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: Ludovic Courtès
Subject: Re: Using $program_transform_name from ‘configure’
Date: Thu, 24 Apr 2014 00:49:07 +0200
User-agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux)

Eric Blake <address@hidden> skribis:

> On 04/23/2014 10:40 AM, Ludovic Courtès wrote:
>> Hello,
>> 
>> $program_transform_name is apparently meant to be used in makefiles
>
>> 
>> What’s the recommended way to use it in configure.ac?
>
> I'm not sure I follow the end goal.  Why do you think you need to use it
> from within configure.ac?  Are you trying to set up a config.h
> substitution that includes the transformed name that a program will be
> installed under for use within the program?  This is actually one use
> case that I think really DOES make sense - there's discussion on the
> grep mailing list about making 'egrep' a simple C program wrapper around
> 'grep -E', but if 'grep' is installed under a different name due to
> program_transform_name, 'egrep' (or whatever actual name it gets
> installed as) needs to know the transformed name to be exec'd.

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

> One alternative would be to have 'grep' and 'egrep' both be shim
> wrappers, that can be installed under any transformed name, which then
> call ${libexecdir}/grep which gets installed without transform, although
> that feels a bit awkward.

Indeed.

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

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

Thanks,
Ludo’.



reply via email to

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