Rename the `testsuite' directory to `test-suite/vm'.
[bpt/guile.git] / configure.ac
1 dnl configuration script for Guile
2 dnl Process this file with autoconf to produce configure.
3 dnl
4
5 define(GUILE_CONFIGURE_COPYRIGHT,[[
6
7 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
8
9 This file is part of GUILE
10
11 GUILE is free software; you can redistribute it and/or modify it under
12 the terms of the GNU Lesser General Public License as published by the
13 Free Software Foundation; either version 3, or (at your option) any
14 later version.
15
16 GUILE is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
19 License for more details.
20
21 You should have received a copy of the GNU Lesser General Public
22 License along with GUILE; see the file COPYING.LESSER. If not, write
23 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
24 Floor, Boston, MA 02110-1301, USA.
25
26 ]])
27
28 AC_PREREQ(2.61)
29
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
33 dnl the output.
34 dnl
35 AC_INIT([GNU Guile],
36 patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${GUILE_VERSION}),[
37 ]),
38 [bug-guile@gnu.org])
39 AC_CONFIG_AUX_DIR([build-aux])
40 AC_CONFIG_MACRO_DIR([m4])
41 AC_CONFIG_SRCDIR(GUILE-VERSION)
42
43 AM_INIT_AUTOMAKE([gnu no-define check-news -Wall -Wno-override])
44
45 AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
46 AC_CONFIG_SRCDIR([GUILE-VERSION])
47
48 . $srcdir/GUILE-VERSION
49
50 AC_CONFIG_HEADERS([config.h])
51 AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)
52
53 #--------------------------------------------------------------------
54
55 AC_LANG([C])
56
57 dnl Some more checks for Win32
58 AC_CANONICAL_HOST
59
60 AC_LIBTOOL_WIN32_DLL
61
62 AC_PROG_INSTALL
63 AC_PROG_CC
64 gl_EARLY
65 AC_PROG_CPP
66 AC_PROG_SED
67 AC_PROG_AWK
68
69 dnl Gnulib.
70 gl_INIT
71
72 AC_PROG_CC_C89
73
74 # for per-target cflags in the libguile subdir
75 AM_PROG_CC_C_O
76
77 AC_LIBTOOL_DLOPEN
78 AC_PROG_LIBTOOL
79 AC_CHECK_LIB([ltdl], [lt_dlinit], ,
80 [AC_MSG_ERROR([libltdl not found. See README.])])
81 AC_CHECK_HEADER([ltdl.h], [],
82 [AC_MSG_ERROR([<ltdl.h> not found. See README.])])
83
84 AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
85 AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
86
87 AM_PATH_LISPDIR
88
89 AC_DEFINE_UNQUOTED([HOST_TYPE], ["$host"],
90 [Define to the host's GNU triplet.])
91
92 #--------------------------------------------------------------------
93 #
94 # User options (after above tests that may set default CFLAGS etc.)
95 #
96 #--------------------------------------------------------------------
97
98 GUILE_ERROR_ON_WARNING="no"
99
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) ;;
106 esac])
107
108 AC_ARG_ENABLE(debug-malloc,
109 [ --enable-debug-malloc include malloc debugging code],
110 if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
111 AC_DEFINE([GUILE_DEBUG_MALLOC], 1,
112 [Define this if you want to debug scm_must_malloc/realloc/free calls.])
113 fi)
114
115 SCM_I_GSC_GUILE_DEBUG=0
116 AC_ARG_ENABLE(guile-debug,
117 [AS_HELP_STRING([--enable-guile-debug],
118 [include internal debugging functions])],
119 if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
120 SCM_I_GSC_GUILE_DEBUG=1
121 fi)
122
123 AC_ARG_ENABLE(posix,
124 [ --disable-posix omit posix interfaces],,
125 enable_posix=yes)
126
127 AC_ARG_ENABLE(networking,
128 [ --disable-networking omit networking interfaces],,
129 enable_networking=yes)
130
131 AC_ARG_ENABLE(regex,
132 [ --disable-regex omit regular expression interfaces],,
133 enable_regex=yes)
134
135 AC_ARG_ENABLE([discouraged],
136 AS_HELP_STRING([--disable-discouraged],[omit discouraged features]))
137
138 if test "$enable_discouraged" = no; then
139 SCM_I_GSC_ENABLE_DISCOURAGED=0
140 else
141 SCM_I_GSC_ENABLE_DISCOURAGED=1
142 fi
143
144 AC_ARG_ENABLE([deprecated],
145 AS_HELP_STRING([--disable-deprecated],[omit deprecated features]))
146
147 if test "$enable_deprecated" = no; then
148 SCM_I_GSC_ENABLE_DEPRECATED=0
149 warn_default=no
150 else
151 if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
152 warn_default=summary
153 elif test "$enable_deprecated" = shutup; then
154 warn_default=no
155 else
156 warn_default=$enable_deprecated
157 fi
158 SCM_I_GSC_ENABLE_DEPRECATED=1
159 fi
160 AC_DEFINE_UNQUOTED([SCM_WARN_DEPRECATED_DEFAULT], "$warn_default",
161 [Define this to control the default warning level for deprecated features.])
162
163 dnl Added the following configure option in January 2008 following
164 dnl investigation of problems with "64" system and library calls on
165 dnl Darwin (MacOS X). The libguile code (_scm.h) assumes that if a
166 dnl system has stat64, it will have all the other 64 APIs too; but on
167 dnl Darwin, stat64 is there but other APIs are missing.
168 dnl
169 dnl It also appears, from the Darwin docs, that most system call APIs
170 dnl there (i.e. the traditional ones _without_ "64" in their names) have
171 dnl been 64-bit-capable for a long time now, so it isn't necessary to
172 dnl use "64" versions anyway. For example, Darwin's off_t is 64-bit.
173 dnl
174 dnl A similar problem has been reported for HP-UX:
175 dnl http://www.nabble.com/Building-guile-1.8.2-on-hpux-td13106681.html
176 dnl
177 dnl Therefore, and also because a Guile without LARGEFILE64 support is
178 dnl better than no Guile at all, we provide this option to suppress
179 dnl trying to use "64" calls.
180 dnl
181 dnl It may be that for some 64-bit function on Darwin/HP-UX we do need
182 dnl to use a "64" call, and hence that by using --without-64-calls we're
183 dnl missing out on that. If so, someone can work on that in the future.
184 dnl For now, --without-64-calls allows Guile to build on OSs where it
185 dnl wasn't building before.
186 AC_MSG_CHECKING([whether to use system and library "64" calls])
187 AC_ARG_WITH([64-calls],
188 AS_HELP_STRING([--without-64-calls],
189 [don't attempt to use system and library calls with "64" in their names]),
190 [use_64_calls=$withval],
191 [use_64_calls=yes
192 case $host in
193 *-apple-darwin* )
194 use_64_calls=no
195 ;;
196 powerpc-ibm-aix* )
197 use_64_calls=no
198 ;;
199 esac])
200 AC_MSG_RESULT($use_64_calls)
201 case "$use_64_calls" in
202 y* )
203 AC_DEFINE([GUILE_USE_64_CALLS], 1,
204 [Define to 1 in order to try to use "64" versions of system and library calls.])
205 ;;
206 esac
207
208 #--------------------------------------------------------------------
209
210 dnl Check for dynamic linking
211
212 use_modules=yes
213 AC_ARG_WITH(modules,
214 [ --with-modules[=FILES] Add support for dynamic modules],
215 use_modules="$withval")
216 test -z "$use_modules" && use_modules=yes
217 DLPREOPEN=
218 if test "$use_modules" != no; then
219 if test "$use_modules" = yes; then
220 DLPREOPEN="-dlpreopen force"
221 else
222 DLPREOPEN="-export-dynamic"
223 for module in $use_modules; do
224 DLPREOPEN="$DLPREOPEN -dlopen $module"
225 done
226 fi
227 fi
228
229 dnl files which are destined for separate modules.
230
231 if test "$use_modules" != no; then
232 AC_LIBOBJ([dynl])
233 fi
234
235 if test "$enable_posix" = yes; then
236 AC_LIBOBJ([filesys])
237 AC_LIBOBJ([posix])
238 AC_DEFINE([HAVE_POSIX], 1,
239 [Define this if you want support for POSIX system calls in Guile.])
240 fi
241
242 if test "$enable_networking" = yes; then
243 AC_LIBOBJ([net_db])
244 AC_LIBOBJ([socket])
245 AC_DEFINE([HAVE_NETWORKING], 1,
246 [Define this if you want support for networking in Guile.])
247 fi
248
249 if test "$enable_debug_malloc" = yes; then
250 AC_LIBOBJ([debug-malloc])
251 fi
252
253 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
254
255 AC_C_CONST
256
257 # "volatile" is used in a couple of tests below.
258 AC_C_VOLATILE
259
260 AC_C_INLINE
261 if test "$ac_cv_c_inline" != no; then
262 SCM_I_GSC_C_INLINE="\"${ac_cv_c_inline}\""
263 else
264 SCM_I_GSC_C_INLINE=NULL
265 fi
266 AC_CHECK_LIB(uca, __uc_get_ar_bsp)
267
268 AC_C_BIGENDIAN
269
270 AC_C_LABELS_AS_VALUES
271
272 AC_CHECK_SIZEOF(char)
273 AC_CHECK_SIZEOF(unsigned char)
274 AC_CHECK_SIZEOF(short)
275 AC_CHECK_SIZEOF(unsigned short)
276 AC_CHECK_SIZEOF(int)
277 AC_CHECK_SIZEOF(unsigned int)
278 AC_CHECK_SIZEOF(long)
279 AC_CHECK_SIZEOF(unsigned long)
280 AC_CHECK_SIZEOF(size_t)
281 AC_CHECK_SIZEOF(long long)
282 AC_CHECK_SIZEOF(unsigned long long)
283 AC_CHECK_SIZEOF(__int64)
284 AC_CHECK_SIZEOF(unsigned __int64)
285 AC_CHECK_SIZEOF(void *)
286 AC_CHECK_SIZEOF(intptr_t)
287 AC_CHECK_SIZEOF(uintptr_t)
288 AC_CHECK_SIZEOF(ptrdiff_t)
289 AC_CHECK_SIZEOF(size_t)
290 AC_CHECK_SIZEOF(off_t)
291
292 if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
293 AC_MSG_ERROR(sizes of long and void* are not identical)
294 fi
295
296 if test "$ac_cv_sizeof_ptrdiff_t" -ne 0; then
297 SCM_I_GSC_T_PTRDIFF='"ptrdiff_t"'
298 else
299 SCM_I_GSC_T_PTRDIFF='"long"'
300 fi
301 AC_SUBST([SCM_I_GSC_T_PTRDIFF])
302
303 AC_CHECK_HEADERS([stdint.h])
304 AC_CHECK_HEADERS([inttypes.h])
305
306 AC_CHECK_SIZEOF(intmax_t)
307
308 SCM_I_GSC_NEEDS_STDINT_H=0
309 SCM_I_GSC_NEEDS_INTTYPES_H=0
310
311 ### intptr and uintptr (try not to use inttypes if we don't have to)
312 if test "$ac_cv_header_inttypes_h" = yes; then
313 if test "$ac_cv_sizeof_intptr_t" -eq 0; then
314 AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
315 #include <stdio.h>])
316 if test "$ac_cv_sizeof_intptr_t" -ne 0; then
317 SCM_I_GSC_NEEDS_INTTYPES_H=1
318 fi
319 fi
320 if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
321 AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
322 #include <stdio.h>])
323 if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
324 SCM_I_GSC_NEEDS_INTTYPES_H=1
325 fi
326 fi
327 fi
328
329 ### See what's provided by stdint.h
330 if test "$ac_cv_header_stdint_h" = yes; then
331 AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
332 AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
333 AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
334 AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
335 AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
336 AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
337 AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
338 AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
339 AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
340 AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
341 AC_CHECK_TYPE([intptr_t],[scm_stdint_has_intptr=1],,[#include <stdint.h>])
342 AC_CHECK_TYPE([uintptr_t],[scm_stdint_has_uintptr=1],,[#include <stdint.h>])
343 fi
344
345 # so we don't get confused by the cache (wish there was a better way
346 # to check particular headers for the same type...)
347
348 unset ac_cv_type_int8_t
349 unset ac_cv_type_uint8_t
350 unset ac_cv_type_int16_t
351 unset ac_cv_type_uint16_t
352 unset ac_cv_type_int32_t
353 unset ac_cv_type_uint32_t
354 unset ac_cv_type_int64_t
355 unset ac_cv_type_uint64_t
356 unset ac_cv_type_intmax_t
357 unset ac_cv_type_uintmax_t
358
359 ### See what's provided by inttypes.h
360 if test "$ac_cv_header_inttypes_h" = yes; then
361 AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
362 AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
363 AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
364 AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include <inttypes.h>])
365 AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
366 AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include <inttypes.h>])
367 AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
368 AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include <inttypes.h>])
369 AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include <inttypes.h>])
370 AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include <inttypes.h>])
371 AC_CHECK_TYPE([intptr_t],[scm_inttypes_has_intptr=1],,[#include <inttypes.h>])
372 AC_CHECK_TYPE([uintptr_t],[scm_inttypes_has_uintptr=1],,[#include <inttypes.h>])
373 fi
374
375 # Try hard to find definitions for some required scm_t_*int* types.
376
377 ### Required type scm_t_int8
378 if test "$scm_stdint_has_int8"; then
379 SCM_I_GSC_T_INT8='"int8_t"'
380 SCM_I_GSC_NEEDS_STDINT_H=1
381 elif test "$scm_inttypes_has_int8"; then
382 SCM_I_GSC_T_INT8='"int8_t"'
383 SCM_I_GSC_NEEDS_INTTYPES_H=1
384 elif test "$ac_cv_sizeof_char" -eq 1; then
385 SCM_I_GSC_T_INT8='"signed char"'
386 else
387 AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
388 fi
389 AC_SUBST([SCM_I_GSC_T_INT8])
390
391 ### Required type scm_t_uint8
392 if test "$scm_stdint_has_uint8"; then
393 SCM_I_GSC_T_UINT8='"uint8_t"'
394 SCM_I_GSC_NEEDS_STDINT_H=1
395 elif test "$scm_inttypes_has_uint8"; then
396 SCM_I_GSC_T_UINT8='"uint8_t"'
397 SCM_I_GSC_NEEDS_INTTYPES_H=1
398 elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
399 SCM_I_GSC_T_UINT8='"unsigned char"'
400 else
401 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
402 fi
403 AC_SUBST([SCM_I_GSC_T_UINT8])
404
405 ### Required type scm_t_int16 (ANSI C says int or short might work)
406 if test "$scm_stdint_has_int16"; then
407 SCM_I_GSC_T_INT16='"int16_t"'
408 SCM_I_GSC_NEEDS_STDINT_H=1
409 elif test "$scm_inttypes_has_int16"; then
410 SCM_I_GSC_T_INT16='"int16_t"'
411 SCM_I_GSC_NEEDS_INTTYPES_H=1
412 elif test "$ac_cv_sizeof_int" -eq 2; then
413 SCM_I_GSC_T_INT16='"int"'
414 elif test "$ac_cv_sizeof_short" -eq 2; then
415 SCM_I_GSC_T_INT16='"short"'
416 else
417 AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
418 fi
419 AC_SUBST([SCM_I_GSC_T_INT16])
420
421 ### Required type scm_t_uint16 (ANSI C says int or short might work)
422 if test "$scm_stdint_has_uint16"; then
423 SCM_I_GSC_T_UINT16='"uint16_t"'
424 SCM_I_GSC_NEEDS_STDINT_H=1
425 elif test "$scm_inttypes_has_uint16"; then
426 SCM_I_GSC_T_UINT16='"uint16_t"'
427 SCM_I_GSC_NEEDS_INTTYPES_H=1
428 elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
429 SCM_I_GSC_T_UINT16='"unsigned int"'
430 elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
431 SCM_I_GSC_T_UINT16='"unsigned short"'
432 else
433 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
434 fi
435 AC_SUBST([SCM_I_GSC_T_UINT16])
436
437
438 ### Required type scm_t_int32 (ANSI C says int, short, or long might work)
439 if test "$scm_stdint_has_int32"; then
440 SCM_I_GSC_T_INT32='"int32_t"'
441 SCM_I_GSC_NEEDS_STDINT_H=1
442 elif test "$scm_inttypes_has_int32"; then
443 SCM_I_GSC_T_INT32='"int32_t"'
444 SCM_I_GSC_NEEDS_INTTYPES_H=1
445 elif test "$ac_cv_sizeof_int" -eq 4; then
446 SCM_I_GSC_T_INT32='"int"'
447 elif test "$ac_cv_sizeof_long" -eq 4; then
448 SCM_I_GSC_T_INT32='"long"'
449 elif test "$ac_cv_sizeof_short" -eq 4; then
450 SCM_I_GSC_T_INT32='"short"'
451 else
452 AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
453 fi
454 AC_SUBST([SCM_I_GSC_T_INT32])
455
456 ### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
457 if test "$scm_stdint_has_uint32"; then
458 SCM_I_GSC_T_UINT32='"uint32_t"'
459 SCM_I_GSC_NEEDS_STDINT_H=1
460 elif test "$scm_inttypes_has_uint32"; then
461 SCM_I_GSC_T_UINT32='"uint32_t"'
462 SCM_I_GSC_NEEDS_INTTYPES_H=1
463 elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
464 SCM_I_GSC_T_UINT32='"unsigned int"'
465 elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
466 SCM_I_GSC_T_UINT32='"unsigned long"'
467 elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
468 SCM_I_GSC_T_UINT32='"unsigned short"'
469 else
470 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
471 fi
472 AC_SUBST([SCM_I_GSC_T_UINT32])
473
474 ### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
475 ### Also try 'long long' and '__int64' if we have it.
476 SCM_I_GSC_T_INT64=0
477 if test "$scm_stdint_has_int64"; then
478 SCM_I_GSC_T_INT64='"int64_t"'
479 SCM_I_GSC_NEEDS_STDINT_H=1
480 elif test "$scm_inttypes_has_int64"; then
481 SCM_I_GSC_T_INT64='"int64_t"'
482 SCM_I_GSC_NEEDS_INTTYPES_H=1
483 elif test "$ac_cv_sizeof_int" -eq 8; then
484 SCM_I_GSC_T_INT64='"int"'
485 elif test "$ac_cv_sizeof_long" -eq 8; then
486 SCM_I_GSC_T_INT64='"long"'
487 elif test "$ac_cv_sizeof_short" -eq 8; then
488 SCM_I_GSC_T_INT64='"short"'
489 elif test "$ac_cv_sizeof_long_long" -eq 8; then
490 SCM_I_GSC_T_INT64='"long long"'
491 elif test "$ac_cv_sizeof___int64" -eq 8; then
492 SCM_I_GSC_T_INT64='"__int64"'
493 else
494 AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
495 fi
496 AC_SUBST([SCM_I_GSC_T_INT64])
497
498
499 ### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
500 ### Also try 'long long' and '__int64' if we have it.
501 SCM_I_GSC_T_UINT64=0
502 if test "$scm_stdint_has_uint64"; then
503 SCM_I_GSC_T_UINT64='"uint64_t"'
504 SCM_I_GSC_NEEDS_STDINT_H=1
505 elif test "$scm_inttypes_has_uint64"; then
506 SCM_I_GSC_T_UINT64='"uint64_t"'
507 SCM_I_GSC_NEEDS_INTTYPES_H=1
508 elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
509 SCM_I_GSC_T_UINT64='"unsigned int"'
510 elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
511 SCM_I_GSC_T_UINT64='"unsigned long"'
512 elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
513 SCM_I_GSC_T_UINT64='"unsigned short"'
514 elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
515 SCM_I_GSC_T_UINT64='"unsigned long long"'
516 elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
517 SCM_I_GSC_T_UINT64='"unsigned __int64"'
518 else
519 AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
520 fi
521 AC_SUBST([SCM_I_GSC_T_UINT64])
522
523 ### Required type scm_t_intmax
524 ###
525 ### We try 'intmax_t', '__int64', 'long long' in this order. When
526 ### none of them is available, we use 'long'.
527 ###
528 SCM_I_GSC_T_INTMAX=0
529 if test "$scm_stdint_has_intmax"; then
530 SCM_I_GSC_T_INTMAX='"intmax_t"'
531 SCM_I_GSC_NEEDS_STDINT_H=1
532 elif test "$scm_inttypes_has_intmax"; then
533 SCM_I_GSC_T_INTMAX='"intmax_t"'
534 SCM_I_GSC_NEEDS_INTTYPES_H=1
535 elif test "$ac_cv_sizeof___int64" -ne 0; then
536 SCM_I_GSC_T_INTMAX='"__int64"'
537 elif test "$ac_cv_sizeof_long_long" -ne 0; then
538 SCM_I_GSC_T_INTMAX='"long long"'
539 else
540 SCM_I_GSC_T_INTMAX='"long"'
541 fi
542 AC_SUBST([SCM_I_GSC_T_INTMAX])
543
544 ### Required type scm_t_uintmax
545 ###
546 ### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
547 ### this order. When none of them is available, we use 'unsigned long'.
548 ###
549 SCM_I_GSC_T_UINTMAX=0
550 if test "$scm_stdint_has_uintmax"; then
551 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
552 SCM_I_GSC_NEEDS_STDINT_H=1
553 elif test "$scm_inttypes_has_uintmax"; then
554 SCM_I_GSC_T_UINTMAX='"uintmax_t"'
555 SCM_I_GSC_NEEDS_INTTYPES_H=1
556 elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
557 SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
558 elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
559 SCM_I_GSC_T_UINTMAX='"unsigned long long"'
560 else
561 SCM_I_GSC_T_UINTMAX='"unsigned long"'
562 fi
563 AC_SUBST([SCM_I_GSC_T_UINTMAX])
564
565 ### Required type scm_t_intptr
566 ###
567 SCM_I_GSC_T_INTPTR=0
568 if test "$scm_stdint_has_intptr"; then
569 SCM_I_GSC_T_INTPTR='"intptr_t"'
570 SCM_I_GSC_NEEDS_STDINT_H=1
571 elif test "$scm_inttypes_has_intptr"; then
572 SCM_I_GSC_T_INTPTR='"intptr_t"'
573 SCM_I_GSC_NEEDS_INTTYPES_H=1
574 elif test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p"; then
575 SCM_I_GSC_T_INTPTR='"int"'
576 elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_void_p"; then
577 SCM_I_GSC_T_INTPTR='"long"'
578 elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_void_p"; then
579 SCM_I_GSC_T_INTPTR='"long long"'
580 else
581 AC_MSG_ERROR([Can't find appropriate type for `scm_t_intptr'.])
582 fi
583 AC_SUBST([SCM_I_GSC_T_INTPTR])
584
585 ### Required type scm_t_uintptr
586 ###
587 SCM_I_GSC_T_UINTPTR=0
588 if test "$scm_stdint_has_uintptr"; then
589 SCM_I_GSC_T_UINTPTR='"uintptr_t"'
590 SCM_I_GSC_NEEDS_STDINT_H=1
591 elif test "$scm_inttypes_has_uintptr"; then
592 SCM_I_GSC_T_UINTPTR='"uintptr_t"'
593 SCM_I_GSC_NEEDS_INTTYPES_H=1
594 elif test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p"; then
595 SCM_I_GSC_T_UINTPTR='"unsigned int"'
596 elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_void_p"; then
597 SCM_I_GSC_T_UINTPTR='"unsigned long"'
598 elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_void_p"; then
599 SCM_I_GSC_T_UINTPTR='"unsigned long long"'
600 else
601 AC_MSG_ERROR([Can't find appropriate type for `scm_t_uintptr'.])
602 fi
603 AC_SUBST([SCM_I_GSC_T_UINTPTR])
604
605
606 AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
607 AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
608
609 AC_HEADER_STDC
610 AC_HEADER_TIME
611 AC_HEADER_SYS_WAIT
612 AC_HEADER_DIRENT
613
614 # Reason for checking:
615 #
616 # HP-UX 11.11 (at least) doesn't provide `struct dirent64', even
617 # with `_LARGEFILE64_SOURCE', so check whether it's available.
618 #
619 AC_CHECK_MEMBER([struct dirent64.d_name],
620 [SCM_I_GSC_HAVE_STRUCT_DIRENT64=1], [SCM_I_GSC_HAVE_STRUCT_DIRENT64=0],
621 [ #ifndef _LARGEFILE64_SOURCE
622 # define _LARGEFILE64_SOURCE
623 #endif
624
625 /* Per Autoconf manual. */
626 #include <sys/types.h>
627 #ifdef HAVE_DIRENT_H
628 # include <dirent.h>
629 #else
630 # define dirent direct
631 # ifdef HAVE_SYS_NDIR_H
632 # include <sys/ndir.h>
633 # endif
634 # ifdef HAVE_SYS_DIR_H
635 # include <sys/dir.h>
636 # endif
637 # ifdef HAVE_NDIR_H
638 # include <ndir.h>
639 # endif
640 #endif ])
641 AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
642
643 # Reasons for testing:
644 # complex.h - new in C99
645 # fenv.h - available in C99, but not older systems
646 # machine/fpu.h - on Tru64 5.1b, the declaration of fesetround(3) is in
647 # this file instead of <fenv.h>
648 # process.h - mingw specific
649 # langinfo.h, nl_types.h - SuS v2
650 #
651 AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
652 regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
653 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
654 sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
655 direct.h langinfo.h nl_types.h machine/fpu.h])
656
657 # Reasons for testing:
658 # nl_item - lacking on Cygwin
659 AC_CHECK_TYPES([nl_item], [], [],
660 [[#ifdef HAVE_LANGINFO_H
661 # include <langinfo.h>
662 #endif
663 #ifdef HAVE_NL_TYPES_H
664 # include <nl_types.h>
665 #endif]])
666
667 # "complex double" is new in C99, and "complex" is only a keyword if
668 # <complex.h> is included
669 AC_CHECK_TYPES(complex double,,,
670 [#if HAVE_COMPLEX_H
671 #include <complex.h>
672 #endif])
673
674 # On MacOS X <sys/socklen.h> contains socklen_t, so must include that
675 # when testing.
676 AC_CHECK_TYPE(socklen_t, ,
677 [AC_DEFINE_UNQUOTED([socklen_t], int,
678 [Define to `int' if <sys/socket.h> does not define.])],
679 [#if HAVE_SYS_TYPES_H
680 #include <sys/types.h>
681 #endif
682 #include <sys/socket.h>
683 ])
684 AC_CHECK_TYPE(struct ip_mreq)
685
686 GUILE_HEADER_LIBC_WITH_UNISTD
687
688 AC_TYPE_GETGROUPS
689 AC_TYPE_SIGNAL
690 AC_TYPE_MODE_T
691
692 # On mingw -lm is empty, so this test is unnecessary, but it's
693 # harmless so we don't hard-code to suppress it.
694 #
695 AC_CHECK_LIB(m, cos)
696
697 AC_CHECK_FUNCS(gethostbyname)
698 if test $ac_cv_func_gethostbyname = no; then
699 AC_CHECK_LIB(nsl, gethostbyname)
700 fi
701
702 AC_CHECK_FUNCS(connect)
703 if test $ac_cv_func_connect = no; then
704 AC_CHECK_LIB(socket, connect)
705 fi
706
707 dnl
708 dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
709 dnl
710 EXTRA_DEFS=""
711 case $host in
712 *-*-mingw*)
713 AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
714 [Define if you have the <winsock2.h> header file.])])
715 AC_CHECK_LIB(ws2_32, main)
716 AC_LIBOBJ([win32-uname])
717 AC_LIBOBJ([win32-dirent])
718 if test "$enable_networking" = yes ; then
719 AC_LIBOBJ([win32-socket])
720 fi
721 if test "$enable_shared" = yes ; then
722 EXTRA_DEFS="-DSCM_IMPORT"
723 AC_DEFINE([USE_DLL_IMPORT], 1,
724 [Define if you need additional CPP macros on Win32 platforms.])
725 fi
726 ;;
727 esac
728 AC_SUBST(EXTRA_DEFS)
729
730 # Reasons for testing:
731 # crt_externs.h - Darwin specific
732 #
733 AC_CHECK_HEADERS([assert.h crt_externs.h])
734
735 # Reasons for testing:
736 # DINFINITY - OSF specific
737 # DQNAN - OSF specific
738 # (DINFINITY and DQNAN are actually global variables, not functions)
739 # chsize - an MS-DOS-ism, found in mingw
740 # cexp, clog - not in various pre-c99 systems, and note that it's possible
741 # for gcc to provide the "complex double" type but the system to not
742 # have functions like cexp and clog
743 # clog10 - not in mingw (though others like clog and csqrt are)
744 # fesetround - available in C99, but not older systems
745 # ftruncate - posix, but probably not older systems (current mingw
746 # has it as an inline for chsize)
747 # ioctl - not in mingw.
748 # gmtime_r - recent posix, not on old systems
749 # pipe - not in mingw
750 # _pipe - specific to mingw, taking 3 args
751 # readdir_r - recent posix, not on old systems
752 # readdir64_r - not available on HP-UX 11.11
753 # stat64 - SuS largefile stuff, not on old systems
754 # sysconf - not on old systems
755 # truncate - not in mingw
756 # isblank - available as a GNU extension or in C99
757 # _NSGetEnviron - Darwin specific
758 # strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
759 # nl_langinfo - X/Open, not available on Windows.
760 # utimensat: posix.1-2008
761 #
762 AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid getsid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_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 nl_langinfo utimensat])
763
764 # Reasons for testing:
765 # netdb.h - not in mingw
766 # sys/param.h - not in mingw
767 # pthread.h - only available with pthreads. ACX_PTHREAD doesn't
768 # check this specifically, we need it for the timespec test below.
769 # sethostname - the function itself check because it's not in mingw,
770 # the DECL is checked because Solaris 10 doens't have in any header
771 # hstrerror - on Tru64 5.1b the symbol is available in libc but the
772 # declaration isn't anywhere.
773 # cuserid - on Tru64 5.1b the declaration is documented to be available
774 # only with `_XOPEN_SOURCE' or some such.
775 #
776 AC_CHECK_HEADERS([crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h])
777 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
778 AC_CHECK_DECLS([sethostname, hstrerror, cuserid])
779
780 # crypt() may or may not be available, for instance in some countries there
781 # are restrictions on cryptography.
782 #
783 # crypt() might be in libc (eg. OpenBSD), or it might be in a separate
784 # -lcrypt library (eg. Debian GNU/Linux).
785 #
786 # On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a. We must
787 # be careful to avoid -lcrypt in this case, since libtool will see there's
788 # only a static libcrypt and decide to build only a static libguile.
789 #
790 # AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the
791 # libraries already in that list.
792 #
793 AC_SEARCH_LIBS(crypt, crypt,
794 [AC_DEFINE([HAVE_CRYPT],1,
795 [Define to 1 if you have the `crypt' function.])])
796
797 # When compiling with GCC on some OSs (Solaris, AIX), _Complex_I doesn't
798 # work; in the reported cases so far, 1.0fi works well instead. According
799 # to the C99 spec, the complex.h header must provide a working definition
800 # of _Complex_I, so we always try _Complex_I first. The 1.0fi fallback
801 # is a workaround for the failure of some systems to conform to C99.
802 if test "$ac_cv_type_complex_double" = yes; then
803 AC_MSG_CHECKING([for i])
804 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
805 #if HAVE_COMPLEX_H
806 #include <complex.h>
807 #endif
808 complex double z;
809 ]], [[
810 z = _Complex_I;
811 ]])],
812 [AC_DEFINE([GUILE_I],_Complex_I,[The imaginary unit (positive square root of -1).])
813 AC_MSG_RESULT([_Complex_I])],
814 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
815 #if HAVE_COMPLEX_H
816 #include <complex.h>
817 #endif
818 complex double z;
819 ]],[[
820 z = 1.0fi;
821 ]])],
822 [AC_DEFINE([GUILE_I],1.0fi)
823 AC_MSG_RESULT([1.0fi])],
824 [ac_cv_type_complex_double=no
825 AC_MSG_RESULT([not available])])])
826 fi
827
828 # glibc 2.3.6 (circa 2006) and various prior versions had a bug where
829 # csqrt(-i) returned a negative real part, when it should be positive
830 # for the principal root.
831 #
832 if test "$ac_cv_type_complex_double" = yes; then
833
834 AC_CACHE_CHECK([whether csqrt is usable],
835 guile_cv_use_csqrt,
836 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
837 #include <complex.h>
838 /* "volatile" is meant to prevent gcc from calculating the sqrt as a
839 constant, we want to test libc. */
840 volatile complex double z = - _Complex_I;
841 int
842 main (void)
843 {
844 z = csqrt (z);
845 if (creal (z) > 0.0)
846 return 0; /* good */
847 else
848 return 1; /* bad */
849 }]])],
850 [guile_cv_use_csqrt=yes],
851 [guile_cv_use_csqrt="no, glibc 2.3 bug"],
852 [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
853 case $guile_cv_use_csqrt in
854 yes*)
855 AC_DEFINE([HAVE_USABLE_CSQRT], 1, [Define to 1 if csqrt is bug-free])
856 ;;
857 esac
858 fi
859
860
861 dnl GMP tests
862 AC_LIB_HAVE_LINKFLAGS([gmp],
863 [],
864 [#include <gmp.h>],
865 [mpz_import (0, 0, 0, 0, 0, 0, 0);])
866
867 if test "x$HAVE_LIBGMP" != "xyes"; then
868 AC_MSG_ERROR([GNU MP 4.1 or greater not found, see README])
869 fi
870
871 dnl GNU libunistring is checked for by Gnulib's `libunistring' module.
872 if test "x$LTLIBUNISTRING" != "x"; then
873 LIBS="$LTLIBUNISTRING $LIBS"
874 else
875 AC_MSG_ERROR([GNU libunistring is required, please install it.])
876 fi
877
878 dnl Libffi is needed to compile Guile's foreign function interface, but its
879 dnl interface isn't exposed in Guile's API.
880 PKG_CHECK_MODULES(LIBFFI, libffi)
881 AC_SUBST(LIBFFI_CFLAGS)
882 AC_SUBST(LIBFFI_LIBS)
883
884 dnl figure out approriate ffi type for size_t
885 AC_CHECK_SIZEOF(size_t)
886 AC_CHECK_SIZEOF(ssize_t)
887 ffi_size_type=uint$(($ac_cv_sizeof_size_t*8))
888 ffi_ssize_type=sint$(($ac_cv_sizeof_ssize_t*8))
889 AC_DEFINE_UNQUOTED(ffi_type_size_t, ffi_type_${ffi_size_type},
890 [ffi type for size_t])
891 AC_DEFINE_UNQUOTED(ffi_type_ssize_t, ffi_type_${ffi_ssize_type},
892 [ffi type for ssize_t])
893
894 dnl i18n tests
895 #AC_CHECK_HEADERS([libintl.h])
896 #AC_CHECK_FUNCS(gettext)
897 #if test $ac_cv_func_gettext = no; then
898 # AC_CHECK_LIB(intl, gettext)
899 #fi
900 #AC_CHECK_FUNCS([bindtextdomain textdomain])
901 AM_GNU_GETTEXT([external], [need-ngettext])
902
903 ### Some systems don't declare some functions. On such systems, we
904 ### need to at least provide our own K&R-style declarations.
905
906 ### GUILE_FUNC_DECLARED(function, headerfile)
907
908 ### Check for a declaration of FUNCTION in HEADERFILE; if it is
909 ### not there, #define MISSING_FUNCTION_DECL.
910 AC_DEFUN([GUILE_FUNC_DECLARED], [
911 AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
912 AC_EGREP_HEADER($1, $2,
913 guile_cv_func_$1_declared=yes,
914 guile_cv_func_$1_declared=no))
915 if test [x$guile_cv_func_]$1[_declared] = xno; then
916 AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
917 [Define if the operating system supplies $1 without declaring it.])
918 fi
919 ])
920
921 GUILE_FUNC_DECLARED(sleep, unistd.h)
922 GUILE_FUNC_DECLARED(usleep, unistd.h)
923
924 AC_CHECK_DECLS([strptime],,,
925 [#define _GNU_SOURCE /* ask glibc to give strptime prototype */
926 #include <time.h>])
927
928 ### On some systems usleep has no return value. If it does have one,
929 ### we'd like to return it; otherwise, we'll fake it.
930 AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
931 [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
932 unistd.h,
933 [guile_cv_func_usleep_return_type=void],
934 [guile_cv_func_usleep_return_type=int])])
935 case "$guile_cv_func_usleep_return_type" in
936 "void" )
937 AC_DEFINE([USLEEP_RETURNS_VOID], 1,
938 [Define if the system headers declare usleep to return void.])
939 ;;
940 esac
941
942 AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
943 if test -n "$have_sys_un_h" ; then
944 AC_DEFINE([HAVE_UNIX_DOMAIN_SOCKETS], 1,
945 [Define if the system supports Unix-domain (file-domain) sockets.])
946 fi
947
948 AC_CHECK_FUNCS(getrlimit setrlimit)
949
950 AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)
951
952 AC_CHECK_FUNCS(sethostent gethostent endhostent dnl
953 setnetent getnetent endnetent dnl
954 setprotoent getprotoent endprotoent dnl
955 setservent getservent endservent dnl
956 getnetbyaddr getnetbyname dnl
957 inet_lnaof inet_makeaddr inet_netof hstrerror)
958
959 # struct sockaddr field sin_len is only present on BSD systems.
960 # On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
961 # (eg. FreeBSD 4.9) it doesn't and we must use this configure check
962 AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
963 [#ifdef HAVE_SYS_TYPES_H
964 #include <sys/types.h>
965 #endif
966 #include <netinet/in.h>])
967
968 AC_MSG_CHECKING(for __libc_stack_end)
969 AC_CACHE_VAL(guile_cv_have_libc_stack_end,
970 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
971 extern char *__libc_stack_end;]],
972 [[printf("%p", (char*) __libc_stack_end);]])],
973 [guile_cv_have_libc_stack_end=yes],
974 [guile_cv_have_libc_stack_end=no])])
975 AC_MSG_RESULT($guile_cv_have_libc_stack_end)
976
977 if test $guile_cv_have_libc_stack_end = yes; then
978 AC_DEFINE([HAVE_LIBC_STACK_END], 1,
979 [Define if you have the __libc_stack_end variable.])
980 fi
981
982 dnl Some systems do not declare this. Some systems do declare it, as a
983 dnl macro. With cygwin it may be in a DLL.
984
985 AC_MSG_CHECKING(whether netdb.h declares h_errno)
986 AC_CACHE_VAL(guile_cv_have_h_errno,
987 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
988 [[int a = h_errno;]])],
989 [guile_cv_have_h_errno=yes],
990 [guile_cv_have_h_errno=no])])
991 AC_MSG_RESULT($guile_cv_have_h_errno)
992 if test $guile_cv_have_h_errno = yes; then
993 AC_DEFINE([HAVE_H_ERRNO], 1, [Define if h_errno is declared in netdb.h.])
994 fi
995
996 AC_MSG_CHECKING(whether uint32_t is defined)
997 AC_CACHE_VAL(guile_cv_have_uint32_t,
998 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
999 #if HAVE_STDINT_H
1000 #include <stdint.h>
1001 #endif
1002 #ifndef HAVE_NETDB_H
1003 #include <netdb.h>
1004 #endif]],
1005 [[uint32_t a;]])],
1006 [guile_cv_have_uint32_t=yes],
1007 [guile_cv_have_uint32_t=no])])
1008 AC_MSG_RESULT($guile_cv_have_uint32_t)
1009 if test $guile_cv_have_uint32_t = yes; then
1010 AC_DEFINE([HAVE_UINT32_T], 1,
1011 [Define if uint32_t typedef is defined when netdb.h is include.])
1012 fi
1013
1014 AC_MSG_CHECKING(for working IPv6 support)
1015 AC_CACHE_VAL(guile_cv_have_ipv6,
1016 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1017 #ifdef HAVE_SYS_TYPES_H
1018 #include <sys/types.h>
1019 #endif
1020 #include <netinet/in.h>
1021 #include <sys/socket.h>]],
1022 [[struct sockaddr_in6 a; a.sin6_family = AF_INET6;]])],
1023 [guile_cv_have_ipv6=yes],
1024 [guile_cv_have_ipv6=no])])
1025 AC_MSG_RESULT($guile_cv_have_ipv6)
1026 if test $guile_cv_have_ipv6 = yes; then
1027 AC_DEFINE([HAVE_IPV6], 1, [Define if you want support for IPv6.])
1028 fi
1029
1030 # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
1031 AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
1032 AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
1033 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1034 #ifdef HAVE_SYS_TYPES_H
1035 #include <sys/types.h>
1036 #endif
1037 #include <netinet/in.h>]],
1038 [[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;]])],
1039 [guile_cv_have_sin6_scope_id=yes],
1040 [guile_cv_have_sin6_scope_id=no])])
1041 AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
1042 if test $guile_cv_have_sin6_scope_id = yes; then
1043 AC_DEFINE([HAVE_SIN6_SCOPE_ID], 1,
1044 [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
1045 fi
1046
1047 # struct sockaddr_in6 field sin_len is only present on BSD systems
1048 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
1049 [#ifdef HAVE_SYS_TYPES_H
1050 #include <sys/types.h>
1051 #endif
1052 #include <netinet/in.h>])
1053
1054 AC_MSG_CHECKING(whether localtime caches TZ)
1055 AC_CACHE_VAL(guile_cv_localtime_cache,
1056 [if test x$ac_cv_func_tzset = xyes; then
1057 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
1058 #if STDC_HEADERS
1059 # include <stdlib.h>
1060 #endif
1061 extern char **environ;
1062 unset_TZ ()
1063 {
1064 char **from, **to;
1065 for (to = from = environ; (*to = *from); from++)
1066 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
1067 to++;
1068 }
1069 char TZ_GMT0[] = "TZ=GMT0";
1070 char TZ_PST8[] = "TZ=PST8";
1071 main()
1072 {
1073 time_t now = time ((time_t *) 0);
1074 int hour_GMT0, hour_unset;
1075 if (putenv (TZ_GMT0) != 0)
1076 exit (1);
1077 hour_GMT0 = localtime (&now)->tm_hour;
1078 unset_TZ ();
1079 hour_unset = localtime (&now)->tm_hour;
1080 if (putenv (TZ_PST8) != 0)
1081 exit (1);
1082 if (localtime (&now)->tm_hour == hour_GMT0)
1083 exit (1);
1084 unset_TZ ();
1085 if (localtime (&now)->tm_hour != hour_unset)
1086 exit (1);
1087 exit (0);
1088 }]])],
1089 [guile_cv_localtime_cache=no],
1090 [guile_cv_localtime_cache=yes],
1091 [# If we have tzset, assume the worst when cross-compiling.
1092 guile_cv_localtime_cache=yes])
1093 else
1094 # If we lack tzset, report that localtime does not cache TZ,
1095 # since we can't invalidate the cache if we don't have tzset.
1096 guile_cv_localtime_cache=no
1097 fi])dnl
1098 AC_MSG_RESULT($guile_cv_localtime_cache)
1099 if test $guile_cv_localtime_cache = yes; then
1100 AC_DEFINE([LOCALTIME_CACHE], 1, [Define if localtime caches the TZ setting.])
1101 fi
1102
1103 if test "$enable_regex" = yes; then
1104 if test "$ac_cv_header_regex_h" = yes ||
1105 test "$ac_cv_header_rxposix_h" = yes ||
1106 test "$ac_cv_header_rx_rxposix_h" = yes; then
1107 GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
1108 [AC_CHECK_LIB(rx, main)
1109 GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
1110 [AC_CHECK_LIB(regex, main)
1111 GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
1112 )
1113 dnl The following should not be necessary, but for some reason
1114 dnl autoheader misses it if we don't include it!
1115 if test "$ac_cv_func_regcomp_norx" = yes ||
1116 test "$ac_cv_func_regcomp_regex" = yes ||
1117 test "$ac_cv_func_regcomp_rx" = yes; then
1118 AC_DEFINE([HAVE_REGCOMP], 1,
1119 [This is included as part of a workaround for a autoheader bug.])
1120 fi
1121 fi
1122 fi
1123
1124 AC_REPLACE_FUNCS([strerror memmove mkstemp])
1125
1126 AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
1127
1128 # Reasons for testing:
1129 # asinh, acosh, atanh, trunc - C99 standard, generally not available on
1130 # older systems
1131 # sincos - GLIBC extension
1132 #
1133 AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
1134
1135 # C99 specifies isinf and isnan as macros.
1136 # HP-UX provides only macros, no functions.
1137 # glibc 2.3.2 provides both macros and functions.
1138 # IRIX 6.5 and Solaris 8 only provide functions.
1139 #
1140 # The following tests detect isinf and isnan either as functions or as
1141 # macros from <math.h>. Plain AC_CHECK_FUNCS is insufficient, it doesn't
1142 # use <math.h> so doesn't detect on macro-only systems like HP-UX.
1143 #
1144 AC_MSG_CHECKING([for isinf])
1145 AC_LINK_IFELSE(AC_LANG_SOURCE(
1146 [[#include <math.h>
1147 volatile double x = 0.0;
1148 int main () { return (isinf(x) != 0); }]]),
1149 [AC_MSG_RESULT([yes])
1150 AC_DEFINE([HAVE_ISINF], 1,
1151 [Define to 1 if you have the `isinf' macro or function.])],
1152 [AC_MSG_RESULT([no])])
1153 AC_MSG_CHECKING([for isnan])
1154 AC_LINK_IFELSE(AC_LANG_SOURCE(
1155 [[#include <math.h>
1156 volatile double x = 0.0;
1157 int main () { return (isnan(x) != 0); }]]),
1158 [AC_MSG_RESULT([yes])
1159 AC_DEFINE([HAVE_ISNAN], 1,
1160 [Define to 1 if you have the `isnan' macro or function.])],
1161 [AC_MSG_RESULT([no])])
1162
1163 # Reasons for checking:
1164 #
1165 # st_rdev
1166 # st_blksize
1167 # st_blocks not in mingw
1168 # tm_gmtoff BSD+GNU, not in C99
1169 #
1170 # Note AC_STRUCT_ST_BLOCKS is not used here because we don't want the
1171 # AC_LIBOBJ(fileblocks) replacement which that macro gives.
1172 #
1173 AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks, struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim],,,
1174 [#define _GNU_SOURCE
1175 AC_INCLUDES_DEFAULT
1176 ])
1177
1178 AC_STRUCT_TIMEZONE
1179 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,
1180 [#include <time.h>
1181 #ifdef TIME_WITH_SYS_TIME
1182 # include <sys/time.h>
1183 # include <time.h>
1184 #else
1185 # if HAVE_SYS_TIME_H
1186 # include <sys/time.h>
1187 # else
1188 # include <time.h>
1189 # endif
1190 #endif
1191 ])
1192 GUILE_STRUCT_UTIMBUF
1193
1194
1195 #--------------------------------------------------------------------
1196 #
1197 # Which way does the stack grow?
1198 #
1199 # Following code comes from Autoconf 2.61's internal _AC_LIBOBJ_ALLOCA
1200 # macro (/usr/share/autoconf/autoconf/functions.m4). Gnulib has
1201 # very similar code, so in future we could look at using that.
1202 #
1203 # An important detail is that the code involves find_stack_direction
1204 # calling _itself_ - which means that find_stack_direction (or at
1205 # least the second find_stack_direction() call) cannot be inlined.
1206 # If the code could be inlined, that might cause the test to give
1207 # an incorrect answer.
1208 #--------------------------------------------------------------------
1209
1210 SCM_I_GSC_STACK_GROWS_UP=0
1211 AC_RUN_IFELSE([AC_LANG_SOURCE(
1212 [AC_INCLUDES_DEFAULT
1213 int
1214 find_stack_direction ()
1215 {
1216 static char *addr = 0;
1217 auto char dummy;
1218 if (addr == 0)
1219 {
1220 addr = &dummy;
1221 return find_stack_direction ();
1222 }
1223 else
1224 return (&dummy > addr) ? 1 : -1;
1225 }
1226
1227 int
1228 main ()
1229 {
1230 return find_stack_direction () < 0;
1231 }])],
1232 [SCM_I_GSC_STACK_GROWS_UP=1],
1233 [],
1234 [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
1235
1236 #--------------------------------------------------------------------
1237 #
1238 # Boehm's GC library
1239 #
1240 #--------------------------------------------------------------------
1241 PKG_CHECK_MODULES([BDW_GC], [bdw-gc])
1242
1243 CFLAGS="$BDW_GC_CFLAGS $CFLAGS"
1244 LIBS="$BDW_GC_LIBS $LIBS"
1245
1246 # `GC_do_blocking ()' is available in GC 7.1 but not declared.
1247 AC_CHECK_FUNCS([GC_do_blocking])
1248 AC_CHECK_DECL([GC_do_blocking],
1249 [AC_DEFINE([HAVE_DECL_GC_DO_BLOCKING], [1],
1250 [Define this if the `GC_do_blocking ()' function is declared])],
1251 [],
1252 [#include <gc/gc.h>])
1253
1254 # `GC_fn_type' is not available in GC 7.1 and earlier.
1255 AC_CHECK_TYPE([GC_fn_type],
1256 [AC_DEFINE([HAVE_GC_FN_TYPE], [1],
1257 [Define this if the `GC_fn_type' type is available.])],
1258 [],
1259 [#include <gc/gc.h>])
1260
1261
1262 AC_CHECK_SIZEOF(float)
1263 if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
1264 AC_DEFINE([SCM_SINGLES], 1,
1265 [Define this if floats are the same size as longs.])
1266 fi
1267
1268 AC_MSG_CHECKING(for struct linger)
1269 AC_CACHE_VAL(scm_cv_struct_linger,
1270 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1271 #include <sys/types.h>
1272 #include <sys/socket.h>]],
1273 [[struct linger lgr; lgr.l_linger = 100]])],
1274 [scm_cv_struct_linger="yes"],
1275 [scm_cv_struct_linger="no"]))
1276 AC_MSG_RESULT($scm_cv_struct_linger)
1277 if test $scm_cv_struct_linger = yes; then
1278 AC_DEFINE([HAVE_STRUCT_LINGER], 1,
1279 [Define this if your system defines struct linger, for use with the
1280 getsockopt and setsockopt system calls.])
1281 fi
1282
1283
1284 # On mingw, struct timespec is in <pthread.h>.
1285 #
1286 AC_MSG_CHECKING(for struct timespec)
1287 AC_CACHE_VAL(scm_cv_struct_timespec,
1288 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1289 #include <time.h>
1290 #if HAVE_PTHREAD_H
1291 #include <pthread.h>
1292 #endif]], [[struct timespec t; t.tv_nsec = 100]])],
1293 [scm_cv_struct_timespec="yes"],
1294 [scm_cv_struct_timespec="no"]))
1295 AC_MSG_RESULT($scm_cv_struct_timespec)
1296 if test $scm_cv_struct_timespec = yes; then
1297 AC_DEFINE([HAVE_STRUCT_TIMESPEC], 1,
1298 [Define this if your system defines struct timespec via either <time.h> or <pthread.h>.])
1299 fi
1300
1301 #--------------------------------------------------------------------
1302 #
1303 # Flags for thread support
1304 #
1305 #--------------------------------------------------------------------
1306
1307 SCM_I_GSC_USE_PTHREAD_THREADS=0
1308 SCM_I_GSC_USE_NULL_THREADS=0
1309 AC_SUBST([SCM_I_GSC_USE_PTHREAD_THREADS])
1310 AC_SUBST([SCM_I_GSC_USE_NULL_THREADS])
1311
1312 ### What thread package has the user asked for?
1313 AC_ARG_WITH(threads, [ --with-threads thread interface],
1314 , with_threads=yes)
1315
1316 AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
1317 AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER, 0)
1318
1319 case "$with_threads" in
1320 "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
1321
1322 build_pthread_support="yes"
1323
1324 ACX_PTHREAD([CC="$PTHREAD_CC"
1325 LIBS="$PTHREAD_LIBS $LIBS"
1326 SCM_I_GSC_USE_PTHREAD_THREADS=1
1327 with_threads="pthreads"],
1328 [with_threads="null"
1329 build_pthread_support="no"])
1330
1331 old_CFLAGS="$CFLAGS"
1332 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1333
1334 # Reasons for testing:
1335 # pthread_getattr_np - "np" meaning "non portable" says it
1336 # all; not present on MacOS X or Solaris 10
1337 # pthread_get_stackaddr_np - "np" meaning "non portable" says it
1338 # all; specific to MacOS X
1339 # pthread_sigmask - not available on mingw
1340 #
1341 AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)
1342
1343 # On past versions of Solaris, believe 8 through 10 at least, you
1344 # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
1345 # This is contrary to POSIX:
1346 # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
1347 # Check here if this style is required.
1348 #
1349 # glibc (2.3.6 at least) works both with or without braces, so the
1350 # test checks whether it works without.
1351 #
1352
1353 if test "$GCC" = "yes"; then
1354 # Since GCC only issues a warning for missing braces, so we need
1355 # `-Werror' to catch it.
1356 CFLAGS="-Werror -Wmissing-braces $CFLAGS"
1357 fi
1358
1359 AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
1360 guile_cv_need_braces_on_pthread_once_init,
1361 [AC_COMPILE_IFELSE([#include <pthread.h>
1362 pthread_once_t foo = PTHREAD_ONCE_INIT;],
1363 [guile_cv_need_braces_on_pthread_once_init=no],
1364 [guile_cv_need_braces_on_pthread_once_init=yes])])
1365 if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
1366 SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
1367 fi
1368
1369 # Same problem with `PTHREAD_MUTEX_INITIALIZER', e.g., on IRIX
1370 # 6.5.30m with GCC 3.3.
1371 AC_CACHE_CHECK([whether PTHREAD_MUTEX_INITIALIZER needs braces],
1372 guile_cv_need_braces_on_pthread_mutex_initializer,
1373 [AC_COMPILE_IFELSE([#include <pthread.h>
1374 pthread_mutex_t foo = PTHREAD_MUTEX_INITIALIZER;],
1375 [guile_cv_need_braces_on_pthread_mutex_initializer=no],
1376 [guile_cv_need_braces_on_pthread_mutex_initializer=yes])])
1377 if test "$guile_cv_need_braces_on_pthread_mutex_initializer" = yes; then
1378 SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER=1
1379 fi
1380
1381 CFLAGS="$old_CFLAGS"
1382
1383 # On Solaris, sched_yield lives in -lrt.
1384 AC_SEARCH_LIBS(sched_yield, rt)
1385
1386 ;;
1387 esac
1388
1389 case "$with_threads" in
1390 "pthreads")
1391 ;;
1392 "no" | "null")
1393 SCM_I_GSC_USE_NULL_THREADS=1
1394 SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS=0
1395 with_threads="null-threads"
1396 ;;
1397 * )
1398 AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
1399 ;;
1400 esac
1401
1402 AC_MSG_CHECKING(what kind of threads to support)
1403 AC_MSG_RESULT($with_threads)
1404
1405 AM_CONDITIONAL([BUILD_PTHREAD_SUPPORT],
1406 [test "x$build_pthread_support" = "xyes"])
1407
1408
1409 ## Check whether pthread_attr_getstack works for the main thread
1410
1411 if test "$with_threads" = pthreads; then
1412
1413 AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
1414 old_CFLAGS="$CFLAGS"
1415 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
1416 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1417 #if HAVE_PTHREAD_ATTR_GETSTACK
1418 #include <pthread.h>
1419
1420 int main ()
1421 {
1422 pthread_attr_t attr;
1423 void *start, *end;
1424 size_t size;
1425
1426 pthread_getattr_np (pthread_self (), &attr);
1427 pthread_attr_getstack (&attr, &start, &size);
1428 end = (char *)start + size;
1429
1430 if ((void *)&attr < start || (void *)&attr >= end)
1431 return 1;
1432 else
1433 return 0;
1434 }
1435 #else
1436 int main ()
1437 {
1438 return 1;
1439 }
1440 #endif
1441 ]])],
1442 [works=yes
1443 AC_DEFINE([PTHREAD_ATTR_GETSTACK_WORKS], [1], [Define when pthread_att_get_stack works for the main thread])],
1444 [works=no],
1445 [])
1446 CFLAGS="$old_CFLAGS"
1447 AC_MSG_RESULT($works)
1448
1449 GUILE_THREAD_LOCAL_STORAGE
1450
1451 fi # with_threads=pthreads
1452
1453
1454 ## Cross building
1455 if test "$cross_compiling" = "yes"; then
1456 AC_MSG_CHECKING(cc for build)
1457 ## /usr/bin/cc still uses wrong assembler
1458 ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
1459 CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
1460 else
1461 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
1462 fi
1463
1464 ## AC_MSG_CHECKING("if we are cross compiling")
1465 ## AC_MSG_RESULT($cross_compiling)
1466 if test "$cross_compiling" = "yes"; then
1467 AC_MSG_RESULT($CC_FOR_BUILD)
1468 fi
1469
1470 ## No need as yet to be more elaborate
1471 CCLD_FOR_BUILD="$CC_FOR_BUILD"
1472
1473 AC_SUBST(cross_compiling)
1474 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
1475 AC_SUBST(CCLD_FOR_BUILD)
1476
1477 ## libtool erroneously calls CC_FOR_BUILD HOST_CC;
1478 ## --HOST is the platform that PACKAGE is compiled for.
1479 HOST_CC="$CC_FOR_BUILD"
1480 AC_SUBST(HOST_CC)
1481
1482 if test "$cross_compiling" = "yes"; then
1483 AC_MSG_CHECKING(guile for build)
1484 GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
1485 else
1486 GUILE_FOR_BUILD='$(preinstguile)'
1487 fi
1488
1489 ## AC_MSG_CHECKING("if we are cross compiling")
1490 ## AC_MSG_RESULT($cross_compiling)
1491 if test "$cross_compiling" = "yes"; then
1492 AC_MSG_RESULT($GUILE_FOR_BUILD)
1493 fi
1494 AC_ARG_VAR(GUILE_FOR_BUILD,[guile for build system])
1495 AC_SUBST(GUILE_FOR_BUILD)
1496
1497 ## If we're using GCC, ask for aggressive warnings.
1498 GCC_CFLAGS=""
1499 case "$GCC" in
1500 yes )
1501 ## We had -Wstrict-prototypes in here for a bit, but Guile does too
1502 ## much stuff with generic function pointers for that to really be
1503 ## less than exasperating.
1504 ## -Wpointer-arith was here too, but something changed in gcc/glibc
1505 ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
1506 POTENTIAL_GCC_CFLAGS="-Wall -Wmissing-prototypes \
1507 -Wdeclaration-after-statement -Wundef \
1508 -Wswitch-enum"
1509 # Do this here so we don't screw up any of the tests above that might
1510 # not be "warning free"
1511 if test "${GUILE_ERROR_ON_WARNING}" = yes
1512 then
1513 POTENTIAL_GCC_CFLAGS="${POTENTIAL_GCC_CFLAGS} -Werror"
1514 enable_compile_warnings=no
1515 fi
1516
1517 for flag in $POTENTIAL_GCC_CFLAGS
1518 do
1519 gl_WARN_ADD([$flag], [GCC_CFLAGS])
1520 done
1521 ;;
1522 esac
1523
1524 AC_SUBST(GCC_CFLAGS)
1525
1526 # Check for GNU ld's "-z relro".
1527 GUILE_GNU_LD_RELRO
1528
1529
1530 ## If we're creating a shared library (using libtool!), then we'll
1531 ## need to generate a list of .lo files corresponding to the .o files
1532 ## given in LIBOBJS. We'll call it LIBLOBJS.
1533 LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"
1534
1535 ## We also need to create corresponding .doc and .x files
1536 EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
1537 EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"
1538
1539 # GNU Readline bindings.
1540 GUILE_READLINE
1541
1542 AC_SUBST(GUILE_MAJOR_VERSION)
1543 AC_SUBST(GUILE_MINOR_VERSION)
1544 AC_SUBST(GUILE_MICRO_VERSION)
1545 AC_SUBST(GUILE_EFFECTIVE_VERSION)
1546 AC_SUBST(GUILE_VERSION)
1547
1548 #######################################################################
1549 # library versioning
1550
1551 AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
1552 AC_SUBST(LIBGUILE_INTERFACE_REVISION)
1553 AC_SUBST(LIBGUILE_INTERFACE_AGE)
1554 AC_SUBST(LIBGUILE_INTERFACE)
1555
1556 AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
1557 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
1558 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
1559 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
1560 AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
1561
1562 AC_SUBST(LIBGUILE_SRFI_SRFI_4_MAJOR)
1563 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
1564 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
1565 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
1566 AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)
1567
1568 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_MAJOR)
1569 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
1570 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
1571 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
1572 AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)
1573
1574 AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
1575 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
1576 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
1577 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
1578 AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)
1579
1580 AC_SUBST(LIBGUILE_I18N_MAJOR)
1581 AC_SUBST(LIBGUILE_I18N_INTERFACE_CURRENT)
1582 AC_SUBST(LIBGUILE_I18N_INTERFACE_REVISION)
1583 AC_SUBST(LIBGUILE_I18N_INTERFACE_AGE)
1584 AC_SUBST(LIBGUILE_I18N_INTERFACE)
1585
1586
1587 #######################################################################
1588
1589 dnl Tell guile-config what flags guile users should compile and link with.
1590 GUILE_LIBS="$LDFLAGS $LIBS"
1591 GUILE_CFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
1592 AC_SUBST(GUILE_LIBS)
1593 AC_SUBST(GUILE_CFLAGS)
1594
1595 AC_SUBST(AWK)
1596 AC_SUBST(LIBLOBJS)
1597 AC_SUBST(EXTRA_DOT_DOC_FILES)
1598 AC_SUBST(EXTRA_DOT_X_FILES)
1599
1600 dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
1601 top_builddir_absolute=`pwd`
1602 AC_SUBST(top_builddir_absolute)
1603 top_srcdir_absolute=`(cd $srcdir && pwd)`
1604 AC_SUBST(top_srcdir_absolute)
1605
1606 dnl We need `sitedir' in `guile-1.8.pc'.
1607 dnl Note: `sitedir' must be kept in sync with `GUILE_SITE_DIR' in `guile.m4'.
1608 pkgdatadir="$datadir/$PACKAGE_TARNAME"
1609 sitedir="$pkgdatadir/site"
1610 AC_SUBST([sitedir])
1611
1612 # Additional SCM_I_GSC definitions are above.
1613 AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
1614 AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
1615 AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
1616 AC_SUBST([SCM_I_GSC_STACK_GROWS_UP])
1617 AC_SUBST([SCM_I_GSC_C_INLINE])
1618 AC_CONFIG_FILES([libguile/gen-scmconfig.h])
1619
1620 AC_CONFIG_FILES([
1621 Makefile
1622 am/Makefile
1623 lib/Makefile
1624 benchmark-suite/Makefile
1625 doc/Makefile
1626 doc/r5rs/Makefile
1627 doc/ref/Makefile
1628 emacs/Makefile
1629 examples/Makefile
1630 libguile/Makefile
1631 srfi/Makefile
1632 guile-readline/Makefile
1633 test-suite/Makefile
1634 test-suite/standalone/Makefile
1635 test-suite/vm/Makefile
1636 meta/Makefile
1637 module/Makefile
1638 ])
1639
1640 AC_CONFIG_FILES([meta/guile-2.0.pc])
1641 AC_CONFIG_FILES([meta/guile-2.0-uninstalled.pc])
1642 AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
1643 AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
1644 AC_CONFIG_FILES([meta/guile], [chmod +x meta/guile])
1645 AC_CONFIG_FILES([meta/uninstalled-env], [chmod +x meta/uninstalled-env])
1646 AC_CONFIG_FILES([meta/gdb-uninstalled-guile], [chmod +x meta/gdb-uninstalled-guile])
1647 AC_CONFIG_FILES([meta/guile-tools], [chmod +x meta/guile-tools])
1648 AC_CONFIG_FILES([libguile/guile-snarf],
1649 [chmod +x libguile/guile-snarf])
1650 AC_CONFIG_FILES([libguile/guile-doc-snarf],
1651 [chmod +x libguile/guile-doc-snarf])
1652 AC_CONFIG_FILES([libguile/guile-func-name-check],
1653 [chmod +x libguile/guile-func-name-check])
1654 AC_CONFIG_FILES([libguile/guile-snarf-docs],
1655 [chmod +x libguile/guile-snarf-docs])
1656 AC_CONFIG_FILES([test-suite/standalone/test-use-srfi],
1657 [chmod +x test-suite/standalone/test-use-srfi])
1658 AC_CONFIG_FILES([test-suite/standalone/test-fast-slot-ref],
1659 [chmod +x test-suite/standalone/test-fast-slot-ref])
1660 AC_CONFIG_FILES([doc/ref/effective-version.texi])
1661
1662 AC_OUTPUT
1663
1664 dnl Local Variables:
1665 dnl comment-start: "dnl "
1666 dnl comment-end: ""
1667 dnl comment-start-skip: "\\bdnl\\b\\s *"
1668 dnl End: