PageRenderTime 59ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1.3.35/configure.in

#
Autoconf | 2053 lines | 1543 code | 290 blank | 220 comment | 285 complexity | 22e13952db4f16104c4c6d44151d6e5b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  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. AC_INIT([swig],[1.3.35],[http://www.swig.org])
  5. AC_PREREQ(2.58)
  6. AC_CONFIG_SRCDIR([Source/Swig/swig.h])
  7. AC_CONFIG_AUX_DIR([Tools/config])
  8. AC_CONFIG_HEADERS([Source/Include/swigconfig.h])
  9. AC_CANONICAL_HOST
  10. AM_INIT_AUTOMAKE
  11. dnl Some extra defines for the config file
  12. AH_BOTTOM([
  13. /* Default language */
  14. #define SWIG_LANG "-tcl"
  15. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  16. #if defined(_MSC_VER)
  17. # define _CRT_SECURE_NO_DEPRECATE
  18. #endif
  19. ])
  20. dnl Checks for programs.
  21. AC_PROG_CC
  22. AC_PROG_CXX
  23. AC_PROG_YACC
  24. AC_EXEEXT
  25. AC_OBJEXT
  26. AC_PROG_RANLIB
  27. AM_PROG_CC_C_O # Needed for subdir-objects in AUTOMAKE_OPTIONS
  28. AC_CHECK_PROGS(AR, ar aal, ar)
  29. AC_SUBST(AR)
  30. AC_COMPILE_WARNINGS # Increase warning levels
  31. AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG])
  32. AC_DEFINE_UNQUOTED(SWIG_PLATFORM, ["$build"], [Platform that SWIG is built for])
  33. dnl Checks for header files.
  34. AC_HEADER_STDC
  35. dnl How to specify include directories that may be system directories.
  36. # -I should not be used on system directories (GCC)
  37. if test "$GCC" = yes; then
  38. ISYSTEM="-isystem "
  39. else
  40. ISYSTEM="-I"
  41. fi
  42. dnl Checks for types.
  43. AC_LANG_PUSH([C++])
  44. AC_CHECK_TYPES([bool])
  45. AC_LANG_POP([C++])
  46. # Set info about shared libraries.
  47. AC_SUBST(SO)
  48. AC_SUBST(LDSHARED)
  49. AC_SUBST(CCSHARED)
  50. AC_SUBST(CXXSHARED)
  51. AC_SUBST(TRYLINKINGWITHCXX)
  52. AC_SUBST(LINKFORSHARED)
  53. # SO is the extension of shared libraries `(including the dot!)
  54. AC_MSG_CHECKING(SO)
  55. if test -z "$SO"
  56. then
  57. case $host in
  58. *-*-hp*) SO=.sl;;
  59. *-*-darwin*) SO=.bundle;;
  60. *-*-cygwin* | *-*-mingw*) SO=.dll;;
  61. *) SO=.so;;
  62. esac
  63. fi
  64. AC_MSG_RESULT($SO)
  65. # LDSHARED is the ld *command* used to create shared library
  66. # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
  67. # (Shared libraries in this instance are shared modules to be loaded into
  68. # Python, as opposed to building Python itself as a shared library.)
  69. AC_MSG_CHECKING(LDSHARED)
  70. if test -z "$LDSHARED"
  71. then
  72. case $host in
  73. *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
  74. *-*-cygwin* | *-*-mingw*)
  75. if test "$GCC" = yes; then
  76. LDSHARED="$CC -shared"
  77. else
  78. if test "cl" = $CC ; then
  79. # Microsoft Visual C++ (MSVC)
  80. LDSHARED="$CC -nologo -LD"
  81. else
  82. # Unknown compiler try gcc approach
  83. LDSHARED="$CC -shared"
  84. fi
  85. fi ;;
  86. *-*-irix5*) LDSHARED="ld -shared";;
  87. *-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
  88. *-*-sunos4*) LDSHARED="ld";;
  89. *-*-solaris*) LDSHARED="ld -G";;
  90. *-*-hp*) LDSHARED="ld -b";;
  91. *-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
  92. *-sequent-sysv4) LDSHARED="ld -G";;
  93. *-*-next*)
  94. if test "$ns_dyld"
  95. then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
  96. else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
  97. fi
  98. if test "$with_next_framework" ; then
  99. LDSHARED="$LDSHARED \$(LDLIBRARY)"
  100. fi ;;
  101. *-*-linux*) LDSHARED="gcc -shared";;
  102. *-*-dgux*) LDSHARED="ld -G";;
  103. *-*-freebsd3*) LDSHARED="gcc -shared";;
  104. *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";;
  105. *-*-netbsd*)
  106. if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
  107. then
  108. LDSHARED="cc -shared"
  109. else
  110. LDSHARED="ld -Bshareable"
  111. fi;;
  112. *-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
  113. *-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";;
  114. *) LDSHARED="ld";;
  115. esac
  116. fi
  117. AC_MSG_RESULT($LDSHARED)
  118. # CXXSHARED is the ld *command* used to create C++ shared library
  119. # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
  120. # (Shared libraries in this instance are shared modules to be loaded into
  121. # Python, as opposed to building Python itself as a shared library.)
  122. AC_MSG_CHECKING(CXXSHARED)
  123. if test -z "$CXXSHARED"
  124. then
  125. CXXSHARED="$LDSHARED"
  126. fi
  127. AC_MSG_RESULT($CXXSHARED)
  128. #
  129. AC_MSG_CHECKING(TRYLINKINGWITHCXX)
  130. if test -z "$TRYLINKINGWITHCXX"
  131. then
  132. case $host in
  133. *-*-solaris*) if test "$GCC" = yes;
  134. then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G";
  135. else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd";
  136. fi;;
  137. *-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";;
  138. *-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";;
  139. *-*-cygwin* | *-*-mingw*)
  140. if test "$GCC" = yes; then
  141. TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared "
  142. else
  143. if test "cl" = $CXX ; then
  144. # Microsoft Visual C++ (MSVC)
  145. TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD"
  146. else
  147. TRYLINKINGWITHCXX="#unknown Windows compiler"
  148. fi
  149. fi ;;
  150. *) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";;
  151. esac
  152. fi
  153. AC_MSG_RESULT($TRYLINKINGWITHCXX)
  154. # CCSHARED are the C *flags* used to create objects to go into a shared
  155. # library (module) -- this is only needed for a few systems
  156. AC_MSG_CHECKING(CCSHARED)
  157. if test -z "$CCSHARED"
  158. then
  159. case $host in
  160. *-*-hp*) if test "$GCC" = yes;
  161. then CCSHARED="-fpic";
  162. else CCSHARED="+z";
  163. fi;;
  164. *-*-linux*) CCSHARED="-fpic";;
  165. *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";;
  166. *-*-netbsd*) CCSHARED="-fPIC";;
  167. *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";;
  168. *-*-irix6*) case $CC in
  169. *gcc*) CCSHARED="-shared";;
  170. *) CCSHARED="";;
  171. esac;;
  172. esac
  173. fi
  174. AC_MSG_RESULT($CCSHARED)
  175. # RPATH is the path used to look for shared library files.
  176. AC_MSG_CHECKING(RPATH)
  177. if test -z "$RPATH"
  178. then
  179. case $host in
  180. *-*-solaris*) RPATH='-R. -R$(exec_prefix)/lib';;
  181. *-*-irix*) RPATH='-rpath .:$(exec_prefix)/lib';;
  182. *-*-linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';;
  183. *) RPATH='';;
  184. esac
  185. fi
  186. AC_MSG_RESULT($RPATH)
  187. AC_SUBST(RPATH)
  188. # LINKFORSHARED are the flags passed to the $(CC) command that links
  189. # the a few executables -- this is only needed for a few systems
  190. AC_MSG_CHECKING(LINKFORSHARED)
  191. if test -z "$LINKFORSHARED"
  192. then
  193. case $host in
  194. *-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
  195. *-*-hp*)
  196. LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
  197. *-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
  198. *-*-next*) LINKFORSHARED="-u libsys_s";;
  199. *-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
  200. *-*-irix6*) LINKFORSHARED="-all";;
  201. esac
  202. fi
  203. AC_MSG_RESULT($LINKFORSHARED)
  204. # This variation is needed on OS-X because there is no (apparent) consistency in shared library naming.
  205. # Sometimes .bundle works, but sometimes .so is needed. It depends on the target language
  206. AC_SUBST(PYTHON_SO)
  207. case $host in
  208. *-*-mingw*) PYTHON_SO=.pyd;;
  209. *-*-darwin*) PYTHON_SO=.so;;
  210. *) PYTHON_SO=$SO;;
  211. esac
  212. AC_SUBST(TCL_SO)
  213. case $host in
  214. *-*-darwin*) TCL_SO=.dylib;;
  215. *) TCL_SO=$SO;;
  216. esac
  217. AC_SUBST(GUILE_SO)
  218. case $host in
  219. *-*-darwin*) GUILE_SO=.so;;
  220. *) GUILE_SO=$SO;;
  221. esac
  222. AC_SUBST(PHP4_SO)
  223. case $host in
  224. *-*-darwin*) PHP4_SO=.so;;
  225. *) PHP4_SO=$SO;;
  226. esac
  227. AC_SUBST(MZSCHEME_SO)
  228. case $host in
  229. *) MZSCHEME_SO=.so;;
  230. esac
  231. AC_SUBST(TCL_LDSHARED)
  232. case $host in
  233. *-*-darwin*) TCL_LDSHARED="gcc -dynamiclib -flat_namespace -undefined suppress";;
  234. *) TCL_LDSHARED=$LDSHARED;;
  235. esac
  236. AC_SUBST(TCL_CXXSHARED)
  237. case $host in
  238. *-*-darwin*) TCL_CXXSHARED="g++ -dynamiclib -flat_namespace -undefined suppress";;
  239. *) TCL_CXXSHARED=$TRYLINKINGWITHCXX;;
  240. esac
  241. AC_SUBST(LUA_SO)
  242. case $host in
  243. *-*-darwin*) LUA_SO=.so;;
  244. *) LUA_SO=$SO;;
  245. esac
  246. # Optional CFLAGS used to silence compiler warnings on some platforms.
  247. AC_SUBST(PLATFLAGS)
  248. case $host in
  249. *-*-darwin*) PLATFLAGS="-Wno-long-double";;
  250. *) PLATFLAGS="";;
  251. esac
  252. echo ""
  253. echo "Checking for installed packages."
  254. echo "Note : None of the following packages are required to compile SWIG"
  255. echo ""
  256. #----------------------------------------------------------------
  257. # Look for popen
  258. #----------------------------------------------------------------
  259. AC_ARG_WITH(popen, AS_HELP_STRING([--without-popen], [Disable popen]), with_popen="$withval")
  260. if test x"${with_popen}" = xno ; then
  261. AC_MSG_NOTICE([Disabling popen])
  262. else
  263. AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen]))
  264. fi
  265. #----------------------------------------------------------------
  266. # Look for RxSpencer
  267. #----------------------------------------------------------------
  268. AC_ARG_WITH(rxspencer, AS_HELP_STRING([--with-rxspencer], [Enable RxSpencer]), with_rxspencer="yes")
  269. if test x"${with_rxspencer}" = xyes ; then
  270. #check first for the header
  271. AC_CHECK_HEADER(rxspencer/regex.h,with_rxspencer="yes",with_rxspencer="no")
  272. if test x"${with_rxspencer}" = xyes ; then
  273. # now check for the library
  274. AC_CHECK_LIB(rxspencer, regcomp,with_rxspencer="yes",with_rxspencer="no")
  275. fi
  276. if test x"${with_rxspencer}" = xyes ; then
  277. # library and header are available
  278. AC_DEFINE(HAVE_RXSPENCER, 1,[Define if rxspencer is available])
  279. LIBS="$LIBS -lrxspencer"
  280. else
  281. AC_MSG_NOTICE([RxSpencer not found. Obtain it at http://arglist.com/regex or http://gnuwin32.sourceforge.net/packages.html])
  282. fi
  283. fi
  284. #----------------------------------------------------------------
  285. # Check for specific libraries. Used for SWIG examples
  286. AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
  287. AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
  288. dnl The following three libraries (nsl,inet,socket) are needed on Sequent,
  289. dnl and must be checked for in this order since each library depends on the
  290. dnl preceding one.
  291. dnl
  292. dnl Most SVR4 platforms will need -lsocket and -lnsl. However on SGI IRIX 5,
  293. dnl these exist but are broken, so we use AC_SEARCH_LIBS which will only try
  294. dnl the library if the function isn't already available without it.
  295. AC_SEARCH_LIBS(t_open, nsl) # SVR4
  296. AC_SEARCH_LIBS(gethostbyname, inet) # Sequent
  297. AC_SEARCH_LIBS(socket, socket) # SVR4 sockets
  298. AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"])
  299. AC_SUBST(SWIGLIBS)
  300. AC_SUBST(SWILL)
  301. # check for --with-libm=...
  302. AC_SUBST(LIBM)
  303. LIBM=-lm
  304. AC_ARG_WITH(libm, [ --with-libm=STRING math library], [
  305. if test "$withval" != yes
  306. then LIBM=$withval
  307. else AC_MSG_ERROR([proper usage is --with-libm=STRING])
  308. fi])
  309. AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"])
  310. AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"])
  311. AC_SUBST(LIBCRYPT)
  312. # check for --with-libc=...
  313. AC_SUBST(LIBC)
  314. AC_ARG_WITH(libc, [ --with-libc=STRING C library], [
  315. if test "$withval" != yes
  316. then LIBC=$withval
  317. else AC_MSG_ERROR([proper usage is --with-libc=STRING])
  318. fi])
  319. #--------------------------------------------------------------------
  320. # Locate the X11 header files and the X11 library archive. Try
  321. # the ac_path_x macro first, but if it doesn't find the X stuff
  322. # (e.g. because there's no xmkmf program) then check through
  323. # a list of possible directories. Under some conditions the
  324. # autoconf macro will return an include directory that contains
  325. # no include files, so double-check its result just to be safe.
  326. #--------------------------------------------------------------------
  327. AC_PATH_X
  328. not_really_there=""
  329. if test "$no_x" = ""; then
  330. if test "$x_includes" = ""; then
  331. AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
  332. else
  333. if test ! -r $x_includes/X11/Intrinsic.h; then
  334. not_really_there="yes"
  335. fi
  336. fi
  337. fi
  338. if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
  339. AC_MSG_CHECKING(for X11 header files)
  340. XINCLUDES="# no special path needed"
  341. AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="")
  342. if test -z "$XINCLUDES"; then
  343. 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"
  344. for i in $dirs ; do
  345. if test -r $i/X11/Intrinsic.h; then
  346. AC_MSG_RESULT($i)
  347. XINCLUDES=" -I$i"
  348. break
  349. fi
  350. done
  351. fi
  352. else
  353. if test "$x_includes" != ""; then
  354. XINCLUDES=-I$x_includes
  355. else
  356. XINCLUDES="# no special path needed"
  357. fi
  358. fi
  359. if test -z "$XINCLUDES"; then
  360. AC_MSG_RESULT(couldn't find any!)
  361. XINCLUDES="# no include files found"
  362. fi
  363. if test "$no_x" = yes; then
  364. AC_MSG_CHECKING(for X11 libraries)
  365. XLIBSW=
  366. 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"
  367. for i in $dirs ; do
  368. if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
  369. AC_MSG_RESULT($i)
  370. XLIBSW="-L$i -lX11"
  371. break
  372. fi
  373. done
  374. else
  375. if test "$x_libraries" = ""; then
  376. XLIBSW=-lX11
  377. else
  378. XLIBSW="-L$x_libraries -lX11"
  379. fi
  380. fi
  381. if test -z "$XLIBSW" ; then
  382. AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
  383. fi
  384. if test -z "$XLIBSW" ; then
  385. AC_MSG_RESULT(couldn't find any! Using -lX11.)
  386. XLIBSW=-lX11
  387. fi
  388. AC_SUBST(XINCLUDES)
  389. AC_SUBST(XLIBSW)
  390. AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
  391. #--------------------------------------------------------------------
  392. # Look for Tcl
  393. #--------------------------------------------------------------------
  394. TCLINCLUDE=
  395. TCLLIB=
  396. TCLPACKAGE=
  397. AC_ARG_WITH(tclconfig, AS_HELP_STRING([--without-tcl], [Disable Tcl])
  398. AS_HELP_STRING([--with-tclconfig=path], [Set location of tclConfig.sh]), [with_tclconfig="$withval"], [with_tclconfig=])
  399. AC_ARG_WITH(tcl,
  400. [ --with-tcl=path Set location of Tcl package],[
  401. TCLPACKAGE="$withval"], [TCLPACKAGE=yes])
  402. AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
  403. TCLINCLUDE="$ISYSTEM$withval"], [TCLINCLUDE=])
  404. AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
  405. TCLLIB="-L$withval"], [TCLLIB=])
  406. # First, check for "--without-tcl" or "--with-tcl=no".
  407. if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then
  408. AC_MSG_NOTICE([Disabling Tcl])
  409. else
  410. AC_MSG_CHECKING([for Tcl configuration])
  411. # First check to see if --with-tclconfig was specified.
  412. if test x"${with_tclconfig}" != x ; then
  413. if test -f "${with_tclconfig}/tclConfig.sh" ; then
  414. TCLCONFIG=`(cd ${with_tclconfig}; pwd)`
  415. else
  416. AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
  417. fi
  418. fi
  419. # check in a few common install locations
  420. if test x"${TCLCONFIG}" = x ; then
  421. for i in `ls -d /usr/lib/ 2>/dev/null` \
  422. `ls -d -r /usr/lib/tcl*/ 2>/dev/null` \
  423. `ls -d /usr/local/lib/ 2>/dev/null` \
  424. `ls -d -r /usr/local/lib/tcl*/ 2>/dev/null` ; do
  425. if test -f $i"tclConfig.sh" ; then
  426. TCLCONFIG=`(cd $i; pwd)`
  427. break
  428. fi
  429. done
  430. fi
  431. if test x"${TCLCONFIG}" = x ; then
  432. AC_MSG_RESULT(no)
  433. else
  434. AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
  435. . $TCLCONFIG/tclConfig.sh
  436. if test -z "$TCLINCLUDE"; then
  437. TCLINCLUDE=`echo $TCL_INCLUDE_SPEC | sed "s/-I/$ISYSTEM/"`
  438. fi
  439. if test -z "$TCLLIB"; then
  440. TCLLIB=$TCL_LIB_SPEC
  441. fi
  442. fi
  443. if test -z "$TCLINCLUDE"; then
  444. if test "x$TCLPACKAGE" != xyes; then
  445. TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include"
  446. fi
  447. fi
  448. if test -z "$TCLLIB"; then
  449. if test "x$TCLPACKAGE" != xyes; then
  450. TCLLIB="-L$TCLPACKAGE/lib -ltcl"
  451. fi
  452. fi
  453. AC_MSG_CHECKING(for Tcl header files)
  454. if test -z "$TCLINCLUDE"; then
  455. AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
  456. if test -z "$TCLINCLUDE"; then
  457. dirs="/usr/local/include /usr/include /opt/local/include"
  458. for i in $dirs ; do
  459. if test -r $i/tcl.h; then
  460. AC_MSG_RESULT($i)
  461. TCLINCLUDE="$ISYSTEM$i"
  462. break
  463. fi
  464. done
  465. fi
  466. if test -z "$TCLINCLUDE"; then
  467. AC_MSG_RESULT(not found)
  468. fi
  469. else
  470. AC_MSG_RESULT($TCLINCLUDE)
  471. fi
  472. AC_MSG_CHECKING(for Tcl library)
  473. if test -z "$TCLLIB"; then
  474. dirs="/usr/local/lib /usr/lib /opt/local/lib"
  475. for i in $dirs ; do
  476. if test -r $i/libtcl.a; then
  477. AC_MSG_RESULT($i)
  478. TCLLIB="-L$i -ltcl"
  479. break
  480. fi
  481. done
  482. if test -z "$TCLLIB"; then
  483. AC_MSG_RESULT(not found)
  484. fi
  485. else
  486. AC_MSG_RESULT($TCLLIB)
  487. fi
  488. # Cygwin (Windows) needs the library for dynamic linking
  489. case $host in
  490. *-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";;
  491. *)TCLDYNAMICLINKING="";;
  492. esac
  493. fi
  494. AC_SUBST(TCLINCLUDE)
  495. AC_SUBST(TCLLIB)
  496. AC_SUBST(TCLDYNAMICLINKING)
  497. #----------------------------------------------------------------
  498. # Look for Python
  499. #----------------------------------------------------------------
  500. PYINCLUDE=
  501. PYLIB=
  502. PYPACKAGE=
  503. AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Disable Python])
  504. AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBIN="$withval"], [PYBIN=yes])
  505. # First, check for "--without-python" or "--with-python=no".
  506. if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then
  507. AC_MSG_NOTICE([Disabling Python])
  508. else
  509. # First figure out the name of the Python executable
  510. if test "x$PYBIN" = xyes; then
  511. 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)
  512. else
  513. PYTHON="$PYBIN"
  514. fi
  515. if test -n "$PYTHON"; then
  516. AC_MSG_CHECKING(for Python prefix)
  517. PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
  518. AC_MSG_RESULT($PYPREFIX)
  519. AC_MSG_CHECKING(for Python exec-prefix)
  520. PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
  521. AC_MSG_RESULT($PYEPREFIX)
  522. # Note: I could not think of a standard way to get the version string from different versions.
  523. # This trick pulls it out of the file location for a standard library file.
  524. AC_MSG_CHECKING(for Python version)
  525. # Need to do this hack since autoconf replaces __file__ with the name of the configure file
  526. filehack="file__"
  527. PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")`
  528. AC_MSG_RESULT($PYVERSION)
  529. # Find the directory for libraries this is necessary to deal with
  530. # platforms that can have apps built for multiple archs: e.g. x86_64
  531. AC_MSG_CHECKING(for Python lib dir)
  532. PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null`
  533. if test -z "$PYLIBDIR"; then
  534. # older versions don't have sys.lib so the best we can do is assume lib
  535. PYLIBDIR="lib"
  536. fi
  537. AC_MSG_RESULT($PYLIBDIR)
  538. # Set the include directory
  539. AC_MSG_CHECKING(for Python header files)
  540. if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
  541. PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config"
  542. fi
  543. if test -z "$PYINCLUDE"; then
  544. if test -r $PYPREFIX/include/Py/Python.h; then
  545. PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib"
  546. fi
  547. fi
  548. AC_MSG_RESULT($PYINCLUDE)
  549. # Set the library directory blindly. This probably won't work with older versions
  550. AC_MSG_CHECKING(for Python library)
  551. dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR"
  552. for i in $dirs; do
  553. if test -d $PYEPREFIX/$PYLIBDIR/$i; then
  554. PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
  555. break
  556. fi
  557. done
  558. if test -z "$PYLIB"; then
  559. AC_MSG_RESULT(Not found)
  560. else
  561. AC_MSG_RESULT($PYLIB)
  562. fi
  563. # Check for really old versions
  564. if test -r $PYLIB/libPython.a; then
  565. PYLINK="-lModules -lPython -lObjects -lParser"
  566. else
  567. PYLINK="-l$PYVERSION"
  568. fi
  569. fi
  570. # Cygwin (Windows) needs the library for dynamic linking
  571. case $host in
  572. *-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
  573. DEFS="-DUSE_DL_IMPORT $DEFS" PYINCLUDE="$PYINCLUDE"
  574. ;;
  575. *)PYTHONDYNAMICLINKING="";;
  576. esac
  577. fi
  578. AC_SUBST(PYINCLUDE)
  579. AC_SUBST(PYLIB)
  580. AC_SUBST(PYLINK)
  581. AC_SUBST(PYTHONDYNAMICLINKING)
  582. #----------------------------------------------------------------
  583. # Look for Perl5
  584. #----------------------------------------------------------------
  585. PERLBIN=
  586. AC_ARG_WITH(perl5, AS_HELP_STRING([--without-perl5], [Disable Perl5])
  587. AS_HELP_STRING([--with-perl5=path], [Set location of Perl5 executable]),[ PERLBIN="$withval"], [PERLBIN=yes])
  588. # First, check for "--without-perl5" or "--with-perl5=no".
  589. if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then
  590. AC_MSG_NOTICE([Disabling Perl5])
  591. PERL=
  592. else
  593. # First figure out what the name of Perl5 is
  594. if test "x$PERLBIN" = xyes; then
  595. AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
  596. else
  597. PERL="$PERLBIN"
  598. fi
  599. # 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:
  600. # perl -MExtUtils::Embed -e ccopts
  601. AC_MSG_CHECKING(for Perl5 header files)
  602. if test -n "$PERL"; then
  603. PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null`
  604. if test "$PERL5DIR" != ""; then
  605. dirs="$PERL5DIR $PERL5DIR/CORE"
  606. PERL5EXT=none
  607. for i in $dirs; do
  608. if test -r $i/perl.h; then
  609. AC_MSG_RESULT($i)
  610. PERL5EXT="$i"
  611. break;
  612. fi
  613. done
  614. if test "$PERL5EXT" = none; then
  615. PERL5EXT="$PERL5DIR/CORE"
  616. AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
  617. fi
  618. AC_MSG_CHECKING(for Perl5 library)
  619. PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_, "\n"') 2>/dev/null`
  620. if test "$PERL5LIB" = "" ; then
  621. AC_MSG_RESULT(not found)
  622. else
  623. AC_MSG_RESULT($PERL5LIB)
  624. fi
  625. AC_MSG_CHECKING(for Perl5 compiler options)
  626. PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-Wdeclaration-after-statement//" | sed "s/-I/$ISYSTEM/") 2>/dev/null`
  627. if test "$PERL5CCFLAGS" = "" ; then
  628. AC_MSG_RESULT(not found)
  629. else
  630. AC_MSG_RESULT($PERL5CCFLAGS)
  631. fi
  632. else
  633. AC_MSG_RESULT(unable to determine perl5 configuration)
  634. PERL5EXT=$PERL5DIR
  635. fi
  636. else
  637. AC_MSG_RESULT(could not figure out how to run perl5)
  638. fi
  639. # Cygwin (Windows) needs the library for dynamic linking
  640. case $host in
  641. *-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";;
  642. *)PERL5DYNAMICLINKING="";;
  643. esac
  644. fi
  645. AC_SUBST(PERL)
  646. AC_SUBST(PERL5EXT)
  647. AC_SUBST(PERL5DYNAMICLINKING)
  648. AC_SUBST(PERL5LIB)
  649. AC_SUBST(PERL5CCFLAGS)
  650. #----------------------------------------------------------------
  651. # Look for Octave
  652. #----------------------------------------------------------------
  653. OCTAVEBIN=
  654. OCTAVEDYNAMICLINKING=
  655. OCTAVE_SO=.oct
  656. AC_ARG_WITH(octave, AS_HELP_STRING([--without-octave], [Disable Octave])
  657. AS_HELP_STRING([--with-octave=path], [Set location of Octave executable]),[ OCTAVEBIN="$withval"], [OCTAVEBIN=yes])
  658. # First, check for "--without-octave" or "--with-octave=no".
  659. if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then
  660. AC_MSG_NOTICE([Disabling Octave])
  661. OCTAVE=
  662. fi
  663. # First figure out what the name of Octave is
  664. if test "x$OCTAVEBIN" = xyes; then
  665. AC_CHECK_PROGS(OCTAVE, octave)
  666. else
  667. OCTAVE="$OCTAVEBIN"
  668. fi
  669. AC_MSG_CHECKING(for Octave header files)
  670. if test -n "$OCTAVE"; then
  671. OCTAVEDIR="/usr/include"
  672. if test "$OCTAVEDIR" != ""; then
  673. dirs="$OCTAVEDIR"
  674. OCTAVEEXT=""
  675. for i in $dirs; do
  676. if test -r $i/octave/oct.h; then
  677. OCTAVEEXT="$i"
  678. break;
  679. fi
  680. if test -r $i/octave/octave/oct.h; then
  681. OCTAVEEXT="$i/octave"
  682. break;
  683. fi
  684. done
  685. if test "$OCTAVEEXT" = "" ; then
  686. AC_MSG_RESULT(not found)
  687. else
  688. AC_MSG_RESULT($OCTAVEEXT)
  689. fi
  690. AC_MSG_CHECKING(for Octave compiler options)
  691. OCTAVECCFLAGS=""
  692. AC_MSG_RESULT($OCTAVECCFLAGS)
  693. fi
  694. else
  695. AC_MSG_RESULT(could not figure out how to run octave)
  696. fi
  697. AC_SUBST(OCTAVE)
  698. AC_SUBST(OCTAVEEXT)
  699. AC_SUBST(OCTAVE_SO)
  700. AC_SUBST(OCTAVEDYNAMICLINKING)
  701. AC_SUBST(OCTAVELIB)
  702. AC_SUBST(OCTAVECCFLAGS)
  703. #----------------------------------------------------------------
  704. # Look for java
  705. #----------------------------------------------------------------
  706. AC_ARG_WITH(java, AS_HELP_STRING([--without-java], [Disable Java])
  707. AS_HELP_STRING([--with-java=path], [Set location of java executable]),[JAVABIN="$withval"], [JAVABIN=yes])
  708. AC_ARG_WITH(javac, [ --with-javac=path Set location of javac executable],[JAVACBIN="$withval"], [JAVACBIN=])
  709. # First, check for "--without-java" or "--with-java=no".
  710. if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then
  711. AC_MSG_NOTICE([Disabling Java])
  712. JAVA=
  713. else
  714. if test "x$JAVABIN" = xyes; then
  715. AC_CHECK_PROGS(JAVA, java kaffe guavac)
  716. else
  717. JAVA="$JAVABIN"
  718. fi
  719. if test -z "$JAVACBIN"; then
  720. AC_CHECK_PROGS(JAVAC, javac)
  721. else
  722. JAVAC="$JAVACBIN"
  723. fi
  724. AC_MSG_CHECKING(for java include file jni.h)
  725. AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=])
  726. if test -z "$JAVAINCDIR" ; then
  727. 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"
  728. # Add in default installation directory on Windows for Cygwin
  729. case $host in
  730. *-*-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";;
  731. *-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";;
  732. *);;
  733. esac
  734. fi
  735. JAVAINC=""
  736. for d in $JAVAINCDIR ; do
  737. if test -r "$d/jni.h" ; then
  738. AC_MSG_RESULT($d)
  739. JAVAINCDIR=$d
  740. JAVAINC=-I\"$d\"
  741. break
  742. fi
  743. done
  744. if test "$JAVAINC" = "" ; then
  745. AC_MSG_RESULT(not found)
  746. else
  747. # now look for <arch>/jni_md.h
  748. AC_MSG_CHECKING(for java include file jni_md.h)
  749. JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print`
  750. if test "$JAVAMDDIR" = "" ; then
  751. AC_MSG_RESULT(not found)
  752. else
  753. JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1`
  754. JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\""
  755. AC_MSG_RESULT($JAVAMDDIR)
  756. fi
  757. fi
  758. # java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable
  759. case $host in
  760. *-*-cygwin* | *-*-mingw*)
  761. if test "$GCC" = yes; then
  762. JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
  763. JAVACFLAGS="-mno-cygwin -mthreads"
  764. else
  765. JAVADYNAMICLINKING=""
  766. JAVACFLAGS=""
  767. fi ;;
  768. *-*-darwin*)
  769. JAVADYNAMICLINKING="-dynamiclib -framework JavaVM"
  770. JAVACFLAGS=""
  771. ;;
  772. *)
  773. JAVADYNAMICLINKING=""
  774. JAVACFLAGS=""
  775. ;;
  776. esac
  777. # Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
  778. case $host in
  779. *-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";;
  780. *)JAVALIBRARYPREFIX="lib";;
  781. esac
  782. # Java on Mac OS X tweaks
  783. case $host in
  784. *-*-darwin*)
  785. JAVASO=".jnilib"
  786. JAVALDSHARED='$(CC)'
  787. JAVACXXSHARED='$(CXX)'
  788. ;;
  789. *)
  790. JAVASO=$SO
  791. JAVALDSHARED='$(LDSHARED)'
  792. JAVACXXSHARED='$(CXXSHARED)'
  793. ;;
  794. esac
  795. fi
  796. AC_SUBST(JAVA)
  797. AC_SUBST(JAVAC)
  798. AC_SUBST(JAVAINC)
  799. AC_SUBST(JAVADYNAMICLINKING)
  800. AC_SUBST(JAVALIBRARYPREFIX)
  801. AC_SUBST(JAVASO)
  802. AC_SUBST(JAVALDSHARED)
  803. AC_SUBST(JAVACXXSHARED)
  804. AC_SUBST(JAVACFLAGS)
  805. #----------------------------------------------------------------
  806. # Look for gcj
  807. #----------------------------------------------------------------
  808. AC_ARG_WITH(gcj, AS_HELP_STRING([--without-gcj], [Disable GCJ])
  809. AS_HELP_STRING([--with-gcj=path], [Set location of gcj executable]),[GCJBIN="$withval"], [GCJBIN=yes])
  810. AC_ARG_WITH(gcjh, [ --with-gcjh=path Set location of gcjh executable],[GCJHBIN="$withval"], [GCJHBIN=])
  811. # First, check for "--without-gcj" or "--with-gcj=no".
  812. if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then
  813. AC_MSG_NOTICE([Disabling GCJ])
  814. else
  815. if test "x$GCJBIN" = xyes; then
  816. AC_CHECK_PROGS(GCJ, gcj)
  817. else
  818. GCJ="$GCJBIN"
  819. fi
  820. if test -z "$GCJCBIN"; then
  821. AC_CHECK_PROGS(GCJH, gcjh)
  822. else
  823. GCJH="$GCJHBIN"
  824. fi
  825. fi
  826. AC_SUBST(GCJ)
  827. AC_SUBST(GCJH)
  828. #----------------------------------------------------------------
  829. # Look for Guile
  830. #----------------------------------------------------------------
  831. GUILEPACKAGE=
  832. GUILEINCLUDE=
  833. GUILE=
  834. GUILELIB=
  835. GUILELINK=
  836. GUILEPKGDATADIR=
  837. AC_ARG_WITH(guile-config,AS_HELP_STRING([--without-guile], [Disable Guile])
  838. AS_HELP_STRING([--with-guile-config=path], [Set location of guile-config]),[ GUILE_CONFIG="$withval"], [GUILE_CONFIG=])
  839. AC_ARG_WITH(guilepackage, AS_HELP_STRING([--with-guile-prefix=path], [Set location of Guile tree]),[
  840. GUILEPACKAGE="$withval"])
  841. AC_ARG_WITH(guile,[ --with-guile=path Set location of Guile executable],[
  842. GUILE="$withval"], [GUILE=yes])
  843. AC_ARG_WITH(guileincl,[ --with-guileincl=path Set location of Guile include directory],[
  844. GUILEINCLUDE="$withval"])
  845. AC_ARG_WITH(guilelib,[ --with-guilelib=path Set location of Guile library directory],[
  846. GUILELIB="$withval"])
  847. # First, check for "--without-guile" or "--with-guile=no".
  848. if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then
  849. AC_MSG_NOTICE([Disabling Guile])
  850. else
  851. if test -z "$GUILE_CONFIG" ; then
  852. AC_PATH_PROG(GUILE_CONFIG, guile-config)
  853. fi
  854. if test -n "$GUILE_CONFIG" ; then
  855. GUILEPACKAGE="`$GUILE_CONFIG info prefix`"
  856. GUILEINCLUDE="`$GUILE_CONFIG info includedir`"
  857. GUILELIB="`$GUILE_CONFIG info libdir`"
  858. GUILE="`$GUILE_CONFIG info bindir`/guile"
  859. GUILELINK="`$GUILE_CONFIG link`"
  860. GUILEPKGDATADIR="`$GUILE_CONFIG info pkgdatadir`"
  861. fi
  862. if test -z "$GUILE" -o "x$GUILE" = xyes; then
  863. if test -n "$GUILEPACKAGE"; then
  864. GUILE="$GUILEPACKAGE/bin/guile"
  865. else
  866. GUILE=
  867. fi
  868. fi
  869. if test -z "$GUILEINCLUDE"; then
  870. if test -n "$GUILEPACKAGE"; then
  871. GUILEINCLUDE="$GUILEPACKAGE/include"
  872. fi
  873. fi
  874. if test -z "$GUILELIB"; then
  875. if test -n "$GUILEPACKAGE"; then
  876. GUILELIB="$GUILEPACKAGE/lib"
  877. fi
  878. fi
  879. AC_MSG_CHECKING(for Guile header files)
  880. dirs="$GUILEINCLUDE"
  881. for i in $dirs ; do
  882. if test -r $i/guile/gh.h; then
  883. AC_MSG_RESULT($i)
  884. GUILEINCLUDE="$ISYSTEM$i"
  885. break
  886. fi
  887. done
  888. if test -z "$GUILEINCLUDE"; then
  889. AC_MSG_RESULT(not found)
  890. fi
  891. AC_MSG_CHECKING(for Guile library)
  892. dirs="$GUILELIB"
  893. for i in $dirs ; do
  894. if test -r $i/libguile.so; then
  895. AC_MSG_RESULT($i)
  896. GUILELIB="$i"
  897. break
  898. fi
  899. done
  900. if test -z "$GUILELIB"; then
  901. AC_MSG_RESULT(not found)
  902. fi
  903. if test -z "$GUILELINK"; then
  904. GUILELINK="-L$GUILELIB -lguile"
  905. fi
  906. guilesafe_CFLAGS=$CFLAGS
  907. guilesafe_LIBS=$LIBS
  908. # Filter out "-ansi -pedantic" because Guile header files will not compile with these flags.
  909. # (The flags -ansi -pedantic are automatically added by ac_compile_warnings.m4)
  910. CFLAGS="`echo $CFLAGS | sed 's/-ansi//g;s/-pedantic//g;'` $GUILEINCLUDE"
  911. LIBS="$LIBS $GUILELINK"
  912. AC_MSG_CHECKING(whether Guile's gh_ API works)
  913. AC_LINK_IFELSE([#include <guile/gh.h>
  914. int main() { SCM s; return gh_scm2int(s); }], GUILE_GH_INTERFACE=1, )
  915. if test -n "$GUILE_GH_INTERFACE" ; then
  916. AC_MSG_RESULT(yes)
  917. else
  918. AC_MSG_RESULT(no)
  919. fi
  920. AC_MSG_CHECKING(whether Guile's SCM_ API works)
  921. AC_LINK_IFELSE([#include <libguile.h>
  922. int main() { SCM s; scm_slot_exists_p(SCM_BOOL_F, SCM_BOOL_F); return SCM_STRING_LENGTH(s); }], GUILE_SCM_INTERFACE=1, )
  923. if test -n "$GUILE_SCM_INTERFACE" ; then
  924. AC_MSG_RESULT(yes)
  925. else
  926. AC_MSG_RESULT(no)
  927. fi
  928. CFLAGS=$guilesafe_CFLAGS
  929. LIBS=$guilesafe_LIBS
  930. fi
  931. AC_SUBST(GUILE)
  932. AC_SUBST(GUILEINCLUDE)
  933. AC_SUBST(GUILELIB)
  934. AC_SUBST(GUILELINK)
  935. AC_SUBST(GUILE_GH_INTERFACE)
  936. AC_SUBST(GUILE_SCM_INTERFACE)
  937. #----------------------------------------------------------------
  938. # Look for MzScheme
  939. #----------------------------------------------------------------
  940. AC_ARG_WITH(mzscheme, AS_HELP_STRING([--without-mzscheme], [Disable MzScheme])
  941. AS_HELP_STRING([--with-mzscheme=path], [Set location of MzScheme executable]),[ MZSCHEMEBIN="$withval"], [MZSCHEMEBIN=yes])
  942. AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's mzc]), [ MZCBIN="$withval"], [MZCBIN=])
  943. # First, check for "--without-mzscheme" or "--with-mzscheme=no".
  944. if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then
  945. AC_MSG_NOTICE([Disabling MzScheme])
  946. MZC=
  947. else
  948. if test "x$MZSCHEMEBIN" = xyes; then
  949. AC_PATH_PROG(MZSCHEME, mzscheme)
  950. else
  951. MZSCHEME="$MZSCHEMEBIN"
  952. fi
  953. if test -z "$MZCBIN"; then
  954. AC_PATH_PROG(MZC, mzc)
  955. fi
  956. if test -n "$MZSCHEME"; then
  957. AC_MSG_CHECKING(for MzScheme dynext object)
  958. 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) (display " ")) (expand-for-link-variant (current-standard-link-libraries)))))'`
  959. AC_MSG_RESULT($MZDYNOBJ)
  960. fi
  961. fi
  962. AC_SUBST(MZDYNOBJ)
  963. #----------------------------------------------------------------
  964. # Look for Ruby
  965. #----------------------------------------------------------------
  966. RUBYBIN=
  967. AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby])
  968. AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes])
  969. # First, check for "--without-ruby" or "--with-ruby=no".
  970. if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then
  971. AC_MSG_NOTICE([Disabling Ruby])
  972. RUBY=
  973. else
  974. # First figure out what the name of Ruby is
  975. if test "x$RUBYBIN" = xyes; then
  976. AC_CHECK_PROGS(RUBY, ruby)
  977. else
  978. RUBY="$RUBYBIN"
  979. fi
  980. AC_MSG_CHECKING(for Ruby header files)
  981. if test -n "$RUBY"; then
  982. RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
  983. if test "$RUBYDIR" != ""; then
  984. dirs="$RUBYDIR"
  985. RUBYINCLUDE=none
  986. for i in $dirs; do
  987. if test -r $i/ruby.h; then
  988. AC_MSG_RESULT($i)
  989. RUBYINCLUDE="-I$i"
  990. break;
  991. fi
  992. done
  993. if test "$RUBYINCLUDE" = none; then
  994. RUBYINCLUDE="-I$RUBYDIR"
  995. AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
  996. fi
  997. # Find library and path for linking.
  998. AC_MSG_CHECKING(for Ruby library)
  999. RUBYLIB=""
  1000. rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
  1001. rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
  1002. dirs="$dirs $rb_libdir $rb_bindir"
  1003. rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
  1004. RUBYLINK=`($RUBY -rrbconfig -e '
  1005. c = Config::CONFIG
  1006. if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
  1007. if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
  1008. link = c[["LIBRUBYARG_STATIC"]]
  1009. else
  1010. link = c[["LIBRUBYARG_SHARED"]]
  1011. end
  1012. else # 1.6.x
  1013. link = "-l" + c[["RUBY_INSTALL_NAME"]]
  1014. end
  1015. # Get the target Ruby was built for
  1016. target = c[["target"]]
  1017. if target == "i386-pc-mswin32"
  1018. # Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby*
  1019. ext = File.extname(link)
  1020. # Get index that counts backwards from end of string
  1021. index = -1 - ext.size
  1022. # Strip off the extension
  1023. link = link.slice(0..index)
  1024. puts "-l#{link}"
  1025. else
  1026. puts link
  1027. end') 2>/dev/null`
  1028. if test "$rb_libruby" != ""; then
  1029. for i in $dirs; do
  1030. if (test -r $i/$rb_libruby;) then
  1031. RUBYLIB="$i"
  1032. break;
  1033. fi
  1034. done
  1035. fi
  1036. if test "$RUBYLIB" = ""; then
  1037. RUBYLIB="$RUBYDIR"
  1038. AC_MSG_RESULT(not found... using $RUBYDIR)
  1039. else
  1040. AC_MSG_RESULT($RUBYLINK in $RUBYLIB)
  1041. fi
  1042. else
  1043. AC_MSG_RESULT(unable to determine ruby configuration)
  1044. RUBYINCLUDE="-I$RUBYDIR"
  1045. RUBYLIB="$RUBYDIR"
  1046. fi
  1047. case $host in
  1048. *-*-mingw*) ;; # do nothing, the default windows libraries are already included
  1049. *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";;
  1050. esac
  1051. RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
  1052. else
  1053. AC_MSG_RESULT(could not figure out how to run ruby)
  1054. RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch"
  1055. RUBYLIB="/usr/local/lib/ruby/1.4/arch"
  1056. RUBYLINK="-lruby -lm"
  1057. fi
  1058. case $host in
  1059. *-*-cygwin* | *-*-mingw*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";;
  1060. *) RUBYDYNAMICLINKING="";;
  1061. esac
  1062. fi
  1063. AC_SUBST(RUBYINCLUDE)
  1064. AC_SUBST(RUBYLIB)
  1065. AC_SUBST(RUBYLINK)
  1066. AC_SUBST(RUBYCCDLFLAGS)
  1067. AC_SUBST(RUBYDYNAMICLINKING)
  1068. #-------------------------------------------------------------------------
  1069. # Look for PHP
  1070. #-------------------------------------------------------------------------
  1071. PHP4BIN=
  1072. AC_ARG_WITH(php4, AS_HELP_STRING([--without-php4], [Disable PHP])
  1073. AS_HELP_STRING([--with-php4=path], [Set location of PHP executable]),[ PHP4BIN="$withval"], [PHP4BIN=yes])
  1074. # First, check for "--without-php4" or "--with-php4=no".
  1075. if test x"${PHP4BIN}" = xno -o x"${with_alllang}" = xno ; then
  1076. AC_MSG_NOTICE([Disabling PHP])
  1077. PHP4=
  1078. else
  1079. if test "x$PHP4BIN" = xyes; then
  1080. AC_CHECK_PROGS(PHP4, php5 php php4)
  1081. else
  1082. PHP4=$PHP4BIN
  1083. fi
  1084. AC_MSG_CHECKING(for PHP header files)
  1085. dnl /usr/bin/php5 -> /usr/bin/php-config5
  1086. case $PHP4 in
  1087. *[[45]])
  1088. PHP4CONFIG=`echo "$PHP4"|sed 's/\([[45]]\)$/-config\1/'` ;;
  1089. *)
  1090. PHP4CONFIG=$PHP4-config ;;
  1091. esac
  1092. PHP4INC=`$PHP4CONFIG --includes 2>/dev/null`
  1093. if test -n "$PHP4INC"; then
  1094. AC_MSG_RESULT($PHP4INC)
  1095. else
  1096. AC_MSG_RESULT(not found)
  1097. fi
  1098. fi
  1099. AC_SUBST(PHP4)
  1100. AC_SUBST(PHP4INC)
  1101. #----------------------------------------------------------------
  1102. # Look for ocaml
  1103. #----------------------------------------------------------------
  1104. AC_ARG_WITH(ocaml, AS_HELP_STRING([--without-ocaml], [Disable OCaml])
  1105. AS_HELP_STRING([--with-ocaml=path], [Set location of ocaml executable]),[ OCAMLBIN="$withval"], [OCAMLBIN=yes])
  1106. AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable],[ OCAMLC="$withval"], [OCAMLC=])
  1107. AC_ARG_WITH(ocamldlgen,[ --with-ocamldlgen=path Set location of ocamldlgen],[ OCAMLDLGEN="$withval" ], [OCAMLDLGEN=])
  1108. AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCAMLFIND="$withval"],[OCAMLFIND=])
  1109. AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=])
  1110. # First, check for "--without-ocaml" or "--with-ocaml=no".
  1111. if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then
  1112. AC_MSG_NOTICE([Disabling OCaml])
  1113. OCAMLBIN=
  1114. else
  1115. AC_MSG_CHECKING(for Ocaml DL load generator)
  1116. if test -z "$OCAMLDLGEN"; then
  1117. AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen, :)
  1118. else
  1119. OCAMLDLGEN="$OCAMLDLGEN"
  1120. fi
  1121. AC_MSG_CHECKING(for Ocaml package tool)
  1122. if test -z "$OCAMLFIND"; then
  1123. AC_CHECK_PROGS(OCAMLFIND, ocamlfind, :)
  1124. else
  1125. OCAMLFIND="$OCAMLFIND"
  1126. fi
  1127. AC_MSG_CHECKING(for Ocaml compiler)
  1128. if test -z "$OCAMLC"; then
  1129. AC_CHECK_PROGS(OCAMLC, ocamlc, :)
  1130. else
  1131. OCAMLC="$OCAMLC"
  1132. fi
  1133. AC_MSG_CHECKING(for Ocaml interpreter)
  1134. if test "x$OCAMLBIN" = xyes; then
  1135. AC_CHECK_PROGS(OCAMLBIN, ocaml, :)
  1136. else
  1137. OCAMLBIN="$OCAMLBIN"
  1138. fi
  1139. AC_MSG_CHECKING(for Ocaml toplevel creator)
  1140. if test -z "$OCAMLMKTOP"; then
  1141. AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :)
  1142. else
  1143. OCAMLMKTOP="$OCAMLMKTOP"
  1144. fi
  1145. OCAMLLOC=loc
  1146. if test "$OCAMLC" != ":" ; then
  1147. AC_MSG_CHECKING(for Ocaml header files)
  1148. dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml"
  1149. dir="`$OCAMLC -where 2>/dev/null`"
  1150. if test "$dir"; then
  1151. dirs="$dir/caml $dirs"
  1152. fi
  1153. for i in $dirs; do
  1154. if test -r $i/mlvalues.h; then
  1155. AC_MSG_RESULT($i)
  1156. OCAMLEXT="$i"
  1157. OCAMLINC="-I$OCAMLEXT"
  1158. break;
  1159. fi
  1160. done
  1161. if test -z "$OCAMLINC"; then
  1162. AC_MSG_RESULT(not found)
  1163. fi
  1164. AC_MSG_CHECKING(for Ocaml version 3.08.2 or higher)
  1165. OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'`
  1166. AC_COMPARE_VERSION([$OCAMLVER],[3.08.2],[:],[:],[OCAMLLOC=_loc])
  1167. AC_MSG_RESULT($OCAMLVER)
  1168. fi
  1169. fi # Disabling ocaml
  1170. export OCAMLLOC
  1171. export OCAMLVER
  1172. export OCAMLINC
  1173. export OCAMLBIN
  1174. export OCAMLC
  1175. export OCAMLDLGEN
  1176. export OCAMLFIND
  1177. export OCAMLMKTOP
  1178. AC_SUBST(OCAMLLOC)
  1179. AC_SUBST(OCAMLVER)
  1180. AC_SUBST(OCAMLINC)
  1181. AC_SUBST(OCAMLBIN)
  1182. AC_SUBST(OCAMLC)
  1183. AC_SUBST(OCAMLDLGEN)
  1184. AC_SUBST(OCAMLFIND)
  1185. AC_SUBST(OCAMLMKTOP)
  1186. #----------------------------------------------------------------
  1187. # Look for Pike
  1188. #----------------------------------------------------------------
  1189. # Identify the name of the Pike executable
  1190. # Priority: configure option, automatic search
  1191. PIKEBIN=
  1192. AC_ARG_WITH(pike, AS_HELP_STRING([--without-pike], [Disable Pike])
  1193. AS_HELP_STRING([--with-pike=path], [Set location of Pike executable]),[PIKEBIN="$withval"], [PIKEBIN=yes])
  1194. # First, check for "--without-pike" or "--with-pike=no".
  1195. if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then
  1196. AC_MSG_NOTICE([Disabling Pike])
  1197. PIKEBIN=
  1198. else
  1199. if test "x$PIKEBIN" = xyes; then
  1200. AC_CHECK_PROGS(PIKE, pike pike7.6 pike7.4 pike7.2)
  1201. else
  1202. PIKE="$PIKEBIN"
  1203. fi
  1204. # Check for pike-config
  1205. # Priority: configure option, guessed from $PIKE, search from list
  1206. AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path],
  1207. [Set location of pike-config script]),
  1208. [PIKECONFIG="$withval"], [PIKECONFIG=""])
  1209. if test -z "$PIKECONFIG" -a -n "$PIKE"; then
  1210. AC_CHECK_PROGS(PIKECONFIG, $PIKE-config pike-config \
  1211. pike7.6-config pike7.4-config pike7.2-config)
  1212. fi
  1213. # Check for a --with-pikeincl option to configure
  1214. # Priority: configure option, info from $PIKECONFIG, guessed by pike script
  1215. AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path],
  1216. [Set location of Pike include directory]),
  1217. [PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=])
  1218. if test -n "$PIKE"; then
  1219. AC_MSG_CHECKING([for Pike header files])
  1220. if test -z "$PIKEINCLUDE" -a -n "$PIKECONFIG"; then
  1221. PIKEINCLUDE=`$PIKECONFIG --cflags`
  1222. fi
  1223. if test -z "$PIKEINCLUDE" -a -n "$PIKE"; then
  1224. PIKEPATH=`which $PIKE`
  1225. PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH`
  1226. PIKEINCLUDE="-I$PIKEINCLUDE"
  1227. fi
  1228. if test -z "$PIKEINCLUDE"; then
  1229. AC_MSG_RESULT(not found)
  1230. else
  1231. AC_MSG_RESULT($PIKEINCLUDE)
  1232. fi
  1233. fi
  1234. fi
  1235. AC_SUBST(PIKEINCLUDE)
  1236. AC_SUBST(PIKECCDLFLAGS) dnl XXX: where is this used/defined?
  1237. AC_SUBST(PIKEDYNAMICLINKING) dnl XXX: where is this used/defined?
  1238. #----------------------------------------------------------------
  1239. # Look for CHICKEN
  1240. #----------------------------------------------------------------
  1241. CHICKEN=
  1242. CHICKEN_CONFIG=
  1243. CHICKENHOME=
  1244. CHICKENOPTS=
  1245. CHICKENLIB=
  1246. AC_ARG_WITH(chicken, AS_HELP_STRING([--without-chicken], [Disable CHICKEN])
  1247. AS_HELP_STRING([--with-chicken=path], [Set location of CHICKEN executable]),[ CHICKENBIN="$withval"], [CHICKENBIN=yes])
  1248. # First, check for "--without-chicken" or "--with-chicken=no".
  1249. if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then
  1250. AC_MSG_NOTICE([Disabling CHICKEN])
  1251. else
  1252. if test "x$CHICKENBIN" = xyes; then
  1253. AC_CHECK_PROGS(CHICKEN, chicken)
  1254. else
  1255. CHICKEN="$CHICKENBIN"
  1256. fi
  1257. AC_ARG_WITH(chickencsc,[ --with-chickencsc=path Set location of csc executable],[ CHICKEN_CSC="$withval"], [CHICKEN_CSC=])
  1258. if test -z "$CHICKEN_CSC"; then
  1259. AC_CHECK_PROGS(CHICKEN_CSC, csc)
  1260. # Both the Microsoft C# compiler and chicken have an executable called csc, so check that this csc is really the chicken one
  1261. if test -n "$CHICKEN_CSC" ; then
  1262. AC_MSG_CHECKING(whether csc is the chicken compiler)
  1263. $CHICKEN_CSC -version 2>/dev/null | grep "chicken" > /dev/null || CHICKEN_CSC=""
  1264. if test -z "$CHICKEN_CSC"; then
  1265. AC_MSG_RESULT(no)
  1266. else
  1267. AC_MSG_RESULT(yes)
  1268. fi
  1269. fi
  1270. fi
  1271. AC_ARG_WITH(chickencsi,[ --with-chickencsi=path Set location of csi executable],[ CHICKEN_CSI="$withval"], [CHICKEN_CSI=])
  1272. if test -z "$CHICKEN_CSI"; then
  1273. AC_CHECK_PROGS(CHICKEN_CSI, csi)
  1274. fi
  1275. if test -n "$CHICKEN_CSC" ; then
  1276. AC_ARG_WITH(chickenopts,[ --with-chickenopts=args Set compiler options for static CHICKEN generated code],[
  1277. CHICKENOPTS="$withval"], [CHICKENOPTS=])
  1278. AC_ARG_WITH(chickensharedlib,[ --with-chickensharedlib=args Set linker options for shared CHICKEN generated code],[
  1279. CHICKENSHAREDLIB="$withval"], [CHICKENSHAREDLIB=])
  1280. AC_ARG_WITH(chickenlib,[ --with-chickenlib=args Set linker options for static CHICKEN generated code],[
  1281. CHICKENLIB="$withval"], [CHICKENLIB=])
  1282. AC_MSG_CHECKING(for compiler options for static CHICKEN generated code)
  1283. if test -z "$CHICKENOPTS"; then
  1284. CHICKENOPTS="`$CHICKEN_CSC -cflags`"
  1285. else
  1286. CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS"
  1287. fi
  1288. if test -z "$CHICKENOPTS"; then
  1289. AC_MSG_RESULT(not found)
  1290. else
  1291. AC_MSG_RESULT($CHICKENOPTS)
  1292. fi
  1293. AC_MSG_CHECKING(for linker options for shared CHICKEN generated code)
  1294. if test -z "$CHICKENSHAREDLIB"; then
  1295. CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`"
  1296. else
  1297. CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB"
  1298. fi
  1299. if test -z "$CHICKENSHAREDLIB"; then
  1300. AC_MSG_RESULT(not found)
  1301. else
  1302. AC_MSG_RESULT($CHICKENSHAREDLIB)
  1303. fi
  1304. AC_MSG_CHECKING(for linker options for static CHICKEN generated code)
  1305. if test -z "$CHICKENLIB"; then
  1306. CHICKENLIB="`$CHICKEN_CSC -libs`"
  1307. else
  1308. CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB"
  1309. fi
  1310. if test -z "$CHICKENLIB"; then
  1311. AC_MSG_RESULT(not found)
  1312. else
  1313. AC_MSG_RESULT($CHICKENLIB)
  1314. fi
  1315. fi # have CHICKEN_CONFIG
  1316. fi # Check for --without-chicken
  1317. AC_SUBST(CHICKEN)
  1318. AC_SUBST(CHICKEN_CSC)
  1319. AC_SUBST(CHICKEN_CSI)
  1320. AC_SUBST(CHICKENOPTS)
  1321. AC_SUBST(CHICKENLIB)
  1322. AC_SUBST(CHICKENSHAREDLIB)
  1323. #----------------------------------------------------------------
  1324. # Look for C#
  1325. #----------------------------------------------------------------
  1326. AC_ARG_WITH(csharp, AS_HELP_STRING([--without-csharp], [Disable CSharp]), [with_csharp="$withval"], [with_csharp=yes])
  1327. AC_ARG_WITH(cil-interpreter, [ --with-cil-interpreter=path Set location of CIL interpreter for CSharp],[CSHARPBIN="$withval"], [CSHARPBIN=])
  1328. AC_ARG_WITH(csharp-compiler, [ --with-csharp-compiler=path Set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=])
  1329. # First, check for "--without-csharp" or "--with-csharp=no".
  1330. if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then
  1331. AC_MSG_NOTICE([Disabling CSharp])
  1332. CSHARPCOMPILER=
  1333. else
  1334. if test -z "$CSHARPCOMPILERBIN" ; then
  1335. case $host in
  1336. *-*-cygwin* | *-*-mingw*)
  1337. # prefer Mono gmcs (.NET 2.0) over mcs (.NET 1.1) - note mcs-1.2.3 has major pinvoke bug
  1338. AC_CHECK_PROGS(CSHARPCOMPILER, csc gmcs mcs cscc)
  1339. if test -n "$CSHARPCOMPILER" && test "$CSHARPCOMPILER" = "csc" ; then
  1340. AC_MSG_CHECKING(whether csc is the Microsoft CSharp compiler)
  1341. csc 2>/dev/null | grep "C#" > /dev/null || CSHARPCOMPILER=""
  1342. if test -z "$CSHARPCOMPILER" ; then
  1343. AC_MSG_RESULT(no)
  1344. AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc)
  1345. else
  1346. AC_MSG_RESULT(yes)
  1347. fi
  1348. fi
  1349. ;;
  1350. *)AC_CHECK_PROGS(CSHARPCOMPILER, gmcs mcs cscc);;
  1351. esac
  1352. else
  1353. CSHARPCOMPILER="$CSHARPCOMPILERBIN"
  1354. fi
  1355. CSHARPPATHSEPARATOR="/"
  1356. CSHARPCYGPATH_W=echo
  1357. if test -z "$CSHARPBIN" ; then
  1358. CSHARPCILINTERPRETER=""
  1359. if test "cscc" = "$CSHARPCOMPILER" ; then
  1360. AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun)
  1361. else
  1362. if test "mcs" = "$CSHARPCOMPILER"; then
  1363. # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version'
  1364. # The Mono compiler should emit: Mono C# compiler version a.b.c.d
  1365. csharp_version_raw=`(mcs --version) 2>/dev/null`
  1366. csharp_version_searched=`(mcs --version | sed -e "/C#/b" -e "/Mono/b" -e d) 2>/dev/null` # return string if contains 'Mono' or 'C#'
  1367. CSHARPCOMPILER="";
  1368. if test -n "$csharp_version_raw" ; then
  1369. if test "$csharp_version_raw" = "$csharp_version_searched" ; then
  1370. CSHARPCOMPILER="mcs"
  1371. fi
  1372. fi
  1373. if test "mcs" != "$CSHARPCOMPILER" ; then
  1374. echo "mcs is not a working Mono C# compiler"
  1375. fi
  1376. fi
  1377. if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then
  1378. AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT
  1379. else
  1380. if test "csc" = "$CSHARPCOMPILER"; then
  1381. CSHARPPATHSEPARATOR="\\\\"
  1382. CSHARPCYGPATH_W='cygpath -w'
  1383. fi
  1384. fi
  1385. fi
  1386. else
  1387. CSHARPCILINTERPRETER="$CSHARPBIN"
  1388. fi
  1389. # Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable
  1390. case $host in
  1391. *-*-cygwin* | *-*-mingw*)
  1392. if test "$GCC" = yes; then
  1393. CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias"
  1394. CSHARPCFLAGS="-mno-cygwin -mthreads"
  1395. else
  1396. CSHARPDYNAMICLINKING=""
  1397. CSHARPCFLAGS=""
  1398. fi ;;
  1399. *)
  1400. CSHARPDYNAMICLINKING=""
  1401. CSHARPCFLAGS=""
  1402. ;;
  1403. esac
  1404. # CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls
  1405. case $host in
  1406. *-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";;
  1407. *)CSHARPLIBRARYPREFIX="lib";;
  1408. esac
  1409. # C#/Mono on Mac OS X tweaks
  1410. case $host in
  1411. *-*-darwin*)
  1412. CSHARPSO=".so"
  1413. ;;
  1414. *)
  1415. CSHARPSO=$SO
  1416. ;;
  1417. esac
  1418. fi
  1419. AC_SUBST(CSHARPCILINTERPRETER)
  1420. AC_SUBST(CSHARPPATHSEPARATOR)
  1421. AC_SUBST(CSHARPCYGPATH_W)
  1422. AC_SUBST(CSHARPCOMPILER)
  1423. AC_SUBST(CSHARPDYNAMICLINKING)
  1424. AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?
  1425. AC_SUBST(CSHARPCFLAGS)
  1426. AC_SUBST(CSHARPSO)
  1427. #----------------------------------------------------------------
  1428. # Look for Lua
  1429. #----------------------------------------------------------------
  1430. LUABIN=
  1431. LUAINCLUDE=
  1432. LUALIB=
  1433. LUADYNAMICLOADLIB=
  1434. LUAFLAGS=
  1435. LUALINK=
  1436. # note: if LUABIN is empty then lua tests will not be done
  1437. # LUABIN will be cleared if certain dependencies cannot be found
  1438. AC_ARG_WITH(lua, AS_HELP_STRING([--without-lua], [Disable Lua])
  1439. AS_HELP_STRING([--with-lua=path], [Set location of Lua executable]),[ LUABIN="$withval"], [LUABIN=yes])
  1440. AC_ARG_WITH(luaincl,[ --with-luaincl=path Set location of Lua include directory],[
  1441. LUAINCLUDE="$withval"], [LUAINCLUDE=])
  1442. AC_ARG_WITH(lualib,[ --with-lualib=path Set location of Lua library directory],[
  1443. LUALIB="$withval"], [LUALIB=])
  1444. # First, check for "--without-lua" or "--with-lua=no".
  1445. if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then
  1446. AC_MSG_NOTICE([Disabling Lua])
  1447. else
  1448. # can we find lua?
  1449. if test "x$LUABIN" = xyes; then
  1450. AC_PATH_PROG(LUABIN, lua)
  1451. fi
  1452. # check version: we need Lua 5.x
  1453. if test "$LUABIN"; then
  1454. AC_MSG_CHECKING(Lua version)
  1455. # if version 5.x
  1456. LUAV5=`$LUABIN -e 'if string.sub(_VERSION,5,5)=="5" then print "1" end'`
  1457. # if not version 5.0
  1458. LUAV51=`$LUABIN -e 'if string.sub(_VERSION,5,7)~="5.0" then print "1" end'`
  1459. if test -z "$LUAV5"; then
  1460. AC_MSG_WARN(Not Lua 5.x, SWIG does not support this version of Lua)
  1461. LUABIN=""
  1462. elif test -z "$LUAV51"; then
  1463. AC_MSG_RESULT(Lua 5.0.x)
  1464. else
  1465. AC_MSG_RESULT(Lua 5.1 or later)
  1466. fi
  1467. fi
  1468. if test "$LUABIN"; then
  1469. AC_MSG_CHECKING(whether Lua dynamic loading is enabled)
  1470. # using Lua to check Lua
  1471. # lua 5.0 & 5.1 have different fn names
  1472. if test -z "$LUAV51"; then
  1473. LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=loadlib("no_such_lib","") if c~="absent" then print "1" end'`
  1474. else
  1475. LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'`
  1476. fi
  1477. if test -z "$LUADYNAMICLOADLIB"; then
  1478. AC_MSG_RESULT(no)
  1479. else
  1480. AC_MSG_RESULT(yes)
  1481. fi
  1482. fi
  1483. # look for the header files & set LUAFLAGS accordingly
  1484. # will clear LUABIN if not present
  1485. if test -n "$LUAINCLUDE"; then
  1486. AC_CHECK_FILE($LUAINCLUDE/lua.h,[LUAFLAGS="$ISYSTEM$LUAINCLUDE"],[LUABIN=])
  1487. else
  1488. LUA_OK="1"
  1489. AC_CHECK_HEADER(lua.h,[LUAFLAGS=""],[LUA_OK=""])
  1490. # if we didn't get it, going to have to look elsewhere (the hard way)
  1491. if test -z "$LUA_OK"; then
  1492. AC_MSG_CHECKING(for lua.h in other locations)
  1493. # note: ubuntu seems to like /usr/include/lua5.1/lua.h
  1494. dirs="/usr/include/lua* /usr/local/include"
  1495. for i in $dirs; do
  1496. #echo "$i"
  1497. if test -r $i/lua.h; then
  1498. AC_MSG_RESULT($i/lua.h)
  1499. LUAFLAGS="$ISYSTEM$i"
  1500. break;
  1501. fi
  1502. done
  1503. if test -z "$LUAFLAGS"; then
  1504. AC_MSG_RESULT(not found)
  1505. LUABIN="" # clear the bin
  1506. fi
  1507. fi
  1508. fi
  1509. # look for the library files & set LUALINK accordingly
  1510. # will clear LUABIN if not present
  1511. lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving
  1512. if test -n "$LUALIB"; then
  1513. AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=])
  1514. else
  1515. AC_SEARCH_LIBS(lua_close, [lua lua51 lua5.1 lua50 lua5.0], [LUALINK="-l$ac_lib"],[LUABIN=])
  1516. fi
  1517. # adding lualib for lua 5.0
  1518. if test -z "$LUAV51"; then # extra for lua 5.0
  1519. LUALINK="$LUALINK -llualib"
  1520. fi
  1521. LIBS=$lua_save_LIBS # restore LIBS
  1522. fi # if not disabled
  1523. AC_SUBST(LUADYNAMICLINKING)
  1524. AC_SUBST(LUAFLAGS)
  1525. AC_SUBST(LUALINK)
  1526. AC_SUBST(LUABIN)
  1527. #----------------------------------------------------------------
  1528. # Look for Allegro Common Lisp
  1529. #----------------------------------------------------------------
  1530. ALLEGROCLBIN=
  1531. AC_ARG_WITH(allegrocl, AS_HELP_STRING([--without-allegrocl], [Disable Allegro CL])
  1532. AS_HELP_STRING([--with-allegrocl=path], [Set location of Allegro CL executable (alisp)]),[ ALLEGROCLBIN="$withval"], [ALLEGROCLBIN=yes])
  1533. # First, check for "--without-allegrocl" or "--with-allegrocl=no".
  1534. if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then
  1535. AC_MSG_NOTICE([Disabling Allegro CL])
  1536. ALLEGROCLBIN=
  1537. else
  1538. # can we find allegrocl?
  1539. if test "x$ALLEGROCLBIN" = xyes; then
  1540. AC_PATH_PROG(ALLEGROCLBIN, alisp)
  1541. fi
  1542. fi
  1543. AC_SUBST(ALLEGROCLBIN)
  1544. #----------------------------------------------------------------
  1545. # Look for GNU CLISP
  1546. #----------------------------------------------------------------
  1547. CLISPBIN=
  1548. AC_ARG_WITH(clisp, AS_HELP_STRING([--without-clisp], [Disable CLISP])
  1549. AS_HELP_STRING([--with-clisp=path], [Set location of CLISP executable (clisp)]),[ CLISPBIN="$withval"], [CLISPBIN=yes])
  1550. # First, check for "--without-clisp" or "--with-clisp=no".
  1551. if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then
  1552. AC_MSG_NOTICE([Disabling CLISP])
  1553. CLISPBIN=
  1554. else
  1555. # can we find clisp?
  1556. if test "x$CLISPBIN" = xyes; then
  1557. AC_PATH_PROG(CLISPBIN, clisp)
  1558. fi
  1559. fi
  1560. AC_SUBST(CLISPBIN)
  1561. #----------------------------------------------------------------
  1562. # Look for GNU R
  1563. #----------------------------------------------------------------
  1564. RBIN=
  1565. AC_ARG_WITH(r, AS_HELP_STRING([--without-r], [Disable R])
  1566. AS_HELP_STRING([--with-r=path], [Set location of R executable (r)]),[ RBIN="$withval"], [RBIN=yes])
  1567. # First, check for "--without-r" or "--with-r=no".
  1568. if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then
  1569. AC_MSG_NOTICE([Disabling R])
  1570. RBIN=
  1571. else
  1572. # can we find R?
  1573. if test "x$RBIN" = xyes; then
  1574. AC_PATH_PROG(RBIN, R)
  1575. fi
  1576. fi
  1577. AC_SUBST(RBIN)
  1578. #----------------------------------------------------------------
  1579. # Determine which languages to use for examples/test-suite
  1580. #----------------------------------------------------------------
  1581. SKIP_TCL=
  1582. if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then
  1583. SKIP_TCL="1"
  1584. fi
  1585. AC_SUBST(SKIP_TCL)
  1586. SKIP_PERL5=
  1587. if test -z "$PERL" || test -z "$PERL5EXT" ; then
  1588. SKIP_PERL5="1"
  1589. fi
  1590. AC_SUBST(SKIP_PERL5)
  1591. SKIP_OCTAVE=
  1592. if test -z "$OCTAVE" || test -z "$OCTAVEEXT" ; then
  1593. SKIP_OCTAVE="1"
  1594. fi
  1595. AC_SUBST(SKIP_OCTAVE)
  1596. SKIP_PYTHON=
  1597. if test -z "$PYINCLUDE" || test -z "$PYLIB" ; then
  1598. SKIP_PYTHON="1"
  1599. fi
  1600. AC_SUBST(SKIP_PYTHON)
  1601. SKIP_JAVA=
  1602. if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then
  1603. SKIP_JAVA="1"
  1604. fi
  1605. AC_SUBST(SKIP_JAVA)
  1606. SKIP_GUILE=
  1607. if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_GH_INTERFACE"; then
  1608. SKIP_GUILE="1"
  1609. fi
  1610. AC_SUBST(SKIP_GUILE)
  1611. SKIP_GUILESCM=
  1612. if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_SCM_INTERFACE"; then
  1613. SKIP_GUILESCM="1"
  1614. fi
  1615. AC_SUBST(SKIP_GUILESCM)
  1616. SKIP_MZSCHEME=
  1617. if test -z "$MZC" ; then
  1618. SKIP_MZSCHEME="1"
  1619. fi
  1620. AC_SUBST(SKIP_MZSCHEME)
  1621. SKIP_RUBY=
  1622. if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then
  1623. SKIP_RUBY="1"
  1624. fi
  1625. AC_SUBST(SKIP_RUBY)
  1626. SKIP_PHP4=
  1627. if test -z "$PHP4" || test -z "$PHP4INC" ; then
  1628. SKIP_PHP4="1"
  1629. fi
  1630. AC_SUBST(SKIP_PHP4)
  1631. SKIP_OCAML=
  1632. if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then
  1633. SKIP_OCAML="1"
  1634. fi
  1635. AC_SUBST(SKIP_OCAML)
  1636. SKIP_PIKE="1" # Always skipped!
  1637. if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then
  1638. SKIP_PIKE="1"
  1639. fi
  1640. AC_SUBST(SKIP_PIKE)
  1641. SKIP_CHICKEN=
  1642. if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then
  1643. SKIP_CHICKEN="1"
  1644. fi
  1645. AC_SUBST(SKIP_CHICKEN)
  1646. SKIP_CSHARP=
  1647. if test -z "$CSHARPCOMPILER" ; then
  1648. SKIP_CSHARP="1"
  1649. else
  1650. if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then
  1651. SKIP_CSHARP="1"
  1652. fi
  1653. fi
  1654. AC_SUBST(SKIP_CSHARP)
  1655. SKIP_MODULA3="1" # Always skipped!
  1656. AC_SUBST(SKIP_MODULA3)
  1657. SKIP_LUA=
  1658. # we need LUABIN & dynamic loading
  1659. if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then
  1660. SKIP_LUA="1"
  1661. fi
  1662. AC_SUBST(SKIP_LUA)
  1663. SKIP_ALLEGROCL=
  1664. if test -z "$ALLEGROCLBIN" ; then
  1665. SKIP_ALLEGROCL="1"
  1666. fi
  1667. AC_SUBST(SKIP_ALLEGROCL)
  1668. SKIP_CLISP=
  1669. if test -z "$CLISPBIN" ; then
  1670. SKIP_CLISP="1"
  1671. fi
  1672. AC_SUBST(SKIP_CLISP)
  1673. SKIP_R=
  1674. if test -z "$RBIN" ; then
  1675. SKIP_R="1"
  1676. fi
  1677. AC_SUBST(SKIP_R)
  1678. SKIP_CFFI=
  1679. #if test -z "$CFFIBIN" ; then
  1680. SKIP_CFFI="1"
  1681. #fi
  1682. AC_SUBST(SKIP_CFFI)
  1683. SKIP_UFFI=
  1684. #if test -z "$UFFIBIN" ; then
  1685. SKIP_UFFI="1"
  1686. #fi
  1687. AC_SUBST(SKIP_UFFI)
  1688. #----------------------------------------------------------------
  1689. # Additional language dependencies
  1690. #----------------------------------------------------------------
  1691. SKIP_GCJ=
  1692. if test -z "$GCJ" || test -z "$GCJH" ; then
  1693. SKIP_GCJ="1"
  1694. else
  1695. if test "$GCC" != yes; then
  1696. SKIP_GCJ="1"
  1697. fi
  1698. fi
  1699. AC_SUBST(SKIP_GCJ)
  1700. #----------------------------------------------------------------
  1701. # Miscellaneous
  1702. #----------------------------------------------------------------
  1703. # Root directory
  1704. # Translate path for native Windows compilers for use with 'make check'
  1705. ROOT_DIR=`pwd`
  1706. case $host in
  1707. *-*-cygwin* | *-*-mingw*)
  1708. if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then
  1709. ROOT_DIR=`cygpath --mixed $ROOT_DIR`
  1710. fi
  1711. # Extra files generated by some Windows compilers
  1712. EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk"
  1713. ;;
  1714. esac
  1715. AC_SUBST(ROOT_DIR)
  1716. AC_SUBST(EXTRA_CLEAN)
  1717. AC_SUBST(ac_aux_dir)
  1718. # Configure SWIG_LIB path
  1719. AC_ARG_WITH(swiglibdir,[ --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR.],
  1720. [swig_lib="$withval"], [swig_lib="${datadir}/swig/${PACKAGE_VERSION}"])
  1721. AC_SUBST(swig_lib)
  1722. AC_DEFINE_DIR(SWIG_LIB, swig_lib, [Directory for SWIG system-independent libraries])
  1723. case $host in
  1724. # Windows does not understand unix directories. Convert into a windows directory with drive letter.
  1725. *-*-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.
  1726. *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;;
  1727. *) SWIG_LIB_WIN_UNIX="";;
  1728. esac
  1729. AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)])
  1730. AC_CONFIG_FILES([ \
  1731. Makefile \
  1732. swig.spec \
  1733. Source/Makefile \
  1734. Examples/Makefile \
  1735. Examples/guile/Makefile \
  1736. Examples/xml/Makefile \
  1737. Examples/GIFPlot/Makefile \
  1738. Examples/GIFPlot/Lib/Makefile \
  1739. Examples/test-suite/chicken/Makefile \
  1740. Examples/test-suite/csharp/Makefile \
  1741. Examples/test-suite/guile/Makefile \
  1742. Examples/test-suite/guilescm/Makefile \
  1743. Examples/test-suite/java/Makefile \
  1744. Examples/test-suite/mzscheme/Makefile \
  1745. Examples/test-suite/ocaml/Makefile \
  1746. Examples/test-suite/octave/Makefile \
  1747. Examples/test-suite/perl5/Makefile \
  1748. Examples/test-suite/php4/Makefile \
  1749. Examples/test-suite/pike/Makefile \
  1750. Examples/test-suite/python/Makefile \
  1751. Examples/test-suite/ruby/Makefile \
  1752. Examples/test-suite/tcl/Makefile \
  1753. Examples/test-suite/lua/Makefile \
  1754. Examples/test-suite/allegrocl/Makefile \
  1755. Examples/test-suite/clisp/Makefile \
  1756. Examples/test-suite/cffi/Makefile \
  1757. Examples/test-suite/uffi/Makefile \
  1758. Examples/test-suite/r/Makefile \
  1759. Lib/ocaml/swigp4.ml
  1760. ])
  1761. AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig])
  1762. AC_OUTPUT
  1763. dnl configure.in ends here