OSDN Git Service

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