diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 203 |
1 files changed, 173 insertions, 30 deletions
diff --git a/configure.in b/configure.in index b6eee4941..d84919861 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,12 @@ dnl Process this file with autoconf to produce a configure script. dnl The macros which aren't shipped with the autotools are stored in the dnl Tools/config directory in .m4 files. -AC_INIT([swig],[2.0.1],[http://www.swig.org]) +AC_INIT([swig],[2.0.2],[http://www.swig.org]) + +dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED +dnl definition below can be removed AC_PREREQ(2.58) + AC_CONFIG_SRCDIR([Source/Swig/swig.h]) AC_CONFIG_AUX_DIR([Tools/config]) AC_CONFIG_HEADERS([Source/Include/swigconfig.h]) @@ -15,7 +19,7 @@ AH_BOTTOM([ /* Default language */ #define SWIG_LANG "-tcl" -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +/* Deal with Microsofts attempt at deprecating C standard runtime functions */ #if defined(_MSC_VER) # define _CRT_SECURE_NO_DEPRECATE #endif @@ -49,23 +53,56 @@ else AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen])) fi -dnl Look for RxSpencer -AC_ARG_WITH(rxspencer, AS_HELP_STRING([--with-rxspencer], [Enable RxSpencer]), with_rxspencer="yes") -if test x"${with_rxspencer}" = xyes ; then -#check first for the header - AC_CHECK_HEADER(rxspencer/regex.h,with_rxspencer="yes",with_rxspencer="no") - if test x"${with_rxspencer}" = xyes ; then -# now check for the library - AC_CHECK_LIB(rxspencer, regcomp,with_rxspencer="yes",with_rxspencer="no") - fi - if test x"${with_rxspencer}" = xyes ; then -# library and header are available - AC_DEFINE(HAVE_RXSPENCER, 1,[Define if rxspencer is available]) - LIBS="$LIBS -lrxspencer" - else - AC_MSG_NOTICE([RxSpencer not found. Obtain it at http://arglist.com/regex or http://gnuwin32.sourceforge.net/packages.html]) - fi -fi +dnl PCRE + +dnl AX_PATH_GENERIC() relies on AC_PROG_SED() but it is defined only in +dnl autoconf 2.60 so trivially predefine it ourselves for the older versions +m4_ifdef([AC_PROG_SED],, [AC_DEFUN([AC_PROG_SED], [AC_PATH_PROG([SED], sed)])]) + +AC_ARG_WITH([pcre], + [AS_HELP_STRING([--without-pcre], + [Disable support for regular expressions using PCRE])], + [], + [with_pcre=yes]) + +AC_MSG_CHECKING([whether to enable PCRE support]) +AC_MSG_RESULT([$with_pcre]) + +dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script +if test x"${with_pcre}" = xyes ; then + AC_MSG_CHECKING([whether to use local PCRE]) + local_pcre_config=no + if test -z $PCRE_CONFIG; then + if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then + PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config + local_pcre_config=$PCRE_CONFIG + fi + fi + AC_MSG_RESULT([$local_pcre_config]) +fi +AS_IF([test "x$with_pcre" != xno], + [AX_PATH_GENERIC([pcre], + [], dnl Minimal version of PCRE we need -- accept any + [], dnl custom sed script for version parsing is not needed + [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) + LIBS="$LIBS $PCRE_LIBS" + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" + ], + [AC_MSG_FAILURE([ + Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) + library package. This dependency is needed for configure to complete, + Either: + - Install the PCRE developer package on your system (preferred approach). + - Download the PCRE source tarball, build and install on your system + as you would for any package built from source distribution. + - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically + link against. Run 'Tools/pcre-build.sh --help' for instructions. + (quite easy and does not require privileges to install PCRE on your system) + - Use configure --without-pcre to disable regular expressions support in SWIG + (not recommended).]) + ]) + ]) + dnl CCache AC_ARG_ENABLE([ccache], AS_HELP_STRING([--disable-ccache], [disable building and installation of ccache-swig executable (default enabled)]), [enable_ccache=$enableval], [enable_ccache=yes]) @@ -93,10 +130,14 @@ AC_CHECK_PROGS(YODL2HTML, yodl2html) echo "" -echo "Checking for installed target languages and other information in order to compile and run the examples." +echo "Checking for installed target languages and other information in order to compile and run" +echo "the examples and test-suite invoked by 'make check'." echo "Note : None of the following packages are required for users to compile and install SWIG" echo "" +dnl Some test cases require Boost +AX_BOOST_BASE(,,,) +AC_SUBST(BOOST_CPPFLAGS) dnl How to specify include directories that may be system directories. # -I should not be used on system directories (GCC) @@ -1981,28 +2022,123 @@ AC_ARG_WITH(go, AS_HELP_STRING([--without-go], [Disable Go]) AS_HELP_STRING([--with-go=path], [Set location of Go compiler]),[GOBIN="$withval"], [GOBIN=yes]) if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then -AC_MSG_NOTICE([Disabling Go]) -GO= -GOGCC=false + AC_MSG_NOTICE([Disabling Go]) + GO= + GOGCC=false else - if test "x$GOBIN" = xyes; then - AC_CHECK_PROGS(GO, 6g 8g gccgo) - else - GO="$GOBIN" - fi + if test "x$GOBIN" = xyes; then + AC_CHECK_PROGS(GO, 6g 8g gccgo) + else + GO="$GOBIN" + fi + if test -n "$GO" ; then GOGCC=false if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then - GOGCC=true + GOGCC=true + else + AC_MSG_CHECKING([whether Go ($GO) version is too old]) + go_version=`$GO -V | sed -e 's/.*version \([[0-9]]*\).*/\1/'` + go_min_version=7077 + if test "$go_version" -lt $go_min_version; then + AC_MSG_RESULT([yes - minimum version is $go_min_version]) + GO= + else + AC_MSG_RESULT([no]) + fi fi - + fi fi AC_SUBST(GOGCC) AC_SUBST(GO) #---------------------------------------------------------------- +# Look for D +#---------------------------------------------------------------- + +AC_ARG_WITH(d, AS_HELP_STRING([--without-d], [Disable D]), [with_d="$withval"], [with_d=yes]) +AC_ARG_WITH(d1-compiler, [ --with-d1-compiler=path Set location of D1/Tango compiler (DMD compatible)],[D1COMPILERBIN="$withval"], [D1COMPILERBIN=]) +AC_ARG_WITH(d2-compiler, [ --with-d2-compiler=path Set location of D2 compiler (DMD compatible)],[D2COMPILERBIN="$withval"], [D2COMPILERBIN=]) + + +# First, check for "--without-d" or "--with-d=no". +if test x"${with_d}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling D]) + D1COMPILER= + D2COMPILER= +else + old_ac_ext=$ac_ext + ac_ext=d + + if test -z "$D1COMPILERBIN" ; then + AC_CHECK_PROGS(D1COMPILER, dmd ldmd gdmd) + + if test -n "$D1COMPILER" ; then + AC_MSG_CHECKING(whether the D1/Tango compiler works) + cat > conftest.$ac_ext <<_ACEOF +import tango.io.Stdout; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + AS_IF( + [_AC_DO_STDERR($D1COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext], + [AC_MSG_RESULT([yes])], + [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no]) + D1COMPILER=] + ) + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D1COMPILER="$D1COMPILERBIN" + fi + + if test -z "$D2COMPILERBIN" ; then + AC_CHECK_PROGS(D2COMPILER, dmd gdmd) + + if test -n "$D2COMPILER" ; then + AC_MSG_CHECKING(whether the D2 compiler works) + cat > conftest.$ac_ext <<_ACEOF +import std.algorithm; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + AS_IF( + [_AC_DO_STDERR($D2COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext], + [AC_MSG_RESULT([yes])], + [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no]) + D2COMPILER=] + ) + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D2COMPILER="$D2COMPILERBIN" + fi + + ac_ext=$old_ac_ext +fi + +if test -n "$D1COMPILER"; then + DDEFAULTVERSION=1 +elif test -n "$D2COMPILER"; then + DDEFAULTVERSION=2 +fi + +# Do not prefix library file names with "lib" on Windows. +case $host in +*-*-cygwin* | *-*-mingw*) DLIBPREFIX="";; +*)DLIBPREFIX="lib";; +esac + +AC_SUBST(D1COMPILER) +AC_SUBST(D2COMPILER) +AC_SUBST(DDEFAULTVERSION) +AC_SUBST(DLIBPREFIX) + +#---------------------------------------------------------------- # Determine which languages to use for examples/test-suite #---------------------------------------------------------------- @@ -2158,6 +2294,12 @@ if test -z "$GO" ; then fi AC_SUBST(SKIP_GO) +SKIP_D= +if test -z "$DDEFAULTVERSION" ; then + SKIP_D="1" +fi +AC_SUBST(SKIP_D) + #---------------------------------------------------------------- # Additional language dependencies #---------------------------------------------------------------- @@ -2218,6 +2360,7 @@ AC_CONFIG_FILES([ \ Examples/xml/Makefile \ Examples/test-suite/chicken/Makefile \ Examples/test-suite/csharp/Makefile \ + Examples/test-suite/d/Makefile \ Examples/test-suite/guile/Makefile \ Examples/test-suite/guilescm/Makefile \ Examples/test-suite/java/Makefile \ |