diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2015-04-02 06:39:30 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2015-04-04 02:17:57 +0100 |
commit | f27faa9c6914d26f17c6e4940699751b940a5efd (patch) | |
tree | 3f114e3fd1272795d97511ae36ba2f12ada504d4 /configure.ac | |
parent | a57302527a9219f22a9226dc9752ec392836e396 (diff) | |
download | swig-f27faa9c6914d26f17c6e4940699751b940a5efd.tar.gz |
Allow for spaces in path to java include directory and executables
For typical Windows installs of Java.
Also don't use cygpath on MinGW.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 0c5ff5134..084096ea5 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,6 +1108,7 @@ fi AC_MSG_CHECKING(for java include file jni.h) AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=]) +JAVAINC="" if test -z "$JAVAINCDIR" ; then JAVAINCDIR="/usr/j2sdk*/include /usr/local/j2sdk*/include /usr/jdk*/include /usr/local/jdk*/include /opt/j2sdk*/include /opt/jdk*/include /usr/java/include /usr/java/j2sdk*/include /usr/java/jdk*/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/lib/java/include /usr/lib/jvm/java*/include /usr/lib64/jvm/java*/include /usr/include/kaffe /usr/local/include/kaffe /usr/include" @@ -1117,30 +1118,33 @@ if test -z "$JAVAINCDIR" ; then *-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";; *);; esac -fi -JAVAINC="" -for d in $JAVAINCDIR ; do - if test -r "$d/jni.h" ; then - AC_MSG_RESULT($d) - JAVAINCDIR=$d - JAVAINC=-I\"$d\" - break + for d in $JAVAINCDIR ; do + if test -r "$d/jni.h" ; then + JAVAINCDIR=$d + JAVAINC=-I\"$d\" + break + fi + done +else + if test -r "$JAVAINCDIR/jni.h" ; then + JAVAINC=-I\"$JAVAINCDIR\" fi -done +fi if test "$JAVAINC" = "" ; then AC_MSG_RESULT(not found) else + AC_MSG_RESULT($JAVAINC) # now look for <arch>/jni_md.h AC_MSG_CHECKING(for java include file jni_md.h) JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print` if test "$JAVAMDDIR" = "" ; then AC_MSG_RESULT(not found) else - JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1` - JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\"" + JAVAMDDIR=-I\"`dirname "$JAVAMDDIR" | tail -1`\" AC_MSG_RESULT($JAVAMDDIR) + JAVAINC="${JAVAINC} ${JAVAMDDIR}" fi fi @@ -1195,6 +1199,15 @@ case $host in esac fi +# Quote for spaces in path to executables +if test -n "$JAVA"; then + JAVA=\"$JAVA\" +fi +if test -n "$JAVAC"; then + JAVAC=\"$JAVAC\" +fi + + AC_SUBST(JAVA) AC_SUBST(JAVAC) AC_SUBST(JAVAINC) @@ -2669,13 +2682,18 @@ AC_SUBST(SKIP_ANDROID) ABS_SRCDIR=`(cd ${srcdir} && pwd)` # Root directory -# Translate path for native Windows compilers for use with 'make check' ROOT_DIR=`pwd` case $host in -*-*-cygwin* | *-*-mingw*) +*-*-cygwin*) + # Translate path for native Windows compilers for use with 'make check' if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then ROOT_DIR=`cygpath --mixed $ROOT_DIR` fi + ;; +esac + +case $host in +*-*-cygwin* | *-*-mingw*) # Extra files generated by some Windows compilers EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk" ;; |