mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
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
31 lines
844 B
Makefile
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)"
|