-
Notifications
You must be signed in to change notification settings - Fork 535
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
base: master
Are you sure you want to change the base?
Rename HAVE_CONFIG_H #1872
Conversation
| check_PROGRAMS = $(CPPUTEST_TESTS) | ||
|
|
||
| # Change autoconf's hard-coded (and collision susceptible) HAVE_CONFIG_H macro. | ||
| DEFS = $(filter-out -DHAVE_CONFIG_H,@DEFS@) -DCPPUTEST_HAVE_GENERATED_CONFIG_H |
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 :)
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.
I tried this and it only appears to affect the name of the resulting header, not the macro.
My AI friend recommended to do this:
AC_CONFIG_HEADERS([config.h:config.hin], [AM_CPPFLAGS="$AM_CPPFLAGS -DCPPUTEST_HAVE_CONFIG_H"])
I'll need to double check, but I think this only adds the CPPUTEST_HAVE_CONFIG_H macro; it doesn't remove the HAVE_CONFIG_H macro which we don't want leaking into other libraries.
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.
My AI friend recommended to do this:
AC_CONFIG_HEADERS([config.h:config.hin], [AM_CPPFLAGS="$AM_CPPFLAGS -DCPPUTEST_HAVE_CONFIG_H"])
That doesn't build. I tried AC_CONFIG_HEADERS([config.h], [AM_CPPFLAGS="$AM_CPPFLAGS -DCPPUTEST_HAVE_CONFIG_H"]) and confirmed that defines only HAVE_CONFIG_H with DEFS = -DHAVE_CONFIG_H in 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?
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.
63949e6 to
8679b2d
Compare
Address #1829.
I know roughly nothing about autoconf, so please double check my work.