automake
[Top][All Lists]
Advanced

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

Re: Troubles with conditional adding files to library


From: Russ Allbery
Subject: Re: Troubles with conditional adding files to library
Date: Thu, 26 Mar 2009 21:38:16 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

"Gerald I. Evenden" <address@hidden> writes:
> On Thursday 26 March 2009 10:26:13 pm Russ Allbery wrote:

>> However, more fundamentally, you're reinventing AC_REPLACE_FUNC, which
>> you probably don't want to do.  Check the Autoconf manual for
>> AC_REPLACE_FUNC, which does exactly what you're trying to do, even down
>> to how it adds additional source files to a variable that you can use
>> in Makefile.am.

> I had seen it but, again, I was unsure how it was going to work.  I will
> reread.

AC_REPLACE_FUNC([strcasecmp]) checks whether strcasecmp exists on the
system and, if not, adds it to LIBOBJS and LTLIBOBJS, which you can then
refer to in Makefile.am.  In this case, you'd normally do something like:

libproject_la_LIBADD = $(LTLIBOBJS)

On systems without strcasecmp, the build system will then try to find a
strcasecmp.c file, compile it, and include it in libproject.la.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

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