OSDN Git Service

797bddc166573b23f71fee8665a2a0a9d5dae48a
[pf3gnuchains/gcc-fork.git] / boehm-gc / 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 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
14 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
15 # are probably using a cross compiler, which will not be able to fully
16 # link an executable.  This should really be fixed in autoconf
17 # itself.
18
19 AC_DEFUN(BOEHM_CONFIGURE,
20 [
21 dnl Default to --enable-multilib
22 AC_ARG_ENABLE(multilib,
23 [  --enable-multilib       build many library versions (default)],
24 [case "${enableval}" in
25   yes) multilib=yes ;;
26   no)  multilib=no ;;
27   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
28  esac], [multilib=yes])dnl
29
30 dnl We may get other options which we don't document:
31 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
32
33 if test "[$]{srcdir}" = "."; then
34   if test "[$]{with_target_subdir}" != "."; then
35     boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
36   else
37     boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
38   fi
39 else
40   boehm_gc_basedir="[$]{srcdir}/$1"
41 fi
42 AC_SUBST(boehm_gc_basedir)
43
44 AC_CANONICAL_HOST
45
46 AM_INIT_AUTOMAKE(boehm-gc, 5.0, no-define)
47
48 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
49 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
50 # are probably using a cross compiler, which will not be able to fully
51 # link an executable.  This should really be fixed in autoconf
52 # itself.
53
54 AC_DEFUN(LIB_AC_PROG_CC,
55 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
56 dnl Fool anybody using AC_PROG_CC.
57 AC_PROVIDE([AC_PROG_CC])
58 AC_CHECK_PROG(CC, gcc, gcc)
59 if test -z "$CC"; then
60   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
61   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
62 fi
63
64 AC_PROG_CC_GNU
65
66 if test $ac_cv_prog_gcc = yes; then
67   GCC=yes
68 dnl Check whether -g works, even if CFLAGS is set, in case the package
69 dnl plays around with CFLAGS (such as to build both debugging and
70 dnl normal versions of a library), tasteless as that idea is.
71   ac_test_CFLAGS="${CFLAGS+set}"
72   ac_save_CFLAGS="$CFLAGS"
73   CFLAGS=
74   AC_PROG_CC_G
75   if test "$ac_test_CFLAGS" = set; then
76     CFLAGS="$ac_save_CFLAGS"
77   elif test $ac_cv_prog_cc_g = yes; then
78     CFLAGS="-g -O2"
79   else
80     CFLAGS="-O2"
81   fi
82 else
83   GCC=
84   test "${CFLAGS+set}" = set || CFLAGS="-g"
85 fi
86 ])
87
88 LIB_AC_PROG_CC
89
90 # Likewise for AC_PROG_CXX.
91 AC_DEFUN(LIB_AC_PROG_CXX,
92 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
93 dnl Fool anybody using AC_PROG_CXX.
94 AC_PROVIDE([AC_PROG_CXX])
95 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
96 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
97
98 AC_PROG_CXX_GNU
99
100 if test $ac_cv_prog_gxx = yes; then
101   GXX=yes
102 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
103 dnl plays around with CXXFLAGS (such as to build both debugging and
104 dnl normal versions of a library), tasteless as that idea is.
105   ac_test_CXXFLAGS="${CXXFLAGS+set}"
106   ac_save_CXXFLAGS="$CXXFLAGS"
107   CXXFLAGS=
108   AC_PROG_CXX_G
109   if test "$ac_test_CXXFLAGS" = set; then
110     CXXFLAGS="$ac_save_CXXFLAGS"
111   elif test $ac_cv_prog_cxx_g = yes; then
112     CXXFLAGS="-g -O2"
113   else
114     CXXFLAGS="-O2"
115   fi
116 else
117   GXX=
118   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
119 fi
120 ])
121
122 LIB_AC_PROG_CXX
123
124 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
125 # run it explicitly here, it will be run implicitly before
126 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
127 # be run before AC_CANONICAL_HOST.
128 AC_CANONICAL_BUILD
129
130 AC_CHECK_TOOL(AS, as)
131 AC_CHECK_TOOL(AR, ar)
132 AC_CHECK_TOOL(RANLIB, ranlib, :)
133
134 AC_PROG_INSTALL
135
136 AM_MAINTAINER_MODE
137
138 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
139 # at least currently, we never actually build a program, so we never
140 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
141 # fails, because we are probably configuring with a cross compiler
142 # which can't create executables.  So we include AC_EXEEXT to keep
143 # automake happy, but we don't execute it, since we don't care about
144 # the result.
145 if false; then
146   AC_EXEEXT
147 fi
148
149 . [$]{boehm_gc_basedir}/configure.host
150
151 case [$]{boehm_gc_basedir} in
152 /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
153 *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;;
154 esac
155
156 boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include"
157 case "${host}" in
158   *-*-cygwin32*)
159     boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include"
160     ;;
161 esac
162
163 boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin"
164
165 BOEHM_GC_CFLAGS=${boehm_gc_cflags}
166 AC_SUBST(BOEHM_GC_CFLAGS)
167 ]))
168
169 ))))
170
171 # Do all the work for Automake.  This macro actually does too much --
172 # some checks are only needed if your package does certain things.
173 # But this isn't really a big deal.
174
175 # serial 1
176
177 dnl Usage:
178 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
179
180 AC_DEFUN(AM_INIT_AUTOMAKE,
181 [AC_REQUIRE([AC_PROG_INSTALL])
182 PACKAGE=[$1]
183 AC_SUBST(PACKAGE)
184 VERSION=[$2]
185 AC_SUBST(VERSION)
186 dnl test to see if srcdir already configured
187 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
188   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
189 fi
190 ifelse([$3],,
191 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
192 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
193 AC_REQUIRE([AM_SANITY_CHECK])
194 AC_REQUIRE([AC_ARG_PROGRAM])
195 dnl FIXME This is truly gross.
196 missing_dir=`cd $ac_aux_dir && pwd`
197 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
198 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
199 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
200 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
201 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
202 AC_REQUIRE([AC_PROG_MAKE_SET])])
203
204 #
205 # Check to make sure that the build environment is sane.
206 #
207
208 AC_DEFUN(AM_SANITY_CHECK,
209 [AC_MSG_CHECKING([whether build environment is sane])
210 # Just in case
211 sleep 1
212 echo timestamp > conftestfile
213 # Do `set' in a subshell so we don't clobber the current shell's
214 # arguments.  Must try -L first in case configure is actually a
215 # symlink; some systems play weird games with the mod time of symlinks
216 # (eg FreeBSD returns the mod time of the symlink's containing
217 # directory).
218 if (
219    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
220    if test "[$]*" = "X"; then
221       # -L didn't work.
222       set X `ls -t $srcdir/configure conftestfile`
223    fi
224    if test "[$]*" != "X $srcdir/configure conftestfile" \
225       && test "[$]*" != "X conftestfile $srcdir/configure"; then
226
227       # If neither matched, then we have a broken ls.  This can happen
228       # if, for instance, CONFIG_SHELL is bash and it inherits a
229       # broken ls alias from the environment.  This has actually
230       # happened.  Such a system could not be considered "sane".
231       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
232 alias in your environment])
233    fi
234
235    test "[$]2" = conftestfile
236    )
237 then
238    # Ok.
239    :
240 else
241    AC_MSG_ERROR([newly created file is older than distributed files!
242 Check your system clock])
243 fi
244 rm -f conftest*
245 AC_MSG_RESULT(yes)])
246
247 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
248 dnl The program must properly implement --version.
249 AC_DEFUN(AM_MISSING_PROG,
250 [AC_MSG_CHECKING(for working $2)
251 # Run test in a subshell; some versions of sh will print an error if
252 # an executable is not found, even if stderr is redirected.
253 # Redirect stdin to placate older versions of autoconf.  Sigh.
254 if ($2 --version) < /dev/null > /dev/null 2>&1; then
255    $1=$2
256    AC_MSG_RESULT(found)
257 else
258    $1="$3/missing $2"
259    AC_MSG_RESULT(missing)
260 fi
261 AC_SUBST($1)])
262
263 # Add --enable-maintainer-mode option to configure.
264 # From Jim Meyering
265
266 # serial 1
267
268 AC_DEFUN(AM_MAINTAINER_MODE,
269 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
270   dnl maintainer-mode is disabled by default
271   AC_ARG_ENABLE(maintainer-mode,
272 [  --enable-maintainer-mode enable make rules and dependencies not useful
273                           (and sometimes confusing) to the casual installer],
274       USE_MAINTAINER_MODE=$enableval,
275       USE_MAINTAINER_MODE=no)
276   AC_MSG_RESULT($USE_MAINTAINER_MODE)
277   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
278   MAINT=$MAINTAINER_MODE_TRUE
279   AC_SUBST(MAINT)dnl
280 ]
281 )
282
283 # Define a conditional.
284
285 AC_DEFUN(AM_CONDITIONAL,
286 [AC_SUBST($1_TRUE)
287 AC_SUBST($1_FALSE)
288 if $2; then
289   $1_TRUE=
290   $1_FALSE='#'
291 else
292   $1_TRUE='#'
293   $1_FALSE=
294 fi])
295
296
297 # serial 40 AC_PROG_LIBTOOL
298 AC_DEFUN(AC_PROG_LIBTOOL,
299 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
300
301 # Save cache, so that ltconfig can load it
302 AC_CACHE_SAVE
303
304 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
305 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
306 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
307 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
308 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
309 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
310 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
311 || AC_MSG_ERROR([libtool configure failed])
312
313 # Reload cache, that may have been modified by ltconfig
314 AC_CACHE_LOAD
315
316 # This can be used to rebuild libtool when needed
317 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
318
319 # Always use our own libtool.
320 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
321 AC_SUBST(LIBTOOL)dnl
322
323 # Redirect the config.log output again, so that the ltconfig log is not
324 # clobbered by the next message.
325 exec 5>>./config.log
326 ])
327
328 AC_DEFUN(AC_LIBTOOL_SETUP,
329 [AC_PREREQ(2.13)dnl
330 AC_REQUIRE([AC_ENABLE_SHARED])dnl
331 AC_REQUIRE([AC_ENABLE_STATIC])dnl
332 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
333 AC_REQUIRE([AC_CANONICAL_HOST])dnl
334 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
335 AC_REQUIRE([AC_PROG_RANLIB])dnl
336 AC_REQUIRE([AC_PROG_CC])dnl
337 AC_REQUIRE([AC_PROG_LD])dnl
338 AC_REQUIRE([AC_PROG_NM])dnl
339 AC_REQUIRE([AC_PROG_LN_S])dnl
340 dnl
341
342 case "$target" in
343 NONE) lt_target="$host" ;;
344 *) lt_target="$target" ;;
345 esac
346
347 # Check for any special flags to pass to ltconfig.
348 libtool_flags="--cache-file=$cache_file"
349 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
350 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
351 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
352 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
353 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
354 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
355 [libtool_flags="$libtool_flags --enable-dlopen"])
356 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
357 [libtool_flags="$libtool_flags --enable-win32-dll"])
358 AC_ARG_ENABLE(libtool-lock,
359   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
360 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
361 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
362
363 # Some flags need to be propagated to the compiler or linker for good
364 # libtool support.
365 case "$lt_target" in
366 *-*-irix6*)
367   # Find out which ABI we are using.
368   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
369   if AC_TRY_EVAL(ac_compile); then
370     case "`/usr/bin/file conftest.o`" in
371     *32-bit*)
372       LD="${LD-ld} -32"
373       ;;
374     *N32*)
375       LD="${LD-ld} -n32"
376       ;;
377     *64-bit*)
378       LD="${LD-ld} -64"
379       ;;
380     esac
381   fi
382   rm -rf conftest*
383   ;;
384
385 *-*-sco3.2v5*)
386   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
387   SAVE_CFLAGS="$CFLAGS"
388   CFLAGS="$CFLAGS -belf"
389   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
390     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
391   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
392     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
393     CFLAGS="$SAVE_CFLAGS"
394   fi
395   ;;
396
397 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
398 [*-*-cygwin* | *-*-mingw*)
399   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
400   AC_CHECK_TOOL(AS, as, false)
401   AC_CHECK_TOOL(OBJDUMP, objdump, false)
402   ;;
403 ])
404 esac
405 ])
406
407 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
408 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
409
410 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
411 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
412
413 # AC_ENABLE_SHARED - implement the --enable-shared flag
414 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
415 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
416 #   `yes'.
417 AC_DEFUN(AC_ENABLE_SHARED, [dnl
418 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
419 AC_ARG_ENABLE(shared,
420 changequote(<<, >>)dnl
421 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
422 changequote([, ])dnl
423 [p=${PACKAGE-default}
424 case "$enableval" in
425 yes) enable_shared=yes ;;
426 no) enable_shared=no ;;
427 *)
428   enable_shared=no
429   # Look at the argument we got.  We use all the common list separators.
430   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
431   for pkg in $enableval; do
432     if test "X$pkg" = "X$p"; then
433       enable_shared=yes
434     fi
435   done
436   IFS="$ac_save_ifs"
437   ;;
438 esac],
439 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
440 ])
441
442 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
443 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
444 AC_ENABLE_SHARED(no)])
445
446 # AC_ENABLE_STATIC - implement the --enable-static flag
447 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
448 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
449 #   `yes'.
450 AC_DEFUN(AC_ENABLE_STATIC, [dnl
451 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
452 AC_ARG_ENABLE(static,
453 changequote(<<, >>)dnl
454 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
455 changequote([, ])dnl
456 [p=${PACKAGE-default}
457 case "$enableval" in
458 yes) enable_static=yes ;;
459 no) enable_static=no ;;
460 *)
461   enable_static=no
462   # Look at the argument we got.  We use all the common list separators.
463   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
464   for pkg in $enableval; do
465     if test "X$pkg" = "X$p"; then
466       enable_static=yes
467     fi
468   done
469   IFS="$ac_save_ifs"
470   ;;
471 esac],
472 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
473 ])
474
475 # AC_DISABLE_STATIC - set the default static flag to --disable-static
476 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
477 AC_ENABLE_STATIC(no)])
478
479
480 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
481 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
482 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
483 #   `yes'.
484 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
485 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
486 AC_ARG_ENABLE(fast-install,
487 changequote(<<, >>)dnl
488 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
489 changequote([, ])dnl
490 [p=${PACKAGE-default}
491 case "$enableval" in
492 yes) enable_fast_install=yes ;;
493 no) enable_fast_install=no ;;
494 *)
495   enable_fast_install=no
496   # Look at the argument we got.  We use all the common list separators.
497   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
498   for pkg in $enableval; do
499     if test "X$pkg" = "X$p"; then
500       enable_fast_install=yes
501     fi
502   done
503   IFS="$ac_save_ifs"
504   ;;
505 esac],
506 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
507 ])
508
509 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
510 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
511 AC_ENABLE_FAST_INSTALL(no)])
512
513 # AC_PROG_LD - find the path to the GNU or non-GNU linker
514 AC_DEFUN(AC_PROG_LD,
515 [AC_ARG_WITH(gnu-ld,
516 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
517 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
518 AC_REQUIRE([AC_PROG_CC])dnl
519 AC_REQUIRE([AC_CANONICAL_HOST])dnl
520 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
521 ac_prog=ld
522 if test "$ac_cv_prog_gcc" = yes; then
523   # Check if gcc -print-prog-name=ld gives a path.
524   AC_MSG_CHECKING([for ld used by GCC])
525   ac_prog=`($CC -print-prog-name=ld) 2>&5`
526   case "$ac_prog" in
527     # Accept absolute paths.
528 changequote(,)dnl
529     [\\/]* | [A-Za-z]:[\\/]*)
530       re_direlt='/[^/][^/]*/\.\./'
531 changequote([,])dnl
532       # Canonicalize the path of ld
533       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
534       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
535         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
536       done
537       test -z "$LD" && LD="$ac_prog"
538       ;;
539   "")
540     # If it fails, then pretend we aren't using GCC.
541     ac_prog=ld
542     ;;
543   *)
544     # If it is relative, then search for the first ld in PATH.
545     with_gnu_ld=unknown
546     ;;
547   esac
548 elif test "$with_gnu_ld" = yes; then
549   AC_MSG_CHECKING([for GNU ld])
550 else
551   AC_MSG_CHECKING([for non-GNU ld])
552 fi
553 AC_CACHE_VAL(ac_cv_path_LD,
554 [if test -z "$LD"; then
555   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
556   for ac_dir in $PATH; do
557     test -z "$ac_dir" && ac_dir=.
558     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
559       ac_cv_path_LD="$ac_dir/$ac_prog"
560       # Check to see if the program is GNU ld.  I'd rather use --version,
561       # but apparently some GNU ld's only accept -v.
562       # Break only if it was the GNU/non-GNU ld that we prefer.
563       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
564         test "$with_gnu_ld" != no && break
565       else
566         test "$with_gnu_ld" != yes && break
567       fi
568     fi
569   done
570   IFS="$ac_save_ifs"
571 else
572   ac_cv_path_LD="$LD" # Let the user override the test with a path.
573 fi])
574 LD="$ac_cv_path_LD"
575 if test -n "$LD"; then
576   AC_MSG_RESULT($LD)
577 else
578   AC_MSG_RESULT(no)
579 fi
580 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
581 AC_PROG_LD_GNU
582 ])
583
584 AC_DEFUN(AC_PROG_LD_GNU,
585 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
586 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
587 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
588   ac_cv_prog_gnu_ld=yes
589 else
590   ac_cv_prog_gnu_ld=no
591 fi])
592 ])
593
594 # AC_PROG_NM - find the path to a BSD-compatible name lister
595 AC_DEFUN(AC_PROG_NM,
596 [AC_MSG_CHECKING([for BSD-compatible nm])
597 AC_CACHE_VAL(ac_cv_path_NM,
598 [if test -n "$NM"; then
599   # Let the user override the test.
600   ac_cv_path_NM="$NM"
601 else
602   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
603   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
604     test -z "$ac_dir" && ac_dir=.
605     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
606       # Check to see if the nm accepts a BSD-compat flag.
607       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
608       #   nm: unknown option "B" ignored
609       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
610         ac_cv_path_NM="$ac_dir/nm -B"
611         break
612       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
613         ac_cv_path_NM="$ac_dir/nm -p"
614         break
615       else
616         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
617         continue # so that we can try to find one that supports BSD flags
618       fi
619     fi
620   done
621   IFS="$ac_save_ifs"
622   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
623 fi])
624 NM="$ac_cv_path_NM"
625 AC_MSG_RESULT([$NM])
626 ])
627
628 # AC_CHECK_LIBM - check for math library
629 AC_DEFUN(AC_CHECK_LIBM,
630 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
631 LIBM=
632 case "$lt_target" in
633 *-*-beos* | *-*-cygwin*)
634   # These system don't have libm
635   ;;
636 *-ncr-sysv4.3*)
637   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
638   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
639   ;;
640 *)
641   AC_CHECK_LIB(m, main, LIBM="-lm")
642   ;;
643 esac
644 ])
645
646 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
647 # the libltdl convenience library, adds --enable-ltdl-convenience to
648 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
649 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
650 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
651 # '${top_builddir}/' (note the single quotes!) if your package is not
652 # flat, and, if you're not using automake, define top_builddir as
653 # appropriate in the Makefiles.
654 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
655   case "$enable_ltdl_convenience" in
656   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
657   "") enable_ltdl_convenience=yes
658       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
659   esac
660   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
661   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
662 ])
663
664 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
665 # the libltdl installable library, and adds --enable-ltdl-install to
666 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
667 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
668 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
669 # '${top_builddir}/' (note the single quotes!) if your package is not
670 # flat, and, if you're not using automake, define top_builddir as
671 # appropriate in the Makefiles.
672 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
673 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
674   AC_CHECK_LIB(ltdl, main,
675   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
676   [if test x"$enable_ltdl_install" = xno; then
677      AC_MSG_WARN([libltdl not installed, but installation disabled])
678    else
679      enable_ltdl_install=yes
680    fi
681   ])
682   if test x"$enable_ltdl_install" = x"yes"; then
683     ac_configure_args="$ac_configure_args --enable-ltdl-install"
684     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
685     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
686   else
687     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
688     LIBLTDL="-lltdl"
689     INCLTDL=
690   fi
691 ])
692
693 dnl old names
694 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
695 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
696 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
697 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
698 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
699 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
700 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
701
702 dnl This is just to silence aclocal about the macro not being used
703 ifelse([AC_DISABLE_FAST_INSTALL])dnl
704