Subject: should a space really be a "special character" ?
From: Brendan Kehoe <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Thu, 30 Jun 2005 22:01:39 +0100

I bumped into an annoying little bug in automake 1.9.1 when I tried to
configure a tree while sitting in a Cygwin shell.  When I invoke
./configure I get a wild message:

    % pwd
    /cygdir/c/Documents and Settings/joehacker/bld
    % ./configure
    ...
    checking whether build environment is sane... yes
    /bin/sh: /cygdir/c/Documents: No such file or directory
    configure: WARNING: `missing' script is too old or missing

So after first making the tweak to my local configure script, I found if
I just change automake to use quotes around $am_aux_dir in
automake/m4/missing.m4 like

     test x"${MISSING+set}" = xset || MISSING="\${SHELL}
\"$am_aux_dir\"/missing"

it fixes it.  Then I checked out autoconf and automake from CVS to come
up with a diff for a patch, and created an automake test for it.  When I
ran the test, though, it failed.  It's now saying

    configure: error: ac_pwd directory name `/cygdir/c/Documents and
Settings/joehacker/bld' has special characters

Hrm.  I looked for this, and found it in autoconf's
lib/autoconf/general.m4 with _AC_INIT_DIRCHECK:

  # 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

Heh, I also just looked in the ChangeLog and noticed Paul's only checked
it in a week ago.  Great timing. :)

I think the single space ' ', at least, should be allowed.  The most
important reason is for Cygwin, MinGW, and Mac OS X users to be able to
configure things and install free software.  For each, the common home
directories of
   /cygdir/c/Documents and Settings/user/bld/
and
  /Users/Joe Smith/bld/
are examples where configure scripts will refuse to run, but not for any
real reason except this worry that a space may mess something up. 
Before last week's checkin, they'd run but give that funky message and
set am_missing_run to nothing, preventing scripts from working around
some of the more common missing bits.

Thus I the one example where missing.m4's AM_MISSING_HAS_RUN needed a
tweak to not assume the variable $am_aux_dir can go without quotes to
contain it.  There may be some other places that still need correction,
but I believe it's more worthwhile to allow such a directory path and
fix any problems that show up.  I've now got a 650k configure script
(cough, we'll talk about that later) that runs just fine having made
that single missing.m4 fix.  I'm reasonable confident that a large
amount of what's in autoconf & automake is already reasonably safe for
such a change, but still gaining the benefit from all of _AC_INIT_DIRCHECK.

Thoughts?

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.  Yet try as I might, googling my head off, I can't seem to find
any evidence of it being cited as a bug or discussed.

All the best,
B
P.S. I've just noticed that autoconf/aclocal.m4 also holds
AM_MISSING_HAS_RUN.  Why?  To avoid dependencies?

--
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/