libtool
[Top][All Lists]
Advanced

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

Re: Conditional sources in archive libraries


From: Ralf Wildenhues
Subject: Re: Conditional sources in archive libraries
Date: Tue, 30 May 2006 19:36:32 +0200
User-agent: Mutt/1.5.11+cvs20060403

* Liviu Nicoara wrote on Tue, May 30, 2006 at 07:27:22PM CEST:
> 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:

Indeed, my advice was just plain wrong.  :-/

But then you should not add the sources to libfoo_la_DEPENDENCIES, but
its objects, x86.la ..., because that is what the library depends upon.
(And we need to be sure you don't have libfoo_la_CCASFLAGS or similar,
because then Automake will like to rename the object, and you end up
having make execute the wrong rule for your object.)

> > 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?

Yes, but just posting the configure.ac and the Makefile.am should
suffice.

> > 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.

Oh, Makefile.am will just have 

if POWER5
libfoo_la_SOURCES += power5.s
endif
...

But however you like.

Cheers,
Ralf




reply via email to

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