summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac250
1 files changed, 159 insertions, 91 deletions
diff --git a/configure.ac b/configure.ac
index 091749f53..b0c7e869d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ 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],[3.0.1],[http://www.swig.org])
+AC_INIT([swig],[3.0.4],[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
@@ -19,7 +19,7 @@ AH_BOTTOM([
/* Default language */
#define SWIG_LANG "-tcl"
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+/* Deal with attempt by Microsoft to deprecate C standard runtime functions */
#if defined(_MSC_VER)
# define _CRT_SECURE_NO_DEPRECATE
#endif
@@ -461,6 +461,8 @@ fi])
AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
+AC_CHECK_PROGS(PKGCONFIG, [pkg-config])
+
#--------------------------------------------------------------------
# Look for Tcl
#--------------------------------------------------------------------
@@ -489,7 +491,7 @@ if test x"${with_tclconfig}" != x ; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
TCLCONFIG=`(cd ${with_tclconfig}; pwd)`
else
- AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
+ AC_MSG_ERROR([${with_tcl} directory does not contain tclConfig.sh])
fi
fi
# check in a few common install locations
@@ -789,7 +791,7 @@ AC_SUBST(PY3INCLUDE)
AC_SUBST(PY3LIB)
AC_SUBST(PY3LINK)
AC_SUBST(PYTHON3DYNAMICLINKING)
-
+AC_CHECK_PROGS(PEP8, pep8)
#----------------------------------------------------------------
# Look for Perl5
@@ -819,7 +821,7 @@ fi
# perl -MExtUtils::Embed -e ccopts
AC_MSG_CHECKING(for Perl5 header files)
if test -n "$PERL"; then
- PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null`
+ PERL5DIR=`($PERL -MConfig -le 'print $Config{archlibexp}') 2>/dev/null`
if test -n "$PERL5DIR" ; then
dirs="$PERL5DIR $PERL5DIR/CORE"
PERL5EXT=none
@@ -937,25 +939,43 @@ fi
if test -n "$OCTAVE"; then
AC_MSG_CHECKING([for Octave preprocessor flags])
OCTAVE_CPPFLAGS=
- for n in CPPFLAGS INCFLAGS; do
- OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} "`unset CPPFLAGS; ${mkoctfile} -p $n`
+ for var in CPPFLAGS INCFLAGS ALL_CXXFLAGS; do
+ for flag in `env - ${mkoctfile} -p ${var}`; do
+ case ${flag} in
+ -D*|-I*) OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} ${flag}";;
+ *) ;;
+ esac
+ done
done
AC_MSG_RESULT([$OCTAVE_CPPFLAGS])
AC_MSG_CHECKING([for Octave compiler flags])
OCTAVE_CXXFLAGS=
- for n in ALL_CXXFLAGS; do
- OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} "`unset CXXFLAGS; ${mkoctfile} -p $n`
+ for var in ALL_CXXFLAGS; do
+ for flag in `env - ${mkoctfile} -p ${var}`; do
+ case ${flag} in
+ -g*|-W*) OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} ${flag}";;
+ *) ;;
+ esac
+ done
done
+ save_CXXFLAGS="${CXXFLAGS}"
+ CXXFLAGS="-Werror -O0"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[])
+ ],[
+ OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} -O0"
+ ])
+ CXXFLAGS="${save_CXXFLAGS}"
AC_MSG_RESULT([$OCTAVE_CXXFLAGS])
AC_MSG_CHECKING([for Octave linker flags])
OCTAVE_LDFLAGS=
- for n in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do
- OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`${mkoctfile} -p $n`
+ for var in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do
+ OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`env - ${mkoctfile} -p ${var}`
done
AC_MSG_RESULT([$OCTAVE_LDFLAGS])
for octave_opt in --silent --norc --no-history --no-window-system; do
AC_MSG_CHECKING([if Octave option '${octave_opt}' is supported])
- octave_out=`${OCTAVE} ${octave_opt} /dev/null 2>&1 | sed -n '1{/unrecognized/p}'`
+ octave_out=`${OCTAVE} ${octave_opt} /dev/null 2>&1 | sed -n '1p' | sed -n '/unrecognized/p'`
AS_IF([test "x${octave_out}" = x],[
AC_MSG_RESULT([yes])
OCTAVE="${OCTAVE} ${octave_opt}"
@@ -1104,27 +1124,14 @@ else
#----------------------------------------------------------------
case $host in
- *-*-cygwin* | *-*-mingw*)
- JSLIBRARYPREFIX=""
- ;;
- *)
- JSLIBRARYPREFIX="lib"
- ;;
- esac
-
- case $host in
*-*-darwin*)
JSSO=".dylib"
- JSLDSHARED='$(CC) -dynamiclib'
- JSCXXSHARED='$(CXX) -dynamiclib'
# HACK: didn't manage to get dynamic module loading working with a g++ compiled interpreter
JSINTERPRETERCXX='c++'
JSINTERPRETERLINKFLAGS='-g -Wl,-search_paths_first -Wl,-headerpad_max_install_names'
;;
*)
JSSO=$SO
- JSLDSHARED='$(LDSHARED)'
- JSCXXSHARED='$(CXXSHARED)'
JSINTERPRETERCXX='$(CXX)'
JSINTERPRETERLINKFLAGS='-ldl'
;;
@@ -1185,37 +1192,21 @@ else
# check for JavaScriptCore/Webkit libraries
AC_ARG_WITH(jscorelib,[ --with-jsclib =path Set location of the JavaScriptCore/Webkit library directory],[JSCORELIB="-L$withval"], [JSCORELIB=])
- AC_MSG_CHECKING(for JavaScriptCore/Webkit library)
- # look for the library when not provided
- if test -z "$JSCORELIB"; then
- case $host in
- *-*-linux*)
- dirs="/usr/lib/ /usr/local/lib/"
- for i in $dirs ; do
- if test -r $i/libjavascriptcoregtk-1.0.so; then
- AC_MSG_RESULT($i)
- JSCORELIB="-L$i -ljavascriptcoregtk-1.0"
- JSCOREVERSION=`pkg-config --modversion javascriptcoregtk-1.0`
- break
- fi
- done
-
- if test -z "$JSCORELIB"; then
- AC_MSG_RESULT(not found)
- JSCENABLED=0
- else
- JSCOREDYNAMICLINKING="$JSCORELIB"
- JSCENABLED=1
- fi
- ;;
- *-*-darwin*)
- JSCOREDYNAMICLINKING="-framework JavaScriptCore"
+ if test -z "$JSCORELIB" -a -n "$PKGCONFIG"; then
+ AC_MSG_CHECKING(for JavaScriptCore/Webkit library)
+ if pkg-config javascriptcoregtk-1.0; then
+ JSCORELIB=`$PKGCONFIG --libs javascriptcoregtk-1.0`
+ JSCOREVERSION=`$PKGCONFIG --modversion javascriptcoregtk-1.0`
+ fi
+ if test -z "$JSCORELIB"; then
+ AC_MSG_RESULT(not found)
+ JSCENABLED=
+ else
+ AC_MSG_RESULT([$JSCORELIB])
+ JSCOREDYNAMICLINKING="$JSCORELIB"
JSCENABLED=1
- ;;
- *)
- ;;
- esac
+ fi
fi
#----------------------------------------------------------------
@@ -1224,7 +1215,7 @@ else
# check for include files
AC_MSG_CHECKING(for V8 Javascript v8.h)
- AC_ARG_WITH(jsv8inc, [ --with-v8inc=path Set location of Javascript v8 include directory], [JSV8INCDIR="$withval"])
+ AC_ARG_WITH(jsv8inc, [ --with-jsv8inc=path Set location of Javascript v8 include directory], [JSV8INCDIR="$withval"])
# if not include dir is specified we try to find
if test -z "$JSV8INCDIR"; then
@@ -1257,11 +1248,11 @@ else
# check for V8 library
AC_MSG_CHECKING(for V8 Javascript library)
- AC_ARG_WITH(jsv8lib,[ --with-v8lib=path Set location of V8 Javascript library directory],[JSV8LIBDIR="$withval"], [JSV8LIB=])
+ AC_ARG_WITH(jsv8lib,[ --with-jsv8lib=path Set location of V8 Javascript library directory],[JSV8LIBDIR="$withval"], [JSV8LIB=])
- v8libdirs="$JSV8LIBDIR /usr/lib/ /usr/local/lib/"
+ v8libdirs="$JSV8LIBDIR /usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/"
for d in $v8libdirs ; do
- if test -r $d/libv8.so; then
+ if test -r $d/libv8$JSSO; then
JSV8LIBDIR=$d
JSV8LIB="-L$d -lv8"
break
@@ -1270,7 +1261,7 @@ else
if test "$JSV8LIB" = "" ; then
AC_MSG_RESULT(not found)
- JSV8ENABLED=0
+ JSV8ENABLED=
else
AC_MSG_RESULT($JSV8LIBDIR)
JSV8ENABLED=1
@@ -1280,7 +1271,7 @@ else
# linking options
case $host in
*-*-darwin*)
- JSV8DYNAMICLINKING="" # TODO: add osx configuration
+ JSV8DYNAMICLINKING="$JSV8LIB"
;;
*-*-linux*)
JSV8DYNAMICLINKING="$JSV8LIB"
@@ -1292,11 +1283,6 @@ else
fi
-AC_SUBST(JSLIBRARYPREFIX)
-AC_SUBST(JSSO)
-AC_SUBST(JSLDSHARED)
-AC_SUBST(JSCXXSHARED)
-
AC_SUBST(JSINTERPRETERCXX)
AC_SUBST(JSINTERPRETERLINKFLAGS)
@@ -1503,6 +1489,7 @@ AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby])
AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes])
# First, check for "--without-ruby" or "--with-ruby=no".
+RUBYSO=$SO
if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then
AC_MSG_NOTICE([Disabling Ruby])
RUBY=
@@ -1521,7 +1508,7 @@ if test -n "$RUBY"; then
# Try Ruby1.9+ first
RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || $rubyhdrdir') 2>/dev/null`
if test x"$RUBYDIR" = x"" || test x"$RUBYDIR" = x"nil"; then
- RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
+ RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
else
RUBYARCH=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]] || $arch') 2>/dev/null`
fi
@@ -1546,13 +1533,13 @@ if test -n "$RUBY"; then
# Find library and path for linking.
AC_MSG_CHECKING(for Ruby library)
RUBYLIB=""
- rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
- rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
+ rb_libdir=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["libdir"]]') 2>/dev/null`
+ rb_bindir=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["bindir"]]') 2>/dev/null`
dirs="$dirs $rb_libdir $rb_bindir"
- rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
+ rb_libruby=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
RUBYLINK=`($RUBY -rrbconfig -e '
- c = Config::CONFIG
+ c = RbConfig::CONFIG
if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
link = c[["LIBRUBYARG_STATIC"]]
@@ -1598,11 +1585,11 @@ if test -n "$RUBY"; then
case $host in
*-*-mingw*) ;; # do nothing, the default windows libraries are already included
- *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";;
+ *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["LIBS"]]') 2>/dev/null`";;
esac
- RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
- RUBYSO=.`($RUBY -rrbconfig -e 'print Config::CONFIG[["DLEXT"]]') 2>/dev/null`
+ RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
+ RUBYSO=.`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["DLEXT"]]') 2>/dev/null`
else
AC_MSG_RESULT(could not figure out how to run ruby)
fi
@@ -2266,9 +2253,13 @@ else
GOGCC=true
GOVERSIONOPTION=--version
AC_MSG_CHECKING([whether gccgo version is too old])
- go_version=`$GO $GOVERSIONOPTION | sed -e 's/[^0-9]* \([0-9.]*\) .*$/\1/' -e 's/[.]//g'`
- if test "$go_version" -lt 470; then
+ go_version=[`$GO $GOVERSIONOPTION | sed -n '1p' | sed -e 's/^.* \([0-9.]*\) *$/\1/' -e 's/[.]//g'`]
+ if test "x$go_version" = x; then
+ AC_MSG_RESULT([could not determine gccgo version - disabling Go])
+ GO=
+ elif test "$go_version" -lt 470; then
AC_MSG_RESULT([yes - minimum version is 4.7.0])
+ GO=
else
AC_MSG_RESULT([no])
if test "$go_version" -lt 480; then
@@ -2287,17 +2278,24 @@ else
GOVERSIONOPTION=version
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
+ AC_MSG_CHECKING([whether go version is too old])
case $go_version in
- go1.0*) GOOPT="-intgosize 32" ;;
- *) if test "$GOC" = "6c"; then
- GOOPT="-intgosize 64"
- else
- GOOPT="-intgosize 32"
- fi
- ;;
+ go1.0* | go1 )
+ AC_MSG_RESULT([yes - minimum version is 1.1])
+ GO=
+ GOOPT="-intgosize 32"
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ if test "$GOC" = "6c"; then
+ GOOPT="-intgosize 64"
+ else
+ GOOPT="-intgosize 32"
+ fi
+ ;;
esac
case $go_version in
- go1.0* | go1.1*)
+ go1.0* | go1 | go1.1*)
GOOPT="$GOOPT -use-shlib"
;;
go1.2*)
@@ -2311,14 +2309,17 @@ else
GOC=`echo $GO | sed -e 's/g/c/'`
GOVERSIONOPTION=-V
AC_MSG_CHECKING([whether Go ($GO) version is too old])
- go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
- go_min_version=7077
- if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then
- AC_MSG_RESULT([yes - minimum version is $go_min_version])
- GO=
- else
- AC_MSG_RESULT([no])
- fi
+ AC_MSG_RESULT([yes - minimum version is 1.1])
+ GO=
+ dnl Old code retained for now in case we implement an option for it.
+ dnl go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
+ dnl go_min_version=7077
+ dnl if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then
+ dnl AC_MSG_RESULT([yes - minimum version is $go_min_version])
+ dnl GO=
+ dnl else
+ dnl AC_MSG_RESULT([no])
+ dnl fi
GOOPT="-intgosize 32"
GO12=false
GO13=false
@@ -2643,6 +2644,7 @@ AC_CONFIG_FILES([
Makefile
swig.spec
Examples/Makefile
+ Examples/d/example.mk
Examples/xml/Makefile
Examples/test-suite/errors/Makefile
Examples/test-suite/chicken/Makefile
@@ -2673,5 +2675,71 @@ AC_CONFIG_FILES([
AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig])
AC_CONFIG_FILES([CCache/ccache_swig_config.h])
+#--------------------------------------------------------------------
+# Building Examples/ out of source directory
+#--------------------------------------------------------------------
+
+# If building out of source tree, replicate Examples/ source tree in
+# build directory, and copy over Makefiles from source directory.
+# Prefix each Makefile with a header which sets SRCDIR to the relative
+# source directory, and provides a rule for updating the Makefile from
+# its original source.
+AC_CONFIG_COMMANDS([Examples],[
+ if test "x${srcdir}" != "x." ; then
+ AC_MSG_NOTICE([generating Examples build tree])
+ for mkfile in `cd ${srcdir} && find Examples/ -type f -name Makefile`; do
+ dir=`dirname ${mkfile}`
+ d=${dir}
+ reldir="";
+ while test "x$d" != "x." ; do
+ d=`dirname $d`
+ reldir="${reldir}../"
+ done
+ relsrcdir=${reldir}${srcdir}/
+ AS_MKDIR_P([${dir}])
+ cat <<EOF >${mkfile}
+# DO NOT EDIT: instead edit ${relsrcdir}${mkfile}
+# and run (cd ${reldir} && ./config.status) to regenerate
+SRCDIR = ${relsrcdir}${dir}/
+
+EOF
+ cat ${srcdir}/${mkfile} >>${mkfile}
+ done
+ fi
+])
+
+#--------------------------------------------------------------------
+
AC_OUTPUT
+
+langs=""
+test -n "$SKIP_ALLEGROCL" || langs="${langs}allegrocl "
+test -n "$SKIP_CFFI" || langs="${langs}cffi "
+test -n "$SKIP_CHICKEN" || langs="${langs}chicken "
+test -n "$SKIP_CLISP" || langs="${langs}clisp "
+test -n "$SKIP_CSHARP" || langs="${langs}csharp "
+test -n "$SKIP_D" || langs="${langs}d "
+test -n "$SKIP_GO" || langs="${langs}go "
+test -n "$SKIP_GUILE" || langs="${langs}guile "
+test -n "$SKIP_JAVA" || langs="${langs}java "
+test -n "$SKIP_JAVASCRIPT" || langs="${langs}javascript "
+test -n "$SKIP_LUA" || langs="${langs}lua "
+test -n "$SKIP_MODULA3" || langs="${langs}modula3 "
+test -n "$SKIP_MZSCHEME" || langs="${langs}mzscheme "
+test -n "$SKIP_OCAML" || langs="${langs}ocaml "
+test -n "$SKIP_OCTAVE" || langs="${langs}octave "
+test -n "$SKIP_PERL5" || langs="${langs}perl5 "
+test -n "$SKIP_PHP" || langs="${langs}php "
+test -n "$SKIP_PIKE" || langs="${langs}pike "
+test -n "$SKIP_PYTHON" || langs="${langs}python "
+test -n "$SKIP_R" || langs="${langs}r "
+test -n "$SKIP_RUBY" || langs="${langs}ruby "
+test -n "$SKIP_TCL" || langs="${langs}tcl "
+test -n "$SKIP_UFFI" || langs="${langs}uffi "
+
+echo "
+The SWIG test-suite and examples are configured for the following languages:
+$langs
+"
+
dnl configure.ac ends here