1 dnl On the NeXT, #including <utime.h> doesn't give you a definition for
2 dnl struct utime, unless you #define _POSIX_SOURCE.
4 AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
5 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
6 guile_cv_struct_utimbuf_needs_posix,
15 guile_cv_struct_utimbuf_needs_posix=no,
16 guile_cv_struct_utimbuf_needs_posix=yes)])
17 if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
18 AC_DEFINE(UTIMBUF_NEEDS_POSIX)
25 dnl Apparently, at CMU they have a weird version of libc.h that is
26 dnl installed in /usr/local/include and conflicts with unistd.h.
27 dnl In these situations, we should not #include libc.h.
28 dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
29 dnl present on the system, and is safe to #include.
31 AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
33 AC_CHECK_HEADERS(libc.h unistd.h)
35 "whether libc.h and unistd.h can be included together",
36 guile_cv_header_libc_with_unistd,
38 if test "$ac_cv_header_libc_h" = "no"; then
39 guile_cv_header_libc_with_unistd="no"
40 elif test "$ac_cv_header_unistd_h" = "no"; then
41 guile_cv_header_libc_with_unistd="yes"
49 [guile_cv_header_libc_with_unistd=yes],
50 [guile_cv_header_libc_with_unistd=no]
55 if test "$guile_cv_header_libc_with_unistd" = yes; then
56 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
63 dnl This is needed when we want to check for the same function repeatedly
64 dnl with other parameters, such as libraries, varying.
66 dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
67 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
68 AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
69 [AC_MSG_CHECKING([for $1])
70 AC_CACHE_VAL(ac_cv_func_$1_$2,
72 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
73 dnl which includes <sys/select.h> which contains a prototype for
74 dnl select. Similarly for bzero.
75 [/* System header to define __stub macros and hopefully few prototypes,
76 which can conflict with char $1(); below. */
78 /* Override any gcc2 internal prototype to avoid an error. */
79 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
83 [/* We use char because int might match the return type of a gcc2
84 builtin and then its argument prototype would still apply. */
87 /* The GNU C library defines this for functions which it implements
88 to always fail with ENOSYS. Some functions are actually named
89 something starting with __ and the normal name is an alias. */
90 #if defined (__stub_$1) || defined (__stub___$1)
95 ], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
96 if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
98 ifelse([$3], , :, [$3])
107 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
108 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
109 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
111 ## This program is free software; you can redistribute it and/or modify
112 ## it under the terms of the GNU General Public License as published by
113 ## the Free Software Foundation; either version 2 of the License, or
114 ## (at your option) any later version.
116 ## This program is distributed in the hope that it will be useful, but
117 ## WITHOUT ANY WARRANTY; without even the implied warranty of
118 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
119 ## General Public License for more details.
121 ## You should have received a copy of the GNU General Public License
122 ## along with this program; if not, write to the Free Software
123 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
125 ## As a special exception to the GNU General Public License, if you
126 ## distribute this file as part of a program that contains a
127 ## configuration script generated by Autoconf, you may include it under
128 ## the same distribution terms that you use for the rest of that program.
130 # serial 40 AC_PROG_LIBTOOL
131 AC_DEFUN(AC_PROG_LIBTOOL,
132 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
134 # Save cache, so that ltconfig can load it
137 # Actually configure libtool. ac_aux_dir is where install-sh is found.
138 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
139 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
140 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
141 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
142 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
143 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
144 || AC_MSG_ERROR([libtool configure failed])
146 # Reload cache, that may have been modified by ltconfig
149 # This can be used to rebuild libtool when needed
150 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
152 # Always use our own libtool.
153 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
156 # Redirect the config.log output again, so that the ltconfig log is not
157 # clobbered by the next message.
161 AC_DEFUN(AC_LIBTOOL_SETUP,
163 AC_REQUIRE([AC_ENABLE_SHARED])dnl
164 AC_REQUIRE([AC_ENABLE_STATIC])dnl
165 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
166 AC_REQUIRE([AC_CANONICAL_HOST])dnl
167 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
168 AC_REQUIRE([AC_PROG_RANLIB])dnl
169 AC_REQUIRE([AC_PROG_CC])dnl
170 AC_REQUIRE([AC_PROG_LD])dnl
171 AC_REQUIRE([AC_PROG_NM])dnl
172 AC_REQUIRE([AC_PROG_LN_S])dnl
176 NONE) lt_target="$host" ;;
177 *) lt_target="$target" ;;
180 # Check for any special flags to pass to ltconfig.
181 libtool_flags="--cache-file=$cache_file"
182 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
183 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
184 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
185 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
186 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
187 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
188 [libtool_flags="$libtool_flags --enable-dlopen"])
189 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
190 [libtool_flags="$libtool_flags --enable-win32-dll"])
191 AC_ARG_ENABLE(libtool-lock,
192 [ --disable-libtool-lock avoid locking (might break parallel builds)])
193 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
194 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
196 # Some flags need to be propagated to the compiler or linker for good
200 # Find out which ABI we are using.
201 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
202 if AC_TRY_EVAL(ac_compile); then
203 case "`/usr/bin/file conftest.o`" in
219 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
220 SAVE_CFLAGS="$CFLAGS"
221 CFLAGS="$CFLAGS -belf"
222 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
223 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
224 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
225 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
226 CFLAGS="$SAVE_CFLAGS"
230 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
231 [*-*-cygwin* | *-*-mingw*)
232 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
233 AC_CHECK_TOOL(AS, as, false)
234 AC_CHECK_TOOL(OBJDUMP, objdump, false)
240 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
241 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
243 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
244 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
246 # AC_ENABLE_SHARED - implement the --enable-shared flag
247 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
248 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
250 AC_DEFUN(AC_ENABLE_SHARED, [dnl
251 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
252 AC_ARG_ENABLE(shared,
253 changequote(<<, >>)dnl
254 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
256 [p=${PACKAGE-default}
258 yes) enable_shared=yes ;;
259 no) enable_shared=no ;;
262 # Look at the argument we got. We use all the common list separators.
263 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
264 for pkg in $enableval; do
265 if test "X$pkg" = "X$p"; then
272 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
275 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
276 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
277 AC_ENABLE_SHARED(no)])
279 # AC_ENABLE_STATIC - implement the --enable-static flag
280 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
281 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
283 AC_DEFUN(AC_ENABLE_STATIC, [dnl
284 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
285 AC_ARG_ENABLE(static,
286 changequote(<<, >>)dnl
287 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
289 [p=${PACKAGE-default}
291 yes) enable_static=yes ;;
292 no) enable_static=no ;;
295 # Look at the argument we got. We use all the common list separators.
296 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
297 for pkg in $enableval; do
298 if test "X$pkg" = "X$p"; then
305 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
308 # AC_DISABLE_STATIC - set the default static flag to --disable-static
309 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
310 AC_ENABLE_STATIC(no)])
313 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
314 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
315 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
317 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
318 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
319 AC_ARG_ENABLE(fast-install,
320 changequote(<<, >>)dnl
321 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
323 [p=${PACKAGE-default}
325 yes) enable_fast_install=yes ;;
326 no) enable_fast_install=no ;;
328 enable_fast_install=no
329 # Look at the argument we got. We use all the common list separators.
330 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
331 for pkg in $enableval; do
332 if test "X$pkg" = "X$p"; then
333 enable_fast_install=yes
339 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
342 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
343 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
344 AC_ENABLE_FAST_INSTALL(no)])
346 # AC_PROG_LD - find the path to the GNU or non-GNU linker
349 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
350 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
351 AC_REQUIRE([AC_PROG_CC])dnl
352 AC_REQUIRE([AC_CANONICAL_HOST])dnl
353 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
355 if test "$ac_cv_prog_gcc" = yes; then
356 # Check if gcc -print-prog-name=ld gives a path.
357 AC_MSG_CHECKING([for ld used by GCC])
358 ac_prog=`($CC -print-prog-name=ld) 2>&5`
360 # Accept absolute paths.
362 [\\/]* | [A-Za-z]:[\\/]*)
363 re_direlt='/[^/][^/]*/\.\./'
365 # Canonicalize the path of ld
366 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
367 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
368 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
370 test -z "$LD" && LD="$ac_prog"
373 # If it fails, then pretend we aren't using GCC.
377 # If it is relative, then search for the first ld in PATH.
381 elif test "$with_gnu_ld" = yes; then
382 AC_MSG_CHECKING([for GNU ld])
384 AC_MSG_CHECKING([for non-GNU ld])
386 AC_CACHE_VAL(ac_cv_path_LD,
387 [if test -z "$LD"; then
388 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
389 for ac_dir in $PATH; do
390 test -z "$ac_dir" && ac_dir=.
391 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
392 ac_cv_path_LD="$ac_dir/$ac_prog"
393 # Check to see if the program is GNU ld. I'd rather use --version,
394 # but apparently some GNU ld's only accept -v.
395 # Break only if it was the GNU/non-GNU ld that we prefer.
396 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
397 test "$with_gnu_ld" != no && break
399 test "$with_gnu_ld" != yes && break
405 ac_cv_path_LD="$LD" # Let the user override the test with a path.
408 if test -n "$LD"; then
413 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
417 AC_DEFUN(AC_PROG_LD_GNU,
418 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
419 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
420 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
421 ac_cv_prog_gnu_ld=yes
427 # AC_PROG_NM - find the path to a BSD-compatible name lister
429 [AC_MSG_CHECKING([for BSD-compatible nm])
430 AC_CACHE_VAL(ac_cv_path_NM,
431 [if test -n "$NM"; then
432 # Let the user override the test.
435 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
436 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
437 test -z "$ac_dir" && ac_dir=.
438 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
439 # Check to see if the nm accepts a BSD-compat flag.
440 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
441 # nm: unknown option "B" ignored
442 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
443 ac_cv_path_NM="$ac_dir/nm -B"
445 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
446 ac_cv_path_NM="$ac_dir/nm -p"
449 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
450 continue # so that we can try to find one that supports BSD flags
455 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
461 # AC_CHECK_LIBM - check for math library
462 AC_DEFUN(AC_CHECK_LIBM,
463 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
466 *-*-beos* | *-*-cygwin*)
467 # These system don't have libm
470 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
471 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
474 AC_CHECK_LIB(m, main, LIBM="-lm")
479 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
480 # the libltdl convenience library, adds --enable-ltdl-convenience to
481 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
482 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
483 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
484 # '${top_builddir}/' (note the single quotes!) if your package is not
485 # flat, and, if you're not using automake, define top_builddir as
486 # appropriate in the Makefiles.
487 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
488 case "$enable_ltdl_convenience" in
489 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
490 "") enable_ltdl_convenience=yes
491 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
493 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
494 INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
497 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
498 # the libltdl installable library, and adds --enable-ltdl-install to
499 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
500 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
501 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
502 # '${top_builddir}/' (note the single quotes!) if your package is not
503 # flat, and, if you're not using automake, define top_builddir as
504 # appropriate in the Makefiles.
505 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
506 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
507 AC_CHECK_LIB(ltdl, main,
508 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
509 [if test x"$enable_ltdl_install" = xno; then
510 AC_MSG_WARN([libltdl not installed, but installation disabled])
512 enable_ltdl_install=yes
515 if test x"$enable_ltdl_install" = x"yes"; then
516 ac_configure_args="$ac_configure_args --enable-ltdl-install"
517 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
518 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
520 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
527 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
528 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
529 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
530 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
531 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
532 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
533 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
535 dnl This is just to silence aclocal about the macro not being used
536 ifelse([AC_DISABLE_FAST_INSTALL])dnl