libtool
[Top][All Lists]
Advanced

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

Re: Conditional sources in archive libraries


From: Liviu Nicoara
Subject: Re: Conditional sources in archive libraries
Date: Tue, 30 May 2006 11:27:22 -0600
User-agent: Thunderbird 1.5 (X11/20051201)

Hi Ralf,

Please see below:

Ralf Wildenhues wrote:
> Hi Liviu,
> * Liviu Nicoara wrote on Tue, May 30, 2006 at 06:59:53PM CEST:
>> ## 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)
> 
> Remove the last two lines and add $(MY_EXTRA_SOURCES) to
> libfoo_la_SOURCES.

If I add them as a substituted variable in _SOURCES automake will complain:

"7.1.3 Conditional compilation of sources

You can't put a configure substitution (e.g., @FOO@ or $(FOO) where FOO
is defined via AC_SUBST) into a _SOURCES variable. The reason for this
is a bit hard to explain, but suffice to say that it simply won't work.
Automake will give an error if you try to do this."

If I add them explicitly the infrastructure build them all. But the
power5.s is supposed to be used only on POWER5 platforms, x86.s only on
32 bit x86, and so on.

> If above hint does not work, then please show the failing code, this
> time quoting from, well, the code, rather than memory, please.  ;-)

:-)
I'll put together a *very* small test case and post it next. Tgz is ok?

> Both should work.  FWIW, I don't reckon conditionals as less "nice" than
> AC_SUBSTed variables.  They allow you to omit the EXTRA_*SOURCES line.

I just feel more comfortable writing sh conditionals in configure.ac
than I feel doing it in Makefile.am.

Thanks.






reply via email to

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