automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AM_CONDITIONAL not working properly, or I just don't understand :-(


From: Gary V. Vaughan
Subject: Re: AM_CONDITIONAL not working properly, or I just don't understand :-(
Date: Mon, 13 Oct 2003 11:33:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3

Kevin P. Fleming wrote:
automake-1.7.8/autoconf-2.57/libtool-1.5

in configure.ac (after all the libtool-related macros but before AC_OUTPUT):

AM_CONDITIONAL(INSTALL_LIBS, test x$enable_shared = xyes)

in Makefile.am:

...
LIBLIST = src/lib/libnALFS.la
LIBLIST += src/handlers/alfs.la
LIBLIST += src/handlers/build.la
LIBLIST += src/handlers/chroot.la
LIBLIST += src/handlers/configure.la
LIBLIST += src/handlers/copy.la
LIBLIST += src/handlers/execute.la
... (more of the same)
if INSTALL_LIBS
INSTALL_LIBLIST = $(LIBLIST)
else
INSTALL_LIBLIST =
endif
if !INSTALL_LIBS
NOINST_LIBLIST = $(LIBLIST)
else
NOINST_LIBLIST =
endif
pkglib_LTLIBRARIES = $(INSTALL_LIBLIST)
noinst_LTLIBRARIES = $(NOINST_LIBLIST)

With this construction, automake complains "src/handlers/alfs.la is already going to be installed in 'noinst'" (for each library). All _SOURCES/_LDFLAGS/etc. variables for these libraries appear after this set of lines (I have tried them before and after, no difference). I have tried setting pkglib_LTLIBRARIES and noinst_LTLIBRARIES _directly_ inside the conditional (instead of using intermediate variables), but that didn't help.

This is about the fourth attempt at constructing this logic; I need to _always_ build these libraries, but only install them if the user asked them to be built shared (for a static build, they will be subsumed into the main binary and don't need to be installed). Am I missing something? This seems to be a valid thing to try, but I can't get automake to accept it.

Actually, you *do* need to install the libraries even if they are linked into the program statically because libltdl looks up the pseudolibrary (.la) in the module directory to get metadata about (even preloaded) modules. Fixing this is on the TODO list, but it is quite a big job and probably won't be fixed soon.

Cheers,
        Gary.
--
  ())_.  Gary V. Vaughan    gary@(lilith.warpmail.net|gnu.org)
  ( '/   Research Scientist http://www.oranda.demon.co.uk       ,_())____
  / )=   GNU Hacker         http://www.gnu.org/software/libtool  \'      `&
`(_~)_   Tech' Author       http://sources.redhat.com/autobook   =`---d__/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]