1 dnl aclocal.m4 generated automatically by aclocal 1.2c
3 dnl Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl On the NeXT, #including <utime.h> doesn't give you a definition for
14 dnl struct utime, unless you #define _POSIX_SOURCE.
16 AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
17 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
18 guile_cv_struct_utimbuf_needs_posix,
21 #include <sys/utime.h>
27 guile_cv_struct_utimbuf_needs_posix=no,
28 guile_cv_struct_utimbuf_needs_posix=yes)])
29 if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
30 AC_DEFINE(UTIMBUF_NEEDS_POSIX)
37 dnl Apparently, at CMU they have a weird version of libc.h that is
38 dnl installed in /usr/local/include and conflicts with unistd.h.
39 dnl In these situations, we should not #include libc.h.
40 dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
41 dnl present on the system, and is safe to #include.
43 AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
45 AC_CHECK_HEADERS(libc.h unistd.h)
47 "whether libc.h and unistd.h can be included together",
48 guile_cv_header_libc_with_unistd,
50 if test "$ac_cv_header_libc_h" = "no"; then
51 guile_cv_header_libc_with_unistd="no"
52 elif test "$ac_cv_header_unistd.h" = "no"; then
53 guile_cv_header_libc_with_unistd="yes"
61 [guile_cv_header_libc_with_unistd=yes],
62 [guile_cv_header_libc_with_unistd=no]
67 if test "$guile_cv_header_libc_with_unistd" = yes; then
68 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
75 dnl This is needed when we want to check for the same function repeatedly
76 dnl with other parameters, such as libraries, varying.
78 dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
79 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
80 AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
81 [AC_MSG_CHECKING([for $1])
82 AC_CACHE_VAL(ac_cv_func_$1_$2,
84 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
85 dnl which includes <sys/select.h> which contains a prototype for
86 dnl select. Similarly for bzero.
87 [/* System header to define __stub macros and hopefully few prototypes,
88 which can conflict with char $1(); below. */
90 /* Override any gcc2 internal prototype to avoid an error. */
91 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
95 [/* We use char because int might match the return type of a gcc2
96 builtin and then its argument prototype would still apply. */
99 /* The GNU C library defines this for functions which it implements
100 to always fail with ENOSYS. Some functions are actually named
101 something starting with __ and the normal name is an alias. */
102 #if defined (__stub_$1) || defined (__stub___$1)
107 ], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
108 if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
110 ifelse([$3], , :, [$3])
120 dnl Check checks whether dlsym (if present) requires a leading underscore.
121 dnl Written by Dan Hagerty <hag@ai.mit.edu> for scsh-0.5.0.
122 AC_DEFUN(GUILE_DLSYM_USCORE, [
123 AC_MSG_CHECKING(for underscore before symbols)
124 AC_CACHE_VAL(guile_cv_uscore,[
125 echo "main(){int i=1;}
126 fnord(){int i=23; int ltuae=42;}" > conftest.c
127 ${CC} conftest.c > /dev/null
128 if (nm a.out | grep _fnord) > /dev/null; then
133 AC_MSG_RESULT($guile_cv_uscore)
134 rm -f conftest.c a.out
136 if test $guile_cv_uscore = yes; then
139 if test $ac_cv_func_dlopen = yes -o $ac_cv_lib_dl_dlopen = yes ; then
140 AC_MSG_CHECKING(whether dlsym always adds an underscore for us)
141 AC_CACHE_VAL(guile_cv_dlsym_adds_uscore,AC_TRY_RUN( [
145 main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
146 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
147 if(ptr1 && !ptr2) exit(0); } exit(1); }
148 ], [guile_cv_dlsym_adds_uscore=yes
149 AC_DEFINE(DLSYM_ADDS_USCORE) ], guile_cv_dlsym_adds_uscore=no,
150 guile_cv_dlsym_adds_uscore=no))
152 AC_MSG_RESULT($guile_cv_dlsym_adds_uscore)
157 # Do all the work for Automake. This macro actually does too much --
158 # some checks are only needed if your package does certain things.
159 # But this isn't really a big deal.
164 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
166 AC_DEFUN(AM_INIT_AUTOMAKE,
167 [AC_REQUIRE([AM_PROG_INSTALL])
172 dnl test to see if srcdir already configured
173 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
174 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
177 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
178 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
181 dnl FIXME This is truly gross.
182 missing_dir=`cd $ac_aux_dir && pwd`
183 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
184 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
185 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
186 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
187 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
193 AC_DEFUN(AM_PROG_INSTALL,
194 [AC_REQUIRE([AC_PROG_INSTALL])
195 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
196 AC_SUBST(INSTALL_SCRIPT)dnl
200 # Check to make sure that the build environment is sane.
203 AC_DEFUN(AM_SANITY_CHECK,
204 [AC_MSG_CHECKING([whether build environment is sane])
207 echo timestamp > conftestfile
208 # Do `set' in a subshell so we don't clobber the current shell's
209 # arguments. Must try -L first in case configure is actually a
210 # symlink; some systems play weird games with the mod time of symlinks
211 # (eg FreeBSD returns the mod time of the symlink's containing
214 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
215 if test "[$]*" = "X"; then
217 set X `ls -t $srcdir/configure conftestfile`
219 test "[$]2" = conftestfile
225 AC_MSG_ERROR([newly created file is older than distributed files!
226 Check your system clock])
231 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
232 dnl The program must properly implement --version.
233 AC_DEFUN(AM_MISSING_PROG,
234 [AC_MSG_CHECKING(for working $2)
235 # Run test in a subshell; some versions of sh will print an error if
236 # an executable is not found, even if stderr is redirected.
237 # Redirect stdin to placate older versions of autoconf. Sigh.
238 if ($2 --version) < /dev/null > /dev/null 2>&1; then
243 AC_MSG_RESULT(missing)
247 # Add --enable-maintainer-mode option to configure.
252 AC_DEFUN(AM_MAINTAINER_MODE,
253 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
254 dnl maintainer-mode is disabled by default
255 AC_ARG_ENABLE(maintainer-mode,
256 [ --enable-maintainer-mode enable make rules and dependencies not useful
257 (and sometimes confusing) to the casual installer],
258 USE_MAINTAINER_MODE=$enableval,
259 USE_MAINTAINER_MODE=no)
260 AC_MSG_RESULT($USE_MAINTAINER_MODE)
261 if test $USE_MAINTAINER_MODE = yes; then
270 # Like AC_CONFIG_HEADER, but automatically create stamp file.
272 AC_DEFUN(AM_CONFIG_HEADER,
274 AC_CONFIG_HEADER([$1])
275 dnl When config.status generates a header, we must update the stamp-h file.
276 dnl This file resides in the same directory as the config header
277 dnl that is generated. We must strip everything past the first ":",
278 dnl and everything past the last "/".
279 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
280 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
281 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
283 for am_file in <<$1>>; do
284 case " <<$>>CONFIG_HEADERS " in
285 *" <<$>>am_file "*<<)>>
286 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
289 am_indx=`expr "<<$>>am_indx" + 1`
294 # serial 17 AM_PROG_LIBTOOL
295 AC_DEFUN(AM_PROG_LIBTOOL,
296 [AC_REQUIRE([AC_CANONICAL_HOST])
297 AC_REQUIRE([AC_PROG_RANLIB])
298 AC_REQUIRE([AC_PROG_CC])
299 AC_REQUIRE([AM_PROG_LD])
300 AC_REQUIRE([AM_PROG_NM])
301 AC_REQUIRE([AC_PROG_LN_S])
303 # Always use our own libtool.
304 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
307 dnl Allow the --disable-shared flag to stop us from building shared libs.
308 AC_ARG_ENABLE(shared,
309 [ --enable-shared build shared libraries [default=yes]],
310 [if test "$enableval" = no; then
311 libtool_enable_shared=no
313 libtool_enable_shared=yes
315 test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
317 test "$enable_shared" = no && libtool_shared=" --disable-shared"
319 dnl Allow the --disable-static flag to stop us from building static libs.
320 AC_ARG_ENABLE(static,
321 [ --enable-static build static libraries [default=yes]],
322 [if test "$enableval" = no; then
323 libtool_enable_static=no
325 libtool_enable_static=yes
327 test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
329 test "$enable_static" = no && libtool_static=" --disable-static"
331 libtool_flags="$libtool_shared$libtool_static"
332 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
333 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
334 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
336 # Some flags need to be propagated to the compiler or linker for good
340 ac_save_CFLAGS="$CFLAGS"
342 for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
345 test -n "$SGI_ABI" && flag_passed=yes
346 if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
347 # Choose the ABI flag according to GCC's specs.
348 if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[ ]-32' >/dev/null; then
357 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
364 CFLAGS="$ac_save_CFLAGS"
368 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
369 CFLAGS="$CFLAGS -belf"
373 # Actually configure libtool. ac_aux_dir is where install-sh is found.
374 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
375 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
376 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
377 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
378 || AC_MSG_ERROR([libtool configure failed])
381 # AM_PROG_LD - find the path to the GNU or non-GNU linker
384 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
385 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
386 AC_REQUIRE([AC_PROG_CC])
388 if test "$ac_cv_prog_gcc" = yes; then
389 # Check if gcc -print-prog-name=ld gives a path.
390 AC_MSG_CHECKING([for ld used by GCC])
391 ac_prog=`($CC -print-prog-name=ld) 2>&5`
393 # Accept absolute paths.
395 test -z "$LD" && LD="$ac_prog"
398 # If it fails, then pretend we aren't using GCC.
402 # If it is relative, then search for the first ld in PATH.
406 elif test "$with_gnu_ld" = yes; then
407 AC_MSG_CHECKING([for GNU ld])
409 AC_MSG_CHECKING([for non-GNU ld])
411 AC_CACHE_VAL(ac_cv_path_LD,
412 [if test -z "$LD"; then
413 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
414 for ac_dir in $PATH; do
415 test -z "$ac_dir" && ac_dir=.
416 if test -f "$ac_dir/$ac_prog"; then
417 ac_cv_path_LD="$ac_dir/$ac_prog"
418 # Check to see if the program is GNU ld. I'd rather use --version,
419 # but apparently some GNU ld's only accept -v.
420 # Break only if it was the GNU/non-GNU ld that we prefer.
421 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
422 test "$with_gnu_ld" != no && break
424 test "$with_gnu_ld" != yes && break
430 ac_cv_path_LD="$LD" # Let the user override the test with a path.
433 if test -n "$LD"; then
438 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
443 AC_DEFUN(AM_PROG_LD_GNU,
444 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
445 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
446 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
447 ac_cv_prog_gnu_ld=yes
453 # AM_PROG_NM - find the path to a BSD-compatible name lister
455 [AC_MSG_CHECKING([for BSD-compatible nm])
456 AC_CACHE_VAL(ac_cv_path_NM,
459 ac_cv_path_NM="$NM" # Let the user override the test with a path.
462 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
463 for ac_dir in /usr/ucb $PATH /bin; do
464 test -z "$ac_dir" && dir=.
465 if test -f $ac_dir/nm; then
466 # Check to see if the nm accepts a BSD-compat flag.
467 if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
468 ac_cv_path_NM="$ac_dir/nm -B"
469 elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
470 ac_cv_path_NM="$ac_dir/nm -p"
472 ac_cv_path_NM="$ac_dir/nm"
478 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
487 dnl CY_AC_WITH_THREADS determines which thread library the user intends
488 dnl to put underneath guile. Pass it the path to find the guile top-level
489 dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
492 AC_DEFUN([CY_AC_WITH_THREADS],[
493 AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
494 AC_CACHE_VAL(cy_cv_threads_cflags,[
495 AC_CACHE_VAL(cy_cv_threads_libs,[
497 AC_ARG_WITH(threads,[ --with-threads thread interface],
498 use_threads=$withval, use_threads=no)
499 test -n "$use_threads" || use_threads=qt
500 threads_package=unknown
501 if test "$use_threads" != no; then
503 dnl Test for the qt threads package - used for cooperative threads
504 dnl This may not necessarily be built yet - so just check for the
507 if test "$use_threads" = yes || test "$use_threads" = qt; then
508 # Look for qt in source directory.
509 if test -f $srcdir/qt/qt.c; then
510 qtsrcdir="`(cd $srcdir; pwd)`/qt"
512 cy_cv_threads_cflags="-I$qtsrcdir -I../qt"
513 cy_cv_threads_libs="../qt/libqthreads.a"
516 if test -f $use_threads/qt.c; then
517 # FIXME seems as though we should try to use an installed qt here.
519 cy_cv_threads_cflags="-I$use_threads -I../qt"
520 cy_cv_threads_libs="../qt/libqthreads.a"
523 if test "$use_threads" = pthreads; then
524 # Look for pthreads in srcdir. See above to understand why
525 # we always set threads_package.
526 if test -f $srcdir/../../pthreads/pthreads/queue.c \
527 || test -f $srcdir/../pthreads/pthreads/queue.c; then
529 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
530 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
533 saved_CPP="$CPPFLAGS"
536 if test "$threads_package" = unknown; then
538 dnl Test for the FSU threads package
540 CPPFLAGS="-I$use_threads/include"
541 LDFLAGS="-L$use_threads/lib"
542 LIBS="-lgthreads -lmalloc"
543 AC_TRY_LINK([#include <pthread.h>],[
544 pthread_equal(NULL,NULL);
545 ], threads_package=FSU)
547 if test "$threads_package" = unknown; then
549 dnl Test for the MIT threads package
552 AC_TRY_LINK([#include <pthread.h>],[
553 pthread_equal(NULL,NULL);
554 ], threads_package=MIT)
556 if test "$threads_package" = unknown; then
558 dnl Test for the PCthreads package
561 AC_TRY_LINK([#include <pthread.h>],[
562 pthread_equal(NULL,NULL);
563 ], threads_package=PCthreads)
566 dnl Set the appropriate flags!
568 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
569 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
570 cy_cv_threads_package=$threads_package
571 CPPFLAGS="$saved_CPP"
574 if test "$threads_package" = unknown; then
575 AC_MSG_ERROR("cannot find thread library installation")
582 dnl Set flags according to what is cached.
584 CPPFLAGS="$cy_cv_threads_cflags"
585 LIBS="$cy_cv_threads_libs"