* Makefile.in, aclocal.m4, configure: Regenerated.
[bpt/guile.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file 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
119
120 dnl Check checks whether dlsym (if present) requires a leading underscore.
121 dnl Written by Dan Hagerty <hag@ai.mit.edu> for scsh-0.5.0.
122 AC_DEFUN(GUILE_DLSYM_USCORE, [
123 AC_MSG_CHECKING(for underscore before symbols)
124 AC_CACHE_VAL(guile_cv_uscore,[
125 echo "main(){int i=1;}
126 fnord(){int i=23; int ltuae=42;}" > conftest.c
127 ${CC} conftest.c > /dev/null
128 if (nm a.out | grep _fnord) > /dev/null; then
129 guile_cv_uscore=yes
130 else
131 guile_cv_uscore=no
132 fi])
133 AC_MSG_RESULT($guile_cv_uscore)
134 rm -f conftest.c a.out
135
136 if test $guile_cv_uscore = yes; then
137 AC_DEFINE(USCORE)
138
139 if test $ac_cv_func_dlopen = yes -o $ac_cv_lib_dl_dlopen = yes ; then
140 AC_MSG_CHECKING(whether dlsym always adds an underscore for us)
141 AC_CACHE_VAL(guile_cv_dlsym_adds_uscore,AC_TRY_RUN( [
142 #include <dlfcn.h>
143 #include <stdio.h>
144 fnord() { int i=42;}
145 main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
146 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
147 if(ptr1 && !ptr2) exit(0); } exit(1); }
148 ], [guile_cv_dlsym_adds_uscore=yes
149 AC_DEFINE(DLSYM_ADDS_USCORE) ], guile_cv_dlsym_adds_uscore=no,
150 guile_cv_dlsym_adds_uscore=no))
151
152 AC_MSG_RESULT($guile_cv_dlsym_adds_uscore)
153 fi
154 fi
155 ])
156
157 # Do all the work for Automake. This macro actually does too much --
158 # some checks are only needed if your package does certain things.
159 # But this isn't really a big deal.
160
161 # serial 1
162
163 dnl Usage:
164 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
165
166 AC_DEFUN(AM_INIT_AUTOMAKE,
167 [AC_REQUIRE([AC_PROG_INSTALL])
168 PACKAGE=[$1]
169 AC_SUBST(PACKAGE)
170 VERSION=[$2]
171 AC_SUBST(VERSION)
172 dnl test to see if srcdir already configured
173 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
174 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
175 fi
176 ifelse([$3],,
177 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
178 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
179 AC_REQUIRE([AM_SANITY_CHECK])
180 AC_REQUIRE([AC_ARG_PROGRAM])
181 dnl FIXME This is truly gross.
182 missing_dir=`cd $ac_aux_dir && pwd`
183 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
184 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
185 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
186 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
187 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
188 AC_REQUIRE([AC_PROG_MAKE_SET])])
189
190 #
191 # Check to make sure that the build environment is sane.
192 #
193
194 AC_DEFUN(AM_SANITY_CHECK,
195 [AC_MSG_CHECKING([whether build environment is sane])
196 # Just in case
197 sleep 1
198 echo timestamp > conftestfile
199 # Do `set' in a subshell so we don't clobber the current shell's
200 # arguments. Must try -L first in case configure is actually a
201 # symlink; some systems play weird games with the mod time of symlinks
202 # (eg FreeBSD returns the mod time of the symlink's containing
203 # directory).
204 if (
205 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
206 if test "[$]*" = "X"; then
207 # -L didn't work.
208 set X `ls -t $srcdir/configure conftestfile`
209 fi
210 if test "[$]*" != "X $srcdir/configure conftestfile" \
211 && test "[$]*" != "X conftestfile $srcdir/configure"; then
212
213 # If neither matched, then we have a broken ls. This can happen
214 # if, for instance, CONFIG_SHELL is bash and it inherits a
215 # broken ls alias from the environment. This has actually
216 # happened. Such a system could not be considered "sane".
217 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
218 alias in your environment])
219 fi
220
221 test "[$]2" = conftestfile
222 )
223 then
224 # Ok.
225 :
226 else
227 AC_MSG_ERROR([newly created file is older than distributed files!
228 Check your system clock])
229 fi
230 rm -f conftest*
231 AC_MSG_RESULT(yes)])
232
233 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
234 dnl The program must properly implement --version.
235 AC_DEFUN(AM_MISSING_PROG,
236 [AC_MSG_CHECKING(for working $2)
237 # Run test in a subshell; some versions of sh will print an error if
238 # an executable is not found, even if stderr is redirected.
239 # Redirect stdin to placate older versions of autoconf. Sigh.
240 if ($2 --version) < /dev/null > /dev/null 2>&1; then
241 $1=$2
242 AC_MSG_RESULT(found)
243 else
244 $1="$3/missing $2"
245 AC_MSG_RESULT(missing)
246 fi
247 AC_SUBST($1)])
248
249 # Add --enable-maintainer-mode option to configure.
250 # From Jim Meyering
251
252 # serial 1
253
254 AC_DEFUN(AM_MAINTAINER_MODE,
255 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
256 dnl maintainer-mode is disabled by default
257 AC_ARG_ENABLE(maintainer-mode,
258 [ --enable-maintainer-mode enable make rules and dependencies not useful
259 (and sometimes confusing) to the casual installer],
260 USE_MAINTAINER_MODE=$enableval,
261 USE_MAINTAINER_MODE=no)
262 AC_MSG_RESULT($USE_MAINTAINER_MODE)
263 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
264 MAINT=$MAINTAINER_MODE_TRUE
265 AC_SUBST(MAINT)dnl
266 ]
267 )
268
269 # Define a conditional.
270
271 AC_DEFUN(AM_CONDITIONAL,
272 [AC_SUBST($1_TRUE)
273 AC_SUBST($1_FALSE)
274 if $2; then
275 $1_TRUE=
276 $1_FALSE='#'
277 else
278 $1_TRUE='#'
279 $1_FALSE=
280 fi])
281
282 # Like AC_CONFIG_HEADER, but automatically create stamp file.
283
284 AC_DEFUN(AM_CONFIG_HEADER,
285 [AC_PREREQ([2.12])
286 AC_CONFIG_HEADER([$1])
287 dnl When config.status generates a header, we must update the stamp-h file.
288 dnl This file resides in the same directory as the config header
289 dnl that is generated. We must strip everything past the first ":",
290 dnl and everything past the last "/".
291 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
292 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
293 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
294 <<am_indx=1
295 for am_file in <<$1>>; do
296 case " <<$>>CONFIG_HEADERS " in
297 *" <<$>>am_file "*<<)>>
298 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
299 ;;
300 esac
301 am_indx=`expr "<<$>>am_indx" + 1`
302 done<<>>dnl>>)
303 changequote([,]))])
304
305
306 # serial 24 AM_PROG_LIBTOOL
307 AC_DEFUN(AM_PROG_LIBTOOL,
308 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
309 AC_REQUIRE([AM_ENABLE_STATIC])dnl
310 AC_REQUIRE([AC_CANONICAL_HOST])dnl
311 AC_REQUIRE([AC_PROG_RANLIB])dnl
312 AC_REQUIRE([AC_PROG_CC])dnl
313 AC_REQUIRE([AM_PROG_LD])dnl
314 AC_REQUIRE([AM_PROG_NM])dnl
315 AC_REQUIRE([AC_PROG_LN_S])dnl
316 dnl
317 # Always use our own libtool.
318 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
319 AC_SUBST(LIBTOOL)dnl
320
321 # Check for any special flags to pass to ltconfig.
322 libtool_flags=
323 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
324 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
325 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
326 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
327 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
328
329 # Some flags need to be propagated to the compiler or linker for good
330 # libtool support.
331 case "$host" in
332 *-*-irix6*)
333 # Find out which ABI we are using.
334 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
335 if AC_TRY_EVAL(ac_compile); then
336 case "`/usr/bin/file conftest.o`" in
337 *32-bit*)
338 LD="${LD-ld} -32"
339 ;;
340 *N32*)
341 LD="${LD-ld} -n32"
342 ;;
343 *64-bit*)
344 LD="${LD-ld} -64"
345 ;;
346 esac
347 fi
348 rm -rf conftest*
349 ;;
350
351 *-*-sco3.2v5*)
352 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
353 CFLAGS="$CFLAGS -belf"
354 ;;
355 esac
356
357 # Actually configure libtool. ac_aux_dir is where install-sh is found.
358 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
359 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
360 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
361 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
362 || AC_MSG_ERROR([libtool configure failed])
363 ])
364
365 # AM_ENABLE_SHARED - implement the --enable-shared flag
366 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
367 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
368 # `yes'.
369 AC_DEFUN(AM_ENABLE_SHARED,
370 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
371 AC_ARG_ENABLE(shared,
372 changequote(<<, >>)dnl
373 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
374 changequote([, ])dnl
375 [ --enable-shared=PKGS only build shared libraries if the current package
376 appears as an element in the PKGS list],
377 [p=${PACKAGE-default}
378 case "$enableval" in
379 yes) enable_shared=yes ;;
380 no) enable_shared=no ;;
381 *)
382 enable_shared=no
383 # Look at the argument we got. We use all the common list separators.
384 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
385 for pkg in $enableval; do
386 if test "X$pkg" = "X$p"; then
387 enable_shared=yes
388 fi
389 done
390 IFS="$ac_save_ifs"
391 ;;
392 esac],
393 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
394 ])
395
396 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
397 AC_DEFUN(AM_DISABLE_SHARED,
398 [AM_ENABLE_SHARED(no)])
399
400 # AM_DISABLE_STATIC - set the default static flag to --disable-static
401 AC_DEFUN(AM_DISABLE_STATIC,
402 [AM_ENABLE_STATIC(no)])
403
404 # AM_ENABLE_STATIC - implement the --enable-static flag
405 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
406 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
407 # `yes'.
408 AC_DEFUN(AM_ENABLE_STATIC,
409 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
410 AC_ARG_ENABLE(static,
411 changequote(<<, >>)dnl
412 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
413 changequote([, ])dnl
414 [ --enable-static=PKGS only build shared libraries if the current package
415 appears as an element in the PKGS list],
416 [p=${PACKAGE-default}
417 case "$enableval" in
418 yes) enable_static=yes ;;
419 no) enable_static=no ;;
420 *)
421 enable_static=no
422 # Look at the argument we got. We use all the common list separators.
423 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
424 for pkg in $enableval; do
425 if test "X$pkg" = "X$p"; then
426 enable_static=yes
427 fi
428 done
429 IFS="$ac_save_ifs"
430 ;;
431 esac],
432 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
433 ])
434
435
436 # AM_PROG_LD - find the path to the GNU or non-GNU linker
437 AC_DEFUN(AM_PROG_LD,
438 [AC_ARG_WITH(gnu-ld,
439 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
440 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
441 AC_REQUIRE([AC_PROG_CC])
442 ac_prog=ld
443 if test "$ac_cv_prog_gcc" = yes; then
444 # Check if gcc -print-prog-name=ld gives a path.
445 AC_MSG_CHECKING([for ld used by GCC])
446 ac_prog=`($CC -print-prog-name=ld) 2>&5`
447 case "$ac_prog" in
448 # Accept absolute paths.
449 /* | [A-Za-z]:\\*)
450 test -z "$LD" && LD="$ac_prog"
451 ;;
452 "")
453 # If it fails, then pretend we aren't using GCC.
454 ac_prog=ld
455 ;;
456 *)
457 # If it is relative, then search for the first ld in PATH.
458 with_gnu_ld=unknown
459 ;;
460 esac
461 elif test "$with_gnu_ld" = yes; then
462 AC_MSG_CHECKING([for GNU ld])
463 else
464 AC_MSG_CHECKING([for non-GNU ld])
465 fi
466 AC_CACHE_VAL(ac_cv_path_LD,
467 [if test -z "$LD"; then
468 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
469 for ac_dir in $PATH; do
470 test -z "$ac_dir" && ac_dir=.
471 if test -f "$ac_dir/$ac_prog"; then
472 ac_cv_path_LD="$ac_dir/$ac_prog"
473 # Check to see if the program is GNU ld. I'd rather use --version,
474 # but apparently some GNU ld's only accept -v.
475 # Break only if it was the GNU/non-GNU ld that we prefer.
476 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
477 test "$with_gnu_ld" != no && break
478 else
479 test "$with_gnu_ld" != yes && break
480 fi
481 fi
482 done
483 IFS="$ac_save_ifs"
484 else
485 ac_cv_path_LD="$LD" # Let the user override the test with a path.
486 fi])
487 LD="$ac_cv_path_LD"
488 if test -n "$LD"; then
489 AC_MSG_RESULT($LD)
490 else
491 AC_MSG_RESULT(no)
492 fi
493 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
494 AC_SUBST(LD)
495 AM_PROG_LD_GNU
496 ])
497
498 AC_DEFUN(AM_PROG_LD_GNU,
499 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
500 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
501 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
502 ac_cv_prog_gnu_ld=yes
503 else
504 ac_cv_prog_gnu_ld=no
505 fi])
506 ])
507
508 # AM_PROG_NM - find the path to a BSD-compatible name lister
509 AC_DEFUN(AM_PROG_NM,
510 [AC_MSG_CHECKING([for BSD-compatible nm])
511 AC_CACHE_VAL(ac_cv_path_NM,
512 [case "$NM" in
513 /* | [A-Za-z]:\\*)
514 ac_cv_path_NM="$NM" # Let the user override the test with a path.
515 ;;
516 *)
517 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
518 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
519 test -z "$ac_dir" && ac_dir=.
520 if test -f $ac_dir/nm; then
521 # Check to see if the nm accepts a BSD-compat flag.
522 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
523 # nm: unknown option "B" ignored
524 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
525 ac_cv_path_NM="$ac_dir/nm -B"
526 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
527 ac_cv_path_NM="$ac_dir/nm -p"
528 else
529 ac_cv_path_NM="$ac_dir/nm"
530 fi
531 break
532 fi
533 done
534 IFS="$ac_save_ifs"
535 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
536 ;;
537 esac])
538 NM="$ac_cv_path_NM"
539 AC_MSG_RESULT([$NM])
540 AC_SUBST(NM)
541 ])
542
543
544 # serial 1
545
546 # @defmac AC_PROG_CC_STDC
547 # @maindex PROG_CC_STDC
548 # @ovindex CC
549 # If the C compiler in not in ANSI C mode by default, try to add an option
550 # to output variable @code{CC} to make it so. This macro tries various
551 # options that select ANSI C on some system or another. It considers the
552 # compiler to be in ANSI C mode if it handles function prototypes correctly.
553 #
554 # If you use this macro, you should check after calling it whether the C
555 # compiler has been set to accept ANSI C; if not, the shell variable
556 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
557 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
558 # program @code{ansi2knr}, which comes with Ghostscript.
559 # @end defmac
560
561 AC_DEFUN(AM_PROG_CC_STDC,
562 [AC_REQUIRE([AC_PROG_CC])
563 AC_BEFORE([$0], [AC_C_INLINE])
564 AC_BEFORE([$0], [AC_C_CONST])
565 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
566 dnl a magic option to avoid problems with ANSI preprocessor commands
567 dnl like #elif.
568 dnl FIXME: can't do this because then AC_AIX won't work due to a
569 dnl circular dependency.
570 dnl AC_BEFORE([$0], [AC_PROG_CPP])
571 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
572 AC_CACHE_VAL(am_cv_prog_cc_stdc,
573 [am_cv_prog_cc_stdc=no
574 ac_save_CC="$CC"
575 # Don't try gcc -ansi; that turns off useful extensions and
576 # breaks some systems' header files.
577 # AIX -qlanglvl=ansi
578 # Ultrix and OSF/1 -std1
579 # HP-UX -Aa -D_HPUX_SOURCE
580 # SVR4 -Xc -D__EXTENSIONS__
581 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
582 do
583 CC="$ac_save_CC $ac_arg"
584 AC_TRY_COMPILE(
585 [#include <stdarg.h>
586 #include <stdio.h>
587 #include <sys/types.h>
588 #include <sys/stat.h>
589 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
590 struct buf { int x; };
591 FILE * (*rcsopen) (struct buf *, struct stat *, int);
592 static char *e (p, i)
593 char **p;
594 int i;
595 {
596 return p[i];
597 }
598 static char *f (char * (*g) (char **, int), char **p, ...)
599 {
600 char *s;
601 va_list v;
602 va_start (v,p);
603 s = g (p, va_arg (v,int));
604 va_end (v);
605 return s;
606 }
607 int test (int i, double x);
608 struct s1 {int (*f) (int a);};
609 struct s2 {int (*f) (double a);};
610 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
611 int argc;
612 char **argv;
613 ], [
614 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
615 ],
616 [am_cv_prog_cc_stdc="$ac_arg"; break])
617 done
618 CC="$ac_save_CC"
619 ])
620 if test -z "$am_cv_prog_cc_stdc"; then
621 AC_MSG_RESULT([none needed])
622 else
623 AC_MSG_RESULT($am_cv_prog_cc_stdc)
624 fi
625 case "x$am_cv_prog_cc_stdc" in
626 x|xno) ;;
627 *) CC="$CC $am_cv_prog_cc_stdc" ;;
628 esac
629 ])
630
631 dnl Autoconf macros for configuring the QuickThreads package
632
633 dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
634 dnl sources should be in $srcdir/qt. If configuration succeeds, this
635 dnl macro creates the appropriate symlinks in the qt object directory,
636 dnl and sets the following variables, used in building libqthreads.a:
637 dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
638 dnl succeeds, or the empty string if configuration fails.
639 dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
640 dnl dependent source files.
641 dnl qthread_asflags --- flags to pass to the compiler when processing
642 dnl assembly-language files.
643 dnl
644 dnl It also sets the following variables, which describe how clients
645 dnl can link against libqthreads.a:
646 dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
647 dnl the empty string if configuration fails.
648 dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
649 dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
650 dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
651 dnl is installed
652 dnl It would be nice if all thread configuration packages for Guile
653 dnl followed the same conventions.
654 dnl
655 dnl All of the above variables will be substituted into Makefiles in
656 dnl the usual autoconf fashion.
657 dnl
658 dnl We distinguish between THREAD_LIBS_LOCAL and
659 dnl THREAD_LIBS_INSTALLED because the thread library might be in
660 dnl this tree, and be built using libtool. This means that:
661 dnl 1) when building other executables in this tree, one must
662 dnl pass the relative path to the ../libfoo.la file, but
663 dnl 2) once the whole package has been installed, users should
664 dnl link using -lfoo.
665 dnl Normally, we only care about the first case, but since the
666 dnl guile-config script needs to give users all the flags they need
667 dnl to link programs against guile, the GUILE_WITH_THREADS macro
668 dnl needs to supply the second piece of information as well.
669 dnl
670 dnl This whole thing is a little confused about what ought to be
671 dnl done in the top-level configure script, and what ought to be
672 dnl taken care of in the subdirectory. For example, qtmds_s and
673 dnl friends really ought not to be even mentioned in the top-level
674 dnl configure script, but here they are.
675
676 AC_DEFUN([QTHREADS_CONFIGURE],[
677 AC_REQUIRE([AC_PROG_LN_S])
678
679 AC_MSG_CHECKING(QuickThreads configuration)
680 # How can we refer to the qt source directory from within the qt build
681 # directory? For headers, we can rely on the fact that the qt src
682 # directory appears in the #include path.
683 qtsrcdir="`(cd $srcdir; pwd)`/qt"
684
685 changequote(,)dnl We use [ and ] in a regexp in the case
686
687 THREAD_PACKAGE=QT
688 qthread_asflags=''
689 case "$host" in
690 i[3456]86-*-*)
691 port_name=i386
692 qtmd_h=md/i386.h
693 qtmds_s=md/i386.s
694 qtmdc_c=md/null.c
695 qtdmdb_s=
696 case "$host" in
697 *-*-netbsd* )
698 ## NetBSD needs to be told to pass the assembly code through
699 ## the C preprocessor. Other GCC installations seem to do
700 ## this by default, but NetBSD's doesn't. We could get the
701 ## same effect by giving the file a name ending with .S
702 ## instead of .s, but I don't see how to tell automake to do
703 ## that.
704 qthread_asflags='-x assembler-with-cpp'
705 ;;
706 esac
707 ;;
708 mips-sgi-irix[56]*)
709 port_name=irix
710 qtmd_h=md/mips.h
711 qtmds_s=md/mips-irix5.s
712 qtmdc_c=md/null.c
713 qtdmdb_s=md/mips_b.s
714 ;;
715 mips-*-*)
716 port_name=mips
717 qtmd_h=md/mips.h
718 qtmds_s=md/mips.s
719 qtmdc_c=md/null.c
720 qtdmdb_s=md/mips_b.s
721 ;;
722 sparc-*-sunos*)
723 port_name=sparc-sunos
724 qtmd_h=md/sparc.h
725 qtmds_s=md/_sparc.s
726 qtmdc_c=md/null.c
727 qtdmdb_s=md/_sparc_b.s
728 ;;
729 sparc-*-*)
730 port_name=sparc
731 qtmd_h=md/sparc.h
732 qtmds_s=md/sparc.s
733 qtmdc_c=md/null.c
734 qtdmdb_s=md/sparc_b.s
735 ;;
736 alpha-*-*)
737 port_name=alpha
738 qtmd_h=md/axp.h
739 qtmds_s=md/axp.s
740 qtmdc_c=md/null.c
741 qtdmdb_s=md/axp_b.s
742 ;;
743 *)
744 echo "Unknown configuration; threads package disabled"
745 THREAD_PACKAGE=""
746 ;;
747 esac
748 changequote([, ])
749
750 # Did configuration succeed?
751 if test -n "$THREAD_PACKAGE"; then
752 AC_MSG_RESULT($port_name)
753 QTHREAD_LTLIBS=libqthreads.la
754 THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
755 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
756 THREAD_LIBS_INSTALLED="-lqthreads"
757 else
758 AC_MSG_RESULT(none; disabled)
759 fi
760
761 AC_SUBST(QTHREAD_LTLIBS)
762 AC_SUBST(qtmd_h)
763 AC_SUBST(qtmds_s)
764 AC_SUBST(qtmdc_c)
765 AC_SUBST(qtdmdb_s)
766 AC_SUBST(qthread_asflags)
767 AC_SUBST(THREAD_PACKAGE)
768 AC_SUBST(THREAD_CPPFLAGS)
769 AC_SUBST(THREAD_LIBS_LOCAL)
770 AC_SUBST(THREAD_LIBS_INSTALLED)
771 ])
772