Subject: Re: should a space really be a "special character" ?
From: Paul Eggert <[email-masked]>
To: Brendan Kehoe <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Fri, 01 Jul 2005 15:33:55 -0700

Brendan Kehoe <[email-masked]> writes:

> Thoughts?

I guess this check is causing more trouble than it cures.

> Oh, one thing that's got me mystified is that such a problem like not
> configuring in a directory 'foo bar' could possibly be a real
> outstanding bug, since it'd have to have happened to tons of Cygwin
> users.

Sometimes spaces work; sometimes they don't.  The same thing is true
for lots of other patterns in file names, including:

 " # $ % & ' * @%:@ @&t@ @S|@ \ ` |

as well as tab and newline.  This is true on both Cygwin and on POSIX
hosts.  Autoconf was playing it safe, but I guess it was too safe.

I've just sent off a bug report and patch to Automake-patches
about this; in a day or two it should appear at
<http://lists.gnu.org/archive/html/automake-patches/2005-07/>.

> P.S. I've just noticed that autoconf/aclocal.m4 also holds
> AM_MISSING_HAS_RUN.  Why?  To avoid dependencies?

Yes; someone who's installing Autoconf shouldn't need Automake,
to avoid the usual bootstrapping problems.

To work around the problem I installed the following Autoconf patch.
Thanks for reporting the problem.

2005-07-01  Paul Eggert  <[email-masked]>

	* lib/autoconf/general.m4 (_AC_INIT_DIRCHECK): Remove the tests for
	directories with weird names.  Apparently some people like living
	on the edge.  However, improve the test that "pwd" actually does
	report a name for the working directory.
	* NEWS: Remove the claim that we test for funny chars in dir names.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.343
diff -p -u -r1.343 NEWS
--- NEWS	24 Jun 2005 02:13:39 -0000	1.343
+++ NEWS	1 Jul 2005 22:18:24 -0000
@@ -1,9 +1,5 @@
 * Major changes in Autoconf 2.59c
 
-** The configure command now diagnoses attempts to use a working or source
-  directory whose name contains a special character like space, newline, or "\".
-  Such names are not supported, and can cause "configure" to crash.
-
 ** The configure command now redirects standard input from /dev/null,
   to help avoid problems with subsidiary commands that might mistakenly
   read standard input.  AS_ORIGINAL_STDIN_FD points to the original
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.871
diff -p -u -r1.871 general.m4
--- lib/autoconf/general.m4	1 Jul 2005 08:45:22 -0000	1.871
+++ lib/autoconf/general.m4	1 Jul 2005 22:18:24 -0000
@@ -450,38 +450,13 @@ AC_DEFUN([AC_CONFIG_SRCDIR],
 m4_define([_AC_INIT_DIRCHECK],
 [m4_divert_push([PARSE_ARGS])dnl
 
-ac_pwd=`pwd` && test -n "$ac_pwd" ||
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
   AC_MSG_ERROR([Working directory cannot be determined])
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  AC_MSG_ERROR([pwd does not report name of working directory])
 
-ac_pat="[[\$][{][_$as_cr_Letters][_$as_cr_alnum]*[}]]"
-ac_pat1='*[)]*'
-
-for ac_var in ac_pwd srcdir
-do
-  # Remove references to shell or make variables.
-  eval ac_dir=\$$ac_var
-  ac_dirx=$ac_dir
-  while :
-  do
-    case $ac_dirx in
-    *\${*}*)
-      ac_dirx=`
-	expr "X$ac_dirx" : "X\\(.*\\)$ac_pat"`X`
-	expr "X$ac_dirx" : "X.*$ac_pat\\(.*\\)"`;;
-    *) break;;
-    esac
-  done
-
-  # Check for newline, tab, space, and other weird possibilities.
-  # Preserve that tab character below!
-  case $ac_dirx in
-  '' | -* | */-* | *'
-'* | *'	'* | *' '* | *\"* | *\#* | *\$* | *\&* | *\'* | *\(* | $ac_pat1 | \
-  *\** | *\;* | *\<* | *\=* | *\>* | *\?* | *\@<:@* | *\\* | *\`* | \
-  *\|* | \~*)
-    AC_MSG_ERROR([$ac_var directory name `$ac_dir' has special characters]);;
-  esac
-done
 m4_divert_pop([PARSE_ARGS])dnl
 ])# _AC_INIT_DIRCHECK
 
@@ -512,7 +487,9 @@ fi
 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%'`
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
 m4_divert_pop([PARSE_ARGS])dnl
 ])# _AC_INIT_SRCDIR

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/