~laney/ubuntu/quantal/swig2.0/guile-2.0

« back to all changes in this revision

Viewing changes to .pc/upstream_r12653.diff/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2011-05-03 22:34:43 UTC
  • Revision ID: james.westby@ubuntu.com-20110503223443-2f1pqulejz92wiqn
Tags: 2.0.3-2
* Package a snapshot of the upcoming upstream release 2.0.4. This matches
  upstream revision r12653.
  + Fixes building of Python 3.2 bindings (closes: #622980).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
4
 
 
5
AC_INIT([swig],[2.0.3],[http://www.swig.org])
 
6
 
 
7
dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED
 
8
dnl     definition below can be removed
 
9
AC_PREREQ(2.58)
 
10
 
 
11
AC_CONFIG_SRCDIR([Source/Swig/swig.h])
 
12
AC_CONFIG_AUX_DIR([Tools/config])
 
13
AC_CONFIG_HEADERS([Source/Include/swigconfig.h])
 
14
AC_CANONICAL_HOST
 
15
AM_INIT_AUTOMAKE
 
16
 
 
17
dnl Some extra defines for the config file
 
18
AH_BOTTOM([
 
19
/* Default language */
 
20
#define SWIG_LANG               "-tcl"
 
21
 
 
22
/* Deal with Microsofts attempt at deprecating C standard runtime functions */
 
23
#if defined(_MSC_VER)
 
24
# define _CRT_SECURE_NO_DEPRECATE
 
25
#endif
 
26
])
 
27
 
 
28
dnl Check for programs that a user requires to build SWIG
 
29
AC_PROG_CC
 
30
AC_PROG_CXX
 
31
AC_EXEEXT
 
32
AC_OBJEXT
 
33
AM_PROG_CC_C_O  # Needed for subdir-objects in AUTOMAKE_OPTIONS
 
34
 
 
35
AC_COMPILE_WARNINGS # Increase warning levels
 
36
 
 
37
AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG])
 
38
AC_DEFINE_UNQUOTED(SWIG_PLATFORM, ["$build"], [Platform that SWIG is built for])
 
39
 
 
40
dnl Checks for header files.
 
41
AC_HEADER_STDC
 
42
 
 
43
dnl Checks for types.
 
44
AC_LANG_PUSH([C++])
 
45
AC_CHECK_TYPES([bool])
 
46
AC_LANG_POP([C++])
 
47
 
 
48
dnl Look for popen
 
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])
 
52
else
 
53
AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen]))
 
54
fi
 
55
 
 
56
dnl PCRE
 
57
 
 
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)])])
 
61
 
 
62
AC_ARG_WITH([pcre],
 
63
  [AS_HELP_STRING([--without-pcre],
 
64
                  [Disable support for regular expressions using PCRE])],
 
65
  [],
 
66
  [with_pcre=yes])
 
67
 
 
68
AC_MSG_CHECKING([whether to enable PCRE support])
 
69
AC_MSG_RESULT([$with_pcre])
 
70
 
 
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])
 
74
  local_pcre_config=no
 
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
 
79
    fi
 
80
  fi
 
81
  AC_MSG_RESULT([$local_pcre_config])
 
82
fi
 
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"
 
90
    ],
 
91
    [AC_MSG_FAILURE([
 
92
        Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
 
93
        library package. This dependency is needed for configure to complete,
 
94
        Either:
 
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
 
102
          (not recommended).])
 
103
    ])
 
104
  ])
 
105
 
 
106
 
 
107
dnl CCache
 
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])
 
111
 
 
112
if test "$enable_ccache" = yes; then
 
113
  AC_CONFIG_SUBDIRS(CCache)
 
114
  ENABLE_CCACHE=1
 
115
fi
 
116
AC_SUBST(ENABLE_CCACHE)
 
117
 
 
118
 
 
119
echo ""
 
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"
 
122
echo ""
 
123
 
 
124
AC_PROG_YACC
 
125
AC_PROG_RANLIB
 
126
AC_CHECK_PROGS(AR, ar aal, ar)
 
127
AC_SUBST(AR)
 
128
AC_CHECK_PROGS(YODL2MAN, yodl2man)
 
129
AC_CHECK_PROGS(YODL2HTML, yodl2html)
 
130
 
 
131
 
 
132
echo ""
 
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"
 
136
echo ""
 
137
 
 
138
dnl Some test cases require Boost
 
139
AX_BOOST_BASE(,,,)
 
140
AC_SUBST(BOOST_CPPFLAGS)
 
141
 
 
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
 
145
    ISYSTEM="-isystem "
 
146
else
 
147
    ISYSTEM="-I"
 
148
fi
 
149
 
 
150
 
 
151
dnl Info for building shared libraries ... in order to run the examples
 
152
 
 
153
# SO is the extension of shared libraries (including the dot!)
 
154
AC_MSG_CHECKING(SO)
 
155
if test -z "$SO"
 
156
then
 
157
        case $host in
 
158
        *-*-hp*) SO=.sl;;
 
159
        *-*-darwin*) SO=.bundle;;
 
160
        *-*-cygwin* | *-*-mingw*) SO=.dll;;
 
161
        *) SO=.so;;
 
162
        esac
 
163
fi
 
164
AC_MSG_RESULT($SO)
 
165
 
 
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"
 
172
then
 
173
        case $host in
 
174
        *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
 
175
        *-*-cygwin* | *-*-mingw*)
 
176
            if test "$GCC" = yes; then
 
177
                LDSHARED="$CC -shared"
 
178
            else
 
179
                if test "cl" = $CC ;  then
 
180
                    # Microsoft Visual C++ (MSVC)
 
181
                    LDSHARED="$CC -nologo -LD"
 
182
                else
 
183
                    # Unknown compiler try gcc approach
 
184
                    LDSHARED="$CC -shared"
 
185
                fi
 
186
            fi ;;
 
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";;
 
194
        *-*-next*)
 
195
                if test "$ns_dyld"
 
196
                then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
 
197
                else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
 
198
                fi
 
199
                if test "$with_next_framework" ; then
 
200
                    LDSHARED="$LDSHARED \$(LDLIBRARY)"
 
201
                fi ;;
 
202
        *-*-linux*) LDSHARED="gcc -shared";;
 
203
        *-*-dgux*) LDSHARED="ld -G";;
 
204
        *-*-freebsd3*) LDSHARED="gcc -shared";;
 
205
        *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";;
 
206
        *-*-netbsd*)
 
207
                if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
 
208
                then
 
209
                        LDSHARED="cc -shared"
 
210
                else
 
211
                        LDSHARED="ld -Bshareable"
 
212
                fi;;
 
213
        *-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
 
214
        *-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";;
 
215
        *)      LDSHARED="ld";;
 
216
        esac
 
217
fi
 
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"
 
225
then
 
226
        CXXSHARED="$LDSHARED"
 
227
fi
 
228
AC_MSG_RESULT($CXXSHARED)
 
229
 
 
230
#
 
231
AC_MSG_CHECKING(TRYLINKINGWITHCXX)
 
232
if test -z "$TRYLINKINGWITHCXX"
 
233
then
 
234
        case $host in
 
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";
 
238
             fi;;
 
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 "
 
244
            else
 
245
                if test "cl" = $CXX ;  then
 
246
                    # Microsoft Visual C++ (MSVC)
 
247
                    TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD"
 
248
                else
 
249
                    TRYLINKINGWITHCXX="#unknown Windows compiler"
 
250
                fi
 
251
            fi ;;
 
252
        *)       TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";;
 
253
        esac
 
254
fi
 
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"
 
260
then
 
261
        case $host in
 
262
        *-*-hp*) if test "$GCC" = yes;
 
263
                 then CCSHARED="-fpic";
 
264
                 else CCSHARED="+z";
 
265
                 fi;;
 
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";;
 
272
                   *) CCSHARED="";;
 
273
                   esac;;
 
274
        esac
 
275
fi
 
276
AC_MSG_RESULT($CCSHARED)
 
277
 
 
278
# RPATH is the path used to look for shared library files.
 
279
AC_MSG_CHECKING(RPATH)
 
280
if test -z "$RPATH"
 
281
then
 
282
        case $host in
 
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 .';;
 
286
        *)      RPATH='';;
 
287
        esac
 
288
fi
 
289
AC_MSG_RESULT($RPATH)
 
290
 
 
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
 
293
 
 
294
AC_MSG_CHECKING(LINKFORSHARED)
 
295
if test -z "$LINKFORSHARED"
 
296
then
 
297
        case $host in
 
298
        *-*-aix*)       LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
 
299
        *-*-hp*)
 
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";;
 
305
        esac
 
306
fi
 
307
AC_MSG_RESULT($LINKFORSHARED)
 
308
 
 
309
# Optional CFLAGS used to silence/enhance compiler warnings on some platforms.
 
310
AC_MSG_CHECKING(PLATFLAGS)
 
311
case $host in
 
312
  *-*-solaris*) if test "$GCC" = yes;
 
