1 dnl configuration script for Guile
2 dnl Process this file with autoconf to produce configure.
5 define(GUILE_CONFIGURE_COPYRIGHT,[[
7 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
9 This file is part of GUILE
11 GUILE is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your
14 option) any later version.
16 GUILE is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GUILE; see the file COPYING. If not, write to the
23 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
30 AC_INIT(m4_esyscmd(. ./GUILE-VERSION && echo -n ${PACKAGE}),
31 m4_esyscmd(. ./GUILE-VERSION && echo -n ${GUILE_VERSION}),
33 AC_CONFIG_AUX_DIR([.])
34 AC_CONFIG_SRCDIR(GUILE-VERSION)
35 AM_INIT_AUTOMAKE([no-define])
37 AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
38 AC_CONFIG_SRCDIR([GUILE-VERSION])
40 . $srcdir/GUILE-VERSION
43 AM_CONFIG_HEADER([config.h])
44 AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)
46 #--------------------------------------------------------------------
48 # Independent Subdirectories
50 #--------------------------------------------------------------------
52 AC_CONFIG_SUBDIRS(guile-readline)
54 #--------------------------------------------------------------------
56 dnl Some more checks for Win32
70 # for per-target cflags in the libguile subdir
75 AC_CHECK_LIB([ltdl], [lt_dlinit], ,
76 [AC_MSG_ERROR([libltdl not found. See README.])])
80 AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
81 AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
85 #--------------------------------------------------------------------
87 # User options (after above tests that may set default CFLAGS etc.)
89 #--------------------------------------------------------------------
91 GUILE_ERROR_ON_WARNING="yes"
93 AC_ARG_ENABLE(error-on-warning,
94 [ --enable-error-on-warning treat compile warnings as errors],
95 [case "${enableval}" in
96 yes | y) GUILE_ERROR_ON_WARNING="yes" ;;
97 no | n) GUILE_ERROR_ON_WARNING="no" ;;
98 *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
101 SCM_I_GSC_GUILE_DEBUG_FREELIST=0
102 AC_ARG_ENABLE(debug-freelist,
103 [ --enable-debug-freelist include garbage collector freelist debugging code],
104 if test "$enable_debug_freelist" = y \
105 || test "$enable_debug_freelist" = yes; then
106 SCM_I_GSC_GUILE_DEBUG_FREELIST=1
109 AC_ARG_ENABLE(debug-malloc,
110 [ --enable-debug-malloc include malloc debugging code],
111 if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
112 AC_DEFINE(GUILE_DEBUG_MALLOC, 1,
113 [Define this if you want to debug scm_must_malloc/realloc/free calls.])
116 SCM_I_GSC_GUILE_DEBUG=0
117 AC_ARG_ENABLE(guile-debug,
118 [AC_HELP_STRING([--enable-guile-debug],
119 [include internal debugging functions])],
120 if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
121 SCM_I_GSC_GUILE_DEBUG=1
125 [ --disable-posix omit posix interfaces],,
128 AC_ARG_ENABLE(networking,
129 [ --disable-networking omit networking interfaces],,
130 enable_networking=yes)
133 [ --disable-regex omit regular expression interfaces],,
136 AC_ARG_ENABLE([discouraged],
137 AC_HELP_STRING([--disable-discouraged],[omit discouraged features]))
139 if test "$enable_discouraged" = no; then
140 SCM_I_GSC_ENABLE_DISCOURAGED=0
142 SCM_I_GSC_ENABLE_DISCOURAGED=1
145 AC_ARG_ENABLE([deprecated],
146 AC_HELP_STRING([--disable-deprecated],[omit deprecated features]))
148 if test "$enable_deprecated" = no; then
149 SCM_I_GSC_ENABLE_DEPRECATED=0
151 if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
153 elif test "$enable_deprecated" = shutup; then
156 warn_default=$enable_deprecated
158 SCM_I_GSC_ENABLE_DEPRECATED=1
159 AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default",
160 [Define this to control the default warning level for deprecated features.])
164 [ --disable-elisp omit Emacs Lisp support],,
167 #--------------------------------------------------------------------
169 dnl Check for dynamic linking
173 [ --with-modules[=FILES] Add support for dynamic modules],
174 use_modules="$withval")
175 test -z "$use_modules" && use_modules=yes
177 if test "$use_modules" != no; then
178 if test "$use_modules" = yes; then
179 DLPREOPEN="-dlpreopen force"
181 DLPREOPEN="-export-dynamic"
182 for module in $use_modules; do
183 DLPREOPEN="$DLPREOPEN -dlopen $module"
188 dnl files which are destined for separate modules.
190 if test "$use_modules" != no; then
194 if test "$enable_posix" = yes; then
197 AC_DEFINE(HAVE_POSIX, 1,
198 [Define this if you want support for POSIX system calls in Guile.])
201 if test "$enable_networking" = yes; then
204 AC_DEFINE(HAVE_NETWORKING, 1,
205 [Define this if you want support for networking in Guile.])
208 if test "$enable_debug_malloc" = yes; then
209 AC_LIBOBJ([debug-malloc])
212 if test "$enable_elisp" = yes; then
213 SCM_I_GSC_ENABLE_ELISP=1
215 SCM_I_GSC_ENABLE_ELISP=0
217 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
222 if test "$ac_cv_c_inline" != no; then
223 SCM_I_GSC_C_INLINE="\"${ac_cv_c_inline}\""
225 SCM_I_GSC_C_INLINE=NULL
227 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
231 AC_CHECK_SIZEOF(char)
232 AC_CHECK_SIZEOF(unsigned char)
233 AC_CHECK_SIZEOF(short)
234 AC_CHECK_SIZEOF(unsigned short)
236 AC_CHECK_SIZEOF(unsigned int)
237 AC_CHECK_SIZEOF(long)
238 AC_CHECK_SIZEOF(unsigned long)
239 AC_CHECK_SIZEOF(size_t)
240 AC_CHECK_SIZEOF(long long)
241 AC_CHECK_SIZEOF(unsigned long long)
242 AC_CHECK_SIZEOF(__int64)
243 AC_CHECK_SIZEOF(unsigned __int64)
244 AC_CHECK_SIZEOF(void *)
245 AC_CHECK_SIZEOF(intptr_t)
246 AC_CHECK_SIZEOF(uintptr_t)
247 AC_CHECK_SIZEOF(ptrdiff_t)
248 AC_CHECK_SIZEOF(size_t)
249 AC_CHECK_SIZEOF(off_t)
251 if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
252 AC_MSG_ERROR(sizes of long and void* are not identical)
255 if test "$ac_cv_sizeof_ptrdiff_t" -ne 0; then
256 SCM_I_GSC_T_PTRDIFF='"ptrdiff_t"'
258 SCM_I_GSC_T_PTRDIFF='"long"'
260 AC_SUBST([SCM_I_GSC_T_PTRDIFF])
262 AC_CHECK_HEADERS([stdint.h])
263 AC_CHECK_HEADERS([inttypes.h])
265 AC_CHECK_SIZEOF(intmax_t)
267 SCM_I_GSC_NEEDS_STDINT_H=0
268 SCM_I_GSC_NEEDS_INTTYPES_H=0
270 ### intptr and uintptr (try not to use inttypes if we don't have to)
271 if test "$ac_cv_header_inttypes_h" = yes; then
272 if test "$ac_cv_sizeof_intptr_t" -eq 0; then
273 AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
275 if test "$ac_cv_sizeof_intptr_t" -ne 0; then
276 SCM_I_GSC_NEEDS_INTTYPES_H=1
279 if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
280 AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
282 if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
283 SCM_I_GSC_NEEDS_INTTYPES_H=1
288 ### See what's provided by stdint.h
289 if test "$ac_cv_header_stdint_h" = yes; then
290 AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
291 AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
292 AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
293 AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
294 AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
295 AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
296 AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
297 AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
298 AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
299 AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
302 # so we don't get confused by the cache (wish there was a better way
303 # to check particular headers for the same type...)
305 unset ac_cv_type_int8_t
306 unset ac_cv_type_uint8_t
307 unset ac_cv_type_int16_t
308 unset ac_cv_type_uint16_t
309 unset ac_cv_type_int32_t
310 unset ac_cv_type_uint32_t
311 unset ac_cv_type_int64_t
312 unset ac_cv_type_uint64_t
313 unset ac_cv_type_intmax_t
314 unset ac_cv_type_uintmax_t
316 ### See what's provided by inttypes.h
317 if test "$ac_cv_header_inttypes_h" = yes; then
318 AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
319 AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
320 AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
321 AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include <inttypes.h>])
322 AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
323 AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include <inttypes.h>])
324 AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
325 AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include <inttypes.h>])
326 AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include <inttypes.h>])
327 AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include <inttypes.h>])
330 # Try hard to find definitions for some required scm_t_*int* types.
332 ### Required type scm_t_int8
333 if test "$scm_stdint_has_int8"; then
334 SCM_I_GSC_T_INT8='"int8_t"'
335 SCM_I_GSC_NEEDS_STDINT_H=1
336 elif test "$scm_inttypes_has_int8"; then
337 SCM_I_GSC_T_INT8='"int8_t"'
338 SCM_I_GSC_NEEDS_INTTYPES_H=1
339 elif test "$ac_cv_sizeof_char" -eq 1; then
340 SCM_I_GSC_T_INT8='"signed char"'
342 AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
344 AC_SUBST([SCM_I_GSC_T_INT8])
346 ### Required type scm_t_uint8
347 if test "$scm_stdint_has_uint8"; then
348 SCM_I_GSC_T_UINT8='"uint8_t"'
349 SCM_I_GSC_NEEDS_STDINT_H=1
350 elif test "$scm_inttypes_has_uint8"; then
351 SCM_I_GSC_T_UINT8='"uint8_t"'
352 SCM_I_GSC_NEEDS_INTTYPES_H=1
353 elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
354 SCM_I_GSC_T_UINT8='"unsigned char"'
356 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
358 AC_SUBST([SCM_I_GSC_T_UINT8])
360 ### Required type scm_t_int16 (ANSI C says int or short might work)
361 if test "$scm_stdint_has_int16"; then
362 SCM_I_GSC_T_INT16='"int16_t"'
363 SCM_I_GSC_NEEDS_STDINT_H=1
364 elif test "$scm_inttypes_has_int16"; then
365 SCM_I_GSC_T_INT16='"int16_t"'
366 SCM_I_GSC_NEEDS_INTTYPES_H=1
367 elif test "$ac_cv_sizeof_int" -eq 2; then
368 SCM_I_GSC_T_INT16='"int"'
369 elif test "$ac_cv_sizeof_short" -eq 2; then
370 SCM_I_GSC_T_INT16='"short"'
372 AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
374 AC_SUBST([SCM_I_GSC_T_INT16])
376 ### Required type scm_t_uint16 (ANSI C says int or short might work)
377 if test "$scm_stdint_has_uint16"; then
378 SCM_I_GSC_T_UINT16='"uint16_t"'
379 SCM_I_GSC_NEEDS_STDINT_H=1
380 elif test "$scm_inttypes_has_uint16"; then
381 SCM_I_GSC_T_UINT16='"uint16_t"'
382 SCM_I_GSC_NEEDS_INTTYPES_H=1
383 elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
384 SCM_I_GSC_T_UINT16='"unsigned int"'
385 elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
386 SCM_I_GSC_T_UINT16='"unsigned short"'
388 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
390 AC_SUBST([SCM_I_GSC_T_UINT16])
393 ### Required type scm_t_int32 (ANSI C says int, short, or long might work)
394 if test "$scm_stdint_has_int32"; then
395 SCM_I_GSC_T_INT32='"int32_t"'
396 SCM_I_GSC_NEEDS_STDINT_H=1
397 elif test "$scm_inttypes_has_int32"; then
398 SCM_I_GSC_T_INT32='"int32_t"'
399 SCM_I_GSC_NEEDS_INTTYPES_H=1
400 elif test "$ac_cv_sizeof_int" -eq 4; then
401 SCM_I_GSC_T_INT32='"int"'
402 elif test "$ac_cv_sizeof_long" -eq 4; then
403 SCM_I_GSC_T_INT32='"long"'
404 elif test "$ac_cv_sizeof_short" -eq 4; then
405 SCM_I_GSC_T_INT32='"short"'
407 AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
409 AC_SUBST([SCM_I_GSC_T_INT32])
411 ### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
412 if test "$scm_stdint_has_uint32"; then
413 SCM_I_GSC_T_UINT32='"uint32_t"'
414 SCM_I_GSC_NEEDS_STDINT_H=1
415 elif test "$scm_inttypes_has_uint32"; then
416 SCM_I_GSC_T_UINT32='"uint32_t"'
417 SCM_I_GSC_NEEDS_INTTYPES_H=1
418 elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
419 SCM_I_GSC_T_UINT32='"unsigned int"'
420 elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
421 SCM_I_GSC_T_UINT32='"unsigned long"'
422 elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
423 SCM_I_GSC_T_UINT32='"unsigned short"'
425 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
427 AC_SUBST([SCM_I_GSC_T_UINT32])
429 ### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
430 ### Also try 'long long' and '__int64' if we have it.
432 if test "$scm_stdint_has_int64"; then
433 SCM_I_GSC_T_INT64='"int64_t"'
434 SCM_I_GSC_NEEDS_STDINT_H=1
435 elif test "$scm_inttypes_has_int64"; then
436 SCM_I_GSC_T_INT64='"int64_t"'
437 SCM_I_GSC_NEEDS_INTTYPES_H=1
438 elif test "$ac_cv_sizeof_int" -eq 8; then
439 SCM_I_GSC_T_INT64='"int"'
440 elif test "$ac_cv_sizeof_long" -eq 8; then
441 SCM_I_GSC_T_INT64='"long"'
442 elif test "$ac_cv_sizeof_short" -eq 8; then
443 SCM_I_GSC_T_INT64='"short"'
444 elif test "$ac_cv_sizeof_long_long" -eq 8; then
445 SCM_I_GSC_T_INT64='"long long"'
446 elif test "$ac_cv_sizeof___int64" -eq 8; then
447 SCM_I_GSC_T_INT64='"__int64"'
449 AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
451 AC_SUBST([SCM_I_GSC_T_INT64])
454 ### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
455 ### Also try 'long long' and '__int64' if we have it.
457 if test "$scm_stdint_has_uint64"; then
458 SCM_I_GSC_T_UINT64='"uint64_t"'
459 SCM_I_GSC_NEEDS_STDINT_H=1
460 elif test "$scm_inttypes_has_uint64"; then
461 SCM_I_GSC_T_UINT64='"uint64_t"'
462 SCM_I_GSC_NEEDS_INTTYPES_H=1
463 elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
464 SCM_I_GSC_T_UINT64='"unsigned int"'
465 elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
466 SCM_I_GSC_T_UINT64='"unsigned long"'
467 elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
468 SCM_I_GSC_T_UINT64='"unsigned short"'
469 elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
470 SCM_I_GSC_T_UINT64='"unsigned long long"'
471 elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
472 SCM_I_GSC_T_UINT64='"unsigned __int64"'
474 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
476 AC_SUBST([SCM_I_GSC_T_UINT64])
478 ### Required type scm_t_intmax
480 ### We try 'intmax_t', '__int64', 'long long' in this order. When
481 ### none of them is available, we use 'long'.
484 if test "$scm_stdint_has_intmax"; then
485 SCM_I_GSC_T_INTMAX='"intmax_t"'
486 SCM_I_GSC_NEEDS_STDINT_H=1
487 elif test "$scm_inttypes_has_intmax"; then
488 SCM_I_GSC_T_INTMAX='"intmax_t"'
489 SCM_I_GSC_NEEDS_INTTYPES_H=1
490 elif test "$ac_cv_sizeof___int64" -ne 0; then
491 SCM_I_GSC_T_INTMAX='"__int64"'
492 elif test "$ac_cv_sizeof_long_long" -ne 0; then
493 SCM_I_GSC_T_INTMAX='"long long"'
495 SCM_I_GSC_T_INTMAX='"long"'
497 AC_SUBST([SCM_I_GSC_T_INTMAX])
499 ### Required type scm_t_uintmax
501 ### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
502 ### this order. When none of them is available, we use 'unsigned long'.
504 SCM_I_GSC_T_UINTMAX=0
505 if test "$scm_stdint_has_uintmax"; then
506 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
507 SCM_I_GSC_NEEDS_STDINT_H=1
508 elif test "$scm_inttypes_has_uintmax"; then
509 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
510 SCM_I_GSC_NEEDS_INTTYPES_H=1
511 elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
512 SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
513 elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
514 SCM_I_GSC_T_UINTMAX='"unsigned long long"'
516 SCM_I_GSC_T_UINTMAX='"unsigned long"'
518 AC_SUBST([SCM_I_GSC_T_UINTMAX])
521 AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
522 AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
529 # Reasons for testing:
530 # complex.h - new in C99
531 # fenv.h - available in C99, but not older systems
532 # process.h - mingw specific
534 AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
535 regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
536 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
537 sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
540 # "complex double" is new in C99, and "complex" is only a keyword if
541 # <complex.h> is included
542 AC_CHECK_TYPES(complex double,,,
547 # On MacOS X <sys/socklen.h> contains socklen_t, so must include that
549 AC_CHECK_TYPE(socklen_t, ,
550 [AC_DEFINE_UNQUOTED(socklen_t, int,
551 [Define to `int' if <sys/socket.h> does not define.])],
552 [#if HAVE_SYS_TYPES_H
553 #include <sys/types.h>
555 #include <sys/socket.h>
557 AC_CHECK_TYPE(struct ip_mreq)
559 GUILE_HEADER_LIBC_WITH_UNISTD
565 # On mingw -lm is empty, so this test is unnecessary, but it's
566 # harmless so we don't hard-code to suppress it.
570 AC_CHECK_FUNCS(gethostbyname)
571 if test $ac_cv_func_gethostbyname = no; then
572 AC_CHECK_LIB(nsl, gethostbyname)
575 AC_CHECK_FUNCS(connect)
576 if test $ac_cv_func_connect = no; then
577 AC_CHECK_LIB(socket, connect)
581 dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
586 AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
587 [Define if you have the <winsock2.h> header file.])])
588 AC_CHECK_LIB(ws2_32, main)
589 AC_LIBOBJ([win32-uname])
590 AC_LIBOBJ([win32-dirent])
591 if test "$enable_networking" = yes ; then
592 AC_LIBOBJ([win32-socket])
594 if test "$enable_shared" = yes ; then
595 EXTRA_DEFS="-DSCM_IMPORT"
596 AC_DEFINE(USE_DLL_IMPORT, 1,
597 [Define if you need additional CPP macros on Win32 platforms.])
603 # Reasons for testing:
604 # crt_externs.h - Darwin specific
606 AC_CHECK_HEADERS([assert.h crt_externs.h])
608 # Reasons for testing:
609 # DINFINITY - OSF specific
610 # DQNAN - OSF specific
611 # (DINFINITY and DQNAN are actually global variables, not functions)
612 # chsize - an MS-DOS-ism, found in mingw
613 # clog10 - not in mingw (though others like clog and csqrt are)
614 # fesetround - available in C99, but not older systems
615 # ftruncate - posix, but probably not older systems (current mingw
616 # has it as an inline for chsize)
617 # ioctl - not in mingw.
618 # gmtime_r - recent posix, not on old systems
619 # pipe - not in mingw
620 # _pipe - specific to mingw, taking 3 args
621 # readdir_r - recent posix, not on old systems
622 # stat64 - SuS largefile stuff, not on old systems
623 # sysconf - not on old systems
624 # truncate - not in mingw
625 # isblank - available as a GNU extension or in C99
626 # _NSGetEnviron - Darwin specific
627 # strcoll_l, newlocale - GNU extensions (glibc)
629 AC_CHECK_FUNCS([DINFINITY DQNAN chsize clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale])
631 # Reasons for testing:
632 # netdb.h - not in mingw
633 # sys/param.h - not in mingw
634 # pthread.h - only available with pthreads. ACX_PTHREAD doesn't
635 # check this specifically, we need it for the timespec test below.
636 # sethostname - the function itself check because it's not in mingw,
637 # the DECL is checked because Solaris 10 doens't have in any header
639 AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h)
640 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
641 AC_CHECK_DECLS([sethostname])
643 # crypt() may or may not be available, for instance in some countries there
644 # are restrictions on cryptography.
646 # crypt() might be in libc (eg. OpenBSD), or it might be in a separate
647 # -lcrypt library (eg. Debian GNU/Linux).
649 # On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a. We must
650 # be careful to avoid -lcrypt in this case, since libtool will see there's
651 # only a static libcrypt and decide to build only a static libguile.
653 # AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the
654 # libraries already in that list.
656 AC_SEARCH_LIBS(crypt, crypt,
657 [AC_DEFINE(HAVE_CRYPT,1,
658 [Define to 1 if you have the `crypt' function.])])
660 # glibc 2.3.6 (circa 2006) and various prior versions had a bug where
661 # csqrt(-i) returned a negative real part, when it should be positive
662 # for the principal root.
664 if test "$ac_cv_type_complex_double" = yes; then
665 AC_CACHE_CHECK([whether csqrt is usable],
669 /* "volatile" is meant to prevent gcc from calculating the sqrt as a
670 constant, we want to test libc. */
671 volatile complex double z = - _Complex_I;
681 [guile_cv_use_csqrt=yes],
682 [guile_cv_use_csqrt="no, glibc 2.3 bug"],
683 [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
684 case $guile_cv_use_csqrt in
686 AC_DEFINE(HAVE_USABLE_CSQRT, 1, [Define to 1 if csqrt is bug-free])
693 AC_CHECK_LIB([gmp], [__gmpz_init], ,
694 [AC_MSG_ERROR([GNU MP not found, see README])])
696 # mpz_import is a macro so we need to include <gmp.h>
697 AC_TRY_LINK([#include <gmp.h>],
698 [mpz_import (0, 0, 0, 0, 0, 0, 0);] , ,
699 [AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])])
702 #AC_CHECK_HEADERS([libintl.h])
703 #AC_CHECK_FUNCS(gettext)
704 #if test $ac_cv_func_gettext = no; then
705 # AC_CHECK_LIB(intl, gettext)
707 #AC_CHECK_FUNCS([bindtextdomain textdomain])
708 AM_GNU_GETTEXT([external], [need-ngettext])
710 ### Some systems don't declare some functions. On such systems, we
711 ### need to at least provide our own K&R-style declarations.
713 ### GUILE_FUNC_DECLARED(function, headerfile)
715 ### Check for a declaration of FUNCTION in HEADERFILE; if it is
716 ### not there, #define MISSING_FUNCTION_DECL.
717 AC_DEFUN([GUILE_FUNC_DECLARED], [
718 AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
719 AC_EGREP_HEADER($1, $2,
720 guile_cv_func_$1_declared=yes,
721 guile_cv_func_$1_declared=no))
722 if test [x$guile_cv_func_]$1[_declared] = xno; then
723 AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
724 [Define if the operating system supplies $1 without declaring it.])
728 GUILE_FUNC_DECLARED(sleep, unistd.h)
729 GUILE_FUNC_DECLARED(usleep, unistd.h)
731 AC_CHECK_DECLS([strptime],,,
732 [#define _GNU_SOURCE /* ask glibc to give strptime prototype */
735 ### On some systems usleep has no return value. If it does have one,
736 ### we'd like to return it; otherwise, we'll fake it.
737 AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
738 [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
740 [guile_cv_func_usleep_return_type=void],
741 [guile_cv_func_usleep_return_type=int])])
742 case "$guile_cv_func_usleep_return_type" in
744 AC_DEFINE(USLEEP_RETURNS_VOID, 1,
745 [Define if the system headers declare usleep to return void.])
749 AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
750 if test -n "$have_sys_un_h" ; then
751 AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS, 1,
752 [Define if the system supports Unix-domain (file-domain) sockets.])
755 AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)
757 AC_CHECK_FUNCS(sethostent gethostent endhostent dnl
758 setnetent getnetent endnetent dnl
759 setprotoent getprotoent endprotoent dnl
760 setservent getservent endservent dnl
761 getnetbyaddr getnetbyname dnl
762 inet_lnaof inet_makeaddr inet_netof hstrerror dnl
765 # struct sockaddr field sin_len is only present on BSD systems.
766 # On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
767 # (eg. FreeBSD 4.9) it doesn't and we must use this configure check
768 AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
769 [#ifdef HAVE_SYS_TYPES_H
770 #include <sys/types.h>
772 #include <netinet/in.h>])
774 AC_MSG_CHECKING(for __libc_stack_end)
775 AC_CACHE_VAL(guile_cv_have_libc_stack_end,
776 [AC_TRY_LINK([#include <stdio.h>
777 extern char *__libc_stack_end;],
778 [printf("%p", (char*) __libc_stack_end);],
779 guile_cv_have_libc_stack_end=yes,
780 guile_cv_have_libc_stack_end=no)])
781 AC_MSG_RESULT($guile_cv_have_libc_stack_end)
783 if test $guile_cv_have_libc_stack_end = yes; then
784 AC_DEFINE(HAVE_LIBC_STACK_END, 1,
785 [Define if you have the __libc_stack_end variable.])
788 dnl Some systems do not declare this. Some systems do declare it, as a
789 dnl macro. With cygwin it may be in a DLL.
791 AC_MSG_CHECKING(whether netdb.h declares h_errno)
792 AC_CACHE_VAL(guile_cv_have_h_errno,
793 [AC_TRY_COMPILE([#include <netdb.h>],
795 guile_cv_have_h_errno=yes, guile_cv_have_h_errno=no)])
796 AC_MSG_RESULT($guile_cv_have_h_errno)
797 if test $guile_cv_have_h_errno = yes; then
798 AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
801 AC_MSG_CHECKING(whether uint32_t is defined)
802 AC_CACHE_VAL(guile_cv_have_uint32_t,
803 [AC_TRY_COMPILE([#include <sys/types.h>
811 guile_cv_have_uint32_t=yes, guile_cv_have_uint32_t=no)])
812 AC_MSG_RESULT($guile_cv_have_uint32_t)
813 if test $guile_cv_have_uint32_t = yes; then
814 AC_DEFINE(HAVE_UINT32_T, 1,
815 [Define if uint32_t typedef is defined when netdb.h is include.])
818 AC_MSG_CHECKING(for working IPv6 support)
819 AC_CACHE_VAL(guile_cv_have_ipv6,
821 #ifdef HAVE_SYS_TYPES_H
822 #include <sys/types.h>
824 #include <netinet/in.h>
825 #include <sys/socket.h>],
826 [struct sockaddr_in6 a; a.sin6_family = AF_INET6;],
827 guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)])
828 AC_MSG_RESULT($guile_cv_have_ipv6)
829 if test $guile_cv_have_ipv6 = yes; then
830 AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
833 # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
834 AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
835 AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
837 #ifdef HAVE_SYS_TYPES_H
838 #include <sys/types.h>
840 #include <netinet/in.h>],
841 [struct sockaddr_in6 sok; sok.sin6_scope_id = 0;],
842 guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)])
843 AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
844 if test $guile_cv_have_sin6_scope_id = yes; then
845 AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
846 [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
849 # struct sockaddr_in6 field sin_len is only present on BSD systems
850 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
851 [#ifdef HAVE_SYS_TYPES_H
852 #include <sys/types.h>
854 #include <netinet/in.h>])
856 AC_MSG_CHECKING(whether localtime caches TZ)
857 AC_CACHE_VAL(guile_cv_localtime_cache,
858 [if test x$ac_cv_func_tzset = xyes; then
859 AC_TRY_RUN([#include <time.h>
863 extern char **environ;
867 for (to = from = environ; (*to = *from); from++)
868 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
871 char TZ_GMT0[] = "TZ=GMT0";
872 char TZ_PST8[] = "TZ=PST8";
875 time_t now = time ((time_t *) 0);
876 int hour_GMT0, hour_unset;
877 if (putenv (TZ_GMT0) != 0)
879 hour_GMT0 = localtime (&now)->tm_hour;
881 hour_unset = localtime (&now)->tm_hour;
882 if (putenv (TZ_PST8) != 0)
884 if (localtime (&now)->tm_hour == hour_GMT0)
887 if (localtime (&now)->tm_hour != hour_unset)
890 }], guile_cv_localtime_cache=no, guile_cv_localtime_cache=yes,
891 [# If we have tzset, assume the worst when cross-compiling.
892 guile_cv_localtime_cache=yes])
894 # If we lack tzset, report that localtime does not cache TZ,
895 # since we can't invalidate the cache if we don't have tzset.
896 guile_cv_localtime_cache=no
898 AC_MSG_RESULT($guile_cv_localtime_cache)
899 if test $guile_cv_localtime_cache = yes; then
900 AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
903 dnl Test whether system calls are restartable by default on the
904 dnl current system. If they are not, we put a loop around every system
905 dnl call to check for EINTR (see SCM_SYSCALL) and do not attempt to
906 dnl change from the default behaviour. On the other hand, if signals
907 dnl are restartable then the loop is not installed and when libguile
908 dnl initialises it also resets the behaviour of each signal to cause a
909 dnl restart (in case a different runtime had a different default
910 dnl behaviour for some reason: e.g., different versions of linux seem
911 dnl to behave differently.)
913 AC_SYS_RESTARTABLE_SYSCALLS
915 if test "$enable_regex" = yes; then
916 if test "$ac_cv_header_regex_h" = yes ||
917 test "$ac_cv_header_rxposix_h" = yes ||
918 test "$ac_cv_header_rx_rxposix_h" = yes; then
919 GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
920 [AC_CHECK_LIB(rx, main)
921 GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
922 [AC_CHECK_LIB(regex, main)
923 GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
925 dnl The following should not be necessary, but for some reason
926 dnl autoheader misses it if we don't include it!
927 if test "$ac_cv_func_regcomp_norx" = yes ||
928 test "$ac_cv_func_regcomp_regex" = yes ||
929 test "$ac_cv_func_regcomp_rx" = yes; then
930 AC_DEFINE(HAVE_REGCOMP, 1,
931 [This is included as part of a workaround for a autoheader bug.])
936 AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
938 AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
940 # Reasons for testing:
941 # asinh, acosh, atanh, trunc - C99 standard, generally not available on
943 # sincos - GLIBC extension
945 AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
947 # C99 specifies isinf and isnan as macros.
948 # HP-UX provides only macros, no functions.
949 # glibc 2.3.2 provides both macros and functions.
950 # IRIX 6.5 and Solaris 8 only provide functions.
952 # The following tests detect isinf and isnan either as functions or as
953 # macros from <math.h>. Plain AC_CHECK_FUNCS is insufficient, it doesn't
954 # use <math.h> so doesn't detect on macro-only systems like HP-UX.
956 AC_MSG_CHECKING([for isinf])
959 int main () { return (isinf(0.0) != 0); }],
960 [AC_MSG_RESULT([yes])
961 AC_DEFINE(HAVE_ISINF, 1,
962 [Define to 1 if you have the `isinf' macro or function.])],
963 [AC_MSG_RESULT([no])])
964 AC_MSG_CHECKING([for isnan])
967 int main () { return (isnan(0.0) != 0); }],
968 [AC_MSG_RESULT([yes])
969 AC_DEFINE(HAVE_ISNAN, 1,
970 [Define to 1 if you have the `isnan' macro or function.])],
971 [AC_MSG_RESULT([no])])
973 # We must have a proper stack-using alloca in order for stack-copying
974 # continuations to work properly. If we don't find a native one,
978 if test "$ALLOCA" = "alloca.o"
980 AC_ERROR([No native alloca found.])
983 # Reasons for checking:
987 # st_blocks not in mingw
988 # tm_gmtoff BSD+GNU, not in C99
990 # Note AC_STRUCT_ST_BLOCKS is not used here because we don't want the
991 # AC_LIBOBJ(fileblocks) replacement which that macro gives.
993 AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks])
996 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,
998 #ifdef TIME_WITH_SYS_TIME
999 # include <sys/time.h>
1002 # if HAVE_SYS_TIME_H
1003 # include <sys/time.h>
1009 GUILE_STRUCT_UTIMBUF
1012 #--------------------------------------------------------------------
1014 # Which way does the stack grow?
1016 #--------------------------------------------------------------------
1018 SCM_I_GSC_STACK_GROWS_UP=0
1019 AC_TRY_RUN(aux (l) unsigned long l;
1020 { int x; exit (l >= ((unsigned long)&x)); }
1021 main () { int q; aux((unsigned long)&q); },
1022 [SCM_I_GSC_STACK_GROWS_UP=1],
1024 [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
1026 AC_CHECK_SIZEOF(float)
1027 if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
1028 AC_DEFINE(SCM_SINGLES, 1,
1029 [Define this if floats are the same size as longs.])
1032 AC_MSG_CHECKING(for struct linger)
1033 AC_CACHE_VAL(scm_cv_struct_linger,
1035 #include <sys/types.h>
1036 #include <sys/socket.h>],
1037 [struct linger lgr; lgr.l_linger = 100],
1038 scm_cv_struct_linger="yes",
1039 scm_cv_struct_linger="no"))
1040 AC_MSG_RESULT($scm_cv_struct_linger)
1041 if test $scm_cv_struct_linger = yes; then
1042 AC_DEFINE(HAVE_STRUCT_LINGER, 1,
1043 [Define this if your system defines struct linger, for use with the
1044 getsockopt and setsockopt system calls.])
1048 # On mingw, struct timespec is in <pthread.h>.
1050 AC_MSG_CHECKING(for struct timespec)
1051 AC_CACHE_VAL(scm_cv_struct_timespec,
1055 #include <pthread.h>
1057 [struct timespec t; t.tv_nsec = 100],
1058 scm_cv_struct_timespec="yes",
1059 scm_cv_struct_timespec="no"))
1060 AC_MSG_RESULT($scm_cv_struct_timespec)
1061 if test $scm_cv_struct_timespec = yes; then
1062 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
1063 [Define this if your system defines struct timespec via either <time.h> or <pthread.h>.])
1066 #--------------------------------------------------------------------
1068 # Flags for thread support
1070 #--------------------------------------------------------------------
1072 SCM_I_GSC_USE_PTHREAD_THREADS=0
1073 SCM_I_GSC_USE_NULL_THREADS=0
1074 AC_SUBST([SCM_I_GSC_USE_PTHREAD_THREADS])
1075 AC_SUBST([SCM_I_GSC_USE_NULL_THREADS])
1077 ### What thread package has the user asked for?
1078 AC_ARG_WITH(threads, [ --with-threads thread interface],
1081 AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
1083 case "$with_threads" in
1084 "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
1085 ACX_PTHREAD(CC="$PTHREAD_CC"
1086 LIBS="$PTHREAD_LIBS $LIBS"
1087 SCM_I_GSC_USE_PTHREAD_THREADS=1
1088 with_threads="pthreads",
1089 with_threads="null")
1091 old_CFLAGS="$CFLAGS"
1092 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1094 # Reasons for testing:
1095 # pthread_getattr_np - "np" meaning "non portable" says it
1096 # all; not present on MacOS X or Solaris 10
1097 # pthread_get_stackaddr_np - "np" meaning "non portable" says it
1098 # all; specific to MacOS X
1099 # pthread_sigmask - not available on mingw
1101 AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)
1103 # On past versions of Solaris, believe 8 through 10 at least, you
1104 # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
1105 # This is contrary to posix:
1106 # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
1107 # Check here if this style is required.
1109 # glibc (2.3.6 at least) works both with or without braces, so the
1110 # test checks whether it works without.
1112 AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
1113 guile_cv_need_braces_on_pthread_once_init,
1114 [AC_TRY_COMPILE([#include <pthread.h>],
1115 [pthread_once_t foo = PTHREAD_ONCE_INIT;],
1116 [guile_cv_need_braces_on_pthread_once_init=no],
1117 [guile_cv_need_braces_on_pthread_once_init=yes])])
1118 if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
1119 SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
1122 CFLAGS="$old_CFLAGS"
1124 # On Solaris, sched_yield lives in -lrt.
1125 AC_SEARCH_LIBS(sched_yield, rt)
1130 case "$with_threads" in
1134 SCM_I_GSC_USE_NULL_THREADS=1
1135 with_threads="null-threads"
1138 AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
1142 AC_MSG_CHECKING(what kind of threads to support)
1143 AC_MSG_RESULT($with_threads)
1145 ## Check whether pthread_attr_getstack works for the main thread
1147 if test "$with_threads" = pthreads; then
1149 AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
1150 old_CFLAGS="$CFLAGS"
1151 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1154 #if HAVE_PTHREAD_ATTR_GETSTACK
1155 #include <pthread.h>
1159 pthread_attr_t attr;
1163 pthread_getattr_np (pthread_self (), &attr);
1164 pthread_attr_getstack (&attr, &start, &size);
1165 end = (char *)start + size;
1167 if ((void *)&attr < start || (void *)&attr >= end)
1180 AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
1182 CFLAGS="$old_CFLAGS"
1183 AC_MSG_RESULT($works)
1185 fi # with_threads=pthreads
1189 if test "$cross_compiling" = "yes"; then
1190 AC_MSG_CHECKING(cc for build)
1191 ## /usr/bin/cc still uses wrong assembler
1192 ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
1193 CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
1195 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
1198 ## AC_MSG_CHECKING("if we are cross compiling")
1199 ## AC_MSG_RESULT($cross_compiling)
1200 if test "$cross_compiling" = "yes"; then
1201 AC_MSG_RESULT($CC_FOR_BUILD)
1204 ## No need as yet to be more elaborate
1205 CCLD_FOR_BUILD="$CC_FOR_BUILD"
1207 AC_SUBST(cross_compiling)
1208 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
1209 AC_SUBST(CCLD_FOR_BUILD)
1211 ## libtool erroneously calls CC_FOR_BUILD HOST_CC;
1212 ## --HOST is the platform that PACKAGE is compiled for.
1213 HOST_CC="$CC_FOR_BUILD"
1216 if test "$cross_compiling" = "yes"; then
1217 AC_MSG_CHECKING(guile for build)
1218 GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
1220 GUILE_FOR_BUILD='$(preinstguile)'
1223 ## AC_MSG_CHECKING("if we are cross compiling")
1224 ## AC_MSG_RESULT($cross_compiling)
1225 if test "$cross_compiling" = "yes"; then
1226 AC_MSG_RESULT($GUILE_FOR_BUILD)
1228 AC_ARG_VAR(GUILE_FOR_BUILD,[guile for build system])
1229 AC_SUBST(GUILE_FOR_BUILD)
1231 ## If we're using GCC, ask for aggressive warnings.
1234 ## We had -Wstrict-prototypes in here for a bit, but Guile does too
1235 ## much stuff with generic function pointers for that to really be
1236 ## less than exasperating.
1237 ## -Wpointer-arith was here too, but something changed in gcc/glibc
1238 ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
1239 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
1240 # Do this here so we don't screw up any of the tests above that might
1241 # not be "warning free"
1242 if test "${GUILE_ERROR_ON_WARNING}" = yes
1244 CFLAGS="${CFLAGS} -Werror"
1245 enable_compile_warnings=no
1250 ## If we're creating a shared library (using libtool!), then we'll
1251 ## need to generate a list of .lo files corresponding to the .o files
1252 ## given in LIBOBJS. We'll call it LIBLOBJS.
1253 LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"
1255 ## We also need to create corresponding .doc and .x files
1256 EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
1257 EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"
1259 AC_SUBST(GUILE_MAJOR_VERSION)
1260 AC_SUBST(GUILE_MINOR_VERSION)
1261 AC_SUBST(GUILE_MICRO_VERSION)
1262 AC_SUBST(GUILE_EFFECTIVE_VERSION)
1263 AC_SUBST(GUILE_VERSION)
1265 #######################################################################
1266 # library versioning
1268 AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
1269 AC_SUBST(LIBGUILE_INTERFACE_REVISION)
1270 AC_SUBST(LIBGUILE_INTERFACE_AGE)
1271 AC_SUBST(LIBGUILE_INTERFACE)
1273 AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
1274 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
1275 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
1276 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
1277 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
1279 AC_SUBST(LIBGUILE_SRFI_SRFI_4_MAJOR)
1280 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
1281 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
1282 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
1283 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)
1285 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_MAJOR)
1286 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
1287 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
1288 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
1289 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)
1291 AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
1292 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
1293 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
1294 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
1295 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)
1297 AC_SUBST(LIBGUILE_I18N_MAJOR)
1298 AC_SUBST(LIBGUILE_I18N_INTERFACE_CURRENT)
1299 AC_SUBST(LIBGUILE_I18N_INTERFACE_REVISION)
1300 AC_SUBST(LIBGUILE_I18N_INTERFACE_AGE)
1301 AC_SUBST(LIBGUILE_I18N_INTERFACE)
1304 #######################################################################
1306 dnl Tell guile-config what flags guile users should compile and link with.
1307 GUILE_LIBS="$LDFLAGS $LIBS"
1308 GUILE_CFLAGS="$PTHREAD_CFLAGS"
1309 AC_SUBST(GUILE_LIBS)
1310 AC_SUBST(GUILE_CFLAGS)
1314 AC_SUBST(EXTRA_DOT_DOC_FILES)
1315 AC_SUBST(EXTRA_DOT_X_FILES)
1317 dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
1318 top_builddir_absolute=`pwd`
1319 AC_SUBST(top_builddir_absolute)
1320 top_srcdir_absolute=`(cd $srcdir && pwd)`
1321 AC_SUBST(top_srcdir_absolute)
1323 # Additional SCM_I_GSC definitions are above.
1324 AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
1325 AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
1326 AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
1327 AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
1328 AC_SUBST([SCM_I_GSC_ENABLE_ELISP])
1329 AC_SUBST([SCM_I_GSC_STACK_GROWS_UP])
1330 AC_SUBST([SCM_I_GSC_C_INLINE])
1331 AC_CONFIG_FILES([libguile/gen-scmconfig.h])
1336 benchmark-suite/Makefile
1341 doc/tutorial/Makefile
1344 examples/box-dynamic-module/Makefile
1345 examples/box-dynamic/Makefile
1346 examples/box-module/Makefile
1347 examples/box/Makefile
1348 examples/modules/Makefile
1349 examples/safe/Makefile
1350 examples/scripts/Makefile
1351 guile-config/Makefile
1353 ice-9/debugger/Makefile
1354 ice-9/debugging/Makefile
1357 lang/elisp/internals/Makefile
1358 lang/elisp/primitives/Makefile
1365 test-suite/standalone/Makefile
1368 AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
1369 AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
1370 AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])
1371 AC_CONFIG_FILES([pre-inst-guile], [chmod +x pre-inst-guile])
1372 AC_CONFIG_FILES([pre-inst-guile-env], [chmod +x pre-inst-guile-env])
1373 AC_CONFIG_FILES([libguile/guile-snarf],
1374 [chmod +x libguile/guile-snarf])
1375 AC_CONFIG_FILES([libguile/guile-doc-snarf],
1376 [chmod +x libguile/guile-doc-snarf])
1377 AC_CONFIG_FILES([libguile/guile-func-name-check],
1378 [chmod +x libguile/guile-func-name-check])
1379 AC_CONFIG_FILES([libguile/guile-snarf-docs],
1380 [chmod +x libguile/guile-snarf-docs])
1384 dnl Local Variables:
1385 dnl comment-start: "dnl "
1387 dnl comment-start-skip: "\\bdnl\\b\\s *"