158
if test "${GCC}" = "yes"; then
196
if test ${GCC} = yes; then
197
if test ${enable_debugging} = no; then
201
LDFLAGS="${LDFLAGS} -g"
159
203
CFLAGS="${CFLAGS} -Wall"
161
if test "$(${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps)"
205
FOO=`${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps`
206
if test "x${FOO}" != x; then
163
207
INSTALL="${INSTALL} --preserve-timestamps"
166
210
dnl Checks for libraries.
167
AC_CHECK_LIB([dl], [dlopen])
168
211
AC_CHECK_LIB([m], [exp])
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],
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])
205
AC_MSG_CHECKING([for db_create in -ldb-4])
210
[DB * db; db_create ((&db), 0, 0);],
211
[scheme_cv_lib_db4=yes],
212
[scheme_cv_lib_db4=no])
214
AC_MSG_RESULT(${scheme_cv_lib_db4})
216
if test "${scheme_cv_lib_pq}" = "yes"; then
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"
223
if test "${PQ_INCLUDE}"; then
224
CPPFLAGS="${CPPFLAGS} -I${PQ_INCLUDE}"
228
213
dnl Checks for header files.
231
217
AC_HEADER_SYS_WAIT
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])
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])
226
define([SCM_INC_TIME],
228
#ifdef TIME_WITH_SYS_TIME
229
# include <sys/time.h>
232
# ifdef HAVE_SYS_TIME_H
233
# include <sys/time.h>
240
define([SCM_INC_TERMIO],
242
#ifdef HAVE_TERMIOS_H
243
# include <termios.h>
245
# ifdef HAVE_TERMIO_H
251
define([SCM_INC_NETDB],
258
define([SCM_INC_SIGNAL],
265
define([SCM_INC_SOCKET],
267
#include <sys/types.h>
268
#ifdef HAVE_SYS_SOCKET_H
269
# include <sys/socket.h>
273
define([SCM_INC_BSDTTY],
280
dnl Checks for types and structs
248
AC_CHECK_TYPE([nlink_t], [short])
250
AC_MSG_CHECKING([for clock_t])
252
#ifdef TIME_WITH_SYS_TIME
253
# include <sys/time.h>
256
# ifdef HAVE_SYS_TIME_H
257
# include <sys/time.h>
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.])
271
AC_MSG_CHECKING([for time_t])
273
#ifdef TIME_WITH_SYS_TIME
274
# include <sys/time.h>
277
# ifdef HAVE_SYS_TIME_H
278
# include <sys/time.h>
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.])
292
if test "${ac_cv_header_sys_socket_h}" = "yes"; then
293
AC_MSG_CHECKING([for socklen_t])
295
#include <sys/types.h>
296
#include <sys/socket.h>],
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.])
307
AC_MSG_CHECKING([for cc_t])
309
#ifdef HAVE_TERMIOS_H
310
# include <termios.h>
312
# ifdef HAVE_TERMIO_H
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.])
325
AC_MSG_CHECKING([for speed_t])
327
#ifdef HAVE_TERMIOS_H
328
# include <termios.h>
330
# ifdef HAVE_TERMIO_H
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.])
343
dnl Checks for structures.
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])
310
if test ${ac_cv_sizeof_char} -ne 1; then
311
AC_MSG_ERROR([SIZEOF_CHAR is not 1])
314
if test ${ac_cv_sizeof_unsigned_char} -ne 1; then
315
AC_MSG_ERROR([SIZEOF_UNSIGNED_CHAR is not 1])
318
AC_CHECK_TYPE([nlink_t],
320
[AC_DEFINE([nlink_t], [short],
321
[Define to 'short' if undefined.])])
323
AC_CHECK_TYPE([clock_t],
325
[AC_DEFINE([clock_t], [unsigned long],
326
[Define to `unsigned long' if <time.h> doesn't define.])],
329
AC_CHECK_TYPE([time_t],
331
[AC_DEFINE([time_t], [long],
332
[Define to `long' if <time.h> doesn't define.])],
335
AC_CHECK_TYPE([socklen_t],
337
[AC_DEFINE([socklen_t], [int],
338
[Define to `int' if <sys/socket.h> doesn't define.])],
341
AC_CHECK_TYPE([cc_t],
343
[AC_DEFINE([cc_t], [unsigned char],
344
[Define to `unsigned char' if <termios.h> doesn't define.])],
347
AC_CHECK_TYPE([speed_t],
349
[AC_DEFINE([speed_t], [short],
350
[Define to `short' if <termios.h> doesn't define.])],
345
354
AC_STRUCT_TIMEZONE
348
356
dnl Timezone stuff is hairy; there's no standard.
349
357
have_timezone_info=no
351
if test "${have_timezone_info}" = "no"; then
352
AC_MSG_CHECKING([for tm_gmtoff in struct tm])
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
368
if test "${have_timezone_info}" = "no"; then
369
AC_MSG_CHECKING([for __tm_gmtoff in struct tm])
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
385
if test "${have_timezone_info}" = "no"; then
386
AC_MSG_CHECKING([for __timezone])
388
#ifdef TIME_WITH_SYS_TIME
389
# include <sys/time.h>
392
# ifdef HAVE_SYS_TIME_H
393
# include <sys/time.h>
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
411
if test "${have_timezone_info}" = "no"; then
412
AC_MSG_CHECKING([for _timezone])
414
#ifdef TIME_WITH_SYS_TIME
415
# include <sys/time.h>
418
# ifdef HAVE_SYS_TIME_H
419
# include <sys/time.h>
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
437
if test "${have_timezone_info}" = "no"; then
438
AC_MSG_CHECKING([for timezone])
440
#ifdef TIME_WITH_SYS_TIME
441
# include <sys/time.h>
444
# ifdef HAVE_SYS_TIME_H
445
# include <sys/time.h>
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
463
if test "${ac_cv_header_bsdtty_h}" = "yes"; then
464
AC_MSG_CHECKING([for struct ltchars])
466
[#include <bsdtty.h>],
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>.])
477
AC_MSG_CHECKING([for hostent h_addr_list])
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.])
489
AC_MSG_CHECKING([for struct sigcontext])
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>.])
361
if test ${have_timezone_info} = no; then
362
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
364
have_timezone_info=yes
365
val_tm_gmtoff=tm_gmtoff
371
if test ${have_timezone_info} = no; then
372
AC_CHECK_MEMBER([struct tm.__tm_gmtoff],
374
have_timezone_info=yes
375
val_tm_gmtoff=__tm_gmtoff
381
if test ${have_timezone_info} = no; then
382
AC_CHECK_DECL([__timezone],
384
have_timezone_info=yes
385
val_timezone=__timezone
391
if test ${have_timezone_info} = no; then
392
AC_CHECK_DECL([_timezone],
394
have_timezone_info=yes
395
val_timezone=_timezone
401
if test ${have_timezone_info} = no; then
402
AC_CHECK_DECL([timezone],
404
have_timezone_info=yes
405
val_timezone=timezone
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.])
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.])
425
AC_CHECK_TYPE([struct ltchars],
426
[AC_DEFINE([HAVE_STRUCT_LTCHARS], [1],
427
[Define if `struct ltchars' is defined in <bsdtty.h>.])],
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.])],
437
AC_CHECK_TYPE([struct sigcontext],
438
[AC_DEFINE([HAVE_STRUCT_SIGCONTEXT], [1],
439
[Define if `struct sigcontext' is defined in <signal.h>.])],
501
443
dnl Checks for compiler characteristics.
503
445
AC_C_CHAR_UNSIGNED
505
AC_CHECK_SIZEOF([unsigned long])
507
448
dnl Checks for C library functions.
532
473
AC_CHECK_FUNCS([uname utime])
533
474
AC_CHECK_FUNCS([waitpid])
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'.])
540
481
dnl Checks for system characteristics.
541
482
AC_CANONICAL_HOST
544
485
AC_SYS_LONG_FILE_NAMES
545
486
AC_SYS_RESTARTABLE_SYSCALLS
547
if test "${ac_cv_lib_dl_dlopen}" = "yes"; then
548
OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld"
549
enable_dynamic_modules="${enable_dynamic_modules:-yes}"
551
enable_dynamic_modules="no"
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"
562
dnl OK, now some complex logic to handle the crypto stuff.
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.
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"
579
OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
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"
589
OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
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"
488
dnl curses/termcap/terminfo support
489
AC_CHECK_LIB([ncurses], [tparm],
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],
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],
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],
504
AC_DEFINE([LIBNCURSES_DEFINES_TPARAM], [1],
505
[Define if ncurses library defines `tparam'.])
508
OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
513
[AC_CHECK_LIB([curses], [tparm],
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"
521
AC_CHECK_LIB([termcap], [tparam],
523
AC_DEFINE([HAVE_LIBTERMCAP], [1],
524
[Define to 1 if you have the `termcap' library (-ltermcap).])
525
STATIC_LIBS="-ltermcap ${STATIC_LIBS}"
528
OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
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"
539
AC_CHECK_HEADERS([openssl/blowfish.h openssl/md5.h])
540
AC_CHECK_LIB([crypto], [BF_set_key],
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"
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.
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"
565
AC_CHECK_HEADER([mhash.h],
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],
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"
616
QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmhash"
617
OPTIONAL_BASES="${OPTIONAL_BASES} prmhash"
575
if test "x${PRMD5_LIBS}" = x; then
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"
590
AC_CHECK_HEADER([mcrypt.h],
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],
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"
633
QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lmcrypt -lltdl"
634
OPTIONAL_BASES="${OPTIONAL_BASES} prmcrypt"
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"
651
STATIC_LIBS="${STATIC_LIBS} -lblowfish"
652
OPTIONAL_BASES="${OPTIONAL_BASES} prbfish"
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"
670
STATIC_LIBS="${STATIC_LIBS} -lmd5"
671
OPTIONAL_BASES="${OPTIONAL_BASES} prmd5"
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
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"
613
AC_CHECK_HEADER([gdbm.h],
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],
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"
686
QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lgdbm"
687
OPTIONAL_BASES="${OPTIONAL_BASES} prgdbm"
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
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"
633
AC_CHECK_HEADER([db.h],
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])
639
LIBS="${LIBS} -ldb-4"
643
[[db_create (0, 0, 0)]])],
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"
700
QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -ldb-4"
701
OPTIONAL_BASES="${OPTIONAL_BASES} prdb4"
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'.])
717
OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
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
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`
733
OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
669
if test -d /usr/include/postgresql; then
670
libpq_inc=/usr/include/postgresql
672
libpq_inc=/usr/include
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}"
680
if test "${libpq_lib}" != /usr/lib; then
681
LDFLAGS="${LDFLAGS} -L${libpq_lib}"
683
AC_CHECK_HEADER([libpq-fe.h],
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],
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"
746
QUASI_STATIC_LIBS="${QUASI_STATIC_LIBS} -lpq"
747
OPTIONAL_BASES="${OPTIONAL_BASES} prpgsql"
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],
701
LIBS="${STATIC_LIBS} ${LIBS}"
704
AC_CHECK_LIB([dl], [dlopen],
706
AC_DEFINE([HAVE_LIBDL], [1],
707
[Define to 1 if you have the `dl' library (-ldl).])
708
LIBS="${STATIC_LIBS} -ldl ${LIBS}"
710
[enable_static_libs=yes])
713
if test ${enable_static_libs} != no; then
714
STATIC_LIBS=${MODULE_LIBS}${STATIC_LIBS}
756
STATIC_LIBS="${STATIC_LIBS}${QUASI_STATIC_LIBS}"
717
OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld"
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"
764
725
dnl Add support for X if present.
765
if test "${no_x}" = "yes"; then
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}"
731
if test "x${x_libraries}" != x; then
732
FOO=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
733
LIBS="${LIBS} ${FOO}"
769
736
OPTIONAL_BASES="${OPTIONAL_BASES} x11base x11term x11graph x11color"
772
739
dnl Add OS-dependent customizations.
779
746
M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
749
DLD_LDFLAGS="${DLD_LDFLAGS} -Wl,-pagezero_size,04000000"
750
MODULE_LDFLAGS="${MODULE_LDFLAGS} -dynamiclib -flat_namespace -undefined suppress"
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}"
782
if test "${GCC}" = "yes"; then
761
if test ${GCC} = yes; then
784
763
M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
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"