-
Notifications
You must be signed in to change notification settings - Fork 532
Rename HAVE_CONFIG_H #1872
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
Merged
Merged
Rename HAVE_CONFIG_H #1872
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a bit more checking on this, perhaps we can try out AX_PREFIX_CONFIG_H in the configure.ac.
My AI friend recommended to do this:
AC_CONFIG_HEADERS([config.h:config.hin], [AM_CPPFLAGS="$AM_CPPFLAGS -DCPPUTEST_HAVE_CONFIG_H"])
Which also feels like a hack... but at least a hack in the right place as this really shouldn't be in the am file :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and it only appears to affect the name of the resulting header, not the macro.
I'll need to double check, but I think this only adds the
CPPUTEST_HAVE_CONFIG_Hmacro; it doesn't remove theHAVE_CONFIG_Hmacro which we don't want leaking into other libraries.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't build. I tried
AC_CONFIG_HEADERS([config.h], [AM_CPPFLAGS="$AM_CPPFLAGS -DCPPUTEST_HAVE_CONFIG_H"])and confirmed that defines onlyHAVE_CONFIG_HwithDEFS = -DHAVE_CONFIG_Hin the generated makefile.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for checking. I did some more checking, and I tried the following in the configure.ac:
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([CppUTestGeneratedConfig.h])
In a quick test, that seems to do the trick. But I didn't checked in throughly yet. Could you check that?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that does not work. The name of
HAVE_CONFIG_His hardcoded in autoconf12. I don't think config headers were ever intended to be exposed in libraries' public interfaces.Footnotes
https://www.gnu.org/software/autoconf/manual/autoconf-2.61/html_node/Configuration-Headers.html ↩
https://github.com/autotools-mirror/autoconf/blob/8ac9edd1a71fe24ed94d70f1669e4fd6a81fa585/lib/autoconf/status.m4#L1267 ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the problem comes from building a unit testing framework as library.
I'd like to merge this then, but probably need a bit of a comment to it to explain what is happening, why, and a tip that if we find a better version to then remove this. Will you give that a try or shall I add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem. see 7f9c245