Re: Help with path expansion

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

 



Mike,

On 01/19/2011 11:43 PM, Ralf Wildenhues wrote:
> * Mike Gran wrote on Wed, Jan 19, 2011 at 06:26:24PM CET:
>>     pkgsitedir="$datadir/$PACKAGE_NAME"
>>     AC_MSG_WARN([]
>>        [The modules will be installed in ${pkgsitedir}.])
>>
>> When I run it, I get the text
>>
>>     configure: WARNING:
>>        The modules will be installed in ${datarootdir}/blammo.
>>
>> Is there a way to have this warning output the full path, e.g.
>> for it to say something like
>>
>>        The modules will be installed in /usr/local/share/blammo
> Try
>
> pkgsitedir="$datadir/$PACKAGE_NAME"
> eval "expanded_pkgsitedir=\"$pkgsitedir\""
> eval "expanded_pkgsitedir=\"$expanded_pkgsitedir\""
> AC_MSG_NOTICE([]
>    [The modules will be installed in ${expanded_pkgsitedir}.])
>
> but please don't use the expanded value elsewhere; see the FAQ
>   info Autoconf "Defining Directories"
>
> and references therein.  Hope that helps.
>

I was answering when Ralf's answer came though, so I thought I'd comment
on his solution (which was pretty close to mine anyway). While this
method works, it does have it's problems.

First of all, you need to know how many levels to expand as you're
writing the code in configure.ac.

Second, you should consider that you're being more accurate when you
tell the user they're installing into ${datarootdir}/blammo. The reason
is that the user still has the option of changing the value of
${datarootdir} on the make install command line, which would override
the hard-coded path you want to display from configure:

  $ make datarootdir=/usr/share install

Perhaps a better message would be:

configure: WARNING:
  The modules will be installed by default in /usr/local/share/blammo
(${datarootdir}/blammo).

Regards,
John


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux