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