r17655 - gnucash/trunk - Bug #514043: Use AM_CPPFLAGS instead of AM_CFLAGS.

Christian Stimming cstim at cvs.gnucash.org
Sat Oct 25 16:30:48 EDT 2008


Author: cstim
Date: 2008-10-25 16:30:47 -0400 (Sat, 25 Oct 2008)
New Revision: 17655
Trac: http://svn.gnucash.org/trac/changeset/17655

Modified:
   gnucash/trunk/lib/glib28/Makefile.am
   gnucash/trunk/lib/libc/Makefile.am
   gnucash/trunk/lib/libqof/backend/file/Makefile.am
   gnucash/trunk/lib/libqof/qof/Makefile.am
   gnucash/trunk/lib/stf/Makefile.am
   gnucash/trunk/packaging/win32/Makefile.am
   gnucash/trunk/src/app-utils/Makefile.am
   gnucash/trunk/src/app-utils/test/Makefile.am
   gnucash/trunk/src/backend/file/Makefile.am
   gnucash/trunk/src/backend/file/test/Makefile.am
   gnucash/trunk/src/backend/postgres/Makefile.am
   gnucash/trunk/src/backend/postgres/test/Makefile.am
   gnucash/trunk/src/bin/Makefile.am
   gnucash/trunk/src/business/business-core/Makefile.am
   gnucash/trunk/src/business/business-core/file/Makefile.am
   gnucash/trunk/src/business/business-core/test/Makefile.am
   gnucash/trunk/src/business/business-gnome/Makefile.am
   gnucash/trunk/src/business/business-ledger/Makefile.am
   gnucash/trunk/src/business/business-utils/Makefile.am
   gnucash/trunk/src/business/dialog-tax-table/Makefile.am
   gnucash/trunk/src/calculation/Makefile.am
   gnucash/trunk/src/core-utils/Makefile.am
   gnucash/trunk/src/engine/Makefile.am
   gnucash/trunk/src/engine/test-core/Makefile.am
   gnucash/trunk/src/engine/test/Makefile.am
   gnucash/trunk/src/experimental/cgi-bin/Makefile.am
   gnucash/trunk/src/gnc-module/Makefile.am
   gnucash/trunk/src/gnc-module/test/Makefile.am
   gnucash/trunk/src/gnc-module/test/misc-mods/Makefile.am
   gnucash/trunk/src/gnc-module/test/mod-bar/Makefile.am
   gnucash/trunk/src/gnc-module/test/mod-baz/Makefile.am
   gnucash/trunk/src/gnc-module/test/mod-foo/Makefile.am
   gnucash/trunk/src/gnome-search/Makefile.am
   gnucash/trunk/src/gnome-utils/Makefile.am
   gnucash/trunk/src/gnome/Makefile.am
   gnucash/trunk/src/import-export/Makefile.am
   gnucash/trunk/src/import-export/binary-import/Makefile.am
   gnucash/trunk/src/import-export/binary-import/test/Makefile.am
   gnucash/trunk/src/import-export/csv/Makefile.am
   gnucash/trunk/src/import-export/hbci/Makefile.am
   gnucash/trunk/src/import-export/log-replay/Makefile.am
   gnucash/trunk/src/import-export/ofx/Makefile.am
   gnucash/trunk/src/import-export/ofx/test/Makefile.am
   gnucash/trunk/src/import-export/qif-import/Makefile.am
   gnucash/trunk/src/import-export/qif-io-core/Makefile.am
   gnucash/trunk/src/import-export/qif-io-core/test/Makefile.am
   gnucash/trunk/src/import-export/qif/Makefile.am
   gnucash/trunk/src/import-export/qif/test/Makefile.am
   gnucash/trunk/src/import-export/test/Makefile.am
   gnucash/trunk/src/register/ledger-core/Makefile.am
   gnucash/trunk/src/register/ledger-core/test/Makefile.am
   gnucash/trunk/src/register/register-core/Makefile.am
   gnucash/trunk/src/register/register-core/test/Makefile.am
   gnucash/trunk/src/register/register-gnome/Makefile.am
   gnucash/trunk/src/register/register-gnome/test/Makefile.am
   gnucash/trunk/src/report/locale-specific/us/Makefile.am
   gnucash/trunk/src/report/report-gnome/Makefile.am
   gnucash/trunk/src/report/report-system/Makefile.am
   gnucash/trunk/src/report/standard-reports/Makefile.am
   gnucash/trunk/src/report/stylesheets/Makefile.am
   gnucash/trunk/src/report/utility-reports/Makefile.am
   gnucash/trunk/src/tax/us/Makefile.am
   gnucash/trunk/src/test-core/Makefile.am
Log:
Bug #514043: Use AM_CPPFLAGS instead of AM_CFLAGS.

AM_CFLAGS is passed both to the compiler (.c -> .o) and to the linker, so it
should only have flags that are appropriate for both steps. AM_CPPFLAGS is
passed only to the compiler, so flags that are only appropriate for that step
(-I and -D flags, for example), should be in _CPPFLAGS instead of _CFLAGS.
Every gnucash-2.2.3 Makefile.am that passes -I flags gets it wrong, placing
them in _CFLAGS. It's not a functional bug (the linker ignores -I flags), but a
ton of superfluous flags makes the build output pretty verbose and hard to
debug when things do go wrong.

To make matters more confusing as a developer, the FOO_CFLAGS variable set by
PKG_CHECK_MODULES(FOO) is actually for _CPPFLAGS in the Makefile.am
('pkg-config --cflags' returns the -I flags).

A related -I bug (one that *is* functionally broken) is that sometimes a local
(build dir) -I flag is passed after a global (installed dependent library) one.
If my system happens to have a header installed from some unrelated thing,
compiler will find *that* one instead of the expected one in the source
directory. Should always pass all local -I before any global ones.

Patch by andi5 plus one manual addition in src/gnome-utils/Makefile.am



More information about the gnucash-patches mailing list