313
    then PLATFLAGS=
 
314
    else PLATFLAGS=
 
315
      #    else PLATFLAGS="-errtags=yes" # Need more work as C examples use ld for linking
 
316
    fi;;
 
317
  *) PLATFLAGS=
 
318
esac
 
319
AC_MSG_RESULT($PLATFLAGS)
 
320
 
 
321
# Set info about shared libraries.
 
322
AC_SUBST(SO)
 
323
AC_SUBST(LDSHARED)
 
324
AC_SUBST(CCSHARED)
 
325
AC_SUBST(CXXSHARED)
 
326
AC_SUBST(TRYLINKINGWITHCXX)
 
327
AC_SUBST(RPATH)
 
328
AC_SUBST(PLATFLAGS)
 
329
AC_SUBST(LINKFORSHARED)
 
330
 
 
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
 
333
 
 
334
AC_SUBST(PYTHON_SO)
 
335
case $host in
 
336
   *-*-mingw*) PYTHON_SO=.pyd;;
 
337
   *-*-darwin*) PYTHON_SO=.so;;
 
338
   *) PYTHON_SO=$SO;;
 
339
esac
 
340
 
 
341
AC_SUBST(TCL_SO)
 
342
case $host in
 
343
   *-*-darwin*) TCL_SO=.dylib;;
 
344
   *) TCL_SO=$SO;;
 
345
esac
 
346
 
 
347
AC_SUBST(GUILE_SO)
 
348
case $host in
 
349
   *-*-darwin*) GUILE_SO=.so;;
 
350
   *) GUILE_SO=$SO;;
 
351
esac
 
352
 
 
353
AC_SUBST(PHP_SO)
 
354
case $host in
 
355
   *-*-darwin*) PHP_SO=.so;;
 
356
   *) PHP_SO=$SO;;
 
357
esac
 
358
 
 
359
AC_SUBST(MZSCHEME_SO)
 
360
case $host in
 
361
   *) MZSCHEME_SO=.so;;
 
362
esac
 
363
 
 
364
AC_SUBST(LUA_SO)
 
365
case $host in
 
366
   *-*-darwin*) LUA_SO=.so;;
 
367
   *) LUA_SO=$SO;;
 
368
esac
 
369
 
 
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
 
373
 
 
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
 
376
dnl preceding one.
 
377
dnl
 
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
 
384
 
 
385
AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"])
 
386
AC_SUBST(SWIGLIBS)
 
387
AC_SUBST(SWILL)
 
388
 
 
389
# check for --with-libm=...
 
390
AC_SUBST(LIBM)
 
391
LIBM=-lm
 
392
AC_ARG_WITH(libm, [  --with-libm=STRING      math library], [
 
393
if test "$withval" != yes
 
394
then LIBM=$withval
 
395
else AC_MSG_ERROR([proper usage is --with-libm=STRING])
 
396
fi])
 
397
AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"])
 
398
AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"])
 
399
AC_SUBST(LIBCRYPT)
 
400
 
 
401
# check for --with-libc=...
 
402
AC_SUBST(LIBC)
 
403
AC_ARG_WITH(libc, [  --with-libc=STRING      C library], [
 
404
if test "$withval" != yes
 
405
then LIBC=$withval
 
406
else AC_MSG_ERROR([proper usage is --with-libc=STRING])
 
407
fi])
 
408
 
 
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
#--------------------------------------------------------------------
 
417
 
 
418
AC_PATH_X
 
419
not_really_there=""
 
420
if test "$no_x" = ""; then
 
421
    if test "$x_includes" = ""; then
 
422
        AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
 
423
    else
 
424
        if test ! -r $x_includes/X11/Intrinsic.h; then
 
425
            not_really_there="yes"
 
426
        fi
 
427
    fi
 
428
fi
 
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"
 
435
        for i in $dirs ; do
 
436
            if test -r $i/X11/Intrinsic.h; then
 
437
                XINCLUDES=" -I$i"
 
438
                break
 
439
            fi
 
440
        done
 
441
    fi
 
442
    AC_MSG_RESULT($XINCLUDES)
 
443
else
 
444
    if test "$x_includes" != ""; then
 
445
        XINCLUDES=-I$x_includes
 
446
    else
 
447
        XINCLUDES="# no special path needed"
 
448
    fi
 
449
fi
 
450
if test -z "$XINCLUDES"; then
 
451
    AC_MSG_RESULT(couldn't find any!)
 
452
    XINCLUDES="# no include files found"
 
453
fi
 
454
 
 
455
if test "$no_x" = yes; then
 
456
    AC_MSG_CHECKING(for X11 libraries)
 
457
    XLIBSW=
 
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"
 
459
    for i in $dirs ; do
 
460
        if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
 
461
            AC_MSG_RESULT($i)
 
462
            XLIBSW="-L$i -lX11"
 
463
            break
 
464
        fi
 
465
    done
 
466
else
 
467
    if test "$x_libraries" = ""; then
 
468
        XLIBSW=-lX11
 
469
    else
 
470
        XLIBSW="-L$x_libraries -lX11"
 
471
    fi
 
472
fi
 
473
if test -z "$XLIBSW" ; then
 
474
    AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
 
475
fi
 
476
if test -z "$XLIBSW" ; then
 
477
    AC_MSG_RESULT(couldn't find any!  Using -lX11.)
 
478
    XLIBSW=-lX11
 
479
fi
 
480
 
 
481
AC_SUBST(XINCLUDES)
 
482
AC_SUBST(XLIBSW)
 
483
 
 
484
AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
 
485
 
 
486
#--------------------------------------------------------------------
 
487
# Look for Tcl
 
488
#--------------------------------------------------------------------
 
489
 
 
490
TCLINCLUDE=
 
491
TCLLIB=
 
492
TCLPACKAGE=
 
493
 
 
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=])
 
496
AC_ARG_WITH(tcl,
 
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=])
 
503
 
 
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])
 
507
else
 
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)`
 
513
   else
 
514
      AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
 
515
   fi
 
516
fi
 
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)`
 
525
            break
 
526
        fi
 
527
    done
 
528
fi
 
529
if test x"${TCLCONFIG}" = x ; then
 
530
    AC_MSG_RESULT(no)
 
531
else
 
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/"`
 
536
    fi
 
537
    if test -z "$TCLLIB"; then
 
538
        TCLLIB=$TCL_LIB_SPEC
 
539
    fi
 
540
fi
 
541
 
 
542
if test -z "$TCLINCLUDE"; then
 
543
   if test "x$TCLPACKAGE" != xyes; then
 
544
        TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include"
 
545
   fi
 
546
fi
 
547
 
 
548
if test -z "$TCLLIB"; then
 
549
   if test "x$TCLPACKAGE" != xyes; then
 
550
        TCLLIB="-L$TCLPACKAGE/lib -ltcl"
 
551
   fi
 
552
fi
 
553
 
 
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"
 
559
        for i in $dirs ; do
 
560
                if test -r $i/tcl.h; then
 
561
                        AC_MSG_RESULT($i)
 
562
                        TCLINCLUDE="$ISYSTEM$i"
 
563
                        break
 
564
                fi
 
565
        done
 
566
fi
 
567
if test -z "$TCLINCLUDE"; then
 
568
        AC_MSG_RESULT(not found)
 
569
fi
 
570
else
 
571
        AC_MSG_RESULT($TCLINCLUDE)
 
572
fi
 
573
 
 
574
AC_MSG_CHECKING(for Tcl library)
 
575
if test -z "$TCLLIB"; then
 
576
dirs="/usr/local/lib /usr/lib /opt/local/lib"
 
577
for i in $dirs ; do
 
578
        if test -r $i/libtcl.a; then
 
579
            AC_MSG_RESULT($i)
 
580
            TCLLIB="-L$i -ltcl"
 
581
            break
 
582
        fi
 
583
done
 
584
if test -z "$TCLLIB"; then
 
585
        AC_MSG_RESULT(not found)
 
586
fi
 
587
else
 
588
AC_MSG_RESULT($TCLLIB)
 
589
fi
 
590
 
 
591
# Cygwin (Windows) needs the library for dynamic linking
 
592
case $host in
 
593
*-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";;
 
594
*)TCLDYNAMICLINKING="";;
 
595
esac
 
596
 
 
597
case $host in
 
598
*-*-darwin*) 
 
599
    TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace'
 
600
    TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace'
 
601
    ;;
 
602
*)
 
603
    TCLLDSHARED='$(LDSHARED)'
 
604
    TCLCXXSHARED='$(CXXSHARED)'
 
605
    ;;
 
606
esac
 
607
 
 
608
fi
 
609
 
 
610
AC_SUBST(TCLINCLUDE)
 
611
AC_SUBST(TCLLIB)
 
612
AC_SUBST(TCLDYNAMICLINKING)
 
613
AC_SUBST(TCLLDSHARED)
 
614
AC_SUBST(TCLCXXSHARED)
 
