1 dnl aclocal.m4 generated automatically by aclocal 1.1i
4 dnl Usage: AM_INIT_GUILE_MODULE(module-name)
5 dnl This macro will automatically get the guile version from the
6 dnl top-level srcdir, and will initialize automake. It also
7 dnl defines the `module' variable.
8 AC_DEFUN([AM_INIT_GUILE_MODULE],[
9 . $srcdir/../GUILE-VERSION
10 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
15 # Do all the work for Automake. This macro actually does too much --
16 # some checks are only needed if your package does certain things.
17 # But this isn't really a big deal.
22 dnl AM_INIT_AUTOMAKE(package,version)
24 AC_DEFUN(AM_INIT_AUTOMAKE,
25 [AC_REQUIRE([AM_PROG_INSTALL])
28 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
31 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
39 AC_DEFUN(AM_PROG_INSTALL,
40 [AC_REQUIRE([AC_PROG_INSTALL])
41 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
42 AC_SUBST(INSTALL_SCRIPT)dnl
46 # Check to make sure that the build environment is sane.
49 AC_DEFUN(AM_SANITY_CHECK,
50 [AC_MSG_CHECKING([whether build environment is sane])
51 echo timestamp > conftestfile
52 # Do this in a subshell so we don't clobber the current shell's
53 # arguments. FIXME: maybe try `-L' hack like GETLOADAVG test?
54 if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
59 AC_MSG_ERROR([newly created file is older than distributed files!
60 Check your system clock])
66 dnl CY_AC_WITH_THREADS determines which thread library the user intends
67 dnl to put underneath guile. Pass it the path to find the guile top-level
68 dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
71 AC_DEFUN([CY_AC_WITH_THREADS],[
72 AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
73 AC_CACHE_VAL(cy_cv_threads_cflags,[
74 AC_CACHE_VAL(cy_cv_threads_libs,[
76 AC_ARG_WITH(threads,[ --with-threads thread interface],
77 use_threads=$withval, use_threads=no)
78 test -n "$use_threads" || use_threads=qt
79 threads_package=unknown
80 if test "$use_threads" != no; then
82 dnl Test for the qt threads package - used for cooperative threads
83 dnl This may not necessarily be built yet - so just check for the
86 if test "$use_threads" = yes || test "$use_threads" = qt; then
87 # Look for qt in source directory. This is a hack: we look in
88 # "./qt" because this check might be run at the top level.
89 if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then
91 cy_cv_threads_cflags="-I$srcdir/../qt -I../qt"
92 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
95 if test -f $use_threads/qt.c; then
96 # FIXME seems as though we should try to use an installed qt here.
98 cy_cv_threads_cflags="-I$use_threads -I../qt"
99 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
102 if test "$use_threads" = pthreads; then
103 # Look for pthreads in srcdir. See above to understand why
104 # we always set threads_package.
105 if test -f $srcdir/../../pthreads/pthreads/queue.c \
106 || test -f $srcdir/../pthreads/pthreads/queue.c; then
108 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
109 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
112 saved_CPP="$CPPFLAGS"
115 if test "$threads_package" = unknown; then
117 dnl Test for the FSU threads package
119 CPPFLAGS="-I$use_threads/include"
120 LDFLAGS="-L$use_threads/lib"
121 LIBS="-lgthreads -lmalloc"
122 AC_TRY_LINK([#include <pthread.h>],[
123 pthread_equal(NULL,NULL);
124 ], threads_package=FSU)
126 if test "$threads_package" = unknown; then
128 dnl Test for the MIT threads package
131 AC_TRY_LINK([#include <pthread.h>],[
132 pthread_equal(NULL,NULL);
133 ], threads_package=MIT)
135 if test "$threads_package" = unknown; then
137 dnl Test for the PCthreads package
140 AC_TRY_LINK([#include <pthread.h>],[
141 pthread_equal(NULL,NULL);
142 ], threads_package=PCthreads)
145 dnl Set the appropriate flags!
147 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
148 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
149 cy_cv_threads_package=$threads_package
150 CPPFLAGS="$saved_CPP"
153 if test "$threads_package" = unknown; then
154 AC_MSG_ERROR("cannot find thread library installation")
161 dnl Set flags according to what is cached.
163 CPPFLAGS="$cy_cv_threads_cflags"
164 LIBS="$cy_cv_threads_libs"