~ubuntu-branches/ubuntu/trusty/mit-scheme/trusty-proposed

« back to all changes in this revision

Viewing changes to src/microcode/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-05-09 10:57:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070509105757-p8focimovgqxaaed
Tags: 7.7.90+20070205-1ubuntu1
* Merge from debian unstable, remaining changes:
  * Bootstrapping done via supplied binary package. See log entry for
    7.7.90+20060906-3ubuntu1 for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl Process this file with autoconf to produce a configure script.
2
2
 
3
 
AC_INIT([MIT/GNU Scheme], [14.17], [bug-mit-scheme@gnu.org], [mit-scheme])
4
 
AC_REVISION([$Id: configure.ac,v 1.11 2006/06/10 15:06:07 cph Exp $])
 
3
AC_INIT([MIT/GNU Scheme microcode], [14.18], [bug-mit-scheme@gnu.org], [mit-scheme])
 
4
AC_REVISION([$Id: configure.ac,v 1.36 2007/01/22 08:35:02 riastradh Exp $])
5
5
AC_CONFIG_SRCDIR([boot.c])
6
6
AC_CONFIG_HEADERS([config.h])
7
7
AC_PROG_MAKE_SET
8
8
 
9
9
AC_COPYRIGHT(
10
 
[Copyright 2000,2002,2003,2004,2005,2006 Massachusetts Institute of Technology
 
10
[Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 
11
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
12
    2006, 2007 Massachusetts Institute of Technology
11
13
 
12
14
This file is part of MIT/GNU Scheme.
13
15
 
23
25
 
24
26
You should have received a copy of the GNU General Public License
25
27
along with MIT/GNU Scheme; if not, write to the Free Software
26
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
28
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
27
29
USA.
28
30
])
29
31
 
30
32
AH_TOP([/*
31
33
 
32
 
Copyright 2000,2002,2003,2004,2005,2006 Massachusetts Institute of Technology
 
34
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 
35
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
36
    2006, 2007 Massachusetts Institute of Technology
33
37
 
34
38
This file is part of MIT/GNU Scheme.
35
39
 
45
49
 
46
50
You should have received a copy of the GNU General Public License
47
51
along with MIT/GNU Scheme; if not, write to the Free Software
48
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
52
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
49
53
USA.
50
54
 
51
55
*/
109
113
 
110
114
#endif /* SCM_CONFIG_H */])
111
115
 
112
 
dnl Feature options.
 
116
dnl Feature options
113
117
AC_ARG_ENABLE([static-libs],
114
 
[[  --enable-static-libs    Link some libraries statically [no]]])
115
 
AC_ARG_ENABLE([dynamic-modules],
116
 
[[  --enable-dynamic-modules Link some primitives dynamically [yes]]])
 
118
    AS_HELP_STRING([--enable-static-libs],
 
119
        [Link some libraries statically [[no]]]))
 
120
: ${enable_static_libs='no'}
 
121
 
117
122
AC_ARG_ENABLE([valgrind-mode],
118
 
[[  --enable-valgrind-mode  Support running under valgrind [no]]])
 
123
    AS_HELP_STRING([--enable-valgrind-mode],
 
124
        [Support running under valgrind [[no]]]))
 
125
: ${enable_valgrind_mode='no'}
 
126
 
 
127
AC_ARG_ENABLE([debugging],
 
128
    AS_HELP_STRING([--enable-debugging],
 
129
        [Compile with debugging support [[no]]]))
 
130
: ${enable_debugging='no'}
 
131
 
 
132
AC_ARG_ENABLE([native-code],
 
133
    AS_HELP_STRING([--enable-native-code],
 
134
        [Support native compiled code if available [[yes]]]))
 
135
: ${enable_native_code='yes'}
 
136
 
119
137
AC_ARG_WITH([openssl],
120
 
[[  --with-openssl          Use OpenSSL crypto library if available [yes]]])
 
138
    AS_HELP_STRING([--with-openssl],
 
139
        [Use OpenSSL crypto library if available [[yes]]]))
 
140
: ${with_openssl='yes'}
 
141
 
121
142
AC_ARG_WITH([mhash],
122
 
[[  --with-mhash            Use mhash library if available [yes]]])
 
143
    AS_HELP_STRING([--with-mhash],
 
144
        [Use mhash library if available [[yes]]]))
 
145
: ${with_mhash='yes'}
 
146
 
123
147
AC_ARG_WITH([mcrypt],
124
 
[[  --with-mcrypt           Use mcrypt library if available [yes]]])
 
148
    AS_HELP_STRING([--with-mcrypt],
 
149
        [Use mcrypt library if available [[yes]]]))
 
150
: ${with_mcrypt='yes'}
 
151
 
125
152
AC_ARG_WITH([gdbm],
126
 
[[  --with-gdbm             Use gdbm library if available [yes]]])
127
 
AC_ARG_WITH([db4],
128
 
[[  --with-db4              Use Berkeley DB v4 library if available [yes]]])
 
153
    AS_HELP_STRING([--with-gdbm],
 
154
        [Use gdbm library if available [[yes]]]))
 
155
: ${with_gdbm='yes'}
 
156
 
 
157
AC_ARG_WITH([db-4],
 
158
    AS_HELP_STRING([--with-db-4],
 
159
        [Use Berkeley DB v4 library if available [[yes]]]))
 
160
: ${with_db_4='yes'}
 
161
 
129
162
AC_ARG_WITH([libpq],
130
 
[[  --with-libpq            Use PostgreSQL libpq library if available [yes]]])
 
163
    AS_HELP_STRING([--with-libpq],
 
164
        [Use PostgreSQL libpq library if available [[yes]]]))
 
165
: ${with_libpq='yes'}
131
166
 
132
167
dnl Substitution variables to be filled in below.
133
168
AS_FLAGS=
134
169
GC_HEAD_FILES=
135
 
LIB_X11=
136
170
M4_FLAGS=
137
171
OPTIONAL_BASES=
 
172
OPTIONAL_SOURCES=
138
173
OPTIONAL_OBJECTS=
139
 
OPTIONAL_SOURCES=
140
174
STATIC_LIBS=
141
 
QUASI_STATIC_LIBS=
142
175
STATIC_PREFIX=
143
176
STATIC_SUFFIX=
144
177
PRBFISH_LIBS=
146
179
SCHEME_DEFS=
147
180
DLD_LDFLAGS=
148
181
MODULE_BASES=
 
182
MODULE_LIBS=
 
183
MODULE_TARGETS=
 
184
MODULE_RULES=/dev/null
149
185
MODULE_CFLAGS="-DCOMPILE_AS_MODULE"
150
186
MODULE_LDFLAGS=
 
187
LIARC_RULES_1=/dev/null
 
188
LIARC_RULES_2=/dev/null
151
189
 
152
190
dnl Checks for programs.
153
191
AC_PROG_CC
155
193
AC_PROG_INSTALL
156
194
AC_PROG_LN_S
157
195
AC_PROG_MAKE_SET
158
 
if test "${GCC}" = "yes"; then
 
196
if test ${GCC} = yes; then
 
197
    if test ${enable_debugging} = no; then
 
198
        CFLAGS=-O3
 
199
    else
 
200
        CFLAGS="-O0 -g"
 
201
        LDFLAGS="${LDFLAGS} -g"
 
202
    fi
159
203
    CFLAGS="${CFLAGS} -Wall"
160
204
fi
161
 
if test "$(${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps)"
162
 
then
 
205
FOO=`${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps`
 
206
if test "x${FOO}" != x; then
163
207
    INSTALL="${INSTALL} --preserve-timestamps"
164
208
fi
165
209
 
166
210
dnl Checks for libraries.
167
 
AC_CHECK_LIB([dl], [dlopen])
168
211
AC_CHECK_LIB([m], [exp])
169
212
 
170
 
AC_CHECK_LIB([crypto], [BF_set_key],
171
 
    [scheme_cv_lib_crypto=yes],
172
 
    [scheme_cv_lib_crypto=no])
173
 
AC_CHECK_LIB([mhash], [mhash_count],
174
 
    [scheme_cv_lib_mhash=yes],
175
 
    [scheme_cv_lib_mhash=no])
176
 
AC_CHECK_LIB([mcrypt], [mcrypt_generic_init],
177
 
    [scheme_cv_lib_mcrypt=yes],
178
 
    [scheme_cv_lib_mcrypt=no],
179
 
    [-lltdl])
180
 
