GNOME Bugzilla – Bug 519794
Un-necessary to pass -I flags to linker
Last modified: 2008-07-01 21:07:00 UTC
Several Makefile.am pass -I flags in various *CFLAGS variables. However, CFLAGS is passed both to the compiler (.c -> .o) and also to the linker (where -I is irrelevant). The *CPPFLAGS (or INCLUDES) is designed and documented to be used for compiler flags such as -I, as these variables are not passed to the linker.
More importantly (i.e., functional, not just cosmetic), *CPPFLAGS defined in Makefile.am is passed before CPPFLAGS from user's shell environment, whereas CFPAGS is passed after user's CPPFLAGS. If a user passes global -I flags, that means the compiler will get global -I before local ones, and headers from an installed libbabl (which may be broken) or other library entirely might mask the expected ones from the build dir.
Created attachment 106349 [details] [review] first of several patches to fix various occurrances
In the extensions/ subdir, it's even worse than that...it's actually completely *ignoring* some of the user's shell vars (CPPFLAGS). Why is there so much hand-coding of compiler commands here instead of using existing tools?
Created attachment 106437 [details] [review] Retain normal configure shell envs and their correct precedence
The reason for the amount of handcoding of commands is the use of wildcards, though discouraged it provides a very nice environment to develop and protoype the plugins in. Adding a new .c file is all that is needed and it is automatically integrated in the build process. integrated in the build process.