615
 
 
616
#----------------------------------------------------------------
 
617
# Look for Python
 
618
#----------------------------------------------------------------
 
619
 
 
620
PYINCLUDE=
 
621
PYLIB=
 
622
PYPACKAGE=
 
623
 
 
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])
 
626
 
 
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])
 
630
else
 
631
# First figure out the name of the Python executable
 
632
 
 
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])
 
635
else
 
636
PYTHON="$PYBIN"
 
637
fi
 
638
 
 
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)
 
646
 
 
647
 
 
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.
 
650
 
 
651
    AC_MSG_CHECKING(for Python version)
 
652
 
 
653
    # Need to do this hack since autoconf replaces __file__ with the name of the configure file
 
654
    filehack="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)
 
657
 
 
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
 
664
      PYLIBDIR="lib" 
 
665
    fi
 
666
    AC_MSG_RESULT($PYLIBDIR)
 
667
    
 
668
    # Set the include directory
 
669
 
 
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"
 
673
    fi
 
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"
 
677
        fi
 
678
    fi
 
679
    AC_MSG_RESULT($PYINCLUDE)
 
680
 
 
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"
 
684
    for i in $dirs; do
 
685
        if test -d $PYEPREFIX/$PYLIBDIR/$i; then
 
686
           PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
 
687
           break
 
688
        fi
 
689
    done
 
690
    if test -z "$PYLIB"; then
 
691
        AC_MSG_RESULT(Not found)
 
692
    else
 
693
        AC_MSG_RESULT($PYLIB)
 
694
    fi
 
695
 
 
696
    # Check for really old versions
 
697
    if test -r $PYLIB/libPython.a; then
 
698
         PYLINK="-lModules -lPython -lObjects -lParser"
 
699
    else
 
700
         PYLINK="-l$PYVERSION"
 
701
    fi
 
702
fi
 
703
 
 
704
# Cygwin (Windows) needs the library for dynamic linking
 
705
case $host in
 
706
*-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
 
707
         DEFS="-DUSE_DL_IMPORT $DEFS" PYINCLUDE="$PYINCLUDE"
 
708
         ;;
 
709
*)PYTHONDYNAMICLINKING="";;
 
710
esac
 
711
fi
 
712
 
 
713
AC_SUBST(PYINCLUDE)
 
714
AC_SUBST(PYLIB)
 
715
AC_SUBST(PYLINK)
 
716
AC_SUBST(PYTHONDYNAMICLINKING)
 
717
 
 
718
 
 
719
#----------------------------------------------------------------
 
720
# Look for Python 3.x
 
721
#----------------------------------------------------------------
 
722
 
 
723
# mostly copy & pasted from "Look for Python" section,
 
724
# did some trim, fix and rename
 
725
 
 
726
PY3INCLUDE=
 
727
PY3LIB=
 
728
PY3PACKAGE=
 
729
 
 
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])
 
732
 
 
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])
 
736
else
 
737
# First figure out the name of the Python3 executable 
 
738
 
 
739
if test "x$PY3BIN" = xyes; then
 
740
  AC_CHECK_PROGS(PYTHON3, [python3 python3.0 python3.1])
 
741
else
 
742
  PYTHON3="$PY3BIN"
 
743
fi
 
744
 
 
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])
 
748
else
 
749
  AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config python3-config python3.0-config python3.1-config])
 
750
fi
 
751
 
 
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)
 
759
 
 
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.
 
762
    
 
763
    AC_MSG_CHECKING([for Python 3.x version])
 
764
 
 
765
    # Need to do this hack since autoconf replaces __file__ with the name of the configure file
 
766
    filehack="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)
 
769
 
 
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
 
776
      PY3LIBDIR="lib" 
 
777
    fi
 
778
    AC_MSG_RESULT($PY3LIBDIR)
 
779
    
 
780
    # Set the include directory
 
781
 
 
782
    AC_MSG_CHECKING([for Python 3.x header files])
 
783
    PY3INCLUDE=`($PY3CONFIG --includes) 2>/dev/null`
 
784
    AC_MSG_RESULT($PY3INCLUDE)
 
785
 
 
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"
 
789
    for i in $dirs; do
 
790
        if test -d $PY3EPREFIX/$PY3LIBDIR/$i; then
 
791
           PY3LIB="$PY3EPREFIX/$PY3LIBDIR/$i"
 
792
           break
 
793
        fi
 
794
    done
 
795
    if test -z "$PY3LIB"; then
 
796
        AC_MSG_RESULT([Not found])
 
797
    else
 
798
        AC_MSG_RESULT($PY3LIB)
 
799
    fi
 
800
 
 
801
    PY3LINK="-l$PY3VERSION"
 
802
fi
 
803
 
 
804
# Cygwin (Windows) needs the library for dynamic linking
 
805
case $host in
 
806
*-*-cygwin* | *-*-mingw*) PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK"
 
807
         DEFS="-DUSE_DL_IMPORT $DEFS" PY3INCLUDE="$PY3INCLUDE"
 
808
         ;;
 
809
*)PYTHON3DYNAMICLINKING="";;
 
810
esac
 
811
fi
 
812
 
 
813
AC_SUBST(PY3INCLUDE)
 
814
AC_SUBST(PY3LIB)
 
815
AC_SUBST(PY3LINK)
 
816
AC_SUBST(PYTHON3DYNAMICLINKING)
 
817
 
 
818
 
 
819
#----------------------------------------------------------------
 
820
# Look for Perl5
 
821
#----------------------------------------------------------------
 
822
 
 
823
PERLBIN=
 
824
 
 
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])
 
827
 
 
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])
 
831
PERL=
 
832
else
 
833
 
 
834
# First figure out what the name of Perl5 is
 
835
 
 
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)
 
838
else
 
839
PERL="$PERLBIN"
 
840
fi
 
841
 
 
842
 
 
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"
 
850
                PERL5EXT=none
 
851
                for i in $dirs; do
 
852
                        if test -r $i/perl.h; then
 
853
                                AC_MSG_RESULT($i)
 
854
                                PERL5EXT="$i"
 
855
                                break;
 
856
                        fi
 
857
                done
 
858
                if test "$PERL5EXT" = none; then
 
859
                        PERL5EXT="$PERL5DIR/CORE"
 
860
                        AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
 
861
                fi
 
862
 
 
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)
 
867
                else
 
868
                        AC_MSG_RESULT($PERL5LIB)
 
869
                fi
 
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)
 
874
                else
 
875
                        AC_MSG_RESULT($PERL5CCFLAGS)
 
876
                fi
 
877
        else
 
878
                AC_MSG_RESULT(unable to determine perl5 configuration)
 
879
                PERL5EXT=$PERL5DIR
 
880
        fi
 
881
else
 
882
        AC_MSG_RESULT(could not figure out how to run perl5)
 
883
fi
 
884
 
 
885
# Cygwin (Windows) needs the library for dynamic linking
 
886
case $host in
 
887
*-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";;
 
888
*)PERL5DYNAMICLINKING="";;
 
889
esac
 
890
fi
 
891
 
 
892
AC_SUBST(PERL)
 
893
AC_SUBST(PERL5EXT)
 
894
AC_SUBST(PERL5DYNAMICLINKING)
 
895
AC_SUBST(PERL5LIB)
 
896
AC_SUBST(PERL5CCFLAGS)
 
897
 
 
898
#----------------------------------------------------------------
 
899
# Look for Octave
 
900
#----------------------------------------------------------------
 
901
 
 
902
OCTAVEBIN=
 
903
OCTAVEDYNAMICLINKING=
 
904
OCTAVE_SO=.oct
 
905
 
 
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])
 
908
 
 
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])
 
912
OCTAVE=
 
913
else
 
914
 
 
915
# First figure out what the name of Octave is
 
916
 
 
917
if test "x$OCTAVEBIN" = xyes; then
 
918
AC_CHECK_PROGS(OCTAVE, octave)
 
919
else
 
920
OCTAVE="$OCTAVEBIN"
 
921
fi
 
922
 
 
923
 
 
924
AC_MSG_CHECKING(for Octave header files)
 
925
if test -n "$OCTAVE"; then
 
926
        OCTAVEDIR="/usr/include"
 
927
        if test "$OCTAVEDIR" != ""; then
 
928
                dirs="$OCTAVEDIR"
 
929
                OCTAVEEXT=""
 
930
                for i in $dirs; do
 
931
                        if test -r $i/octave/oct.h; then
 
932
                                OCTAVEEXT="$i"
 
933
                                break;
 
934
                        fi
 
935
                        if test -r $i/octave/octave/oct.h; then
 
936
                                OCTAVEEXT="$i/octave"
 
937
                                break;
 
938
                        fi
 
939
                done
 
940
                if test "$OCTAVEEXT" = "" ; then
 
941
                        AC_MSG_RESULT(not found)
 
942
                else
 
943
                        AC_MSG_RESULT($OCTAVEEXT)
 
944
                fi
 
945
 
 
946
                AC_MSG_CHECKING(for Octave compiler options)
 
947
                OCTAVECCFLAGS=""
 
948
                AC_MSG_RESULT($OCTAVECCFLAGS)
 
949
        fi
 
950
else
 
951
        AC_MSG_RESULT(could not figure out how to run octave)
 
952
fi
 
953
 
 
954
fi
 
955
 
 
956
AC_SUBST(OCTAVE)
 
957
AC_SUBST(OCTAVEEXT)
 
958
AC_SUBST(OCTAVE_SO)
 
959
AC_SUBST(OCTAVEDYNAMICLINKING)
 
960
AC_SUBST(OCTAVELIB)
 
961
AC_SUBST(OCTAVECCFLAGS)
 
962
 
 
963
#----------------------------------------------------------------
 
964
# Look for java
 
965
#----------------------------------------------------------------
 
966
 
 
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=])
 
970
 
 
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])
 
974
JAVA=
 
975
else
 
976
 
 
977
if test "x$JAVABIN" = xyes; then
 
978
  AC_CHECK_PROGS(JAVA, java kaffe guavac)
 
979
else
 
980
  JAVA="$JAVABIN"
 
981
fi
 
982
 
 
983
if test -z "$JAVACBIN"; then
 
984
  AC_CHECK_PROGS(JAVAC, javac)
 
985
else
 
986
  JAVAC="$JAVACBIN"
 
987
fi
 
988
 
 
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=])
 
991
 
 
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"
 
994
 
 
995
  # Add in default installation directory on Windows for Cygwin
 
996
  case $host in
 
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";;
 
999
  *);;
 
1000
  esac
 
1001
fi
 
1002
 
 
1003
JAVAINC=""
 
1004
for d in $JAVAINCDIR ; do
 
1005
  if test -r "$d/jni.h" ; then
 
1006
    AC_MSG_RESULT($d)
 
1007
    JAVAINCDIR=$d
 
1008
    JAVAINC=-I\"$d\"
 
1009
    break
 
1010
  fi
 
1011
done
 
1012
 
 
1013
if test "$JAVAINC" = "" ; then
 
1014
  AC_MSG_RESULT(not found)
 
1015
else
 
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)
 
1021
  else
 
1022
    JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1`
 
1023
    JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\""
 
1024
    AC_MSG_RESULT($JAVAMDDIR)
 
1025
  fi
 
1026
fi
 
1027
 
 
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
 
1029
case $host in
 
1030
*-*-cygwin* | *-*-mingw*)
 
1031
    if test "$GCC" = yes; then
 
1032
        JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
 
1033
        JAVACFLAGS="-mno-cygwin -mthreads"
 
1034
    else
 
1035
        JAVADYNAMICLINKING=""
 
1036
        JAVACFLAGS=""
 
1037
    fi ;;
 
1038
*-*-darwin*) 
 
1039
        JAVADYNAMICLINKING="-dynamiclib -framework JavaVM"
 
1040
        JAVACFLAGS=""
 
1041
        ;;
 
1042
*)
 
1043
        JAVADYNAMICLINKING=""
 
1044
        JAVACFLAGS=""
 
1045
        ;;
 
1046
esac
 
1047
 
 
1048
# Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
 
1049
case $host in
 
1050
*-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";;
 
1051
*)JAVALIBRARYPREFIX="lib";;
 
1052
esac
 
1053
 
 
1054
# Java on Mac OS X tweaks
 
1055
case $host in
 
1056
*-*-darwin*) 
 
1057
    JAVASO=".jnilib"
 
1058
    JAVALDSHARED='$(CC)'
 
1059
    JAVACXXSHARED='$(CXX)'
 
1060
    ;;
 
1061
*)
 
1062
    JAVASO=$SO
 
1063
    JAVALDSHARED='$(LDSHARED)'
 
1064
    JAVACXXSHARED='$(CXXSHARED)'
 
1065
    ;;
 
1066
esac
 
1067
fi
 
1068
 
 
1069
AC_SUBST(JAVA)
 
1070
AC_SUBST(JAVAC)
 
1071
AC_SUBST(JAVAINC)
 
1072
AC_SUBST(JAVADYNAMICLINKING)
 
1073
AC_SUBST(JAVALIBRARYPREFIX)
 
1074
AC_SUBST(JAVASO)
 
1075
AC_SUBST(JAVALDSHARED)
 
1076
AC_SUBST(JAVACXXSHARED)
 
1077
AC_SUBST(JAVACFLAGS)
 
1078
 
 
1079
#----------------------------------------------------------------
 
1080
# Look for gcj
 
1081
#----------------------------------------------------------------
 
1082
 
 
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=])
 
1086
 
 
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])
 
1090
else
 
1091
  if test "x$GCJBIN" = xyes; then
 
1092
    AC_CHECK_PROGS(GCJ, gcj)
 
1093
  else
 
1094
    GCJ="$GCJBIN"
 
1095
  fi
 
1096
 
 
1097
  if test -z "$GCJCBIN"; then
 
1098
    AC_CHECK_PROGS(GCJH, gcjh)
 
1099
  else
 
1100
    GCJH="$GCJHBIN"
 
1101
  fi
 
1102
fi
 
1103
 
 
1104
AC_SUBST(GCJ)
 
1105
AC_SUBST(GCJH)
 
1106
 
 
1107
#----------------------------------------------------------------
 
1108
# Look for Guile
 
1109
#----------------------------------------------------------------
 
1110
 
 
1111
GUILEPACKAGE=
 
1112
GUILEINCLUDE=
 
1113
GUILE=
 
1114
GUILELIB=
 
1115
GUILELINK=
 
1116
GUILEPKGDATADIR=
 
1117
 
 
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"])
 
1128
 
 
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])
 
1132
else
 
1133
 
 
1134
if test -z "$GUILE_CONFIG" ; then
 
1135
  AC_PATH_PROG(GUILE_CONFIG, guile-config)
 
1136
fi
 
1137
 
 
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`"
 
1145
fi
 
1146
 
 
1147
  if test -z "$GUILE" -o "x$GUILE" = xyes; then
 
1148
     if test -n "$GUILEPACKAGE"; then
 
1149
        GUILE="$GUILEPACKAGE/bin/guile"
 
1150
     else
 
1151
        GUILE=
 
1152
     fi
 
1153
  fi
 
1154
 
 
1155
  if test -z "$GUILEINCLUDE"; then
 
1156
     if test -n "$GUILEPACKAGE"; then
 
1157
        GUILEINCLUDE="$GUILEPACKAGE/include"
 
1158
     fi
 
1159
  fi
 
1160
 
 
1161
  if test -z "$GUILELIB"; then
 
1162
     if test -n "$GUILEPACKAGE"; then
 
1163
        GUILELIB="$GUILEPACKAGE/lib"
 
1164
     fi
 
1165
  fi
 
1166
 
 
1167
 
 
1168
AC_MSG_CHECKING(for Guile header files)
 
1169
 
 
1170
  dirs="$GUILEINCLUDE"
 
1171
  for i in $dirs ; do
 
1172
        if test -r $i/guile/gh.h; then
 
1173
                AC_MSG_RESULT($i)
 
1174
                GUILEINCLUDE="$ISYSTEM$i"
 
1175
                break
 
1176
        fi
 
1177
  done
 
1178
  if test -z "$GUILEINCLUDE"; then
 
1179
        AC_MSG_RESULT(not found)
 
1180
  fi
 
1181
 
 
1182
  AC_MSG_CHECKING(for Guile library)
 
1183
  dirs="$GUILELIB"
 
1184
  for i in $dirs ; do
 
1185
        if test -r $i/libguile.so; then
 
1186
            AC_MSG_RESULT($i)
 
1187
            GUILELIB="$i"
 
1188
            break
 
1189
        fi
 
1190
  done
 
1191
  if test -z "$GUILELIB"; then
 
1192
        AC_MSG_RESULT(not found)
 
1193
  fi
 
1194
 
 
1195
if test -z "$GUILELINK"; then
 
1196
  GUILELINK="-L$GUILELIB -lguile"
 
1197
fi
 
1198
 
 
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"
 
1205
 
 
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
 
1210
        AC_MSG_RESULT(yes)
 
1211
else
 
1212
        AC_MSG_RESULT(no)
 
1213
fi
 
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
 
1218
        AC_MSG_RESULT(yes)
 
1219
else
 
1220
        AC_MSG_RESULT(no)
 
1221
fi
 
1222
CFLAGS=$guilesafe_CFLAGS
 
1223
LIBS=$guilesafe_LIBS
 
1224
fi
 
1225
 
 
1226
AC_SUBST(GUILE)
 
1227
AC_SUBST(GUILEINCLUDE)
 
1228
AC_SUBST(GUILELIB)
 
1229
AC_SUBST(GUILELINK)
 
1230
AC_SUBST(GUILE_GH_INTERFACE)
 
1231
AC_SUBST(GUILE_SCM_INTERFACE)
 
