OSDN Git Service

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