* simpos.h: prototype for scm_primitive_exit.
[bpt/guile.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.1p
2
3 dnl On the NeXT, #including <utime.h> doesn't give you a definition for
4 dnl struct utime, unless you #define _POSIX_SOURCE.
5
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,
9 [AC_TRY_CPP([
10 #ifdef __EMX__
11 #include <sys/utime.h>
12 #else
13 #include <utime.h>
14 #endif
15 struct utime blah;
16 ],
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)
21 fi])
22
23
24
25
26 dnl
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.
32 dnl
33 AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
34 [
35 AC_CHECK_HEADERS(libc.h unistd.h)
36 AC_CACHE_CHECK(
37 "whether libc.h and unistd.h can be included together",
38 guile_cv_header_libc_with_unistd,
39 [
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"
44 else
45 AC_TRY_COMPILE(
46 [
47 # include <libc.h>
48 # include <unistd.h>
49 ],
50 [],
51 [guile_cv_header_libc_with_unistd=yes],
52 [guile_cv_header_libc_with_unistd=no]
53 )
54 fi
55 ]
56 )
57 if test "$guile_cv_header_libc_with_unistd" = yes; then
58 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
59 fi
60 ]
61 )
62
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.
66
67 # serial 1
68
69 dnl Usage:
70 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
71
72 AC_DEFUN(AM_INIT_AUTOMAKE,
73 [AC_REQUIRE([AM_PROG_INSTALL])
74 PACKAGE=[$1]
75 AC_SUBST(PACKAGE)
76 VERSION=[$2]
77 AC_SUBST(VERSION)
78 dnl test to see if srcdir already configured
79 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
80 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
81 fi
82 ifelse([$3],,
83 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
84 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
85 AM_SANITY_CHECK
86 AC_ARG_PROGRAM
87 dnl FIXME This is truly gross.
88 missing_dir=`cd $ac_aux_dir && pwd`
89 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
90 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
91 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
92 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
93 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
94 AC_PROG_MAKE_SET])
95
96
97 # serial 1
98
99 AC_DEFUN(AM_PROG_INSTALL,
100 [AC_REQUIRE([AC_PROG_INSTALL])
101 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
102 AC_SUBST(INSTALL_SCRIPT)dnl
103 ])
104
105 #
106 # Check to make sure that the build environment is sane.
107 #
108
109 AC_DEFUN(AM_SANITY_CHECK,
110 [AC_MSG_CHECKING([whether build environment is sane])
111 # Just in case
112 sleep 1
113 echo timestamp > conftestfile
114 # Do `set' in a subshell so we don't clobber the current shell's
115 # arguments. Must try -L first in case configure is actually a
116 # symlink; some systems play weird games with the mod time of symlinks
117 # (eg FreeBSD returns the mod time of the symlink's containing
118 # directory).
119 if (
120 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
121 if test "$@" = "X"; then
122 # -L didn't work.
123 set X `ls -t $srcdir/configure conftestfile`
124 fi
125 test "[$]2" = conftestfile
126 )
127 then
128 # Ok.
129 :
130 else
131 AC_MSG_ERROR([newly created file is older than distributed files!
132 Check your system clock])
133 fi
134 rm -f conftest*
135 AC_MSG_RESULT(yes)])
136
137 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
138 dnl The program must properly implement --version.
139 AC_DEFUN(AM_MISSING_PROG,
140 [AC_MSG_CHECKING(for working $2)
141 # Run test in a subshell; some versions of sh will print an error if
142 # an executable is not found, even if stderr is redirected.
143 # Redirect stdin to placate older versions of autoconf. Sigh.
144 if ($2 --version) < /dev/null > /dev/null 2>&1; then
145 $1=$2
146 AC_MSG_RESULT(found)
147 else
148 $1="$3/missing $2"
149 AC_MSG_RESULT(missing)
150 fi
151 AC_SUBST($1)])
152
153 # Add --enable-maintainer-mode option to configure.
154 # From Jim Meyering
155
156 # serial 1
157
158 AC_DEFUN(AM_MAINTAINER_MODE,
159 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
160 dnl maintainer-mode is disabled by default
161 AC_ARG_ENABLE(maintainer-mode,
162 [ --enable-maintainer-mode enable make rules and dependencies not useful
163 (and sometimes confusing) to the casual installer],
164 USE_MAINTAINER_MODE=$enableval,
165 USE_MAINTAINER_MODE=no)
166 AC_MSG_RESULT($USE_MAINTAINER_MODE)
167 if test $USE_MAINTAINER_MODE = yes; then
168 MAINT=
169 else
170 MAINT='#M#'
171 fi
172 AC_SUBST(MAINT)dnl
173 ]
174 )
175
176 # Like AC_CONFIG_HEADER, but automatically create stamp file.
177
178 AC_DEFUN(AM_CONFIG_HEADER,
179 [AC_PREREQ([2.12])
180 AC_CONFIG_HEADER([$1])
181 dnl When config.status generates a header, we must update the stamp-h file.
182 dnl This file resides in the same directory as the config header
183 dnl that is generated. We must strip everything past the first ":",
184 dnl and everything past the last "/".
185 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
186 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
187 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
188 <<am_indx=1
189 for am_file in <<$1>>; do
190 case " <<$>>CONFIG_HEADERS " in
191 *" <<$>>am_file "*<<)>>
192 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
193 ;;
194 esac
195 am_indx=`expr "<<$>>am_indx" + 1`
196 done<<>>dnl>>)
197 changequote([,]))])
198
199
200 # serial 7 AM_PROG_LIBTOOL
201 AC_DEFUN(AM_PROG_LIBTOOL,
202 [AC_REQUIRE([AC_CANONICAL_HOST])
203 AC_REQUIRE([AC_PROG_CC])
204 AC_REQUIRE([AC_PROG_RANLIB])
205 AC_REQUIRE([AM_PATH_PROG_LD])
206
207 # Always use our own libtool.
208 LIBTOOL='$(top_builddir)/libtool'
209 AC_SUBST(LIBTOOL)
210
211 dnl Allow the --disable-shared flag to stop us from building shared libs.
212 AC_ARG_ENABLE(shared,
213 [ --enable-shared build shared libraries [default=yes]],
214 test "$enableval" = no && libtool_shared=" --disable-shared",
215 libtool_shared=)
216
217 dnl Allow the --disable-static flag to stop us from building static libs.
218 AC_ARG_ENABLE(static,
219 [ --enable-static build static libraries [default=yes]],
220 test "$enableval" = no && libtool_static=" --disable-static",
221 libtool_static=)
222
223 libtool_flags="$libtool_shared$libtool_static"
224 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
225 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
226
227 # Some flags need to be propagated to the compiler or linker for good
228 # libtool support.
229 [case "$host" in
230 *-*-irix6*)
231 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
232 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
233 LD="${LD-ld} $f"
234 fi
235 done
236 ;;
237
238 *-*-sco3.2v5*)
239 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
240 CFLAGS="$CFLAGS -belf"
241 ;;
242 esac]
243
244 # Actually configure libtool. ac_aux_dir is where install-sh is found.
245 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \
246 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
247 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
248 || AC_MSG_ERROR([libtool configure failed])
249 ])
250
251 # AM_PATH_PROG_LD - find out which linker is being used by the C compiler
252 AC_DEFUN(AM_PATH_PROG_LD,
253 [AC_REQUIRE([AC_PROG_CC])
254 AC_MSG_CHECKING([for ld used by the C compiler ($CC $CFLAGS $LDFLAGS)])
255 AC_CACHE_VAL(am_cv_path_LD,
256 [case "$LD" in
257 /*)
258 am_cv_path_LD="$LD" # Let the user override the test with a path.
259 ;;
260 *)
261 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
262 for ac_dir in $PATH; do
263 test -z "$ac_dir" && ac_dir=.
264 if test -f "$ac_dir/ld"; then
265 # Check to see if the program is GNU ld. I'd rather use --version,
266 # but apparently some GNU ld's only accept -v.
267 if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
268 # If it was GNU ld, only accept it if we're using GCC.
269 am_cv_path_LD="$ac_dir/ld"
270 test "$ac_cv_prog_gcc" = yes && break
271 else
272 # If it was not GNU ld, and we are not using GCC, then accept it.
273 am_cv_path_LD="$ac_dir/ld"
274 break
275 fi
276 fi
277 done
278 IFS="$ac_save_ifs"
279 ;;
280 esac])
281 LD="$am_cv_path_LD"
282 if test -n "$LD"; then
283 AC_MSG_RESULT($LD)
284 else
285 AC_MSG_RESULT(no)
286 fi
287 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
288 AC_SUBST(LD)
289 ])
290
291 dnl
292 dnl CY_AC_WITH_THREADS determines which thread library the user intends
293 dnl to put underneath guile. Pass it the path to find the guile top-level
294 dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
295 dnl
296
297 AC_DEFUN([CY_AC_WITH_THREADS],[
298 AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
299 AC_CACHE_VAL(cy_cv_threads_cflags,[
300 AC_CACHE_VAL(cy_cv_threads_libs,[
301 use_threads=no;
302 AC_ARG_WITH(threads,[ --with-threads thread interface],
303 use_threads=$withval, use_threads=no)
304 test -n "$use_threads" || use_threads=qt
305 threads_package=unknown
306 if test "$use_threads" != no; then
307 dnl
308 dnl Test for the qt threads package - used for cooperative threads
309 dnl This may not necessarily be built yet - so just check for the
310 dnl header files.
311 dnl
312 if test "$use_threads" = yes || test "$use_threads" = qt; then
313 # Look for qt in source directory.
314 if test -f $srcdir/qt/qt.c; then
315 qtsrcdir="`(cd $srcdir; pwd)`/qt"
316 threads_package=COOP
317 cy_cv_threads_cflags="-I$qtsrcdir -I../qt"
318 cy_cv_threads_libs="../qt/libqt.a"
319 fi
320 else
321 if test -f $use_threads/qt.c; then
322 # FIXME seems as though we should try to use an installed qt here.
323 threads_package=COOP
324 cy_cv_threads_cflags="-I$use_threads -I../qt"
325 cy_cv_threads_libs="../qt/libqt.a"
326 fi
327 fi
328 if test "$use_threads" = pthreads; then
329 # Look for pthreads in srcdir. See above to understand why
330 # we always set threads_package.
331 if test -f $srcdir/../../pthreads/pthreads/queue.c \
332 || test -f $srcdir/../pthreads/pthreads/queue.c; then
333 threads_package=MIT
334 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
335 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
336 fi
337 fi
338 saved_CPP="$CPPFLAGS"
339 saved_LD="$LDFLAGS"
340 saved_LIBS="$LIBS"
341 if test "$threads_package" = unknown; then
342 dnl
343 dnl Test for the FSU threads package
344 dnl
345 CPPFLAGS="-I$use_threads/include"
346 LDFLAGS="-L$use_threads/lib"
347 LIBS="-lgthreads -lmalloc"
348 AC_TRY_LINK([#include <pthread.h>],[
349 pthread_equal(NULL,NULL);
350 ], threads_package=FSU)
351 fi
352 if test "$threads_package" = unknown; then
353 dnl
354 dnl Test for the MIT threads package
355 dnl
356 LIBS="-lpthread"
357 AC_TRY_LINK([#include <pthread.h>],[
358 pthread_equal(NULL,NULL);
359 ], threads_package=MIT)
360 fi
361 if test "$threads_package" = unknown; then
362 dnl
363 dnl Test for the PCthreads package
364 dnl
365 LIBS="-lpthreads"
366 AC_TRY_LINK([#include <pthread.h>],[
367 pthread_equal(NULL,NULL);
368 ], threads_package=PCthreads)
369 fi
370 dnl
371 dnl Set the appropriate flags!
372 dnl
373 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
374 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
375 cy_cv_threads_package=$threads_package
376 CPPFLAGS="$saved_CPP"
377 LDFLAGS="$saved_LD"
378 LIBS="$saved_LIBS"
379 if test "$threads_package" = unknown; then
380 AC_MSG_ERROR("cannot find thread library installation")
381 fi
382 fi
383 ])
384 ])
385 ],
386 dnl
387 dnl Set flags according to what is cached.
388 dnl
389 CPPFLAGS="$cy_cv_threads_cflags"
390 LIBS="$cy_cv_threads_libs"
391 )
392 ])
393