1232
 
 
1233
#----------------------------------------------------------------
 
1234
# Look for MzScheme
 
1235
#----------------------------------------------------------------
 
1236
 
 
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=])
 
1240
 
 
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])
 
1244
  MZC=
 
1245
else
 
1246
  if test "x$MZSCHEMEBIN" = xyes; then
 
1247
     AC_PATH_PROG(MZSCHEME, mzscheme)
 
1248
  else
 
1249
     MZSCHEME="$MZSCHEMEBIN"
 
1250
  fi
 
1251
  
 
1252
  if test -z "$MZCBIN"; then
 
1253
     AC_PATH_PROG(MZC, mzc)
 
1254
  fi
 
1255
 
 
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"
 
1261
    else
 
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`
 
1264
    fi
 
1265
    if test -f "$MZDYNOBJ"; then
 
1266
      AC_MSG_RESULT($MZDYNOBJ)
 
1267
    else
 
1268
      AC_MSG_RESULT(not found)
 
1269
      MZDYNOBJ=""
 
1270
    fi
 
1271
  fi
 
1272
fi
 
1273
AC_SUBST(MZDYNOBJ)
 
1274
 
 
1275
#----------------------------------------------------------------
 
1276
# Look for Ruby
 
1277
#----------------------------------------------------------------
 
1278
 
 
1279
RUBYBIN=
 
1280
 
 
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])
 
1283
 
 
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])
 
1287
RUBY=
 
1288
else
 
1289
 
 
1290
# First figure out what the name of Ruby is
 
1291
 
 
1292
if test "x$RUBYBIN" = xyes; then
 
1293
        AC_CHECK_PROGS(RUBY, ruby)
 
1294
else
 
1295
        RUBY="$RUBYBIN"
 
1296
fi
 
1297
 
 
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
 
1302
                dirs="$RUBYDIR"
 
1303
                RUBYINCLUDE=none
 
1304
                for i in $dirs; do
 
1305
                        if test -r $i/ruby.h; then
 
1306
                                AC_MSG_RESULT($i)
 
1307
                                RUBYINCLUDE="-I$i"
 
1308
                                break;
 
1309
                        fi
 
1310
                done
 
1311
                if test "$RUBYINCLUDE" = none; then
 
1312
                        RUBYINCLUDE="-I$RUBYDIR"
 
1313
                        AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
 
1314
                fi
 
1315
 
 
1316
                # Find library and path for linking.
 
1317
                AC_MSG_CHECKING(for Ruby library)
 
1318
                RUBYLIB=""
 
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"
 
1322
 
 
1323
        rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
 
1324
        RUBYLINK=`($RUBY -rrbconfig -e '
 
1325
            c = Config::CONFIG
 
1326
            if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
 
1327
                if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
 
1328
                    link = c[["LIBRUBYARG_STATIC"]]
 
1329
                else
 
1330
                    link = c[["LIBRUBYARG_SHARED"]]
 
1331
                end
 
1332
            else # 1.6.x
 
1333
                link = "-l" + c[["RUBY_INSTALL_NAME"]]
 
1334
            end
 
1335
            
 
1336
            # Get the target Ruby was built for
 
1337
            target = c[["target"]]
 
1338
           
 
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)
 
1346
              puts "-l#{link}"
 
1347
            else
 
1348
              puts link
 
1349
            end') 2>/dev/null`
 
1350
 
 
1351
                if test "$rb_libruby" != ""; then
 
1352
                        for i in $dirs; do
 
1353
                                if (test -r $i/$rb_libruby;) then
 
1354
                                        RUBYLIB="$i"
 
1355
                                        break;
 
1356
                                fi
 
1357
                        done
 
1358
                fi
 
1359
                if test "$RUBYLIB" = ""; then
 
1360
                        RUBYLIB="$RUBYDIR"
 
1361
                        AC_MSG_RESULT(not found... using $RUBYDIR)
 
1362
                else
 
1363
                        AC_MSG_RESULT($RUBYLINK in $RUBYLIB)
 
1364
                fi
 
1365
        else
 
1366
                AC_MSG_RESULT(unable to determine ruby configuration)
 
1367
                RUBYINCLUDE="-I$RUBYDIR"
 
1368
                RUBYLIB="$RUBYDIR"
 
1369
        fi
 
1370
 
 
1371
        case $host in
 
1372
                *-*-mingw*) ;; # do nothing, the default windows libraries are already included
 
1373
                *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";;
 
1374
        esac
 
1375
 
 
1376
        RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
 
1377
else
 
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"
 
1382
fi
 
1383
 
 
1384
case $host in
 
1385
*-*-cygwin* | *-*-mingw*)       RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";;
 
1386
*)              RUBYDYNAMICLINKING="";;
 
1387
esac
 
1388
fi
 
1389
 
 
1390
AC_SUBST(RUBYINCLUDE)
 
1391
AC_SUBST(RUBYLIB)
 
1392
AC_SUBST(RUBYLINK)
 
1393
AC_SUBST(RUBYCCDLFLAGS)
 
1394
AC_SUBST(RUBYDYNAMICLINKING)
 
1395
 
 
1396
#-------------------------------------------------------------------------
 
1397
# Look for PHP
 
1398
#-------------------------------------------------------------------------
 
1399
 
 
1400
PHPBIN=
 
1401
 
 
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])
 
1404
 
 
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])
 
1408
    PHP=
 
1409
else
 
1410
 
 
1411
    if test "x$PHPBIN" = xyes; then
 
1412
      AC_CHECK_PROGS(PHP, [php5 php])
 
1413
    else
 
1414
      PHP=$PHPBIN
 
1415
    fi
 
1416
 
 
1417
    AC_MSG_CHECKING(for PHP header files)
 
1418
    dnl /usr/bin/php5 -> /usr/bin/php-config5
 
1419
    case $PHP in
 
1420
      *5)
 
1421
        PHPCONFIG=`echo "$PHP"|sed 's/5$/-config5/'` ;;
 
1422
      *)
 
1423
        PHPCONFIG=$PHP-config ;;
 
1424
    esac
 
1425
    php_version=`$PHPCONFIG --version 2>/dev/null`
 
1426
    case $php_version in
 
1427
    5*) 
 
1428
        PHPINC=`$PHPCONFIG --includes 2>/dev/null`
 
1429
        if test -n "$PHPINC"; then
 
1430
          AC_MSG_RESULT($PHPINC)
 
1431
        else
 
1432
          AC_MSG_RESULT(not found)
 
1433
        fi
 
1434
        ;;
 
1435
    *)
 
1436
        AC_MSG_RESULT([found PHP $version, but only PHP 5 is supported]) ;;
 
1437
    esac
 
1438
fi
 
1439
AC_SUBST(PHP)
 
1440
AC_SUBST(PHPINC)
 
1441
 
 
1442
#----------------------------------------------------------------
 
1443
# Look for ocaml
 
1444
#----------------------------------------------------------------
 
1445
 
 
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=])
 
1452
 
 
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])
 
1456
OCAMLBIN=
 
1457
else
 
1458
 
 
1459
AC_MSG_CHECKING(for Ocaml DL load generator)
 
1460
if test -z "$OCAMLDLGEN"; then
 
1461
AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen, :)
 
1462
else
 
1463
OCAMLDLGEN="$OCAMLDLGEN"
 
1464
fi
 
1465
 
 
1466
AC_MSG_CHECKING(for Ocaml package tool)
 
1467
if test -z "$OCAMLFIND"; then
 
1468
AC_CHECK_PROGS(OCAMLFIND, ocamlfind, :)
 
1469
else
 
1470
OCAMLFIND="$OCAMLFIND"
 
1471
fi
 
1472
 
 
1473
AC_MSG_CHECKING(for Ocaml compiler)
 
1474
if test -z "$OCAMLC"; then
 
1475
AC_CHECK_PROGS(OCAMLC, ocamlc, :)
 
1476
else
 
1477
OCAMLC="$OCAMLC"
 
1478
fi
 
1479
 
 
1480
AC_MSG_CHECKING(for Ocaml interpreter)
 
1481
if test "x$OCAMLBIN" = xyes; then
 
1482
AC_CHECK_PROGS(OCAMLBIN, ocaml, :)
 
1483
else
 
1484
OCAMLBIN="$OCAMLBIN"
 
1485
fi
 
1486
 
 
1487
AC_MSG_CHECKING(for Ocaml toplevel creator)
 
1488
if test -z "$OCAMLMKTOP"; then
 
1489
AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :)
 
1490
else
 
1491
OCAMLMKTOP="$OCAMLMKTOP"
 
1492
fi
 
1493
 
 
1494
OCAMLLOC=loc
 
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"
 
1501
        fi
 
1502
        for i in $dirs; do
 
1503
                if test -r $i/mlvalues.h; then
 
1504
                        AC_MSG_RESULT($i)
 
1505
                        OCAMLEXT="$i"
 
1506
                        OCAMLINC="-I$OCAMLEXT"
 
