1 dnl aclocal.m4 generated automatically by aclocal 1.1n
3 dnl On the NeXT, #including <utime.h> doesn't give you a definition for
4 dnl struct utime, unless you #define _POSIX_SOURCE.
6 AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
7 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
8 guile_cv_struct_utimbuf_needs_posix,
11 #include <sys/utime.h>
17 guile_cv_struct_utimbuf_needs_posix=no,
18 guile_cv_struct_utimbuf_needs_posix=yes)])
19 if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
20 AC_DEFINE(UTIMBUF_NEEDS_POSIX)
27 dnl Apparently, at CMU they have a weird version of libc.h that is
28 dnl installed in /usr/local/include and conflicts with unistd.h.
29 dnl In these situations, we should not #include libc.h.
30 dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
31 dnl present on the system, and is safe to #include.
33 AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
35 AC_CHECK_HEADERS(libc.h unistd.h)
37 "whether libc.h and unistd.h can be included together",
38 guile_cv_header_libc_with_unistd,
40 if test "$ac_cv_header_libc_h" = "no"; then
41 guile_cv_header_libc_with_unistd="no"
42 elif test "$ac_cv_header_unistd.h" = "no"; then
43 guile_cv_header_libc_with_unistd="yes"
51 [guile_cv_header_libc_with_unistd=yes],
52 [guile_cv_header_libc_with_unistd=no]
57 if test "$guile_cv_header_libc_with_unistd" = yes; then
58 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
63 # Do all the work for Automake. This macro actually does too much --
64 # some checks are only needed if your package does certain things.
65 # But this isn't really a big deal.
70 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
72 AC_DEFUN(AM_INIT_AUTOMAKE,
73 [AC_REQUIRE([AM_PROG_INSTALL])
79 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
80 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
83 dnl FIXME This is truly gross.
84 missing_dir=`cd $ac_aux_dir && pwd`
85 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
86 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
87 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
88 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
89 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
95 AC_DEFUN(AM_PROG_INSTALL,
96 [AC_REQUIRE([AC_PROG_INSTALL])
97 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
98 AC_SUBST(INSTALL_SCRIPT)dnl
102 # Check to make sure that the build environment is sane.
105 AC_DEFUN(AM_SANITY_CHECK,
106 [AC_MSG_CHECKING([whether build environment is sane])
109 echo timestamp > conftestfile
110 # Do `set' in a subshell so we don't clobber the current shell's
111 # arguments. Must try -L first in case configure is actually a
112 # symlink; some systems play weird games with the mod time of symlinks
113 # (eg FreeBSD returns the mod time of the symlink's containing
116 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
117 if test "$@" = "X"; then
119 set X `ls -t $srcdir/configure conftestfile`
121 test "[$]2" = conftestfile
127 AC_MSG_ERROR([newly created file is older than distributed files!
128 Check your system clock])
133 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
134 dnl The program must properly implement --version.
135 AC_DEFUN(AM_MISSING_PROG,
136 [AC_MSG_CHECKING(for working $2)
137 # Run test in a subshell; some versions of sh will print an error if
138 # an executable is not found, even if stderr is redirected.
139 if ($2 --version) > /dev/null 2>&1; then
144 AC_MSG_RESULT(missing)
148 # Add --enable-maintainer-mode option to configure.
153 AC_DEFUN(AM_MAINTAINER_MODE,
154 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
155 dnl maintainer-mode is disabled by default
156 AC_ARG_ENABLE(maintainer-mode,
157 [ --enable-maintainer-mode enable make rules and dependencies not useful
158 (and sometimes confusing) to the casual installer],
159 USE_MAINTAINER_MODE=$enableval,
160 USE_MAINTAINER_MODE=no)
161 AC_MSG_RESULT($USE_MAINTAINER_MODE)
162 if test $USE_MAINTAINER_MODE = yes; then
171 # Like AC_CONFIG_HEADER, but automatically create stamp file.
173 AC_DEFUN(AM_CONFIG_HEADER,
175 AC_CONFIG_HEADER([$1])
176 dnl When config.status generates a header, we must update the stamp-h file.
177 dnl This file resides in the same directory as the config header
178 dnl that is generated. We must strip everything past the first ":",
179 dnl and everything past the last "/".
180 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
181 test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl
185 # serial 4 AM_PROG_LIBTOOL
186 AC_DEFUN(AM_PROG_LIBTOOL,
187 [AC_REQUIRE([AC_CANONICAL_HOST])
188 AC_REQUIRE([AC_PROG_CC])
189 AC_REQUIRE([AC_PROG_RANLIB])
191 # Always use our own libtool.
192 LIBTOOL='$(top_builddir)/libtool'
195 dnl Allow the --disable-shared flag to stop us from building shared libs.
196 AC_ARG_ENABLE(shared,
197 [ --enable-shared build shared libraries [default=yes]],
198 test "$enableval" = no && libtool_shared=" --disable-shared",
201 libtool_flags="$libtool_shared"
202 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
203 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
207 # For IRIX 6, ld needs -n32 if cc uses it.
208 if echo " $CC $CFLAGS " | egrep -e '[ ]-n32[ ]' > /dev/null; then
214 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
215 CFLAGS="$CFLAGS -belf"
219 # Actually configure libtool. ac_aux_dir is where install-sh is found.
220 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \
221 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
222 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
223 || AC_MSG_ERROR([libtool configure failed])
227 dnl CY_AC_WITH_THREADS determines which thread library the user intends
228 dnl to put underneath guile. Pass it the path to find the guile top-level
229 dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
232 AC_DEFUN([CY_AC_WITH_THREADS],[
233 AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
234 AC_CACHE_VAL(cy_cv_threads_cflags,[
235 AC_CACHE_VAL(cy_cv_threads_libs,[
237 AC_ARG_WITH(threads,[ --with-threads thread interface],
238 use_threads=$withval, use_threads=no)
239 test -n "$use_threads" || use_threads=qt
240 threads_package=unknown
241 if test "$use_threads" != no; then
243 dnl Test for the qt threads package - used for cooperative threads
244 dnl This may not necessarily be built yet - so just check for the
247 if test "$use_threads" = yes || test "$use_threads" = qt; then
248 # Look for qt in source directory. This is a hack: we look in
249 # "./qt" because this check might be run at the top level.
250 if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then
252 cy_cv_threads_cflags="-I$srcdir/../qt -I../qt"
253 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
256 if test -f $use_threads/qt.c; then
257 # FIXME seems as though we should try to use an installed qt here.
259 cy_cv_threads_cflags="-I$use_threads -I../qt"
260 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
263 if test "$use_threads" = pthreads; then
264 # Look for pthreads in srcdir. See above to understand why
265 # we always set threads_package.
266 if test -f $srcdir/../../pthreads/pthreads/queue.c \
267 || test -f $srcdir/../pthreads/pthreads/queue.c; then
269 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
270 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
273 saved_CPP="$CPPFLAGS"
276 if test "$threads_package" = unknown; then
278 dnl Test for the FSU threads package
280 CPPFLAGS="-I$use_threads/include"
281 LDFLAGS="-L$use_threads/lib"
282 LIBS="-lgthreads -lmalloc"
283 AC_TRY_LINK([#include <pthread.h>],[
284 pthread_equal(NULL,NULL);
285 ], threads_package=FSU)
287 if test "$threads_package" = unknown; then
289 dnl Test for the MIT threads package
292 AC_TRY_LINK([#include <pthread.h>],[
293 pthread_equal(NULL,NULL);
294 ], threads_package=MIT)
296 if test "$threads_package" = unknown; then
298 dnl Test for the PCthreads package
301 AC_TRY_LINK([#include <pthread.h>],[
302 pthread_equal(NULL,NULL);
303 ], threads_package=PCthreads)
306 dnl Set the appropriate flags!
308 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
309 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
310 cy_cv_threads_package=$threads_package
311 CPPFLAGS="$saved_CPP"
314 if test "$threads_package" = unknown; then
315 AC_MSG_ERROR("cannot find thread library installation")
322 dnl Set flags according to what is cached.
324 CPPFLAGS="$cy_cv_threads_cflags"
325 LIBS="$cy_cv_threads_libs"