blob: e3726759ee2d2e6c79edf6c115e780ee3eaa5c1e [file] [log] [blame]
Daniel Veillard5edcc932000-10-15 21:43:03 +00001dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl Like AC_TRY_EVAL but also errors out if the compiler generates
14dnl _any_ output. Some compilers might issue warnings which we want
15dnl to catch.
16AC_DEFUN(AC_TRY_EVAL2,
17[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
18(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
19
20dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
21AC_DEFUN(AC_TRY_COMPILE2,
22[cat > conftest.$ac_ext <<EOF
23[#]line __oline__ "configure"
24#include "confdefs.h"
25[$1]
26int main() {
27[$2]
28; return 0; }
29EOF
30if AC_TRY_EVAL2(ac_compile); then
31 ifelse([$3], , :, [rm -rf conftest*
32 $3])
33else
34 echo "configure: failed program was:" >&AC_FD_CC
35 cat conftest.$ac_ext >&AC_FD_CC
36ifelse([$4], , , [ rm -rf conftest*
37 $4
38])dnl
39fi
40rm -f conftest*])
41
42# Like AC_CONFIG_HEADER, but automatically create stamp file.
43
44AC_DEFUN(AM_CONFIG_HEADER,
45[AC_PREREQ([2.12])
46AC_CONFIG_HEADER([$1])
47dnl When config.status generates a header, we must update the stamp-h file.
48dnl This file resides in the same directory as the config header
49dnl that is generated. We must strip everything past the first ":",
50dnl and everything past the last "/".
51AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
52ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
53<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
54<<am_indx=1
55for am_file in <<$1>>; do
56 case " <<$>>CONFIG_HEADERS " in
57 *" <<$>>am_file "*<<)>>
58 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
59 ;;
60 esac
61 am_indx=`expr "<<$>>am_indx" + 1`
62done<<>>dnl>>)
63changequote([,]))])
64
65# Do all the work for Automake. This macro actually does too much --
66# some checks are only needed if your package does certain things.
67# But this isn't really a big deal.
68
69# serial 1
70
71dnl Usage:
72dnl AM_INIT_AUTOMAKE(package,version, [no-define])
73
74AC_DEFUN(AM_INIT_AUTOMAKE,
75[AC_REQUIRE([AC_PROG_INSTALL])
76PACKAGE=[$1]
77AC_SUBST(PACKAGE)
78VERSION=[$2]
79AC_SUBST(VERSION)
80dnl test to see if srcdir already configured
81if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
82 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
83fi
84ifelse([$3],,
85AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
86AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
87AC_REQUIRE([AM_SANITY_CHECK])
88AC_REQUIRE([AC_ARG_PROGRAM])
89dnl FIXME This is truly gross.
90missing_dir=`cd $ac_aux_dir && pwd`
91AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
92AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
93AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
94AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
95AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
96AC_REQUIRE([AC_PROG_MAKE_SET])])
97
98#
99# Check to make sure that the build environment is sane.
100#
101
102AC_DEFUN(AM_SANITY_CHECK,
103[AC_MSG_CHECKING([whether build environment is sane])
104# Just in case
105sleep 1
106echo timestamp > conftestfile
107# Do `set' in a subshell so we don't clobber the current shell's
108# arguments. Must try -L first in case configure is actually a
109# symlink; some systems play weird games with the mod time of symlinks
110# (eg FreeBSD returns the mod time of the symlink's containing
111# directory).
112if (
113 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
114 if test "[$]*" = "X"; then
115 # -L didn't work.
116 set X `ls -t $srcdir/configure conftestfile`
117 fi
118 if test "[$]*" != "X $srcdir/configure conftestfile" \
119 && test "[$]*" != "X conftestfile $srcdir/configure"; then
120
121 # If neither matched, then we have a broken ls. This can happen
122 # if, for instance, CONFIG_SHELL is bash and it inherits a
123 # broken ls alias from the environment. This has actually
124 # happened. Such a system could not be considered "sane".
125 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
126alias in your environment])
127 fi
128
129 test "[$]2" = conftestfile
130 )
131then
132 # Ok.
133 :
134else
135 AC_MSG_ERROR([newly created file is older than distributed files!
136Check your system clock])
137fi
138rm -f conftest*
139AC_MSG_RESULT(yes)])
140
141dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
142dnl The program must properly implement --version.
143AC_DEFUN(AM_MISSING_PROG,
144[AC_MSG_CHECKING(for working $2)
145# Run test in a subshell; some versions of sh will print an error if
146# an executable is not found, even if stderr is redirected.
147# Redirect stdin to placate older versions of autoconf. Sigh.
148if ($2 --version) < /dev/null > /dev/null 2>&1; then
149 $1=$2
150 AC_MSG_RESULT(found)
151else
152 $1="$3/missing $2"
153 AC_MSG_RESULT(missing)
154fi
155AC_SUBST($1)])
156
157
158# serial 1
159
160AC_DEFUN(AM_C_PROTOTYPES,
161[AC_REQUIRE([AM_PROG_CC_STDC])
162AC_REQUIRE([AC_PROG_CPP])
163AC_MSG_CHECKING([for function prototypes])
164if test "$am_cv_prog_cc_stdc" != no; then
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
167 U= ANSI2KNR=
168else
169 AC_MSG_RESULT(no)
170 U=_ ANSI2KNR=./ansi2knr
171 # Ensure some checks needed by ansi2knr itself.
172 AC_HEADER_STDC
173 AC_CHECK_HEADERS(string.h)
174fi
175AC_SUBST(U)dnl
176AC_SUBST(ANSI2KNR)dnl
177])
178
179
180# serial 1
181
182# @defmac AC_PROG_CC_STDC
183# @maindex PROG_CC_STDC
184# @ovindex CC
185# If the C compiler in not in ANSI C mode by default, try to add an option
186# to output variable @code{CC} to make it so. This macro tries various
187# options that select ANSI C on some system or another. It considers the
188# compiler to be in ANSI C mode if it handles function prototypes correctly.
189#
190# If you use this macro, you should check after calling it whether the C
191# compiler has been set to accept ANSI C; if not, the shell variable
192# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
193# code in ANSI C, you can make an un-ANSIfied copy of it by using the
194# program @code{ansi2knr}, which comes with Ghostscript.
195# @end defmac
196
197AC_DEFUN(AM_PROG_CC_STDC,
198[AC_REQUIRE([AC_PROG_CC])
199AC_BEFORE([$0], [AC_C_INLINE])
200AC_BEFORE([$0], [AC_C_CONST])
201dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
202dnl a magic option to avoid problems with ANSI preprocessor commands
203dnl like #elif.
204dnl FIXME: can't do this because then AC_AIX won't work due to a
205dnl circular dependency.
206dnl AC_BEFORE([$0], [AC_PROG_CPP])
207AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
208AC_CACHE_VAL(am_cv_prog_cc_stdc,
209[am_cv_prog_cc_stdc=no
210ac_save_CC="$CC"
211# Don't try gcc -ansi; that turns off useful extensions and
212# breaks some systems' header files.
213# AIX -qlanglvl=ansi
214# Ultrix and OSF/1 -std1
215# HP-UX -Aa -D_HPUX_SOURCE
216# SVR4 -Xc -D__EXTENSIONS__
217for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
218do
219 CC="$ac_save_CC $ac_arg"
220 AC_TRY_COMPILE(
221[#include <stdarg.h>
222#include <stdio.h>
223#include <sys/types.h>
224#include <sys/stat.h>
225/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
226struct buf { int x; };
227FILE * (*rcsopen) (struct buf *, struct stat *, int);
228static char *e (p, i)
229 char **p;
230 int i;
231{
232 return p[i];
233}
234static char *f (char * (*g) (char **, int), char **p, ...)
235{
236 char *s;
237 va_list v;
238 va_start (v,p);
239 s = g (p, va_arg (v,int));
240 va_end (v);
241 return s;
242}
243int test (int i, double x);
244struct s1 {int (*f) (int a);};
245struct s2 {int (*f) (double a);};
246int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
247int argc;
248char **argv;
249], [
250return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
251],
252[am_cv_prog_cc_stdc="$ac_arg"; break])
253done
254CC="$ac_save_CC"
255])
256if test -z "$am_cv_prog_cc_stdc"; then
257 AC_MSG_RESULT([none needed])
258else
259 AC_MSG_RESULT($am_cv_prog_cc_stdc)
260fi
261case "x$am_cv_prog_cc_stdc" in
262 x|xno) ;;
263 *) CC="$CC $am_cv_prog_cc_stdc" ;;
264esac
265])
266
267
268# serial 40 AC_PROG_LIBTOOL
269AC_DEFUN(AC_PROG_LIBTOOL,
270[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
271
272# Save cache, so that ltconfig can load it
273AC_CACHE_SAVE
274
275# Actually configure libtool. ac_aux_dir is where install-sh is found.
276CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
277LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
278LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
279DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
280${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
281$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
282|| AC_MSG_ERROR([libtool configure failed])
283
284# Reload cache, that may have been modified by ltconfig
285AC_CACHE_LOAD
286
287# This can be used to rebuild libtool when needed
288LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
289
290# Always use our own libtool.
291LIBTOOL='$(SHELL) $(top_builddir)/libtool'
292AC_SUBST(LIBTOOL)dnl
293
294# Redirect the config.log output again, so that the ltconfig log is not
295# clobbered by the next message.
296exec 5>>./config.log
297])
298
299AC_DEFUN(AC_LIBTOOL_SETUP,
300[AC_PREREQ(2.13)dnl
301AC_REQUIRE([AC_ENABLE_SHARED])dnl
302AC_REQUIRE([AC_ENABLE_STATIC])dnl
303AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
304AC_REQUIRE([AC_CANONICAL_HOST])dnl
305AC_REQUIRE([AC_CANONICAL_BUILD])dnl
306AC_REQUIRE([AC_PROG_RANLIB])dnl
307AC_REQUIRE([AC_PROG_CC])dnl
308AC_REQUIRE([AC_PROG_LD])dnl
309AC_REQUIRE([AC_PROG_NM])dnl
310AC_REQUIRE([AC_PROG_LN_S])dnl
311dnl
312
313case "$target" in
314NONE) lt_target="$host" ;;
315*) lt_target="$target" ;;
316esac
317
318# Check for any special flags to pass to ltconfig.
319#
320# the following will cause an existing older ltconfig to fail, so
321# we ignore this at the expense of the cache file... Checking this
322# will just take longer ... bummer!
323#libtool_flags="--cache-file=$cache_file"
324#
325test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
326test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
327test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
328test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
329test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
330ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
331[libtool_flags="$libtool_flags --enable-dlopen"])
332ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
333[libtool_flags="$libtool_flags --enable-win32-dll"])
334AC_ARG_ENABLE(libtool-lock,
335 [ --disable-libtool-lock avoid locking (might break parallel builds)])
336test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
337test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
338
339# Some flags need to be propagated to the compiler or linker for good
340# libtool support.
341case "$lt_target" in
342*-*-irix6*)
343 # Find out which ABI we are using.
344 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
345 if AC_TRY_EVAL(ac_compile); then
346 case "`/usr/bin/file conftest.o`" in
347 *32-bit*)
348 LD="${LD-ld} -32"
349 ;;
350 *N32*)
351 LD="${LD-ld} -n32"
352 ;;
353 *64-bit*)
354 LD="${LD-ld} -64"
355 ;;
356 esac
357 fi
358 rm -rf conftest*
359 ;;
360
361*-*-sco3.2v5*)
362 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
363 SAVE_CFLAGS="$CFLAGS"
364 CFLAGS="$CFLAGS -belf"
365 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
366 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
367 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
368 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
369 CFLAGS="$SAVE_CFLAGS"
370 fi
371 ;;
372
373ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
374[*-*-cygwin* | *-*-mingw*)
375 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
376 AC_CHECK_TOOL(AS, as, false)
377 AC_CHECK_TOOL(OBJDUMP, objdump, false)
378 ;;
379])
380esac
381])
382
383# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
384AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
385
386# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
387AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
388
389# AC_ENABLE_SHARED - implement the --enable-shared flag
390# Usage: AC_ENABLE_SHARED[(DEFAULT)]
391# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
392# `yes'.
393AC_DEFUN(AC_ENABLE_SHARED, [dnl
394define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
395AC_ARG_ENABLE(shared,
396changequote(<<, >>)dnl
397<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
398changequote([, ])dnl
399[p=${PACKAGE-default}
400case "$enableval" in
401yes) enable_shared=yes ;;
402no) enable_shared=no ;;
403*)
404 enable_shared=no
405 # Look at the argument we got. We use all the common list separators.
406 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
407 for pkg in $enableval; do
408 if test "X$pkg" = "X$p"; then
409 enable_shared=yes
410 fi
411 done
412 IFS="$ac_save_ifs"
413 ;;
414esac],
415enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
416])
417
418# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
419AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
420AC_ENABLE_SHARED(no)])
421
422# AC_ENABLE_STATIC - implement the --enable-static flag
423# Usage: AC_ENABLE_STATIC[(DEFAULT)]
424# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
425# `yes'.
426AC_DEFUN(AC_ENABLE_STATIC, [dnl
427define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
428AC_ARG_ENABLE(static,
429changequote(<<, >>)dnl
430<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
431changequote([, ])dnl
432[p=${PACKAGE-default}
433case "$enableval" in
434yes) enable_static=yes ;;
435no) enable_static=no ;;
436*)
437 enable_static=no
438 # Look at the argument we got. We use all the common list separators.
439 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
440 for pkg in $enableval; do
441 if test "X$pkg" = "X$p"; then
442 enable_static=yes
443 fi
444 done
445 IFS="$ac_save_ifs"
446 ;;
447esac],
448enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
449])
450
451# AC_DISABLE_STATIC - set the default static flag to --disable-static
452AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
453AC_ENABLE_STATIC(no)])
454
455
456# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
457# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
458# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
459# `yes'.
460AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
461define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
462AC_ARG_ENABLE(fast-install,
463changequote(<<, >>)dnl
464<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
465changequote([, ])dnl
466[p=${PACKAGE-default}
467case "$enableval" in
468yes) enable_fast_install=yes ;;
469no) enable_fast_install=no ;;
470*)
471 enable_fast_install=no
472 # Look at the argument we got. We use all the common list separators.
473 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
474 for pkg in $enableval; do
475 if test "X$pkg" = "X$p"; then
476 enable_fast_install=yes
477 fi
478 done
479 IFS="$ac_save_ifs"
480 ;;
481esac],
482enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
483])
484
485# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
486AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
487AC_ENABLE_FAST_INSTALL(no)])
488
489# AC_PROG_LD - find the path to the GNU or non-GNU linker
490AC_DEFUN(AC_PROG_LD,
491[AC_ARG_WITH(gnu-ld,
492[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
493test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
494AC_REQUIRE([AC_PROG_CC])dnl
495AC_REQUIRE([AC_CANONICAL_HOST])dnl
496AC_REQUIRE([AC_CANONICAL_BUILD])dnl
497ac_prog=ld
498if test "$ac_cv_prog_gcc" = yes; then
499 # Check if gcc -print-prog-name=ld gives a path.
500 AC_MSG_CHECKING([for ld used by GCC])
501 ac_prog=`($CC -print-prog-name=ld) 2>&5`
502 case "$ac_prog" in
503 # Accept absolute paths.
504changequote(,)dnl
505 [\\/]* | [A-Za-z]:[\\/]*)
506 re_direlt='/[^/][^/]*/\.\./'
507changequote([,])dnl
508 # Canonicalize the path of ld
509 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
510 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
511 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
512 done
513 test -z "$LD" && LD="$ac_prog"
514 ;;
515 "")
516 # If it fails, then pretend we aren't using GCC.
517 ac_prog=ld
518 ;;
519 *)
520 # If it is relative, then search for the first ld in PATH.
521 with_gnu_ld=unknown
522 ;;
523 esac
524elif test "$with_gnu_ld" = yes; then
525 AC_MSG_CHECKING([for GNU ld])
526else
527 AC_MSG_CHECKING([for non-GNU ld])
528fi
529AC_CACHE_VAL(ac_cv_path_LD,
530[if test -z "$LD"; then
531 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
532 for ac_dir in $PATH; do
533 test -z "$ac_dir" && ac_dir=.
534 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
535 ac_cv_path_LD="$ac_dir/$ac_prog"
536 # Check to see if the program is GNU ld. I'd rather use --version,
537 # but apparently some GNU ld's only accept -v.
538 # Break only if it was the GNU/non-GNU ld that we prefer.
539 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
540 test "$with_gnu_ld" != no && break
541 else
542 test "$with_gnu_ld" != yes && break
543 fi
544 fi
545 done
546 IFS="$ac_save_ifs"
547else
548 ac_cv_path_LD="$LD" # Let the user override the test with a path.
549fi])
550LD="$ac_cv_path_LD"
551if test -n "$LD"; then
552 AC_MSG_RESULT($LD)
553else
554 AC_MSG_RESULT(no)
555fi
556test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
557AC_PROG_LD_GNU
558])
559
560AC_DEFUN(AC_PROG_LD_GNU,
561[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
562[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
563if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
564 ac_cv_prog_gnu_ld=yes
565else
566 ac_cv_prog_gnu_ld=no
567fi])
568])
569
570# AC_PROG_NM - find the path to a BSD-compatible name lister
571AC_DEFUN(AC_PROG_NM,
572[AC_MSG_CHECKING([for BSD-compatible nm])
573AC_CACHE_VAL(ac_cv_path_NM,
574[if test -n "$NM"; then
575 # Let the user override the test.
576 ac_cv_path_NM="$NM"
577else
578 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
579 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
580 test -z "$ac_dir" && ac_dir=.
581 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
582 # Check to see if the nm accepts a BSD-compat flag.
583 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
584 # nm: unknown option "B" ignored
585 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
586 ac_cv_path_NM="$ac_dir/nm -B"
587 break
588 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
589 ac_cv_path_NM="$ac_dir/nm -p"
590 break
591 else
592 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
593 continue # so that we can try to find one that supports BSD flags
594 fi
595 fi
596 done
597 IFS="$ac_save_ifs"
598 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
599fi])
600NM="$ac_cv_path_NM"
601AC_MSG_RESULT([$NM])
602])
603
604# AC_CHECK_LIBM - check for math library
605AC_DEFUN(AC_CHECK_LIBM,
606[AC_REQUIRE([AC_CANONICAL_HOST])dnl
607LIBM=
608case "$lt_target" in
609*-*-beos* | *-*-cygwin*)
610 # These system don't have libm
611 ;;
612*-ncr-sysv4.3*)
613 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
614 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
615 ;;
616*)
617 AC_CHECK_LIB(m, main, LIBM="-lm")
618 ;;
619esac
620])
621
622# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
Daniel Veillardc5d64342001-06-24 12:13:24 +0000623# the libltdl convenience library and INCLTDL to the include flags for
624# the libltdl header and adds --enable-ltdl-convenience to the
625# configure arguments. Note that LIBLTDL and INCLTDL are not
626# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
627# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
628# with '${top_builddir}/' and INCLTDL will be prefixed with
629# '${top_srcdir}/' (note the single quotes!). If your package is not
630# flat and you're not using automake, define top_builddir and
631# top_srcdir appropriately in the Makefiles.
Daniel Veillard5edcc932000-10-15 21:43:03 +0000632AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
633 case "$enable_ltdl_convenience" in
634 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
635 "") enable_ltdl_convenience=yes
636 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
637 esac
Daniel Veillardc5d64342001-06-24 12:13:24 +0000638 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
639 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
Daniel Veillard5edcc932000-10-15 21:43:03 +0000640])
641
642# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
Daniel Veillardc5d64342001-06-24 12:13:24 +0000643# the libltdl installable library and INCLTDL to the include flags for
644# the libltdl header and adds --enable-ltdl-install to the configure
645# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
646# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
647# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
648# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
649# with '${top_srcdir}/' (note the single quotes!). If your package is
650# not flat and you're not using automake, define top_builddir and
651# top_srcdir appropriately in the Makefiles.
Daniel Veillard5edcc932000-10-15 21:43:03 +0000652# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
653AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
654 AC_CHECK_LIB(ltdl, main,
655 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
656 [if test x"$enable_ltdl_install" = xno; then
657 AC_MSG_WARN([libltdl not installed, but installation disabled])
658 else
659 enable_ltdl_install=yes
660 fi
661 ])
662 if test x"$enable_ltdl_install" = x"yes"; then
663 ac_configure_args="$ac_configure_args --enable-ltdl-install"
Daniel Veillardc5d64342001-06-24 12:13:24 +0000664 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
665 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
Daniel Veillard5edcc932000-10-15 21:43:03 +0000666 else
667 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
668 LIBLTDL="-lltdl"
669 INCLTDL=
670 fi
671])
672
673dnl old names
674AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
675AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
676AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
677AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
678AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
679AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
680AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
681
682dnl This is just to silence aclocal about the macro not being used
683ifelse([AC_DISABLE_FAST_INSTALL])dnl
684
685# Add --enable-maintainer-mode option to configure.
686# From Jim Meyering
687
688# serial 1
689
690AC_DEFUN(AM_MAINTAINER_MODE,
691[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
692 dnl maintainer-mode is disabled by default
693 AC_ARG_ENABLE(maintainer-mode,
694[ --enable-maintainer-mode enable make rules and dependencies not useful
695 (and sometimes confusing) to the casual installer],
696 USE_MAINTAINER_MODE=$enableval,
697 USE_MAINTAINER_MODE=no)
698 AC_MSG_RESULT($USE_MAINTAINER_MODE)
699 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
700 MAINT=$MAINTAINER_MODE_TRUE
701 AC_SUBST(MAINT)dnl
702]
703)
704
705# Define a conditional.
706
707AC_DEFUN(AM_CONDITIONAL,
708[AC_SUBST($1_TRUE)
709AC_SUBST($1_FALSE)
710if $2; then
711 $1_TRUE=
712 $1_FALSE='#'
713else
714 $1_TRUE='#'
715 $1_FALSE=
716fi])
717