updated to automake 1.1l
[bpt/guile.git] / qt / aclocal.m4
CommitLineData
85e02c55 1dnl aclocal.m4 generated automatically by aclocal 1.1l
733943b9
TT
2
3
4dnl Usage: AM_INIT_GUILE_MODULE(module-name)
5dnl This macro will automatically get the guile version from the
6dnl top-level srcdir, and will initialize automake. It also
7dnl defines the `module' variable.
8AC_DEFUN([AM_INIT_GUILE_MODULE],[
9. $srcdir/../GUILE-VERSION
10AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
11AC_CONFIG_AUX_DIR(..)
12module=[$1]
13AC_SUBST(module)])
14
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.
18
19# serial 1
20
21dnl Usage:
22dnl AM_INIT_AUTOMAKE(package,version)
23
24AC_DEFUN(AM_INIT_AUTOMAKE,
25[AC_REQUIRE([AM_PROG_INSTALL])
26PACKAGE=[$1]
27AC_SUBST(PACKAGE)
28AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
29VERSION=[$2]
30AC_SUBST(VERSION)
31AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
32AM_SANITY_CHECK
33AC_ARG_PROGRAM
34AC_PROG_MAKE_SET])
35
36
37# serial 1
38
39AC_DEFUN(AM_PROG_INSTALL,
40[AC_REQUIRE([AC_PROG_INSTALL])
41test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
42AC_SUBST(INSTALL_SCRIPT)dnl
43])
44
45#
46# Check to make sure that the build environment is sane.
47#
48
49AC_DEFUN(AM_SANITY_CHECK,
50[AC_MSG_CHECKING([whether build environment is sane])
51echo 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?
54if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
55then
56 # Ok.
57 :
58else
59 AC_MSG_ERROR([newly created file is older than distributed files!
60Check your system clock])
61fi
62rm -f conftest*
63AC_MSG_RESULT(yes)])
64
65dnl
66dnl CY_AC_WITH_THREADS determines which thread library the user intends
67dnl to put underneath guile. Pass it the path to find the guile top-level
68dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
69dnl
70
71AC_DEFUN([CY_AC_WITH_THREADS],[
72AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
73AC_CACHE_VAL(cy_cv_threads_cflags,[
74AC_CACHE_VAL(cy_cv_threads_libs,[
75use_threads=no;
76AC_ARG_WITH(threads,[ --with-threads thread interface],
77 use_threads=$withval, use_threads=no)
78test -n "$use_threads" || use_threads=qt
79threads_package=unknown
80if test "$use_threads" != no; then
81dnl
82dnl Test for the qt threads package - used for cooperative threads
83dnl This may not necessarily be built yet - so just check for the
84dnl header files.
85dnl
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
90 threads_package=COOP
91 cy_cv_threads_cflags="-I$srcdir/../qt -I../qt"
92 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
93 fi
94 else
95 if test -f $use_threads/qt.c; then
96 # FIXME seems as though we should try to use an installed qt here.
97 threads_package=COOP
98 cy_cv_threads_cflags="-I$use_threads -I../qt"
99 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
100 fi
101 fi
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
107 threads_package=MIT
108 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
109 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
110 fi
111 fi
112 saved_CPP="$CPPFLAGS"
113 saved_LD="$LDFLAGS"
114 saved_LIBS="$LIBS"
115 if test "$threads_package" = unknown; then
116dnl
117dnl Test for the FSU threads package
118dnl
119 CPPFLAGS="-I$use_threads/include"
120 LDFLAGS="-L$use_threads/lib"
121 LIBS="-lgthreads -lmalloc"
122 AC_TRY_LINK([#include <pthread.h>],[
123pthread_equal(NULL,NULL);
124], threads_package=FSU)
125 fi
126 if test "$threads_package" = unknown; then
127dnl
128dnl Test for the MIT threads package
129dnl
130 LIBS="-lpthread"
131 AC_TRY_LINK([#include <pthread.h>],[
132pthread_equal(NULL,NULL);
133], threads_package=MIT)
134 fi
135 if test "$threads_package" = unknown; then
136dnl
137dnl Test for the PCthreads package
138dnl
139 LIBS="-lpthreads"
140 AC_TRY_LINK([#include <pthread.h>],[
141pthread_equal(NULL,NULL);
142], threads_package=PCthreads)
143 fi
144dnl
145dnl Set the appropriate flags!
146dnl
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"
151 LDFLAGS="$saved_LD"
152 LIBS="$saved_LIBS"
153 if test "$threads_package" = unknown; then
154 AC_MSG_ERROR("cannot find thread library installation")
155 fi
156fi
157])
158])
159],
160dnl
161dnl Set flags according to what is cached.
162dnl
163CPPFLAGS="$cy_cv_threads_cflags"
164LIBS="$cy_cv_threads_libs"
165)
166])
167