-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoconf config.h #31
Comments
I wonder if we're trying to generalize too much here. I included PROJECT_NAME, VERSION_MAJOR etc. in ImageStream.h.in, but the only thing really needed is IMAGESTRUCT_VERSION, right? So maybe just have that in ImageStream.h.in and then nothing else gets redefined. I can push a quick update with this. What do you think, @DasVinch ? |
So far so good, since we compile and run. So no rush in fixing just yet I'd say. But the same issue will arise if you try to include/link a 3rd party using milk as a dependency and using the same config.h autogen structure. Which is also what you were trying to address with the pkg_config standardization you PR'd? |
Phew, that's great. I've now pulled the updated dev branches for both and I can confirm it.
I think the issue only arises in the case where one project is included as a subfolder / submodule of a different project, as is the case with ImageStreamIO and milk. In this case, they are both built together and during the build these variables keep getting redefined. In the case of my PR I am including milk as a dependency in the Another solution I can think of is to include the project name in the definitions for the overlapping variables. So instead of |
But that does mean that your project |
Apologies for the slow reply, @DasVinch. What were your thoughts on the explicit namespace separation (e.g. A variation on that would be to keep the
|
Oh that header guard is clever! In a hack way :) So I like it. That's a good thing to keep in mind in case we hit a pkg_config snag. |
It's been a while since I did anything with autoconf: is the |
So after making a hot mess with the autoconf system with #30 and milk-org/ImageStreamIO#64.
"config.h" should never be #included from .h files, only from .c files -- it shouldn't be part of a public header (see here: https://stackoverflow.com/questions/7398/how-to-avoid-redefining-version-package-etc)
I mostly resolved that out of ImageStreamIO with milk-org/ImageStreamIO@caeb39b and milk-org/ImageStreamIO@a70528c
Only one place in MILK actually needs the IMAGESTRUCT_VERSION from ISIO, in src/CommandLineInterface/CLIcore/CLIcore_help.c. I've fixed this at 1ee867c with a
#include "ImageStreamIO/ImageStreamIO_config.h"
(in a C file, not H).Now the problem this causes is that CLIcore_help includes both MILK's config.h and ISIO's config.h, which causes symbol redefinition and thus spits the following warning:
Now the clean way to get rid of this would be to get rid of the
#include "config.h"
fromCLIcore.h
. This however break a macroINIT_MODULE_LIB
and functionRegisterModule
that's defined directly in that h file and refers to Milk's versionTo be continued... @stefi07 lmk if you have thoughts on how to be proper there.
The text was updated successfully, but these errors were encountered: