diff options
author | Vadim Zeitlin <vz-swig@zeitlins.org> | 2015-06-15 18:02:28 +0200 |
---|---|---|
committer | Vadim Zeitlin <vz-swig@zeitlins.org> | 2015-06-24 23:59:32 +0200 |
commit | 0de11efdd3b7b7a42e28896a92da0341044d4ad5 (patch) | |
tree | c674676f4198b1341b7a854b6fb33a6c0cdd42ec | |
parent | 078ad6cb86d1e8e93eae5b758dc35b37a476347a (diff) | |
download | swig-0de11efdd3b7b7a42e28896a92da0341044d4ad5.tar.gz |
Use "mixed" path to source directory under Cygwin.
This allows build to work with both native and Cygwin builds of SWIG and
doesn't restrict us to building in the source directory as was the case
previously because SWIG_LIB was explicitly not set under Windows.
-rw-r--r-- | configure.ac | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 1eb338617..3877811d4 100644 --- a/configure.ac +++ b/configure.ac @@ -2790,6 +2790,17 @@ AC_SUBST(SKIP_ANDROID) ABS_SRCDIR=`(cd ${srcdir} && pwd)` +dnl Under Cygwin, we may need native absolute path as it is used by SWIG, which +dnl may be a native, and not a Cygwin, program (this is the case when it's +dnl built using MinGW or cccl compiler in Cygwin environment). However it may, +dnl although this is probably more rare, also be built as a Cygwin program. +dnl Using "mixed" path like we do here allows the path to work in both cases. +case $host in +*-*-cygwin* ) + ABS_SRCDIR=`cygpath --mixed $ABS_SRCDIR` + ;; +esac + # Root directory ROOT_DIR=`pwd` case $host in @@ -2827,12 +2838,20 @@ case $build in esac AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) -# For testing - Windows builds of SWIG do not need SWIG_LIB set -AC_EGREP_CPP([yes], -[#ifdef _WIN32 - yes -#endif -], [SWIG_LIB_PREINST=], [SWIG_LIB_PREINST=$ABS_SRCDIR/Lib]) +dnl For testing purposes, don't set SWIG_LIB_PREINST when building SWIG in the +dnl source directory under Windows because it is supposed to work without +dnl SWIG_LIB being set at all in this particular case. +if test "${srcdir}" = "."; then + AC_EGREP_CPP([yes], + [#ifdef _WIN32 + yes + #endif + ], [SWIG_LIB_PREINST=], [SWIG_LIB_PREINST=$ABS_SRCDIR/Lib]) +else + dnl When not building in source directory, we must always set SWIG_LIB, + dnl even under Windows, as things couldn't work without it. + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib +fi AC_SUBST(SWIG_LIB_PREINST) AC_CONFIG_FILES([ |