home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / configure.in < prev    next >
Text File  |  2001-07-01  |  20KB  |  701 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2.  
  3. dnl Copyright (c) 2000-2001 Massachusetts Institute of Technology
  4. dnl
  5. dnl This program is free software; you can redistribute it and/or
  6. dnl modify it under the terms of the GNU General Public License as
  7. dnl published by the Free Software Foundation; either version 2 of the
  8. dnl License, or (at your option) any later version.
  9. dnl
  10. dnl This program is distributed in the hope that it will be useful,
  11. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. dnl General Public License for more details.
  14. dnl
  15. dnl You should have received a copy of the GNU General Public License
  16. dnl along with this program; if not, write to the Free Software
  17. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  18. dnl 02111-1307, USA.
  19.  
  20. AC_REVISION([$Id: configure.in,v 11.13 2001/07/02 01:20:32 cph Exp $])
  21. AC_INIT(boot.c)
  22. AC_CONFIG_HEADER(config.h)
  23.  
  24. dnl Feature options.
  25. AC_ARG_ENABLE(static-libs,
  26. [  --enable-static-libs    Link some libraries statically [no]])
  27. AC_ARG_ENABLE(dynamic-crypto,
  28. [  --enable-dynamic-crypto Link crypto primitives dynamically [yes]])
  29. AC_ARG_WITH(openssl,
  30. [  --with-openssl          Use the OpenSSL crypto library if available [yes]])
  31. AC_ARG_WITH(mhash,
  32. [  --with-mhash            Use the mhash library if available [yes]])
  33. AC_ARG_WITH(mcrypt,
  34. [  --with-mcrypt           Use the mcrypt library available [yes]])
  35.  
  36. dnl Substitution variables to be filled in below.
  37. AS_FLAGS=
  38. GC_HEAD_FILES=
  39. LIB_X11=
  40. M4_FLAGS=
  41. OPTIONAL_BASES=
  42. OPTIONAL_OBJECTS=
  43. OPTIONAL_SOURCES=
  44. STATIC_LIBS=
  45. QUASI_STATIC_LIBS=
  46. STATIC_PREFIX=
  47. STATIC_SUFFIX=
  48. PRBFISH_LIBS=
  49. PRMD5_LIBS=
  50. SCHEME_DEFS=
  51. DLD_LDFLAGS=
  52. MODULE_BASES=
  53. MODULE_CFLAGS="-DCOMPILE_AS_MODULE"
  54. MODULE_LDFLAGS=
  55.  
  56. dnl Checks for programs.
  57. AC_PROG_CC
  58. AC_PROG_GCC_TRADITIONAL
  59. AC_PROG_INSTALL
  60. AC_PROG_LN_S
  61. AC_PROG_MAKE_SET
  62. if test "${GCC}" = "yes"; then
  63.     CFLAGS="${CFLAGS} -Wall"
  64. fi
  65. if test "$(${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps)"
  66. then
  67.     INSTALL="${INSTALL} --preserve-timestamps"
  68. fi
  69.  
  70. dnl Checks for libraries.
  71. AC_CHECK_LIB(dl, dlopen)
  72. AC_CHECK_LIB(m, exp)
  73.  
  74. AC_CHECK_LIB(crypto, BF_set_key,
  75.     [scheme_cv_lib_crypto=yes],
  76.     [scheme_cv_lib_crypto=no])
  77. AC_CHECK_LIB(mhash, mhash_count,
  78.     [scheme_cv_lib_mhash=yes],
  79.     [scheme_cv_lib_mhash=no])
  80. AC_CHECK_LIB(mcrypt, mcrypt_generic_init,
  81.     [scheme_cv_lib_mcrypt=yes],
  82.     [scheme_cv_lib_mcrypt=no],
  83.     [-lltdl])
  84. AC_CHECK_LIB(blowfish, BF_set_key,
  85.     [scheme_cv_lib_blowfish=yes],
  86.     [scheme_cv_lib_blowfish=no])
  87. AC_CHECK_LIB(md5, MD5Init,
  88.     [scheme_cv_lib_md5=yes],
  89.     [scheme_cv_lib_md5=no])
  90. AC_CHECK_LIB(gdbm, gdbm_open,
  91.     [scheme_cv_lib_gdbm=yes],
  92.     [scheme_cv_lib_gdbm=no])
  93. AC_CHECK_LIB(ncurses, tparm,
  94.     [scheme_cv_lib_ncurses=yes],
  95.     [scheme_cv_lib_ncurses=no])
  96. AC_CHECK_LIB(ncurses, tparam,
  97.     [scheme_cv_lib_ncurses_defines_tparam=yes],
  98.     [scheme_cv_lib_ncurses_defines_tparam=no])
  99. AC_CHECK_LIB(curses, tparm,
  100.     [scheme_cv_lib_curses=yes],
  101.     [scheme_cv_lib_curses=no])
  102. AC_CHECK_LIB(termcap, tparam,
  103.     [scheme_cv_lib_termcap=yes],
  104.     [scheme_cv_lib_termcap=no])
  105.  
  106. dnl Checks for header files.
  107. AC_HEADER_DIRENT
  108. AC_HEADER_STDC
  109. AC_HEADER_SYS_WAIT
  110. AC_HEADER_TIME
  111. AC_CHECK_HEADERS(bsdtty.h fcntl.h limits.h malloc.h sgtty.h stropts.h time.h)
  112. AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/poll.h)
  113. AC_CHECK_HEADERS(sys/ptyio.h sys/socket.h sys/time.h sys/un.h sys/vfs.h)
  114. AC_CHECK_HEADERS(termio.h termios.h unistd.h utime.h)
  115. AC_CHECK_HEADERS(openssl/blowfish.h openssl/md5.h blowfish.h md5.h)
  116. AC_CHECK_HEADERS(mhash.h mcrypt.h gdbm.h curses.h term.h)
  117.  
  118. dnl Checks for typedefs
  119. AC_TYPE_MODE_T
  120. AC_TYPE_OFF_T
  121. AC_TYPE_PID_T
  122. AC_TYPE_SIGNAL
  123. AC_TYPE_SIZE_T
  124. AC_TYPE_UID_T
  125. AC_CHECK_TYPE(nlink_t, short)
  126.  
  127. AC_MSG_CHECKING([for clock_t])
  128. AC_TRY_COMPILE([
  129. #ifdef TIME_WITH_SYS_TIME
  130. #  include <sys/time.h>
  131. #  include <time.h>
  132. #else
  133. #  ifdef HAVE_SYS_TIME_H
  134. #    include <sys/time.h>
  135. #  else
  136. #    include <time.h>
  137. #  endif
  138. #endif],
  139.     [clock_t x;],
  140.     [scheme_cv_type_clock_t=yes],
  141.     [scheme_cv_type_clock_t=no])
  142. AC_MSG_RESULT(${scheme_cv_type_clock_t})
  143. if test "${scheme_cv_type_clock_t}" = "no"; then
  144.     AC_DEFINE(clock_t, unsigned long)
  145. fi
  146.  
  147. AC_MSG_CHECKING([for time_t])
  148. AC_TRY_COMPILE([
  149. #ifdef TIME_WITH_SYS_TIME
  150. #  include <sys/time.h>
  151. #  include <time.h>
  152. #else
  153. #  ifdef HAVE_SYS_TIME_H
  154. #    include <sys/time.h>
  155. #  else
  156. #    include <time.h>
  157. #  endif
  158. #endif],
  159.     [time_t x;],
  160.     [scheme_cv_type_time_t=yes],
  161.     [scheme_cv_type_time_t=no])
  162. AC_MSG_RESULT(${scheme_cv_type_time_t})
  163. if test "${scheme_cv_type_time_t}" = "no"; then
  164.     AC_DEFINE(time_t, long)
  165. fi
  166.  
  167. if test "${ac_cv_header_sys_socket_h}" = "yes"; then
  168.     AC_MSG_CHECKING([for socklen_t])
  169.     AC_TRY_COMPILE(
  170.     [#include <sys/socket.h>],
  171.     [socklen_t x;],
  172.     [scheme_cv_type_socklen_t=yes],
  173.     [scheme_cv_type_socklen_t=no])
  174.     AC_MSG_RESULT(${scheme_cv_type_socklen_t})
  175.     if test "${scheme_cv_type_socklen_t}" = "no"; then
  176.     AC_DEFINE(socklen_t, int)
  177.     fi
  178. fi
  179.  
  180. AC_MSG_CHECKING([for cc_t])
  181. AC_TRY_COMPILE([
  182. #ifdef HAVE_TERMIOS_H
  183. #  include <termios.h>
  184. #else
  185. #  ifdef HAVE_TERMIO_H
  186. #    include <termio.h>
  187. #  endif
  188. #endif],
  189.     [cc_t x;],
  190.     [scheme_cv_type_cc_t=yes],
  191.     [scheme_cv_type_cc_t=no])
  192. AC_MSG_RESULT(${scheme_cv_type_cc_t})
  193. if test "${scheme_cv_type_cc_t}" = "no"; then
  194.     AC_DEFINE(cc_t, unsigned char)
  195. fi
  196.  
  197. AC_MSG_CHECKING([for speed_t])
  198. AC_TRY_COMPILE([
  199. #ifdef HAVE_TERMIOS_H
  200. #  include <termios.h>
  201. #else
  202. #  ifdef HAVE_TERMIO_H
  203. #    include <termio.h>
  204. #  endif
  205. #endif],
  206.     [speed_t x;],
  207.     [scheme_cv_type_speed_t=yes],
  208.     [scheme_cv_type_speed_t=no])
  209. AC_MSG_RESULT(${scheme_cv_type_speed_t})
  210. if test "${scheme_cv_type_speed_t}" = "no"; then
  211.     AC_DEFINE(speed_t, short)
  212. fi
  213.  
  214. dnl Checks for structures.
  215. AC_STRUCT_TM
  216. AC_STRUCT_TIMEZONE
  217.  
  218.  
  219. dnl Timezone stuff is hairy; there's no standard.
  220. have_timezone_info=no
  221.  
  222. if test "${have_timezone_info}" = "no"; then
  223.     AC_MSG_CHECKING([for tm_gmtoff in struct tm])
  224.     AC_TRY_LINK(
  225.     [#include <time.h>],
  226.     [struct tm t; t.tm_gmtoff],
  227.     [scheme_cv_struct_tm_gmtoff=yes],
  228.     [scheme_cv_struct_tm_gmtoff=no])
  229.     AC_MSG_RESULT(${scheme_cv_struct_tm_gmtoff})
  230.     if test "${scheme_cv_struct_tm_gmtoff}" = "yes"; then
  231.     AC_DEFINE(HAVE_TM_GMTOFF)
  232.     AC_DEFINE(TM_GMTOFF, tm_gmtoff)
  233.     have_timezone_info=yes
  234.     fi
  235. fi
  236.  
  237. if test "${have_timezone_info}" = "no"; then
  238.     AC_MSG_CHECKING([for __tm_gmtoff in struct tm])
  239.     AC_TRY_LINK(
  240.     [#include <time.h>],
  241.     [struct tm t; t.__tm_gmtoff],
  242.     [scheme_cv_struct___tm_gmtoff=yes],
  243.     [scheme_cv_struct___tm_gmtoff=no])
  244.     AC_MSG_RESULT(${scheme_cv_struct___tm_gmtoff})
  245.     if test "${scheme_cv_struct___tm_gmtoff}" = "yes"; then
  246.     AC_DEFINE(HAVE_TM_GMTOFF)
  247.     AC_DEFINE(TM_GMTOFF, __tm_gmtoff)
  248.     have_timezone_info=yes
  249.     fi
  250. fi
  251.  
  252. if test "${have_timezone_info}" = "no"; then
  253.     AC_MSG_CHECKING([for __timezone])
  254.     AC_TRY_LINK([
  255. #ifdef TIME_WITH_SYS_TIME
  256. #  include <sys/time.h>
  257. #  include <time.h>
  258. #else
  259. #  ifdef HAVE_SYS_TIME_H
  260. #    include <sys/time.h>
  261. #  else
  262. #    include <time.h>
  263. #  endif
  264. #endif],
  265.     [__timezone;],
  266.     [scheme_cv_var___timezone=yes],
  267.     [scheme_cv_var___timezone=no])
  268.     AC_MSG_RESULT(${scheme_cv_var___timezone})
  269.     if test "${scheme_cv_var___timezone}" = "yes"; then
  270.     AC_DEFINE(HAVE_TIMEZONE)
  271.     AC_DEFINE(TIMEZONE, __timezone)
  272.     have_timezone_info=yes
  273.     fi
  274. fi
  275.  
  276. if test "${have_timezone_info}" = "no"; then
  277.     AC_MSG_CHECKING([for _timezone])
  278.     AC_TRY_LINK([
  279. #ifdef TIME_WITH_SYS_TIME
  280. #  include <sys/time.h>
  281. #  include <time.h>
  282. #else
  283. #  ifdef HAVE_SYS_TIME_H
  284. #    include <sys/time.h>
  285. #  else
  286. #    include <time.h>
  287. #  endif
  288. #endif],
  289.     [_timezone;],
  290.     [scheme_cv_var__timezone=yes],
  291.     [scheme_cv_var__timezone=no])
  292.     AC_MSG_RESULT(${scheme_cv_var__timezone})
  293.     if test "${scheme_cv_var__timezone}" = "yes"; then
  294.     AC_DEFINE(HAVE_TIMEZONE)
  295.     AC_DEFINE(TIMEZONE, _timezone)
  296.     have_timezone_info=yes
  297.     fi
  298. fi
  299.  
  300. if test "${have_timezone_info}" = "no"; then
  301.     AC_MSG_CHECKING([for timezone])
  302.     AC_TRY_LINK([
  303. #ifdef TIME_WITH_SYS_TIME
  304. #  include <sys/time.h>
  305. #  include <time.h>
  306. #else
  307. #  ifdef HAVE_SYS_TIME_H
  308. #    include <sys/time.h>
  309. #  else
  310. #    include <time.h>
  311. #  endif
  312. #endif],
  313.     [timezone;],
  314.     [scheme_cv_var_timezone=yes],
  315.     [scheme_cv_var_timezone=no])
  316.     AC_MSG_RESULT(${scheme_cv_var_timezone})
  317.     if test "${scheme_cv_var_timezone}" = "yes"; then
  318.     AC_DEFINE(HAVE_TIMEZONE)
  319.     AC_DEFINE(TIMEZONE, timezone)
  320.     have_timezone_info=yes
  321.     fi
  322. fi
  323.  
  324. if test "${ac_cv_header_bsdtty_h}" = "yes"; then
  325.     AC_MSG_CHECKING([for struct ltchars])
  326.     AC_TRY_COMPILE(
  327.     [#include <bsdtty.h>],
  328.     [struct ltchars x;],
  329.     [scheme_cv_struct_ltchars=yes],
  330.     [scheme_cv_struct_ltchars=no])
  331.     AC_MSG_RESULT(${scheme_cv_struct_ltchars})
  332.     if test "${scheme_cv_struct_ltchars}" = "yes"; then
  333.     AC_DEFINE(HAVE_STRUCT_LTCHARS)
  334.     fi
  335. fi
  336.  
  337. AC_MSG_CHECKING([for hostent h_addr_list])
  338. AC_TRY_COMPILE(
  339.     [#include <netdb.h>],
  340.     [struct hostent x; x.h_addr_list;],
  341.     [scheme_cv_struct_hostent_h_addr_list=yes],
  342.     [scheme_cv_struct_hostent_h_addr_list=no])
  343. AC_MSG_RESULT(${scheme_cv_struct_hostent_h_addr_list})
  344. if test "${scheme_cv_struct_hostent_h_addr_list}" = "yes"; then
  345.     AC_DEFINE(HAVE_HOSTENT_H_ADDR_LIST)
  346. fi
  347.  
  348. AC_MSG_CHECKING([for struct sigcontext])
  349. AC_TRY_COMPILE(
  350.     [#include <signal.h>],
  351.     [struct sigcontext x;],
  352.     [scheme_cv_struct_sigcontext=yes],
  353.     [scheme_cv_struct_sigcontext=no])
  354. AC_MSG_RESULT(${scheme_cv_struct_sigcontext})
  355. if test "${scheme_cv_struct_sigcontext}" = "yes"; then
  356.     AC_DEFINE(HAVE_STRUCT_SIGCONTEXT)
  357. fi
  358.  
  359. dnl Checks for compiler characteristics.
  360. AC_C_BIGENDIAN
  361. AC_C_CHAR_UNSIGNED
  362. AC_C_CONST
  363. AC_CHECK_SIZEOF(unsigned long)
  364.  
  365. dnl Checks for C library functions.
  366. AC_FUNC_GETPGRP
  367. AC_FUNC_MEMCMP
  368. AC_FUNC_MMAP
  369. AC_FUNC_SETPGRP
  370. AC_FUNC_SETVBUF_REVERSED
  371. AC_FUNC_UTIME_NULL
  372. AC_FUNC_VFORK
  373. AC_FUNC_VPRINTF
  374. AC_FUNC_WAIT3
  375. AC_CHECK_FUNCS(ctermid)
  376. AC_CHECK_FUNCS(dup2)
  377. AC_CHECK_FUNCS(fcntl floor fpathconf frexp ftruncate)
  378. AC_CHECK_FUNCS(getcwd gethostbyname gethostname getlogin getpgrp)
  379. AC_CHECK_FUNCS(gettimeofday getwd grantpt)
  380. AC_CHECK_FUNCS(kill)
  381. AC_CHECK_FUNCS(lockf)
  382. AC_CHECK_FUNCS(memcpy mkdir mktime modf)
  383. AC_CHECK_FUNCS(nice)
  384. AC_CHECK_FUNCS(poll prealloc)
  385. AC_CHECK_FUNCS(rename rmdir)
  386. AC_CHECK_FUNCS(select setitimer setpgrp setpgrp2 shmat sigaction)
  387. AC_CHECK_FUNCS(sighold socket statfs strchr strstr strtol strtoul)
  388. AC_CHECK_FUNCS(symlink sysconf)
  389. AC_CHECK_FUNCS(times truncate)
  390. AC_CHECK_FUNCS(uname utime)
  391. AC_CHECK_FUNCS(waitpid)
  392.  
  393. if test "${ac_cv_type_signal}" = "void"; then
  394.     AC_DEFINE(VOID_SIGNAL_HANDLERS)
  395. fi
  396.  
  397. dnl Checks for system characteristics.
  398. AC_CANONICAL_HOST
  399. AC_PATH_XTRA
  400. AC_SYS_LONG_FILE_NAMES
  401. AC_SYS_RESTARTABLE_SYSCALLS
  402.  
  403. dnl OK, now some complex logic to handle the crypto stuff.
  404.  
  405. if test "${ac_cv_lib_dl_dlopen}" = "yes"; then
  406.     OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld"
  407.     enable_dynamic_crypto="${enable_dynamic_crypto:-yes}"
  408. else
  409.     enable_dynamic_crypto="no"
  410. fi
  411.  
  412. dnl Handle options to enable/disable use of some libraries.
  413. test "${with_openssl:-yes}" = "no" && scheme_cv_lib_crypto="no"
  414. test "${with_mhash:-yes}" = "no" && scheme_cv_lib_mhash="no"
  415. test "${with_mcrypt:-yes}" = "no" && scheme_cv_lib_mcrypt="no"
  416.  
  417. dnl Next, we decide which libraries to use.  We mostly want support
  418. dnl for Blowfish and MD5, each of which can come from multiple libraries.
  419. HAVE_BLOWFISH="no"
  420. HAVE_MD5="no"
  421.  
  422. dnl The OpenSSL crypto library provides support for both, and is preferred.
  423. if test "${scheme_cv_lib_crypto}" = "yes"; then
  424.     AC_DEFINE(HAVE_LIBCRYPTO)
  425.     if test "${ac_cv_header_openssl_blowfish_h}" = "yes" \
  426.         || test "${ac_cv_header_blowfish_h}" = "yes"; then
  427.     if test "${enable_dynamic_crypto}" = "yes"; then
  428.         MODULE_BASES="${MODULE_BASES} prbfish"
  429.         PRBFISH_LIBS="-lcrypto"
  430.     else
  431.         OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
  432.     fi
  433.     HAVE_BLOWFISH="yes"
  434.     fi
  435.     if test "${ac_cv_header_openssl_md5_h}" = "yes" \
  436.         || test "${ac_cv_header_md5_h}" = "yes"; then
  437.     if test "${enable_dynamic_crypto}" = "yes"; then
  438.         MODULE_BASES="${MODULE_BASES} prmd5"
  439.         PRMD5_LIBS="-lcrypto"
  440.     else
  441.         OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
  442.     fi
  443.     HAVE_MD5="yes"
  444.     fi
  445.     if test "${enable_dynamic_crypto}" = "no"; then
  446.     if test "${HAVE_BLOWFISH}" = "yes" || test "${HAVE_MD5}" = "yes"; then
  447.         QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lcrypto"
  448.     fi
  449.     fi
  450. fi
  451.  
  452. dnl The mhash library provides md5 support.  It can be loaded in addition
  453. dnl to other MD5 libraries and provides a rich set of hashes.
  454. if test "${scheme_cv_lib_mhash}" = "yes"; then
  455.     AC_DEFINE(HAVE_LIBMHASH)
  456.     if test "${ac_cv_header_mhash_h}" = "yes"; then
  457.     if test "${enable_dynamic_crypto}" = "yes"; then
  458.         MODULE_BASES="${MODULE_BASES} prmhash"
  459.     else
  460.         QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmhash"
  461.         OPTIONAL_BASES="${OPTIONAL_BASES} prmhash"
  462.     fi
  463.     HAVE_MD5="yes"
  464.     fi
  465. fi
  466.  
  467. dnl The mcrypt library provides blowfish, but its CFB mode is 8 bit.
  468. dnl We have been using 64-bit CFB, so this isn't really compatible.
  469. dnl But mcrypt provides many ciphers and can be loaded in addition.
  470. if test "${scheme_cv_lib_mcrypt}" = "yes"; then
  471.     AC_DEFINE(HAVE_LIBMCRYPT)
  472.     if test "${ac_cv_header_mcrypt_h}" = "yes"; then
  473.     if test "${enable_dynamic_crypto}" = "yes"; then
  474.         MODULE_BASES="${MODULE_BASES} prmcrypt"
  475.     else
  476.         QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmcrypt -lltdl"
  477.         OPTIONAL_BASES="${OPTIONAL_BASES} prmcrypt"
  478.     fi
  479.     fi
  480. fi
  481.  
  482. dnl This is a stripped-down library that provides just Blowfish.  It
  483. dnl seems to be code that was extracted from OpenSSL long ago.  We
  484. dnl used this for a long time but no longer do.
  485. if test "${HAVE_BLOWFISH}" = "no"; then
  486.     if test "${scheme_cv_lib_blowfish}" = "yes"; then
  487.     AC_DEFINE(HAVE_LIBBLOWFISH)
  488.     if test "${ac_cv_header_blowfish_h}" = "yes"; then
  489.         if test "${enable_dynamic_crypto}" = "yes"; then
  490.         MODULE_BASES="${MODULE_BASES} prbfish"
  491.         PRBFISH_LIBS="-lblowfish"
  492.         else
  493.         STATIC_LIBS="${STATIC_LIBS} -lblowfish"
  494.         OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
  495.         fi
  496.         HAVE_BLOWFISH="yes"
  497.     fi
  498.     fi
  499. fi
  500.  
  501. dnl This is Phil Karn's MD5 implementation, which seems to have nearly
  502. dnl the same interface as that of OpenSSL.
  503. if test "${HAVE_MD5}" = "no"; then
  504.     if test "${scheme_cv_lib_md5}" = "yes"; then
  505.     AC_DEFINE(HAVE_LIBMD5)
  506.     if test "${ac_cv_header_md5_h}" = "yes"; then
  507.         if test "${enable_dynamic_crypto}" = "yes"; then
  508.         MODULE_BASES="${MODULE_BASES} prmd5"
  509.         PRMD5_LIBS="-lmd5"
  510.         else
  511.         STATIC_LIBS="${STATIC_LIBS} -lmd5"
  512.         OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
  513.         fi
  514.         HAVE_MD5="yes"
  515.     fi
  516.     fi
  517. fi
  518.  
  519. dnl gdbm support.
  520. if test "${scheme_cv_lib_gdbm}" = "yes"; then
  521.     AC_DEFINE(HAVE_LIBGDBM)
  522.     if test "${ac_cv_header_gdbm_h}" = "yes"; then
  523.     QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lgdbm"
  524.     OPTIONAL_BASES="${OPTIONAL_BASES} prgdbm"
  525.     fi
  526. fi
  527.  
  528. dnl curses/termcap/terminfo support.
  529. if test "${scheme_cv_lib_ncurses}" = "yes"; then
  530.     AC_DEFINE(HAVE_LIBNCURSES)
  531.     if test "${ac_cv_header_curses_h}" = "yes" \
  532.     && test "${ac_cv_header_term_h}" = "yes"; then
  533.     QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lncurses"
  534.     if test "${scheme_cv_lib_ncurses_defines_tparam}" = "yes"; then
  535.         AC_DEFINE(LIBNCURSES_DEFINES_TPARAM)
  536.     else
  537.         OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
  538.     fi
  539.     fi
  540. else
  541.     if test "${scheme_cv_lib_curses}" = "yes"; then
  542.     AC_DEFINE(HAVE_LIBCURSES)
  543.     QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lcurses"
  544.     OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
  545.     else
  546.     if test "${scheme_cv_lib_termcap}" = "yes"; then
  547.         AC_DEFINE(HAVE_LIBTERMCAP)
  548.         QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -ltermcap"
  549.         OPTIONAL_BASES="${OPTIONAL_BASES} tparam"
  550.     else
  551.         OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
  552.     fi
  553.     fi
  554. fi
  555.  
  556. dnl Decide whether we're using static or dynamic libraries.
  557. if test "${enable_static_libs:-no}" = "no"; then
  558.     LIBS="${LIBS}${QUASI_STATIC_LIBS}"
  559. else
  560.     STATIC_LIBS="${STATIC_LIBS}${QUASI_STATIC_LIBS}"
  561. fi
  562.  
  563. dnl Add support for X if present.
  564. if test "${no_x}" = "yes"; then
  565.     LIB_X11=
  566. else
  567.     LIB_X11=-lX11
  568.     OPTIONAL_BASES="${OPTIONAL_BASES} x11base x11term x11graph x11color"
  569. fi
  570.  
  571. dnl Add OS-dependent customizations.
  572. case "$host_os" in
  573. linux-gnu)
  574.     if test "${STATIC_LIBS}" != ""; then
  575.     STATIC_PREFIX="-Xlinker -Bstatic"
  576.     STATIC_SUFFIX="-Xlinker -Bdynamic"
  577.     fi
  578.     DLD_LDFLAGS="${DLD_LDFLAGS} -export-dynamic"
  579.     MODULE_CFLAGS="${MODULE_CFLAGS} -fPIC"
  580.     MODULE_LDFLAGS="${MODULE_LDFLAGS} -shared"
  581.     AC_MSG_CHECKING([for ELF binaries])
  582.     AC_TRY_RUN(
  583. [int
  584. main ()
  585. {
  586. #ifdef __ELF__
  587. return 0;
  588. #endif
  589. return 1;
  590. }],
  591.     [scheme_cv_linux_elf=yes],
  592.     [scheme_cv_linux_elf=no])
  593.     AC_MSG_RESULT(${scheme_cv_linux_elf})
  594.     if test "${scheme_cv_linux_elf}" = "yes"; then
  595.     M4_FLAGS="${M4_FLAGS} -P LINUX_ELF,1"
  596.     fi
  597.     if test "${GCC}" = "yes"; then
  598.     AC_MSG_CHECKING([for GCC version >= 2.95])
  599.     AC_TRY_RUN(
  600. [int
  601. main ()
  602. {
  603. #if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)))
  604. return 0;
  605. #endif
  606. return 1;
  607. }],
  608.     [scheme_cv_gcc3=yes],
  609.     [scheme_cv_gcc3=no])
  610.     AC_MSG_RESULT(${scheme_cv_gcc3})
  611.     if test "${scheme_cv_gcc3}" = "yes"; then
  612.         M4_FLAGS="${M4_FLAGS} -P CALLEE_POPS_STRUCT_RETURN,1"
  613.     fi
  614.     fi
  615.     ;;
  616. freebsdelf*)
  617.     M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
  618.     ;;
  619. esac
  620.  
  621. dnl Add architecture-dependent customizations.
  622. dnl This is mostly support for native-code compilation.
  623. scheme_arch=
  624. OPTIONAL_BASES="${OPTIONAL_BASES} cmpint"
  625. GC_HEAD_FILES="gccode.h cmpgc.h"
  626. case "$host_cpu" in
  627. alpha*)
  628.     scheme_arch=alpha
  629.     ;;
  630. hppa*)
  631.     scheme_arch=hppa
  632.     GC_HEAD_FILES="${GC_HEAD_FILES} hppacach.h"
  633.     ;;
  634. i?86)
  635.     scheme_arch=i386
  636.     ;;
  637. m68k|m680?0)
  638.     scheme_arch=mc68k
  639.     ;;
  640. mips*)
  641.     scheme_arch=mips
  642.     ;;
  643. vax)
  644.     scheme_arch=vax
  645.     ;;
  646. esac
  647. if test "${scheme_arch}" != ""; then
  648.     AC_DEFINE(HAS_COMPILER_SUPPORT)
  649.     test -f cmpauxmd.m4 \
  650.       || ${ac_cv_prog_LN_S} cmpauxmd/${scheme_arch}.m4 cmpauxmd.m4
  651.     test -f cmpintmd.h \
  652.       || ${ac_cv_prog_LN_S} cmpintmd/${scheme_arch}.h cmpintmd.h
  653.     OPTIONAL_SOURCES="${OPTIONAL_SOURCES} cmpauxmd.m4"
  654.     OPTIONAL_OBJECTS="${OPTIONAL_OBJECTS} cmpauxmd.o"
  655.     GC_HEAD_FILES="${GC_HEAD_FILES} cmpintmd.h"
  656. fi
  657.  
  658. for base in ${OPTIONAL_BASES}; do
  659.     OPTIONAL_SOURCES="${OPTIONAL_SOURCES} ${base}.c"
  660.     OPTIONAL_OBJECTS="${OPTIONAL_OBJECTS} ${base}.o"
  661. done
  662.  
  663.  
  664. MODULE_TARGETS=
  665. if test "${MODULE_BASES}" = ""; then
  666.     MODULE_RULES="/dev/null"
  667. else
  668.     MODULE_RULES="config.modrules"
  669.     rm -f "${MODULE_RULES}"
  670.     for BASE in ${MODULE_BASES}; do
  671.     MODULE_TARGETS="${MODULE_TARGETS} ${BASE}.so"
  672.     echo "" >> "${MODULE_RULES}"
  673.     echo "${BASE}.o: ${BASE}.c" >> "${MODULE_RULES}"
  674.     echo "    \$(COMPILE_MODULE) -c \$*.c" >> "${MODULE_RULES}"
  675.     done
  676. fi
  677.  
  678. AC_SUBST(AS_FLAGS)
  679. AC_SUBST(GC_HEAD_FILES)
  680. AC_SUBST(LIB_X11)
  681. AC_SUBST(M4_FLAGS)
  682. AC_SUBST(OPTIONAL_OBJECTS)
  683. AC_SUBST(OPTIONAL_SOURCES)
  684. AC_SUBST(STATIC_LIBS)
  685. AC_SUBST(STATIC_PREFIX)
  686. AC_SUBST(STATIC_SUFFIX)
  687. AC_SUBST(PRBFISH_LIBS)
  688. AC_SUBST(PRMD5_LIBS)
  689. AC_SUBST(SCHEME_DEFS)
  690. AC_SUBST(DLD_LDFLAGS)
  691. AC_SUBST(MODULE_TARGETS)
  692. AC_SUBST_FILE(MODULE_RULES)
  693. AC_SUBST(MODULE_CFLAGS)
  694. AC_SUBST(MODULE_LDFLAGS)
  695.  
  696. AC_OUTPUT(Makefile)
  697.  
  698. if test "${MODULE_RULES}" != "/dev/null"; then
  699.     rm -f "${MODULE_RULES}"
  700. fi
  701.