* validate.h (SCM_VALIDATE_INPUT_PORT, SCM_VALIDATE_OUTPUT_PORT):
[bpt/guile.git] / acinclude.m4
CommitLineData
3a629497
JB
1dnl On the NeXT, #including <utime.h> doesn't give you a definition for
2dnl struct utime, unless you #define _POSIX_SOURCE.
3
4AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
5 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
6 guile_cv_struct_utimbuf_needs_posix,
7 [AC_TRY_CPP([
8#ifdef __EMX__
9#include <sys/utime.h>
10#else
11#include <utime.h>
12#endif
13struct utime blah;
14],
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)
19 fi])
20
21
22
23
24dnl
25dnl Apparently, at CMU they have a weird version of libc.h that is
26dnl installed in /usr/local/include and conflicts with unistd.h.
27dnl In these situations, we should not #include libc.h.
28dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
29dnl present on the system, and is safe to #include.
30dnl
31AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
32 [
33 AC_CHECK_HEADERS(libc.h unistd.h)
34 AC_CACHE_CHECK(
35 "whether libc.h and unistd.h can be included together",
36 guile_cv_header_libc_with_unistd,
37 [
38 if test "$ac_cv_header_libc_h" = "no"; then
39 guile_cv_header_libc_with_unistd="no"
42d0ffc9 40 elif test "$ac_cv_header_unistd_h" = "no"; then
3a629497
JB
41 guile_cv_header_libc_with_unistd="yes"
42 else
43 AC_TRY_COMPILE(
44 [
45# include <libc.h>
46# include <unistd.h>
47 ],
48 [],
49 [guile_cv_header_libc_with_unistd=yes],
50 [guile_cv_header_libc_with_unistd=no]
51 )
52 fi
53 ]
54 )
55 if test "$guile_cv_header_libc_with_unistd" = yes; then
56 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
57 fi
58 ]
59)
0b89e78e
MD
60
61
62
63dnl This is needed when we want to check for the same function repeatedly
64dnl with other parameters, such as libraries, varying.
65dnl
66dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
67dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
68AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
69[AC_MSG_CHECKING([for $1])
70AC_CACHE_VAL(ac_cv_func_$1_$2,
71[AC_TRY_LINK(
72dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
73dnl which includes <sys/select.h> which contains a prototype for
74dnl select. Similarly for bzero.
75[/* System header to define __stub macros and hopefully few prototypes,
76 which can conflict with char $1(); below. */
77#include <assert.h>
78/* Override any gcc2 internal prototype to avoid an error. */
79]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
80extern "C"
81#endif
82])dnl
83[/* We use char because int might match the return type of a gcc2
84 builtin and then its argument prototype would still apply. */
85char $1();
86], [
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)
91choke me
92#else
93$1();
94#endif
95], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
96if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
97 AC_MSG_RESULT(yes)
98 ifelse([$3], , :, [$3])
99else
100 AC_MSG_RESULT(no)
101ifelse([$4], , , [$4
102])dnl
103fi
104])
2a0d7176
TP
105
106
eb9ef08b
MD
107dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
108dnl sources should be in $srcdir/qt. If configuration succeeds, this
109dnl macro creates the appropriate symlinks in the qt object directory,
110dnl and sets the following variables, used in building libqthreads.a:
111dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
112dnl succeeds, or the empty string if configuration fails.
113dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
114dnl dependent source files.
115dnl qthread_asflags --- flags to pass to the compiler when processing
116dnl assembly-language files.
117dnl
118dnl It also sets the following variables, which describe how clients
119dnl can link against libqthreads.a:
120dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
121dnl the empty string if configuration fails.
122dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
123dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
124dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
125dnl is installed
126dnl It would be nice if all thread configuration packages for Guile
127dnl followed the same conventions.
128dnl
129dnl All of the above variables will be substituted into Makefiles in
130dnl the usual autoconf fashion.
131dnl
132dnl We distinguish between THREAD_LIBS_LOCAL and
133dnl THREAD_LIBS_INSTALLED because the thread library might be in
134dnl this tree, and be built using libtool. This means that:
135dnl 1) when building other executables in this tree, one must
136dnl pass the relative path to the ../libfoo.la file, but
137dnl 2) once the whole package has been installed, users should
138dnl link using -lfoo.
139dnl Normally, we only care about the first case, but since the
140dnl guile-config script needs to give users all the flags they need
141dnl to link programs against guile, the GUILE_WITH_THREADS macro
142dnl needs to supply the second piece of information as well.
143dnl
144dnl This whole thing is a little confused about what ought to be
145dnl done in the top-level configure script, and what ought to be
146dnl taken care of in the subdirectory. For example, qtmds_s and
147dnl friends really ought not to be even mentioned in the top-level
148dnl configure script, but here they are.
149
150AC_DEFUN([QTHREADS_CONFIGURE],[
151 AC_REQUIRE([AC_PROG_LN_S])
152
153 AC_MSG_CHECKING(QuickThreads configuration)
154 # How can we refer to the qt source directory from within the qt build
155 # directory? For headers, we can rely on the fact that the qt src
156 # directory appears in the #include path.
157 qtsrcdir="`(cd $srcdir; pwd)`/qt"
158
159 changequote(,)dnl We use [ and ] in a regexp in the case
160
161 THREAD_PACKAGE=QT
162 qthread_asflags=''
163 case "$host" in
164 i[3456]86-*-*)
165 port_name=i386
166 qtmd_h=md/i386.h
167 qtmds_s=md/i386.s
168 qtmdc_c=md/null.c
169 qtdmdb_s=
170 case "$host" in
171 *-*-netbsd* )
172 ## NetBSD needs to be told to pass the assembly code through
173 ## the C preprocessor. Other GCC installations seem to do
174 ## this by default, but NetBSD's doesn't. We could get the
175 ## same effect by giving the file a name ending with .S
176 ## instead of .s, but I don't see how to tell automake to do
177 ## that.
178 qthread_asflags='-x assembler-with-cpp'
179 ;;
180 esac
181 ;;
182 mips-sgi-irix[56]*)
183 port_name=irix
184 qtmd_h=md/mips.h
185 qtmds_s=md/mips-irix5.s
186 qtmdc_c=md/null.c
187 qtdmdb_s=md/mips_b.s
188 ;;
189 mips-*-*)
190 port_name=mips
191 qtmd_h=md/mips.h
192 qtmds_s=md/mips.s
193 qtmdc_c=md/null.c
194 qtdmdb_s=md/mips_b.s
195 ;;
196 sparc-*-sunos*)
197 port_name=sparc-sunos
198 qtmd_h=md/sparc.h
199 qtmds_s=md/_sparc.s
200 qtmdc_c=md/null.c
201 qtdmdb_s=md/_sparc_b.s
202 ;;
203 sparc-*-*)
204 port_name=sparc
205 qtmd_h=md/sparc.h
206 qtmds_s=md/sparc.s
207 qtmdc_c=md/null.c
208 qtdmdb_s=md/sparc_b.s
209 ;;
6f9f0fb9 210 alpha*-*-*)
eb9ef08b
MD
211 port_name=alpha
212 qtmd_h=md/axp.h
213 qtmds_s=md/axp.s
214 qtmdc_c=md/null.c
215 qtdmdb_s=md/axp_b.s
216 ;;
217 *)
218 echo "Unknown configuration; threads package disabled"
219 THREAD_PACKAGE=""
220 ;;
221 esac
222 changequote([, ])
223
224 # Did configuration succeed?
225 if test -n "$THREAD_PACKAGE"; then
226 AC_MSG_RESULT($port_name)
227 QTHREAD_LTLIBS=libqthreads.la
228 THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
229 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
230 THREAD_LIBS_INSTALLED="-lqthreads"
231 else
232 AC_MSG_RESULT(none; disabled)
233 fi
234
235 AC_SUBST(QTHREAD_LTLIBS)
236 AC_SUBST(qtmd_h)
237 AC_SUBST(qtmds_s)
238 AC_SUBST(qtmdc_c)
239 AC_SUBST(qtdmdb_s)
240 AC_SUBST(qthread_asflags)
241 AC_SUBST(THREAD_PACKAGE)
242 AC_SUBST(THREAD_CPPFLAGS)
243 AC_SUBST(THREAD_LIBS_LOCAL)
244 AC_SUBST(THREAD_LIBS_INSTALLED)
245])
c96730b1
MV
246
247## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
248## Copyright (C) 1996-1999 Free Software Foundation, Inc.
249## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
250##
251## This program is free software; you can redistribute it and/or modify
252## it under the terms of the GNU General Public License as published by
253## the Free Software Foundation; either version 2 of the License, or
254## (at your option) any later version.
255##
256## This program is distributed in the hope that it will be useful, but
257## WITHOUT ANY WARRANTY; without even the implied warranty of
258## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
259## General Public License for more details.
260##
261## You should have received a copy of the GNU General Public License
262## along with this program; if not, write to the Free Software
263## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
264##
265## As a special exception to the GNU General Public License, if you
266## distribute this file as part of a program that contains a
267## configuration script generated by Autoconf, you may include it under
268## the same distribution terms that you use for the rest of that program.
269
270# serial 40 AC_PROG_LIBTOOL
271AC_DEFUN(AC_PROG_LIBTOOL,
272[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
273
274# Save cache, so that ltconfig can load it
275AC_CACHE_SAVE
276
277# Actually configure libtool. ac_aux_dir is where install-sh is found.
278CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
279LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
280LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
281DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
282${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
283$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
284|| AC_MSG_ERROR([libtool configure failed])
285
286# Reload cache, that may have been modified by ltconfig
287AC_CACHE_LOAD
288
289# This can be used to rebuild libtool when needed
290LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
291
292# Always use our own libtool.
293LIBTOOL='$(SHELL) $(top_builddir)/libtool'
294AC_SUBST(LIBTOOL)dnl
295
296# Redirect the config.log output again, so that the ltconfig log is not
297# clobbered by the next message.
298exec 5>>./config.log
299])
300
301AC_DEFUN(AC_LIBTOOL_SETUP,
302[AC_PREREQ(2.13)dnl
303AC_REQUIRE([AC_ENABLE_SHARED])dnl
304AC_REQUIRE([AC_ENABLE_STATIC])dnl
305AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
306AC_REQUIRE([AC_CANONICAL_HOST])dnl
307AC_REQUIRE([AC_CANONICAL_BUILD])dnl
308AC_REQUIRE([AC_PROG_RANLIB])dnl
309AC_REQUIRE([AC_PROG_CC])dnl
310AC_REQUIRE([AC_PROG_LD])dnl
311AC_REQUIRE([AC_PROG_NM])dnl
312AC_REQUIRE([AC_PROG_LN_S])dnl
313dnl
314
315case "$target" in
316NONE) lt_target="$host" ;;
317*) lt_target="$target" ;;
318esac
319
320# Check for any special flags to pass to ltconfig.
321libtool_flags="--cache-file=$cache_file"
322test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
323test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
324test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
325test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
326test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
327ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
328[libtool_flags="$libtool_flags --enable-dlopen"])
329ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
330[libtool_flags="$libtool_flags --enable-win32-dll"])
331AC_ARG_ENABLE(libtool-lock,
332 [ --disable-libtool-lock avoid locking (might break parallel builds)])
333test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
334test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
335
336# Some flags need to be propagated to the compiler or linker for good
337# libtool support.
338case "$lt_target" in
339*-*-irix6*)
340 # Find out which ABI we are using.
341 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
342 if AC_TRY_EVAL(ac_compile); then
343 case "`/usr/bin/file conftest.o`" in
344 *32-bit*)
345 LD="${LD-ld} -32"
346 ;;
347 *N32*)
348 LD="${LD-ld} -n32"
349 ;;
350 *64-bit*)
351 LD="${LD-ld} -64"
352 ;;
353 esac
354 fi
355 rm -rf conftest*
356 ;;
357
358*-*-sco3.2v5*)
359 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
360 SAVE_CFLAGS="$CFLAGS"
361 CFLAGS="$CFLAGS -belf"
362 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
363 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
364 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
365 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
366 CFLAGS="$SAVE_CFLAGS"
367 fi
368 ;;
369
370ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
371[*-*-cygwin* | *-*-mingw*)
372 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
373 AC_CHECK_TOOL(AS, as, false)
374 AC_CHECK_TOOL(OBJDUMP, objdump, false)
375 ;;
376])
377esac
378])
379
380# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
381AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
382
383# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
384AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
385
386# AC_ENABLE_SHARED - implement the --enable-shared flag
387# Usage: AC_ENABLE_SHARED[(DEFAULT)]
388# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
389# `yes'.
390AC_DEFUN(AC_ENABLE_SHARED, [dnl
391define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
392AC_ARG_ENABLE(shared,
393changequote(<<, >>)dnl
394<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
395changequote([, ])dnl
396[p=${PACKAGE-default}
397case "$enableval" in
398yes) enable_shared=yes ;;
399no) enable_shared=no ;;
400*)
401 enable_shared=no
402 # Look at the argument we got. We use all the common list separators.
403 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
404 for pkg in $enableval; do
405 if test "X$pkg" = "X$p"; then
406 enable_shared=yes
407 fi
408 done
409 IFS="$ac_save_ifs"
410 ;;
411esac],
412enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
413])
414
415# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
416AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
417AC_ENABLE_SHARED(no)])
418
419# AC_ENABLE_STATIC - implement the --enable-static flag
420# Usage: AC_ENABLE_STATIC[(DEFAULT)]
421# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
422# `yes'.
423AC_DEFUN(AC_ENABLE_STATIC, [dnl
424define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
425AC_ARG_ENABLE(static,
426changequote(<<, >>)dnl
427<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
428changequote([, ])dnl
429[p=${PACKAGE-default}
430case "$enableval" in
431yes) enable_static=yes ;;
432no) enable_static=no ;;
433*)
434 enable_static=no
435 # Look at the argument we got. We use all the common list separators.
436 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
437 for pkg in $enableval; do
438 if test "X$pkg" = "X$p"; then
439 enable_static=yes
440 fi
441 done
442 IFS="$ac_save_ifs"
443 ;;
444esac],
445enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
446])
447
448# AC_DISABLE_STATIC - set the default static flag to --disable-static
449AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
450AC_ENABLE_STATIC(no)])
451
452
453# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
454# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
455# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
456# `yes'.
457AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
458define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
459AC_ARG_ENABLE(fast-install,
460changequote(<<, >>)dnl
461<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
462changequote([, ])dnl
463[p=${PACKAGE-default}
464case "$enableval" in
465yes) enable_fast_install=yes ;;
466no) enable_fast_install=no ;;
467*)
468 enable_fast_install=no
469 # Look at the argument we got. We use all the common list separators.
470 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
471 for pkg in $enableval; do
472 if test "X$pkg" = "X$p"; then
473 enable_fast_install=yes
474 fi
475 done
476 IFS="$ac_save_ifs"
477 ;;
478esac],
479enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
480])
481
482# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
483AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
484AC_ENABLE_FAST_INSTALL(no)])
485
486# AC_PROG_LD - find the path to the GNU or non-GNU linker
487AC_DEFUN(AC_PROG_LD,
488[AC_ARG_WITH(gnu-ld,
489[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
490test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
491AC_REQUIRE([AC_PROG_CC])dnl
492AC_REQUIRE([AC_CANONICAL_HOST])dnl
493AC_REQUIRE([AC_CANONICAL_BUILD])dnl
494ac_prog=ld
495if test "$ac_cv_prog_gcc" = yes; then
496 # Check if gcc -print-prog-name=ld gives a path.
497 AC_MSG_CHECKING([for ld used by GCC])
498 ac_prog=`($CC -print-prog-name=ld) 2>&5`
499 case "$ac_prog" in
500 # Accept absolute paths.
501changequote(,)dnl
502 [\\/]* | [A-Za-z]:[\\/]*)
503 re_direlt='/[^/][^/]*/\.\./'
504changequote([,])dnl
505 # Canonicalize the path of ld
506 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
507 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
508 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
509 done
510 test -z "$LD" && LD="$ac_prog"
511 ;;
512 "")
513 # If it fails, then pretend we aren't using GCC.
514 ac_prog=ld
515 ;;
516 *)
517 # If it is relative, then search for the first ld in PATH.
518 with_gnu_ld=unknown
519 ;;
520 esac
521elif test "$with_gnu_ld" = yes; then
522 AC_MSG_CHECKING([for GNU ld])
523else
524 AC_MSG_CHECKING([for non-GNU ld])
525fi
526AC_CACHE_VAL(ac_cv_path_LD,
527[if test -z "$LD"; then
528 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
529 for ac_dir in $PATH; do
530 test -z "$ac_dir" && ac_dir=.
531 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
532 ac_cv_path_LD="$ac_dir/$ac_prog"
533 # Check to see if the program is GNU ld. I'd rather use --version,
534 # but apparently some GNU ld's only accept -v.
535 # Break only if it was the GNU/non-GNU ld that we prefer.
536 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
537 test "$with_gnu_ld" != no && break
538 else
539 test "$with_gnu_ld" != yes && break
540 fi
541 fi
542 done
543 IFS="$ac_save_ifs"
544else
545 ac_cv_path_LD="$LD" # Let the user override the test with a path.
546fi])
547LD="$ac_cv_path_LD"
548if test -n "$LD"; then
549 AC_MSG_RESULT($LD)
550else
551 AC_MSG_RESULT(no)
552fi
553test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
554AC_PROG_LD_GNU
555])
556
557AC_DEFUN(AC_PROG_LD_GNU,
558[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
559[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
560if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
561 ac_cv_prog_gnu_ld=yes
562else
563 ac_cv_prog_gnu_ld=no
564fi])
565])
566
567# AC_PROG_NM - find the path to a BSD-compatible name lister
568AC_DEFUN(AC_PROG_NM,
569[AC_MSG_CHECKING([for BSD-compatible nm])
570AC_CACHE_VAL(ac_cv_path_NM,
571[if test -n "$NM"; then
572 # Let the user override the test.
573 ac_cv_path_NM="$NM"
574else
575 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
576 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
577 test -z "$ac_dir" && ac_dir=.
578 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
579 # Check to see if the nm accepts a BSD-compat flag.
580 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
581 # nm: unknown option "B" ignored
582 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
583 ac_cv_path_NM="$ac_dir/nm -B"
584 break
585 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
586 ac_cv_path_NM="$ac_dir/nm -p"
587 break
588 else
589 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
590 continue # so that we can try to find one that supports BSD flags
591 fi
592 fi
593 done
594 IFS="$ac_save_ifs"
595 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
596fi])
597NM="$ac_cv_path_NM"
598AC_MSG_RESULT([$NM])
599])
600
601# AC_CHECK_LIBM - check for math library
602AC_DEFUN(AC_CHECK_LIBM,
603[AC_REQUIRE([AC_CANONICAL_HOST])dnl
604LIBM=
605case "$lt_target" in
606*-*-beos* | *-*-cygwin*)
607 # These system don't have libm
608 ;;
609*-ncr-sysv4.3*)
610 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
611 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
612 ;;
613*)
614 AC_CHECK_LIB(m, main, LIBM="-lm")
615 ;;
616esac
617])
618
619# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
620# the libltdl convenience library, adds --enable-ltdl-convenience to
621# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
622# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
623# to be `${top_builddir}/libltdl'. Make sure you start DIR with
624# '${top_builddir}/' (note the single quotes!) if your package is not
625# flat, and, if you're not using automake, define top_builddir as
626# appropriate in the Makefiles.
627AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
628 case "$enable_ltdl_convenience" in
629 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
630 "") enable_ltdl_convenience=yes
631 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
632 esac
633 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
6d2568e5 634 INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
c96730b1
MV
635])
636
637# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
638# the libltdl installable library, and adds --enable-ltdl-install to
639# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
640# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
641# to be `${top_builddir}/libltdl'. Make sure you start DIR with
642# '${top_builddir}/' (note the single quotes!) if your package is not
643# flat, and, if you're not using automake, define top_builddir as
644# appropriate in the Makefiles.
645# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
646AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
647 AC_CHECK_LIB(ltdl, main,
648 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
649 [if test x"$enable_ltdl_install" = xno; then
650 AC_MSG_WARN([libltdl not installed, but installation disabled])
651 else
652 enable_ltdl_install=yes
653 fi
654 ])
655 if test x"$enable_ltdl_install" = x"yes"; then
656 ac_configure_args="$ac_configure_args --enable-ltdl-install"
657 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
658 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
659 else
660 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
661 LIBLTDL="-lltdl"
662 INCLTDL=
663 fi
664])
665
666dnl old names
667AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
668AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
669AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
670AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
671AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
672AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
673AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
674
675dnl This is just to silence aclocal about the macro not being used
676ifelse([AC_DISABLE_FAST_INSTALL])dnl