autoconf
[Top][All Lists]
Advanced

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

Re: Using $program_transform_name from ‘configure’


From: Eric Blake
Subject: Re: Using $program_transform_name from ‘configure’
Date: Wed, 23 Apr 2014 17:10:44 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/23/2014 04:49 PM, Ludovic Courtès wrote:
> I’m looking at an instance of the same problem: Guile comes with a
> binary called ‘guild’ that calls out to the ‘guile’ program.
> 
> The approach I implemented some time ago (and which, ahem, happens to be
> broken because of this very issue) is:
> 
>   1. ‘configure’ (erroneously) computes the transformed ‘guile’ program
>       name and substitutes it;
>       http://git.savannah.gnu.org/cgit/guile.git/tree/configure.ac#n1606
> 
>   2. ‘guild.in’ uses that value.
>      http://git.savannah.gnu.org/cgit/guile.git/tree/meta/guild.in#n5

I don't see an AC_CONFIG_FILES() in configure.ac that tries to create
guild solely at configure time.  Therefore, I assume it's being created
at make time - but which Makefile.am is responsible for creating it?
_That_ rule would be the place to run $program_transform_name as part of
the creation process, rather than trying to shoehorn the conversion into
configure.ac.

>> Off-hand, I _think_ what you want is something that mirrors what the
>> gnulib 'configmake' module is able to do - it propagates the value of
>> ${srcdir} and friends into a "configmake.h" header created at make time,
>> which is then compiled into the C code so that the program can learn the
>> values that were chosen at configure-time and/or overridden at make
>> time.  It sounds like exposing the transformed program name via a make
>> rule that runs $program_transform_name and feeds the .h file for use by
>> the rest of the program would give your C code introspective access into
>> the transformed name it will be installed as.
> 
> Doesn’t seem easily transposed to the situation above.

Still seems like the right way to go.  Observe how the automake project
does things.  First, it sets up a convenience macro for building a file
with make-time substitution by using config.status for the easy
conversions that configure.ac could provide and make syntax for the
remaining conversions:

http://git.savannah.gnu.org/cgit/automake.git/tree/Makefile.am#n41

then uses that macro in several other locations:

http://git.savannah.gnu.org/cgit/automake.git/tree/bin/Makefile.inc#n57
http://git.savannah.gnu.org/cgit/automake.git/tree/lib/Automake/Makefile.inc#n48

>> But your problem statement didn't give me many details to know if I'm
>> on the right track for solving the actual problem you are facing.
> 
> Sorry about that, I hope it’s clearer now.

Yep, and I hope my ideas have been helpful in return.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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