[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Win32 neon build error (Spaces in path)

From: Jon Foster <jon_at_jon-foster.co.uk>
Date: 2004-05-02 02:39:02 CEST


Branko Čibej wrote:
> Jon Foster wrote:
>> Hi,
>> D.J. Heap wrote:
>> > Can you try fixing it with quoting and posting a patch?
>> I tried, but I now believe it's impossible. The Neon makefile is
>> just too broken.
> I'd be interested to know how, since I wrote that makefile. :-) Do
> please post the patches here, as I'm not on the Neon mailing list.

Oh :-)

>> I just posted a couple of patches to the Neon
>> list; if they get accepted then I'll provide the corresponding
>> fixes to Subversion.
> I admit that I didn't bother to make sure that paths with spaces in them
> work with that makefile. What kind of quoting did you try before giving
> up? It's a fact that getting quoted parameters into a script is
> sometimes even harder in Windows batch files than in Unix shell
> scripts... but I can't believe it can't be done.
> -- Brane

Here is the message I sent to the Neon list:
> I'm trying to build Subversion on Windows. This uses Neon.
> I've got a space in the name of the folder I'm using to build
> everything, and this seems to be causing some problems for
> Neon's makefile.
> Here is how I am invoking Neon's make, which causes it to fail:
[The following is an extract from build_neon.bat]
>> set ZLIB_SRC=D:\My Documents\Jon\Prog\Subversion\Work\Subversion\common\zlib
>> set OPENSSL_SRC=D:\My Documents\Jon\Prog\Subversion\Work\Subversion\common\openssl
>> set EXPAT_FLAGS=/I "D:\My Documents\Jon\Prog\Subversion\Work\Subversion\apr-util/xml/expat/lib" /D HAVE_EXPAT /D HAVE_EXPAT_H
>> cd ..\..\neon
>> nmake /nologo /f neon.mak ALL DEBUG_BUILD=Aye
> If I set the variables so the paths do not contain spaces, it works:
>> set ZLIB_SRC=D:\MyDocu~1\Jon\Prog\Subversion\Work\Subversion\common\zlib
>> set OPENSSL_SRC=D:\MyDocu~1\Jon\Prog\Subversion\Work\Subversion\common\openssl
>> set EXPAT_FLAGS=/I D:\MyDocu~1\Jon\Prog\Subversion\Work\Subversion\apr-util/xml/expat/lib /D HAVE_EXPAT /D HAVE_EXPAT_H
>> cd ..\..\neon
>> nmake /nologo /f neon.mak ALL DEBUG_BUILD=Aye
> There are two problems here:
> (1) OPENSSL_SRC is expanded without being enclosed in quotes, e.g.:
>> LIB32_OBJS = $(LIB32_OBJS) $(OPENSSL_SRC)\out32dll\libeay32.lib \
>> $(OPENSSL_SRC)\out32dll\ssleay32.lib
> This needs to be changed to:
>> LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32\libeay32.lib" \
>> "$(OPENSSL_SRC)\out32\ssleay32.lib"
Note that I can't just quote the value passed to OPENSSL_SRC before
passing it to the Neon makefile, as that causes a problem similar
to (2) below. Also, everywhere else in the Neon makefile quotes
filenames like this already, it just seems to have been missed here.

> (2) EXPAT_FLAGS is tested by expanding it inside quotes - i.e.:
>> !IF "$(EXPAT_FLAGS)" == ""
> If EXPAT_FLAGS contains quotes, then this does not work. The quotes
> in EXPAT_FLAGS are essential - if I remove them, then the flags are
> parsed wrongly by the C compiler. The only solution I could come up
> with was to change the test like this:
> Which doesn't quite test the same thing but is close enough. (Setting
> EXPAT_FLAGS="" will cause the original test to return TRUE but the new
> test to return FALSE).

Patch attached as "neon-spaces-fix.patch", against Neon 0.24.5.

