[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AM_CPPFLAGS vs. [lib]_CPPFLAGS
From: |
Bill Moseley |
Subject: |
AM_CPPFLAGS vs. [lib]_CPPFLAGS |
Date: |
Sun, 13 Apr 2003 13:34:57 -0700 (PDT) |
I'm making an convenience library like the following. Note the *_CPPFLAGS
noinst_LTLIBRARIES = libswishindex.la
libswishindex_la_LIBADD = expat/libswexpat.la $(LIBXML2_OBJS)
replace/libreplace.la
libswishindex_la_LDFLAGS = $(LIBXML2_LIB) $(Z_LIBS) $(PCRE_LIBS)
libswishindex_la_CPPFLAGS = $(LIBXML2_CFLAGS) $(Z_CFLAGS) $(PCRE_CFLAGS)
-Ireplace
libswishindex_la_DEPENDENCIES = $(libswishindex_la_LIBADD)
EXTRA_libswishindex_la_SOURCES = parser.c parser.h
In the same Makefile.am I'm building two other libraries and a binary from
those libraries.
I was finding that I was repeating the *_CPPFLAGS for each library so I
thought it would clean things up to use a global AM_CPPFLAGS instead and
not use the program or library specific CPPFLAGS
But if I simply rename libswishindex_la_CPPFLAGS to AM_CPPLFAGS then I
get:
make[3]: *** No rule to make target `libswishindex_la-parser.lo', needed by
`libswishindex.la'. Stop.
"parser.lo" is conditionally added in the configure script.
LIBXML2_OBJS="libswishindex_la-parser.lo"
AC_SUBST(LIBXML2_OBJS)
Here's a comparison of the gcc line using the two *_CPPFLAGS:
This one is using libswishindex_la_CPPFLAGS and works fine:
gcc [...] -c ../../swish-e/src/docprop_write.c
-Wp,-MD,.deps/libswishindex_la-docprop_write.TPlo -o
libswishindex_la-docprop_write.o >/dev/null 2>&1
This one is using AM_CPPFLAGS and blows up
gcc [...] -c ../../swish-e/src/docprop_write.c -Wp,-MD,.deps/docprop_write.TPlo
-o docprop_write.o >/dev/null 2>&1
I know (from guessing) I can fix by changing my configure.in to use:
LIBXML2_OBJS="parser.lo"
But I don't understand why. Is this expected behavior?
--
Bill Moseley address@hidden
- AM_CPPFLAGS vs. [lib]_CPPFLAGS,
Bill Moseley <=