comparison lib/swig/swigwin-2.0.11/configure.ac @ 1899:b3009adc0e2f

Adding swig, gitignore, hgignore
author Nomad
date Mon, 21 Oct 2013 10:42:27 +0200
parents
children
comparison
equal deleted inserted replaced
1867:eb580660bbbb 1899:b3009adc0e2f
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.11],[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, ["$host"], [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 from the distributed tarball"
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 if test -n "$YODL2MAN"; then
132 AC_MSG_CHECKING([yodl2man version >= 2.02])
133 yodl_version=`$YODL2MAN --version 2>&1 | grep 'yodl version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.*[0-9]*\).*/\1/g'`
134 AX_COMPARE_VERSION([$yodl_version],[ge],[2.02], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no - $yodl_version found])])
135 fi
136
137 if test -n "$YODL2HTML"; then
138 AC_MSG_CHECKING([yodl2html version >= 2.02])
139 yodl_version=`$YODL2HTML --version 2>&1 | grep 'yodl version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
140 AX_COMPARE_VERSION([$yodl_version],[ge],[2.02], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no - $yodl_version found])])
141 fi
142
143 echo ""
144 echo "Checking for installed target languages and other information in order to compile and run"
145 echo "the examples and test-suite invoked by 'make check'."
146 echo "Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball"
147 echo ""
148
149 dnl Some test cases require Boost
150 AX_BOOST_BASE(,,,)
151 AC_SUBST(BOOST_CPPFLAGS)
152
153 dnl How to specify include directories that may be system directories.
154 # -I should not be used on system directories (GCC)
155 if test "$GCC" = yes; then
156 ISYSTEM="-isystem "
157 else
158 ISYSTEM="-I"
159 fi
160 AC_MSG_NOTICE(ISYSTEM: $ISYSTEM)
161
162 dnl Info for building shared libraries ... in order to run the examples
163
164 # SO is the extension of shared libraries (including the dot!)
165 AC_MSG_CHECKING(SO)
166 if test -z "$SO"
167 then
168 case $host in
169 *-*-hp*) SO=.sl;;
170 *-*-darwin*) SO=.bundle;;
171 *-*-cygwin* | *-*-mingw*) SO=.dll;;
172 *) SO=.so;;
173 esac
174 fi
175 AC_MSG_RESULT($SO)
176
177 # LDSHARED is the ld *command* used to create shared library
178 # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
179 # (Shared libraries in this instance are shared modules to be loaded into
180 # Python, as opposed to building Python itself as a shared library.)
181 AC_MSG_CHECKING(LDSHARED)
182 if test -z "$LDSHARED"
183 then
184 case $host in
185 *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
186 *-*-cygwin* | *-*-mingw*)
187 if test "$GCC" = yes; then
188 LDSHARED="$CC -shared"
189 else
190 if test "cl" = $CC ; then
191 # Microsoft Visual C++ (MSVC)
192 LDSHARED="$CC -nologo -LD"
193 else
194 # Unknown compiler try gcc approach
195 LDSHARED="$CC -shared"
196 fi
197 fi ;;
198 *-*-irix5*) LDSHARED="ld -shared";;
199 *-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
200 *-*-sunos4*) LDSHARED="ld";;
201 *-*-solaris*) LDSHARED="ld -G";;
202 *-*-hp*) LDSHARED="ld -b";;
203 *-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
204 *-sequent-sysv4) LDSHARED="ld -G";;
205 *-*-next*)
206 if test "$ns_dyld"
207 then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
208 else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r'
209 fi
210 if test "$with_next_framework" ; then
211 LDSHARED="$LDSHARED \$(LDLIBRARY)"
212 fi ;;
213 *-*-linux*) LDSHARED="gcc -shared";;
214 *-*-dgux*) LDSHARED="ld -G";;
215 *-*-freebsd3*) LDSHARED="gcc -shared";;
216 *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";;
217 *-*-netbsd*)
218 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
219 then
220 LDSHARED="cc -shared"
221 else
222 LDSHARED="ld -Bshareable"
223 fi;;
224 *-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
225 *-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";;
226 *) LDSHARED="ld";;
227 esac
228 fi
229 AC_MSG_RESULT($LDSHARED)
230 # CXXSHARED is the ld *command* used to create C++ shared library
231 # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
232 # (Shared libraries in this instance are shared modules to be loaded into
233 # Python, as opposed to building Python itself as a shared library.)
234 AC_MSG_CHECKING(CXXSHARED)
235 if test -z "$CXXSHARED"
236 then
237 CXXSHARED="$LDSHARED"
238 fi
239 AC_MSG_RESULT($CXXSHARED)
240
241 #
242 AC_MSG_CHECKING(TRYLINKINGWITHCXX)
243 if test -z "$TRYLINKINGWITHCXX"
244 then
245 case $host in
246 *-*-solaris*) if test "$GCC" = yes
247 then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G"
248 else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd"
249 fi;;
250 *-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";;
251 *-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";;
252 *-*-cygwin* | *-*-mingw*)
253 if test "$GCC" = yes; then
254 TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared "
255 else
256 if test "cl" = $CXX ; then
257 # Microsoft Visual C++ (MSVC)
258 TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD"
259 else
260 TRYLINKINGWITHCXX="#unknown Windows compiler"
261 fi
262 fi ;;
263 *) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";;
264 esac
265 fi
266 AC_MSG_RESULT($TRYLINKINGWITHCXX)
267 # CCSHARED are the C *flags* used to create objects to go into a shared
268 # library (module) -- this is only needed for a few systems
269 AC_MSG_CHECKING(CCSHARED)
270 if test -z "$CCSHARED"
271 then
272 case $host in
273 *-*-hp*) if test "$GCC" = yes
274 then CCSHARED="-fpic"
275 else CCSHARED="+z"
276 fi;;
277 *-*-linux*) CCSHARED="-fpic";;
278 *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";;
279 *-*-netbsd*) CCSHARED="-fPIC";;
280 *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";;
281 *-*-irix6*) case $CC in
282 *gcc*) CCSHARED="-shared";;
283 *) CCSHARED="";;
284 esac;;
285 esac
286 fi
287 AC_MSG_RESULT($CCSHARED)
288
289 # RPATH is the path used to look for shared library files.
290 AC_MSG_CHECKING(RPATH)
291 if test -z "$RPATH"
292 then
293 case $host in
294 *-*-solaris*) RPATH='-R. -R$(exec_prefix)/lib';;
295 *-*-irix*) RPATH='-rpath .:$(exec_prefix)/lib';;
296 *-*-linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';;
297 *) RPATH='';;
298 esac
299 fi
300 AC_MSG_RESULT($RPATH)
301
302 # LINKFORSHARED are the flags passed to the $(CC) command that links
303 # the a few executables -- this is only needed for a few systems
304
305 AC_MSG_CHECKING(LINKFORSHARED)
306 if test -z "$LINKFORSHARED"
307 then
308 case $host in
309 *-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
310 *-*-hp*)
311 LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
312 *-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
313 *-*-next*) LINKFORSHARED="-u libsys_s";;
314 *-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
315 *-*-irix6*) LINKFORSHARED="-all";;
316 esac
317 fi
318 AC_MSG_RESULT($LINKFORSHARED)
319
320 # Optional CFLAGS used to silence/enhance compiler warnings on some platforms.
321 AC_MSG_CHECKING(PLATFLAGS)
322 case $host in
323 *-*-solaris*) if test "$GCC" = yes
324 then PLATFLAGS=
325 else PLATFLAGS=
326 # else PLATFLAGS="-errtags=yes" # Need more work as C examples use ld for linking
327 fi;;
328 *) PLATFLAGS=
329 esac
330 AC_MSG_RESULT($PLATFLAGS)
331
332 # Set info about shared libraries.
333 AC_SUBST(SO)
334 AC_SUBST(LDSHARED)
335 AC_SUBST(CCSHARED)
336 AC_SUBST(CXXSHARED)
337 AC_SUBST(TRYLINKINGWITHCXX)
338 AC_SUBST(RPATH)
339 AC_SUBST(PLATFLAGS)
340 AC_SUBST(LINKFORSHARED)
341
342 # This variation is needed on OS-X because there is no (apparent) consistency in shared library naming.
343 # Sometimes .bundle works, but sometimes .so is needed. It depends on the target language
344
345 AC_SUBST(PYTHON_SO)
346 case $host in
347 *-*-mingw*) PYTHON_SO=.pyd;;
348 *-*-darwin*) PYTHON_SO=.so;;
349 *) PYTHON_SO=$SO;;
350 esac
351
352 AC_SUBST(TCL_SO)
353 case $host in
354 *-*-darwin*) TCL_SO=.dylib;;
355 *) TCL_SO=$SO;;
356 esac
357
358 AC_SUBST(GUILE_SO)
359 case $host in
360 *-*-darwin*) GUILE_SO=.so;;
361 *) GUILE_SO=$SO;;
362 esac
363
364 AC_SUBST(PHP_SO)
365 case $host in
366 *-*-darwin*) PHP_SO=.so;;
367 *) PHP_SO=$SO;;
368 esac
369
370 AC_SUBST(MZSCHEME_SO)
371 case $host in
372 *) MZSCHEME_SO=.so;;
373 esac
374
375 AC_SUBST(LUA_SO)
376 case $host in
377 *-*-darwin*) LUA_SO=.so;;
378 *) LUA_SO=$SO;;
379 esac
380
381 # Check for specific libraries. Used for SWIG examples
382 AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
383 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
384
385 dnl The following three libraries (nsl,inet,socket) are needed on Sequent,
386 dnl and must be checked for in this order since each library depends on the
387 dnl preceding one.
388 dnl
389 dnl Most SVR4 platforms will need -lsocket and -lnsl. However on SGI IRIX 5,
390 dnl these exist but are broken, so we use AC_SEARCH_LIBS which will only try
391 dnl the library if the function isn't already available without it.
392 AC_SEARCH_LIBS(t_open, nsl) # SVR4
393 AC_SEARCH_LIBS(gethostbyname, inet) # Sequent
394 AC_SEARCH_LIBS(socket, socket) # SVR4 sockets
395
396 AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"])
397 AC_SUBST(SWIGLIBS)
398 AC_SUBST(SWILL)
399
400 # check for --with-libm=...
401 AC_SUBST(LIBM)
402 LIBM=-lm
403 AC_ARG_WITH(libm, [ --with-libm=STRING math library], [
404 if test "$withval" != yes
405 then LIBM=$withval
406 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
407 fi])
408 AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"])
409 AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"])
410 AC_SUBST(LIBCRYPT)
411
412 # check for --with-libc=...
413 AC_SUBST(LIBC)
414 AC_ARG_WITH(libc, [ --with-libc=STRING C library], [
415 if test "$withval" != yes
416 then LIBC=$withval
417 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
418 fi])
419
420 #--------------------------------------------------------------------
421 # Locate the X11 header files and the X11 library archive. Try
422 # the ac_path_x macro first, but if it doesn't find the X stuff
423 # (e.g. because there's no xmkmf program) then check through
424 # a list of possible directories. Under some conditions the
425 # autoconf macro will return an include directory that contains
426 # no include files, so double-check its result just to be safe.
427 #--------------------------------------------------------------------
428
429 AC_PATH_X
430 not_really_there=""
431 if test "$no_x" = ""; then
432 if test "$x_includes" = ""; then
433 AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
434 else
435 if test ! -r $x_includes/X11/Intrinsic.h; then
436 not_really_there="yes"
437 fi
438 fi
439 fi
440 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
441 AC_MSG_CHECKING(for X11 header files)
442 XINCLUDES="# no special path needed"
443 AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="")
444 if test -z "$XINCLUDES"; then
445 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"
446 for i in $dirs ; do
447 if test -r $i/X11/Intrinsic.h; then
448 XINCLUDES=" -I$i"
449 break
450 fi
451 done
452 fi
453 AC_MSG_RESULT($XINCLUDES)
454 else
455 if test "$x_includes" != ""; then
456 XINCLUDES=-I$x_includes
457 else
458 XINCLUDES="# no special path needed"
459 fi
460 fi
461 if test -z "$XINCLUDES"; then
462 AC_MSG_RESULT(couldn't find any!)
463 XINCLUDES="# no include files found"
464 fi
465
466 if test "$no_x" = yes; then
467 AC_MSG_CHECKING(for X11 libraries)
468 XLIBSW=
469 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"
470 for i in $dirs ; do
471 if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
472 AC_MSG_RESULT($i)
473 XLIBSW="-L$i -lX11"
474 break
475 fi
476 done
477 else
478 if test "$x_libraries" = ""; then
479 XLIBSW=-lX11
480 else
481 XLIBSW="-L$x_libraries -lX11"
482 fi
483 fi
484 if test -z "$XLIBSW" ; then
485 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
486 fi
487 if test -z "$XLIBSW" ; then
488 AC_MSG_RESULT(couldn't find any! Using -lX11.)
489 XLIBSW=-lX11
490 fi
491
492 AC_SUBST(XINCLUDES)
493 AC_SUBST(XLIBSW)
494
495 AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
496
497 #--------------------------------------------------------------------
498 # Look for Tcl
499 #--------------------------------------------------------------------
500
501 TCLINCLUDE=
502 TCLLIB=
503 TCLPACKAGE=
504
505 AC_ARG_WITH(tclconfig, AS_HELP_STRING([--without-tcl], [Disable Tcl])
506 AS_HELP_STRING([--with-tclconfig=path], [Set location of tclConfig.sh]), [with_tclconfig="$withval"], [with_tclconfig=])
507 AC_ARG_WITH(tcl,
508 [ --with-tcl=path Set location of Tcl package],[
509 TCLPACKAGE="$withval"], [TCLPACKAGE=yes])
510 AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
511 TCLINCLUDE="$ISYSTEM$withval"], [TCLINCLUDE=])
512 AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
513 TCLLIB="-L$withval"], [TCLLIB=])
514
515 # First, check for "--without-tcl" or "--with-tcl=no".
516 if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then
517 AC_MSG_NOTICE([Disabling Tcl])
518 else
519 AC_MSG_CHECKING([for Tcl configuration])
520 # First check to see if --with-tclconfig was specified.
521 if test x"${with_tclconfig}" != x ; then
522 if test -f "${with_tclconfig}/tclConfig.sh" ; then
523 TCLCONFIG=`(cd ${with_tclconfig}; pwd)`
524 else
525 AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
526 fi
527 fi
528 # check in a few common install locations
529 if test x"${TCLCONFIG}" = x ; then
530 for i in `ls -d /usr/lib/ 2>/dev/null` \
531 `ls -d -r /usr/lib/tcl*/ 2>/dev/null` \
532 `ls -d /usr/local/lib/ 2>/dev/null` \
533 `ls -d -r /usr/local/lib/tcl*/ 2>/dev/null` ; do
534 if test -f $i"tclConfig.sh" ; then
535 TCLCONFIG=`(cd $i; pwd)`
536 break
537 fi
538 done
539 fi
540 if test x"${TCLCONFIG}" = x ; then
541 AC_MSG_RESULT(no)
542 else
543 AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
544 . $TCLCONFIG/tclConfig.sh
545 if test -z "$TCLINCLUDE"; then
546 TCLINCLUDE=`echo $TCL_INCLUDE_SPEC | sed "s/-I/$ISYSTEM/"`
547 fi
548 if test -z "$TCLLIB"; then
549 TCLLIB=$TCL_LIB_SPEC
550 fi
551 fi
552
553 if test -z "$TCLINCLUDE"; then
554 if test "x$TCLPACKAGE" != xyes; then
555 TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include"
556 fi
557 fi
558
559 if test -z "$TCLLIB"; then
560 if test "x$TCLPACKAGE" != xyes; then
561 TCLLIB="-L$TCLPACKAGE/lib -ltcl"
562 fi
563 fi
564
565 AC_MSG_CHECKING(for Tcl header files)
566 if test -z "$TCLINCLUDE"; then
567 AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
568 if test -z "$TCLINCLUDE"; then
569 dirs="/usr/local/include /usr/include /opt/local/include"
570 for i in $dirs ; do
571 if test -r $i/tcl.h; then
572 AC_MSG_RESULT($i)
573 TCLINCLUDE="$ISYSTEM$i"
574 break
575 fi
576 done
577 fi
578 if test -z "$TCLINCLUDE"; then
579 AC_MSG_RESULT(not found)
580 fi
581 else
582 AC_MSG_RESULT($TCLINCLUDE)
583 fi
584
585 AC_MSG_CHECKING(for Tcl library)
586 if test -z "$TCLLIB"; then
587 dirs="/usr/local/lib /usr/lib /opt/local/lib"
588 for i in $dirs ; do
589 if test -r $i/libtcl.a; then
590 AC_MSG_RESULT($i)
591 TCLLIB="-L$i -ltcl"
592 break
593 fi
594 done
595 if test -z "$TCLLIB"; then
596 AC_MSG_RESULT(not found)
597 fi
598 else
599 AC_MSG_RESULT($TCLLIB)
600 fi
601
602 # Cygwin (Windows) needs the library for dynamic linking
603 case $host in
604 *-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";;
605 *)TCLDYNAMICLINKING="";;
606 esac
607
608 case $host in
609 *-*-darwin*)
610 TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace'
611 TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace'
612 ;;
613 *)
614 TCLLDSHARED='$(LDSHARED)'
615 TCLCXXSHARED='$(CXXSHARED)'
616 ;;
617 esac
618
619 fi
620
621 AC_SUBST(TCLINCLUDE)
622 AC_SUBST(TCLLIB)
623 AC_SUBST(TCLDYNAMICLINKING)
624 AC_SUBST(TCLLDSHARED)
625 AC_SUBST(TCLCXXSHARED)
626
627 #----------------------------------------------------------------
628 # Look for Python
629 #----------------------------------------------------------------
630
631 PYINCLUDE=
632 PYLIB=
633 PYPACKAGE=
634
635 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Disable Python])
636 AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBIN="$withval"], [PYBIN=yes])
637
638 # First, check for "--without-python" or "--with-python=no".
639 if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then
640 AC_MSG_NOTICE([Disabling Python])
641 else
642 # First figure out the name of the Python executable
643 if test "x$PYBIN" = xyes; then
644 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])
645 else
646 PYTHON="$PYBIN"
647 fi
648
649 if test -n "$PYTHON"; then
650 AC_MSG_CHECKING(for Python prefix)
651 PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
652 AC_MSG_RESULT($PYPREFIX)
653 AC_MSG_CHECKING(for Python exec-prefix)
654 PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
655 AC_MSG_RESULT($PYEPREFIX)
656
657
658 # Note: I could not think of a standard way to get the version string from different versions.
659 # This trick pulls it out of the file location for a standard library file.
660
661 AC_MSG_CHECKING(for Python version)
662
663 # Need to do this hack since autoconf replaces __file__ with the name of the configure file
664 filehack="file__"
665 PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")`
666 AC_MSG_RESULT($PYVERSION)
667
668 # Find the directory for libraries this is necessary to deal with
669 # platforms that can have apps built for multiple archs: e.g. x86_64
670 AC_MSG_CHECKING(for Python lib dir)
671 PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null`
672 if test -z "$PYLIBDIR"; then
673 # Fedora patch Python to add sys.lib, for other distros we assume "lib".
674 PYLIBDIR="lib"
675 fi
676 AC_MSG_RESULT($PYLIBDIR)
677
678 # Set the include directory
679
680 AC_MSG_CHECKING(for Python header files)
681 if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
682 PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config"
683 fi
684 if test -z "$PYINCLUDE"; then
685 if test -r $PYPREFIX/include/Py/Python.h; then
686 PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib"
687 fi
688 fi
689 AC_MSG_RESULT($PYINCLUDE)
690
691 # Set the library directory blindly. This probably won't work with older versions
692 AC_MSG_CHECKING(for Python library)
693 dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR"
694 for i in $dirs; do
695 if test -d $PYEPREFIX/$PYLIBDIR/$i; then
696 PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
697 break
698 fi
699 done
700 if test -z "$PYLIB"; then
701 AC_MSG_RESULT(Not found)
702 else
703 AC_MSG_RESULT($PYLIB)
704 fi
705
706 PYLINK="-l$PYVERSION"
707 fi
708
709 # Cygwin (Windows) needs the library for dynamic linking
710 case $host in
711 *-*-cygwin* | *-*-mingw*)
712 PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
713 DEFS="-DUSE_DL_IMPORT $DEFS"
714 ;;
715 *)PYTHONDYNAMICLINKING="";;
716 esac
717 fi
718
719 AC_SUBST(PYINCLUDE)
720 AC_SUBST(PYLIB)
721 AC_SUBST(PYLINK)
722 AC_SUBST(PYTHONDYNAMICLINKING)
723
724
725 #----------------------------------------------------------------
726 # Look for Python 3.x
727 #----------------------------------------------------------------
728
729 # mostly copy & pasted from "Look for Python" section,
730 # did some trim, fix and rename
731
732 PY3INCLUDE=
733 PY3LIB=
734 PY3PACKAGE=
735
736 AC_ARG_WITH(python3, AS_HELP_STRING([--without-python3], [Disable Python 3.x support])
737 AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[ PY3BIN="$withval"], [PY3BIN=yes])
738
739 # First, check for "--without-python3" or "--with-python3=no".
740 if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then
741 AC_MSG_NOTICE([Disabling Python 3.x support])
742 else
743 for py_ver in 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0; do
744 AC_CHECK_PROGS(PYTHON3, [python$py_ver])
745 if test -n "$PYTHON3"; then
746 AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config])
747 if test -n "$PY3CONFIG"; then
748 break
749 fi
750 fi
751 done
752
753 if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then
754 AC_MSG_CHECKING([for Python 3.x prefix])
755 PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null`
756 AC_MSG_RESULT($PY3PREFIX)
757 AC_MSG_CHECKING(for Python 3.x exec-prefix)
758 PY3EPREFIX=`($PY3CONFIG --exec-prefix) 2>/dev/null`
759 AC_MSG_RESULT($PY3EPREFIX)
760
761 # Note: I could not think of a standard way to get the version string from different versions.
762 # This trick pulls it out of the file location for a standard library file.
763
764 AC_MSG_CHECKING([for Python 3.x version])
765
766 # Need to do this hack since autoconf replaces __file__ with the name of the configure file
767 filehack="file__"
768 PY3VERSION=`($PYTHON3 -c "import string,operator,os.path; print(operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1))")`
769 AC_MSG_RESULT($PY3VERSION)
770
771 # Find the directory for libraries this is necessary to deal with
772 # platforms that can have apps built for multiple archs: e.g. x86_64
773 AC_MSG_CHECKING([for Python 3.x lib dir])
774 PY3LIBDIR=`($PYTHON3 -c "import sys; print(sys.lib)") 2>/dev/null`
775 if test -z "$PY3LIBDIR"; then
776 # some dists don't have sys.lib so the best we can do is assume lib
777 PY3LIBDIR="lib"
778 fi
779 AC_MSG_RESULT($PY3LIBDIR)
780
781 # Set the include directory
782
783 AC_MSG_CHECKING([for Python 3.x header files])
784 PY3INCLUDE=`($PY3CONFIG --includes) 2>/dev/null`
785 AC_MSG_RESULT($PY3INCLUDE)
786
787 # Set the library directory blindly. This probably won't work with older versions
788 AC_MSG_CHECKING([for Python 3.x library])
789 dirs="$PY3VERSION/config $PY3VERSION/$PY3LIBDIR python/$PY3LIBDIR"
790 for i in $dirs; do
791 if test -d $PY3EPREFIX/$PY3LIBDIR/$i; then
792 PY3LIB="$PY3EPREFIX/$PY3LIBDIR/$i"
793 break
794 fi
795 done
796 if test -z "$PY3LIB"; then
797 AC_MSG_RESULT([Not found])
798 else
799 AC_MSG_RESULT($PY3LIB)
800 fi
801
802 PY3LINK="-l$PY3VERSION"
803 fi
804
805 # Cygwin (Windows) needs the library for dynamic linking
806 case $host in
807 *-*-cygwin* | *-*-mingw*)
808 PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK"
809 DEFS="-DUSE_DL_IMPORT $DEFS"
810 ;;
811 *)PYTHON3DYNAMICLINKING="";;
812 esac
813 fi
814
815 AC_SUBST(PY3INCLUDE)
816 AC_SUBST(PY3LIB)
817 AC_SUBST(PY3LINK)
818 AC_SUBST(PYTHON3DYNAMICLINKING)
819
820
821 #----------------------------------------------------------------
822 # Look for Perl5
823 #----------------------------------------------------------------
824
825 PERLBIN=
826
827 AC_ARG_WITH(perl5, AS_HELP_STRING([--without-perl5], [Disable Perl5])
828 AS_HELP_STRING([--with-perl5=path], [Set location of Perl5 executable]),[ PERLBIN="$withval"], [PERLBIN=yes])
829
830 # First, check for "--without-perl5" or "--with-perl5=no".
831 if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then
832 AC_MSG_NOTICE([Disabling Perl5])
833 PERL=
834 else
835
836 # First figure out what the name of Perl5 is
837
838 if test "x$PERLBIN" = xyes; then
839 AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
840 else
841 PERL="$PERLBIN"
842 fi
843
844
845 # 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:
846 # perl -MExtUtils::Embed -e ccopts
847 AC_MSG_CHECKING(for Perl5 header files)
848 if test -n "$PERL"; then
849 PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null`
850 if test -n "$PERL5DIR" ; then
851 dirs="$PERL5DIR $PERL5DIR/CORE"
852 PERL5EXT=none
853 for i in $dirs; do
854 if test -r $i/perl.h; then
855 AC_MSG_RESULT($i)
856 PERL5EXT="$i"
857 break
858 fi
859 done
860 if test "$PERL5EXT" = none; then
861 PERL5EXT="$PERL5DIR/CORE"
862 AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
863 fi
864
865 AC_MSG_CHECKING(for Perl5 library)
866 PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; s/\.$Config{so}.*//; print $_, "\n"') 2>/dev/null`
867 if test -z "$PERL5LIB" ; then
868 AC_MSG_RESULT(not found)
869 else
870 AC_MSG_RESULT($PERL5LIB)
871 fi
872 AC_MSG_CHECKING(for Perl5 ccflags)
873 PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-Wdeclaration-after-statement//" | sed "s/-I/$ISYSTEM/") 2>/dev/null`
874 if test -z "$PERL5CCFLAGS" ; then
875 AC_MSG_RESULT(not found)
876 else
877 AC_MSG_RESULT($PERL5CCFLAGS)
878 fi
879 AC_MSG_CHECKING(for Perl5 ccdlflags)
880 PERL5CCDLFLAGS=`($PERL -e 'use Config; print $Config{ccdlflags}, "\n"') 2>/dev/null`
881 if test -z "$PERL5CCDLFLAGS" ; then
882 AC_MSG_RESULT(not found)
883 else
884 AC_MSG_RESULT($PERL5CCDLFLAGS)
885 fi
886 AC_MSG_CHECKING(for Perl5 cccdlflags)
887 PERL5CCCDLFLAGS=`($PERL -e 'use Config; print $Config{cccdlflags}, "\n"') 2>/dev/null`
888 if test -z "$PERL5CCCDLFLAGS" ; then
889 AC_MSG_RESULT(not found)
890 else
891 AC_MSG_RESULT($PERL5CCCDLFLAGS)
892 fi
893 AC_MSG_CHECKING(for Perl5 ldflags)
894 PERL5LDFLAGS=`($PERL -e 'use Config; print $Config{ldflags}, "\n"') 2>/dev/null`
895 if test -z "$PERL5LDFLAGS" ; then
896 AC_MSG_RESULT(not found)
897 else
898 AC_MSG_RESULT($PERL5LDFLAGS)
899 fi
900 else
901 AC_MSG_RESULT(unable to determine perl5 configuration)
902 PERL5EXT=$PERL5DIR
903 fi
904 else
905 AC_MSG_RESULT(could not figure out how to run perl5)
906 fi
907
908 # Cygwin (Windows) needs the library for dynamic linking
909 case $host in
910 *-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";;
911 *)PERL5DYNAMICLINKING="";;
912 esac
913 fi
914
915 AC_SUBST(PERL)
916 AC_SUBST(PERL5EXT)
917 AC_SUBST(PERL5DYNAMICLINKING)
918 AC_SUBST(PERL5LIB)
919 AC_SUBST(PERL5CCFLAGS)
920 AC_SUBST(PERL5CCDLFLAGS)
921 AC_SUBST(PERL5CCCDLFLAGS)
922 AC_SUBST(PERL5LDFLAGS)
923
924 #----------------------------------------------------------------
925 # Look for Octave
926 #----------------------------------------------------------------
927
928 OCTAVEBIN=
929 OCTAVE_SO=.oct
930
931 AC_ARG_WITH(octave, AS_HELP_STRING([--without-octave], [Disable Octave])
932 AS_HELP_STRING([--with-octave=path], [Set location of Octave executable]),[OCTAVEBIN="$withval"], [OCTAVEBIN=yes])
933
934 # First, check for "--without-octave" or "--with-octave=no".
935 if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then
936 AC_MSG_NOTICE([Disabling Octave])
937 OCTAVE=
938
939 # First figure out what the name of Octave is
940 elif test "x$OCTAVEBIN" = xyes; then
941 AC_PATH_PROG(OCTAVE, [octave])
942
943 else
944 OCTAVE="$OCTAVEBIN"
945 fi
946
947 if test -n "$OCTAVE"; then
948 AC_MSG_CHECKING([for mkoctfile])
949 mkoctfile="`dirname ${OCTAVE}`/mkoctfile"
950 AS_IF([test -x "${mkoctfile}"],[
951 AC_MSG_RESULT([${mkoctfile}])
952 ],[
953 AC_MSG_RESULT([not found, disabling Octave])
954 OCTAVE=
955 ])
956 fi
957 if test -n "$OCTAVE"; then
958 AC_MSG_CHECKING([for Octave preprocessor flags])
959 OCTAVE_CPPFLAGS=
960 for n in CPPFLAGS INCFLAGS; do
961 OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} "`${mkoctfile} -p $n`
962 done
963 AC_MSG_RESULT([$OCTAVE_CPPFLAGS])
964 AC_MSG_CHECKING([for Octave compiler flags])
965 OCTAVE_CXXFLAGS=
966 for n in ALL_CXXFLAGS; do
967 OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} "`${mkoctfile} -p $n`
968 done
969 AC_MSG_RESULT([$OCTAVE_CXXFLAGS])
970 AC_MSG_CHECKING([for Octave linker flags])
971 OCTAVE_LDFLAGS=
972 for n in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do
973 OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`${mkoctfile} -p $n`
974 done
975 AC_MSG_RESULT([$OCTAVE_LDFLAGS])
976 for octave_opt in --silent --norc --no-history --no-window-system; do
977 AC_MSG_CHECKING([if Octave option '${octave_opt}' is supported])
978 octave_out=`${OCTAVE} ${octave_opt} /dev/null 2>&1 | sed -n '1{/unrecognized/p}'`
979 AS_IF([test "x${octave_out}" = x],[
980 AC_MSG_RESULT([yes])
981 OCTAVE="${OCTAVE} ${octave_opt}"
982 ],[
983 AC_MSG_RESULT([no])
984 ])
985 done
986 fi
987
988 AC_SUBST(OCTAVE)
989 AC_SUBST(OCTAVE_SO)
990 AC_SUBST(OCTAVE_CPPFLAGS)
991 AC_SUBST(OCTAVE_CXXFLAGS)
992 AC_SUBST(OCTAVE_LDFLAGS)
993
994 #----------------------------------------------------------------
995 # Look for java
996 #----------------------------------------------------------------
997
998 AC_ARG_WITH(java, AS_HELP_STRING([--without-java], [Disable Java])
999 AS_HELP_STRING([--with-java=path], [Set location of java executable]),[JAVABIN="$withval"], [JAVABIN=yes])
1000 AC_ARG_WITH(javac, [ --with-javac=path Set location of javac executable],[JAVACBIN="$withval"], [JAVACBIN=])
1001
1002 # First, check for "--without-java" or "--with-java=no".
1003 if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then
1004 AC_MSG_NOTICE([Disabling Java])
1005 JAVA=
1006 else
1007
1008 if test "x$JAVABIN" = xyes; then
1009 AC_CHECK_PROGS(JAVA, java kaffe guavac)
1010 else
1011 JAVA="$JAVABIN"
1012 fi
1013
1014 if test -z "$JAVACBIN"; then
1015 AC_CHECK_PROGS(JAVAC, javac)
1016 else
1017 JAVAC="$JAVACBIN"
1018 fi
1019
1020 AC_MSG_CHECKING(for java include file jni.h)
1021 AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=])
1022
1023 if test -z "$JAVAINCDIR" ; then
1024 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"
1025
1026 # Add in default installation directory on Windows for Cygwin
1027 case $host in
1028 *-*-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";;
1029 *-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";;
1030 *);;
1031 esac
1032 fi
1033
1034 JAVAINC=""
1035 for d in $JAVAINCDIR ; do
1036 if test -r "$d/jni.h" ; then
1037 AC_MSG_RESULT($d)
1038 JAVAINCDIR=$d
1039 JAVAINC=-I\"$d\"
1040 break
1041 fi
1042 done
1043
1044 if test "$JAVAINC" = "" ; then
1045 AC_MSG_RESULT(not found)
1046 else
1047 # now look for <arch>/jni_md.h
1048 AC_MSG_CHECKING(for java include file jni_md.h)
1049 JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print`
1050 if test "$JAVAMDDIR" = "" ; then
1051 AC_MSG_RESULT(not found)
1052 else
1053 JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1`
1054 JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\""
1055 AC_MSG_RESULT($JAVAMDDIR)
1056 fi
1057 fi
1058
1059 # java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable
1060 case $host in
1061 *-*-cygwin* | *-*-mingw*)
1062 if test "$GCC" = yes; then
1063 JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
1064 JAVACFLAGS="-mno-cygwin -mthreads"
1065 else
1066 JAVADYNAMICLINKING=""
1067 JAVACFLAGS=""
1068 fi ;;
1069 *-*-darwin*)
1070 JAVADYNAMICLINKING="-dynamiclib -framework JavaVM"
1071 JAVACFLAGS=""
1072 ;;
1073 *)
1074 JAVADYNAMICLINKING=""
1075 JAVACFLAGS=""
1076 ;;
1077 esac
1078
1079 # Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
1080 case $host in
1081 *-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";;
1082 *)JAVALIBRARYPREFIX="lib";;
1083 esac
1084
1085 # Java on Mac OS X tweaks
1086 case $host in
1087 *-*-darwin*)
1088 JAVASO=".jnilib"
1089 JAVALDSHARED='$(CC)'
1090 JAVACXXSHARED='$(CXX)'
1091 ;;
1092 *)
1093 JAVASO=$SO
1094 JAVALDSHARED='$(LDSHARED)'
1095 JAVACXXSHARED='$(CXXSHARED)'
1096 ;;
1097 esac
1098 fi
1099
1100 AC_SUBST(JAVA)
1101 AC_SUBST(JAVAC)
1102 AC_SUBST(JAVAINC)
1103 AC_SUBST(JAVADYNAMICLINKING)
1104 AC_SUBST(JAVALIBRARYPREFIX)
1105 AC_SUBST(JAVASO)
1106 AC_SUBST(JAVALDSHARED)
1107 AC_SUBST(JAVACXXSHARED)
1108 AC_SUBST(JAVACFLAGS)
1109
1110 #----------------------------------------------------------------
1111 # Look for gcj
1112 #----------------------------------------------------------------
1113
1114 AC_ARG_WITH(gcj, AS_HELP_STRING([--without-gcj], [Disable GCJ])
1115 AS_HELP_STRING([--with-gcj=path], [Set location of gcj executable]),[GCJBIN="$withval"], [GCJBIN=yes])
1116 AC_ARG_WITH(gcjh, [ --with-gcjh=path Set location of gcjh executable],[GCJHBIN="$withval"], [GCJHBIN=])
1117
1118 # First, check for "--without-gcj" or "--with-gcj=no".
1119 if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then
1120 AC_MSG_NOTICE([Disabling GCJ])
1121 else
1122 if test "x$GCJBIN" = xyes; then
1123 AC_CHECK_PROGS(GCJ, gcj)
1124 else
1125 GCJ="$GCJBIN"
1126 fi
1127
1128 if test -z "$GCJCBIN"; then
1129 AC_CHECK_PROGS(GCJH, gcjh)
1130 else
1131 GCJH="$GCJHBIN"
1132 fi
1133 fi
1134
1135 AC_SUBST(GCJ)
1136 AC_SUBST(GCJH)
1137
1138 #----------------------------------------------------------------
1139 # Look for Android
1140 #----------------------------------------------------------------
1141
1142 AC_ARG_WITH(android, AS_HELP_STRING([--without-android], [Disable Android])
1143 AS_HELP_STRING([--with-android=path], [Set location of android executable]),[ANDROIDBIN="$withval"], [ANDROIDBIN=yes])
1144 AC_ARG_WITH(adb, [ --with-adb=path Set location of adb executable - Android Debug Bridge],[ADBBIN="$withval"], [ADBBIN=])
1145 AC_ARG_WITH(ant, [ --with-ant=path Set location of ant executable for Android],[ANTBIN="$withval"], [ANTBIN=])
1146 AC_ARG_WITH(ndk-build, [ --with-ndk-build=path Set location of Android ndk-build executable],[NDKBUILDBIN="$withval"], [NDKBUILDBIN=])
1147
1148 # First, check for "--without-android" or "--with-android=no".
1149 if test x"${ANDROIDBIN}" = xno -o x"${with_alllang}" = xno ; then
1150 AC_MSG_NOTICE([Disabling Android])
1151 ANDROID=
1152 else
1153 if test "x$ANDROIDBIN" = xyes; then
1154 AC_CHECK_PROGS(ANDROID, android)
1155 else
1156 ANDROID="$ANDROIDBIN"
1157 fi
1158
1159 if test -z "$ADBBIN"; then
1160 AC_CHECK_PROGS(ADB, adb)
1161 else
1162 ADB="$ADBBIN"
1163 fi
1164
1165 if test -z "$ANTBIN"; then
1166 AC_CHECK_PROGS(ANT, ant)
1167 else
1168 ANT="$ANTBIN"
1169 fi
1170
1171 if test -z "$NDKBUILDBIN"; then
1172 AC_CHECK_PROGS(NDKBUILD, ndk-build)
1173 else
1174 NDKBUILD="$NDKBUILDBIN"
1175 fi
1176 fi
1177
1178 AC_SUBST(ANDROID)
1179 AC_SUBST(ADB)
1180 AC_SUBST(ANT)
1181 AC_SUBST(NDKBUILD)
1182
1183 #----------------------------------------------------------------
1184 # Look for Guile
1185 #----------------------------------------------------------------
1186
1187 GUILE=
1188 GUILE_CFLAGS=
1189 GUILE_LIBS=
1190
1191 AC_ARG_WITH(guile-config, AS_HELP_STRING([--without-guile], [Disable Guile])
1192 AS_HELP_STRING([--with-guile-config=path], [Set location of guile-config]),[ GUILE_CONFIG="$withval"], [GUILE_CONFIG=])
1193 AC_ARG_WITH(guile,[ --with-guile=path Set location of Guile executable],[
1194 GUILE="$withval"], [GUILE=yes])
1195 AC_ARG_WITH(guile-cflags,[ --with-guile-cflags=cflags Set cflags required to compile against Guile],[
1196 GUILE_CFLAGS="$withval"])
1197 AC_ARG_WITH(guile-libs,[ --with-guile-libs=ldflags Set ldflags needed to link with Guile],[
1198 GUILE_LIBS="$withval"])
1199
1200 # First, check for "--without-guile" or "--with-guile=no".
1201 if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then
1202 AC_MSG_NOTICE([Disabling Guile])
1203 else
1204 if test -z "$GUILE_CONFIG" ; then
1205 AC_PATH_PROG(GUILE_CONFIG, guile-config)
1206 fi
1207 if test -n "$GUILE_CONFIG" ; then
1208 if test x"$GUILE" = xyes; then
1209 AC_MSG_CHECKING([for guile bindir])
1210 guile_bindir="`$GUILE_CONFIG info bindir`"
1211 AC_MSG_RESULT([$guile_bindir])
1212 GUILE=$guile_bindir/guile
1213 if ! test -f "$GUILE" ; then
1214 GUILE=
1215 AC_PATH_PROG(GUILE, guile)
1216 fi
1217 fi
1218
1219 if test -f "$GUILE" ; then
1220 AC_MSG_CHECKING([for guile version])
1221 guile_version=`$GUILE -c '(display (effective-version))'`
1222 AC_MSG_RESULT([$guile_version])
1223 AC_MSG_CHECKING([for guile version >= 1.8])
1224 guile_good_version=`$GUILE -c '(if (>= (string->number (effective-version)) 1.8) (display "yes") (display "no"))'`
1225 AC_MSG_RESULT([$guile_good_version])
1226 if test x"$guile_good_version" != xyes ; then
1227 GUILE=
1228 fi
1229 fi
1230
1231 if test -z "$GUILE_CFLAGS" ; then
1232 AC_MSG_CHECKING([for guile compile flags])
1233 GUILE_CFLAGS="`$GUILE_CONFIG compile`" # Note that this can sometimes be empty
1234 AC_MSG_RESULT([$GUILE_CFLAGS])
1235 fi
1236
1237 if test -z "$GUILE_LIBS" ; then
1238 AC_MSG_CHECKING([for guile link flags])
1239 GUILE_LIBS="`$GUILE_CONFIG link`"
1240 AC_MSG_RESULT([$GUILE_LIBS])
1241 fi
1242 fi
1243 fi
1244
1245 AC_SUBST(GUILE)
1246 AC_SUBST(GUILE_CFLAGS)
1247 AC_SUBST(GUILE_LIBS)
1248
1249 #----------------------------------------------------------------
1250 # Look for MzScheme
1251 #----------------------------------------------------------------
1252
1253 AC_ARG_WITH(mzscheme, AS_HELP_STRING([--without-mzscheme], [Disable MzScheme])
1254 AS_HELP_STRING([--with-mzscheme=path], [Set location of MzScheme executable]),[ MZSCHEMEBIN="$withval"], [MZSCHEMEBIN=yes])
1255 AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's mzc]), [ MZCBIN="$withval"], [MZCBIN=])
1256
1257 # First, check for "--without-mzscheme" or "--with-mzscheme=no".
1258 if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then
1259 AC_MSG_NOTICE([Disabling MzScheme])
1260 MZC=
1261 else
1262 if test "x$MZSCHEMEBIN" = xyes; then
1263 AC_PATH_PROG(MZSCHEME, mzscheme)
1264 else
1265 MZSCHEME="$MZSCHEMEBIN"
1266 fi
1267
1268 if test -z "$MZCBIN"; then
1269 AC_PATH_PROG(MZC, mzc)
1270 fi
1271
1272 if test -n "$MZSCHEME"; then
1273 AC_MSG_CHECKING(for MzScheme dynext object)
1274 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`
1275 if test -f "$MZDYNOBJ"; then
1276 :
1277 else
1278 # older versions (3.72 approx and earlier)
1279 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`
1280 fi
1281 if test -f "$MZDYNOBJ"; then
1282 AC_MSG_RESULT($MZDYNOBJ)
1283 else
1284 AC_MSG_RESULT(not found)
1285 MZDYNOBJ=""
1286 fi
1287 fi
1288 fi
1289 AC_SUBST(MZDYNOBJ)
1290
1291 #----------------------------------------------------------------
1292 # Look for Ruby
1293 #----------------------------------------------------------------
1294
1295 RUBYBIN=
1296
1297 AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby])
1298 AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes])
1299
1300 # First, check for "--without-ruby" or "--with-ruby=no".
1301 if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then
1302 AC_MSG_NOTICE([Disabling Ruby])
1303 RUBY=
1304 else
1305
1306 # First figure out what the name of Ruby is
1307
1308 if test "x$RUBYBIN" = xyes; then
1309 AC_CHECK_PROGS(RUBY, ruby)
1310 else
1311 RUBY="$RUBYBIN"
1312 fi
1313
1314 AC_MSG_CHECKING(for Ruby header files)
1315 if test -n "$RUBY"; then
1316 # Try Ruby1.9 first
1317 RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || $rubyhdrdir') 2>/dev/null`
1318 if test x"$RUBYDIR" = x"" || test x"$RUBYDIR" = x"nil"; then
1319 RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
1320 else
1321 RUBYARCH=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]] || $arch') 2>/dev/null`
1322 fi
1323 if test x"$RUBYDIR" != x""; then
1324 dirs="$RUBYDIR"
1325 RUBYINCLUDE=none
1326 for i in $dirs; do
1327 if test -r $i/ruby.h; then
1328 AC_MSG_RESULT($i)
1329 RUBYINCLUDE="-I$i"
1330 break
1331 fi
1332 done
1333 if test x"$RUBYARCH" != x""; then
1334 RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH"
1335 fi
1336 if test "$RUBYINCLUDE" = none; then
1337 RUBYINCLUDE="-I$RUBYDIR"
1338 AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
1339 fi
1340
1341 # Find library and path for linking.
1342 AC_MSG_CHECKING(for Ruby library)
1343 RUBYLIB=""
1344 rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
1345 rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
1346 dirs="$dirs $rb_libdir $rb_bindir"
1347
1348 rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
1349 RUBYLINK=`($RUBY -rrbconfig -e '
1350 c = Config::CONFIG
1351 if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
1352 if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
1353 link = c[["LIBRUBYARG_STATIC"]]
1354 else
1355 link = c[["LIBRUBYARG_SHARED"]]
1356 end
1357 else # 1.6.x
1358 link = "-l" + c[["RUBY_INSTALL_NAME"]]
1359 end
1360
1361 # Get the target Ruby was built for
1362 target = c[["target"]]
1363
1364 if target == "i386-pc-mswin32"
1365 # Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby*
1366 ext = File.extname(link)
1367 # Get index that counts backwards from end of string
1368 index = -1 - ext.size
1369 # Strip off the extension
1370 link = link.slice(0..index)
1371 puts "-l#{link}"
1372 else
1373 puts link
1374 end') 2>/dev/null`
1375
1376 if test "$rb_libruby" != ""; then
1377 for i in $dirs; do
1378 if (test -r $i/$rb_libruby;) then
1379 RUBYLIB="$i"
1380 break
1381 fi
1382 done
1383 fi
1384 if test "$RUBYLIB" = ""; then
1385 RUBYLIB="$RUBYDIR"
1386 AC_MSG_RESULT(not found... using $RUBYDIR)
1387 else
1388 AC_MSG_RESULT($RUBYLINK in $RUBYLIB)
1389 fi
1390 else
1391 AC_MSG_RESULT(unable to determine ruby configuration)
1392 RUBYINCLUDE="-I$RUBYDIR"
1393 RUBYLIB="$RUBYDIR"
1394 fi
1395
1396 case $host in
1397 *-*-mingw*) ;; # do nothing, the default windows libraries are already included
1398 *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";;
1399 esac
1400
1401 RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
1402 RUBYSO=.`($RUBY -rrbconfig -e 'print Config::CONFIG[["DLEXT"]]') 2>/dev/null`
1403 else
1404 AC_MSG_RESULT(could not figure out how to run ruby)
1405 RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch"
1406 RUBYLIB="/usr/local/lib/ruby/1.4/arch"
1407 RUBYLINK="-lruby -lm"
1408 fi
1409
1410 case $host in
1411 *-*-cygwin* | *-*-mingw*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";;
1412 *) RUBYDYNAMICLINKING="";;
1413 esac
1414 fi
1415
1416 AC_SUBST(RUBYINCLUDE)
1417 AC_SUBST(RUBYLIB)
1418 AC_SUBST(RUBYLINK)
1419 AC_SUBST(RUBYCCDLFLAGS)
1420 AC_SUBST(RUBYSO)
1421 AC_SUBST(RUBYDYNAMICLINKING)
1422
1423 #-------------------------------------------------------------------------
1424 # Look for PHP
1425 #-------------------------------------------------------------------------
1426
1427 PHPBIN=
1428
1429 AC_ARG_WITH(php, AS_HELP_STRING([--without-php], [Disable PHP])
1430 AS_HELP_STRING([--with-php=path], [Set location of PHP executable]),[ PHPBIN="$withval"], [PHPBIN=yes])
1431
1432 # First, check for "--without-php" or "--with-php=no".
1433 if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then
1434 AC_MSG_NOTICE([Disabling PHP])
1435 PHP=
1436 else
1437
1438 if test "x$PHPBIN" = xyes; then
1439 AC_CHECK_PROGS(PHP, [php5 php])
1440 else
1441 PHP=$PHPBIN
1442 fi
1443
1444 AC_MSG_CHECKING(for PHP header files)
1445 dnl /usr/bin/php5 -> /usr/bin/php-config5
1446 case $PHP in
1447 *5)
1448 PHPCONFIG=`echo "$PHP"|sed 's/5$/-config5/'` ;;
1449 *)
1450 PHPCONFIG=$PHP-config ;;
1451 esac
1452 php_version=`$PHPCONFIG --version 2>/dev/null`
1453 case $php_version in
1454 5*)
1455 PHPINC=`$PHPCONFIG --includes 2>/dev/null`
1456 if test -n "$PHPINC"; then
1457 AC_MSG_RESULT($PHPINC)
1458 else
1459 AC_MSG_RESULT(not found)
1460 fi
1461 ;;
1462 *)
1463 AC_MSG_RESULT([found PHP $version, but only PHP 5 is supported]) ;;
1464 esac
1465 fi
1466 AC_SUBST(PHP)
1467 AC_SUBST(PHPINC)
1468
1469 #----------------------------------------------------------------
1470 # Look for ocaml
1471 #----------------------------------------------------------------
1472
1473 AC_ARG_WITH(ocaml, AS_HELP_STRING([--without-ocaml], [Disable OCaml])
1474 AS_HELP_STRING([--with-ocaml=path], [Set location of ocaml executable]),[ OCAMLBIN="$withval"], [OCAMLBIN=yes])
1475 AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable],[ OCAMLC="$withval"], [OCAMLC=])
1476 AC_ARG_WITH(ocamldlgen,[ --with-ocamldlgen=path Set location of ocamldlgen],[ OCAMLDLGEN="$withval" ], [OCAMLDLGEN=])
1477 AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCAMLFIND="$withval"],[OCAMLFIND=])
1478 AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=])
1479
1480 # First, check for "--without-ocaml" or "--with-ocaml=no".
1481 if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then
1482 AC_MSG_NOTICE([Disabling OCaml])
1483 OCAMLBIN=
1484 else
1485
1486 AC_MSG_CHECKING(for Ocaml DL load generator)
1487 if test -z "$OCAMLDLGEN"; then
1488 AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen, :)
1489 fi
1490
1491 AC_MSG_CHECKING(for Ocaml package tool)
1492 if test -z "$OCAMLFIND"; then
1493 AC_CHECK_PROGS(OCAMLFIND, ocamlfind, :)
1494 fi
1495
1496 AC_MSG_CHECKING(for Ocaml compiler)
1497 if test -z "$OCAMLC"; then
1498 AC_CHECK_PROGS(OCAMLC, ocamlc, :)
1499 fi
1500
1501 AC_MSG_CHECKING(for Ocaml interpreter)
1502 if test "x$OCAMLBIN" = xyes; then
1503 AC_CHECK_PROGS(OCAMLBIN, ocaml, :)
1504 fi
1505
1506 AC_MSG_CHECKING(for Ocaml toplevel creator)
1507 if test -z "$OCAMLMKTOP"; then
1508 AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :)
1509 fi
1510
1511 OCAMLLOC=loc
1512 if test "$OCAMLC" != ":" ; then
1513 AC_MSG_CHECKING(for Ocaml header files)
1514 dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml"
1515 dir="`$OCAMLC -where 2>/dev/null`"
1516 if test "$dir"; then
1517 dirs="$dir/caml $dirs"
1518 fi
1519 for i in $dirs; do
1520 if test -r $i/mlvalues.h; then
1521 AC_MSG_RESULT($i)
1522 OCAMLEXT="$i"
1523 OCAMLINC="-I$OCAMLEXT"
1524 break
1525 fi
1526 done
1527 if test -z "$OCAMLINC"; then
1528 AC_MSG_RESULT(not found)
1529 fi
1530
1531 AC_MSG_CHECKING(for Ocaml version 3.08.2 or higher)
1532 OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'`
1533 AC_COMPARE_VERSION([$OCAMLVER],[3.08.2],[:],[:],[OCAMLLOC=_loc])
1534 AC_MSG_RESULT($OCAMLVER)
1535 fi
1536 fi # Disabling ocaml
1537
1538 export OCAMLLOC
1539 export OCAMLVER
1540 export OCAMLINC
1541 export OCAMLBIN
1542 export OCAMLC
1543 export OCAMLDLGEN
1544 export OCAMLFIND
1545 export OCAMLMKTOP
1546
1547 AC_SUBST(OCAMLLOC)
1548 AC_SUBST(OCAMLVER)
1549 AC_SUBST(OCAMLINC)
1550 AC_SUBST(OCAMLBIN)
1551 AC_SUBST(OCAMLC)
1552 AC_SUBST(OCAMLDLGEN)
1553 AC_SUBST(OCAMLFIND)
1554 AC_SUBST(OCAMLMKTOP)
1555
1556 #----------------------------------------------------------------
1557 # Look for Pike
1558 #----------------------------------------------------------------
1559
1560 # Identify the name of the Pike executable
1561 # Priority: configure option, automatic search
1562 PIKEBIN=
1563 AC_ARG_WITH(pike, AS_HELP_STRING([--without-pike], [Disable Pike])
1564 AS_HELP_STRING([--with-pike=path], [Set location of Pike executable]),[PIKEBIN="$withval"], [PIKEBIN=yes])
1565
1566 # First, check for "--without-pike" or "--with-pike=no".
1567 if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then
1568 AC_MSG_NOTICE([Disabling Pike])
1569 PIKEBIN=
1570 else
1571
1572 if test "x$PIKEBIN" = xyes; then
1573 AC_CHECK_PROGS(PIKE, pike pike7.8 pike7.6 pike7.4 pike7.2)
1574 else
1575 PIKE="$PIKEBIN"
1576 fi
1577
1578
1579 # Check for pike-config
1580 # Priority: configure option, guessed from $PIKE, search from list
1581 AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path],
1582 [Set location of pike-config script]),
1583 [PIKECONFIG="$withval"], [PIKECONFIG=""])
1584
1585 if test -z "$PIKECONFIG" -a -n "$PIKE"; then
1586 AC_CHECK_PROGS(PIKECONFIG, $PIKE-config pike-config \
1587 pike7.6-config pike7.4-config pike7.2-config)
1588 fi
1589
1590 # Check for a --with-pikeincl option to configure
1591 # Priority: configure option, info from $PIKECONFIG, guessed by pike script
1592 AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path],
1593 [Set location of Pike include directory]),
1594 [PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=])
1595
1596 if test -n "$PIKE"; then
1597 AC_MSG_CHECKING([for Pike header files])
1598 if test -z "$PIKEINCLUDE" -a -n "$PIKECONFIG"; then
1599 PIKEINCLUDE=`$PIKECONFIG --cflags`
1600 fi
1601 if test -z "$PIKEINCLUDE" -a -n "$PIKE"; then
1602 PIKEINCLUDE=`$PIKE -x cflags`
1603 if test -z "$PIKEINCLUDE"; then
1604 PIKEPATH=`which $PIKE`
1605 PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH`
1606 PIKEINCLUDE="-I$PIKEINCLUDE"
1607 fi
1608 fi
1609
1610 if test -z "$PIKEINCLUDE"; then
1611 AC_MSG_RESULT(not found)
1612 else
1613 AC_MSG_RESULT($PIKEINCLUDE)
1614 fi
1615 fi
1616 fi
1617
1618 AC_SUBST(PIKEINCLUDE)
1619 AC_SUBST(PIKECCDLFLAGS) dnl XXX: where is this used/defined?
1620 AC_SUBST(PIKEDYNAMICLINKING) dnl XXX: where is this used/defined?
1621
1622 #----------------------------------------------------------------
1623 # Look for CHICKEN
1624 #----------------------------------------------------------------
1625
1626 CHICKEN=
1627 CHICKEN_CONFIG=
1628 CHICKENHOME=
1629 CHICKENOPTS=
1630 CHICKENLIB=
1631
1632
1633 AC_ARG_WITH(chicken, AS_HELP_STRING([--without-chicken], [Disable CHICKEN])
1634 AS_HELP_STRING([--with-chicken=path], [Set location of CHICKEN executable]),[ CHICKENBIN="$withval"], [CHICKENBIN=yes])
1635
1636 # First, check for "--without-chicken" or "--with-chicken=no".
1637 if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then
1638 AC_MSG_NOTICE([Disabling CHICKEN])
1639 else
1640
1641 if test "x$CHICKENBIN" = xyes; then
1642 AC_CHECK_PROGS(CHICKEN, chicken)
1643 else
1644 CHICKEN="$CHICKENBIN"
1645 fi
1646
1647 AC_ARG_WITH(chickencsc,[ --with-chickencsc=path Set location of csc executable],[ CHICKEN_CSC="$withval"], [CHICKEN_CSC=])
1648
1649 if test -z "$CHICKEN_CSC"; then
1650 AC_CHECK_PROGS(CHICKEN_CSC, csc)
1651 # Both the Microsoft C# compiler and chicken have an executable called csc, so check that this csc is really the chicken one
1652 if test -n "$CHICKEN_CSC" ; then
1653 AC_MSG_CHECKING(whether csc is the chicken compiler)
1654 $CHICKEN_CSC -version 2>/dev/null | grep "chicken" > /dev/null || CHICKEN_CSC=""
1655 if test -z "$CHICKEN_CSC"; then
1656 AC_MSG_RESULT(no)
1657 else
1658 AC_MSG_RESULT(yes)
1659 fi
1660 fi
1661 fi
1662
1663 AC_ARG_WITH(chickencsi,[ --with-chickencsi=path Set location of csi executable],[ CHICKEN_CSI="$withval"], [CHICKEN_CSI=])
1664
1665 if test -z "$CHICKEN_CSI"; then
1666 AC_CHECK_PROGS(CHICKEN_CSI, csi)
1667 fi
1668
1669 if test -n "$CHICKEN_CSC" ; then
1670
1671 AC_ARG_WITH(chickenopts,[ --with-chickenopts=args Set compiler options for static CHICKEN generated code],[
1672 CHICKENOPTS="$withval"], [CHICKENOPTS=])
1673 AC_ARG_WITH(chickensharedlib,[ --with-chickensharedlib=args Set linker options for shared CHICKEN generated code],[
1674 CHICKENSHAREDLIB="$withval"], [CHICKENSHAREDLIB=])
1675 AC_ARG_WITH(chickenlib,[ --with-chickenlib=args Set linker options for static CHICKEN generated code],[
1676 CHICKENLIB="$withval"], [CHICKENLIB=])
1677
1678 AC_MSG_CHECKING(for compiler options for static CHICKEN generated code)
1679 if test -z "$CHICKENOPTS"; then
1680 CHICKENOPTS="`$CHICKEN_CSC -cflags`"
1681 else
1682 CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS"
1683 fi
1684 if test -z "$CHICKENOPTS"; then
1685 AC_MSG_RESULT(not found)
1686 else
1687 AC_MSG_RESULT($CHICKENOPTS)
1688 fi
1689
1690 AC_MSG_CHECKING(for linker options for shared CHICKEN generated code)
1691 if test -z "$CHICKENSHAREDLIB"; then
1692 CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`"
1693 else
1694 CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB"
1695 fi
1696 if test -z "$CHICKENSHAREDLIB"; then
1697 AC_MSG_RESULT(not found)
1698 else
1699 AC_MSG_RESULT($CHICKENSHAREDLIB)
1700 fi
1701
1702 AC_MSG_CHECKING(for linker options for static CHICKEN generated code)
1703 if test -z "$CHICKENLIB"; then
1704 CHICKENLIB="`$CHICKEN_CSC -libs`"
1705 else
1706 CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB"
1707 fi
1708 if test -z "$CHICKENLIB"; then
1709 AC_MSG_RESULT(not found)
1710 else
1711 AC_MSG_RESULT($CHICKENLIB)
1712 fi
1713
1714 fi # have CHICKEN_CONFIG
1715 fi # Check for --without-chicken
1716
1717 AC_SUBST(CHICKEN)
1718 AC_SUBST(CHICKEN_CSC)
1719 AC_SUBST(CHICKEN_CSI)
1720 AC_SUBST(CHICKENOPTS)
1721 AC_SUBST(CHICKENLIB)
1722 AC_SUBST(CHICKENSHAREDLIB)
1723
1724 #----------------------------------------------------------------
1725 # Look for C#
1726 #----------------------------------------------------------------
1727
1728 AC_ARG_WITH(csharp, AS_HELP_STRING([--without-csharp], [Disable CSharp]), [with_csharp="$withval"], [with_csharp=yes])
1729 AC_ARG_WITH(cil-interpreter, [ --with-cil-interpreter=path Set location of CIL interpreter for CSharp],[CSHARPBIN="$withval"], [CSHARPBIN=])
1730 AC_ARG_WITH(csharp-compiler, [ --with-csharp-compiler=path Set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=])
1731
1732 # First, check for "--without-csharp" or "--with-csharp=no".
1733 if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then
1734 AC_MSG_NOTICE([Disabling CSharp])
1735 CSHARPCOMPILER=
1736 else
1737
1738 if test -z "$CSHARPCOMPILERBIN" ; then
1739 case $host in
1740 *-*-cygwin* | *-*-mingw*)
1741 # prefer Mono gmcs (.NET 2.0) over mcs (.NET 1.1) - note mcs-1.2.3 has major pinvoke bug
1742 AC_CHECK_PROGS(CSHARPCOMPILER, csc mono-csc gmcs mcs cscc)
1743 if test -n "$CSHARPCOMPILER" && test "$CSHARPCOMPILER" = "csc" ; then
1744 AC_MSG_CHECKING(whether csc is the Microsoft CSharp compiler)
1745 csc 2>/dev/null | grep "C#" > /dev/null || CSHARPCOMPILER=""
1746 if test -z "$CSHARPCOMPILER" ; then
1747 AC_MSG_RESULT(no)
1748 AC_CHECK_PROGS(CSHARPCOMPILER, mono-csc gmcs mcs cscc)
1749 else
1750 AC_MSG_RESULT(yes)
1751 fi
1752 fi
1753 ;;
1754 *)AC_CHECK_PROGS(CSHARPCOMPILER, mono-csc gmcs mcs cscc);;
1755 esac
1756 else
1757 CSHARPCOMPILER="$CSHARPCOMPILERBIN"
1758 fi
1759
1760 CSHARPPATHSEPARATOR="/"
1761 CSHARPCYGPATH_W=echo
1762 if test -z "$CSHARPBIN" ; then
1763 CSHARPCILINTERPRETER=""
1764 CSHARPCILINTERPRETER_FLAGS=""
1765 if test "cscc" = "$CSHARPCOMPILER" ; then
1766 AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun)
1767 else
1768 if test "mcs" = "$CSHARPCOMPILER"; then
1769 # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version'
1770 # The Mono compiler should emit: Mono C# compiler version a.b.c.d
1771 csharp_version_raw=`(mcs --version) 2>/dev/null`
1772 csharp_version_searched=`(mcs --version | sed -e "/C#/b" -e "/Mono/b" -e d) 2>/dev/null` # return string if contains 'Mono' or 'C#'
1773 CSHARPCOMPILER=""
1774 if test -n "$csharp_version_raw" ; then
1775 if test "$csharp_version_raw" = "$csharp_version_searched" ; then
1776 CSHARPCOMPILER="mcs"
1777 fi
1778 fi
1779 if test "mcs" != "$CSHARPCOMPILER" ; then
1780 echo "mcs is not a working Mono C# compiler"
1781 fi
1782 fi
1783 if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then
1784 AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT
1785 CSHARPCILINTERPRETER_FLAGS="--debug"
1786 else
1787 if test "csc" = "$CSHARPCOMPILER"; then
1788 CSHARPPATHSEPARATOR="\\\\"
1789 CSHARPCYGPATH_W='cygpath -w'
1790 fi
1791 fi
1792 fi
1793 else
1794 CSHARPCILINTERPRETER="$CSHARPBIN"
1795 fi
1796
1797 # Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable
1798 case $host in
1799 *-*-cygwin* | *-*-mingw*)
1800 if test "$GCC" = yes; then
1801 CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
1802 CSHARPCFLAGS="-mno-cygwin -mthreads"
1803 else
1804 CSHARPDYNAMICLINKING=""
1805 CSHARPCFLAGS=""
1806 fi ;;
1807 *)
1808 CSHARPDYNAMICLINKING=""
1809 CSHARPCFLAGS=""
1810 ;;
1811 esac
1812
1813 # CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
1814 case $host in
1815 *-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";;
1816 *)CSHARPLIBRARYPREFIX="lib";;
1817 esac
1818
1819 # C#/Mono on Mac OS X tweaks
1820 case $host in
1821 *-*-darwin*)
1822 CSHARPSO=".so"
1823 ;;
1824 *)
1825 CSHARPSO=$SO
1826 ;;
1827 esac
1828 fi
1829
1830 AC_SUBST(CSHARPCILINTERPRETER_FLAGS)
1831 AC_SUBST(CSHARPCILINTERPRETER)
1832 AC_SUBST(CSHARPPATHSEPARATOR)
1833 AC_SUBST(CSHARPCYGPATH_W)
1834 AC_SUBST(CSHARPCOMPILER)
1835 AC_SUBST(CSHARPDYNAMICLINKING)
1836 AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?
1837 AC_SUBST(CSHARPCFLAGS)
1838 AC_SUBST(CSHARPSO)
1839
1840 #----------------------------------------------------------------
1841 # Look for Lua
1842 #----------------------------------------------------------------
1843
1844 LUABIN=
1845 LUAINCLUDE=
1846 LUALIB=
1847 LUADYNAMICLOADLIB=
1848 LUAFLAGS=
1849 LUALINK=
1850 # note: if LUABIN is empty then lua tests will not be done
1851 # LUABIN will be cleared if certain dependencies cannot be found
1852
1853 AC_ARG_WITH(lua, AS_HELP_STRING([--without-lua], [Disable Lua])
1854 AS_HELP_STRING([--with-lua=path], [Set location of Lua executable]),[ LUABIN="$withval"], [LUABIN=yes])
1855 AC_ARG_WITH(luaincl,[ --with-luaincl=path Set location of Lua include directory],[
1856 LUAINCLUDE="$withval"], [LUAINCLUDE=])
1857 AC_ARG_WITH(lualib,[ --with-lualib=path Set location of Lua library directory],[
1858 LUALIB="$withval"], [LUALIB=])
1859
1860 # First, check for "--without-lua" or "--with-lua=no".
1861 if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then
1862 AC_MSG_NOTICE([Disabling Lua])
1863 else
1864
1865 # can we find lua?
1866 if test "x$LUABIN" = xyes; then
1867 # We look for a versioned Lua binary first, as there can be
1868 # multiple versions of Lua installed on some systems (like Debian).
1869 # The search order should match the include-file and library search
1870 # orders below (a Lua shared library built for one version may not
1871 # work with a Lua binary of a different version).
1872 AC_PATH_PROGS(LUABIN, [lua5.2 lua5.1 lua])
1873 fi
1874
1875 # check version: we need Lua 5.x
1876 if test "$LUABIN"; then
1877 AC_MSG_CHECKING(Lua version)
1878 # if version 5.x
1879 LUAV5=`$LUABIN -e 'if string.sub(_VERSION,5,5)=="5" then print "1" end'`
1880 # if not version 5.0
1881 LUAV51=`$LUABIN -e 'if string.sub(_VERSION,5,7)~="5.0" then print "1" end'`
1882
1883 if test -z "$LUAV5"; then
1884 AC_MSG_WARN(Not Lua 5.x, SWIG does not support this version of Lua)
1885 LUABIN=""
1886 elif test -z "$LUAV51"; then
1887 AC_MSG_RESULT(Lua 5.0.x)
1888 else
1889 AC_MSG_RESULT(Lua 5.1 or later)
1890 fi
1891 fi
1892
1893 if test "$LUABIN"; then
1894 AC_MSG_CHECKING(whether Lua dynamic loading is enabled)
1895 # using Lua to check Lua
1896 # lua 5.0 & 5.1 have different fn names
1897 if test -z "$LUAV51"; then
1898 LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=loadlib("no_such_lib","") if c~="absent" then print "1" end'`
1899 else
1900 LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'`
1901 fi
1902
1903 if test -z "$LUADYNAMICLOADLIB"; then
1904 AC_MSG_RESULT(no)
1905 else
1906 AC_MSG_RESULT(yes)
1907 fi
1908 fi
1909
1910 # look for the header files & set LUAFLAGS accordingly
1911 # will clear LUABIN if not present
1912 if test -n "$LUAINCLUDE"; then
1913 AC_CHECK_FILE($LUAINCLUDE/lua.h,[LUAFLAGS="$ISYSTEM$LUAINCLUDE"],[LUABIN=])
1914 else
1915 LUA_OK="1"
1916 AC_CHECK_HEADER(lua.h,[LUAFLAGS=""],[LUA_OK=""])
1917 # if we didn't get it, going to have to look elsewhere (the hard way)
1918 if test -z "$LUA_OK"; then
1919 AC_MSG_CHECKING(for lua.h in other locations)
1920 # note: Debian/Ubuntu seem to like /usr/include/lua5.1/lua.h
1921 # The ordering of the include directories to search should match
1922 # the ordering of libraries to search in the library test below.
1923 inc=/usr/include
1924 dirs="$inc/lua5.2 $inc/lua5.1 $inc/lua51 $inc/lua5.0 $inc/lua50 /usr/local/include"
1925 for i in $dirs; do
1926 #echo "$i"
1927 if test -r $i/lua.h; then
1928 AC_MSG_RESULT($i/lua.h)
1929 LUAFLAGS="$ISYSTEM$i"
1930 break
1931 fi
1932 done
1933 if test -z "$LUAFLAGS"; then
1934 AC_MSG_RESULT(not found)
1935 LUABIN="" # clear the bin
1936 fi
1937 fi
1938 fi
1939
1940 # look for the library files & set LUALINK accordingly
1941 # will clear LUABIN if not present
1942 lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving
1943
1944 if test -n "$LUALIB"; then
1945 AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=])
1946 else
1947 AC_SEARCH_LIBS(lua_close, [lua lua5.2 lua5.1 lua51 lua5.0 lua50], [LUALINK="-l$ac_lib"],[LUABIN=])
1948 fi
1949
1950 # adding lualib for lua 5.0
1951 if test -z "$LUAV51"; then # extra for lua 5.0
1952 LUALINK="$LUALINK -llualib"
1953 fi
1954
1955 LIBS=$lua_save_LIBS # restore LIBS
1956
1957 fi # if not disabled
1958
1959 AC_SUBST(LUADYNAMICLINKING)
1960 AC_SUBST(LUAFLAGS)
1961 AC_SUBST(LUALINK)
1962 AC_SUBST(LUABIN)
1963
1964 #----------------------------------------------------------------
1965 # Look for Allegro Common Lisp
1966 #----------------------------------------------------------------
1967
1968 ALLEGROCLBIN=
1969
1970 AC_ARG_WITH(allegrocl, AS_HELP_STRING([--without-allegrocl], [Disable Allegro CL])
1971 AS_HELP_STRING([--with-allegrocl=path], [Set location of Allegro CL executable (alisp)]),[ ALLEGROCLBIN="$withval"], [ALLEGROCLBIN=yes])
1972
1973 # First, check for "--without-allegrocl" or "--with-allegrocl=no".
1974 if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then
1975 AC_MSG_NOTICE([Disabling Allegro CL])
1976 ALLEGROCLBIN=
1977 else
1978
1979 # can we find allegrocl?
1980 if test "x$ALLEGROCLBIN" = xyes; then
1981 AC_PATH_PROG(ALLEGROCLBIN, alisp)
1982 fi
1983 fi
1984
1985 AC_SUBST(ALLEGROCLBIN)
1986
1987 #----------------------------------------------------------------
1988 # Look for GNU CLISP
1989 #----------------------------------------------------------------
1990
1991 CLISPBIN=
1992
1993 AC_ARG_WITH(clisp, AS_HELP_STRING([--without-clisp], [Disable CLISP])
1994 AS_HELP_STRING([--with-clisp=path], [Set location of CLISP executable (clisp)]),[ CLISPBIN="$withval"], [CLISPBIN=yes])
1995
1996 # First, check for "--without-clisp" or "--with-clisp=no".
1997 if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then
1998 AC_MSG_NOTICE([Disabling CLISP])
1999 CLISPBIN=
2000 else
2001
2002 # can we find clisp?
2003 if test "x$CLISPBIN" = xyes; then
2004 AC_PATH_PROG(CLISPBIN, clisp)
2005 fi
2006 fi
2007
2008 AC_SUBST(CLISPBIN)
2009
2010 #----------------------------------------------------------------
2011 # Look for GNU R
2012 #----------------------------------------------------------------
2013
2014 RBIN=
2015
2016 AC_ARG_WITH(r, AS_HELP_STRING([--without-r], [Disable R])
2017 AS_HELP_STRING([--with-r=path], [Set location of R executable (r)]),[ RBIN="$withval"], [RBIN=yes])
2018
2019 # First, check for "--without-r" or "--with-r=no".
2020 if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then
2021 AC_MSG_NOTICE([Disabling R])
2022 RBIN=
2023 else
2024
2025 # can we find R?
2026 if test "x$RBIN" = xyes; then
2027 AC_PATH_PROG(RBIN, R)
2028 fi
2029 fi
2030
2031 AC_SUBST(RBIN)
2032
2033 #----------------------------------------------------------------
2034 # Look for Go compilers
2035 #----------------------------------------------------------------
2036
2037 AC_ARG_WITH(go, AS_HELP_STRING([--without-go], [Disable Go])
2038 AS_HELP_STRING([--with-go=path], [Set location of Go compiler]),[GOBIN="$withval"], [GOBIN=yes])
2039
2040 if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then
2041 AC_MSG_NOTICE([Disabling Go])
2042 GO=
2043 GOC=
2044 GO1=false
2045 GOGCC=false
2046 GOOPT=
2047 GOVERSIONOPTION=
2048 else
2049
2050 if test "x$GOBIN" = xyes; then
2051 AC_CHECK_PROGS(GO, go 6g 8g gccgo)
2052 else
2053 GO="$GOBIN"
2054 fi
2055
2056 GOGCC=false
2057 GO1=false
2058 GOOPT=
2059 GOVERSIONOPTION=
2060 if test -n "$GO" ; then
2061 if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then
2062 GOGCC=true
2063 GOVERSIONOPTION=--version
2064 AC_MSG_CHECKING([whether gccgo version is too old])
2065 go_version=`$GO $GOVERSIONOPTION | sed -e 's/[^0-9]* \([0-9.]*\) .*$/\1/' -e 's/[.]//g'`
2066 if test "$go_version" -lt 470; then
2067 AC_MSG_RESULT([yes - minimum version is 4.7.0])
2068 else
2069 AC_MSG_RESULT([no])
2070 if test "$go_version" -lt 480; then
2071 GOOPT="-intgosize 32"
2072 else
2073 AC_CHECK_SIZEOF([void *], [4])
2074 if test "$ac_cv_sizeof_void_p" = "8"; then
2075 GOOPT="-intgosize 64"
2076 else
2077 GOOPT="-intgosize 32"
2078 fi
2079 fi
2080 fi
2081 elif test "`echo $GO | sed -e 's|.*/||'`" = "go"; then
2082 GO1=true
2083 GOVERSIONOPTION=version
2084 GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
2085 go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
2086 case $go_version in
2087 go1.0*) GOOPT="-intgosize 32" ;;
2088 *) if test "$GOC" = "6c"; then
2089 GOOPT="-intgosize 64"
2090 else
2091 GOOPT="-intgosize 32"
2092 fi
2093 ;;
2094 esac
2095 else
2096 GOC=`echo $GO | sed -e 's/g/c/'`
2097 GOVERSIONOPTION=-V
2098 AC_MSG_CHECKING([whether Go ($GO) version is too old])
2099 go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
2100 go_min_version=7077
2101 if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then
2102 AC_MSG_RESULT([yes - minimum version is $go_min_version])
2103 GO=
2104 else
2105 AC_MSG_RESULT([no])
2106 fi
2107 GOOPT="-intgosize 32"
2108 fi
2109 fi
2110 fi
2111
2112 AC_SUBST(GOGCC)
2113 AC_SUBST(GO)
2114 AC_SUBST(GOC)
2115 AC_SUBST(GO1)
2116 AC_SUBST(GOOPT)
2117 AC_SUBST(GOVERSIONOPTION)
2118
2119 #----------------------------------------------------------------
2120 # Look for D
2121 #----------------------------------------------------------------
2122
2123 AC_ARG_WITH(d, AS_HELP_STRING([--without-d], [Disable D]), [with_d="$withval"], [with_d=yes])
2124 AC_ARG_WITH(d1-compiler, [ --with-d1-compiler=path Set location of D1/Tango compiler (DMD compatible)],[D1COMPILERBIN="$withval"], [D1COMPILERBIN=])
2125 AC_ARG_WITH(d2-compiler, [ --with-d2-compiler=path Set location of D2 compiler (DMD compatible)],[D2COMPILERBIN="$withval"], [D2COMPILERBIN=])
2126
2127
2128 # First, check for "--without-d" or "--with-d=no".
2129 if test x"${with_d}" = xno -o x"${with_alllang}" = xno ; then
2130 AC_MSG_NOTICE([Disabling D])
2131 D1COMPILER=
2132 D2COMPILER=
2133 else
2134 old_ac_ext=$ac_ext
2135 ac_ext=d
2136
2137 if test -z "$D1COMPILERBIN" ; then
2138 AC_CHECK_PROGS(D1COMPILER, dmd ldmd gdmd)
2139
2140 if test -n "$D1COMPILER" ; then
2141 AC_MSG_CHECKING(whether the D1/Tango compiler works)
2142 cat > conftest.$ac_ext <<_ACEOF
2143 import tango.io.Stdout;
2144 void main() {
2145 }
2146 _ACEOF
2147 rm -f conftest.$ac_objext
2148 AS_IF(
2149 [_AC_DO_STDERR($D1COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext],
2150 [AC_MSG_RESULT([yes])],
2151 [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no])
2152 D1COMPILER=]
2153 )
2154 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2155 fi
2156 else
2157 D1COMPILER="$D1COMPILERBIN"
2158 fi
2159
2160 if test -z "$D2COMPILERBIN" ; then
2161 AC_CHECK_PROGS(D2COMPILER, dmd gdmd)
2162
2163 if test -n "$D2COMPILER" ; then
2164 AC_MSG_CHECKING(whether the D2 compiler works)
2165 cat > conftest.$ac_ext <<_ACEOF
2166 import std.algorithm;
2167 void main() {
2168 }
2169 _ACEOF
2170 rm -f conftest.$ac_objext
2171 AS_IF(
2172 [_AC_DO_STDERR($D2COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext],
2173 [AC_MSG_RESULT([yes])],
2174 [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no])
2175 D2COMPILER=]
2176 )
2177 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2178 fi
2179 else
2180 D2COMPILER="$D2COMPILERBIN"
2181 fi
2182
2183 ac_ext=$old_ac_ext
2184 fi
2185
2186 if test -n "$D1COMPILER"; then
2187 DDEFAULTVERSION=1
2188 elif test -n "$D2COMPILER"; then
2189 DDEFAULTVERSION=2
2190 fi
2191
2192 # Do not prefix library file names with "lib" on Windows.
2193 case $host in
2194 *-*-cygwin* | *-*-mingw*) DLIBPREFIX="";;
2195 *)DLIBPREFIX="lib";;
2196 esac
2197
2198 AC_SUBST(D1COMPILER)
2199 AC_SUBST(D2COMPILER)
2200 AC_SUBST(DDEFAULTVERSION)
2201 AC_SUBST(DLIBPREFIX)
2202
2203 #----------------------------------------------------------------
2204 # Determine which languages to use for examples/test-suite
2205 #----------------------------------------------------------------
2206
2207 SKIP_TCL=
2208 if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then
2209 SKIP_TCL="1"
2210 fi
2211 AC_SUBST(SKIP_TCL)
2212
2213
2214 SKIP_PERL5=
2215 if test -z "$PERL" || test -z "$PERL5EXT" ; then
2216 SKIP_PERL5="1"
2217 fi
2218 AC_SUBST(SKIP_PERL5)
2219
2220
2221 SKIP_OCTAVE=
2222 if test -z "$OCTAVE" ; then
2223 SKIP_OCTAVE="1"
2224 fi
2225 AC_SUBST(SKIP_OCTAVE)
2226
2227
2228 SKIP_PYTHON=
2229 if (test -z "$PYINCLUDE") &&
2230 (test -z "$PY3INCLUDE") ; then
2231 SKIP_PYTHON="1"
2232 fi
2233 AC_SUBST(SKIP_PYTHON)
2234
2235 SKIP_PYTHON3=
2236 if test -z "$PY3INCLUDE" ; then
2237 SKIP_PYTHON3="1"
2238 fi
2239 AC_SUBST(SKIP_PYTHON3)
2240
2241 SKIP_JAVA=
2242 if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then
2243 SKIP_JAVA="1"
2244 fi
2245 AC_SUBST(SKIP_JAVA)
2246
2247
2248 SKIP_GUILE=
2249 if test -z "$GUILE" || test -z "$GUILE_LIBS" ; then
2250 SKIP_GUILE="1"
2251 fi
2252 AC_SUBST(SKIP_GUILE)
2253
2254
2255 SKIP_MZSCHEME=
2256 if test -z "$MZC" || test -z "$MZDYNOBJ" ; then
2257 SKIP_MZSCHEME="1"
2258 fi
2259 AC_SUBST(SKIP_MZSCHEME)
2260
2261
2262 SKIP_RUBY=
2263 if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then
2264 SKIP_RUBY="1"
2265 fi
2266 AC_SUBST(SKIP_RUBY)
2267
2268
2269 SKIP_PHP=
2270 if test -z "$PHP" || test -z "$PHPINC" ; then
2271 SKIP_PHP="1"
2272 fi
2273 AC_SUBST(SKIP_PHP)
2274
2275
2276 SKIP_OCAML=
2277 if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then
2278 SKIP_OCAML="1"
2279 fi
2280 AC_SUBST(SKIP_OCAML)
2281
2282
2283 SKIP_PIKE=
2284 if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then
2285 SKIP_PIKE="1"
2286 fi
2287 AC_SUBST(SKIP_PIKE)
2288
2289
2290 SKIP_CHICKEN=
2291 if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then
2292 SKIP_CHICKEN="1"
2293 fi
2294 AC_SUBST(SKIP_CHICKEN)
2295
2296
2297 SKIP_CSHARP=
2298 if test -z "$CSHARPCOMPILER" ; then
2299 SKIP_CSHARP="1"
2300 else
2301 if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then
2302 SKIP_CSHARP="1"
2303 fi
2304 fi
2305 AC_SUBST(SKIP_CSHARP)
2306
2307 SKIP_MODULA3="1" # Always skipped!
2308 AC_SUBST(SKIP_MODULA3)
2309
2310 SKIP_LUA=
2311 # we need LUABIN & dynamic loading
2312 if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then
2313 SKIP_LUA="1"
2314 fi
2315 AC_SUBST(SKIP_LUA)
2316
2317 SKIP_ALLEGROCL=
2318 if test -z "$ALLEGROCLBIN" ; then
2319 SKIP_ALLEGROCL="1"
2320 fi
2321 AC_SUBST(SKIP_ALLEGROCL)
2322
2323 SKIP_CLISP=
2324 if test -z "$CLISPBIN" ; then
2325 SKIP_CLISP="1"
2326 fi
2327 AC_SUBST(SKIP_CLISP)
2328
2329 SKIP_R=
2330 if test -z "$RBIN" ; then
2331 SKIP_R="1"
2332 fi
2333 AC_SUBST(SKIP_R)
2334
2335 SKIP_CFFI=
2336 #if test -z "$CFFIBIN" ; then
2337 SKIP_CFFI="1"
2338 #fi
2339 AC_SUBST(SKIP_CFFI)
2340
2341 SKIP_UFFI=
2342 #if test -z "$UFFIBIN" ; then
2343 SKIP_UFFI="1"
2344 #fi
2345 AC_SUBST(SKIP_UFFI)
2346
2347 SKIP_GO=
2348 if test -z "$GO" ; then
2349 SKIP_GO="1"
2350 fi
2351 AC_SUBST(SKIP_GO)
2352
2353 SKIP_D=
2354 if test -z "$DDEFAULTVERSION" ; then
2355 SKIP_D="1"
2356 fi
2357 AC_SUBST(SKIP_D)
2358
2359 #----------------------------------------------------------------
2360 # Additional language dependencies
2361 #----------------------------------------------------------------
2362 SKIP_GCJ=
2363 if test -z "$GCJ" || test -z "$GCJH" ; then
2364 SKIP_GCJ="1"
2365 else
2366 if test "$GCC" != yes; then
2367 SKIP_GCJ="1"
2368 fi
2369 fi
2370 AC_SUBST(SKIP_GCJ)
2371
2372
2373 SKIP_ANDROID=
2374 if test -z "$ANDROID" || test -z "$ADB" || test -z "$ANT" || test -z "$NDKBUILD" ; then
2375 SKIP_ANDROID="1"
2376 fi
2377 AC_SUBST(SKIP_ANDROID)
2378
2379
2380
2381 #----------------------------------------------------------------
2382 # Miscellaneous
2383 #----------------------------------------------------------------
2384
2385
2386 # Root directory
2387 # Translate path for native Windows compilers for use with 'make check'
2388 ROOT_DIR=`pwd`
2389 case $host in
2390 *-*-cygwin* | *-*-mingw*)
2391 if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then
2392 ROOT_DIR=`cygpath --mixed $ROOT_DIR`
2393 fi
2394 # Extra files generated by some Windows compilers
2395 EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk"
2396 ;;
2397 esac
2398
2399 AC_SUBST(ROOT_DIR)
2400 AC_SUBST(EXTRA_CLEAN)
2401 AC_SUBST(ac_aux_dir)
2402
2403 # Configure SWIG_LIB path
2404
2405 AC_ARG_WITH(swiglibdir,[ --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR.],
2406 [swig_lib="$withval"], [swig_lib="${datadir}/swig/${PACKAGE_VERSION}"])
2407 AC_SUBST(swig_lib)
2408 AC_DEFINE_DIR(SWIG_LIB, swig_lib, [Directory for SWIG system-independent libraries])
2409
2410 case $build in
2411 # Windows does not understand unix directories. Convert into a windows directory with drive letter.
2412 *-*-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.
2413 *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;;
2414 *) SWIG_LIB_WIN_UNIX="";;
2415 esac
2416 AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)])
2417
2418 AC_CONFIG_FILES([ \
2419 Makefile \
2420 swig.spec \
2421 Source/Makefile \
2422 Examples/Makefile \
2423 Examples/xml/Makefile \
2424 Examples/test-suite/chicken/Makefile \
2425 Examples/test-suite/csharp/Makefile \
2426 Examples/test-suite/d/Makefile \
2427 Examples/test-suite/guile/Makefile \
2428 Examples/test-suite/java/Makefile \
2429 Examples/test-suite/mzscheme/Makefile \
2430 Examples/test-suite/ocaml/Makefile \
2431 Examples/test-suite/octave/Makefile \
2432 Examples/test-suite/perl5/Makefile \
2433 Examples/test-suite/php/Makefile \
2434 Examples/test-suite/pike/Makefile \
2435 Examples/test-suite/python/Makefile \
2436 Examples/test-suite/ruby/Makefile \
2437 Examples/test-suite/tcl/Makefile \
2438 Examples/test-suite/lua/Makefile \
2439 Examples/test-suite/allegrocl/Makefile \
2440 Examples/test-suite/clisp/Makefile \
2441 Examples/test-suite/cffi/Makefile \
2442 Examples/test-suite/uffi/Makefile \
2443 Examples/test-suite/r/Makefile \
2444 Examples/test-suite/go/Makefile \
2445 Lib/ocaml/swigp4.ml
2446 ])
2447 AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig])
2448 AC_CONFIG_FILES([CCache/ccache_swig_config.h])
2449
2450 AC_OUTPUT
2451 dnl configure.ac ends here