Rebuilt using automake 1.1n.
[bpt/guile.git] / qt / aclocal.m4
CommitLineData
1dc9c5b0 1dnl aclocal.m4 generated automatically by aclocal 1.1n
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
1dc9c5b0
JB
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, [no-define])
23
24AC_DEFUN(AM_INIT_AUTOMAKE,
25[AC_REQUIRE([AM_PROG_INSTALL])
26PACKAGE=[$1]
733943b9 27AC_SUBST(PACKAGE)
1dc9c5b0 28VERSION=[$2]
733943b9 29AC_SUBST(VERSION)
1dc9c5b0
JB
30ifelse([$3],,
31AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
32AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
733943b9
TT
33AM_SANITY_CHECK
34AC_ARG_PROGRAM
1dc9c5b0
JB
35dnl FIXME This is truly gross.
36missing_dir=`cd $ac_aux_dir && pwd`
37AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
38AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
39AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
40AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
41AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
42AC_PROG_MAKE_SET])
733943b9
TT
43
44
45# serial 1
46
47AC_DEFUN(AM_PROG_INSTALL,
48[AC_REQUIRE([AC_PROG_INSTALL])
49test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
50AC_SUBST(INSTALL_SCRIPT)dnl
51])
52
53#
54# Check to make sure that the build environment is sane.
55#
56
57AC_DEFUN(AM_SANITY_CHECK,
58[AC_MSG_CHECKING([whether build environment is sane])
1dc9c5b0
JB
59# Just in case
60sleep 1
733943b9 61echo timestamp > conftestfile
1dc9c5b0
JB
62# Do `set' in a subshell so we don't clobber the current shell's
63# arguments. Must try -L first in case configure is actually a
64# symlink; some systems play weird games with the mod time of symlinks
65# (eg FreeBSD returns the mod time of the symlink's containing
66# directory).
67if (
68 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
69 if test "$@" = "X"; then
70 # -L didn't work.
71 set X `ls -t $srcdir/configure conftestfile`
72 fi
73 test "[$]2" = conftestfile
74 )
733943b9
TT
75then
76 # Ok.
77 :
78else
79 AC_MSG_ERROR([newly created file is older than distributed files!
80Check your system clock])
81fi
82rm -f conftest*
83AC_MSG_RESULT(yes)])
84
1dc9c5b0
JB
85dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
86dnl The program must properly implement --version.
87AC_DEFUN(AM_MISSING_PROG,
88[AC_MSG_CHECKING(for working $2)
89# Run test in a subshell; some versions of sh will print an error if
90# an executable is not found, even if stderr is redirected.
91if ($2 --version) > /dev/null 2>&1; then
92 $1=$2
93 AC_MSG_RESULT(found)
94else
95 $1="$3/missing $2"
96 AC_MSG_RESULT(missing)
97fi
98AC_SUBST($1)])
99
15ae1bee
MD
100# Add --enable-maintainer-mode option to configure.
101# From Jim Meyering
102
103# serial 1
104
105AC_DEFUN(AM_MAINTAINER_MODE,
106[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
107 dnl maintainer-mode is disabled by default
108 AC_ARG_ENABLE(maintainer-mode,
109[ --enable-maintainer-mode enable make rules and dependencies not useful
110 (and sometimes confusing) to the casual installer],
111 USE_MAINTAINER_MODE=$enableval,
112 USE_MAINTAINER_MODE=no)
113 AC_MSG_RESULT($USE_MAINTAINER_MODE)
114 if test $USE_MAINTAINER_MODE = yes; then
115 MAINT=
116 else
117 MAINT='#M#'
118 fi
119 AC_SUBST(MAINT)dnl
120]
121)
122
733943b9
TT
123dnl
124dnl CY_AC_WITH_THREADS determines which thread library the user intends
125dnl to put underneath guile. Pass it the path to find the guile top-level
126dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
127dnl
128
129AC_DEFUN([CY_AC_WITH_THREADS],[
130AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
131AC_CACHE_VAL(cy_cv_threads_cflags,[
132AC_CACHE_VAL(cy_cv_threads_libs,[
133use_threads=no;
134AC_ARG_WITH(threads,[ --with-threads thread interface],
135 use_threads=$withval, use_threads=no)
136test -n "$use_threads" || use_threads=qt
137threads_package=unknown
138if test "$use_threads" != no; then
139dnl
140dnl Test for the qt threads package - used for cooperative threads
141dnl This may not necessarily be built yet - so just check for the
142dnl header files.
143dnl
144 if test "$use_threads" = yes || test "$use_threads" = qt; then
145 # Look for qt in source directory. This is a hack: we look in
146 # "./qt" because this check might be run at the top level.
147 if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then
148 threads_package=COOP
149 cy_cv_threads_cflags="-I$srcdir/../qt -I../qt"
150 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
151 fi
152 else
153 if test -f $use_threads/qt.c; then
154 # FIXME seems as though we should try to use an installed qt here.
155 threads_package=COOP
156 cy_cv_threads_cflags="-I$use_threads -I../qt"
157 cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a"
158 fi
159 fi
160 if test "$use_threads" = pthreads; then
161 # Look for pthreads in srcdir. See above to understand why
162 # we always set threads_package.
163 if test -f $srcdir/../../pthreads/pthreads/queue.c \
164 || test -f $srcdir/../pthreads/pthreads/queue.c; then
165 threads_package=MIT
166 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
167 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
168 fi
169 fi
170 saved_CPP="$CPPFLAGS"
171 saved_LD="$LDFLAGS"
172 saved_LIBS="$LIBS"
173 if test "$threads_package" = unknown; then
174dnl
175dnl Test for the FSU threads package
176dnl
177 CPPFLAGS="-I$use_threads/include"
178 LDFLAGS="-L$use_threads/lib"
179 LIBS="-lgthreads -lmalloc"
180 AC_TRY_LINK([#include <pthread.h>],[
181pthread_equal(NULL,NULL);
182], threads_package=FSU)
183 fi
184 if test "$threads_package" = unknown; then
185dnl
186dnl Test for the MIT threads package
187dnl
188 LIBS="-lpthread"
189 AC_TRY_LINK([#include <pthread.h>],[
190pthread_equal(NULL,NULL);
191], threads_package=MIT)
192 fi
193 if test "$threads_package" = unknown; then
194dnl
195dnl Test for the PCthreads package
196dnl
197 LIBS="-lpthreads"
198 AC_TRY_LINK([#include <pthread.h>],[
199pthread_equal(NULL,NULL);
200], threads_package=PCthreads)
201 fi
202dnl
203dnl Set the appropriate flags!
204dnl
205 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
206 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
207 cy_cv_threads_package=$threads_package
208 CPPFLAGS="$saved_CPP"
209 LDFLAGS="$saved_LD"
210 LIBS="$saved_LIBS"
211 if test "$threads_package" = unknown; then
212 AC_MSG_ERROR("cannot find thread library installation")
213 fi
214fi
215])
216])
217],
218dnl
219dnl Set flags according to what is cached.
220dnl
221CPPFLAGS="$cy_cv_threads_cflags"
222LIBS="$cy_cv_threads_libs"
223)
224])
225