Call the QuickThreads library libqthreads.a, not libqt.a. The old
[bpt/guile.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.2c
2
3 dnl Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl On the NeXT, #including <utime.h> doesn't give you a definition for
14 dnl struct utime, unless you #define _POSIX_SOURCE.
15
16 AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
17 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
18 guile_cv_struct_utimbuf_needs_posix,
19 [AC_TRY_CPP([
20 #ifdef __EMX__
21 #include <sys/utime.h>
22 #else
23 #include <utime.h>
24 #endif
25 struct utime blah;
26 ],
27 guile_cv_struct_utimbuf_needs_posix=no,
28 guile_cv_struct_utimbuf_needs_posix=yes)])
29 if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
30 AC_DEFINE(UTIMBUF_NEEDS_POSIX)
31 fi])
32
33
34
35
36 dnl
37 dnl Apparently, at CMU they have a weird version of libc.h that is
38 dnl installed in /usr/local/include and conflicts with unistd.h.
39 dnl In these situations, we should not #include libc.h.
40 dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
41 dnl present on the system, and is safe to #include.
42 dnl
43 AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
44 [
45 AC_CHECK_HEADERS(libc.h unistd.h)
46 AC_CACHE_CHECK(
47 "whether libc.h and unistd.h can be included together",
48 guile_cv_header_libc_with_unistd,
49 [
50 if test "$ac_cv_header_libc_h" = "no"; then
51 guile_cv_header_libc_with_unistd="no"
52 elif test "$ac_cv_header_unistd.h" = "no"; then
53 guile_cv_header_libc_with_unistd="yes"
54 else
55 AC_TRY_COMPILE(
56 [
57 # include <libc.h>
58 # include <unistd.h>
59 ],
60 [],
61 [guile_cv_header_libc_with_unistd=yes],
62 [guile_cv_header_libc_with_unistd=no]
63 )
64 fi
65 ]
66 )
67 if test "$guile_cv_header_libc_with_unistd" = yes; then
68 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
69 fi
70 ]
71 )
72
73
74
75 dnl This is needed when we want to check for the same function repeatedly
76 dnl with other parameters, such as libraries, varying.
77 dnl
78 dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
79 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
80 AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
81 [AC_MSG_CHECKING([for $1])
82 AC_CACHE_VAL(ac_cv_func_$1_$2,
83 [AC_TRY_LINK(
84 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
85 dnl which includes <sys/select.h> which contains a prototype for
86 dnl select. Similarly for bzero.
87 [/* System header to define __stub macros and hopefully few prototypes,
88 which can conflict with char $1(); below. */
89 #include <assert.h>
90 /* Override any gcc2 internal prototype to avoid an error. */
91 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
92 extern "C"
93 #endif
94 ])dnl
95 [/* We use char because int might match the return type of a gcc2
96 builtin and then its argument prototype would still apply. */
97 char $1();
98 ], [
99 /* The GNU C library defines this for functions which it implements
100 to always fail with ENOSYS. Some functions are actually named
101 something starting with __ and the normal name is an alias. */
102 #if defined (__stub_$1) || defined (__stub___$1)
103 choke me
104 #else
105 $1();
106 #endif
107 ], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
108 if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
109 AC_MSG_RESULT(yes)
110 ifelse([$3], , :, [$3])
111 else
112 AC_MSG_RESULT(no)
113 ifelse([$4], , , [$4
114 ])dnl
115 fi
116 ])
117
118 # Do all the work for Automake. This macro actually does too much --
119 # some checks are only needed if your package does certain things.
120 # But this isn't really a big deal.
121
122 # serial 1
123
124 dnl Usage:
125 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
126
127 AC_DEFUN(AM_INIT_AUTOMAKE,
128 [AC_REQUIRE([AM_PROG_INSTALL])
129 PACKAGE=[$1]
130 AC_SUBST(PACKAGE)
131 VERSION=[$2]
132 AC_SUBST(VERSION)
133 dnl test to see if srcdir already configured
134 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
135 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
136 fi
137 ifelse([$3],,
138 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
139 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
140 AM_SANITY_CHECK
141 AC_ARG_PROGRAM
142 dnl FIXME This is truly gross.
143 missing_dir=`cd $ac_aux_dir && pwd`
144 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
145 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
146 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
147 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
148 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
149 AC_PROG_MAKE_SET])
150
151
152 # serial 1
153
154 AC_DEFUN(AM_PROG_INSTALL,
155 [AC_REQUIRE([AC_PROG_INSTALL])
156 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
157 AC_SUBST(INSTALL_SCRIPT)dnl
158 ])
159
160 #
161 # Check to make sure that the build environment is sane.
162 #
163
164 AC_DEFUN(AM_SANITY_CHECK,
165 [AC_MSG_CHECKING([whether build environment is sane])
166 # Just in case
167 sleep 1
168 echo timestamp > conftestfile
169 # Do `set' in a subshell so we don't clobber the current shell's
170 # arguments. Must try -L first in case configure is actually a
171 # symlink; some systems play weird games with the mod time of symlinks
172 # (eg FreeBSD returns the mod time of the symlink's containing
173 # directory).
174 if (
175 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
176 if test "[$]*" = "X"; then
177 # -L didn't work.
178 set X `ls -t $srcdir/configure conftestfile`
179 fi
180 test "[$]2" = conftestfile
181 )
182 then
183 # Ok.
184 :
185 else
186 AC_MSG_ERROR([newly created file is older than distributed files!
187 Check your system clock])
188 fi
189 rm -f conftest*
190 AC_MSG_RESULT(yes)])
191
192 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
193 dnl The program must properly implement --version.
194 AC_DEFUN(AM_MISSING_PROG,
195 [AC_MSG_CHECKING(for working $2)
196 # Run test in a subshell; some versions of sh will print an error if
197 # an executable is not found, even if stderr is redirected.
198 # Redirect stdin to placate older versions of autoconf. Sigh.
199 if ($2 --version) < /dev/null > /dev/null 2>&1; then
200 $1=$2
201 AC_MSG_RESULT(found)
202 else
203 $1="$3/missing $2"
204 AC_MSG_RESULT(missing)
205 fi
206 AC_SUBST($1)])
207
208 # Add --enable-maintainer-mode option to configure.
209 # From Jim Meyering
210
211 # serial 1
212
213 AC_DEFUN(AM_MAINTAINER_MODE,
214 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
215 dnl maintainer-mode is disabled by default
216 AC_ARG_ENABLE(maintainer-mode,
217 [ --enable-maintainer-mode enable make rules and dependencies not useful
218 (and sometimes confusing) to the casual installer],
219 USE_MAINTAINER_MODE=$enableval,
220 USE_MAINTAINER_MODE=no)
221 AC_MSG_RESULT($USE_MAINTAINER_MODE)
222 if test $USE_MAINTAINER_MODE = yes; then
223 MAINT=
224 else
225 MAINT='#M#'
226 fi
227 AC_SUBST(MAINT)dnl
228 ]
229 )
230
231 # Like AC_CONFIG_HEADER, but automatically create stamp file.
232
233 AC_DEFUN(AM_CONFIG_HEADER,
234 [AC_PREREQ([2.12])
235 AC_CONFIG_HEADER([$1])
236 dnl When config.status generates a header, we must update the stamp-h file.
237 dnl This file resides in the same directory as the config header
238 dnl that is generated. We must strip everything past the first ":",
239 dnl and everything past the last "/".
240 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
241 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
242 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
243 <<am_indx=1
244 for am_file in <<$1>>; do
245 case " <<$>>CONFIG_HEADERS " in
246 *" <<$>>am_file "*<<)>>
247 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
248 ;;
249 esac
250 am_indx=`expr "<<$>>am_indx" + 1`
251 done<<>>dnl>>)
252 changequote([,]))])
253
254
255 # serial 15 AM_PROG_LIBTOOL
256 AC_DEFUN(AM_PROG_LIBTOOL,
257 [AC_REQUIRE([AC_CANONICAL_HOST])
258 AC_REQUIRE([AC_PROG_RANLIB])
259 AC_REQUIRE([AC_PROG_CC])
260 AC_REQUIRE([AM_PROG_LD])
261 AC_REQUIRE([AM_PROG_NM])
262 AC_REQUIRE([AC_PROG_LN_S])
263
264 # Always use our own libtool.
265 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
266 AC_SUBST(LIBTOOL)
267
268 dnl Allow the --disable-shared flag to stop us from building shared libs.
269 AC_ARG_ENABLE(shared,
270 [ --enable-shared build shared libraries [default=yes]],
271 [if test "$enableval" = no; then
272 enable_shared=no
273 else
274 enable_shared=yes
275 fi])
276 libtool_shared=
277 test "$enable_shared" = no && libtool_shared=" --disable-shared"
278
279 dnl Allow the --disable-static flag to stop us from building static libs.
280 AC_ARG_ENABLE(static,
281 [ --enable-static build static libraries [default=yes]],
282 [if test "$enableval" = no; then
283 enable_static=no
284 else
285 enable_static=yes
286 fi])
287 libtool_static=
288 test "$enable_static" = no && libtool_static=" --disable-static"
289
290 libtool_flags="$libtool_shared$libtool_static"
291 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
292 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
293 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
294
295 # Some flags need to be propagated to the compiler or linker for good
296 # libtool support.
297 [case "$host" in
298 *-*-irix6*)
299 ac_save_CFLAGS="$CFLAGS"
300 # -n32 always needs to be added to the linker when using GCC.
301 test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
302 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
303 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
304 LD="${LD-ld} $f"
305 fi
306 done
307 CFLAGS="$ac_save_CFLAGS"
308 ;;
309
310 *-*-sco3.2v5*)
311 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
312 CFLAGS="$CFLAGS -belf"
313 ;;
314 esac]
315
316 # Actually configure libtool. ac_aux_dir is where install-sh is found.
317 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
318 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
319 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
320 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
321 || AC_MSG_ERROR([libtool configure failed])
322 ])
323
324 # AM_PROG_LD - find the path to the GNU or non-GNU linker
325 AC_DEFUN(AM_PROG_LD,
326 [AC_ARG_WITH(gnu-ld,
327 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
328 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
329 AC_REQUIRE([AC_PROG_CC])
330 ac_prog=ld
331 if test "$ac_cv_prog_gcc" = yes; then
332 # Check if gcc -print-prog-name=ld gives a path.
333 AC_MSG_CHECKING([for ld used by GCC])
334 ac_prog=`($CC -print-prog-name=ld) 2>&5`
335 case "$ac_prog" in
336 # Accept absolute paths.
337 /*)
338 test -z "$LD" && LD="$ac_prog"
339 ;;
340 "")
341 # If it fails, then pretend we aren't using GCC.
342 ac_prog=ld
343 ;;
344 *)
345 # If it is relative, then search for the first ld in PATH.
346 with_gnu_ld=unknown
347 ;;
348 esac
349 elif test "$with_gnu_ld" = yes; then
350 AC_MSG_CHECKING([for GNU ld])
351 else
352 AC_MSG_CHECKING([for non-GNU ld])
353 fi
354 AC_CACHE_VAL(ac_cv_path_LD,
355 [if test -z "$LD"; then
356 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
357 for ac_dir in $PATH; do
358 test -z "$ac_dir" && ac_dir=.
359 if test -f "$ac_dir/$ac_prog"; then
360 ac_cv_path_LD="$ac_dir/$ac_prog"
361 # Check to see if the program is GNU ld. I'd rather use --version,
362 # but apparently some GNU ld's only accept -v.
363 # Break only if it was the GNU/non-GNU ld that we prefer.
364 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
365 test "$with_gnu_ld" != no && break
366 else
367 test "$with_gnu_ld" != yes && break
368 fi
369 fi
370 done
371 IFS="$ac_save_ifs"
372 else
373 ac_cv_path_LD="$LD" # Let the user override the test with a path.
374 fi])
375 LD="$ac_cv_path_LD"
376 if test -n "$LD"; then
377 AC_MSG_RESULT($LD)
378 else
379 AC_MSG_RESULT(no)
380 fi
381 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
382 AC_SUBST(LD)
383 AM_PROG_LD_GNU
384 ])
385
386 AC_DEFUN(AM_PROG_LD_GNU,
387 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
388 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
389 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
390 ac_cv_prog_gnu_ld=yes
391 else
392 ac_cv_prog_gnu_ld=no
393 fi])
394 ])
395
396 # AM_PROG_NM - find the path to a BSD-compatible name lister
397 AC_DEFUN(AM_PROG_NM,
398 [AC_MSG_CHECKING([for BSD-compatible nm])
399 AC_CACHE_VAL(ac_cv_path_NM,
400 [case "$NM" in
401 /*)
402 ac_cv_path_NM="$NM" # Let the user override the test with a path.
403 ;;
404 *)
405 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
406 for ac_dir in /usr/ucb $PATH /bin; do
407 test -z "$ac_dir" && dir=.
408 if test -f $ac_dir/nm; then
409 # Check to see if the nm accepts a BSD-compat flag.
410 if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
411 ac_cv_path_NM="$ac_dir/nm -B"
412 elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
413 ac_cv_path_NM="$ac_dir/nm -p"
414 else
415 ac_cv_path_NM="$ac_dir/nm"
416 fi
417 break
418 fi
419 done
420 IFS="$ac_save_ifs"
421 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
422 ;;
423 esac])
424 NM="$ac_cv_path_NM"
425 AC_MSG_RESULT([$NM])
426 AC_SUBST(NM)
427 ])
428
429 dnl
430 dnl CY_AC_WITH_THREADS determines which thread library the user intends
431 dnl to put underneath guile. Pass it the path to find the guile top-level
432 dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
433 dnl
434
435 AC_DEFUN([CY_AC_WITH_THREADS],[
436 AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
437 AC_CACHE_VAL(cy_cv_threads_cflags,[
438 AC_CACHE_VAL(cy_cv_threads_libs,[
439 use_threads=no;
440 AC_ARG_WITH(threads,[ --with-threads thread interface],
441 use_threads=$withval, use_threads=no)
442 test -n "$use_threads" || use_threads=qt
443 threads_package=unknown
444 if test "$use_threads" != no; then
445 dnl
446 dnl Test for the qt threads package - used for cooperative threads
447 dnl This may not necessarily be built yet - so just check for the
448 dnl header files.
449 dnl
450 if test "$use_threads" = yes || test "$use_threads" = qt; then
451 # Look for qt in source directory.
452 if test -f $srcdir/qt/qt.c; then
453 qtsrcdir="`(cd $srcdir; pwd)`/qt"
454 threads_package=COOP
455 cy_cv_threads_cflags="-I$qtsrcdir -I../qt"
456 cy_cv_threads_libs="../qt/libqthreads.a"
457 fi
458 else
459 if test -f $use_threads/qt.c; then
460 # FIXME seems as though we should try to use an installed qt here.
461 threads_package=COOP
462 cy_cv_threads_cflags="-I$use_threads -I../qt"
463 cy_cv_threads_libs="../qt/libqthreads.a"
464 fi
465 fi
466 if test "$use_threads" = pthreads; then
467 # Look for pthreads in srcdir. See above to understand why
468 # we always set threads_package.
469 if test -f $srcdir/../../pthreads/pthreads/queue.c \
470 || test -f $srcdir/../pthreads/pthreads/queue.c; then
471 threads_package=MIT
472 cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
473 cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
474 fi
475 fi
476 saved_CPP="$CPPFLAGS"
477 saved_LD="$LDFLAGS"
478 saved_LIBS="$LIBS"
479 if test "$threads_package" = unknown; then
480 dnl
481 dnl Test for the FSU threads package
482 dnl
483 CPPFLAGS="-I$use_threads/include"
484 LDFLAGS="-L$use_threads/lib"
485 LIBS="-lgthreads -lmalloc"
486 AC_TRY_LINK([#include <pthread.h>],[
487 pthread_equal(NULL,NULL);
488 ], threads_package=FSU)
489 fi
490 if test "$threads_package" = unknown; then
491 dnl
492 dnl Test for the MIT threads package
493 dnl
494 LIBS="-lpthread"
495 AC_TRY_LINK([#include <pthread.h>],[
496 pthread_equal(NULL,NULL);
497 ], threads_package=MIT)
498 fi
499 if test "$threads_package" = unknown; then
500 dnl
501 dnl Test for the PCthreads package
502 dnl
503 LIBS="-lpthreads"
504 AC_TRY_LINK([#include <pthread.h>],[
505 pthread_equal(NULL,NULL);
506 ], threads_package=PCthreads)
507 fi
508 dnl
509 dnl Set the appropriate flags!
510 dnl
511 cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
512 cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
513 cy_cv_threads_package=$threads_package
514 CPPFLAGS="$saved_CPP"
515 LDFLAGS="$saved_LD"
516 LIBS="$saved_LIBS"
517 if test "$threads_package" = unknown; then
518 AC_MSG_ERROR("cannot find thread library installation")
519 fi
520 fi
521 ])
522 ])
523 ],
524 dnl
525 dnl Set flags according to what is cached.
526 dnl
527 CPPFLAGS="$cy_cv_threads_cflags"
528 LIBS="$cy_cv_threads_libs"
529 )
530 ])
531