/tags/rel-1.3.35/configure.in
Autoconf | 2053 lines | 1543 code | 290 blank | 220 comment | 285 complexity | 22e13952db4f16104c4c6d44151d6e5b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
Large files files are truncated, but you can click here to view the full file
- 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],[1.3.35],[http://www.swig.org])
- AC_PREREQ(2.58)
- AC_CONFIG_SRCDIR([Source/Swig/swig.h])
- AC_CONFIG_AUX_DIR([Tools/config])
- AC_CONFIG_HEADERS([Source/Include/swigconfig.h])
- AC_CANONICAL_HOST
- AM_INIT_AUTOMAKE
- dnl Some extra defines for the config file
- AH_BOTTOM([
- /* Default language */
- #define SWIG_LANG "-tcl"
- /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
- #if defined(_MSC_VER)
- # define _CRT_SECURE_NO_DEPRECATE
- #endif
- ])
- dnl Checks for programs.
- AC_PROG_CC
- AC_PROG_CXX
- AC_PROG_YACC
- AC_EXEEXT
- AC_OBJEXT
- AC_PROG_RANLIB
- AM_PROG_CC_C_O # Needed for subdir-objects in AUTOMAKE_OPTIONS
- AC_CHECK_PROGS(AR, ar aal, ar)
- AC_SUBST(AR)
- AC_COMPILE_WARNINGS # Increase warning levels
- AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG])
- AC_DEFINE_UNQUOTED(SWIG_PLATFORM, ["$build"], [Platform that SWIG is built for])
- dnl Checks for header files.
- AC_HEADER_STDC
- dnl How to specify include directories that may be system directories.
- # -I should not be used on system directories (GCC)
- if test "$GCC" = yes; then
- ISYSTEM="-isystem "
- else
- ISYSTEM="-I"
- fi
- dnl Checks for types.
- AC_LANG_PUSH([C++])
- AC_CHECK_TYPES([bool])
- AC_LANG_POP([C++])
- # Set info about shared libraries.
- 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!)
- AC_MSG_CHECKING(SO)
- if test -z "$SO"
- then
- case $host in
- *-*-hp*) SO=.sl;;
- *-*-darwin*) SO=.bundle;;
- *-*-cygwin* | *-*-mingw*) SO=.dll;;
- *) SO=.so;;
- esac
- fi
- AC_MSG_RESULT($SO)
- # LDSHARED is the ld *command* used to create 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(LDSHARED)
- if test -z "$LDSHARED"
- then
- case $host in
- *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
- *-*-cygwin* | *-*-mingw*)
- 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 ;;
- *-*-irix5*) LDSHARED="ld -shared";;
- *-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
- *-*-sunos4*) LDSHARED="ld";;
- *-*-solaris*) LDSHARED="ld -G";;
- *-*-hp*) LDSHARED="ld -b";;
- *-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
- *-sequent-sysv4) LDSHARED="ld -G";;
- *-*-next*)
- if test "$ns_dyld"
- then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
- else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
- fi
- if test "$with_next_framework" ; then
- LDSHARED="$LDSHARED \$(LDLIBRARY)"
- fi ;;
- *-*-linux*) LDSHARED="gcc -shared";;
- *-*-dgux*) LDSHARED="ld -G";;
- *-*-freebsd3*) LDSHARED="gcc -shared";;
- *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";;
- *-*-netbsd*)
- if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
- then
- LDSHARED="cc -shared"
- else
- LDSHARED="ld -Bshareable"
- fi;;
- *-sco-sysv*) 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 $host in
- *-*-solaris*) if test "$GCC" = yes;
- then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G";
- else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd";
- fi;;
- *-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";;
- *-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";;
- *-*-cygwin* | *-*-mingw*)
- 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)
- if test -z "$CCSHARED"
- then
- case $host in
- *-*-hp*) if test "$GCC" = yes;
- then CCSHARED="-fpic";
- else CCSHARED="+z";
- fi;;
- *-*-linux*) CCSHARED="-fpic";;
- *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";;
- *-*-netbsd*) CCSHARED="-fPIC";;
- *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";;
- *-*-irix6*) case $CC in
- *gcc*) CCSHARED="-shared";;
- *) CCSHARED="";;
- esac;;
- esac
- fi
- AC_MSG_RESULT($CCSHARED)
- # RPATH is the path used to look for shared library files.
- AC_MSG_CHECKING(RPATH)
- if test -z "$RPATH"
- then
- case $host in
- *-*-solaris*) 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)
- AC_SUBST(RPATH)
- # LINKFORSHARED are the flags passed to the $(CC) command that links
- # the a few executables -- this is only needed for a few systems
- AC_MSG_CHECKING(LINKFORSHARED)
- if test -z "$LINKFORSHARED"
- then
- case $host in
- *-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
- *-*-hp*)
- LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- *-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
- *-*-next*) LINKFORSHARED="-u libsys_s";;
- *-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
- *-*-irix6*) LINKFORSHARED="-all";;
- esac
- fi
- AC_MSG_RESULT($LINKFORSHARED)
- # This variation is needed on OS-X because there is no (apparent) consistency in shared library naming.
- # Sometimes .bundle works, but sometimes .so is needed. It depends on the target language
- AC_SUBST(PYTHON_SO)
- case $host in
- *-*-mingw*) PYTHON_SO=.pyd;;
- *-*-darwin*) PYTHON_SO=.so;;
- *) PYTHON_SO=$SO;;
- esac
- AC_SUBST(TCL_SO)
- case $host in
- *-*-darwin*) TCL_SO=.dylib;;
- *) TCL_SO=$SO;;
- esac
- AC_SUBST(GUILE_SO)
- case $host in
- *-*-darwin*) GUILE_SO=.so;;
- *) GUILE_SO=$SO;;
- esac
- AC_SUBST(PHP4_SO)
- case $host in