Subject: Re: bug#15675: the configure script invoked before make

From: Andy Moreton <[email-masked]>
Date: Thu, 24 Oct 2013 02:12:17 +0100

On Wed 23 Oct 2013, Glenn Morris wrote:

> Version: 24.4
>
> “Adrian” wrote:
>
>> Downloaded and put the emacs24.3 sources in a directory whose name
>> contained 1 space. The configure script seemed not able to interpret
>> the directory name properly, as it could only grasp the word
>> preceeding the space in the directory name. I verified that this was
>> the problem, as i changed the directory name to contain no spaces and
>> the configure script ran beautifully.
>
> In Emacs trunk, building in directories whose name contains space should
> now work. (Installing into such a directory probably still doesn't work.)

The changes to support this break doing an out of tree build using
MSYS/MinGW.

I have been trying to build from bzr r114764, with the source tree at
"c:\emacs\src\emacs\trunk", and building in an "obj-mingw32" subdir.

Building in "obj-mingw32/lib" fails because CPP and CPPFLAGS still have
"-I ../nt/inc", which should either be "-I ../../nt/inc" (relative to
"obj-mingw32") or be absolute.

My attempts to patch configure.ac to fix this resulted in a configure
script which complained about missing ACl libraries (which is normally
handled by trunk/nt/mingw-config.site).

As I am inexpert in autotools, I instead tried to work around this by
adding the absolute path to "trunk/nt/inc" to CPPFLAGS on the configure
command line (generated from unmodified configure.ac). This got further,
but failed building lisp:

------------------------------------------------------------------
cd ../lisp; /usr/bin/make -w update-subdirs
make[2]: Entering directory `/c/emacs/src/emacs/trunk/obj-mingw32/lisp'
cd ../../lisp; subdirs=`find . -type d -print`; for file in $subdirs; do case $file in */.* | */.*/* | */=* | */cedet* ) ;; *) wins="$wins${wins:+ }$file" ;; esac; done; \
        for file in $wins; do \
           ../../build-aux/update-subdirs $file; \
        done;
/bin/sh: line 2: ../../build-aux/update-subdirs: No such file or directory
/bin/sh: line 2: ../../build-aux/update-subdirs: No such file or directory
------------------------------------------------------------------

The for loop runs from trunk/lisp, so the path to trunk/build-aux is wrong.
In addition, this use of find and a for loop does not look correct for
directory paths with spaces.

Let me know if you need any help with testing, build logs etc.

    AndyM