1507
                        break;
 
1508
                fi
 
1509
        done
 
1510
        if test -z "$OCAMLINC"; then
 
1511
                AC_MSG_RESULT(not found)
 
1512
        fi
 
1513
 
 
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)
 
1518
fi
 
1519
fi # Disabling ocaml
 
1520
 
 
1521
export OCAMLLOC
 
1522
export OCAMLVER
 
1523
export OCAMLINC
 
1524
export OCAMLBIN
 
1525
export OCAMLC
 
1526
export OCAMLDLGEN
 
1527
export OCAMLFIND
 
1528
export OCAMLMKTOP
 
1529
 
 
1530
AC_SUBST(OCAMLLOC)
 
1531
AC_SUBST(OCAMLVER)
 
1532
AC_SUBST(OCAMLINC)
 
1533
AC_SUBST(OCAMLBIN)
 
1534
AC_SUBST(OCAMLC)
 
1535
AC_SUBST(OCAMLDLGEN)
 
1536
AC_SUBST(OCAMLFIND)
 
1537
AC_SUBST(OCAMLMKTOP)
 
1538
 
 
1539
#----------------------------------------------------------------
 
1540
# Look for Pike
 
1541
#----------------------------------------------------------------
 
1542
 
 
1543
# Identify the name of the Pike executable
 
1544
# Priority: configure option, automatic search
 
1545
PIKEBIN=
 
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])
 
1548
 
 
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])
 
1552
PIKEBIN=
 
1553
else
 
1554
 
 
1555
if test "x$PIKEBIN" = xyes; then
 
1556
        AC_CHECK_PROGS(PIKE, pike pike7.6 pike7.4 pike7.2)
 
1557
else
 
1558
        PIKE="$PIKEBIN"
 
1559
fi
 
1560
 
 
1561
 
 
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=""])
 
1567
 
 
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)
 
1571
fi
 
1572
 
 
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=])
 
1578
 
 
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`
 
1583
      fi
 
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"
 
1588
      fi
 
1589
 
 
1590
      if test -z "$PIKEINCLUDE"; then
 
1591
              AC_MSG_RESULT(not found)
 
1592
      else
 
1593
              AC_MSG_RESULT($PIKEINCLUDE)
 
1594
      fi
 
1595
fi
 
1596
fi
 
1597
 
 
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?
 
1601
 
 
1602
#----------------------------------------------------------------
 
1603
# Look for CHICKEN
 
1604
#----------------------------------------------------------------
 
1605
 
 
1606
CHICKEN=
 
1607
CHICKEN_CONFIG=
 
1608
CHICKENHOME=
 
1609
CHICKENOPTS=
 
1610
CHICKENLIB=
 
1611
 
 
1612
 
 
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])
 
1615
 
 
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])
 
1619
else
 
1620
 
 
1621
if test "x$CHICKENBIN" = xyes; then
 
1622
AC_CHECK_PROGS(CHICKEN, chicken)
 
1623
else
 
1624
CHICKEN="$CHICKENBIN"
 
1625
fi
 
1626
 
 
1627
AC_ARG_WITH(chickencsc,[  --with-chickencsc=path  Set location of csc executable],[ CHICKEN_CSC="$withval"], [CHICKEN_CSC=])
 
1628
 
 
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
 
1636
      AC_MSG_RESULT(no)
 
1637
    else
 
1638
      AC_MSG_RESULT(yes)
 
1639
    fi
 
1640
  fi
 
1641
fi
 
1642
 
 
1643
AC_ARG_WITH(chickencsi,[  --with-chickencsi=path  Set location of csi executable],[ CHICKEN_CSI="$withval"], [CHICKEN_CSI=])
 
1644
 
 
1645
if test -z "$CHICKEN_CSI"; then
 
1646
AC_CHECK_PROGS(CHICKEN_CSI, csi)
 
1647
fi
 
1648
 
 
1649
if test -n "$CHICKEN_CSC" ; then
 
1650
 
 
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=])
 
1657
 
 
1658
  AC_MSG_CHECKING(for compiler options for static CHICKEN generated code)
 
1659
  if test -z "$CHICKENOPTS"; then
 
1660
        CHICKENOPTS="`$CHICKEN_CSC -cflags`"
 
1661
  else
 
1662
        CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS"
 
1663
  fi
 
1664
  if test -z "$CHICKENOPTS"; then
 
1665
        AC_MSG_RESULT(not found)
 
1666
  else
 
1667
        AC_MSG_RESULT($CHICKENOPTS)
 
1668
  fi
 
1669
 
 
1670
  AC_MSG_CHECKING(for linker options for shared CHICKEN generated code)
 
1671
  if test -z "$CHICKENSHAREDLIB"; then
 
1672
        CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`"
 
1673
  else
 
1674
        CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB"
 
1675
  fi
 
1676
  if test -z "$CHICKENSHAREDLIB"; then
 
1677
        AC_MSG_RESULT(not found)
 
1678
  else
 
1679
        AC_MSG_RESULT($CHICKENSHAREDLIB)
 
1680
  fi
 
1681
 
 
1682
  AC_MSG_CHECKING(for linker options for static CHICKEN generated code)
 
1683
  if test -z "$CHICKENLIB"; then
 
1684
        CHICKENLIB="`$CHICKEN_CSC -libs`"
 
1685
  else
 
1686
        CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB"
 
1687
  fi
 
1688
  if test -z "$CHICKENLIB"; then
 
1689
        AC_MSG_RESULT(not found)
 
1690
  else
 
1691
        AC_MSG_RESULT($CHICKENLIB)
 
1692
  fi
 
1693
 
 
1694
fi # have CHICKEN_CONFIG
 
1695
fi # Check for --without-chicken
 
1696
 
 
1697
AC_SUBST(CHICKEN)
 
1698
AC_SUBST(CHICKEN_CSC)
 
1699
AC_SUBST(CHICKEN_CSI)
 
1700
AC_SUBST(CHICKENOPTS)
 
1701
AC_SUBST(CHICKENLIB)
 
1702
AC_SUBST(CHICKENSHAREDLIB)
 
1703
 
 
1704
#----------------------------------------------------------------
 
1705
# Look for C#
 
1706
#----------------------------------------------------------------
 
1707
 
 
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=])
 
1711
 
 
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])
 
1715
CSHARPCOMPILER=
 
1716
else
 
1717
 
 
1718
if test -z "$CSHARPCOMPILERBIN" ; then
 
1719
  case $host in
 
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
 
1727
        AC_MSG_RESULT(no)
 
1728
        AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc)
 
1729
      else
 
1730
        AC_MSG_RESULT(yes)
 
1731
      fi
 
1732
    fi
 
1733
    ;;
 
1734
  *)AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc);;
 
1735
  esac
 
1736
else
 
1737
  CSHARPCOMPILER="$CSHARPCOMPILERBIN"
 
1738
fi
 
1739
 
 
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)
 
1746
  else
 
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#'
 
1752
      CSHARPCOMPILER="";
 
1753
      if test -n "$csharp_version_raw" ; then
 
1754
        if test "$csharp_version_raw" = "$csharp_version_searched" ; then
 
1755
          CSHARPCOMPILER="mcs"
 
1756
        fi
 
1757
      fi
 
1758
      if test "mcs" != "$CSHARPCOMPILER" ; then
 
1759
        echo "mcs is not a working Mono C# compiler"
 
1760
      fi
 
1761
    fi
 
1762
    if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then
 
1763
        AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT
 
1764
    else 
 
1765
      if test "csc" = "$CSHARPCOMPILER"; then
 
1766
          CSHARPPATHSEPARATOR="\\\\"
 
1767
          CSHARPCYGPATH_W='cygpath -w'
 
1768
      fi
 
1769
    fi
 
1770
  fi
 
1771
else
 
1772
  CSHARPCILINTERPRETER="$CSHARPBIN"
 
1773
fi
 
1774
 
 
1775
# Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable
 
1776
case $host in
 
1777
*-*-cygwin* | *-*-mingw*)
 
1778
    if test "$GCC" = yes; then
 
1779
        CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
 
1780
        CSHARPCFLAGS="-mno-cygwin -mthreads"
 
1781
    else
 
1782
        CSHARPDYNAMICLINKING=""
 
1783
        CSHARPCFLAGS=""
 
1784
    fi ;;
 
1785
*)
 
1786
        CSHARPDYNAMICLINKING=""
 
1787
        CSHARPCFLAGS=""
 
1788
        ;;
 
1789
esac
 
1790
 
 
1791
# CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
 
1792
case $host in
 
1793
*-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";;
 
1794
*)CSHARPLIBRARYPREFIX="lib";;
 
1795
esac
 
1796
 
 
1797
# C#/Mono on Mac OS X tweaks
 
1798
case $host in
 
1799
*-*-darwin*)
 
1800
    CSHARPSO=".so"
 
1801
    ;;
 
1802
*)
 
1803
    CSHARPSO=$SO
 
