autoconf
[Top][All Lists]
Advanced

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

Re: Forcing complete expansion of a PATH variable


From: Tim Van Holder
Subject: Re: Forcing complete expansion of a PATH variable
Date: Thu, 24 Apr 2003 09:05:14 +0200

> > The code at http://ac-archive.sf.net/Miscellaneous/ac_subst_dir.html
> > says:
> > 
> >     AC_DEFUN([AC_SUBST_DIR], [
> >             ifelse($2, , $1, $1="[$]$2")
> >             $1=`(
> >                 test "x$prefix" = xNONE && 
> prefix="$ac_default_prefix"
> >                 test "x$exec_prefix" = xNONE && 
> exec_prefix="${prefix}"
> >                 eval echo \""[$]$1"\"
> >             )`
> >             AC_SUBST($1)
> >     ])
> > 
> > Try this instead:
> > 
> >     AC_DEFUN([AC_SUBST_DIR], [
> >             ifelse($2,,,$1="[$]$2")
> >             $1=`(
> >                 test "x$prefix" = xNONE && 
> prefix="$ac_default_prefix"
> >                 test "x$exec_prefix" = xNONE && 
> exec_prefix="${prefix}"
> >                 eval echo \""[$]$1"\"
> >             )`
> >             AC_SUBST($1)
> >     ])
> > 
> > - Hari
> 
> spot the difference :-)=) ... the whitespace in the ifelse, right?

No, the $1 in the ifelse.

> I am modifying the macro in the ac-archive, plus sending a message
> to the author given for that macro. I wonder why that was never a
> problem before. Well, anyways, let's have that fixed. -- guido

Because most people will use

AC_SUBST_DIR(MUSICPATH, musicpath)

i.e. SUBST the expansion of the path in $musicpath as MUSICPATH

Because the second argument was omitted here (resulting in a lowercase
#define I'd expect - which is what you normally wouldn't want), the
bug was hit.





reply via email to

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