AC_CHECK_LIB([blowfish], [BF_set_key],
181
 
    [scheme_cv_lib_blowfish=yes],
182
 
    [scheme_cv_lib_blowfish=no])
183
 
AC_CHECK_LIB([md5], [MD5Init],
184
 
    [scheme_cv_lib_md5=yes],
185
 
    [scheme_cv_lib_md5=no])
186
 
AC_CHECK_LIB([gdbm], [gdbm_open],
187
 
    [scheme_cv_lib_gdbm=yes],
188
 
    [scheme_cv_lib_gdbm=no])
189
 
AC_CHECK_LIB([ncurses], [tparm],
190
 
    [scheme_cv_lib_ncurses=yes],
191
 
    [scheme_cv_lib_ncurses=no])
192
 
AC_CHECK_LIB([ncurses], [tparam],
193
 
    [scheme_cv_lib_ncurses_defines_tparam=yes],
194
 
    [scheme_cv_lib_ncurses_defines_tparam=no])
195
 
AC_CHECK_LIB([curses], [tparm],
196
 
    [scheme_cv_lib_curses=yes],
197
 
    [scheme_cv_lib_curses=no])
198
 
AC_CHECK_LIB([termcap], [tparam],
199
 
    [scheme_cv_lib_termcap=yes],
200
 
    [scheme_cv_lib_termcap=no])
201
 
AC_CHECK_LIB([pq], [PQconnectdb],
202
 
    [scheme_cv_lib_pq=yes],
203
 
    [scheme_cv_lib_pq=no])
204
 
 
205
 
AC_MSG_CHECKING([for db_create in -ldb-4])
206
 
save_LIBS="$LIBS"
207
 
LIBS="-ldb-4 $LIBS"
208
 
AC_TRY_LINK(
209
 
    [#include <db.h>],
210
 
    [DB * db; db_create ((&db), 0, 0);],
211
 
    [scheme_cv_lib_db4=yes],
212
 
    [scheme_cv_lib_db4=no])
213
 
LIBS="$save_LIBS"
214
 
AC_MSG_RESULT(${scheme_cv_lib_db4})
215
 
 
216
 
if test "${scheme_cv_lib_pq}" = "yes"; then
217
 
    PQ_INCLUDE=
218
 
    if test -x "/usr/bin/pg_config"; then
219
 
        PQ_INCLUDE="$(/usr/bin/pg_config --includedir 2> /dev/null)"
220
 
    elif test -d "/usr/include/postgresql"; then
221
 
        PQ_INCLUDE="/usr/include/postgresql"
222
 
    fi
223
 
    if test "${PQ_INCLUDE}"; then
224
 
        CPPFLAGS="${CPPFLAGS} -I${PQ_INCLUDE}"
225
 
    fi
226
 
fi
227
 
 
228
213
dnl Checks for header files.
229
214
AC_HEADER_DIRENT
230
215
AC_HEADER_STDC
 
216
AC_HEADER_STDBOOL
231
217
AC_HEADER_SYS_WAIT
232
218
AC_HEADER_TIME
233
219
AC_CHECK_HEADERS([bsdtty.h fcntl.h limits.h malloc.h sgtty.h stropts.h time.h])
234
220
AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/poll.h])
235
221
AC_CHECK_HEADERS([sys/ptyio.h sys/socket.h sys/time.h sys/un.h sys/vfs.h])
236
 
AC_CHECK_HEADERS([stdbool.h termio.h termios.h unistd.h utime.h])
237
 
AC_CHECK_HEADERS([openssl/blowfish.h openssl/md5.h blowfish.h md5.h])
238
 
AC_CHECK_HEADERS([mhash.h mcrypt.h gdbm.h db.h curses.h term.h dlfcn.h])
239
 
AC_CHECK_HEADERS([sys/mman.h libpq-fe.h])
240
 
 
241
 
dnl Checks for typedefs
 
222
AC_CHECK_HEADERS([termio.h termios.h unistd.h utime.h])
 
223
AC_CHECK_HEADERS([dlfcn.h netdb.h signal.h])
 
224
AC_CHECK_HEADERS([sys/mman.h float.h assert.h stdint.h])
 
225
 
 
226
define([SCM_INC_TIME],
 
227
    [
 
228
    #ifdef TIME_WITH_SYS_TIME
 
229
    #  include <sys/time.h>
 
230
    #  include <time.h>
 
231
    #else
 
232
    #  ifdef HAVE_SYS_TIME_H
 
233
    #    include <sys/time.h>
 
234
    #  else
 
235
    #    include <time.h>
 
236
    #  endif
 
237
    #endif
 
238
    ])
 
239
 
 
240
define([SCM_INC_TERMIO],
 
241
    [
 
242
    #ifdef HAVE_TERMIOS_H
 
243
    #  include <termios.h>
 
244
    #else
 
245
    #  ifdef HAVE_TERMIO_H
 
246
    #    include <termio.h>
 
247
    #  endif
 
248
    #endif
 
249
    ])
 
250
 
 
251
define([SCM_INC_NETDB],
 
252
    [
 
253
    #ifdef HAVE_NETDB_H
 
254
    #  include <netdb.h>
 
255
    #endif
 
256
    ])
 
257
 
 
258
define([SCM_INC_SIGNAL],
 
259
    [
 
260
    #ifdef HAVE_SIGNAL_H
 
261
    #  include <signal.h>
 
262
    #endif
 
263
    ])
 
264
 
 
265
define([SCM_INC_SOCKET],
 
266
    [
 
267
    #include <sys/types.h>
 
268
    #ifdef HAVE_SYS_SOCKET_H
 
269
    #  include <sys/socket.h>
 
270
    #endif
 
271
    ])
 
272
 
 
273
define([SCM_INC_BSDTTY],
 
274
    [
 
275
    #ifdef HAVE_BSDTTY_H
 
276
    #  include <bsdtty.h>
 
277
    #endif
 
278
    ])
 
279
 
 
280
dnl Checks for types and structs
242
281
AC_TYPE_MODE_T
243
282
AC_TYPE_OFF_T
244
283
AC_TYPE_PID_T
245
284
AC_TYPE_SIGNAL
246
285
AC_TYPE_SIZE_T
247
286
AC_TYPE_UID_T
248
 
AC_CHECK_TYPE([nlink_t], [short])
249
 
 
250
 
AC_MSG_CHECKING([for clock_t])
251
 
