[Xapian-discuss] binding JAVA, rushing!
Olly Betts
olly at survex.com
Wed Apr 4 06:05:54 BST 2007
On Tue, Apr 03, 2007 at 11:47:26PM +0100, James Aylett wrote:
> Please keep replies on-list, so more people can help you :)
Indeed.
> JAVA_CPPFLAGS='-I/cygdrive/c/Program\ Files/....'
You don't want to backslash-escape the space if you use single (or
double) quotes:
$ JAVA_CPPFLAGS='-I/cygdrive/c/Program\ Files/....'
$ echo $JAVA_CPPFLAGS
-I/cygdrive/c/Program\ Files/....
$ JAVA_CPPFLAGS="-I/cygdrive/c/Program\ Files/...."
$ echo $JAVA_CPPFLAGS
-I/cygdrive/c/Program\ Files/....
> Generally, spaces in file paths are wrong. There are quite a lot of
> Windows applications that can't cope either, so whatever gave
> Microsoft the idea of putting critical directories on the disk with
> spaces in, I don't know :-(
In particular, spaces in pathnames are best avoided with autotools
generated scripts. The situation has improved a lot in recent versions
for autoconf and automake, but libtool is still problematic. Also,
the way some macros are designed works against the use of spaces in
paths - for example, autoconf's AC_CHECK_PROGS tries the first word of
each specified program name, assuming that the specified program name
might be a program name with arguments, e.g. 'bison -y'.
My aim is to not gratuitously break use of spaces in paths, but it's not
something I think it's worth expending a lot of effort on given it will
be at the expense of other improvements.
In practice it's only a problem on MS Windows, and there are easy
workarounds there.
For cygwin you can just mount the problematic path elsewhere, using
something like:
mount 'c:\Program Files' '/cygdrive/c/Program_Files'
http://www.cygwin.com/cygwin-ug-net/using-utils.html#mount
Then specify the mounted version without spaces.
For mingw you can probably use the "short path" version - "C:\Progra~1"
is the same as "C:\Program Files".
Actually, looking at configure.ac, I notice there's missing quoting
in the handling of the java tests, but fixing that won't actually help
in your case (I will fix it anyway - it might help in other cases).
Cheers,
Olly
More information about the Xapian-discuss
mailing list