Files
gnucash/lib/libc/Makefile.am
T
Christian Stimming 60c32fd16b 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

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17655 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-10-25 20:30:47 +00:00

31 lines
844 B
Makefile

noinst_LTLIBRARIES = libc-missing.la
# All header files must be listed.
noinst_HEADERS = \
localtime_r.h setenv.h strptime.h pow.h
# No sources should be listed.
libc_missing_la_SOURCES = libc-missing-noop.c
EXTRA_libc_missing_la_SOURCES = localtime_r.c setenv.c strptime.c
# This will automatically be filled in with the necessary object file
# names. Configure does this based upon the AC_REPLACE_FUNCS macros.
LIBOBJS = @LIBOBJS@
LTLIBOBJS = $(shell echo "$(LIBOBJS)" | sed '@LIBOBJS_SEDSCRIPT@' | \
sed 's,\.[^.]* ,.lo ,g;s,\.[^.]*$$,.lo,')
libc_missing_la_LIBADD = $(LTLIBOBJS)
if OS_WIN32
AM_CPPFLAGS = -DOS_WIN32
endif
# Not currently used. If added to AC_REPLACE_FUNCS then this line
# should be removed.
EXTRA_DIST = scm_strptime.c
print_libobjs: Makefile
@echo "LIBOBJS = $(LIBOBJS)"
@echo "LTLIBOBJS = $(LTLIBOBJS)"