AC_TRY_COMPILE([
252
 
#ifdef TIME_WITH_SYS_TIME
253
 
#  include <sys/time.h>
254
 
#  include <time.h>
255
 
#else
256
 
#  ifdef HAVE_SYS_TIME_H
257
 
#    include <sys/time.h>
258
 
#  else
259
 
#    include <time.h>
260
 
#  endif
261
 
#endif],
262
 
    [clock_t x;],
263
 
    [scheme_cv_type_clock_t=yes],
264
 
    [scheme_cv_type_clock_t=no])
265
 
AC_MSG_RESULT(${scheme_cv_type_clock_t})
266
 
if test "${scheme_cv_type_clock_t}" = "no"; then
267
 
    AC_DEFINE([clock_t], [unsigned long],
268
 
        [Define to `unsigned long' if <time.h> doesn't define.])
269
 
fi
270
 
 
271
 
AC_MSG_CHECKING([for time_t])
272
 
AC_TRY_COMPILE([
273
 
#ifdef TIME_WITH_SYS_TIME
274
 
#  include <sys/time.h>
275
 
#  include <time.h>
276
 
#else
277
 
#  ifdef HAVE_SYS_TIME_H
278
 
#    include <sys/time.h>
279
 
#  else
280
 
#    include <time.h>
281
 
#  endif
282
 
#endif],
283
 
    [time_t x;],
284
 
    [scheme_cv_type_time_t=yes],
285
 
    [scheme_cv_type_time_t=no])
286
 
AC_MSG_RESULT(${scheme_cv_type_time_t})
287
 
if test "${scheme_cv_type_time_t}" = "no"; then
288
 
    AC_DEFINE([time_t], [long],
289
 
        [Define to `long' if <time.h> doesn't define.])
290
 
fi
291
 
 
292
 
if test "${ac_cv_header_sys_socket_h}" = "yes"; then
293
 
    AC_MSG_CHECKING([for socklen_t])
294
 
    AC_TRY_COMPILE([
295
 
#include <sys/types.h>
296
 
#include <sys/socket.h>],
297
 
        [socklen_t x;],
298
 
        [scheme_cv_type_socklen_t=yes],
299
 
        [scheme_cv_type_socklen_t=no])
300
 
    AC_MSG_RESULT(${scheme_cv_type_socklen_t})
301
 
    if test "${scheme_cv_type_socklen_t}" = "no"; then
302
 
        AC_DEFINE([socklen_t], [int],
303
 
            [Define to `int' if <sys/socket.h> doesn't define.])
304
 
    fi
305
 
fi
306
 
 
307
 
AC_MSG_CHECKING([for cc_t])
308
 
AC_TRY_COMPILE([
309
 
#ifdef HAVE_TERMIOS_H
310
 
#  include <termios.h>
311
 
#else
312
 
#  ifdef HAVE_TERMIO_H
313
 
#    include <termio.h>
314
 
#  endif
315
 
#endif],
316
 
        [cc_t x;],
317
 
        [scheme_cv_type_cc_t=yes],
318
 
        [scheme_cv_type_cc_t=no])
319
 
AC_MSG_RESULT(${scheme_cv_type_cc_t})
320
 
if test "${scheme_cv_type_cc_t}" = "no"; then
321
 
    AC_DEFINE([cc_t], [unsigned char],
322
 
        [Define to `unsigned char' if <termios.h> doesn't define.])
323
 
fi
324
 
 
325
 
AC_MSG_CHECKING([for speed_t])
326
 
AC_TRY_COMPILE([
327
 
#ifdef HAVE_TERMIOS_H
328
 
#  include <termios.h>
329
 
#else
330
 
#  ifdef HAVE_TERMIO_H
331
 
#    include <termio.h>
332
 
#  endif
333
 
#endif],
334
 
        [speed_t x;],
335
 
        [scheme_cv_type_speed_t=yes],
336
 
        [scheme_cv_type_speed_t=no])
337
 
AC_MSG_RESULT(${scheme_cv_type_speed_t})
338
 
if test "${scheme_cv_type_speed_t}" = "no"; then
339
 
    AC_DEFINE([speed_t], [short],
340
 
        [Define to `short' if <termios.h> doesn't define.])
341
 
fi
342
 
 
343
 
dnl Checks for structures.
 
287
 
 
288
#AC_TYPE_INT8_T
 
289
#AC_TYPE_INT16_T
 
290
#AC_TYPE_INT32_T
 
291
#AC_TYPE_INTPTR_T
 
292
 
 
293
#AC_TYPE_UINT8_T
 
294
#AC_TYPE_UINT16_T
 
295
#AC_TYPE_UINT32_T
 
296
#AC_TYPE_UINTPTR_T
 
297
 
 
298
AC_CHECK_SIZEOF([char])
 
299
AC_CHECK_SIZEOF([short])
 
300
AC_CHECK_SIZEOF([int])
 
301
AC_CHECK_SIZEOF([long])
 
302
AC_CHECK_SIZEOF([unsigned char])
 
303
AC_CHECK_SIZEOF([unsigned short])
 
304
AC_CHECK_SIZEOF([unsigned int])
 
305
AC_CHECK_SIZEOF([unsigned long])
 
306
AC_CHECK_SIZEOF([void *])
 
307
#AC_CHECK_SIZEOF([intptr_t])
 
308
#AC_CHECK_SIZEOF([uintptr_t])
 
309
 
 
310
if test ${ac_cv_sizeof_char} -ne 1; then
 
311
    AC_MSG_ERROR([SIZEOF_CHAR is not 1])
 
312
fi
 
313
 
 
314
if test ${ac_cv_sizeof_unsigned_char} -ne 1; then
 
315
    AC_MSG_ERROR([SIZEOF_UNSIGNED_CHAR is not 1])
 
316
fi
 
317
 
 
318
AC_CHECK_TYPE([nlink_t],
 
319
    [],
 
320
    [AC_DEFINE([nlink_t], [short],
 
321
        [Define to 'short' if undefined.])])
 
322
 
 
323
AC_CHECK_TYPE([clock_t],
 
324
    [],
 
325
    [AC_DEFINE([clock_t], [unsigned long],
 
326
        [Define to `unsigned long' if <time.h> doesn't define.])],
 
327
    [SCM_INC_TIME])
 
328
 
 
329
AC_CHECK_TYPE([time_t], 
 
330
    [],
 
331
    [AC_DEFINE([time_t], [long],
 
332
        [Define to `long' if <time.h> doesn't define.])],
 
333
    [SCM_INC_TIME])
 
334
 
 
335
AC_CHECK_TYPE([socklen_t],
 
336
    [],
 
337
    [AC_DEFINE([socklen_t], [int],
 
338
        [Define to `int' if <sys/socket.h> doesn't define.])],
 
339
    [SCM_INC_SOCKET])
 
340
 
 
341
AC_CHECK_TYPE([cc_t],
 
342
    [],
 
343
    [AC_DEFINE([cc_t], [unsigned char],
 
344
        [Define to `unsigned char' if <termios.h> doesn't define.])],
 
345
    [SCM_INC_TERMIO])
 
346
 
 
347
AC_CHECK_TYPE([speed_t],
 
348
    [],
 
349
    [AC_DEFINE([speed_t], [short],
 
350
        [Define to `short' if <termios.h> doesn't define.])],
 
351
    [SCM_INC_TERMIO])
 
352
 
344
353
AC_STRUCT_TM
345
354
AC_STRUCT_TIMEZONE
346
355
 
347
 
 
348
356
dnl Timezone stuff is hairy; there's no standard.
349
357
have_timezone_info=no
350
 
 
351
 
if test "${have_timezone_info}" = "no"; then
352
 
    AC_MSG_CHECKING([for tm_gmtoff in struct tm])
353
 
    AC_TRY_LINK(
354
 
        [#include <time.h>],
355
 
        [struct tm t; t.tm_gmtoff],
356
 
        [scheme_cv_struct_tm_gmtoff=yes],
357
 
        [scheme_cv_struct_tm_gmtoff=no])
358
 
    AC_MSG_RESULT(${scheme_cv_struct_tm_gmtoff})
359
 
    if test "${scheme_cv_struct_tm_gmtoff}" = "yes"; then
360
 
        AC_DEFINE([HAVE_TM_GMTOFF], [1],
361
 
            [Define if `struct tm' has the `tm_gmtoff' member.])
362
 
        AC_DEFINE([TM_GMTOFF], [tm_gmtoff],
363
 
            [Define to name of `tm_gmtoff' member if available.])
364
 
        have_timezone_info=yes
365
 
    fi
366
 
fi
367
 
 
368
 
if test "${have_timezone_info}" = "no"; then
369
 
    AC_MSG_CHECKING([for __tm_gmtoff in struct tm])
370
 
    AC_TRY_LINK(
371
 
        [#include <time.h>],
372
 
        [struct tm t; t.__tm_gmtoff],
373
 
        [scheme_cv_struct___tm_gmtoff=yes],
374
 
        [scheme_cv_struct___tm_gmtoff=no])
375
 
    AC_MSG_RESULT(${scheme_cv_struct___tm_gmtoff})
376
 
    if test "${scheme_cv_struct___tm_gmtoff}" = "yes"; then
377
 
        AC_DEFINE([HAVE_TM_GMTOFF], [1],
378
 
            [Define if `struct tm' has the `tm_gmtoff' member.])
379
 
        AC_DEFINE([TM_GMTOFF], [__tm_gmtoff],
380
 
            [Define to name of `tm_gmtoff' member if available.])
381
 
        have_timezone_info=yes
382
 
    fi
383
 
fi
384
 
 
385
 
if test "${have_timezone_info}" = "no"; then
386
 
    AC_MSG_CHECKING([for __timezone])
387
 
    AC_TRY_LINK([
388
 
#ifdef TIME_WITH_SYS_TIME
389
 
#  include <sys/time.h>
390
 
#  include <time.h>
391
 
#else
392
 
#  ifdef HAVE_SYS_TIME_H
393
 
#    include <sys/time.h>
394
 
#  else
395
 
#    include <time.h>
396
 
#  endif
397
 
#endif],
398
 
        [__timezone;],
399
 
        [scheme_cv_var___timezone=yes],
400
 
        [scheme_cv_var___timezone=no])
401
 
    AC_MSG_RESULT(${scheme_cv_var___timezone})
402
 
    if test "${scheme_cv_var___timezone}" = "yes"; then
403
 
        AC_DEFINE([HAVE_TIMEZONE], [1],
404
 
            [Define if timezone variable is available.])
405
 
        AC_DEFINE([TIMEZONE], [__timezone],
406
 
            [Define to name of timezone variable if available.])
407
 
        have_timezone_info=yes
408
 
    fi
409
 
fi
410
 
 
411
 
if test "${have_timezone_info}" = "no"; then
412
 
    AC_MSG_CHECKING([for _timezone])
413
 
    AC_TRY_LINK([
414
 
#ifdef TIME_WITH_SYS_TIME
415
 
#  include <sys/time.h>
416
 
#  include <time.h>
417
 
#else
418
 
#  ifdef HAVE_SYS_TIME_H
419
 
#    include <sys/time.h>
420
 
#  else
421
 
#    include <time.h>
422
 
#  endif
423
 
#endif],
424
 
        [_timezone;],
425
 
        [scheme_cv_var__timezone=yes],
426
 
        [scheme_cv_var__timezone=no])
427
 
    AC_MSG_RESULT(${scheme_cv_var__timezone})
428
 
    if test "${scheme_cv_var__timezone}" = "yes"; then
429
 
        AC_DEFINE([HAVE_TIMEZONE], [1],
430
 
            [Define if timezone variable is available.])
431
 
        AC_DEFINE([TIMEZONE], [_timezone],
432
 
            [Define to name of timezone variable if available.])
433
 
        have_timezone_info=yes
434
 
    fi
435
 
fi
436
 
 
437
 
if test "${have_timezone_info}" = "no"; then
438
 
    AC_MSG_CHECKING([for timezone])
439
 
    AC_TRY_LINK([
440
 
#ifdef TIME_WITH_SYS_TIME
441
 
#  include <sys/time.h>
442
 
#  include <time.h>
443
 
#else
444
 
#  ifdef HAVE_SYS_TIME_H
445
 
#    include <sys/time.h>
446
 
#  else
447
 
#    include <time.h>
448
 
#  endif
449
 
#endif],
450
 
        [timezone;],
451
 
        [scheme_cv_var_timezone=yes],
452
 
        [scheme_cv_var_timezone=no])
453
 
    AC_MSG_RESULT(${scheme_cv_var_timezone})
454
 
    if test "${scheme_cv_var_timezone}" = "yes"; then
455
 
        AC_DEFINE([HAVE_TIMEZONE], [1],
456
 
            [Define if timezone variable is available.])
457
 
        AC_DEFINE([TIMEZONE], [timezone],
458
 
            [Define to name of timezone variable if available.])
459
 
        have_timezone_info=yes
460
 
    fi
461
 
fi
462
 
 
463
 
if test "${ac_cv_header_bsdtty_h}" = "yes"; then
464
 
    AC_MSG_CHECKING([for struct ltchars])
465
 
    AC_TRY_COMPILE(
466
 
        [#include <bsdtty.h>],
467
 
        [struct ltchars x;],
468
 
        [scheme_cv_struct_ltchars=yes],
469
 
        [scheme_cv_struct_ltchars=no])
470
 
    AC_MSG_RESULT(${scheme_cv_struct_ltchars})
471
 
    if test "${scheme_cv_struct_ltchars}" = "yes"; then
472
 
        AC_DEFINE([HAVE_STRUCT_LTCHARS], [1],
473
 
            [Define if `struct ltchars' is defined in <bsdtty.h>.])
474
 
    fi
475
 
fi
476
 
 
477
 
AC_MSG_CHECKING([for hostent h_addr_list])
478
 
AC_TRY_COMPILE(
479
 
    [#include <netdb.h>],
480
 
    [struct hostent x; x.h_addr_list;],
481
 
    [scheme_cv_struct_hostent_h_addr_list=yes],
482
 
    [scheme_cv_struct_hostent_h_addr_list=no])
483
 
AC_MSG_RESULT(${scheme_cv_struct_hostent_h_addr_list})
484
 
if test "${scheme_cv_struct_hostent_h_addr_list}" = "yes"; then
485
 
    AC_DEFINE([HAVE_HOSTENT_H_ADDR_LIST], [1],
486
 
        [Define if `struct hostent' has the `h_addr_list' member.])
487
 
fi
488
 
 
489
 
AC_MSG_CHECKING([for struct sigcontext])
490
 
AC_TRY_COMPILE(
491
 
    [#include <signal.h>],
492
 
    [struct sigcontext x;],
493
 
    [scheme_cv_struct_sigcontext=yes],
494
 
    [scheme_cv_struct_sigcontext=no])
495
 
AC_MSG_RESULT(${scheme_cv_struct_sigcontext})
496
 
if test "${scheme_cv_struct_sigcontext}" = "yes"; then
497
 
    AC_DEFINE([HAVE_STRUCT_SIGCONTEXT], [1],
498
 
        [Define if `struct sigcontext' is defined in <signal.h>.])
499
 
fi
 
358
val_tm_gmtoff=
 
359
val_timezone=
 
360
 
 
361
if test ${have_timezone_info} = no; then
 
362
    AC_CHECK_MEMBER([struct tm.tm_gmtoff],
 
363
        [
 
364
        have_timezone_info=yes
 
365
        val_tm_gmtoff=tm_gmtoff
 
366
        ],
 
367
        [],
 
368
        [SCM_INC_TIME])
 
369
fi
 
370
 
 
371
if test ${have_timezone_info} = no; then
 
372
    AC_CHECK_MEMBER([struct tm.__tm_gmtoff],
 
373
        [
 
374
        have_timezone_info=yes
 
375
        val_tm_gmtoff=__tm_gmtoff
 
376
        ],
 
377
        [],
 
378
        [SCM_INC_TIME])
 
379
fi
 
380
 
 
381
if test ${have_timezone_info} = no; then
 
382
    AC_CHECK_DECL([__timezone],
 
383
        [
 
384
        have_timezone_info=yes
 
385
        val_timezone=__timezone
 
386
        ],
 
387
        [],
 
388
        [SCM_INC_TIME])
 
389
fi
 
390
 
 
391
if test ${have_timezone_info} = no; then
 
392
    AC_CHECK_DECL([_timezone],
 
393
        [
 
394
        have_timezone_info=yes
 
395
        val_timezone=_timezone
 
396
        ],
 
397
        [],
 
398
        [SCM_INC_TIME])
 
399
fi
 
400
 
 
401
if test ${have_timezone_info} = no; then
 
402
    AC_CHECK_DECL([timezone],
 
403
        [
 
404
        have_timezone_info=yes
 
405
        val_timezone=timezone
 
406
        ],
 
407
        [],
 
408
        [SCM_INC_TIME])
 
409
fi
 
410
 
 
411
if test -n "${val_tm_gmtoff}"; then
 
412
    AC_DEFINE([HAVE_TM_GMTOFF], [1],
 
413
        [Define if `struct tm' has the `tm_gmtoff' member.])
 
414
    AC_DEFINE_UNQUOTED([TM_GMTOFF], [${val_tm_gmtoff}],
 
415
        [Define to name of `tm_gmtoff' member if available.])
 
416
fi
 
417
 
 
418
if test -n "${val_timezone}"; then
 
419
    AC_DEFINE([HAVE_TIMEZONE], [1],
 
420
        [Define if timezone variable is available.])
 
421
    AC_DEFINE_UNQUOTED([TIMEZONE], [${val_timezone}],
 
422
        [Define to name of timezone variable if available.])
 
423
fi
 
424
 
 
425
AC_CHECK_TYPE([struct ltchars],
 
426
    [AC_DEFINE([HAVE_STRUCT_LTCHARS], [1],
 
427
        [Define if `struct ltchars' is defined in <bsdtty.h>.])],
 
428
    [],
 
429
    [SCM_INC_BSDTTY])
 
430
 
 
431
AC_CHECK_MEMBER([struct hostent.h_addr_list],
 
432
    [AC_DEFINE([HAVE_HOSTENT_H_ADDR_LIST], [1],
 
433
        [Define if `struct hostent' has the `h_addr_list' member.])],
 
434
    [],
 
435
    [SCM_INC_NETDB])
 
436
 
 
437
AC_CHECK_TYPE([struct sigcontext],
 
438
    [AC_DEFINE([HAVE_STRUCT_SIGCONTEXT], [1],
 
439
        [Define if `struct sigcontext' is defined in <signal.h>.])],
 
440
    [],
 
441
    [SCM_INC_SIGNAL])
500
442
 
501
443
dnl Checks for compiler characteristics.
502
444
AC_C_BIGENDIAN
503
445
AC_C_CHAR_UNSIGNED
504
446
AC_C_CONST
505
 
AC_CHECK_SIZEOF([unsigned long])
506
447
 
507
448
dnl Checks for C library functions.
508
449
AC_FUNC_GETPGRP
532
473
AC_CHECK_FUNCS([uname utime])
533
474
AC_CHECK_FUNCS([waitpid])
534
475
 
535
 
if test "${ac_cv_type_signal}" = "void"; then
 
476
if test ${ac_cv_type_signal} = void; then
536
477
    AC_DEFINE([VOID_SIGNAL_HANDLERS], [1],
537
478
        [Define if RETSIGTYPE is `void'.])
538
479
fi
539
480
 
540
481
dnl Checks for system characteristics.
541
482
AC_CANONICAL_HOST
542
 
AC_PATH_XTRA
 
483
AC_PATH_X
543
484
AC_SYS_LARGEFILE
544
485
AC_SYS_LONG_FILE_NAMES
545
486
AC_SYS_RESTARTABLE_SYSCALLS
546
487
 
547
 
if test "${ac_cv_lib_dl_dlopen}" = "yes"; then
548
 
    OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld"
549
 
    enable_dynamic_modules="${enable_dynamic_modules:-yes}"
550
 
else
551
 
    enable_dynamic_modules="no"
552
 
fi
553
 
 
554
 
dnl Handle options to enable/disable use of some libraries.
555
 
test "${with_openssl:-yes}" = "yes" || scheme_cv_lib_crypto="no"
556
 
test "${with_mhash:-yes}" = "yes" || scheme_cv_lib_mhash="no"
557
 
test "${with_mcrypt:-yes}" = "yes" || scheme_cv_lib_mcrypt="no"
558
 
test "${with_gdbm:-yes}" = "yes" || scheme_cv_lib_gdbm="no"
559
 
test "${with_db4:-yes}" = "yes" || scheme_cv_lib_db4="no"
560
 
test "${with_libpq:-yes}" = "yes" || scheme_cv_lib_pq="no"
561
 
 
562
 
dnl OK, now some complex logic to handle the crypto stuff.
563
 
 
564
 
dnl Next, we decide which libraries to use.  We mostly want support
565
 
dnl for Blowfish and MD5, each of which can come from multiple libraries.
566
 
HAVE_BLOWFISH="no"
567
 
HAVE_MD5="no"
568
 
 
569
 
dnl The OpenSSL crypto library provides support for both, and is preferred.
570
 
if test "${scheme_cv_lib_crypto}" = "yes"; then
571
 
    AC_DEFINE([HAVE_LIBCRYPTO], [1],
572
 
        [Define if OpenSSL crypto library is present.])
573
 
    if test "${ac_cv_header_openssl_blowfish_h}" = "yes" \
574
 
            || test "${ac_cv_header_blowfish_h}" = "yes"; then
575
 
        if test "${enable_dynamic_modules}" = "yes"; then
576
 
            MODULE_BASES="${MODULE_BASES} prbfish"
577
 
            PRBFISH_LIBS="-lcrypto"
578
 
        else
579
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
580
 
        fi
581
 
        HAVE_BLOWFISH="yes"
582
 
    fi
583
 
    if test "${ac_cv_header_openssl_md5_h}" = "yes" \
584
 
            || test "${ac_cv_header_md5_h}" = "yes"; then
585
 
        if test "${enable_dynamic_modules}" = "yes"; then
586
 
            MODULE_BASES="${MODULE_BASES} prmd5"
587
 
            PRMD5_LIBS="-lcrypto"
588
 
        else
589
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
590
 
        fi
591
 
        HAVE_MD5="yes"
592
 
    fi
593
 
    if test "${enable_dynamic_modules}" != "yes"; then
594
 
        if test "${HAVE_BLOWFISH}" = "yes" || test "${HAVE_MD5}" = "yes"; then
595
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lcrypto"
596
 
        fi
597
 
    fi
 
488
dnl curses/termcap/terminfo support
 
489
AC_CHECK_LIB([ncurses], [tparm],
 
490
    [
 
491
    AC_DEFINE([HAVE_LIBNCURSES], [1],
 
492
        [Define to 1 if you have the `ncurses' library (-lncurses).])
 
493
    STATIC_LIBS="-lncurses ${STATIC_LIBS}"
 
494
    AC_CHECK_HEADER([curses.h],
 
495
        [
 
496
        AC_DEFINE([HAVE_CURSES_H], [1],
 
497
            [Define to 1 if you have the <curses.h> header file.])
 
498
        AC_CHECK_HEADER([term.h],
 
499
            [
 
500
            AC_DEFINE([HAVE_TERM_H], [1],
 
501
                [Define to 1 if you have the <term.h> header file.])
 
502
            AC_CHECK_LIB([ncurses], [tparam],
 
503
                [
 
504
                AC_DEFINE([LIBNCURSES_DEFINES_TPARAM], [1],
 
505
                    [Define if ncurses library defines `tparam'.])
 
506
                ],
 
507
                [
 
508
                OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
 
509
                ])
 
510
            ])
 
511
        ])
 
512
    ],
 
513
    [AC_CHECK_LIB([curses], [tparm],
 
514
        [
 
515
        AC_DEFINE([HAVE_LIBCURSES], [1],
 
516
            [Define to 1 if you have the `curses' library (-lcurses).])
 
517
        STATIC_LIBS="-lcurses ${STATIC_LIBS}"
 
518
        OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
 
519
        ],
 
520
        [
 
521
        AC_CHECK_LIB([termcap], [tparam],
 
522
            [
 
523
            AC_DEFINE([HAVE_LIBTERMCAP], [1],
 
524
                [Define to 1 if you have the `termcap' library (-ltermcap).])
 
525
            STATIC_LIBS="-ltermcap ${STATIC_LIBS}"
 
526
            ],
 
527
            [
 
528
            OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
 
529
            ])
 
530
        ])
 
531
    ])
 
532
 
 
533
dnl The OpenSSL crypto library provides support for blowfish and MD5.
 
534
if test "${with_openssl}" != no; then
 
535
    if test "${with_openssl}" != yes; then
 
536
        CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
 
537
        LDFLAGS="${LDFLAGS} -L${with_openssl}/lib"
 
538
    fi
 
539
    AC_CHECK_HEADERS([openssl/blowfish.h openssl/md5.h])
 
540
    AC_CHECK_LIB([crypto], [BF_set_key],
 
541
        [
 
542
        AC_DEFINE([HAVE_LIBCRYPTO], [1],
 
543
            [Define to 1 if you have the `crypto' library (-lcrypto).])
 
544
        MODULE_LIBS="-lcrypto ${MODULE_LIBS}"
 
545
        MODULE_BASES="${MODULE_BASES} prbfish prmd5"
 
546
        PRBFISH_LIBS="-lcrypto"
 
547
        PRMD5_LIBS="-lcrypto"
 
548
        ])
598
549
fi
599
550
 
600
551
dnl These libraries might not be installed, so take care generating
604
555
dnl respectively, to avoid warnings in "Makefile.deps" and its embeds.
605
556
dnl Finally, note that "prmd5.c" is similarly conditionalized as well.
606
557
 
607
 
dnl The mhash library provides md5 support.  It can be loaded in addition
 
558
dnl The mhash library provides MD5 support.  It can be loaded in addition
608
559
dnl to other MD5 libraries and provides a rich set of hashes.
609
 
if test "${scheme_cv_lib_mhash}" = "yes"; then
610
 
    AC_DEFINE([HAVE_LIBMHASH], [1],
611
 
        [Define if mhash library is present.])
612
 
    if test "${ac_cv_header_mhash_h}" = "yes"; then
613
 
        if test "${enable_dynamic_modules}" = "yes"; then
 
560
if test "${with_mhash}" != no; then
 
561
    if test "${with_mhash}" != yes; then
 
562
        CPPFLAGS="${CPPFLAGS} -I${with_mhash}/include"
 
563
        LDFLAGS="${LDFLAGS} -L${with_mhash}/lib"
 
564
    fi
 
565
    AC_CHECK_HEADER([mhash.h],
 
566
        [
 
567
        AC_DEFINE([HAVE_MHASH_H], [1],
 
568
            [Define to 1 if you have the <mhash.h> header file.])
 
569
        AC_CHECK_LIB([mhash], [mhash_count],
 
570
            [
 
571
            AC_DEFINE([HAVE_LIBMHASH], [1],
 
572
                [Define to 1 if you have the `mhash' library (-lmhash).])
 
573
            MODULE_LIBS="-lmhash ${MODULE_LIBS}"
614
574
            MODULE_BASES="${MODULE_BASES} prmhash"
615
 
        else
616
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmhash"
617
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prmhash"
618
 
        fi
619
 
        HAVE_MD5="yes"
620
 
    fi
 
575
            if test "x${PRMD5_LIBS}" = x; then
 
576
                PRMD5_LIBS="-lmhash"
 
577
            fi
 
578
            ])
 
579
        ])
621
580
fi
622
581
 
623
582
dnl The mcrypt library provides blowfish, but its CFB mode is 8 bit.
624
583
dnl We have been using 64-bit CFB, so this isn't really compatible.
625
584
dnl But mcrypt provides many ciphers and can be loaded in addition.
626
 
if test "${scheme_cv_lib_mcrypt}" = "yes"; then
627
 
    AC_DEFINE([HAVE_LIBMCRYPT], [1],
628
 
        [Define if mcrypt library is present.])
629
 
    if test "${ac_cv_header_mcrypt_h}" = "yes"; then
630
 
        if test "${enable_dynamic_modules}" = "yes"; then
 
585
if test "${with_mcrypt}" != no; then
 
586
    if test "${with_mcrypt}" != yes; then
 
587
        CPPFLAGS="${CPPFLAGS} -I${with_mcrypt}/include"
 
588
        LDFLAGS="${LDFLAGS} -L${with_mcrypt}/lib"
 
589
    fi
 
590
    AC_CHECK_HEADER([mcrypt.h],
 
591
        [
 
592
        AC_DEFINE([HAVE_MCRYPT_H], [1],
 
593
            [Define to 1 if you have the <mcrypt.h> header file.])
 
594
        AC_CHECK_LIB([ltdl], [lt_dlinit], [mc_libs=-lltdl], [mc_libs=])
 
595
        AC_CHECK_LIB([mcrypt], [mcrypt_generic_init],
 
596
            [
 
597
            AC_DEFINE([HAVE_LIBMCRYPT], [1],
 
598
                [Define to 1 if you have the `mcrypt' library (-lmcrypt).])
 
599
            MODULE_LIBS="-lmcrypt ${mc_libs} ${MODULE_LIBS}"
631
600
            MODULE_BASES="${MODULE_BASES} prmcrypt"
632
 
        else
633
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmcrypt -lltdl"
634
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prmcrypt"
635
 
        fi
636
 
    fi
637
 
fi
638
 
 
639
 
dnl This is a stripped-down library that provides just Blowfish.  It
640
 
dnl seems to be code that was extracted from OpenSSL long ago.  We
641
 
dnl used this for a long time but no longer do.
642
 
if test "${HAVE_BLOWFISH}" = "no"; then
643
 
    if test "${scheme_cv_lib_blowfish}" = "yes"; then
644
 
        AC_DEFINE([HAVE_LIBBLOWFISH], [1],
645
 
            [Define if blowfish library is present.])
646
 
        if test "${ac_cv_header_blowfish_h}" = "yes"; then
647
 
            if test "${enable_dynamic_modules}" = "yes"; then
648
 
                MODULE_BASES="${MODULE_BASES} prbfish"
649
 
                PRBFISH_LIBS="-lblowfish"
650
 
            else
651
 
                STATIC_LIBS="${STATIC_LIBS} -lblowfish"
652
 
                OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
653
 
            fi
654
 
            HAVE_BLOWFISH="yes"
655
 
        fi
656
 
    fi
657
 
fi
658
 
 
659
 
dnl This is Phil Karn's MD5 implementation, which seems to have nearly
660
 
dnl the same interface as that of OpenSSL.
661
 
if test "${HAVE_MD5}" = "no"; then
662
 
    if test "${scheme_cv_lib_md5}" = "yes"; then
663
 
        AC_DEFINE([HAVE_LIBMD5], [1],
664
 
            [Define if md5 library is present.])
665
 
        if test "${ac_cv_header_md5_h}" = "yes"; then
666
 
            if test "${enable_dynamic_modules}" = "yes"; then
667
 
                MODULE_BASES="${MODULE_BASES} prmd5"
668
 
                PRMD5_LIBS="-lmd5"
669
 
            else
670
 
                STATIC_LIBS="${STATIC_LIBS} -lmd5"
671
 
                OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
672
 
            fi
673
 
            HAVE_MD5="yes"
674
 
        fi
675
 
    fi
676
 
fi
677
 
 
678
 
dnl gdbm support.
679
 
if test "${scheme_cv_lib_gdbm}" = "yes"; then
680
 
    AC_DEFINE([HAVE_LIBGDBM], [1],
681
 
        [Define if gdbm library is present.])
682
 
    if test "${ac_cv_header_gdbm_h}" = "yes"; then
683
 
        if test "${enable_dynamic_modules}" = "yes"; then
 
601
            ],
 
602
            [],
 
603
            [${mc_libs}])
 
604
        ])
 
605
fi
 
606
 
 
607
dnl gdbm support
 
608
if test "${with_gdbm}" != no; then
 
609
    if test "${with_gdbm}" != yes; then
 
610
        CPPFLAGS="${CPPFLAGS} -I${with_gdbm}/include"
 
611
        LDFLAGS="${LDFLAGS} -L${with_gdbm}/lib"
 
612
    fi
 
613
    AC_CHECK_HEADER([gdbm.h],
 
614
        [
 
615
        AC_DEFINE([HAVE_GDBM_H], [1],
 
616
            [Define to 1 if you have the <gdbm.h> header file.])
 
617
        AC_CHECK_LIB([gdbm], [gdbm_open],
 
618
            [
 
619
            AC_DEFINE([HAVE_LIBGDBM], [1],
 
620
                [Define to 1 if you have the `gdbm' library (-lgdbm).])
 
621
            MODULE_LIBS="-lgdbm ${MODULE_LIBS}"
684
622
            MODULE_BASES="${MODULE_BASES} prgdbm"
685
 
        else
686
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lgdbm"
687
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prgdbm"
688
 
        fi
689
 
    fi
 
623
            ])
 
624
        ])
690
625
fi
691
626
 
692
 
dnl db4 support.
693
 
if test "${scheme_cv_lib_db4}" = "yes"; then
694
 
    AC_DEFINE([HAVE_LIBDB4], [1],
695
 
        [Define if db4 library is present.])
696
 
    if test "${ac_cv_header_db_h}" = "yes"; then
697
 
        if test "${enable_dynamic_modules}" = "yes"; then
 
627
dnl DB v4 support
 
628
if test "${with_db_4}" != no; then
 
629
    if test "${with_db_4}" != yes; then
 
630
        CPPFLAGS="${CPPFLAGS} -I${with_db_4}/include"
 
631
        LDFLAGS="${LDFLAGS} -L${with_db_4}/lib"
 
632
    fi
 
633
    AC_CHECK_HEADER([db.h],
 
634
        [
 
635
        AC_DEFINE([HAVE_DB_H], [1],
 
636
            [Define to 1 if you have the <db.h> header file.])
 
637
        AC_MSG_CHECKING([for db_create in -ldb-4])
 
638
        save_LIBS=${LIBS}
 
639
        LIBS="${LIBS} -ldb-4"
 
640
        AC_LINK_IFELSE(
 
641
            [AC_LANG_PROGRAM(
 
642
                [[#include <db.h>]],
 
643
                [[db_create (0, 0, 0)]])],
 
644
            [
 
645
            AC_MSG_RESULT([yes])
 
646
            AC_DEFINE([HAVE_LIBDB_4], [1], 
 
647
                [Define to 1 if you have the `db-4' library (-ldb-4).])
 
648
            MODULE_LIBS="-ldb-4 ${MODULE_LIBS}"
698
649
            MODULE_BASES="${MODULE_BASES} prdb4"
699
 
        else
700
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -ldb-4"
701
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prdb4"
702
 
        fi
703
 
    fi
 
650
            ],
 
651
            [
 
652
            AC_MSG_RESULT([no])
 
653
            ])
 
654
        LIBS=${save_LIBS}
 
655
        ])
704
656
fi
705
657
 
706
 
dnl curses/termcap/terminfo support.
707
 
if test "${scheme_cv_lib_ncurses}" = "yes"; then
708
 
    AC_DEFINE([HAVE_LIBNCURSES], [1],
709
 
        [Define if ncurses library is present.])
710
 
    if test "${ac_cv_header_curses_h}" = "yes" \
711
 
        && test "${ac_cv_header_term_h}" = "yes"; then
712
 
        QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lncurses"
713
 
        if test "${scheme_cv_lib_ncurses_defines_tparam}" = "yes"; then
714
 
            AC_DEFINE([LIBNCURSES_DEFINES_TPARAM], [1],
715
 
                [Define if ncurses library defines `tparam'.])
716
 
        else
717
 
            OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
718
 
        fi
719
 
    fi
720
 
else
721
 
    if test "${scheme_cv_lib_curses}" = "yes"; then
722
 
        AC_DEFINE([HAVE_LIBCURSES], [1],
723
 
            [Define if curses library is present.])
724
 
        QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lcurses"
725
 
        OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
 
658
dnl PostgreSQL support
 
659
if test "${with_libpq}" != no; then
 
660
    if test "${with_libpq}" != yes; then
 
661
        libpq_inc=${with_libpq}/include
 
662
        libpq_lib=${with_libpq}/lib
726
663
    else
727
 
        if test "${scheme_cv_lib_termcap}" = "yes"; then
728
 
            AC_DEFINE([HAVE_LIBTERMCAP], [1],
729
 
                [Define if termcap library is present.])
730
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -ltermcap"
731
 
            OPTIONAL_BASES="${OPTIONAL_BASES} tparam"
 
664
        AC_PATH_PROG([PG_CONFIG], [pg_config])
 
665
        if test "x${PG_CONFIG}" != x; then
 
666
            libpq_inc=`${PG_CONFIG} --includedir 2>/dev/null`
 
667
            libpq_lib=`${PG_CONFIG} --libdir 2>/dev/null`
732
668
        else
733
 
            OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
 
669
            if test -d /usr/include/postgresql; then
 
670
               libpq_inc=/usr/include/postgresql
 
671
            else
 
672
               libpq_inc=/usr/include
 
673
            fi
 
674
            libpq_lib=/usr/lib
734
675
        fi
735
676
    fi
736
 
fi
737
 
 
738
 
dnl PostgreSQL support.
739
 
if test "${scheme_cv_lib_pq}" = "yes"; then
740
 
    AC_DEFINE([HAVE_LIBPQ], [1],
741
 
        [Define if PostgreSQL libpq library is present.])
742
 
    if test "${ac_cv_header_libpq_fe_h}" = "yes"; then
743
 
        if test "${enable_dynamic_modules}" = "yes"; then
 
677
    if test "${libpq_inc}" != /usr/include; then
 
678
        CPPFLAGS="${CPPFLAGS} -I${libpq_inc}"
 
679
    fi
 
680
    if test "${libpq_lib}" != /usr/lib; then
 
681
        LDFLAGS="${LDFLAGS} -L${libpq_lib}"
 
682
    fi
 
683
    AC_CHECK_HEADER([libpq-fe.h],
 
684
        [
 
685
        AC_DEFINE([HAVE_LIBPQ_FE_H], [1],
 
686
            [Define to 1 if you have the <libpq-fe.h> header file.])
 
687
        AC_CHECK_LIB([pq], [PQconnectdb],
 
688
            [
 
689
            AC_DEFINE([HAVE_LIBPQ], [1],
 
690
                [Define to 1 if you have the `pq' library (-lpq).])
 
691
            MODULE_LIBS="-lpq ${MODULE_LIBS}"
744
692
            MODULE_BASES="${MODULE_BASES} prpgsql"
745
 
        else
746
 
            QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lpq"
747
 
            OPTIONAL_BASES="${OPTIONAL_BASES} prpgsql"
748
 
        fi
749
 
    fi
 
693
            ])
 
694
        ])
750
695
fi
751
696
 
752
697
dnl Decide whether we're using static or dynamic libraries.
753
 
if test "${enable_static_libs:-no}" = "no"; then
754
 
    LIBS="${LIBS}${QUASI_STATIC_LIBS}"
 
698
if test "${enable_static_libs}" = no; then
 
699
    AC_CHECK_FUNC([dlopen],
 
700
        [
 
701
        LIBS="${STATIC_LIBS} ${LIBS}"
 
702
        ],
 
703
        [
 
704
        AC_CHECK_LIB([dl], [dlopen],
 
705
            [
 
706
            AC_DEFINE([HAVE_LIBDL], [1],
 
707
                [Define to 1 if you have the `dl' library (-ldl).])
 
708
            LIBS="${STATIC_LIBS} -ldl ${LIBS}"
 
709
            ],
 
710
            [enable_static_libs=yes])
 
711
        ])
 
712
fi
 
713
if test ${enable_static_libs} != no; then
 
714
    STATIC_LIBS=${MODULE_LIBS}${STATIC_LIBS}
755
715
else
756
 
    STATIC_LIBS="${STATIC_LIBS}${QUASI_STATIC_LIBS}"
 
716
    STATIC_LIBS=
 
717
    OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld"
757
718
fi
758
719
 
759
 
if test "${enable_valgrind_mode:-no}" != "no"; then
 
720
if test ${enable_valgrind_mode} != no; then
760
721
    SCHEME_DEFS="${SCHEME_DEFS} -DVALGRIND_MODE"
761
722
    M4_FLAGS="${M4_FLAGS} -P VALGRIND_MODE,1"
762
723
fi
763
724
 
764
725
dnl Add support for X if present.
765
 
if test "${no_x}" = "yes"; then
766
 
    LIB_X11=
767
 
else
768
 
    LIB_X11=-lX11
 
726
if test "${no_x}" != yes; then
 
727
    if test "x${x_includes}" != x; then
 
728
        FOO=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
 
729
        CPPFLAGS="${CPPFLAGS} ${FOO}"
 
730
    fi
 
731
    if test "x${x_libraries}" != x; then
 
732
        FOO=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
 
733
        LIBS="${LIBS} ${FOO}"
 
734
    fi
 
735
    LIBS="${LIBS} -lX11"
769
736
    OPTIONAL_BASES="${OPTIONAL_BASES} x11base x11term x11graph x11color"
770
737
fi
771
738
 
772
739
dnl Add OS-dependent customizations.
773
 
DO_GCC_TESTS="no"
774
 
case "$host_os" in
 
740
DO_GCC_TESTS=no
 
741
case ${host_os} in
775
742
linux-gnu)
776
 
    DO_GCC_TESTS="yes"
 
743
    DO_GCC_TESTS=yes
777
744
    ;;
778
745
freebsd*)
779
746
    M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
780
747
    ;;
 
748
darwin*)
 
749
    DLD_LDFLAGS="${DLD_LDFLAGS} -Wl,-pagezero_size,04000000"
 
750
    MODULE_LDFLAGS="${MODULE_LDFLAGS} -dynamiclib -flat_namespace -undefined suppress"
 
751
    ;;
 
752
netbsd*)
 
753
    DO_GCC_TESTS=yes
 
754
    dnl NetBSD, by default, has programs find non-base libraries via RPATH
 
755
    if test "x${x_libraries}" != x; then
 
756
        FOO=-Wl,-rpath,`echo ${x_libraries} | sed -e "s/:/ -Wl,-rpath,/g"`
 
757
        LDFLAGS="${LDFLAGS} ${FOO}"
 
758
    fi
 
759
    ;;
781
760
solaris*)
782
 
    if test "${GCC}" = "yes"; then
783
 
        DO_GCC_TESTS="yes"
 
761
    if test ${GCC} = yes; then
 
762
        DO_GCC_TESTS=yes
784
763
        M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
785
764
    fi
786
765
    ;;
787
766
esac
788
767
 
789
 
if test "${DO_GCC_TESTS}" = "yes"; then
790
 
    if test "${STATIC_LIBS}" != ""; then
 
768
if test ${DO_GCC_TESTS} = yes; then
 
769
    if test "x${STATIC_LIBS}" != x; then
791
770
        STATIC_PREFIX="-Xlinker -Bstatic"
792
771
        STATIC_SUFFIX="-Xlinker -Bdynamic"
793
772
    fi
795
774
    MODULE_CFLAGS="${MODULE_CFLAGS} -fPIC"
796
775
    MODULE_LDFLAGS="${MODULE_LDFLAGS} -shared"
797
776
    AC_MSG_CHECKING([for ELF binaries])
798
 
    AC_TRY_RUN(
799
 
[int
800
 
main ()
801
 
{
802
 
#ifdef __ELF__
803
 
return 0;
804
 
#endif
805
 
return 1;
806
 
}],
807
 
        [scheme_cv_linux_elf=yes],
808
 
        [scheme_cv_linux_elf=no])
809
 
    AC_MSG_RESULT(${scheme_cv_linux_elf})
810
 
    if test "${scheme_cv_linux_elf}" = "yes"; then
 
777
    AC_RUN_IFELSE(
 
778
        [AC_LANG_PROGRAM(
 
779
            [[]],
 
780
            [[
 
781
            #ifdef __ELF__
 
782
            return 0;
 
783
            #endif
 
784
            return 1;
 
785
            ]]
 
786
        )],
 
787
        [
 
788
        AC_MSG_RESULT([yes])
811
789
        M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
812
 
    fi
 
790
        ],
 
791
        [AC_MSG_RESULT([no])])
813
792
fi
814
793
 
815
 
dnl Add architecture-dependent customizations.
816
 
dnl This is mostly support for native-code compilation.
817
 
scheme_arch=
 
794
AC_MSG_CHECKING([for native-code support])
818
795
OPTIONAL_BASES="${OPTIONAL_BASES} cmpint"
819
796
GC_HEAD_FILES="gccode.h cmpgc.h"
820
 
case "$host_cpu" in
821
 
alpha*)
822
 
    scheme_arch=alpha
823
 
    ;;
824
 
hppa*)
825
 
    scheme_arch=hppa
826
 
    GC_HEAD_FILES="${GC_HEAD_FILES} hppacach.h"
827
 
    ;;
828
 
i?86)
829
 
    scheme_arch=i386
830
 
    ;;
831
 
m68k|m680?0)
832
 
    scheme_arch=mc68k
833
 
    ;;
834
 
mips*)
835
 
    scheme_arch=mips
836
 
    ;;
837
 
vax)
838
 
    scheme_arch=vax
839
 
    ;;
840
 
esac
841
 
if test "${scheme_arch}" != ""; then
 
797
SCM_ARCH=none
 
798
ECN_WARNP=no
 
799
 
 
800
case ${enable_native_code} in
 
801
yes)
 
802
    case ${host_cpu} in
 
803
    alpha*)
 
804
        SCM_ARCH=alpha
 
805
        ;;
 
806
    hppa*)
 
807
        SCM_ARCH=hppa
 
808
        GC_HEAD_FILES="${GC_HEAD_FILES} hppacach.h"
 
809
        ;;
 
810
    i?86)
 
811
        SCM_ARCH=i386
 
812
        ;;
 
813
    # x86_64)
 
814
    #     SCM_ARCH=i386
 
815
    #     CFLAGS="${CFLAGS} -m32"
 
816
    #     LDFLAGS="${LDFLAGS} -m32"
 
817
    #     ;;
 
818
    m68k|m680?0)
 
819
        SCM_ARCH=mc68k
 
820
        ;;
 
821
    mips*)
 
822
        SCM_ARCH=mips
 
823
        ;;
 
824
    vax)
 
825
        SCM_ARCH=vax
 
826
        ;;
 
827
    esac
 
828
    ;;
 
829
c)
 
830
    SCM_ARCH=c
 
831
    ;;
 
832
no|none)
 
833
    ;;
 
834
*)
 
835
    ECN_WARNP=yes
 
836
    ;;
 
837
esac
 
838
 
 
839
case ${SCM_ARCH} in
 
840
none)
 
841
    AC_MSG_RESULT([no])
 
842
    ;;
 
843
c)
 
844
    AC_MSG_RESULT([yes, using portable C code])
 
845
    AC_DEFINE([NATIVE_CODE_IS_C], [1],
 
846
        [Define that the compiler outputs C code instead of binaries.])
 
847
    AC_CONFIG_LINKS([cmpauxmd.c:cmpauxmd/c.c])
 
848
    AC_DEFINE([COMPILE_FOR_STATIC_LINKING], [1],
 
849
        [Define to 1 for static compilation of C native code.])
 
850
    OPTIONAL_BASES="${OPTIONAL_BASES} cmpauxmd unstackify compinit"
 
851
    LIARC_RULES_1=liarc-rules-1
 
852
    LIARC_RULES_2=makegen/liarc-rules-2
 
853
    ;;
 
854
*)
 
855
    AC_MSG_RESULT([yes, for ${SCM_ARCH}])
 
856
    AC_CONFIG_LINKS([cmpauxmd.m4:cmpauxmd/${SCM_ARCH}.m4])
 
857
    OPTIONAL_SOURCES="${OPTIONAL_SOURCES} cmpauxmd.m4"
 
858
    OPTIONAL_OBJECTS="${OPTIONAL_OBJECTS} cmpauxmd.o"
 
859
    ;;
 
860
esac
 
861
 
 
862
if test ${ECN_WARNP} = yes; then
 
863
    AC_MSG_WARN([illegal --enable-native-code value: ${enable_native_code}])
 
864
fi
 
865
 
 
866
if test ${SCM_ARCH} != none; then
842
867
    AC_DEFINE([HAS_COMPILER_SUPPORT], [1],
843
868
        [Define if architecture has native-code compiler support.])
844
 
    test -f cmpauxmd.m4 || ${LN_S} cmpauxmd/${scheme_arch}.m4 cmpauxmd.m4
845
 
    test -f cmpintmd.h || ${LN_S} cmpintmd/${scheme_arch}.h cmpintmd.h
846
 
    OPTIONAL_SOURCES="${OPTIONAL_SOURCES} cmpauxmd.m4"
847
 
    OPTIONAL_OBJECTS="${OPTIONAL_OBJECTS} cmpauxmd.o"
 
869
    AC_CONFIG_LINKS([cmpintmd.h:cmpintmd/${SCM_ARCH}.h])
848
870
    GC_HEAD_FILES="${GC_HEAD_FILES} cmpintmd.h"
849
871
fi
850
872
 
853
875
    OPTIONAL_OBJECTS="${OPTIONAL_OBJECTS} ${base}.o"
854
876
done
855
877
 
856
 
MODULE_TARGETS=
857
 
if test "${MODULE_BASES}" = ""; then
858
 
    MODULE_RULES="/dev/null"
859
 
else
860
 
    MODULE_RULES="config.modrules"
861
 
    rm -f "${MODULE_RULES}"
 
878
if test "x${MODULE_BASES}" != x; then
 
879
    MODULE_RULES=config-rules.module
 
880
    rm -f ${MODULE_RULES}
862
881
    for BASE in ${MODULE_BASES}; do
863
882
        MODULE_TARGETS="${MODULE_TARGETS} ${BASE}.so"
864
 
        echo "" >> "${MODULE_RULES}"
865
 
        echo "${BASE}.o: ${BASE}.c" >> "${MODULE_RULES}"
866
 
        echo "  \$(COMPILE_MODULE) -c \$*.c" >> "${MODULE_RULES}"
 
883
        echo >> ${MODULE_RULES}
 
884
        echo ${BASE}.o: ${BASE}.c >> ${MODULE_RULES}
 
885
        echo "  " '$(COMPILE_MODULE)' -c '$*.c' >> ${MODULE_RULES}
867
886
    done
868
887
fi
869
888
 
870
889
AC_SUBST([AS_FLAGS])
871
890
AC_SUBST([GC_HEAD_FILES])
872
 
AC_SUBST([LIB_X11])
873
891
AC_SUBST([M4_FLAGS])
 
892
AC_SUBST([OPTIONAL_SOURCES])
874
893
AC_SUBST([OPTIONAL_OBJECTS])
875
 
AC_SUBST([OPTIONAL_SOURCES])
876
894
AC_SUBST([STATIC_LIBS])
877
895
AC_SUBST([STATIC_PREFIX])
878
896
AC_SUBST([STATIC_SUFFIX])
884
902
AC_SUBST_FILE([MODULE_RULES])
885
903
AC_SUBST([MODULE_CFLAGS])
886
904
AC_SUBST([MODULE_LDFLAGS])
 
905
AC_SUBST_FILE([LIARC_RULES_1])
 
906
AC_SUBST_FILE([LIARC_RULES_2])
887
907
 
888
908
AC_CONFIG_FILES([Makefile])
889
909
AC_OUTPUT
891
911
# Make custom compilation program for "makegen.scm".
892
912
rm -f makegen-cc
893
913
echo "#!/bin/sh" > makegen-cc
894
 
echo "exec gcc -MM -DMIT_SCHEME ${CPPFLAGS} \"\${1}\"" >> makegen-cc
 
914
echo exec gcc -MM -MG -DMIT_SCHEME ${CPPFLAGS} '"${1}"' >> makegen-cc
895
915
chmod +x makegen-cc
896
916
 
897
 
if test "${MODULE_RULES}" != "/dev/null"; then
898
 
    rm -f "${MODULE_RULES}"
 
917
if test ${MODULE_RULES} != /dev/null; then
 
918
    rm -f ${MODULE_RULES}
899
919
fi