aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorDave Beazley <dave-swig@dabeaz.com>2002-11-30 22:01:28 +0000
committerDave Beazley <dave-swig@dabeaz.com>2002-11-30 22:01:28 +0000
commit12a43edc2df8853e8e0315f742e57be88f0c4269 (patch)
treee3237f5f8c0a67c9bfa9bb5d6d095a739a49e4b2 /configure.in
parent5fcae5eb66d377e1c3f81da7465c44a62295a72b (diff)
downloadswig-12a43edc2df8853e8e0315f742e57be88f0c4269.tar.gz
The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in559
1 files changed, 447 insertions, 112 deletions
diff --git a/configure.in b/configure.in
index 78e8e362b..22e8ec183 100644
--- a/configure.in
+++ b/configure.in
@@ -7,12 +7,14 @@ dnl to nothing) and `test -z "$VAR"' or `test -n "$VAR"' as the
dnl case may be. --ttn, 2000/08/04 12:11:26
AC_INIT(Source/Swig/swig.h)
-AC_PREREQ(2.0)
+AC_PREREQ(2.53)
. $srcdir/VERSION
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(SWIG_VERSION)
AC_SUBST(SWIG_SPIN)
+AC_SUBST(SWIG_MAJOR_VERSION)
+AC_SUBST(SWIG_MINOR_VERSION)
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
@@ -61,6 +63,8 @@ dnl Checks for library functions.
AC_SUBST(SO)
AC_SUBST(LDSHARED)
AC_SUBST(CCSHARED)
+AC_SUBST(CXXSHARED)
+AC_SUBST(TRYLINKINGWITHCXX)
AC_SUBST(LINKFORSHARED)
# SO is the extension of shared libraries `(including the dot!)
@@ -70,6 +74,7 @@ if test -z "$SO"
then
case $ac_sys_system in
hp*|HP*) SO=.sl;;
+ CYGWIN*) SO=.dll;;
*) SO=.so;;
esac
fi
@@ -83,6 +88,18 @@ if test -z "$LDSHARED"
then
case $ac_sys_system/$ac_sys_release in
AIX*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
+ CYGWIN*)
+ if test "$GCC" = yes; then
+ LDSHARED="$CC -shared"
+ else
+ if test "cl" = $CC ; then
+ # Microsoft Visual C++ (MSVC)
+ LDSHARED="$CC -nologo -LD"
+ else
+ # Unknown compiler try gcc approach
+ LDSHARED="$CC -shared"
+ fi
+ fi ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/4*) LDSHARED="ld";;
@@ -110,10 +127,48 @@ then
LDSHARED="ld -Bshareable"
fi;;
SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
+ Darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";;
*) LDSHARED="ld";;
esac
fi
+
AC_MSG_RESULT($LDSHARED)
+# CXXSHARED is the ld *command* used to create C++ shared library
+# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
+# (Shared libraries in this instance are shared modules to be loaded into
+# Python, as opposed to building Python itself as a shared library.)
+AC_MSG_CHECKING(CXXSHARED)
+if test -z "$CXXSHARED"
+then
+ CXXSHARED="$LDSHARED"
+fi
+AC_MSG_RESULT($CXXSHARED)
+
+#
+AC_MSG_CHECKING(TRYLINKINGWITHCXX)
+if test -z "$TRYLINKINGWITHCXX"
+then
+ case $ac_sys_system/$ac_sys_release in
+ SunOS/5*) if test "$GCC" = yes;
+ then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G";
+ else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun";
+ fi;;
+ Darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";;
+ CYGWIN*)
+ if test "$GCC" = yes; then
+ TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared "
+ else
+ if test "cl" = $CXX ; then
+ # Microsoft Visual C++ (MSVC)
+ TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD"
+ else
+ TRYLINKINGWITHCXX="#unknown Windows compiler"
+ fi
+ fi ;;
+ *) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";;
+ esac
+fi
+AC_MSG_RESULT($TRYLINKINGWITHCXX)
# CCSHARED are the C *flags* used to create objects to go into a shared
# library (module) -- this is only needed for a few systems
AC_MSG_CHECKING(CCSHARED)
@@ -145,10 +200,10 @@ AC_MSG_CHECKING(RPATH)
if test -z "$RPATH"
then
case $ac_sys_system/$ac_sys_release in
- SunOS/5*) RPATH="-R. -R$(exec_prefix)/lib";;
- IRIX*) RPATH="-rpath .:$(exec_prefix)/lib";;
- Linux*) RPATH="-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .";;
- *) RPATH="";;
+ SunOS/5*) RPATH='-R. -R$(exec_prefix)/lib';;
+ IRIX*) RPATH='-rpath .:$(exec_prefix)/lib';;
+ Linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';;
+ *) RPATH='';;
esac
fi
AC_MSG_RESULT($RPATH)
@@ -172,7 +227,6 @@ then
fi
AC_MSG_RESULT($LINKFORSHARED)
-
echo ""
echo "Checking for installed packages."
echo "Note : None of the following packages are required to compile SWIG"
@@ -195,6 +249,11 @@ AC_CHECK_LIB(inet, gethostbyname, [LIBS="-linet $LIBS"], [], -lnsl) # Sequent
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
fi
+
+AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"])
+AC_SUBST(SWIGLIBS)
+AC_SUBST(SWILL)
+
# check for --with-libm=...
AC_SUBST(LIBM)
LIBM=-lm
@@ -290,6 +349,7 @@ fi
AC_SUBST(XINCLUDES)
AC_SUBST(XLIBSW)
+
#--------------------------------------------------------------------
# Try to locate the Tcl package
#--------------------------------------------------------------------
@@ -298,6 +358,8 @@ TCLINCLUDE=
TCLLIB=
TCLPACKAGE=
+AC_ARG_WITH(tclconfig,[ --with-tclconfig=path Set location of tclConfig.sh],
+ with_tclconfig="$withval")
AC_ARG_WITH(tcl,[ --with-tcl=path Set location of Tcl package],[
TCLPACKAGE="$withval"], [TCLPACKAGE=])
AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
@@ -305,6 +367,35 @@ AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include direc
AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
TCLLIB="-L$withval"], [TCLLIB=])
+AC_MSG_CHECKING([for Tcl configuration])
+# First check to see if --with-tclconfig was specified.
+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])
+ fi
+fi
+# check in a few common install locations
+if test x"${TCLCONFIG}" = x ; then
+ for i in `ls -d /usr/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/tclConfig.sh" ; then
+ TCLCONFIG=`(cd $i; pwd)`
+ break
+ fi
+ done
+fi
+if test x"${TCLCONFIG}" = x ; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
+ . $TCLCONFIG/tclConfig.sh
+ TCLINCLUDE=-I$TCL_PREFIX/include
+ TCLLIB=$TCL_LIB_SPEC
+fi
+
if test -z "$TCLINCLUDE"; then
if test -n "$TCLPACKAGE"; then
TCLINCLUDE="-I$TCLPACKAGE/include"
@@ -313,7 +404,7 @@ fi
if test -z "$TCLLIB"; then
if test -n "$TCLPACKAGE"; then
- TCLLIB="-L$TCLPACKAGE/lib"
+ TCLLIB="-L$TCLPACKAGE/lib -ltcl"
fi
fi
@@ -321,7 +412,7 @@ AC_MSG_CHECKING(for Tcl header files)
if test -z "$TCLINCLUDE"; then
AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
if test -z "$TCLINCLUDE"; then
- dirs="$prefix/include /usr/local/include /usr/include /opt/local/include /home/sci/local/include"
+ dirs="$prefix/include /usr/local/include /usr/include /opt/local/include"
for i in $dirs ; do
if test -r $i/tcl.h; then
AC_MSG_RESULT($i)
@@ -331,7 +422,7 @@ if test -z "$TCLINCLUDE"; then
done
fi
if test -z "$TCLINCLUDE"; then
- TCLINCLUDE="-I/usr/local/include"
+# TCLINCLUDE="-I/usr/local/include"
AC_MSG_RESULT(not found)
fi
else
@@ -340,25 +431,31 @@ fi
AC_MSG_CHECKING(for Tcl library)
if test -z "$TCLLIB"; then
-dirs="$prefix/lib /usr/local/lib /usr/lib /opt/local/lib /home/sci/local/lib"
+dirs="$prefix/lib /usr/local/lib /usr/lib /opt/local/lib"
for i in $dirs ; do
if test -r $i/libtcl.a; then
AC_MSG_RESULT($i)
- TCLLIB="-L$i"
+ TCLLIB="-L$i -ltcl"
break
fi
done
if test -z "$TCLLIB"; then
AC_MSG_RESULT(not found)
- TCLLIB="-L/usr/local/lib"
+# TCLLIB="-L/usr/local/lib"
fi
else
AC_MSG_RESULT($TCLLIB)
fi
+# Only Cygwin (Windows) needs the library for dynamic linking
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*) TCLDYNAMICLINKING="$TCLLIB";;
+*)TCLDYNAMICLINKING="";;
+esac
+
AC_SUBST(TCLINCLUDE)
AC_SUBST(TCLLIB)
-AC_SUBST(TCLPACKAGE)
+AC_SUBST(TCLDYNAMICLINKING)
#----------------------------------------------------------------
# Look for Python
@@ -367,77 +464,108 @@ AC_SUBST(TCLPACKAGE)
PYINCLUDE=
PYLIB=
PYPACKAGE=
-PYLINK="-lModules -lPython -lObjects -lParser"
-
-AC_ARG_WITH(py,[ --with-py=path Set location of Python],[
- PYPACKAGE="$withval"], [PYPACKAGE=])
-AC_ARG_WITH(pyincl,[ --with-pyincl=path Set location of Python include directory],[
- PYINCLUDE="$withval"], [PYINCLUDE=])
-AC_ARG_WITH(pylib,[ --with-pylib=path Set location of Python library directory],[
- PYLIB="$withval"], [PYLIB=])
-
-if test -z "$PYINCLUDE"; then
- if test -n "$PYPACKAGE"; then
- PYINCLUDE="$PYPACKAGE/include"
- fi
-fi
-if test -z "$PYLIB"; then
- if test -n "$PYPACKAGE"; then
- PYLIB="$PYPACKAGE/lib"
- fi
-fi
+# I don't think any of this commented stuff works anymore
+#PYLINK="-lModules -lPython -lObjects -lParser"
-AC_MSG_CHECKING(for Python header files)
+#AC_ARG_WITH(py,[ --with-py=path Set location of Python],[
+# PYPACKAGE="$withval"], [PYPACKAGE=])
+#AC_ARG_WITH(pyincl,[ --with-pyincl=path Set location of Python include directory],[
+# PYINCLUDE="$withval"], [PYINCLUDE=])
+#AC_ARG_WITH(pylib,[ --with-pylib=path Set location of Python library directory],[
+# PYLIB="$withval"], [PYLIB=])
-dirs="$PYINCLUDE $PYINCLUDE/python1.6 $PYINCLUDE/python1.5 $PYINCLUDE/python1.4 $PYINCLUDE/Py $prefix=/include/python1.6 $prefix/include/python1.5 $prefix/include/python1.4 /usr/local/include/python1.6 /usr/local/include/python1.5 /usr/include/python1.5 /usr/local/include/python1.4 /usr/include/python1.4 $prefix/include/Py /usr/local/include/Py /usr/include/Py"
-for i in $dirs ; do
- if test -r $i/Python.h; then
- AC_MSG_RESULT($i)
- PYINCLUDE="-I$i"
- break
- fi
-done
-if test -z "$PYINCLUDE"; then
- PYINCLUDE="-I/usr/local/include/Py"
- AC_MSG_RESULT(not found)
+#if test -z "$PYINCLUDE"; then
+# if test -n "$PYPACKAGE"; then
+# PYINCLUDE="$PYPACKAGE/include"
+# fi
+#fi
+
+#if test -z "$PYLIB"; then
+# if test -n "$PYPACKAGE"; then
+# PYLIB="$PYPACKAGE/lib"
+# fi
+#fi
+
+AC_ARG_WITH(python,[ --with-python=path Set location of Python executable],[ PYBIN="$withval"], [PYBIN=])
+
+# First figure out the name of the Python executable
+
+if test -z "$PYBIN"; then
+AC_CHECK_PROGS(PYTHON, $prefix/bin/python python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python)
+else
+PYTHON="$PYBIN"
fi
-AC_MSG_CHECKING(for Python library)
-dirs="$PYLIB $PYLIB/config $PYLIB/lib $PYLIB/python1.6/config $PYLIB/python1.5/config $PYLIB/python1.4/config $PYLIB/python/lib $prefix/lib/python1.6/config $prefix/lib/python1.5/config $prefix/lib/python1.4/config /usr/local/lib/python1.6/config /usr/local/lib/python1.5/config /usr/lib/python1.5 /usr/local/lib/python1.4/config /usr/lib/python1.4 $prefix/lib/python/lib /usr/local/lib/python/lib /usr/lib/python/lib /home/sci/local/lib/python"
+if test -n "$PYTHON"; then
+ AC_MSG_CHECKING(for Python prefix)
+ PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
+ AC_MSG_RESULT($PYPREFIX)
+ AC_MSG_CHECKING(for Python exec-prefix)
+ PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
+ AC_MSG_RESULT($PYEPREFIX)
-for i in $dirs ; do
- if test -r $i/libpython1.6.a; then
- AC_MSG_RESULT($i)
- PYLIB="$i"
- PYINCLUDE="$PYINCLUDE -I$i"
- PYLINK="-lpython1.6"
- break
- fi
- if test -r $i/libpython1.5.a; then
- AC_MSG_RESULT($i)
- PYLIB="$i"
- PYINCLUDE="$PYINCLUDE -I$i"
- PYLINK="-lpython1.5"
- break
- fi
- if test -r $i/libPython.a; then
- AC_MSG_RESULT($i)
- PYLIB="$i"
- PYINCLUDE="$PYINCLUDE -I$i"
- break
- fi
-done
-if test -z "$PYLIB"; then
- AC_MSG_RESULT(not found)
- PYLIB="/usr/local/lib/python/lib"
- PYINCLUDE="$PYINCLUDE -I$PYLIB"
+
+ # Note: I could not think of a standard way to get the version string from different versions.
+ # This trick pulls it out of the file location for a standard library file.
+
+ AC_MSG_CHECKING(for Python version)
+
+ # Need to do this hack since autoconf replaces __file__ with the name of the configure file
+ filehack="file__"
+ PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
+ AC_MSG_RESULT($PYVERSION)
+
+ # Set the include directory
+
+ AC_MSG_CHECKING(for Python header files)
+ if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
+ PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/lib/$PYVERSION/config"
+ fi
+ if test -z "$PYINCLUDE"; then
+ if test -r $PYPREFIX/include/Py/Python.h; then
+ PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/lib/python/lib"
+ fi
+ fi
+ AC_MSG_RESULT($PYINCLUDE)
+
+ # Set the library directory blindly. This probably won't work with older versions
+ AC_MSG_CHECKING(for Python library)
+ dirs="$PYVERSION/config $PYVERSION/lib python/lib"
+ for i in $dirs; do
+ if test -d $PYEPREFIX/lib/$i; then
+ PYLIB="$PYEPREFIX/lib/$i"
+ break
+ fi
+ done
+ if test -z "$PYLIB"; then
+ AC_MSG_RESULT(Not found)
+ else
+ AC_MSG_RESULT($PYLIB)
+ fi
+
+ # Check for really old versions
+ if test -r $PYLIB/libPython.a; then
+ PYLINK="-lModules -lPython -lObjects -lParser"
+ else
+ PYLINK="-l$PYVERSION"
+ fi
fi
+# Only Cygwin (Windows) needs the library for dynamic linking
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
+ PYINCLUDE="-DUSE_DL_IMPORT $PYINCLUDE"
+ ;;
+*)PYTHONDYNAMICLINKING="";;
+esac
+
+
AC_SUBST(PYINCLUDE)
AC_SUBST(PYLIB)
AC_SUBST(PYLINK)
+AC_SUBST(PYTHONDYNAMICLINKING)
#----------------------------------------------------------------
# Look for Perl5
@@ -450,10 +578,12 @@ AC_ARG_WITH(perl5,[ --with-perl5=path Set location of Perl5 executable],[
# First figure out what the name of Perl5 is
if test -z "$PERLBIN"; then
-AC_CHECK_PROGS(PERL, perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
+AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
else
PERL="$PERLBIN"
fi
+
+
AC_MSG_CHECKING(for Perl5 header files)
if test -n "$PERL"; then
PERL5DIR=`($PERL -e 'use Config; print $Config{archlib};') 2>/dev/null`
@@ -471,16 +601,37 @@ if test -n "$PERL"; then
PERL5EXT="$PERL5DIR/CORE"
AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
fi
+
+ AC_MSG_CHECKING(for Perl5 library)
+ PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_') 2>/dev/null`
+ if test "$PERL5LIB" = "" ; then
+ AC_MSG_RESULT(not found)
+ else
+ AC_MSG_RESULT($PERL5LIB)
+ fi
else
AC_MSG_RESULT(unable to determine perl5 configuration)
PERL5EXT=$PERL5DIR
fi
- else
+else
AC_MSG_RESULT(could not figure out how to run perl5)
- PERL5EXT="/usr/local/lib/perl/archname/5.003/CORE"
- fi
+# PERL5EXT="/usr/local/lib/perl/archname/5.003/CORE"
+fi
+
+# Only Cygwin (Windows) needs the library for dynamic linking
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";;
+*)PERL5DYNAMICLINKING="";;
+esac
AC_SUBST(PERL5EXT)
+AC_SUBST(PERL5DYNAMICLINKING)
+AC_SUBST(PERL5LIB)
+
+# kludges to ease naming conventions conformance.
+( cd Examples ;
+ test -d perl || ln -s perl5 perl ;
+ test -d test-suite/perl || ( cd test-suite && ln -s perl5 perl ) )
#----------------------------------------------------------------
# Look for java
@@ -505,7 +656,13 @@ 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=])
if test -z "$JAVAINCDIR"; then
- JAVAINCDIR="/usr/jdk*/include /usr/local/jdk*/include /opt/jdk*/include /usr/java/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/include/kaffe /usr/local/include/kaffe /usr/include /usr/local/include"
+ 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/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/include/kaffe /usr/local/include/kaffe /usr/include /usr/local/include"
+
+ # Add in default installation directory on Windows for Cygwin
+ case $ac_sys_system/$ac_sys_release in
+ CYGWIN*) JAVAINCDIR="c:/j2sdk*/include d:/j2sdk*/include c:/jdk*/include d:/jdk*/include $JAVAINCDIR";;
+ *);;
+ esac
fi
JAVAINC=""
@@ -533,9 +690,29 @@ else
fi
fi
+# java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*)
+ if test "$GCC" = yes; then
+ JAVADYNAMICLINKING=" -Wl,--add-stdcall-alias"
+ else
+ JAVADYNAMICLINKING=""
+ fi ;;
+*)JAVADYNAMICLINKING="";;
+esac
+
+# Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*) JAVALIBRARYPREFIX="";;
+*)JAVALIBRARYPREFIX="lib";;
+esac
+
+
AC_SUBST(JAVA)
AC_SUBST(JAVAC)
AC_SUBST(JAVAINC)
+AC_SUBST(JAVADYNAMICLINKING)
+AC_SUBST(JAVALIBRARYPREFIX)
AC_SUBST(ROOT_DIR)ROOT_DIR=`pwd`
@@ -583,7 +760,7 @@ if test -n "$GUILE_CONFIG" ; then
fi
done
if test -z "$GUILEINCLUDE"; then
- GUILEINCLUDE="-I/usr/local/include"
+# GUILEINCLUDE="-I/usr/local/include"
AC_MSG_RESULT(not found)
fi
@@ -598,7 +775,7 @@ if test -n "$GUILE_CONFIG" ; then
done
if test -z "$GUILELIB"; then
AC_MSG_RESULT(not found)
- GUILELIB="/usr/local/lib"
+# GUILELIB="/usr/local/lib"
fi
GUILELINK="`guile-config link`"
@@ -626,10 +803,11 @@ AC_ARG_WITH(ruby,[ --with-ruby=path Set location of Ruby executable],[ R
# First figure out what the name of Ruby is
if test -z "$RUBYBIN"; then
-AC_CHECK_PROGS(RUBY, ruby)
+ AC_CHECK_PROGS(RUBY, ruby)
else
-RUBY="$RUBYBIN"
+ RUBY="$RUBYBIN"
fi
+
AC_MSG_CHECKING(for Ruby header files)
if test -n "$RUBY"; then
RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
@@ -648,68 +826,227 @@ if test -n "$RUBY"; then
AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
fi
+ # Find library and path for linking. Use libruby.a except on Cygwin use the DLL.
AC_MSG_CHECKING(for Ruby library)
- RUBYLIB=none
- for i in $dirs; do
- if test -r $i/libruby.a; then
- AC_MSG_RESULT($i)
- RUBYLIB="$i"
- break;
- fi
- done
- if test "$RUBYLIB" = none; then
+ RUBYLIB=""
+ case $ac_sys_system/$ac_sys_release in
+ CYGWIN*)
+ rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
+ rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
+ dirs="$dirs $rb_libdir $rb_bindir"
+ rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_SO"]]') 2>/dev/null`
+ RUBYLINK=`($RUBY -rrbconfig -e 'print Config::CONFIG[["RUBY_SO_NAME"]]') 2>/dev/null`
+ ;;
+ *)
+ rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
+ RUBYLINK=`($RUBY -rrbconfig -e 'print Config::CONFIG[["RUBY_INSTALL_NAME"]]') 2>/dev/null`
+ ;;
+ esac
+ if test "$rb_libruby" != ""; then
+ for i in $dirs; do
+ if (test -r $i/$rb_libruby;) then
+ RUBYLIB="$i"
+ break;
+ fi
+ done
+ fi
+ if test "$RUBYLIB" = ""; then
RUBYLIB="$RUBYDIR"
- AC_MSG_RESULT(could not locate libruby.a...using $RUBYLIB)
+ AC_MSG_RESULT(not found... using $RUBYDIR)
+ else
+ AC_MSG_RESULT($RUBYLINK in $RUBYLIB)
fi
else
AC_MSG_RESULT(unable to determine ruby configuration)
RUBYINCLUDE="-I$RUBYDIR"
RUBYLIB="$RUBYDIR"
fi
- RUBYLINK=`($RUBY -rrbconfig -e 'print Config::CONFIG[["RUBY_INSTALL_NAME"]]') 2>/dev/null`
- RUBYLINK="-l$RUBYLINK"
- RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`"
+ RUBYLINK="-l$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`"
+ RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
else
- AC_MSG_RESULT(could not figure out how to run ruby)
+ AC_MSG_RESULT(could not figure out how to run ruby)
RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch"
- RUBYLIB="-I/usr/local/lib/ruby/1.4/arch"
+ RUBYLIB="/usr/local/lib/ruby/1.4/arch"
RUBYLINK="-lruby -lm"
fi
+case $ac_sys_system/$ac_sys_release in
+CYGWIN*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";;
+*) RUBYDYNAMICLINKING="";;
+esac
+
+
AC_SUBST(RUBYINCLUDE)
AC_SUBST(RUBYLIB)
AC_SUBST(RUBYLINK)
+AC_SUBST(RUBYCCDLFLAGS)
+AC_SUBST(RUBYDYNAMICLINKING)
+
+#-------------------------------------------------------------------------
+# Look for Php4
+#-------------------------------------------------------------------------
+
+PHP4BIN=
+
+AC_ARG_WITH(php4,[ --with-php4=path Set location of PHP4 executable],[ PHP4BIN="$withval"], [PHP4BIN=])
+
+if test -z "$PHP4BIN"; then
+AC_CHECK_PROGS(PHP4, php, php4)
+else
+PHP4="$PHP4BIN"
+fi
+
+AC_SUBST(PHP4)
+
+AC_MSG_CHECKING(for PHP4 header files)
+dirs="/usr/include/php /usr/local/include/php /usr/local/apache/php"
+for i in $dirs; do
+ if test -r $i/php_config.h -o -r $i/php_version.h; then
+ AC_MSG_RESULT($i)
+ PHP4EXT="$i"
+ PHP4INC="-I$PHP4EXT -I$PHP4EXT/Zend -I$PHP4EXT/main -I$PHP4EXT/TSRM"
+ break;
+ fi
+done
+if test -z "$PHP4INC"; then
+ AC_MSG_RESULT(not found)
+fi
+
+AC_SUBST(PHP4INC)
+
+# kludges to ease naming conventions conformance.
+( cd Examples/GIFPlot ; test -d Php4 || ln -s Php Php4 )
+( cd Examples/php4 ; for dir in `sed '/^#/d' check.list` ; do
+ test -f $dir/Makefile || ( cd $dir ; ln -s ../Makefile.php Makefile )
+ done )
+
+#----------------------------------------------------------------
+# Detect ocaml
+#----------------------------------------------------------------
+
+AC_ARG_WITH(ocaml,[ --with-ocaml=path Set location of ocaml executable],[ OCAMLBIN="$withval"], [OCAMLBIN=])
+AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable],[ OCAMLC="$withval"], [OCAMLC=])
+AC_MSG_CHECKING(for Ocaml compiler)
+if test -z "$OCAMLC"; then
+AC_CHECK_PROGS(OCAMLC, ocamlc, ocamlc)
+else
+OCAMLC="$OCAMLC"
+fi
+
+AC_MSG_CHECKING(for Ocaml interpreter)
+if test -z "$OCAMLBIN"; then
+AC_CHECK_PROGS(OCAMLBIN, ocaml, ocaml)
+else
+OCAMLBIN="$OCAMLBIN"
+fi
+AC_MSG_CHECKING(for Ocaml header files)
+dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml"
+for i in $dirs; do
+ if test -r $i/mlvalues.h; then
+ AC_MSG_RESULT($i)
+ OCAMLEXT="$i"
+ OCAMLINC="-I$OCAMLEXT"
+ break;
+ fi
+done
+if test -z "$OCAMLINC"; then
+ AC_MSG_RESULT(not found)
+fi
+
+export OCAMLINC
+export OCAMLBIN
+export OCAMLC
+
+AC_SUBST(OCAMLINC)
+AC_SUBST(OCAMLBIN)
+AC_SUBST(OCAMLC)
+
+#----------------------------------------------------------------
+# Look for Pike
+#----------------------------------------------------------------
+
+# Identify the name of the Pike executable
+PIKEBIN=
+AC_ARG_WITH(pike,[ --with-pike=path Set location of Pike executable],[ PIKEBIN="$withval"], [PIKEBIN=])
+if test -z "$PIKEBIN"; then
+ AC_CHECK_PROGS(PIKE, pike)
+else
+ PIKE="$PIKEBIN"
+fi
+
+# Check for a --with-pikeincl option to configure
+PIKEINCLUDE=
+AC_ARG_WITH(pikeincl,[ --with-pikeincl=path Set location of Pike include directory],[
+ PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=])
+
+AC_MSG_CHECKING(for Pike header files)
+if test -z "$PIKEINCLUDE"; then
+if test -n "$PIKE"; then
+ PIKEPATH=`which $PIKE`
+ PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH`
+ AC_MSG_RESULT($PIKEINCLUDE)
+ PIKEINCLUDE="-I$PIKEINCLUDE"
+fi
+if test -z "$PIKEINCLUDE"; then
+ AC_MSG_RESULT(not found)
+fi
+else
+ AC_MSG_RESULT($PIKEINCLUDE)
+fi
+
+AC_SUBST(PIKEINCLUDE)
+AC_SUBST(PIKECCDLFLAGS)
+AC_SUBST(PIKEDYNAMICLINKING)
#----------------------------------------------------------------
# Miscellaneous
#----------------------------------------------------------------
-# These commands are only intended for use in a development environment.
+# Configure SWIG_LIB path
+
+AC_ARG_WITH(swiglibdir,[ --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR.],
+ [swig_lib="$withval"], [swig_lib="\$(prefix)/lib/swig1.3"])
+AC_SUBST(swig_lib)
+
+# Configure RELEASESUFFIX (for setups having both SWIG 1.1 and 1.3 on a system...)
+
+AC_ARG_WITH(release-suffix,
+ [ --with-release-suffix=SUFFIX Attach SUFFIX to the binary and the runtime libs. ],
+ [release_suffix="$withval"], [release_suffix=""])
+AC_SUBST(release_suffix)
+
+##########
+# The commands below are only intended for use in a development environment.
# When one makes a fresh CVS checkout, no 'configure' scripts exist. This
# Makes the CONFIG_SUBDIRS macro fail below. To fix this, one needs to
# generate the configure script by calling autoconf manually. This is
# not an issue in non-CVS releases--the mkdist.py script creates all
# of the configure scripts before making a tar-ball. -- beazley 2000/03/01
-if test ! -r $srcdir/Source/DOH/configure; then
- (cd $srcdir/Source/DOH ; autoconf)
-fi
+# All these have been commented out as it turned out that the mkdist.py
+# script was not creating all of the configure files in subdirectories.
+# This required autoconf to be installed on user's machines when installing
+# SWIG - not a good requirement. Developers should run the autogen.sh instead.
+# Do not uncomment else the same problem may arise again. - William Fulton 2001/08/03.
-#if test -d $srcdir/Source/SWILL/SWILL; then
-# if test ! -r $srcdir/Source/SWILL/configure; then
-# (cd $srcdir/Source/SWILL ; autoconf)
-# fi
+#if test ! -r $srcdir/Source/DOH/configure; then
+# (cd $srcdir/Source/DOH ; autoconf)
#fi
-if test ! -r $srcdir/Tools/configure ; then
- (cd $srcdir/Tools ; autoconf)
-fi
+#if test ! -r $srcdir/Tools/configure ; then
+# (cd $srcdir/Tools ; autoconf)
+#fi
+
+#if test ! -r $srcdir/Examples/GIFPlot/configure ; then
+# (cd $srcdir/Examples/GIFPlot ; autoconf)
+#fi
#
#AC_OUTPUT_COMMANDS(test -f Examples/install-sh || cp install-sh Examples)
# DB: Maybe I'm missings something, but why is it necessary to put
# an 'install-sh' script in the Examples directory?
+###########
AC_CONFIG_SUBDIRS(Source/DOH Tools)
@@ -720,15 +1057,13 @@ test -d Source || mkdir Source
dnl We use the following in `AC_OUTPUT' and "make distclean".
configure_substituted_files=`echo \
Examples/Makefile \
- Examples/C++/test_conf.py \
Examples/guile/Makefile \
- Examples/xml/Makefile \
+ Examples/GIFPlot/Makefile \
+ Examples/GIFPlot/Lib/Makefile \
Makefile \
Runtime/Makefile \
- Source/Include/swigconfig.h \
Source/Include/swigver.h \
- Source/LParse/Makefile \
- Source/Modules/Makefile \
+ Source/CParse/Makefile \
Source/Modules1.1/Makefile \
Source/Preprocessor/Makefile \
Source/Swig/Makefile \