1804
    ;;
 
1805
esac
 
1806
fi
 
1807
 
 
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)
 
1815
AC_SUBST(CSHARPSO)
 
1816
 
 
1817
#----------------------------------------------------------------
 
1818
# Look for Lua
 
1819
#----------------------------------------------------------------
 
1820
 
 
1821
LUABIN=
 
1822
LUAINCLUDE=
 
1823
LUALIB=
 
1824
LUADYNAMICLOADLIB=
 
1825
LUAFLAGS=
 
1826
LUALINK=
 
1827
# note: if LUABIN is empty then lua tests will not be done
 
1828
# LUABIN will be cleared if certain dependencies cannot be found
 
1829
 
 
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=])
 
1836
 
 
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])
 
1840
else
 
1841
 
 
1842
# can we find lua?
 
1843
if test "x$LUABIN" = xyes; then
 
1844
   AC_PATH_PROG(LUABIN, lua)
 
1845
fi
 
1846
 
 
1847
# check version: we need Lua 5.x
 
1848
if test "$LUABIN"; then
 
1849
   AC_MSG_CHECKING(Lua version)
 
1850
   # if version 5.x
 
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'`
 
1854
 
 
1855
   if test -z "$LUAV5"; then
 
1856
     AC_MSG_WARN(Not Lua 5.x, SWIG does not support this version of Lua)
 
1857
     LUABIN=""
 
1858
   elif test -z "$LUAV51"; then
 
1859
     AC_MSG_RESULT(Lua 5.0.x)
 
1860
   else
 
1861
     AC_MSG_RESULT(Lua 5.1 or later)
 
1862
   fi
 
1863
fi
 
1864
 
 
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'`
 
1871
   else
 
1872
     LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'`
 
1873
   fi
 
1874
   
 
1875
   if test -z "$LUADYNAMICLOADLIB"; then 
 
1876
     AC_MSG_RESULT(no)
 
1877
   else
 
1878
     AC_MSG_RESULT(yes)
 
1879
   fi
 
1880
fi
 
1881
 
 
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=])
 
1886
else
 
1887
  LUA_OK="1"
 
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"
 
1894
    for i in $dirs; do
 
1895
      #echo "$i"
 
1896
      if test -r $i/lua.h; then
 
1897
        AC_MSG_RESULT($i/lua.h)
 
1898
        LUAFLAGS="$ISYSTEM$i"
 
1899
        break;
 
1900
      fi
 
1901
    done
 
1902
    if test -z "$LUAFLAGS"; then
 
1903
      AC_MSG_RESULT(not found)
 
1904
      LUABIN="" # clear the bin
 
1905
    fi
 
1906
  fi
 
1907
fi
 
1908
 
 
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
 
1912
        
 
1913
if test -n "$LUALIB"; then
 
1914
  AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=])
 
1915
else
 
1916
  AC_SEARCH_LIBS(lua_close, [lua lua51 lua5.1 lua50 lua5.0], [LUALINK="-l$ac_lib"],[LUABIN=])
 
1917
fi
 
1918
 
 
1919
# adding lualib for lua 5.0
 
1920
if test -z "$LUAV51"; then # extra for lua 5.0
 
1921
  LUALINK="$LUALINK -llualib"
 
1922
fi
 
1923
 
 
1924
LIBS=$lua_save_LIBS     # restore LIBS
 
1925
 
 
1926
fi # if not disabled
 
1927
 
 
1928
AC_SUBST(LUADYNAMICLINKING)
 
1929
AC_SUBST(LUAFLAGS)
 
1930
AC_SUBST(LUALINK)
 
1931
AC_SUBST(LUABIN)
 
1932
 
 
1933
#----------------------------------------------------------------
 
1934
# Look for Allegro Common Lisp
 
1935
#----------------------------------------------------------------
 
1936
 
 
1937
ALLEGROCLBIN=
 
1938
 
 
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])
 
1941
 
 
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])
 
1945
ALLEGROCLBIN=
 
1946
else
 
1947
 
 
1948
# can we find allegrocl?
 
1949
if test "x$ALLEGROCLBIN" = xyes; then
 
1950
   AC_PATH_PROG(ALLEGROCLBIN, alisp)
 
1951
fi
 
1952
fi
 
1953
 
 
1954
AC_SUBST(ALLEGROCLBIN)
 
1955
 
 
1956
#----------------------------------------------------------------
 
1957
# Look for GNU CLISP
 
1958
#----------------------------------------------------------------
 
1959
 
 
1960
CLISPBIN=
 
1961
 
 
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])
 
1964
 
 
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])
 
1968
CLISPBIN=
 
1969
else
 
1970
 
 
1971
# can we find clisp?
 
1972
if test "x$CLISPBIN" = xyes; then
 
1973
   AC_PATH_PROG(CLISPBIN, clisp)
 
1974
fi
 
1975
fi
 
1976
 
 
1977
AC_SUBST(CLISPBIN)
 
1978
 
 
1979
#----------------------------------------------------------------
 
1980
# Look for GNU R
 
1981
#----------------------------------------------------------------
 
1982
 
 
1983
RBIN=
 
1984
 
 
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])
 
1987
 
 
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])
 
1991
RBIN=
 
1992
else
 
1993
 
 
1994
# can we find R?
 
1995
if test "x$RBIN" = xyes; then
 
1996
   AC_PATH_PROG(RBIN, R)
 
1997
fi
 
1998
fi
 
1999
 
 
2000
AC_SUBST(RBIN)
 
2001
 
 
2002
#----------------------------------------------------------------
 
2003
# Look for Go compilers
 
2004
#----------------------------------------------------------------
 
2005
 
 
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])
 
2008
 
 
2009
if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then 
 
2010
  AC_MSG_NOTICE([Disabling Go])
 
2011
  GO=
 
2012
  GOGCC=false
 
2013
else
 
2014
 
 
2015
  if test "x$GOBIN" = xyes; then
 
2016
    AC_CHECK_PROGS(GO, 6g 8g gccgo)
 
2017
  else
 
2018
    GO="$GOBIN"
 
2019
  fi
 
2020
 
 
2021
  if test -n "$GO" ; then
 
2022
    GOGCC=false
 
2023
    if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then
 
2024
      GOGCC=true
 
2025
    else
 
2026
      AC_MSG_CHECKING([whether Go ($GO) version is too old])
 
