1
dnl Process this file with autoconf to produce a configure script.
2
dnl The macros which aren't shipped with the autotools are stored in the
3
dnl Tools/config directory in .m4 files.
5
AC_INIT([swig],[2.0.3],[http://www.swig.org])
7
dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED
8
dnl definition below can be removed
11
AC_CONFIG_SRCDIR([Source/Swig/swig.h])
12
AC_CONFIG_AUX_DIR([Tools/config])
13
AC_CONFIG_HEADERS([Source/Include/swigconfig.h])
17
dnl Some extra defines for the config file
19
/* Default language */
20
#define SWIG_LANG "-tcl"
22
/* Deal with Microsofts attempt at deprecating C standard runtime functions */
24
# define _CRT_SECURE_NO_DEPRECATE
28
dnl Check for programs that a user requires to build SWIG
33
AM_PROG_CC_C_O # Needed for subdir-objects in AUTOMAKE_OPTIONS
35
AC_COMPILE_WARNINGS # Increase warning levels
37
AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG])
38
AC_DEFINE_UNQUOTED(SWIG_PLATFORM, ["$build"], [Platform that SWIG is built for])
40
dnl Checks for header files.
45
AC_CHECK_TYPES([bool])
49
AC_ARG_WITH(popen, AS_HELP_STRING([--without-popen], [Disable popen]), with_popen="$withval")
50
if test x"${with_popen}" = xno ; then
51
AC_MSG_NOTICE([Disabling popen])
53
AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen]))
58
dnl AX_PATH_GENERIC() relies on AC_PROG_SED() but it is defined only in
59
dnl autoconf 2.60 so trivially predefine it ourselves for the older versions
60
m4_ifdef([AC_PROG_SED],, [AC_DEFUN([AC_PROG_SED], [AC_PATH_PROG([SED], sed)])])
63
[AS_HELP_STRING([--without-pcre],
64
[Disable support for regular expressions using PCRE])],
68
AC_MSG_CHECKING([whether to enable PCRE support])
69
AC_MSG_RESULT([$with_pcre])
71
dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
72
if test x"${with_pcre}" = xyes ; then
73
AC_MSG_CHECKING([whether to use local PCRE])
75
if test -z $PCRE_CONFIG; then
76
if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then
77
PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config
78
local_pcre_config=$PCRE_CONFIG
81
AC_MSG_RESULT([$local_pcre_config])
83
AS_IF([test "x$with_pcre" != xno],
84
[AX_PATH_GENERIC([pcre],
85
[], dnl Minimal version of PCRE we need -- accept any
86
[], dnl custom sed script for version parsing is not needed
87
[AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
88
LIBS="$LIBS $PCRE_LIBS"
89
CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
92
Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
93
library package. This dependency is needed for configure to complete,
95
- Install the PCRE developer package on your system (preferred approach).
96
- Download the PCRE source tarball, build and install on your system
97
as you would for any package built from source distribution.
98
- Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
99
link against. Run 'Tools/pcre-build.sh --help' for instructions.
100
(quite easy and does not require privileges to install PCRE on your system)
101
- Use configure --without-pcre to disable regular expressions support in SWIG
108
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])
109
AC_MSG_CHECKING([whether to enable ccache-swig])
110
AC_MSG_RESULT([$enable_ccache])
112
if test "$enable_ccache" = yes; then
113
AC_CONFIG_SUBDIRS(CCache)
116
AC_SUBST(ENABLE_CCACHE)
120
echo "Checking packages required for SWIG developers."
121
echo "Note : None of the following packages are required for users to compile and install SWIG"
126
AC_CHECK_PROGS(AR, ar aal, ar)
128
AC_CHECK_PROGS(YODL2MAN, yodl2man)
129
AC_CHECK_PROGS(YODL2HTML, yodl2html)
133
echo "Checking for installed target languages and other information in order to compile and run"
134
echo "the examples and test-suite invoked by 'make check'."
135
echo "Note : None of the following packages are required for users to compile and install SWIG"
138
dnl Some test cases require Boost
140
AC_SUBST(BOOST_CPPFLAGS)
142
dnl How to specify include directories that may be system directories.
143
# -I should not be used on system directories (GCC)
144
if test "$GCC" = yes; then
151
dnl Info for building shared libraries ... in order to run the examples
153
# SO is the extension of shared libraries (including the dot!)
159
*-*-darwin*) SO=.bundle;;
160
*-*-cygwin* | *-*-mingw*) SO=.dll;;
166
# LDSHARED is the ld *command* used to create shared library
167
# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
168
# (Shared libraries in this instance are shared modules to be loaded into
169
# Python, as opposed to building Python itself as a shared library.)
170
AC_MSG_CHECKING(LDSHARED)
171
if test -z "$LDSHARED"
174
*-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
175
*-*-cygwin* | *-*-mingw*)
176
if test "$GCC" = yes; then
177
LDSHARED="$CC -shared"
179
if test "cl" = $CC ; then
180
# Microsoft Visual C++ (MSVC)
181
LDSHARED="$CC -nologo -LD"
183
# Unknown compiler try gcc approach
184
LDSHARED="$CC -shared"
187
*-*-irix5*) LDSHARED="ld -shared";;
188
*-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
189
*-*-sunos4*) LDSHARED="ld";;
190
*-*-solaris*) LDSHARED="ld -G";;
191
*-*-hp*) LDSHARED="ld -b";;
192
*-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
193
*-sequent-sysv4) LDSHARED="ld -G";;
196
then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
197
else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
199
if test "$with_next_framework" ; then
200
LDSHARED="$LDSHARED \$(LDLIBRARY)"
202
*-*-linux*) LDSHARED="gcc -shared";;
203
*-*-dgux*) LDSHARED="ld -G";;
204
*-*-freebsd3*) LDSHARED="gcc -shared";;
205
*-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";;
207
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
209
LDSHARED="cc -shared"
211
LDSHARED="ld -Bshareable"
213
*-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
214
*-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";;
218
AC_MSG_RESULT($LDSHARED)
219
# CXXSHARED is the ld *command* used to create C++ shared library
220
# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
221
# (Shared libraries in this instance are shared modules to be loaded into
222
# Python, as opposed to building Python itself as a shared library.)
223
AC_MSG_CHECKING(CXXSHARED)
224
if test -z "$CXXSHARED"
226
CXXSHARED="$LDSHARED"
228
AC_MSG_RESULT($CXXSHARED)
231
AC_MSG_CHECKING(TRYLINKINGWITHCXX)
232
if test -z "$TRYLINKINGWITHCXX"
235
*-*-solaris*) if test "$GCC" = yes;
236
then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G";
237
else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd";
239
*-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";;
240
*-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";;
241
*-*-cygwin* | *-*-mingw*)
242
if test "$GCC" = yes; then
243
TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared "
245
if test "cl" = $CXX ; then
246
# Microsoft Visual C++ (MSVC)
247
TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD"
249
TRYLINKINGWITHCXX="#unknown Windows compiler"
252
*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";;
255
AC_MSG_RESULT($TRYLINKINGWITHCXX)
256
# CCSHARED are the C *flags* used to create objects to go into a shared
257
# library (module) -- this is only needed for a few systems
258
AC_MSG_CHECKING(CCSHARED)
259
if test -z "$CCSHARED"
262
*-*-hp*) if test "$GCC" = yes;
263
then CCSHARED="-fpic";
266
*-*-linux*) CCSHARED="-fpic";;
267
*-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";;
268
*-*-netbsd*) CCSHARED="-fPIC";;
269
*-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";;
270
*-*-irix6*) case $CC in
271
*gcc*) CCSHARED="-shared";;
276
AC_MSG_RESULT($CCSHARED)
278
# RPATH is the path used to look for shared library files.
279
AC_MSG_CHECKING(RPATH)
283
*-*-solaris*) RPATH='-R. -R$(exec_prefix)/lib';;
284
*-*-irix*) RPATH='-rpath .:$(exec_prefix)/lib';;
285
*-*-linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';;
289
AC_MSG_RESULT($RPATH)
291
# LINKFORSHARED are the flags passed to the $(CC) command that links
292
# the a few executables -- this is only needed for a few systems
294
AC_MSG_CHECKING(LINKFORSHARED)
295
if test -z "$LINKFORSHARED"
298
*-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
300
LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
301
*-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
302
*-*-next*) LINKFORSHARED="-u libsys_s";;
303
*-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
304
*-*-irix6*) LINKFORSHARED="-all";;
307
AC_MSG_RESULT($LINKFORSHARED)
309
# Optional CFLAGS used to silence/enhance compiler warnings on some platforms.
310
AC_MSG_CHECKING(PLATFLAGS)
312
*-*-solaris*) if test "$GCC" = yes;
315
# else PLATFLAGS="-errtags=yes" # Need more work as C examples use ld for linking
319
AC_MSG_RESULT($PLATFLAGS)
321
# Set info about shared libraries.
326
AC_SUBST(TRYLINKINGWITHCXX)
329
AC_SUBST(LINKFORSHARED)
331
# This variation is needed on OS-X because there is no (apparent) consistency in shared library naming.
332
# Sometimes .bundle works, but sometimes .so is needed. It depends on the target language
336
*-*-mingw*) PYTHON_SO=.pyd;;
337
*-*-darwin*) PYTHON_SO=.so;;
343
*-*-darwin*) TCL_SO=.dylib;;
349
*-*-darwin*) GUILE_SO=.so;;
355
*-*-darwin*) PHP_SO=.so;;
359
AC_SUBST(MZSCHEME_SO)
366
*-*-darwin*) LUA_SO=.so;;
370
# Check for specific libraries. Used for SWIG examples
371
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
372
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
374
dnl The following three libraries (nsl,inet,socket) are needed on Sequent,
375
dnl and must be checked for in this order since each library depends on the
378
dnl Most SVR4 platforms will need -lsocket and -lnsl. However on SGI IRIX 5,
379
dnl these exist but are broken, so we use AC_SEARCH_LIBS which will only try
380
dnl the library if the function isn't already available without it.
381
AC_SEARCH_LIBS(t_open, nsl) # SVR4
382
AC_SEARCH_LIBS(gethostbyname, inet) # Sequent
383
AC_SEARCH_LIBS(socket, socket) # SVR4 sockets
385
AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"])
389
# check for --with-libm=...
392
AC_ARG_WITH(libm, [ --with-libm=STRING math library], [
393
if test "$withval" != yes
395
else AC_MSG_ERROR([proper usage is --with-libm=STRING])
397
AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"])
398
AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"])
401
# check for --with-libc=...
403
AC_ARG_WITH(libc, [ --with-libc=STRING C library], [
404
if test "$withval" != yes
406
else AC_MSG_ERROR([proper usage is --with-libc=STRING])
409
#--------------------------------------------------------------------
410
# Locate the X11 header files and the X11 library archive. Try
411
# the ac_path_x macro first, but if it doesn't find the X stuff
412
# (e.g. because there's no xmkmf program) then check through
413
# a list of possible directories. Under some conditions the
414
# autoconf macro will return an include directory that contains
415
# no include files, so double-check its result just to be safe.
416
#--------------------------------------------------------------------
420
if test "$no_x" = ""; then
421
if test "$x_includes" = ""; then
422
AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
424
if test ! -r $x_includes/X11/Intrinsic.h; then
425
not_really_there="yes"
429
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
430
AC_MSG_CHECKING(for X11 header files)
431
XINCLUDES="# no special path needed"
432
AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="")
433
if test -z "$XINCLUDES"; then
434
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include /usr/X11R6/include /usr/include/X11R6"
436
if test -r $i/X11/Intrinsic.h; then
442
AC_MSG_RESULT($XINCLUDES)
444
if test "$x_includes" != ""; then
445
XINCLUDES=-I$x_includes
447
XINCLUDES="# no special path needed"
450
if test -z "$XINCLUDES"; then
451
AC_MSG_RESULT(couldn't find any!)
452
XINCLUDES="# no include files found"
455
if test "$no_x" = yes; then
456
AC_MSG_CHECKING(for X11 libraries)
458
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/X11R6/lib /usr/lib/X11R6 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
460
if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
467
if test "$x_libraries" = ""; then
470
XLIBSW="-L$x_libraries -lX11"
473
if test -z "$XLIBSW" ; then
474
AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
476
if test -z "$XLIBSW" ; then
477
AC_MSG_RESULT(couldn't find any! Using -lX11.)
484
AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
486
#--------------------------------------------------------------------
488
#--------------------------------------------------------------------
494
AC_ARG_WITH(tclconfig, AS_HELP_STRING([--without-tcl], [Disable Tcl])
495
AS_HELP_STRING([--with-tclconfig=path], [Set location of tclConfig.sh]), [with_tclconfig="$withval"], [with_tclconfig=])
497
[ --with-tcl=path Set location of Tcl package],[
498
TCLPACKAGE="$withval"], [TCLPACKAGE=yes])
499
AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
500
TCLINCLUDE="$ISYSTEM$withval"], [TCLINCLUDE=])
501
AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
502
TCLLIB="-L$withval"], [TCLLIB=])
504
# First, check for "--without-tcl" or "--with-tcl=no".
505
if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then
506
AC_MSG_NOTICE([Disabling Tcl])
508
AC_MSG_CHECKING([for Tcl configuration])
509
# First check to see if --with-tclconfig was specified.
510
if test x"${with_tclconfig}" != x ; then
511
if test -f "${with_tclconfig}/tclConfig.sh" ; then
512
TCLCONFIG=`(cd ${with_tclconfig}; pwd)`
514
AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
517
# check in a few common install locations
518
if test x"${TCLCONFIG}" = x ; then
519
for i in `ls -d /usr/lib/ 2>/dev/null` \
520
`ls -d -r /usr/lib/tcl*/ 2>/dev/null` \
521
`ls -d /usr/local/lib/ 2>/dev/null` \
522
`ls -d -r /usr/local/lib/tcl*/ 2>/dev/null` ; do
523
if test -f $i"tclConfig.sh" ; then
524
TCLCONFIG=`(cd $i; pwd)`
529
if test x"${TCLCONFIG}" = x ; then
532
AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
533
. $TCLCONFIG/tclConfig.sh
534
if test -z "$TCLINCLUDE"; then
535
TCLINCLUDE=`echo $TCL_INCLUDE_SPEC | sed "s/-I/$ISYSTEM/"`
537
if test -z "$TCLLIB"; then
542
if test -z "$TCLINCLUDE"; then
543
if test "x$TCLPACKAGE" != xyes; then
544
TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include"
548
if test -z "$TCLLIB"; then
549
if test "x$TCLPACKAGE" != xyes; then
550
TCLLIB="-L$TCLPACKAGE/lib -ltcl"
554
AC_MSG_CHECKING(for Tcl header files)
555
if test -z "$TCLINCLUDE"; then
556
AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
557
if test -z "$TCLINCLUDE"; then
558
dirs="/usr/local/include /usr/include /opt/local/include"
560
if test -r $i/tcl.h; then
562
TCLINCLUDE="$ISYSTEM$i"
567
if test -z "$TCLINCLUDE"; then
568
AC_MSG_RESULT(not found)
571
AC_MSG_RESULT($TCLINCLUDE)
574
AC_MSG_CHECKING(for Tcl library)
575
if test -z "$TCLLIB"; then
576
dirs="/usr/local/lib /usr/lib /opt/local/lib"
578
if test -r $i/libtcl.a; then
584
if test -z "$TCLLIB"; then
585
AC_MSG_RESULT(not found)
588
AC_MSG_RESULT($TCLLIB)
591
# Cygwin (Windows) needs the library for dynamic linking
593
*-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";;
594
*)TCLDYNAMICLINKING="";;
599
TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace'
600
TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace'
603
TCLLDSHARED='$(LDSHARED)'
604
TCLCXXSHARED='$(CXXSHARED)'
612
AC_SUBST(TCLDYNAMICLINKING)
613
AC_SUBST(TCLLDSHARED)
614
AC_SUBST(TCLCXXSHARED)
616
#----------------------------------------------------------------
618
#----------------------------------------------------------------
624
AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Disable Python])
625
AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBIN="$withval"], [PYBIN=yes])
627
# First, check for "--without-python" or "--with-python=no".
628
if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then
629
AC_MSG_NOTICE([Disabling Python])
631
# First figure out the name of the Python executable
633
if test "x$PYBIN" = xyes; then
634
AC_CHECK_PROGS(PYTHON, [python python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python])
639
if test -n "$PYTHON"; then
640
AC_MSG_CHECKING(for Python prefix)
641
PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
642
AC_MSG_RESULT($PYPREFIX)
643
AC_MSG_CHECKING(for Python exec-prefix)
644
PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
645
AC_MSG_RESULT($PYEPREFIX)
648
# Note: I could not think of a standard way to get the version string from different versions.
649
# This trick pulls it out of the file location for a standard library file.
651
AC_MSG_CHECKING(for Python version)
653
# Need to do this hack since autoconf replaces __file__ with the name of the configure file
655
PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")`
656
AC_MSG_RESULT($PYVERSION)
658
# Find the directory for libraries this is necessary to deal with
659
# platforms that can have apps built for multiple archs: e.g. x86_64
660
AC_MSG_CHECKING(for Python lib dir)
661
PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null`
662
if test -z "$PYLIBDIR"; then
663
# older versions don't have sys.lib so the best we can do is assume lib
666
AC_MSG_RESULT($PYLIBDIR)
668
# Set the include directory
670
AC_MSG_CHECKING(for Python header files)
671
if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
672
PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config"
674
if test -z "$PYINCLUDE"; then
675
if test -r $PYPREFIX/include/Py/Python.h; then
676
PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib"
679
AC_MSG_RESULT($PYINCLUDE)
681
# Set the library directory blindly. This probably won't work with older versions
682
AC_MSG_CHECKING(for Python library)
683
dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR"
685
if test -d $PYEPREFIX/$PYLIBDIR/$i; then
686
PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
690
if test -z "$PYLIB"; then
691
AC_MSG_RESULT(Not found)
693
AC_MSG_RESULT($PYLIB)
696
# Check for really old versions
697
if test -r $PYLIB/libPython.a; then
698
PYLINK="-lModules -lPython -lObjects -lParser"
700
PYLINK="-l$PYVERSION"
704
# Cygwin (Windows) needs the library for dynamic linking
706
*-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
707
DEFS="-DUSE_DL_IMPORT $DEFS" PYINCLUDE="$PYINCLUDE"
709
*)PYTHONDYNAMICLINKING="";;
716
AC_SUBST(PYTHONDYNAMICLINKING)
719
#----------------------------------------------------------------
720
# Look for Python 3.x
721
#----------------------------------------------------------------
723
# mostly copy & pasted from "Look for Python" section,
724
# did some trim, fix and rename
730
AC_ARG_WITH(python3, AS_HELP_STRING([--without-python3], [Disable Python 3.x support])
731
AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[ PY3BIN="$withval"], [PY3BIN=yes])
733
# First, check for "--without-python3" or "--with-python3=no".
734
if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then
735
AC_MSG_NOTICE([Disabling Python 3.x support])
737
# First figure out the name of the Python3 executable
739
if test "x$PY3BIN" = xyes; then
740
AC_CHECK_PROGS(PYTHON3, [python3 python3.0 python3.1])
745
# Check for Python 3.x development tools (header files, static library and python3-config)
746
if test "x$PYTHON3" = x; then
747
AC_CHECK_PROGS(PY3CONFIG, [python3-config python3.0-config python3.1-config])
749
AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config python3-config python3.0-config python3.1-config])
752
if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then
753
AC_MSG_CHECKING([for Python 3.x prefix])
754
PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null`
755
AC_MSG_RESULT($PY3PREFIX)
756
AC_MSG_CHECKING(for Python 3.x exec-prefix)
757
PY3EPREFIX=`($PY3CONFIG --exec-prefix) 2>/dev/null`
758
AC_MSG_RESULT($PY3EPREFIX)
760
# Note: I could not think of a standard way to get the version string from different versions.
761
# This trick pulls it out of the file location for a standard library file.
763
AC_MSG_CHECKING([for Python 3.x version])
765
# Need to do this hack since autoconf replaces __file__ with the name of the configure file
767
PY3VERSION=`($PYTHON3 -c "import string,operator,os.path; print(operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1))")`
768
AC_MSG_RESULT($PY3VERSION)
770
# Find the directory for libraries this is necessary to deal with
771
# platforms that can have apps built for multiple archs: e.g. x86_64
772
AC_MSG_CHECKING([for Python 3.x lib dir])
773
PY3LIBDIR=`($PYTHON3 -c "import sys; print(sys.lib)") 2>/dev/null`
774
if test -z "$PY3LIBDIR"; then
775
# some dists don't have sys.lib so the best we can do is assume lib
778
AC_MSG_RESULT($PY3LIBDIR)
780
# Set the include directory
782
AC_MSG_CHECKING([for Python 3.x header files])
783
PY3INCLUDE=`($PY3CONFIG --includes) 2>/dev/null`
784
AC_MSG_RESULT($PY3INCLUDE)
786
# Set the library directory blindly. This probably won't work with older versions
787
AC_MSG_CHECKING([for Python 3.x library])
788
dirs="$PY3VERSION/config $PY3VERSION/$PY3LIBDIR python/$PY3LIBDIR"
790
if test -d $PY3EPREFIX/$PY3LIBDIR/$i; then
791
PY3LIB="$PY3EPREFIX/$PY3LIBDIR/$i"
795
if test -z "$PY3LIB"; then
796
AC_MSG_RESULT([Not found])
798
AC_MSG_RESULT($PY3LIB)
801
PY3LINK="-l$PY3VERSION"
804
# Cygwin (Windows) needs the library for dynamic linking
806
*-*-cygwin* | *-*-mingw*) PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK"
807
DEFS="-DUSE_DL_IMPORT $DEFS" PY3INCLUDE="$PY3INCLUDE"
809
*)PYTHON3DYNAMICLINKING="";;
816
AC_SUBST(PYTHON3DYNAMICLINKING)
819
#----------------------------------------------------------------
821
#----------------------------------------------------------------
825
AC_ARG_WITH(perl5, AS_HELP_STRING([--without-perl5], [Disable Perl5])
826
AS_HELP_STRING([--with-perl5=path], [Set location of Perl5 executable]),[ PERLBIN="$withval"], [PERLBIN=yes])
828
# First, check for "--without-perl5" or "--with-perl5=no".
829
if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then
830
AC_MSG_NOTICE([Disabling Perl5])
834
# First figure out what the name of Perl5 is
836
if test "x$PERLBIN" = xyes; then
837
AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
843
# This could probably be simplified as for all platforms and all versions of Perl the following apparently should be run to get the compilation options:
844
# perl -MExtUtils::Embed -e ccopts
845
AC_MSG_CHECKING(for Perl5 header files)
846
if test -n "$PERL"; then
847
PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null`
848
if test "$PERL5DIR" != ""; then
849
dirs="$PERL5DIR $PERL5DIR/CORE"
852
if test -r $i/perl.h; then
858
if test "$PERL5EXT" = none; then
859
PERL5EXT="$PERL5DIR/CORE"
860
AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
863
AC_MSG_CHECKING(for Perl5 library)
864
PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_, "\n"') 2>/dev/null`
865
if test "$PERL5LIB" = "" ; then
866
AC_MSG_RESULT(not found)
868
AC_MSG_RESULT($PERL5LIB)
870
AC_MSG_CHECKING(for Perl5 compiler options)
871
PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-Wdeclaration-after-statement//" | sed "s/-I/$ISYSTEM/") 2>/dev/null`
872
if test "$PERL5CCFLAGS" = "" ; then
873
AC_MSG_RESULT(not found)
875
AC_MSG_RESULT($PERL5CCFLAGS)
878
AC_MSG_RESULT(unable to determine perl5 configuration)
882
AC_MSG_RESULT(could not figure out how to run perl5)
885
# Cygwin (Windows) needs the library for dynamic linking
887
*-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";;
888
*)PERL5DYNAMICLINKING="";;
894
AC_SUBST(PERL5DYNAMICLINKING)
896
AC_SUBST(PERL5CCFLAGS)
898
#----------------------------------------------------------------
900
#----------------------------------------------------------------
903
OCTAVEDYNAMICLINKING=
906
AC_ARG_WITH(octave, AS_HELP_STRING([--without-octave], [Disable Octave])
907
AS_HELP_STRING([--with-octave=path], [Set location of Octave executable]),[OCTAVEBIN="$withval"], [OCTAVEBIN=yes])
909
# First, check for "--without-octave" or "--with-octave=no".
910
if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then
911
AC_MSG_NOTICE([Disabling Octave])
915
# First figure out what the name of Octave is
917
if test "x$OCTAVEBIN" = xyes; then
918
AC_CHECK_PROGS(OCTAVE, octave)
924
AC_MSG_CHECKING(for Octave header files)
925
if test -n "$OCTAVE"; then
926
OCTAVEDIR="/usr/include"
927
if test "$OCTAVEDIR" != ""; then
931
if test -r $i/octave/oct.h; then
935
if test -r $i/octave/octave/oct.h; then
936
OCTAVEEXT="$i/octave"
940
if test "$OCTAVEEXT" = "" ; then
941
AC_MSG_RESULT(not found)
943
AC_MSG_RESULT($OCTAVEEXT)
946
AC_MSG_CHECKING(for Octave compiler options)
948
AC_MSG_RESULT($OCTAVECCFLAGS)
951
AC_MSG_RESULT(could not figure out how to run octave)
959
AC_SUBST(OCTAVEDYNAMICLINKING)
961
AC_SUBST(OCTAVECCFLAGS)
963
#----------------------------------------------------------------
965
#----------------------------------------------------------------
967
AC_ARG_WITH(java, AS_HELP_STRING([--without-java], [Disable Java])
968
AS_HELP_STRING([--with-java=path], [Set location of java executable]),[JAVABIN="$withval"], [JAVABIN=yes])
969
AC_ARG_WITH(javac, [ --with-javac=path Set location of javac executable],[JAVACBIN="$withval"], [JAVACBIN=])
971
# First, check for "--without-java" or "--with-java=no".
972
if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then
973
AC_MSG_NOTICE([Disabling Java])
977
if test "x$JAVABIN" = xyes; then
978
AC_CHECK_PROGS(JAVA, java kaffe guavac)
983
if test -z "$JAVACBIN"; then
984
AC_CHECK_PROGS(JAVAC, javac)
989
AC_MSG_CHECKING(for java include file jni.h)
990
AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=])
992
if test -z "$JAVAINCDIR" ; then
993
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/java/j2sdk*/include /usr/java/jdk*/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/lib/java/include /usr/lib/jvm/java*/include /usr/include/kaffe /usr/local/include/kaffe /usr/include"
995
# Add in default installation directory on Windows for Cygwin
997
*-*-cygwin* | *-*-mingw*) JAVAINCDIR="c:/Program*Files/Java/jdk*/include d:/Program*Files/Java/jdk*/include c:/j2sdk*/include d:/j2sdk*/include c:/jdk*/include d:/jdk*/include $JAVAINCDIR";;
998
*-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";;
1004
for d in $JAVAINCDIR ; do
1005
if test -r "$d/jni.h" ; then
1013
if test "$JAVAINC" = "" ; then
1014
AC_MSG_RESULT(not found)
1016
# now look for <arch>/jni_md.h
1017
AC_MSG_CHECKING(for java include file jni_md.h)
1018
JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print`
1019
if test "$JAVAMDDIR" = "" ; then
1020
AC_MSG_RESULT(not found)
1022
JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1`
1023
JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\""
1024
AC_MSG_RESULT($JAVAMDDIR)
1028
# java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable
1030
*-*-cygwin* | *-*-mingw*)
1031
if test "$GCC" = yes; then
1032
JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
1033
JAVACFLAGS="-mno-cygwin -mthreads"
1035
JAVADYNAMICLINKING=""
1039
JAVADYNAMICLINKING="-dynamiclib -framework JavaVM"
1043
JAVADYNAMICLINKING=""
1048
# Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
1050
*-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";;
1051
*)JAVALIBRARYPREFIX="lib";;
1054
# Java on Mac OS X tweaks
1058
JAVALDSHARED='$(CC)'
1059
JAVACXXSHARED='$(CXX)'
1063
JAVALDSHARED='$(LDSHARED)'
1064
JAVACXXSHARED='$(CXXSHARED)'
1072
AC_SUBST(JAVADYNAMICLINKING)
1073
AC_SUBST(JAVALIBRARYPREFIX)
1075
AC_SUBST(JAVALDSHARED)
1076
AC_SUBST(JAVACXXSHARED)
1077
AC_SUBST(JAVACFLAGS)
1079
#----------------------------------------------------------------
1081
#----------------------------------------------------------------
1083
AC_ARG_WITH(gcj, AS_HELP_STRING([--without-gcj], [Disable GCJ])
1084
AS_HELP_STRING([--with-gcj=path], [Set location of gcj executable]),[GCJBIN="$withval"], [GCJBIN=yes])
1085
AC_ARG_WITH(gcjh, [ --with-gcjh=path Set location of gcjh executable],[GCJHBIN="$withval"], [GCJHBIN=])
1087
# First, check for "--without-gcj" or "--with-gcj=no".
1088
if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then
1089
AC_MSG_NOTICE([Disabling GCJ])
1091
if test "x$GCJBIN" = xyes; then
1092
AC_CHECK_PROGS(GCJ, gcj)
1097
if test -z "$GCJCBIN"; then
1098
AC_CHECK_PROGS(GCJH, gcjh)
1107
#----------------------------------------------------------------
1109
#----------------------------------------------------------------
1118
AC_ARG_WITH(guile-config,AS_HELP_STRING([--without-guile], [Disable Guile])
1119
AS_HELP_STRING([--with-guile-config=path], [Set location of guile-config]),[ GUILE_CONFIG="$withval"], [GUILE_CONFIG=])
1120
AC_ARG_WITH(guilepackage, AS_HELP_STRING([--with-guile-prefix=path], [Set location of Guile tree]),[
1121
GUILEPACKAGE="$withval"])
1122
AC_ARG_WITH(guile,[ --with-guile=path Set location of Guile executable],[
1123
GUILE="$withval"], [GUILE=yes])
1124
AC_ARG_WITH(guileincl,[ --with-guileincl=path Set location of Guile include directory],[
1125
GUILEINCLUDE="$withval"])
1126
AC_ARG_WITH(guilelib,[ --with-guilelib=path Set location of Guile library directory],[
1127
GUILELIB="$withval"])
1129
# First, check for "--without-guile" or "--with-guile=no".
1130
if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then
1131
AC_MSG_NOTICE([Disabling Guile])
1134
if test -z "$GUILE_CONFIG" ; then
1135
AC_PATH_PROG(GUILE_CONFIG, guile-config)
1138
if test -n "$GUILE_CONFIG" ; then
1139
GUILEPACKAGE="`$GUILE_CONFIG info prefix`"
1140
GUILEINCLUDE="`$GUILE_CONFIG info includedir`"
1141
GUILELIB="`$GUILE_CONFIG info libdir`"
1142
GUILE="`$GUILE_CONFIG info bindir`/guile"
1143
GUILELINK="`$GUILE_CONFIG link`"
1144
GUILEPKGDATADIR="`$GUILE_CONFIG info pkgdatadir`"
1147
if test -z "$GUILE" -o "x$GUILE" = xyes; then
1148
if test -n "$GUILEPACKAGE"; then
1149
GUILE="$GUILEPACKAGE/bin/guile"
1155
if test -z "$GUILEINCLUDE"; then
1156
if test -n "$GUILEPACKAGE"; then
1157
GUILEINCLUDE="$GUILEPACKAGE/include"
1161
if test -z "$GUILELIB"; then
1162
if test -n "$GUILEPACKAGE"; then
1163
GUILELIB="$GUILEPACKAGE/lib"
1168
AC_MSG_CHECKING(for Guile header files)
1170
dirs="$GUILEINCLUDE"
1172
if test -r $i/guile/gh.h; then
1174
GUILEINCLUDE="$ISYSTEM$i"
1178
if test -z "$GUILEINCLUDE"; then
1179
AC_MSG_RESULT(not found)
1182
AC_MSG_CHECKING(for Guile library)
1185
if test -r $i/libguile.so; then
1191
if test -z "$GUILELIB"; then
1192
AC_MSG_RESULT(not found)
1195
if test -z "$GUILELINK"; then
1196
GUILELINK="-L$GUILELIB -lguile"
1199
guilesafe_CFLAGS=$CFLAGS
1200
guilesafe_LIBS=$LIBS
1201
# Filter out "-ansi -pedantic" because Guile header files will not compile with these flags.
1202
# (The flags -ansi -pedantic are automatically added by ac_compile_warnings.m4)
1203
CFLAGS="`echo $CFLAGS | sed 's/-ansi//g;s/-pedantic//g;'` $GUILEINCLUDE"
1204
LIBS="$LIBS $GUILELINK"
1206
AC_MSG_CHECKING(whether Guile's gh_ API works)
1207
AC_LINK_IFELSE([#include <guile/gh.h>
1208
int main() { SCM s; return gh_scm2int(s); }], GUILE_GH_INTERFACE=1, )
1209
if test -n "$GUILE_GH_INTERFACE" ; then
1214
AC_MSG_CHECKING(whether Guile's SCM_ API works)
1215
AC_LINK_IFELSE([#include <libguile.h>
1216
int main() { SCM s; scm_slot_exists_p(SCM_BOOL_F, SCM_BOOL_F); return SCM_STRING_LENGTH(s); }], GUILE_SCM_INTERFACE=1, )
1217
if test -n "$GUILE_SCM_INTERFACE" ; then
1222
CFLAGS=$guilesafe_CFLAGS
1223
LIBS=$guilesafe_LIBS
1227
AC_SUBST(GUILEINCLUDE)
1230
AC_SUBST(GUILE_GH_INTERFACE)
1231
AC_SUBST(GUILE_SCM_INTERFACE)
1233
#----------------------------------------------------------------
1235
#----------------------------------------------------------------
1237
AC_ARG_WITH(mzscheme, AS_HELP_STRING([--without-mzscheme], [Disable MzScheme])
1238
AS_HELP_STRING([--with-mzscheme=path], [Set location of MzScheme executable]),[ MZSCHEMEBIN="$withval"], [MZSCHEMEBIN=yes])
1239
AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's mzc]), [ MZCBIN="$withval"], [MZCBIN=])
1241
# First, check for "--without-mzscheme" or "--with-mzscheme=no".
1242
if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then
1243
AC_MSG_NOTICE([Disabling MzScheme])
1246
if test "x$MZSCHEMEBIN" = xyes; then
1247
AC_PATH_PROG(MZSCHEME, mzscheme)
1249
MZSCHEME="$MZSCHEMEBIN"
1252
if test -z "$MZCBIN"; then
1253
AC_PATH_PROG(MZC, mzc)
1256
if test -n "$MZSCHEME"; then
1257
AC_MSG_CHECKING(for MzScheme dynext object)
1258
MZDYNOBJ=`$MZSCHEME --eval '(begin (require dynext/link) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (printf "~a" x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null`
1259
if test -f "$MZDYNOBJ"; then
1260
MZDYNOBJ="$MZDYNOBJ"
1262
# older versions (3.72 approx and earlier)
1263
MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext")) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries)))) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null`
1265
if test -f "$MZDYNOBJ"; then
1266
AC_MSG_RESULT($MZDYNOBJ)
1268
AC_MSG_RESULT(not found)
1275
#----------------------------------------------------------------
1277
#----------------------------------------------------------------
1281
AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby])
1282
AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes])
1284
# First, check for "--without-ruby" or "--with-ruby=no".
1285
if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then
1286
AC_MSG_NOTICE([Disabling Ruby])
1290
# First figure out what the name of Ruby is
1292
if test "x$RUBYBIN" = xyes; then
1293
AC_CHECK_PROGS(RUBY, ruby)
1298
AC_MSG_CHECKING(for Ruby header files)
1299
if test -n "$RUBY"; then
1300
RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
1301
if test x"$RUBYDIR" != x""; then
1305
if test -r $i/ruby.h; then
1311
if test "$RUBYINCLUDE" = none; then
1312
RUBYINCLUDE="-I$RUBYDIR"
1313
AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
1316
# Find library and path for linking.
1317
AC_MSG_CHECKING(for Ruby library)
1319
rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
1320
rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
1321
dirs="$dirs $rb_libdir $rb_bindir"
1323
rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
1324
RUBYLINK=`($RUBY -rrbconfig -e '
1326
if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
1327
if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
1328
link = c[["LIBRUBYARG_STATIC"]]
1330
link = c[["LIBRUBYARG_SHARED"]]
1333
link = "-l" + c[["RUBY_INSTALL_NAME"]]
1336
# Get the target Ruby was built for
1337
target = c[["target"]]
1339
if target == "i386-pc-mswin32"
1340
# Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby*
1341
ext = File.extname(link)
1342
# Get index that counts backwards from end of string
1343
index = -1 - ext.size
1344
# Strip off the extension
1345
link = link.slice(0..index)
1351
if test "$rb_libruby" != ""; then
1353
if (test -r $i/$rb_libruby;) then
1359
if test "$RUBYLIB" = ""; then
1361
AC_MSG_RESULT(not found... using $RUBYDIR)
1363
AC_MSG_RESULT($RUBYLINK in $RUBYLIB)
1366
AC_MSG_RESULT(unable to determine ruby configuration)
1367
RUBYINCLUDE="-I$RUBYDIR"
1372
*-*-mingw*) ;; # do nothing, the default windows libraries are already included
1373
*) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";;
1376
RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
1378
AC_MSG_RESULT(could not figure out how to run ruby)
1379
RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch"
1380
RUBYLIB="/usr/local/lib/ruby/1.4/arch"
1381
RUBYLINK="-lruby -lm"
1385
*-*-cygwin* | *-*-mingw*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";;
1386
*) RUBYDYNAMICLINKING="";;
1390
AC_SUBST(RUBYINCLUDE)
1393
AC_SUBST(RUBYCCDLFLAGS)
1394
AC_SUBST(RUBYDYNAMICLINKING)
1396
#-------------------------------------------------------------------------
1398
#-------------------------------------------------------------------------
1402
AC_ARG_WITH(php, AS_HELP_STRING([--without-php], [Disable PHP])
1403
AS_HELP_STRING([--with-php=path], [Set location of PHP executable]),[ PHPBIN="$withval"], [PHPBIN=yes])
1405
# First, check for "--without-php" or "--with-php=no".
1406
if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then
1407
AC_MSG_NOTICE([Disabling PHP])
1411
if test "x$PHPBIN" = xyes; then
1412
AC_CHECK_PROGS(PHP, [php5 php])
1417
AC_MSG_CHECKING(for PHP header files)
1418
dnl /usr/bin/php5 -> /usr/bin/php-config5
1421
PHPCONFIG=`echo "$PHP"|sed 's/5$/-config5/'` ;;
1423
PHPCONFIG=$PHP-config ;;
1425
php_version=`$PHPCONFIG --version 2>/dev/null`
1426
case $php_version in
1428
PHPINC=`$PHPCONFIG --includes 2>/dev/null`
1429
if test -n "$PHPINC"; then
1430
AC_MSG_RESULT($PHPINC)
1432
AC_MSG_RESULT(not found)
1436
AC_MSG_RESULT([found PHP $version, but only PHP 5 is supported]) ;;
1442
#----------------------------------------------------------------
1444
#----------------------------------------------------------------
1446
AC_ARG_WITH(ocaml, AS_HELP_STRING([--without-ocaml], [Disable OCaml])
1447
AS_HELP_STRING([--with-ocaml=path], [Set location of ocaml executable]),[ OCAMLBIN="$withval"], [OCAMLBIN=yes])
1448
AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable],[ OCAMLC="$withval"], [OCAMLC=])
1449
AC_ARG_WITH(ocamldlgen,[ --with-ocamldlgen=path Set location of ocamldlgen],[ OCAMLDLGEN="$withval" ], [OCAMLDLGEN=])
1450
AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCAMLFIND="$withval"],[OCAMLFIND=])
1451
AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=])
1453
# First, check for "--without-ocaml" or "--with-ocaml=no".
1454
if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then
1455
AC_MSG_NOTICE([Disabling OCaml])
1459
AC_MSG_CHECKING(for Ocaml DL load generator)
1460
if test -z "$OCAMLDLGEN"; then
1461
AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen, :)
1463
OCAMLDLGEN="$OCAMLDLGEN"
1466
AC_MSG_CHECKING(for Ocaml package tool)
1467
if test -z "$OCAMLFIND"; then
1468
AC_CHECK_PROGS(OCAMLFIND, ocamlfind, :)
1470
OCAMLFIND="$OCAMLFIND"
1473
AC_MSG_CHECKING(for Ocaml compiler)
1474
if test -z "$OCAMLC"; then
1475
AC_CHECK_PROGS(OCAMLC, ocamlc, :)
1480
AC_MSG_CHECKING(for Ocaml interpreter)
1481
if test "x$OCAMLBIN" = xyes; then
1482
AC_CHECK_PROGS(OCAMLBIN, ocaml, :)
1484
OCAMLBIN="$OCAMLBIN"
1487
AC_MSG_CHECKING(for Ocaml toplevel creator)
1488
if test -z "$OCAMLMKTOP"; then
1489
AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :)
1491
OCAMLMKTOP="$OCAMLMKTOP"
1495
if test "$OCAMLC" != ":" ; then
1496
AC_MSG_CHECKING(for Ocaml header files)
1497
dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml"
1498
dir="`$OCAMLC -where 2>/dev/null`"
1499
if test "$dir"; then
1500
dirs="$dir/caml $dirs"
1503
if test -r $i/mlvalues.h; then
1506
OCAMLINC="-I$OCAMLEXT"
1510
if test -z "$OCAMLINC"; then
1511
AC_MSG_RESULT(not found)
1514
AC_MSG_CHECKING(for Ocaml version 3.08.2 or higher)
1515
OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'`
1516
AC_COMPARE_VERSION([$OCAMLVER],[3.08.2],[:],[:],[OCAMLLOC=_loc])
1517
AC_MSG_RESULT($OCAMLVER)
1519
fi # Disabling ocaml
1535
AC_SUBST(OCAMLDLGEN)
1537
AC_SUBST(OCAMLMKTOP)
1539
#----------------------------------------------------------------
1541
#----------------------------------------------------------------
1543
# Identify the name of the Pike executable
1544
# Priority: configure option, automatic search
1546
AC_ARG_WITH(pike, AS_HELP_STRING([--without-pike], [Disable Pike])
1547
AS_HELP_STRING([--with-pike=path], [Set location of Pike executable]),[PIKEBIN="$withval"], [PIKEBIN=yes])
1549
# First, check for "--without-pike" or "--with-pike=no".
1550
if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then
1551
AC_MSG_NOTICE([Disabling Pike])
1555
if test "x$PIKEBIN" = xyes; then
1556
AC_CHECK_PROGS(PIKE, pike pike7.6 pike7.4 pike7.2)
1562
# Check for pike-config
1563
# Priority: configure option, guessed from $PIKE, search from list
1564
AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path],
1565
[Set location of pike-config script]),
1566
[PIKECONFIG="$withval"], [PIKECONFIG=""])
1568
if test -z "$PIKECONFIG" -a -n "$PIKE"; then
1569
AC_CHECK_PROGS(PIKECONFIG, $PIKE-config pike-config \
1570
pike7.6-config pike7.4-config pike7.2-config)
1573
# Check for a --with-pikeincl option to configure
1574
# Priority: configure option, info from $PIKECONFIG, guessed by pike script
1575
AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path],
1576
[Set location of Pike include directory]),
1577
[PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=])
1579
if test -n "$PIKE"; then
1580
AC_MSG_CHECKING([for Pike header files])
1581
if test -z "$PIKEINCLUDE" -a -n "$PIKECONFIG"; then
1582
PIKEINCLUDE=`$PIKECONFIG --cflags`
1584
if test -z "$PIKEINCLUDE" -a -n "$PIKE"; then
1585
PIKEPATH=`which $PIKE`
1586
PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH`
1587
PIKEINCLUDE="-I$PIKEINCLUDE"
1590
if test -z "$PIKEINCLUDE"; then
1591
AC_MSG_RESULT(not found)
1593
AC_MSG_RESULT($PIKEINCLUDE)
1598
AC_SUBST(PIKEINCLUDE)
1599
AC_SUBST(PIKECCDLFLAGS) dnl XXX: where is this used/defined?
1600
AC_SUBST(PIKEDYNAMICLINKING) dnl XXX: where is this used/defined?
1602
#----------------------------------------------------------------
1604
#----------------------------------------------------------------
1613
AC_ARG_WITH(chicken, AS_HELP_STRING([--without-chicken], [Disable CHICKEN])
1614
AS_HELP_STRING([--with-chicken=path], [Set location of CHICKEN executable]),[ CHICKENBIN="$withval"], [CHICKENBIN=yes])
1616
# First, check for "--without-chicken" or "--with-chicken=no".
1617
if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then
1618
AC_MSG_NOTICE([Disabling CHICKEN])
1621
if test "x$CHICKENBIN" = xyes; then
1622
AC_CHECK_PROGS(CHICKEN, chicken)
1624
CHICKEN="$CHICKENBIN"
1627
AC_ARG_WITH(chickencsc,[ --with-chickencsc=path Set location of csc executable],[ CHICKEN_CSC="$withval"], [CHICKEN_CSC=])
1629
if test -z "$CHICKEN_CSC"; then
1630
AC_CHECK_PROGS(CHICKEN_CSC, csc)
1631
# Both the Microsoft C# compiler and chicken have an executable called csc, so check that this csc is really the chicken one
1632
if test -n "$CHICKEN_CSC" ; then
1633
AC_MSG_CHECKING(whether csc is the chicken compiler)
1634
$CHICKEN_CSC -version 2>/dev/null | grep "chicken" > /dev/null || CHICKEN_CSC=""
1635
if test -z "$CHICKEN_CSC"; then
1643
AC_ARG_WITH(chickencsi,[ --with-chickencsi=path Set location of csi executable],[ CHICKEN_CSI="$withval"], [CHICKEN_CSI=])
1645
if test -z "$CHICKEN_CSI"; then
1646
AC_CHECK_PROGS(CHICKEN_CSI, csi)
1649
if test -n "$CHICKEN_CSC" ; then
1651
AC_ARG_WITH(chickenopts,[ --with-chickenopts=args Set compiler options for static CHICKEN generated code],[
1652
CHICKENOPTS="$withval"], [CHICKENOPTS=])
1653
AC_ARG_WITH(chickensharedlib,[ --with-chickensharedlib=args Set linker options for shared CHICKEN generated code],[
1654
CHICKENSHAREDLIB="$withval"], [CHICKENSHAREDLIB=])
1655
AC_ARG_WITH(chickenlib,[ --with-chickenlib=args Set linker options for static CHICKEN generated code],[
1656
CHICKENLIB="$withval"], [CHICKENLIB=])
1658
AC_MSG_CHECKING(for compiler options for static CHICKEN generated code)
1659
if test -z "$CHICKENOPTS"; then
1660
CHICKENOPTS="`$CHICKEN_CSC -cflags`"
1662
CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS"
1664
if test -z "$CHICKENOPTS"; then
1665
AC_MSG_RESULT(not found)
1667
AC_MSG_RESULT($CHICKENOPTS)
1670
AC_MSG_CHECKING(for linker options for shared CHICKEN generated code)
1671
if test -z "$CHICKENSHAREDLIB"; then
1672
CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`"
1674
CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB"
1676
if test -z "$CHICKENSHAREDLIB"; then
1677
AC_MSG_RESULT(not found)
1679
AC_MSG_RESULT($CHICKENSHAREDLIB)
1682
AC_MSG_CHECKING(for linker options for static CHICKEN generated code)
1683
if test -z "$CHICKENLIB"; then
1684
CHICKENLIB="`$CHICKEN_CSC -libs`"
1686
CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB"
1688
if test -z "$CHICKENLIB"; then
1689
AC_MSG_RESULT(not found)
1691
AC_MSG_RESULT($CHICKENLIB)
1694
fi # have CHICKEN_CONFIG
1695
fi # Check for --without-chicken
1698
AC_SUBST(CHICKEN_CSC)
1699
AC_SUBST(CHICKEN_CSI)
1700
AC_SUBST(CHICKENOPTS)
1701
AC_SUBST(CHICKENLIB)
1702
AC_SUBST(CHICKENSHAREDLIB)
1704
#----------------------------------------------------------------
1706
#----------------------------------------------------------------
1708
AC_ARG_WITH(csharp, AS_HELP_STRING([--without-csharp], [Disable CSharp]), [with_csharp="$withval"], [with_csharp=yes])
1709
AC_ARG_WITH(cil-interpreter, [ --with-cil-interpreter=path Set location of CIL interpreter for CSharp],[CSHARPBIN="$withval"], [CSHARPBIN=])
1710
AC_ARG_WITH(csharp-compiler, [ --with-csharp-compiler=path Set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=])
1712
# First, check for "--without-csharp" or "--with-csharp=no".
1713
if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then
1714
AC_MSG_NOTICE([Disabling CSharp])
1718
if test -z "$CSHARPCOMPILERBIN" ; then
1720
*-*-cygwin* | *-*-mingw*)
1721
# prefer Mono gmcs (.NET 2.0) over mcs (.NET 1.1) - note mcs-1.2.3 has major pinvoke bug
1722
AC_CHECK_PROGS(CSHARPCOMPILER, csc gmcs mcs cscc)
1723
if test -n "$CSHARPCOMPILER" && test "$CSHARPCOMPILER" = "csc" ; then
1724
AC_MSG_CHECKING(whether csc is the Microsoft CSharp compiler)
1725
csc 2>/dev/null | grep "C#" > /dev/null || CSHARPCOMPILER=""
1726
if test -z "$CSHARPCOMPILER" ; then
1728
AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc)
1734
*)AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc);;
1737
CSHARPCOMPILER="$CSHARPCOMPILERBIN"
1740
CSHARPPATHSEPARATOR="/"
1741
CSHARPCYGPATH_W=echo
1742
if test -z "$CSHARPBIN" ; then
1743
CSHARPCILINTERPRETER=""
1744
if test "cscc" = "$CSHARPCOMPILER" ; then
1745
AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun)
1747
if test "mcs" = "$CSHARPCOMPILER"; then
1748
# Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version'
1749
# The Mono compiler should emit: Mono C# compiler version a.b.c.d
1750
csharp_version_raw=`(mcs --version) 2>/dev/null`
1751
csharp_version_searched=`(mcs --version | sed -e "/C#/b" -e "/Mono/b" -e d) 2>/dev/null` # return string if contains 'Mono' or 'C#'
1753
if test -n "$csharp_version_raw" ; then
1754
if test "$csharp_version_raw" = "$csharp_version_searched" ; then
1755
CSHARPCOMPILER="mcs"
1758
if test "mcs" != "$CSHARPCOMPILER" ; then
1759
echo "mcs is not a working Mono C# compiler"
1762
if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then
1763
AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT
1765
if test "csc" = "$CSHARPCOMPILER"; then
1766
CSHARPPATHSEPARATOR="\\\\"
1767
CSHARPCYGPATH_W='cygpath -w'
1772
CSHARPCILINTERPRETER="$CSHARPBIN"
1775
# Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable
1777
*-*-cygwin* | *-*-mingw*)
1778
if test "$GCC" = yes; then
1779
CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
1780
CSHARPCFLAGS="-mno-cygwin -mthreads"
1782
CSHARPDYNAMICLINKING=""
1786
CSHARPDYNAMICLINKING=""
1791
# CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
1793
*-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";;
1794
*)CSHARPLIBRARYPREFIX="lib";;
1797
# C#/Mono on Mac OS X tweaks
1808
AC_SUBST(CSHARPCILINTERPRETER)
1809
AC_SUBST(CSHARPPATHSEPARATOR)
1810
AC_SUBST(CSHARPCYGPATH_W)
1811
AC_SUBST(CSHARPCOMPILER)
1812
AC_SUBST(CSHARPDYNAMICLINKING)
1813
AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?
1814
AC_SUBST(CSHARPCFLAGS)
1817
#----------------------------------------------------------------
1819
#----------------------------------------------------------------
1827
# note: if LUABIN is empty then lua tests will not be done
1828
# LUABIN will be cleared if certain dependencies cannot be found
1830
AC_ARG_WITH(lua, AS_HELP_STRING([--without-lua], [Disable Lua])
1831
AS_HELP_STRING([--with-lua=path], [Set location of Lua executable]),[ LUABIN="$withval"], [LUABIN=yes])
1832
AC_ARG_WITH(luaincl,[ --with-luaincl=path Set location of Lua include directory],[
1833
LUAINCLUDE="$withval"], [LUAINCLUDE=])
1834
AC_ARG_WITH(lualib,[ --with-lualib=path Set location of Lua library directory],[
1835
LUALIB="$withval"], [LUALIB=])
1837
# First, check for "--without-lua" or "--with-lua=no".
1838
if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then
1839
AC_MSG_NOTICE([Disabling Lua])
1843
if test "x$LUABIN" = xyes; then
1844
AC_PATH_PROG(LUABIN, lua)
1847
# check version: we need Lua 5.x
1848
if test "$LUABIN"; then
1849
AC_MSG_CHECKING(Lua version)
1851
LUAV5=`$LUABIN -e 'if string.sub(_VERSION,5,5)=="5" then print "1" end'`
1852
# if not version 5.0
1853
LUAV51=`$LUABIN -e 'if string.sub(_VERSION,5,7)~="5.0" then print "1" end'`
1855
if test -z "$LUAV5"; then
1856
AC_MSG_WARN(Not Lua 5.x, SWIG does not support this version of Lua)
1858
elif test -z "$LUAV51"; then
1859
AC_MSG_RESULT(Lua 5.0.x)
1861
AC_MSG_RESULT(Lua 5.1 or later)
1865
if test "$LUABIN"; then
1866
AC_MSG_CHECKING(whether Lua dynamic loading is enabled)
1867
# using Lua to check Lua
1868
# lua 5.0 & 5.1 have different fn names
1869
if test -z "$LUAV51"; then
1870
LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=loadlib("no_such_lib","") if c~="absent" then print "1" end'`
1872
LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'`
1875
if test -z "$LUADYNAMICLOADLIB"; then
1882
# look for the header files & set LUAFLAGS accordingly
1883
# will clear LUABIN if not present
1884
if test -n "$LUAINCLUDE"; then
1885
AC_CHECK_FILE($LUAINCLUDE/lua.h,[LUAFLAGS="$ISYSTEM$LUAINCLUDE"],[LUABIN=])
1888
AC_CHECK_HEADER(lua.h,[LUAFLAGS=""],[LUA_OK=""])
1889
# if we didn't get it, going to have to look elsewhere (the hard way)
1890
if test -z "$LUA_OK"; then
1891
AC_MSG_CHECKING(for lua.h in other locations)
1892
# note: ubuntu seems to like /usr/include/lua5.1/lua.h
1893
dirs="/usr/include/lua* /usr/local/include"
1896
if test -r $i/lua.h; then
1897
AC_MSG_RESULT($i/lua.h)
1898
LUAFLAGS="$ISYSTEM$i"
1902
if test -z "$LUAFLAGS"; then
1903
AC_MSG_RESULT(not found)
1904
LUABIN="" # clear the bin
1909
# look for the library files & set LUALINK accordingly
1910
# will clear LUABIN if not present
1911
lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving
1913
if test -n "$LUALIB"; then
1914
AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=])
1916
AC_SEARCH_LIBS(lua_close, [lua lua51 lua5.1 lua50 lua5.0], [LUALINK="-l$ac_lib"],[LUABIN=])
1919
# adding lualib for lua 5.0
1920
if test -z "$LUAV51"; then # extra for lua 5.0
1921
LUALINK="$LUALINK -llualib"
1924
LIBS=$lua_save_LIBS # restore LIBS
1926
fi # if not disabled
1928
AC_SUBST(LUADYNAMICLINKING)
1933
#----------------------------------------------------------------
1934
# Look for Allegro Common Lisp
1935
#----------------------------------------------------------------
1939
AC_ARG_WITH(allegrocl, AS_HELP_STRING([--without-allegrocl], [Disable Allegro CL])
1940
AS_HELP_STRING([--with-allegrocl=path], [Set location of Allegro CL executable (alisp)]),[ ALLEGROCLBIN="$withval"], [ALLEGROCLBIN=yes])
1942
# First, check for "--without-allegrocl" or "--with-allegrocl=no".
1943
if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then
1944
AC_MSG_NOTICE([Disabling Allegro CL])
1948
# can we find allegrocl?
1949
if test "x$ALLEGROCLBIN" = xyes; then
1950
AC_PATH_PROG(ALLEGROCLBIN, alisp)
1954
AC_SUBST(ALLEGROCLBIN)
1956
#----------------------------------------------------------------
1957
# Look for GNU CLISP
1958
#----------------------------------------------------------------
1962
AC_ARG_WITH(clisp, AS_HELP_STRING([--without-clisp], [Disable CLISP])
1963
AS_HELP_STRING([--with-clisp=path], [Set location of CLISP executable (clisp)]),[ CLISPBIN="$withval"], [CLISPBIN=yes])
1965
# First, check for "--without-clisp" or "--with-clisp=no".
1966
if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then
1967
AC_MSG_NOTICE([Disabling CLISP])
1971
# can we find clisp?
1972
if test "x$CLISPBIN" = xyes; then
1973
AC_PATH_PROG(CLISPBIN, clisp)
1979
#----------------------------------------------------------------
1981
#----------------------------------------------------------------
1985
AC_ARG_WITH(r, AS_HELP_STRING([--without-r], [Disable R])
1986
AS_HELP_STRING([--with-r=path], [Set location of R executable (r)]),[ RBIN="$withval"], [RBIN=yes])
1988
# First, check for "--without-r" or "--with-r=no".
1989
if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then
1990
AC_MSG_NOTICE([Disabling R])
1995
if test "x$RBIN" = xyes; then
1996
AC_PATH_PROG(RBIN, R)
2002
#----------------------------------------------------------------
2003
# Look for Go compilers
2004
#----------------------------------------------------------------
2006
AC_ARG_WITH(go, AS_HELP_STRING([--without-go], [Disable Go])
2007
AS_HELP_STRING([--with-go=path], [Set location of Go compiler]),[GOBIN="$withval"], [GOBIN=yes])
2009
if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then
2010
AC_MSG_NOTICE([Disabling Go])
2015
if test "x$GOBIN" = xyes; then
2016
AC_CHECK_PROGS(GO, 6g 8g gccgo)
2021
if test -n "$GO" ; then
2023
if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then
2026
AC_MSG_CHECKING([whether Go ($GO) version is too old])
2027
go_version=`$GO -V | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
2029
if test "$go_version" -lt $go_min_version; then
2030
AC_MSG_RESULT([yes - minimum version is $go_min_version])
2042
#----------------------------------------------------------------
2044
#----------------------------------------------------------------
2046
AC_ARG_WITH(d, AS_HELP_STRING([--without-d], [Disable D]), [with_d="$withval"], [with_d=yes])
2047
AC_ARG_WITH(d1-compiler, [ --with-d1-compiler=path Set location of D1/Tango compiler (DMD compatible)],[D1COMPILERBIN="$withval"], [D1COMPILERBIN=])
2048
AC_ARG_WITH(d2-compiler, [ --with-d2-compiler=path Set location of D2 compiler (DMD compatible)],[D2COMPILERBIN="$withval"], [D2COMPILERBIN=])
2051
# First, check for "--without-d" or "--with-d=no".
2052
if test x"${with_d}" = xno -o x"${with_alllang}" = xno ; then
2053
AC_MSG_NOTICE([Disabling D])
2060
if test -z "$D1COMPILERBIN" ; then
2061
AC_CHECK_PROGS(D1COMPILER, dmd ldmd gdmd)
2063
if test -n "$D1COMPILER" ; then
2064
AC_MSG_CHECKING(whether the D1/Tango compiler works)
2065
cat > conftest.$ac_ext <<_ACEOF
2066
import tango.io.Stdout;
2070
rm -f conftest.$ac_objext
2072
[_AC_DO_STDERR($D1COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext],
2073
[AC_MSG_RESULT([yes])],
2074
[_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no])
2077
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2080
D1COMPILER="$D1COMPILERBIN"
2083
if test -z "$D2COMPILERBIN" ; then
2084
AC_CHECK_PROGS(D2COMPILER, dmd gdmd)
2086
if test -n "$D2COMPILER" ; then
2087
AC_MSG_CHECKING(whether the D2 compiler works)
2088
cat > conftest.$ac_ext <<_ACEOF
2089
import std.algorithm;
2093
rm -f conftest.$ac_objext
2095
[_AC_DO_STDERR($D2COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext],
2096
[AC_MSG_RESULT([yes])],
2097
[_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no])
2100
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2103
D2COMPILER="$D2COMPILERBIN"
2109
if test -n "$D1COMPILER"; then
2111
elif test -n "$D2COMPILER"; then
2115
# Do not prefix library file names with "lib" on Windows.
2117
*-*-cygwin* | *-*-mingw*) DLIBPREFIX="";;
2118
*)DLIBPREFIX="lib";;
2121
AC_SUBST(D1COMPILER)
2122
AC_SUBST(D2COMPILER)
2123
AC_SUBST(DDEFAULTVERSION)
2124
AC_SUBST(DLIBPREFIX)
2126
#----------------------------------------------------------------
2127
# Determine which languages to use for examples/test-suite
2128
#----------------------------------------------------------------
2131
if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then
2138
if test -z "$PERL" || test -z "$PERL5EXT" ; then
2141
AC_SUBST(SKIP_PERL5)
2145
if test -z "$OCTAVE" || test -z "$OCTAVEEXT" ; then
2148
AC_SUBST(SKIP_OCTAVE)
2152
if (test -z "$PYINCLUDE" || test -z "$PYLIB") &&
2153
(test -z "$PY3INCLUDE" || test -z "PY3LIB") ; then
2156
AC_SUBST(SKIP_PYTHON)
2159
if test -z "$PY3INCLUDE" || test -z "$PY3LIB" ; then
2162
AC_SUBST(SKIP_PYTHON3)
2165
if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then
2172
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_GH_INTERFACE"; then
2175
AC_SUBST(SKIP_GUILE)
2178
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_SCM_INTERFACE"; then
2181
AC_SUBST(SKIP_GUILESCM)
2185
if test -z "$MZC" || test -z "$MZDYNOBJ" ; then
2188
AC_SUBST(SKIP_MZSCHEME)
2192
if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then
2199
if test -z "$PHP" || test -z "$PHPINC" ; then
2206
if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then
2209
AC_SUBST(SKIP_OCAML)
2212
SKIP_PIKE="1" # Always skipped!
2213
if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then
2220
if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then
2223
AC_SUBST(SKIP_CHICKEN)
2227
if test -z "$CSHARPCOMPILER" ; then
2230
if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then
2234
AC_SUBST(SKIP_CSHARP)
2236
SKIP_MODULA3="1" # Always skipped!
2237
AC_SUBST(SKIP_MODULA3)
2240
# we need LUABIN & dynamic loading
2241
if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then
2247
if test -z "$ALLEGROCLBIN" ; then
2250
AC_SUBST(SKIP_ALLEGROCL)
2253
if test -z "$CLISPBIN" ; then
2256
AC_SUBST(SKIP_CLISP)
2259
if test -z "$RBIN" ; then
2265
#if test -z "$CFFIBIN" ; then
2271
#if test -z "$UFFIBIN" ; then
2277
if test -z "$GO" ; then
2283
if test -z "$DDEFAULTVERSION" ; then
2288
#----------------------------------------------------------------
2289
# Additional language dependencies
2290
#----------------------------------------------------------------
2292
if test -z "$GCJ" || test -z "$GCJH" ; then
2295
if test "$GCC" != yes; then
2302
#----------------------------------------------------------------
2304
#----------------------------------------------------------------
2308
# Translate path for native Windows compilers for use with 'make check'
2311
*-*-cygwin* | *-*-mingw*)
2312
if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then
2313
ROOT_DIR=`cygpath --mixed $ROOT_DIR`
2315
# Extra files generated by some Windows compilers
2316
EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk"
2321
AC_SUBST(EXTRA_CLEAN)
2322
AC_SUBST(ac_aux_dir)
2324
# Configure SWIG_LIB path
2326
AC_ARG_WITH(swiglibdir,[ --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR.],
2327
[swig_lib="$withval"], [swig_lib="${datadir}/swig/${PACKAGE_VERSION}"])
2329
AC_DEFINE_DIR(SWIG_LIB, swig_lib, [Directory for SWIG system-independent libraries])
2332
# Windows does not understand unix directories. Convert into a windows directory with drive letter.
2333
*-*-mingw*) SWIG_LIB_WIN_UNIX=`cmd //c echo $SWIG_LIB | sed -e "s/[ ]*$//"`;; # This echo converts unix to mixed paths. Then zap unexpected trailing space.
2334
*-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;;
2335
*) SWIG_LIB_WIN_UNIX="";;
2337
AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)])
2344
Examples/guile/Makefile \
2345
Examples/xml/Makefile \
2346
Examples/test-suite/chicken/Makefile \
2347
Examples/test-suite/csharp/Makefile \
2348
Examples/test-suite/d/Makefile \
2349
Examples/test-suite/guile/Makefile \
2350
Examples/test-suite/guilescm/Makefile \
2351
Examples/test-suite/java/Makefile \
2352
Examples/test-suite/mzscheme/Makefile \
2353
Examples/test-suite/ocaml/Makefile \
2354
Examples/test-suite/octave/Makefile \
2355
Examples/test-suite/perl5/Makefile \
2356
Examples/test-suite/php/Makefile \
2357
Examples/test-suite/pike/Makefile \
2358
Examples/test-suite/python/Makefile \
2359
Examples/test-suite/ruby/Makefile \
2360
Examples/test-suite/tcl/Makefile \
2361
Examples/test-suite/lua/Makefile \
2362
Examples/test-suite/allegrocl/Makefile \
2363
Examples/test-suite/clisp/Makefile \
2364
Examples/test-suite/cffi/Makefile \
2365
Examples/test-suite/uffi/Makefile \
2366
Examples/test-suite/r/Makefile \
2367
Examples/test-suite/go/Makefile \
2370
AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig])
2371
AC_CONFIG_FILES([CCache/ccache_swig_config.h])
2374
dnl configure.in ends here