swig/configure.in
Dustin Mitchell c4a023be78 Moved Makefiles and configure.in to the top level, and added .cvsignore
files to most subdirectories to make things a bit cleaner.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@37 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-01-11 20:51:24 +00:00

175 lines
4.9 KiB
Text

dnl Process this file with autoconf to produce a configure script.
AC_INIT(Source/Core/swigcore.h)
AC_PREREQ(2.0)
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
if test -f /usr/lib/NextStep/software_version; then
set X `hostinfo | grep 'NeXT Mach.*:' | \
sed -e 's/://' -e 's/\./_/'` && \
ac_sys_system=next && ac_sys_release=$4
MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
else
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" ; then
ac_sys_release=`uname -v`
else
ac_sys_release=`uname -r`
fi
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
fi
case MACHDEP in
'') MACHDEP=unknown;;
esac
fi
AC_MSG_RESULT($MACHDEP)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
dnl Checks for programs.
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for library functions.
# Set info about shared libraries.
AC_SUBST(SO)
AC_SUBST(LDSHARED)
AC_SUBST(CCSHARED)
# SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX
AC_MSG_CHECKING(SO)
if test -z "$SO"
then
case $ac_sys_system in
hp*|HP*) SO=.sl;;
*) 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 $ac_sys_system/$ac_sys_release in
AIX*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/4*) LDSHARED="ld";;
SunOS/5*) LDSHARED="ld -G";;
hp*|HP*) LDSHARED="ld -b";;
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
DYNIX/ptx*) 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";;
FreeBSD*/3*) 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_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
*) LDSHARED="ld";;
esac
fi
AC_MSG_RESULT($LDSHARED)
# 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 $ac_sys_system/$ac_sys_release in
hp*|HP*) if test "$GCC" = yes;
then CCSHARED="-fpic";
else CCSHARED="+z";
fi;;
Linux*) CCSHARED="-fpic";;
FreeBSD*|OpenBSD*) CCSHARED="-fpic";;
NetBSD*) CCSHARED="-fPIC";;
SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";;
IRIX*/6*) case $CC in
*gcc*) CCSHARED="-shared";;
*) CCSHARED="";;
esac;;
esac
fi
AC_MSG_RESULT($CCSHARED)
AC_ARG_WITH(yacc,[ --without-yacc Try to compile without yacc/bison], [
YACC="cp parser.cxx.no y.tab.c; cp parser.h.no y.tab.h"
AC_SUBST(YACC)
YACCFLAGS=""
AC_SUBST(YACCFLAGS)
], [ AC_PROG_YACC
YACCFLAGS="-d parser.y"
AC_SUBST(YACCFLAGS) ])
#----------------------------------------------------------------
# Look for Python
#----------------------------------------------------------------
PYINCLUDE=nope
AC_MSG_CHECKING(for Python header files)
dirs="$PYINCLUDE $PYINCLUDE/python1.5 $PYINCLUDE/python1.4 $PYINCLUDE/Py $prefix/include/python1.5 $prefix/include/python1.4 /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 "$PYINCLUDE" = nope; then
PYINCLUDE="-I/usr/local/include/Py"
AC_MSG_RESULT(not found)
fi
AC_SUBST(PYINCLUDE)
# RPATH is the path used to look for shared library files.
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="";;
esac
fi
AC_MSG_RESULT($RPATH)
AC_SUBST(RPATH)
# Note we write DOH's Makefiles for it -- if it has any special configure
# stuff, we're going to skip it!
AC_OUTPUT(Makefile Source/Core/Makefile Source/DOH/Doh/Makefile
Source/DOH/Makefile Source/Preprocessor/Makefile Source/SWIG1.1/Makefile
Source/Modules1.1/Makefile)