2027
      go_version=`$GO -V | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
 
2028
      go_min_version=7077
 
2029
      if test "$go_version" -lt $go_min_version; then
 
2030
        AC_MSG_RESULT([yes - minimum version is $go_min_version])
 
2031
        GO=
 
2032
      else
 
2033
        AC_MSG_RESULT([no])
 
2034
      fi
 
2035
    fi
 
2036
  fi
 
2037
fi
 
2038
 
 
2039
AC_SUBST(GOGCC)
 
2040
AC_SUBST(GO)
 
2041
 
 
2042
#----------------------------------------------------------------
 
2043
# Look for D
 
2044
#----------------------------------------------------------------
 
2045
 
 
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=])
 
2049
 
 
2050
 
 
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])
 
2054
  D1COMPILER=
 
2055
  D2COMPILER=
 
2056
else
 
2057
  old_ac_ext=$ac_ext
 
2058
  ac_ext=d
 
2059
 
 
2060
  if test -z "$D1COMPILERBIN" ; then
 
2061
    AC_CHECK_PROGS(D1COMPILER, dmd ldmd gdmd)
 
2062
 
 
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;
 
2067
void main() {
 
2068
}
 
2069
_ACEOF
 
2070
      rm -f conftest.$ac_objext
 
2071
      AS_IF(
 
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])
 
2075
        D1COMPILER=]
 
2076
      )
 
2077
      rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
2078
    fi
 
2079
  else
 
2080
    D1COMPILER="$D1COMPILERBIN"
 
2081
  fi
 
2082
 
 
2083
  if test -z "$D2COMPILERBIN" ; then
 
2084
    AC_CHECK_PROGS(D2COMPILER, dmd gdmd)
 
2085
 
 
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;
 
2090
void main() {
 
2091
}
 
2092
_ACEOF
 
2093
      rm -f conftest.$ac_objext
 
2094
      AS_IF(
 
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])
 
2098
        D2COMPILER=]
 
2099
      )
 
2100
      rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
2101
    fi
 
2102
  else
 
2103
    D2COMPILER="$D2COMPILERBIN"
 
2104
  fi
 
2105
 
 
2106
  ac_ext=$old_ac_ext
 
2107
fi
 
2108
 
 
2109
if test -n "$D1COMPILER"; then
 
2110
  DDEFAULTVERSION=1
 
2111
elif test -n "$D2COMPILER"; then
 
2112
  DDEFAULTVERSION=2
 
2113
fi
 
2114
 
 
2115
# Do not prefix library file names with "lib" on Windows.
 
2116
case $host in
 
2117
*-*-cygwin* | *-*-mingw*) DLIBPREFIX="";;
 
2118
*)DLIBPREFIX="lib";;
 
2119
esac
 
2120
 
 
2121
AC_SUBST(D1COMPILER)
 
2122
AC_SUBST(D2COMPILER)
 
2123
AC_SUBST(DDEFAULTVERSION)
 
2124
AC_SUBST(DLIBPREFIX)
 
2125
 
 
2126
#----------------------------------------------------------------
 
2127
# Determine which languages to use for examples/test-suite
 
2128
#----------------------------------------------------------------
 
2129
 
 
2130
SKIP_TCL=
 
2131
if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then
 
2132
    SKIP_TCL="1"
 
2133
fi
 
2134
AC_SUBST(SKIP_TCL)
 
2135
 
 
2136
 
 
2137
SKIP_PERL5=
 
2138
if test -z "$PERL" || test -z "$PERL5EXT" ; then
 
2139
    SKIP_PERL5="1"
 
2140
fi
 
2141
AC_SUBST(SKIP_PERL5)
 
2142
 
 
2143
 
 
2144
SKIP_OCTAVE=
 
2145
if test -z "$OCTAVE" || test -z "$OCTAVEEXT" ; then
 
2146
    SKIP_OCTAVE="1"
 
2147
fi
 
2148
AC_SUBST(SKIP_OCTAVE)
 
2149
 
 
2150
 
 
2151
SKIP_PYTHON=
 
2152
if (test -z "$PYINCLUDE" || test -z "$PYLIB") &&
 
2153
   (test -z "$PY3INCLUDE" || test -z "PY3LIB") ; then
 
2154
    SKIP_PYTHON="1"
 
2155
fi
 
2156
AC_SUBST(SKIP_PYTHON)
 
2157
 
 
2158
SKIP_PYTHON3=
 
2159
if test -z "$PY3INCLUDE" || test -z "$PY3LIB" ; then
 
2160
    SKIP_PYTHON3="1"
 
2161
fi
 
2162
AC_SUBST(SKIP_PYTHON3)
 
2163
 
 
2164
SKIP_JAVA=
 
2165
if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then
 
2166
    SKIP_JAVA="1"
 
2167
fi
 
2168
AC_SUBST(SKIP_JAVA)
 
2169
 
 
2170
 
 
2171
SKIP_GUILE=
 
2172
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_GH_INTERFACE"; then
 
2173
    SKIP_GUILE="1"
 
2174
fi
 
2175
AC_SUBST(SKIP_GUILE)
 
2176
 
 
2177
SKIP_GUILESCM=
 
2178
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_SCM_INTERFACE"; then
 
2179
    SKIP_GUILESCM="1"
 
2180
fi
 
2181
AC_SUBST(SKIP_GUILESCM)
 
2182
 
 
2183
 
 
2184
SKIP_MZSCHEME=
 
2185
if test -z "$MZC" || test -z "$MZDYNOBJ" ; then
 
2186
    SKIP_MZSCHEME="1"
 
2187
fi
 
2188
AC_SUBST(SKIP_MZSCHEME)
 
2189
 
 
2190
 
 
2191
SKIP_RUBY=
 
2192
if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then
 
2193
    SKIP_RUBY="1"
 
2194
fi
 
2195
AC_SUBST(SKIP_RUBY)
 
2196
 
 
2197
 
 
2198
SKIP_PHP=
 
2199
if test -z "$PHP" || test -z "$PHPINC" ; then
 
2200
    SKIP_PHP="1"
 
2201
fi
 
2202
AC_SUBST(SKIP_PHP)
 
2203
 
 
2204
 
 
2205
SKIP_OCAML=
 
2206
if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then
 
2207
    SKIP_OCAML="1"
 
2208
fi
 
2209
AC_SUBST(SKIP_OCAML)
 
2210
 
 
2211
 
 
2212
SKIP_PIKE="1" # Always skipped!
 
2213
if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then
 
2214
    SKIP_PIKE="1"
 
2215
fi
 
2216
AC_SUBST(SKIP_PIKE)
 
2217
 
 
2218
 
 
2219
SKIP_CHICKEN=
 
2220
if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then
 
2221
    SKIP_CHICKEN="1"
 
2222
fi
 
2223
AC_SUBST(SKIP_CHICKEN)
 
2224
 
 
2225
 
 
2226
SKIP_CSHARP=
 
2227
if test -z "$CSHARPCOMPILER" ; then
 
2228
    SKIP_CSHARP="1"
 
2229
else
 
2230
    if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then
 
2231
      SKIP_CSHARP="1"
 
2232
    fi
 
2233
fi
 
2234
AC_SUBST(SKIP_CSHARP)
 
2235
 
 
2236
SKIP_MODULA3="1" # Always skipped!
 
2237
AC_SUBST(SKIP_MODULA3)
 
2238
 
 
2239
SKIP_LUA=
 
2240
# we need LUABIN & dynamic loading
 
2241
if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then
 
2242
    SKIP_LUA="1"
 
2243
fi
 
2244
AC_SUBST(SKIP_LUA)
 
2245
 
 
2246
SKIP_ALLEGROCL=
 
2247
if test -z "$ALLEGROCLBIN" ; then
 
2248
    SKIP_ALLEGROCL="1"
 
2249
fi
 
2250
AC_SUBST(SKIP_ALLEGROCL)
 
2251
 
 
2252
SKIP_CLISP=
 
2253
if test -z "$CLISPBIN" ; then
 
2254
    SKIP_CLISP="1"
 
2255
fi
 
2256
AC_SUBST(SKIP_CLISP)
 
2257
 
 
2258
SKIP_R=
 
2259
if test -z "$RBIN" ; then
 
2260
    SKIP_R="1"
 
2261
fi
 
2262
AC_SUBST(SKIP_R)
 
2263
 
 
2264
SKIP_CFFI=
 
2265
#if test -z "$CFFIBIN" ; then
 
2266
    SKIP_CFFI="1"
 
2267
#fi
 
2268
AC_SUBST(SKIP_CFFI)
 
2269
 
 
2270
SKIP_UFFI=
 
2271
#if test -z "$UFFIBIN" ; then
 
2272
    SKIP_UFFI="1"
 
2273
#fi
 
2274
AC_SUBST(SKIP_UFFI)
 
2275
 
 
2276
SKIP_GO=
 
2277
if test -z "$GO" ; then
 
2278
    SKIP_GO="1"
 
2279
fi
 
2280
AC_SUBST(SKIP_GO)
 
2281
 
 
2282
SKIP_D=
 
2283
if test -z "$DDEFAULTVERSION" ; then
 
2284
    SKIP_D="1"
 
2285
fi
 
2286
AC_SUBST(SKIP_D)
 
2287
 
 
2288
#----------------------------------------------------------------
 
2289
# Additional language dependencies
 
2290
#----------------------------------------------------------------
 
2291
SKIP_GCJ=
 
2292
if test -z "$GCJ" || test -z "$GCJH" ; then
 
2293
  SKIP_GCJ="1"
 
2294
else
 
2295
  if test "$GCC" != yes; then
 
2296
    SKIP_GCJ="1"
 
2297
  fi
 
2298
fi
 
2299
AC_SUBST(SKIP_GCJ)
 
2300
 
 
2301
 
 
2302
#----------------------------------------------------------------
 
2303
# Miscellaneous
 
2304
#----------------------------------------------------------------
 
2305
 
 
2306
 
 
2307
# Root directory
 
2308
# Translate path for native Windows compilers for use with 'make check'
 
2309
ROOT_DIR=`pwd`
 
2310
case $host in
 
2311
*-*-cygwin* | *-*-mingw*)
 
2312
  if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then
 
2313
    ROOT_DIR=`cygpath --mixed $ROOT_DIR`
 
2314
  fi
 
2315
  # Extra files generated by some Windows compilers
 
2316
  EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk"
 
2317
  ;;
 
2318
esac
 
2319
 
 
2320
AC_SUBST(ROOT_DIR)
 
2321
AC_SUBST(EXTRA_CLEAN)
 
2322
AC_SUBST(ac_aux_dir)
 
2323
 
 
2324
# Configure SWIG_LIB path
 
2325
 
 
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}"])
 
2328
AC_SUBST(swig_lib)
 
2329
AC_DEFINE_DIR(SWIG_LIB, swig_lib, [Directory for SWIG system-independent libraries])
 
2330
 
 
2331
case $host in
 
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="";;
 
2336
esac
 
2337
AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)])
 
2338
 
 
2339
AC_CONFIG_FILES([                               \
 
2340
    Makefile                                    \
 
2341
    swig.spec                                   \
 
2342
    Source/Makefile                             \
 
2343
    Examples/Makefile                           \
 
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             \
 
2368
    Lib/ocaml/swigp4.ml
 
2369
])
 
2370
AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig])
 
2371
AC_CONFIG_FILES([CCache/ccache_swig_config.h])
 
2372
 
 
2373
AC_OUTPUT
 
2374
dnl configure.in ends here