autoconf-patches
[Top][All Lists]
Advanced

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

Re: Spaces in the checks with ac_unique_file break the program


From: Ralf Wildenhues
Subject: Re: Spaces in the checks with ac_unique_file break the program
Date: Thu, 23 Jun 2005 23:11:39 +0200

Hi Paul, Couple of comments:
Paul Eggert writes:

--- lib/autoconf/general.m4     22 Jun 2005 09:10:50 -0000      1.866
+++ lib/autoconf/general.m4     23 Jun 2005 20:03:13 -0000
@@ -468,13 +468,14 @@ ac_pwd=`pwd` && test -n "$ac_pwd" ||
ac_pat="[[\$][{][_$as_cr_Letters][_$as_cr_alnum]*[}]]" -for ac_dir in "$ac_pwd" "$srcdir" \
-  "$bindir" "$sbindir" "$libexecdir" "$datarootdir" "$datadir" \
-  "$sysconfdir" "$sharedstatedir" "$localstatedir" "$includedir" \
-  "$oldincludedir" "$docdir" "$infodir" "$htmldir" "$dvidir" "$pdfdir" \
-  "$psdir" "$libdir" "$localedir" "$mandir"
+for ac_var in ac_pwd srcdir \
+  bindir sbindir libexecdir datarootdir datadir \
+  sysconfdir sharedstatedir localstatedir includedir \
+  oldincludedir docdir infodir htmldir dvidir pdfdir \
+  psdir libdir localedir mandir
 do
   # Remove references to shell or make variables.
+  eval ac_dir=\$$ac_var
   ac_dirx=$ac_dir
   while :
   do
@@ -494,7 +495,7 @@ do
 '* | *'        '* | *' '* | *\"* | *\#* | *\$* | *\&* | *\'* | *\(* | *\)* | \
   *\** | *\;* | *\<* | *\=* | *\>* | *\?* | *\@<:@* | *\\* | *\`* | \
   *\|* | \~*)
-    AC_MSG_WARN([Directory name `$ac_dir' contains special characters]);;
+    AC_MSG_ERROR([$ac_var directory name `$ac_dir' has special characters]);;

AFAICS, this will break on Tru64, as noted in 'Limitations of Builtins'.
I'd suggest just leaving the warning.
   esac
 done
 m4_divert_pop([PARSE_ARGS])dnl
@@ -509,24 +510,25 @@ m4_define([_AC_INIT_SRCDIR],
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
+  # Try the directory containing this script, then the parent directory.
   ac_confdir=`AS_DIRNAME(["$[0]"])`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
+if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
   AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
   AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work])
+dnl Remove unnecessary trailing slashes from srcdir.
 dnl Double slashes in file names in object file debugging info
 dnl mess up M-x gdb in Emacs.
-srcdir=`echo "$srcdir" | sed 's%\([[^\\/]]\)[[\\/]]*$%\1%'`
+srcdir=`echo "$srcdir" | sed 's%\([[^/]]\)/*$%\1%'`

Why do you think $srcdir cannot contain backslashes here?
I would not be so sure.
 m4_divert_pop([PARSE_ARGS])dnl
 ])# _AC_INIT_SRCDIR
*snip rest*
Regards,
Ralf




reply via email to

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