This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Conditionals in Makefile.am
- From: Alexandre Duret-Lutz <duret_g at lrde dot epita dot fr>
- To: Filip Kaliński <filon at pld dot org dot pl>
- Cc: automake at gnu dot org
- Date: Wed, 12 Jun 2002 09:48:41 +0200
- Subject: Re: Conditionals in Makefile.am
- References: <20020611161400.GA9259@sokrates.mimuw.edu.pl>
>>> "Filip" == Filip Kaliński <filon@pld.org.pl> writes:
Filip> I have AM_CONDITIONAL(ENABLE_BAR, ... ) in configure.in
Filip> and I want to have
Filip> if ENABLE_BAR
Filip> lib_LTLIBARAIES=libfoo.la
Filip> libfoo_la_LDADD=-lbaz
Filip> ...
Filip> else
Filip> noninst_LTILIBRARIES=libfoo.la
Filip> ...
Filip> endif
Filip> in Makefile.am, but it doesn't work, automake wants to
Filip> define both of ..._LTLIBRARIES and screams that it is
Filip> alredy defined (while parsing second) :-(
This looks like a bug.
Filip> Does anyone know how to solve it?
I think you can workaround Automake as follows (untested):
EXTRA_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = ...
if ENABLE_BAR
lib_LTLIBRARIES = @LIBFOO1@
libfoo_la_LIBADD = -lbaz
libfoo_la_LDFLAGS = -rpath $(libdir)
else
noinst_LTLIBRARIES = @LIBFOO2@
endif
and add
AC_SUBST([LIBFOO1], [libfoo.la])
AC_SUBST([LIBFOO2], [libfoo.la])
to your configure.ac.
--
Alexandre Duret-Lutz