autoconf
[Top][All Lists]
Advanced

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

Re: generating pc files


From: Russ Allbery
Subject: Re: generating pc files
Date: Thu, 20 Sep 2012 11:08:43 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Bruce Korb <address@hidden> writes:
> On 09/19/12 11:03, Russ Allbery wrote:

>> ...  I believe the method using sed is
>> correct, and generating the file at Autoconf time is not as correct...

> For my perspective, there really ought to be a simple macro that just
> exports all the configured values to whatever external command anyone
> wants to use.  e.g. always have all Makefile-s define this:

> CONFIGURABLES = \
>   prefix="$(prefix)" \
> ....

> so that you can, for example, use this in any directory:

>    $(CONFIGURABLES) $(SHELL) some-script

> and have the right thing happen.

We're probably drifting into Automake territory here, but I would even
take that one step further: wouldn't it be nice if Automake had a standard
facility to do build-time substitution of (fully-expanded) AC_SUBST
variables in a file?  In other words, just create a file with the same
syntax as an AC_OUTPUT file template, but tell Automake to generate it at
build time rather than configure time, and Automake would then take care
of doing the sed for you plus fully expand the variables rather than
leaving them unexpanded the way that config.status does (and has to, to
permit build-time changes to ${prefix}).

That doesn't entirely replace your idea, since your idea would permit
making decisions and using conditionals, but it would certainly be
sufficient for generationg pkg-config files and I suspect it would handle
a number of other cases.

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



reply via email to

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