I then sent another e-mail with an incremental improvement:
> While writing my previous patch, I noticed that Subversion
> is calling the Neon makefile in an overly complex way, and
> a small change to the Neon makefile would make things much
> easier for Subversion. It would also make Subversion much
> more resistent to changes in Neon - currently it has to
> know details of what #defines Neon uses internally.
> To quote the batch file in Subversion that calls Neon's
> makefile:
>> @rem The normal compilation of Neon on Windows is designed to compile
>> @rem and link against the pre-compiled Windows binary Expat
>> @rem installation and uses the EXPAT_SRC command line parameter to
>> @rem 'nmake /f neon.mak' to specify where this binary installation
>> @rem resides. However, here, Neon is instructed to compile and link
>> @rem against the Expat packages with APR, and the EXPAT_FLAGS
>> @rem parameter must be used instead of EXPAT_SRC.
>> set EXPAT_FLAGS=/I D:\Wherever\apr-util/xml/expat/lib /D HAVE_EXPAT /D HAVE_EXPAT_H
> It would be much easier if Neon provided an option that
> specifies the location of the directory which contains the
> Expat include files. Then Subversion could just do:
>> set EXPAT_INC=D:\Wherever\apr-util/xml/expat/lib
> The attached patch does just that.

Patch attached as "neon-expat-inc-path.patch", apply on top of the
first patch.

Kind regards,


--- neon-0.24.5/neon.mak 2003-03-26 19:12:12.000000000 +0000
+++ neon/neon.mak 2004-05-01 17:57:33.375000000 +0100
@@ -17,7 +17,7 @@
 # support.
 !IF "$(EXPAT_SRC)" == ""
-!IF "$(EXPAT_FLAGS)" == ""
@@ -99,11 +99,11 @@
 !IF "$(OPENSSL_SRC)" != ""
 LIB32_OBJS = $(LIB32_OBJS) "$(INTDIR)\ne_openssl.obj"
-LIB32_OBJS = $(LIB32_OBJS) $(OPENSSL_SRC)\out32\libeay32.lib \
- $(OPENSSL_SRC)\out32\ssleay32.lib
+LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32\libeay32.lib" \
+ "$(OPENSSL_SRC)\out32\ssleay32.lib"
-LIB32_OBJS = $(LIB32_OBJS) $(OPENSSL_SRC)\out32dll\libeay32.lib \
- $(OPENSSL_SRC)\out32dll\ssleay32.lib
+LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32dll\libeay32.lib" \
+ "$(OPENSSL_SRC)\out32dll\ssleay32.lib"
 # Provide ABI-compatibility stubs for SSL interface

--- neon-0.24.5/neon.mak 2003-03-26 19:12:12.000000000 +0000
+++ neon/neon.mak 2004-05-01 17:53:59.562500000 +0100
@@ -10,19 +10,33 @@
 # Support for Expat integration
-# IF EXPAT_SRC is set, then assume compiling against a pre-built
-# binary Expat 1.95.X. If EXPAT_SRC is not set, then the user can
+# If EXPAT_SRC or EXPAT_INC are set, then assume compiling against a
+# pre-built binary Expat 1.95.X. You can use either EXPAT_SRC
+# to specify the top-level Expat directory, or EXPAT_INC to directly
+# specify the Expat include directory. (If both are set, EXPAT_SRC
+# is ignored).
+# If EXPAT_SRC and EXPAT_INC are not set, then the user can
 # still set EXPAT_FLAGS to specify very specific compile behavior.
-# If both EXPAT_SRC and EXPAT_FLAGS are not set, disable WebDAV
-# support.
+# If none of EXPAT_SRC, EXPAT_INC and EXPAT_FLAGS are set, disable
+# WebDAV support.
+!IF "$(EXPAT_INC)" == ""
+!IF "$(EXPAT_SRC)" != ""
+EXPAT_INC = $(EXPAT_SRC)\Source\Lib
-!IF "$(EXPAT_SRC)" == ""
+!IF "$(EXPAT_INC)" == ""

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun May 2 02:36:23 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.