libtool
[Top][All Lists]
Advanced

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

Conditional sources in archive libraries


From: Liviu Nicoara
Subject: Conditional sources in archive libraries
Date: Tue, 30 May 2006 10:59:53 -0600
User-agent: Thunderbird 1.5 (X11/20051201)

Hi all,

I am trying to conditionally compile [assembly] sources for my archive
library. I initially tried:

## Makefile.am:

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = main.cpp
EXTRA_libfoo_la_SOURCES = x86.s x86_64.s power5.s
libfoo_la_LIBADD = $(MY_EXTRA_SOURCES)
libfoo_la_DEPENDENCIES = $(MY_EXTRA_SOURCES)

(I may be wrong about minute details here - I am quoting the code from
memory.)

where MY_EXTRA_SOURCES are platform-specific assembly (.s) files,
AC_SUBST'ed from autoconf.

When I make after configure'ing:

$ ./configure --disable-shared ...

in order to create an archive library I see that the extra objects from
MY_EXTRA_SOURCES are not archived together with the rest of the object
files. However, I see the invocation of libtool has all the files on the
command line; only the subsequent invocation of the archiver (ar) is
missing the extra object files making it look as if libtool has chosen
to skip those files when it invoked ar.

This problem does not occur in shared builds - all object files end up
in the library, as expected.

The workaround for me was to use AM_CONDITIONALs and that worked pretty
good. But using AM_CONDITIONALs is not as nice as AC_SUBST'ing from
autoconf. Does anyone know why it's not working (as detailed in automake
manual, the libtool library, section 7.3.4)?

Thanks,
Liviu




reply via email to

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