GNOME Bugzilla – Bug 464517
Bad -I flag-ordering
Last modified: 2007-08-08 00:06:03 UTC
During the compiling of passepartout-0.7.0, I see some local -I flags are appearing after some global ones (-I. after ones for installed external support libraries). That's bad: if I happen to have installed a .h from some other random package with the same name as the local one, #including it will get the "wrong" one. The problem is a general misuse of *_CXXFLAGS to pass local -I flags in various Makefile.am: sometimes -I are placed after pkgconfig-derived global ones explicitly. More generally, _CXXFLAGS isn't the right place for these flags at all: ./configure --help and the automake documentation agree that _CPPFLAGS is the place for -I flags.
In addition, src/util/Makefile.am over-rides CXXFLAGS, a variable that is documented to be reserved for the user (i.e., Makefile.am must not over-ride it without Very Good Reasons). Seems like the goal is to have one set of flags for all targets created by that Makefile.am and an additional set of flags for specific targets? The AM_* variables are the ones for Makefile.am to pass flags to all targets. These are used when there are is target-specific variable. So if you want both the general flags for all targets and also target-specific ones, you simply list one variable within the other.
Created attachment 93254 [details] [review] Lots of -I flag fixes
Created attachment 93256 [details] [review] Lots of -I flag fixes (fixed)
2007-08-08 Sven Herzberg <herzi@gnome-de.org> * src/fonts/Makefile.am, * src/pptout/Makefile.am, * src/pptout/document/Makefile.am, * src/pptout/widget/Makefile.am, * src/ps/Makefile.am, * src/testbed/Makefile.am, * src/util/Makefile.am, * src/xml2ps/Makefile.am: committed lots of CPPFLAGS fixes (closes: #464517); patch by dmacks@netspace.org