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, 2007 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 dnl `patsubst' here deletes the newline which "echo" prints. We can't use
31 dnl "echo -n" since -n is not portable (see autoconf manual "Limitations of
32 dnl Builtins"), in particular on solaris it results in a literal "-n" in
35 AC_INIT(patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${PACKAGE}),[
37 patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${GUILE_VERSION}),[
40 AC_CONFIG_AUX_DIR([.])
41 AC_CONFIG_SRCDIR(GUILE-VERSION)
42 AM_INIT_AUTOMAKE([no-define])
44 AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
45 AC_CONFIG_SRCDIR([GUILE-VERSION])
47 . $srcdir/GUILE-VERSION
50 AM_CONFIG_HEADER([config.h])
51 AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)
53 #--------------------------------------------------------------------
55 # Independent Subdirectories
57 #--------------------------------------------------------------------
59 AC_CONFIG_SUBDIRS(guile-readline)
61 #--------------------------------------------------------------------
63 dnl Some more checks for Win32
77 # for per-target cflags in the libguile subdir
82 AC_CHECK_LIB([ltdl], [lt_dlinit], ,
83 [AC_MSG_ERROR([libltdl not found. See README.])])
87 AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
88 AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
92 #--------------------------------------------------------------------
94 # User options (after above tests that may set default CFLAGS etc.)
96 #--------------------------------------------------------------------
98 GUILE_ERROR_ON_WARNING="yes"
100 AC_ARG_ENABLE(error-on-warning,
101 [ --enable-error-on-warning treat compile warnings as errors],
102 [case "${enableval}" in
103 yes | y) GUILE_ERROR_ON_WARNING="yes" ;;
104 no | n) GUILE_ERROR_ON_WARNING="no" ;;
105 *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
108 SCM_I_GSC_GUILE_DEBUG_FREELIST=0
109 AC_ARG_ENABLE(debug-freelist,
110 [ --enable-debug-freelist include garbage collector freelist debugging code],
111 if test "$enable_debug_freelist" = y \
112 || test "$enable_debug_freelist" = yes; then
113 SCM_I_GSC_GUILE_DEBUG_FREELIST=1
116 AC_ARG_ENABLE(debug-malloc,
117 [ --enable-debug-malloc include malloc debugging code],
118 if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
119 AC_DEFINE(GUILE_DEBUG_MALLOC, 1,
120 [Define this if you want to debug scm_must_malloc/realloc/free calls.])
123 SCM_I_GSC_GUILE_DEBUG=0
124 AC_ARG_ENABLE(guile-debug,
125 [AC_HELP_STRING([--enable-guile-debug],
126 [include internal debugging functions])],
127 if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
128 SCM_I_GSC_GUILE_DEBUG=1
132 [ --disable-posix omit posix interfaces],,
135 AC_ARG_ENABLE(networking,
136 [ --disable-networking omit networking interfaces],,
137 enable_networking=yes)
140 [ --disable-regex omit regular expression interfaces],,
143 AC_ARG_ENABLE([discouraged],
144 AC_HELP_STRING([--disable-discouraged],[omit discouraged features]))
146 if test "$enable_discouraged" = no; then
147 SCM_I_GSC_ENABLE_DISCOURAGED=0
149 SCM_I_GSC_ENABLE_DISCOURAGED=1
152 AC_ARG_ENABLE([deprecated],
153 AC_HELP_STRING([--disable-deprecated],[omit deprecated features]))
155 if test "$enable_deprecated" = no; then
156 SCM_I_GSC_ENABLE_DEPRECATED=0
158 if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
160 elif test "$enable_deprecated" = shutup; then
163 warn_default=$enable_deprecated
165 SCM_I_GSC_ENABLE_DEPRECATED=1
166 AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default",
167 [Define this to control the default warning level for deprecated features.])
171 [ --disable-elisp omit Emacs Lisp support],,
174 #--------------------------------------------------------------------
176 dnl Check for dynamic linking
180 [ --with-modules[=FILES] Add support for dynamic modules],
181 use_modules="$withval")
182 test -z "$use_modules" && use_modules=yes
184 if test "$use_modules" != no; then
185 if test "$use_modules" = yes; then
186 DLPREOPEN="-dlpreopen force"
188 DLPREOPEN="-export-dynamic"
189 for module in $use_modules; do
190 DLPREOPEN="$DLPREOPEN -dlopen $module"
195 dnl files which are destined for separate modules.
197 if test "$use_modules" != no; then
201 if test "$enable_posix" = yes; then
204 AC_DEFINE(HAVE_POSIX, 1,
205 [Define this if you want support for POSIX system calls in Guile.])
208 if test "$enable_networking" = yes; then
211 AC_DEFINE(HAVE_NETWORKING, 1,
212 [Define this if you want support for networking in Guile.])
215 if test "$enable_debug_malloc" = yes; then
216 AC_LIBOBJ([debug-malloc])
219 if test "$enable_elisp" = yes; then
220 SCM_I_GSC_ENABLE_ELISP=1
222 SCM_I_GSC_ENABLE_ELISP=0
224 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
228 # "volatile" is used in a couple of tests below.
232 if test "$ac_cv_c_inline" != no; then
233 SCM_I_GSC_C_INLINE="\"${ac_cv_c_inline}\""
235 SCM_I_GSC_C_INLINE=NULL
237 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
241 AC_CHECK_SIZEOF(char)
242 AC_CHECK_SIZEOF(unsigned char)
243 AC_CHECK_SIZEOF(short)
244 AC_CHECK_SIZEOF(unsigned short)
246 AC_CHECK_SIZEOF(unsigned int)
247 AC_CHECK_SIZEOF(long)
248 AC_CHECK_SIZEOF(unsigned long)
249 AC_CHECK_SIZEOF(size_t)
250 AC_CHECK_SIZEOF(long long)
251 AC_CHECK_SIZEOF(unsigned long long)
252 AC_CHECK_SIZEOF(__int64)
253 AC_CHECK_SIZEOF(unsigned __int64)
254 AC_CHECK_SIZEOF(void *)
255 AC_CHECK_SIZEOF(intptr_t)
256 AC_CHECK_SIZEOF(uintptr_t)
257 AC_CHECK_SIZEOF(ptrdiff_t)
258 AC_CHECK_SIZEOF(size_t)
259 AC_CHECK_SIZEOF(off_t)
261 if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
262 AC_MSG_ERROR(sizes of long and void* are not identical)
265 if test "$ac_cv_sizeof_ptrdiff_t" -ne 0; then
266 SCM_I_GSC_T_PTRDIFF='"ptrdiff_t"'
268 SCM_I_GSC_T_PTRDIFF='"long"'
270 AC_SUBST([SCM_I_GSC_T_PTRDIFF])
272 AC_CHECK_HEADERS([stdint.h])
273 AC_CHECK_HEADERS([inttypes.h])
275 AC_CHECK_SIZEOF(intmax_t)
277 SCM_I_GSC_NEEDS_STDINT_H=0
278 SCM_I_GSC_NEEDS_INTTYPES_H=0
280 ### intptr and uintptr (try not to use inttypes if we don't have to)
281 if test "$ac_cv_header_inttypes_h" = yes; then
282 if test "$ac_cv_sizeof_intptr_t" -eq 0; then
283 AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
285 if test "$ac_cv_sizeof_intptr_t" -ne 0; then
286 SCM_I_GSC_NEEDS_INTTYPES_H=1
289 if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
290 AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
292 if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
293 SCM_I_GSC_NEEDS_INTTYPES_H=1
298 ### See what's provided by stdint.h
299 if test "$ac_cv_header_stdint_h" = yes; then
300 AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
301 AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
302 AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
303 AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
304 AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
305 AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
306 AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
307 AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
308 AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
309 AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
312 # so we don't get confused by the cache (wish there was a better way
313 # to check particular headers for the same type...)
315 unset ac_cv_type_int8_t
316 unset ac_cv_type_uint8_t
317 unset ac_cv_type_int16_t
318 unset ac_cv_type_uint16_t
319 unset ac_cv_type_int32_t
320 unset ac_cv_type_uint32_t
321 unset ac_cv_type_int64_t
322 unset ac_cv_type_uint64_t
323 unset ac_cv_type_intmax_t
324 unset ac_cv_type_uintmax_t
326 ### See what's provided by inttypes.h
327 if test "$ac_cv_header_inttypes_h" = yes; then
328 AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
329 AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
330 AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
331 AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include <inttypes.h>])
332 AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
333 AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include <inttypes.h>])
334 AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
335 AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include <inttypes.h>])
336 AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include <inttypes.h>])
337 AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include <inttypes.h>])
340 # Try hard to find definitions for some required scm_t_*int* types.
342 ### Required type scm_t_int8
343 if test "$scm_stdint_has_int8"; then
344 SCM_I_GSC_T_INT8='"int8_t"'
345 SCM_I_GSC_NEEDS_STDINT_H=1
346 elif test "$scm_inttypes_has_int8"; then
347 SCM_I_GSC_T_INT8='"int8_t"'
348 SCM_I_GSC_NEEDS_INTTYPES_H=1
349 elif test "$ac_cv_sizeof_char" -eq 1; then
350 SCM_I_GSC_T_INT8='"signed char"'
352 AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
354 AC_SUBST([SCM_I_GSC_T_INT8])
356 ### Required type scm_t_uint8
357 if test "$scm_stdint_has_uint8"; then
358 SCM_I_GSC_T_UINT8='"uint8_t"'
359 SCM_I_GSC_NEEDS_STDINT_H=1
360 elif test "$scm_inttypes_has_uint8"; then
361 SCM_I_GSC_T_UINT8='"uint8_t"'
362 SCM_I_GSC_NEEDS_INTTYPES_H=1
363 elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
364 SCM_I_GSC_T_UINT8='"unsigned char"'
366 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
368 AC_SUBST([SCM_I_GSC_T_UINT8])
370 ### Required type scm_t_int16 (ANSI C says int or short might work)
371 if test "$scm_stdint_has_int16"; then
372 SCM_I_GSC_T_INT16='"int16_t"'
373 SCM_I_GSC_NEEDS_STDINT_H=1
374 elif test "$scm_inttypes_has_int16"; then
375 SCM_I_GSC_T_INT16='"int16_t"'
376 SCM_I_GSC_NEEDS_INTTYPES_H=1
377 elif test "$ac_cv_sizeof_int" -eq 2; then
378 SCM_I_GSC_T_INT16='"int"'
379 elif test "$ac_cv_sizeof_short" -eq 2; then
380 SCM_I_GSC_T_INT16='"short"'
382 AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
384 AC_SUBST([SCM_I_GSC_T_INT16])
386 ### Required type scm_t_uint16 (ANSI C says int or short might work)
387 if test "$scm_stdint_has_uint16"; then
388 SCM_I_GSC_T_UINT16='"uint16_t"'
389 SCM_I_GSC_NEEDS_STDINT_H=1
390 elif test "$scm_inttypes_has_uint16"; then
391 SCM_I_GSC_T_UINT16='"uint16_t"'
392 SCM_I_GSC_NEEDS_INTTYPES_H=1
393 elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
394 SCM_I_GSC_T_UINT16='"unsigned int"'
395 elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
396 SCM_I_GSC_T_UINT16='"unsigned short"'
398 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
400 AC_SUBST([SCM_I_GSC_T_UINT16])
403 ### Required type scm_t_int32 (ANSI C says int, short, or long might work)
404 if test "$scm_stdint_has_int32"; then
405 SCM_I_GSC_T_INT32='"int32_t"'
406 SCM_I_GSC_NEEDS_STDINT_H=1
407 elif test "$scm_inttypes_has_int32"; then
408 SCM_I_GSC_T_INT32='"int32_t"'
409 SCM_I_GSC_NEEDS_INTTYPES_H=1
410 elif test "$ac_cv_sizeof_int" -eq 4; then
411 SCM_I_GSC_T_INT32='"int"'
412 elif test "$ac_cv_sizeof_long" -eq 4; then
413 SCM_I_GSC_T_INT32='"long"'
414 elif test "$ac_cv_sizeof_short" -eq 4; then
415 SCM_I_GSC_T_INT32='"short"'
417 AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
419 AC_SUBST([SCM_I_GSC_T_INT32])
421 ### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
422 if test "$scm_stdint_has_uint32"; then
423 SCM_I_GSC_T_UINT32='"uint32_t"'
424 SCM_I_GSC_NEEDS_STDINT_H=1
425 elif test "$scm_inttypes_has_uint32"; then
426 SCM_I_GSC_T_UINT32='"uint32_t"'
427 SCM_I_GSC_NEEDS_INTTYPES_H=1
428 elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
429 SCM_I_GSC_T_UINT32='"unsigned int"'
430 elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
431 SCM_I_GSC_T_UINT32='"unsigned long"'
432 elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
433 SCM_I_GSC_T_UINT32='"unsigned short"'
435 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
437 AC_SUBST([SCM_I_GSC_T_UINT32])
439 ### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
440 ### Also try 'long long' and '__int64' if we have it.
442 if test "$scm_stdint_has_int64"; then
443 SCM_I_GSC_T_INT64='"int64_t"'
444 SCM_I_GSC_NEEDS_STDINT_H=1
445 elif test "$scm_inttypes_has_int64"; then
446 SCM_I_GSC_T_INT64='"int64_t"'
447 SCM_I_GSC_NEEDS_INTTYPES_H=1
448 elif test "$ac_cv_sizeof_int" -eq 8; then
449 SCM_I_GSC_T_INT64='"int"'
450 elif test "$ac_cv_sizeof_long" -eq 8; then
451 SCM_I_GSC_T_INT64='"long"'
452 elif test "$ac_cv_sizeof_short" -eq 8; then
453 SCM_I_GSC_T_INT64='"short"'
454 elif test "$ac_cv_sizeof_long_long" -eq 8; then
455 SCM_I_GSC_T_INT64='"long long"'
456 elif test "$ac_cv_sizeof___int64" -eq 8; then
457 SCM_I_GSC_T_INT64='"__int64"'
459 AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
461 AC_SUBST([SCM_I_GSC_T_INT64])
464 ### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
465 ### Also try 'long long' and '__int64' if we have it.
467 if test "$scm_stdint_has_uint64"; then
468 SCM_I_GSC_T_UINT64='"uint64_t"'
469 SCM_I_GSC_NEEDS_STDINT_H=1
470 elif test "$scm_inttypes_has_uint64"; then
471 SCM_I_GSC_T_UINT64='"uint64_t"'
472 SCM_I_GSC_NEEDS_INTTYPES_H=1
473 elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
474 SCM_I_GSC_T_UINT64='"unsigned int"'
475 elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
476 SCM_I_GSC_T_UINT64='"unsigned long"'
477 elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
478 SCM_I_GSC_T_UINT64='"unsigned short"'
479 elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
480 SCM_I_GSC_T_UINT64='"unsigned long long"'
481 elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
482 SCM_I_GSC_T_UINT64='"unsigned __int64"'
484 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
486 AC_SUBST([SCM_I_GSC_T_UINT64])
488 ### Required type scm_t_intmax
490 ### We try 'intmax_t', '__int64', 'long long' in this order. When
491 ### none of them is available, we use 'long'.
494 if test "$scm_stdint_has_intmax"; then
495 SCM_I_GSC_T_INTMAX='"intmax_t"'
496 SCM_I_GSC_NEEDS_STDINT_H=1
497 elif test "$scm_inttypes_has_intmax"; then
498 SCM_I_GSC_T_INTMAX='"intmax_t"'
499 SCM_I_GSC_NEEDS_INTTYPES_H=1
500 elif test "$ac_cv_sizeof___int64" -ne 0; then
501 SCM_I_GSC_T_INTMAX='"__int64"'
502 elif test "$ac_cv_sizeof_long_long" -ne 0; then
503 SCM_I_GSC_T_INTMAX='"long long"'
505 SCM_I_GSC_T_INTMAX='"long"'
507 AC_SUBST([SCM_I_GSC_T_INTMAX])
509 ### Required type scm_t_uintmax
511 ### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
512 ### this order. When none of them is available, we use 'unsigned long'.
514 SCM_I_GSC_T_UINTMAX=0
515 if test "$scm_stdint_has_uintmax"; then
516 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
517 SCM_I_GSC_NEEDS_STDINT_H=1
518 elif test "$scm_inttypes_has_uintmax"; then
519 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
520 SCM_I_GSC_NEEDS_INTTYPES_H=1
521 elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
522 SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
523 elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
524 SCM_I_GSC_T_UINTMAX='"unsigned long long"'
526 SCM_I_GSC_T_UINTMAX='"unsigned long"'
528 AC_SUBST([SCM_I_GSC_T_UINTMAX])
531 AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
532 AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
539 # Reasons for testing:
540 # complex.h - new in C99
541 # fenv.h - available in C99, but not older systems
542 # process.h - mingw specific
543 # langinfo.h, nl_types.h - SuS v2
545 AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
546 regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
547 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
548 sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
549 strings.h direct.h langinfo.h nl_types.h])
551 # "complex double" is new in C99, and "complex" is only a keyword if
552 # <complex.h> is included
553 AC_CHECK_TYPES(complex double,,,
558 # On MacOS X <sys/socklen.h> contains socklen_t, so must include that
560 AC_CHECK_TYPE(socklen_t, ,
561 [AC_DEFINE_UNQUOTED(socklen_t, int,
562 [Define to `int' if <sys/socket.h> does not define.])],
563 [#if HAVE_SYS_TYPES_H
564 #include <sys/types.h>
566 #include <sys/socket.h>
568 AC_CHECK_TYPE(struct ip_mreq)
570 GUILE_HEADER_LIBC_WITH_UNISTD
576 # On mingw -lm is empty, so this test is unnecessary, but it's
577 # harmless so we don't hard-code to suppress it.
581 AC_CHECK_FUNCS(gethostbyname)
582 if test $ac_cv_func_gethostbyname = no; then
583 AC_CHECK_LIB(nsl, gethostbyname)
586 AC_CHECK_FUNCS(connect)
587 if test $ac_cv_func_connect = no; then
588 AC_CHECK_LIB(socket, connect)
592 dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
597 AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
598 [Define if you have the <winsock2.h> header file.])])
599 AC_CHECK_LIB(ws2_32, main)
600 AC_LIBOBJ([win32-uname])
601 AC_LIBOBJ([win32-dirent])
602 if test "$enable_networking" = yes ; then
603 AC_LIBOBJ([win32-socket])
605 if test "$enable_shared" = yes ; then
606 EXTRA_DEFS="-DSCM_IMPORT"
607 AC_DEFINE(USE_DLL_IMPORT, 1,
608 [Define if you need additional CPP macros on Win32 platforms.])
614 # Reasons for testing:
615 # crt_externs.h - Darwin specific
617 AC_CHECK_HEADERS([assert.h crt_externs.h])
619 # Reasons for testing:
620 # DINFINITY - OSF specific
621 # DQNAN - OSF specific
622 # (DINFINITY and DQNAN are actually global variables, not functions)
623 # chsize - an MS-DOS-ism, found in mingw
624 # clog10 - not in mingw (though others like clog and csqrt are)
625 # fesetround - available in C99, but not older systems
626 # ftruncate - posix, but probably not older systems (current mingw
627 # has it as an inline for chsize)
628 # ioctl - not in mingw.
629 # gmtime_r - recent posix, not on old systems
630 # pipe - not in mingw
631 # _pipe - specific to mingw, taking 3 args
632 # readdir_r - recent posix, not on old systems
633 # stat64 - SuS largefile stuff, not on old systems
634 # sysconf - not on old systems
635 # truncate - not in mingw
636 # isblank - available as a GNU extension or in C99
637 # _NSGetEnviron - Darwin specific
638 # strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
639 # nl_langinfo - X/Open, not available on Windows.
641 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 strncasecmp strcoll strcoll_l newlocale nl_langinfo])
643 # Reasons for testing:
644 # netdb.h - not in mingw
645 # sys/param.h - not in mingw
646 # pthread.h - only available with pthreads. ACX_PTHREAD doesn't
647 # check this specifically, we need it for the timespec test below.
648 # sethostname - the function itself check because it's not in mingw,
649 # the DECL is checked because Solaris 10 doens't have in any header
650 # xlocale.h - needed on Darwin for the `locale_t' API
652 AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h xlocale.h)
653 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
654 AC_CHECK_DECLS([sethostname])
656 # crypt() may or may not be available, for instance in some countries there
657 # are restrictions on cryptography.
659 # crypt() might be in libc (eg. OpenBSD), or it might be in a separate
660 # -lcrypt library (eg. Debian GNU/Linux).
662 # On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a. We must
663 # be careful to avoid -lcrypt in this case, since libtool will see there's
664 # only a static libcrypt and decide to build only a static libguile.
666 # AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the
667 # libraries already in that list.
669 AC_SEARCH_LIBS(crypt, crypt,
670 [AC_DEFINE(HAVE_CRYPT,1,
671 [Define to 1 if you have the `crypt' function.])])
673 # glibc 2.3.6 (circa 2006) and various prior versions had a bug where
674 # csqrt(-i) returned a negative real part, when it should be positive
675 # for the principal root.
677 if test "$ac_cv_type_complex_double" = yes; then
679 AC_CHECK_FUNCS(cexp clog carg)
680 AC_CACHE_CHECK([whether csqrt is usable],
684 /* "volatile" is meant to prevent gcc from calculating the sqrt as a
685 constant, we want to test libc. */
686 volatile complex double z = - _Complex_I;
696 [guile_cv_use_csqrt=yes],
697 [guile_cv_use_csqrt="no, glibc 2.3 bug"],
698 [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
699 case $guile_cv_use_csqrt in
701 AC_DEFINE(HAVE_USABLE_CSQRT, 1, [Define to 1 if csqrt is bug-free])
708 AC_CHECK_LIB([gmp], [__gmpz_init], ,
709 [AC_MSG_ERROR([GNU MP not found, see README])])
711 # mpz_import is a macro so we need to include <gmp.h>
712 AC_TRY_LINK([#include <gmp.h>],
713 [mpz_import (0, 0, 0, 0, 0, 0, 0);] , ,
714 [AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])])
717 #AC_CHECK_HEADERS([libintl.h])
718 #AC_CHECK_FUNCS(gettext)
719 #if test $ac_cv_func_gettext = no; then
720 # AC_CHECK_LIB(intl, gettext)
722 #AC_CHECK_FUNCS([bindtextdomain textdomain])
723 AM_GNU_GETTEXT([external], [need-ngettext])
725 ### Some systems don't declare some functions. On such systems, we
726 ### need to at least provide our own K&R-style declarations.
728 ### GUILE_FUNC_DECLARED(function, headerfile)
730 ### Check for a declaration of FUNCTION in HEADERFILE; if it is
731 ### not there, #define MISSING_FUNCTION_DECL.
732 AC_DEFUN([GUILE_FUNC_DECLARED], [
733 AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
734 AC_EGREP_HEADER($1, $2,
735 guile_cv_func_$1_declared=yes,
736 guile_cv_func_$1_declared=no))
737 if test [x$guile_cv_func_]$1[_declared] = xno; then
738 AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
739 [Define if the operating system supplies $1 without declaring it.])
743 GUILE_FUNC_DECLARED(sleep, unistd.h)
744 GUILE_FUNC_DECLARED(usleep, unistd.h)
746 AC_CHECK_DECLS([strptime],,,
747 [#define _GNU_SOURCE /* ask glibc to give strptime prototype */
750 ### On some systems usleep has no return value. If it does have one,
751 ### we'd like to return it; otherwise, we'll fake it.
752 AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
753 [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
755 [guile_cv_func_usleep_return_type=void],
756 [guile_cv_func_usleep_return_type=int])])
757 case "$guile_cv_func_usleep_return_type" in
759 AC_DEFINE(USLEEP_RETURNS_VOID, 1,
760 [Define if the system headers declare usleep to return void.])
764 AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
765 if test -n "$have_sys_un_h" ; then
766 AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS, 1,
767 [Define if the system supports Unix-domain (file-domain) sockets.])
770 AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)
772 AC_CHECK_FUNCS(sethostent gethostent endhostent dnl
773 setnetent getnetent endnetent dnl
774 setprotoent getprotoent endprotoent dnl
775 setservent getservent endservent dnl
776 getnetbyaddr getnetbyname dnl
777 inet_lnaof inet_makeaddr inet_netof hstrerror dnl
780 # struct sockaddr field sin_len is only present on BSD systems.
781 # On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
782 # (eg. FreeBSD 4.9) it doesn't and we must use this configure check
783 AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
784 [#ifdef HAVE_SYS_TYPES_H
785 #include <sys/types.h>
787 #include <netinet/in.h>])
789 AC_MSG_CHECKING(for __libc_stack_end)
790 AC_CACHE_VAL(guile_cv_have_libc_stack_end,
791 [AC_TRY_LINK([#include <stdio.h>
792 extern char *__libc_stack_end;],
793 [printf("%p", (char*) __libc_stack_end);],
794 guile_cv_have_libc_stack_end=yes,
795 guile_cv_have_libc_stack_end=no)])
796 AC_MSG_RESULT($guile_cv_have_libc_stack_end)
798 if test $guile_cv_have_libc_stack_end = yes; then
799 AC_DEFINE(HAVE_LIBC_STACK_END, 1,
800 [Define if you have the __libc_stack_end variable.])
803 dnl Some systems do not declare this. Some systems do declare it, as a
804 dnl macro. With cygwin it may be in a DLL.
806 AC_MSG_CHECKING(whether netdb.h declares h_errno)
807 AC_CACHE_VAL(guile_cv_have_h_errno,
808 [AC_TRY_COMPILE([#include <netdb.h>],
810 guile_cv_have_h_errno=yes, guile_cv_have_h_errno=no)])
811 AC_MSG_RESULT($guile_cv_have_h_errno)
812 if test $guile_cv_have_h_errno = yes; then
813 AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
816 AC_MSG_CHECKING(whether uint32_t is defined)
817 AC_CACHE_VAL(guile_cv_have_uint32_t,
818 [AC_TRY_COMPILE([#include <sys/types.h>
826 guile_cv_have_uint32_t=yes, guile_cv_have_uint32_t=no)])
827 AC_MSG_RESULT($guile_cv_have_uint32_t)
828 if test $guile_cv_have_uint32_t = yes; then
829 AC_DEFINE(HAVE_UINT32_T, 1,
830 [Define if uint32_t typedef is defined when netdb.h is include.])
833 AC_MSG_CHECKING(for working IPv6 support)
834 AC_CACHE_VAL(guile_cv_have_ipv6,
836 #ifdef HAVE_SYS_TYPES_H
837 #include <sys/types.h>
839 #include <netinet/in.h>
840 #include <sys/socket.h>],
841 [struct sockaddr_in6 a; a.sin6_family = AF_INET6;],
842 guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)])
843 AC_MSG_RESULT($guile_cv_have_ipv6)
844 if test $guile_cv_have_ipv6 = yes; then
845 AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
848 # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
849 AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
850 AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
852 #ifdef HAVE_SYS_TYPES_H
853 #include <sys/types.h>
855 #include <netinet/in.h>],
856 [struct sockaddr_in6 sok; sok.sin6_scope_id = 0;],
857 guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)])
858 AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
859 if test $guile_cv_have_sin6_scope_id = yes; then
860 AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
861 [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
864 # struct sockaddr_in6 field sin_len is only present on BSD systems
865 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
866 [#ifdef HAVE_SYS_TYPES_H
867 #include <sys/types.h>
869 #include <netinet/in.h>])
871 AC_MSG_CHECKING(whether localtime caches TZ)
872 AC_CACHE_VAL(guile_cv_localtime_cache,
873 [if test x$ac_cv_func_tzset = xyes; then
874 AC_TRY_RUN([#include <time.h>
878 extern char **environ;
882 for (to = from = environ; (*to = *from); from++)
883 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
886 char TZ_GMT0[] = "TZ=GMT0";
887 char TZ_PST8[] = "TZ=PST8";
890 time_t now = time ((time_t *) 0);
891 int hour_GMT0, hour_unset;
892 if (putenv (TZ_GMT0) != 0)
894 hour_GMT0 = localtime (&now)->tm_hour;
896 hour_unset = localtime (&now)->tm_hour;
897 if (putenv (TZ_PST8) != 0)
899 if (localtime (&now)->tm_hour == hour_GMT0)
902 if (localtime (&now)->tm_hour != hour_unset)
905 }], guile_cv_localtime_cache=no, guile_cv_localtime_cache=yes,
906 [# If we have tzset, assume the worst when cross-compiling.
907 guile_cv_localtime_cache=yes])
909 # If we lack tzset, report that localtime does not cache TZ,
910 # since we can't invalidate the cache if we don't have tzset.
911 guile_cv_localtime_cache=no
913 AC_MSG_RESULT($guile_cv_localtime_cache)
914 if test $guile_cv_localtime_cache = yes; then
915 AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
918 dnl Test whether system calls are restartable by default on the
919 dnl current system. If they are not, we put a loop around every system
920 dnl call to check for EINTR (see SCM_SYSCALL) and do not attempt to
921 dnl change from the default behaviour. On the other hand, if signals
922 dnl are restartable then the loop is not installed and when libguile
923 dnl initialises it also resets the behaviour of each signal to cause a
924 dnl restart (in case a different runtime had a different default
925 dnl behaviour for some reason: e.g., different versions of linux seem
926 dnl to behave differently.)
928 AC_SYS_RESTARTABLE_SYSCALLS
930 if test "$enable_regex" = yes; then
931 if test "$ac_cv_header_regex_h" = yes ||
932 test "$ac_cv_header_rxposix_h" = yes ||
933 test "$ac_cv_header_rx_rxposix_h" = yes; then
934 GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
935 [AC_CHECK_LIB(rx, main)
936 GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
937 [AC_CHECK_LIB(regex, main)
938 GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
940 dnl The following should not be necessary, but for some reason
941 dnl autoheader misses it if we don't include it!
942 if test "$ac_cv_func_regcomp_norx" = yes ||
943 test "$ac_cv_func_regcomp_regex" = yes ||
944 test "$ac_cv_func_regcomp_rx" = yes; then
945 AC_DEFINE(HAVE_REGCOMP, 1,
946 [This is included as part of a workaround for a autoheader bug.])
951 AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
953 AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
955 # Reasons for testing:
956 # asinh, acosh, atanh, trunc - C99 standard, generally not available on
958 # sincos - GLIBC extension
960 AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
962 # C99 specifies isinf and isnan as macros.
963 # HP-UX provides only macros, no functions.
964 # glibc 2.3.2 provides both macros and functions.
965 # IRIX 6.5 and Solaris 8 only provide functions.
967 # The following tests detect isinf and isnan either as functions or as
968 # macros from <math.h>. Plain AC_CHECK_FUNCS is insufficient, it doesn't
969 # use <math.h> so doesn't detect on macro-only systems like HP-UX.
971 AC_MSG_CHECKING([for isinf])
972 AC_LINK_IFELSE(AC_LANG_SOURCE(
974 volatile double x = 0.0;
975 int main () { return (isinf(x) != 0); }]]),
976 [AC_MSG_RESULT([yes])
977 AC_DEFINE(HAVE_ISINF, 1,
978 [Define to 1 if you have the `isinf' macro or function.])],
979 [AC_MSG_RESULT([no])])
980 AC_MSG_CHECKING([for isnan])
981 AC_LINK_IFELSE(AC_LANG_SOURCE(
983 volatile double x = 0.0;
984 int main () { return (isnan(x) != 0); }]]),
985 [AC_MSG_RESULT([yes])
986 AC_DEFINE(HAVE_ISNAN, 1,
987 [Define to 1 if you have the `isnan' macro or function.])],
988 [AC_MSG_RESULT([no])])
990 # We must have a proper stack-using alloca in order for stack-copying
991 # continuations to work properly. If we don't find a native one,
995 if test "$ALLOCA" = "alloca.o"
997 AC_ERROR([No native alloca found.])
1000 # Reasons for checking:
1004 # st_blocks not in mingw
1005 # tm_gmtoff BSD+GNU, not in C99
1007 # Note AC_STRUCT_ST_BLOCKS is not used here because we don't want the
1008 # AC_LIBOBJ(fileblocks) replacement which that macro gives.
1010 AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks])
1013 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,
1015 #ifdef TIME_WITH_SYS_TIME
1016 # include <sys/time.h>
1019 # if HAVE_SYS_TIME_H
1020 # include <sys/time.h>
1026 GUILE_STRUCT_UTIMBUF
1029 #--------------------------------------------------------------------
1031 # Which way does the stack grow?
1033 #--------------------------------------------------------------------
1035 SCM_I_GSC_STACK_GROWS_UP=0
1036 AC_TRY_RUN(aux (l) unsigned long l;
1037 { int x; exit (l >= ((unsigned long)&x)); }
1038 main () { int q; aux((unsigned long)&q); },
1039 [SCM_I_GSC_STACK_GROWS_UP=1],
1041 [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
1043 AC_CHECK_SIZEOF(float)
1044 if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
1045 AC_DEFINE(SCM_SINGLES, 1,
1046 [Define this if floats are the same size as longs.])
1049 AC_MSG_CHECKING(for struct linger)
1050 AC_CACHE_VAL(scm_cv_struct_linger,
1052 #include <sys/types.h>
1053 #include <sys/socket.h>],
1054 [struct linger lgr; lgr.l_linger = 100],
1055 scm_cv_struct_linger="yes",
1056 scm_cv_struct_linger="no"))
1057 AC_MSG_RESULT($scm_cv_struct_linger)
1058 if test $scm_cv_struct_linger = yes; then
1059 AC_DEFINE(HAVE_STRUCT_LINGER, 1,
1060 [Define this if your system defines struct linger, for use with the
1061 getsockopt and setsockopt system calls.])
1065 # On mingw, struct timespec is in <pthread.h>.
1067 AC_MSG_CHECKING(for struct timespec)
1068 AC_CACHE_VAL(scm_cv_struct_timespec,
1072 #include <pthread.h>
1074 [struct timespec t; t.tv_nsec = 100],
1075 scm_cv_struct_timespec="yes",
1076 scm_cv_struct_timespec="no"))
1077 AC_MSG_RESULT($scm_cv_struct_timespec)
1078 if test $scm_cv_struct_timespec = yes; then
1079 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
1080 [Define this if your system defines struct timespec via either <time.h> or <pthread.h>.])
1083 #--------------------------------------------------------------------
1085 # Flags for thread support
1087 #--------------------------------------------------------------------
1089 SCM_I_GSC_USE_PTHREAD_THREADS=0
1090 SCM_I_GSC_USE_NULL_THREADS=0
1091 AC_SUBST([SCM_I_GSC_USE_PTHREAD_THREADS])
1092 AC_SUBST([SCM_I_GSC_USE_NULL_THREADS])
1094 ### What thread package has the user asked for?
1095 AC_ARG_WITH(threads, [ --with-threads thread interface],
1098 AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
1100 case "$with_threads" in
1101 "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
1102 ACX_PTHREAD(CC="$PTHREAD_CC"
1103 LIBS="$PTHREAD_LIBS $LIBS"
1104 SCM_I_GSC_USE_PTHREAD_THREADS=1
1105 with_threads="pthreads",
1106 with_threads="null")
1108 old_CFLAGS="$CFLAGS"
1109 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1111 # Reasons for testing:
1112 # pthread_getattr_np - "np" meaning "non portable" says it
1113 # all; not present on MacOS X or Solaris 10
1114 # pthread_get_stackaddr_np - "np" meaning "non portable" says it
1115 # all; specific to MacOS X
1116 # pthread_sigmask - not available on mingw
1118 AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)
1120 # On past versions of Solaris, believe 8 through 10 at least, you
1121 # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
1122 # This is contrary to posix:
1123 # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
1124 # Check here if this style is required.
1126 # glibc (2.3.6 at least) works both with or without braces, so the
1127 # test checks whether it works without.
1129 AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
1130 guile_cv_need_braces_on_pthread_once_init,
1131 [AC_TRY_COMPILE([#include <pthread.h>],
1132 [pthread_once_t foo = PTHREAD_ONCE_INIT;],
1133 [guile_cv_need_braces_on_pthread_once_init=no],
1134 [guile_cv_need_braces_on_pthread_once_init=yes])])
1135 if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
1136 SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
1139 CFLAGS="$old_CFLAGS"
1141 # On Solaris, sched_yield lives in -lrt.
1142 AC_SEARCH_LIBS(sched_yield, rt)
1147 case "$with_threads" in
1151 SCM_I_GSC_USE_NULL_THREADS=1
1152 with_threads="null-threads"
1155 AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
1159 AC_MSG_CHECKING(what kind of threads to support)
1160 AC_MSG_RESULT($with_threads)
1162 ## Check whether pthread_attr_getstack works for the main thread
1164 if test "$with_threads" = pthreads; then
1166 AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
1167 old_CFLAGS="$CFLAGS"
1168 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1171 #if HAVE_PTHREAD_ATTR_GETSTACK
1172 #include <pthread.h>
1176 pthread_attr_t attr;
1180 pthread_getattr_np (pthread_self (), &attr);
1181 pthread_attr_getstack (&attr, &start, &size);
1182 end = (char *)start + size;
1184 if ((void *)&attr < start || (void *)&attr >= end)
1197 AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
1199 CFLAGS="$old_CFLAGS"
1200 AC_MSG_RESULT($works)
1202 fi # with_threads=pthreads
1206 if test "$cross_compiling" = "yes"; then
1207 AC_MSG_CHECKING(cc for build)
1208 ## /usr/bin/cc still uses wrong assembler
1209 ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
1210 CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
1212 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
1215 ## AC_MSG_CHECKING("if we are cross compiling")
1216 ## AC_MSG_RESULT($cross_compiling)
1217 if test "$cross_compiling" = "yes"; then
1218 AC_MSG_RESULT($CC_FOR_BUILD)
1221 ## No need as yet to be more elaborate
1222 CCLD_FOR_BUILD="$CC_FOR_BUILD"
1224 AC_SUBST(cross_compiling)
1225 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
1226 AC_SUBST(CCLD_FOR_BUILD)
1228 ## libtool erroneously calls CC_FOR_BUILD HOST_CC;
1229 ## --HOST is the platform that PACKAGE is compiled for.
1230 HOST_CC="$CC_FOR_BUILD"
1233 if test "$cross_compiling" = "yes"; then
1234 AC_MSG_CHECKING(guile for build)
1235 GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
1237 GUILE_FOR_BUILD='$(preinstguile)'
1240 ## AC_MSG_CHECKING("if we are cross compiling")
1241 ## AC_MSG_RESULT($cross_compiling)
1242 if test "$cross_compiling" = "yes"; then
1243 AC_MSG_RESULT($GUILE_FOR_BUILD)
1245 AC_ARG_VAR(GUILE_FOR_BUILD,[guile for build system])
1246 AC_SUBST(GUILE_FOR_BUILD)
1248 ## If we're using GCC, ask for aggressive warnings.
1251 ## We had -Wstrict-prototypes in here for a bit, but Guile does too
1252 ## much stuff with generic function pointers for that to really be
1253 ## less than exasperating.
1254 ## -Wpointer-arith was here too, but something changed in gcc/glibc
1255 ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
1256 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
1257 # Do this here so we don't screw up any of the tests above that might
1258 # not be "warning free"
1259 if test "${GUILE_ERROR_ON_WARNING}" = yes
1261 CFLAGS="${CFLAGS} -Werror"
1262 enable_compile_warnings=no
1267 ## If we're creating a shared library (using libtool!), then we'll
1268 ## need to generate a list of .lo files corresponding to the .o files
1269 ## given in LIBOBJS. We'll call it LIBLOBJS.
1270 LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"
1272 ## We also need to create corresponding .doc and .x files
1273 EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
1274 EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"
1276 AC_SUBST(GUILE_MAJOR_VERSION)
1277 AC_SUBST(GUILE_MINOR_VERSION)
1278 AC_SUBST(GUILE_MICRO_VERSION)
1279 AC_SUBST(GUILE_EFFECTIVE_VERSION)
1280 AC_SUBST(GUILE_VERSION)
1282 #######################################################################
1283 # library versioning
1285 AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
1286 AC_SUBST(LIBGUILE_INTERFACE_REVISION)
1287 AC_SUBST(LIBGUILE_INTERFACE_AGE)
1288 AC_SUBST(LIBGUILE_INTERFACE)
1290 AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
1291 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
1292 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
1293 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
1294 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
1296 AC_SUBST(LIBGUILE_SRFI_SRFI_4_MAJOR)
1297 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
1298 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
1299 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
1300 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)
1302 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_MAJOR)
1303 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
1304 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
1305 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
1306 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)
1308 AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
1309 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
1310 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
1311 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
1312 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)
1314 AC_SUBST(LIBGUILE_I18N_MAJOR)
1315 AC_SUBST(LIBGUILE_I18N_INTERFACE_CURRENT)
1316 AC_SUBST(LIBGUILE_I18N_INTERFACE_REVISION)
1317 AC_SUBST(LIBGUILE_I18N_INTERFACE_AGE)
1318 AC_SUBST(LIBGUILE_I18N_INTERFACE)
1321 #######################################################################
1323 dnl Tell guile-config what flags guile users should compile and link with.
1324 GUILE_LIBS="$LDFLAGS $LIBS"
1325 GUILE_CFLAGS="$PTHREAD_CFLAGS"
1326 AC_SUBST(GUILE_LIBS)
1327 AC_SUBST(GUILE_CFLAGS)
1331 AC_SUBST(EXTRA_DOT_DOC_FILES)
1332 AC_SUBST(EXTRA_DOT_X_FILES)
1334 dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
1335 top_builddir_absolute=`pwd`
1336 AC_SUBST(top_builddir_absolute)
1337 top_srcdir_absolute=`(cd $srcdir && pwd)`
1338 AC_SUBST(top_srcdir_absolute)
1340 # Additional SCM_I_GSC definitions are above.
1341 AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
1342 AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
1343 AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
1344 AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
1345 AC_SUBST([SCM_I_GSC_ENABLE_ELISP])
1346 AC_SUBST([SCM_I_GSC_STACK_GROWS_UP])
1347 AC_SUBST([SCM_I_GSC_C_INLINE])
1348 AC_CONFIG_FILES([libguile/gen-scmconfig.h])
1353 benchmark-suite/Makefile
1358 doc/tutorial/Makefile
1361 examples/box-dynamic-module/Makefile
1362 examples/box-dynamic/Makefile
1363 examples/box-module/Makefile
1364 examples/box/Makefile
1365 examples/modules/Makefile
1366 examples/safe/Makefile
1367 examples/scripts/Makefile
1368 guile-config/Makefile
1370 ice-9/debugger/Makefile
1371 ice-9/debugging/Makefile
1374 lang/elisp/internals/Makefile
1375 lang/elisp/primitives/Makefile
1382 test-suite/standalone/Makefile
1385 AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
1386 AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
1387 AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])
1388 AC_CONFIG_FILES([pre-inst-guile], [chmod +x pre-inst-guile])
1389 AC_CONFIG_FILES([pre-inst-guile-env], [chmod +x pre-inst-guile-env])
1390 AC_CONFIG_FILES([libguile/guile-snarf],
1391 [chmod +x libguile/guile-snarf])
1392 AC_CONFIG_FILES([libguile/guile-doc-snarf],
1393 [chmod +x libguile/guile-doc-snarf])
1394 AC_CONFIG_FILES([libguile/guile-func-name-check],
1395 [chmod +x libguile/guile-func-name-check])
1396 AC_CONFIG_FILES([libguile/guile-snarf-docs],
1397 [chmod +x libguile/guile-snarf-docs])
1401 dnl Local Variables:
1402 dnl comment-start: "dnl "
1404 dnl comment-start-skip: "\\bdnl\\b\\s *"