Hi, On Mon, Jan 10, 2005 at 04:32:51PM +0100, Andreas Schwab wrote: > Stepan Kasal <kasal@xxxxxx> writes: > > > + ac_define_dir=`eval echo "\"[$]$2\""` > > + ac_define_dir=`eval echo "\"[$]ac_define_dir\""` > > In this case the quotes are not necessary because assignments are not word > splitted. Both `eval' and `echo' do word-splitting. So both pairs of quotes are needed. (My terminology may be wrong, but my tests show you need the quotes.) > But it can be further simplified: > > eval ac_define_dir=\"[$]$2\" > eval ac_define_dir=\"[$]ac_define_dir\" You are right, bu you need to quote more: eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"[$]ac_define_dir\"" I use the following to test: a='a $b' # double space b='b $c' c='c $d' d='d $e' e='e $f' eval x="\"$a\""; echo "$x" eval x="\"$a\""; echo "$x" Updated patch attached. Stepan Kasal
2005-01-10 Stepan Kasal <kasal@xxxxxx> * legacy/misc/ac_define_dir.m4: Simplify the assignments, add quoting to handle spaces in values correctly, use AC_SUBST/2, remove unnecessary `ifelse'. Index: legacy/misc/ac_define_dir.m4 =================================================================== RCS file: /cvsroot/ac-archive/ac-archive/legacy/misc/ac_define_dir.m4,v retrieving revision 1.4 diff -u -r1.4 ac_define_dir.m4 --- legacy/misc/ac_define_dir.m4 28 Oct 2003 22:50:09 -0000 1.4 +++ legacy/misc/ac_define_dir.m4 10 Jan 2005 15:42:56 -0000 @@ -20,11 +20,8 @@ AC_DEFUN([AC_DEFINE_DIR], [ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo [$]$2` - ac_define_dir=`eval echo [$]ac_define_dir` - $1="$ac_define_dir" - AC_SUBST($1) - ifelse($3, , - AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), - AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"[$]ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) ])
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf