This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Conditional modules and libraries.
- From: Bill Moseley <moseley at hank dot org>
- To: automake at gnu dot org
- Date: Wed, 26 Mar 2003 14:02:43 -0800 (PST)
- Subject: Re: Conditional modules and libraries.
On Wed, 26 Mar 2003, Alexandre Duret-Lutz wrote:
> [mfu2: automake at gnu dot org]
Ok, although sending mail to automake-request at gnu dot org doesn't indicated
that I'm confirmed.[see below]
Thanks for all the references. That helps. And thank you very much for
responding.
BTW -- automake 1.4-p4 autoconf 2.57.
> To set per-library CPPFLAGS and LDFLAGS, use
> libswishindex_la_LDFLAGS and libswishindex_la_CPPFLAGS. These
> are documented here.
> http://sources.redhat.com/automake/automake.html#Program%20and%20Library%20Variables
I tried that before, and fell back to AM_CPPFLAGS. Perhaps I'm missing
the point:
If I try:
noinst_LTLIBRARIES = libswishindex.la
libswishindex_la_LIBADD = sw_expat/libswexpat.la $(LIBXML2_OBJS)
libswishindex_la_LDFLAGS = $(LIBXML2_LIB)
libswishindex_la_CPPFLAGS = $(LIBXML2_CFLAGS)
libswishindex_la_DEPENDENCIES = $(LIBXML2_OBJS)
EXTRA_libswishindex_la_SOURCES = parser.c parser.h
libswishindex_la_SOURCES = \
fs.c fs.h \
http.c http.h \
...
The flags are set:
~/swish-e/src$ fgrep LIBXML2_CFLAGS Makefile
LIBXML2_CFLAGS = -I/usr/include/libxml2/libxml -I/usr/include/libxml2
libswishindex_la_CPPFLAGS = $(LIBXML2_CFLAGS)
But when building the LIBXML2_CFLAGS are not passed to gcc:
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wp,-MD,.deps/parser.pp -c parser.c
-fPIC -DPIC -o .libs/parser.lo
parser.c:67: libxml/HTMLparser.h: No such file or directory
parser.c:68: libxml/xmlerror.h: No such file or directory
parser.c:69: libxml/uri.h: No such file or directory
~/swish-e/src$ fgrep libswishindex_la_CPPFLAGS Makefile
libswishindex_la_CPPFLAGS = $(LIBXML2_CFLAGS)
The second method of conditionals looks ok, but if I have multiple options
it might require a lot of "elses".
> Bill> By the way, how can I force the complete rebuiding of just one
> Bill> (convenience) library without rebuilding everything?
>
> You can use sub-directories to make partial cleaning easier or
> write your own clean rule. I fail to see why you want to do
> that, though (hidden dependencies?)
If I update Makefile.am, then run ./bootstrap && ./configure && make the
library is not rebuilt. I guessed that there would be dependency on the
Makefile.
Thanks,
--
This is the reply I get from automake-request at gnu dot org:
Date: Wed, 26 Mar 2003 16:24:38 -0500
From: automake-bounces at gnu dot org
To: moseley at hank dot org
Subject: The results of your email commands
Parts/Attachments:
1 Shown 9 lines Text
2 Shown 771 bytes Message
2.1 Shown 6 lines Text
----------------------------------------
The results of your email command are provided below. Attached is your
original message.
- Unprocessed:
Bill Moseley moseley at hank dot org
- Done.
[ Part 2: "Included Message" ]
Date: Wed, 26 Mar 2003 13:21:21 -0800 (PST)
From: Bill Moseley <moseley at hank dot org>
To: automake-request at gnu dot org
--
Bill Moseley moseley at hank dot org
--
Bill Moseley moseley at hank dot org