1 dnl aclocal.m4 generated automatically by aclocal 1.4
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.
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.
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
19 AC_DEFUN(LIBGCJ_CONFIGURE,
21 dnl Default to --enable-multilib
22 AC_ARG_ENABLE(multilib,
23 [ --enable-multilib build many library versions (default)],
24 [case "${enableval}" in
27 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
28 esac], [multilib=yes])dnl
30 dnl We may get other options which we dont document:
31 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
33 if test "[$]{srcdir}" = "."; then
34 if test "[$]{with_target_subdir}" != "."; then
35 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
37 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
40 libgcj_basedir="[$]{srcdir}/$1"
42 AC_SUBST(libgcj_basedir)
46 dnl version is pulled out to make it a bit easier to change using sed.
48 dnl Still use "libjava" here to placate dejagnu.
49 AM_INIT_AUTOMAKE(libjava, $version)
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
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])
67 if test $ac_cv_prog_gcc = yes; then
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"
76 if test "$ac_test_CFLAGS" = set; then
77 CFLAGS="$ac_save_CFLAGS"
78 elif test $ac_cv_prog_cc_g = yes; then
85 test "${CFLAGS+set}" = set || CFLAGS="-g"
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])
99 if test $ac_cv_prog_gxx = yes; then
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"
108 if test "$ac_test_CXXFLAGS" = set; then
109 CXXFLAGS="$ac_save_CXXFLAGS"
110 elif test $ac_cv_prog_cxx_g = yes; then
117 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
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.
129 AC_CHECK_TOOL(AS, as)
130 AC_CHECK_TOOL(AR, ar)
131 AC_CHECK_TOOL(RANLIB, ranlib, :)
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
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
157 . [$]{libgcj_basedir}/configure.host
159 case [$]{libgcj_basedir} in
160 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
161 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
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)
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.
179 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
181 AC_DEFUN(AM_INIT_AUTOMAKE,
182 [AC_REQUIRE([AC_PROG_INSTALL])
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])
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])])
206 # Check to make sure that the build environment is sane.
209 AC_DEFUN(AM_SANITY_CHECK,
210 [AC_MSG_CHECKING([whether build environment is sane])
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
220 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
221 if test "[$]*" = "X"; then
223 set X `ls -t $srcdir/configure conftestfile`
225 if test "[$]*" != "X $srcdir/configure conftestfile" \
226 && test "[$]*" != "X conftestfile $srcdir/configure"; then
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])
236 test "[$]2" = conftestfile
242 AC_MSG_ERROR([newly created file is older than distributed files!
243 Check your system clock])
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
260 AC_MSG_RESULT(missing)
264 # Add --enable-maintainer-mode option to configure.
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
284 # Define a conditional.
286 AC_DEFUN(AM_CONDITIONAL,
297 # Like AC_CONFIG_HEADER, but automatically create stamp file.
299 AC_DEFUN(AM_CONFIG_HEADER,
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>>,
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
316 am_indx=`expr "<<$>>am_indx" + 1`
321 # serial 35 AC_PROG_LIBTOOL
322 AC_DEFUN(AC_PROG_LIBTOOL,
323 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
325 # Save cache, so that ltconfig can load it
328 # Actually configure libtool. ac_aux_dir is where install-sh is found.
329 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
330 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
331 DLLTOOL="$DLLTOOL" AS="$AS" \
332 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
333 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
334 || AC_MSG_ERROR([libtool configure failed])
336 # Reload cache, that may have been modified by ltconfig
339 # This can be used to rebuild libtool when needed
340 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
342 # Always use our own libtool.
343 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
346 # Redirect the config.log output again, so that the ltconfig log is not
347 # clobbered by the next message.
351 AC_DEFUN(AC_LIBTOOL_SETUP,
353 AC_REQUIRE([AC_ENABLE_SHARED])dnl
354 AC_REQUIRE([AC_ENABLE_STATIC])dnl
355 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
356 AC_REQUIRE([AC_CANONICAL_HOST])dnl
357 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
358 AC_REQUIRE([AC_PROG_RANLIB])dnl
359 AC_REQUIRE([AC_PROG_CC])dnl
360 AC_REQUIRE([AC_PROG_LD])dnl
361 AC_REQUIRE([AC_PROG_NM])dnl
362 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
363 AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
364 AC_REQUIRE([AC_PROG_LN_S])dnl
367 # Check for any special flags to pass to ltconfig.
368 libtool_flags="--cache-file=$cache_file"
369 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
370 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
371 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
372 test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
373 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
374 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
375 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
377 # Some flags need to be propagated to the compiler or linker for good
381 # Find out which ABI we are using.
382 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
383 if AC_TRY_EVAL(ac_compile); then
384 case "`/usr/bin/file conftest.o`" in
400 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
401 SAVE_CFLAGS="$CFLAGS"
402 CFLAGS="$CFLAGS -belf"
403 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
404 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
405 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
406 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
407 CFLAGS="$SAVE_CFLAGS"
412 AC_SYS_LIBTOOL_CYGWIN
417 # enable the --disable-libtool-lock switch
419 AC_ARG_ENABLE(libtool-lock,
420 [ --disable-libtool-lock force libtool not to do file locking],
421 need_locks=$enableval,
424 if test x"$need_locks" = xno; then
425 libtool_flags="$libtool_flags --disable-lock"
429 # AC_LIBTOOL_DLOPEN - check for dlopen support
430 AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
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
436 AC_DEFUN(AC_ENABLE_SHARED,
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],
442 [p=${PACKAGE-default}
444 yes) enable_shared=yes ;;
445 no) 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
458 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
461 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
462 AC_DEFUN(AC_DISABLE_SHARED,
463 [AC_ENABLE_SHARED(no)])
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
469 AC_DEFUN(AC_ENABLE_STATIC,
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],
475 [p=${PACKAGE-default}
477 yes) enable_static=yes ;;
478 no) 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
491 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
494 # AC_DISABLE_STATIC - set the default static flag to --disable-static
495 AC_DEFUN(AC_DISABLE_STATIC,
496 [AC_ENABLE_STATIC(no)])
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
503 AC_DEFUN(AC_ENABLE_FAST_INSTALL,
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],
509 [p=${PACKAGE-default}
511 yes) enable_fast_install=yes ;;
512 no) enable_fast_install=no ;;
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
525 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
528 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
529 AC_DEFUN(AC_DISABLE_FAST_INSTALL,
530 [AC_ENABLE_FAST_INSTALL(no)])
533 # AC_PROG_LD - find the path to the GNU or non-GNU linker
536 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
537 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
538 AC_REQUIRE([AC_PROG_CC])dnl
539 AC_REQUIRE([AC_CANONICAL_HOST])dnl
540 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
542 if test "$ac_cv_prog_gcc" = yes; then
543 # Check if gcc -print-prog-name=ld gives a path.
544 AC_MSG_CHECKING([for ld used by GCC])
545 ac_prog=`($CC -print-prog-name=ld) 2>&5`
547 # Accept absolute paths.
549 /* | [A-Za-z]:[\\/]*)
550 re_direlt='/[^/][^/]*/\.\./'
552 # Canonicalize the path of ld
553 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
554 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
555 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
557 test -z "$LD" && LD="$ac_prog"
560 # If it fails, then pretend we aren't using GCC.
564 # If it is relative, then search for the first ld in PATH.
568 elif test "$with_gnu_ld" = yes; then
569 AC_MSG_CHECKING([for GNU ld])
571 AC_MSG_CHECKING([for non-GNU ld])
573 AC_CACHE_VAL(ac_cv_path_LD,
574 [if test -z "$LD"; then
575 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
576 for ac_dir in $PATH; do
577 test -z "$ac_dir" && ac_dir=.
578 if test -f "$ac_dir/$ac_prog"; then
579 ac_cv_path_LD="$ac_dir/$ac_prog"
580 # Check to see if the program is GNU ld. I'd rather use --version,
581 # but apparently some GNU ld's only accept -v.
582 # Break only if it was the GNU/non-GNU ld that we prefer.
583 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
584 test "$with_gnu_ld" != no && break
586 test "$with_gnu_ld" != yes && break
592 ac_cv_path_LD="$LD" # Let the user override the test with a path.
595 if test -n "$LD"; then
600 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
605 AC_DEFUN(AC_PROG_LD_GNU,
606 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
607 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
608 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
609 ac_cv_prog_gnu_ld=yes
615 # AC_PROG_NM - find the path to a BSD-compatible name lister
617 [AC_MSG_CHECKING([for BSD-compatible nm])
618 AC_CACHE_VAL(ac_cv_path_NM,
619 [if test -n "$NM"; then
620 # Let the user override the test.
623 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
624 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
625 test -z "$ac_dir" && ac_dir=.
626 if test -f $ac_dir/nm; then
627 # Check to see if the nm accepts a BSD-compat flag.
628 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
629 # nm: unknown option "B" ignored
630 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
631 ac_cv_path_NM="$ac_dir/nm -B"
633 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
634 ac_cv_path_NM="$ac_dir/nm -p"
637 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
638 continue # so that we can try to find one that supports BSD flags
643 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
650 # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
651 # by C symbol name from nm.
652 AC_DEFUN(AC_SYS_NM_PARSE,
653 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
654 AC_REQUIRE([AC_PROG_NM])dnl
655 # Check for command to grab the raw symbol name followed by C symbol from nm.
656 AC_MSG_CHECKING([command to parse $NM output])
657 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
658 [# These are sane defaults that work on at least a few old systems.
659 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
662 # Character class describing NM global symbol codes.
663 ac_symcode='[BCDEGRST]'
665 # Regexp to match symbols that can be accessed directly from C.
666 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
668 # Transform the above into a raw symbol and a C symbol.
669 ac_symxfrm='\1 \2\3 \3'
671 # Transform an extracted symbol line into a proper C declaration
672 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
674 # Define system-specific variables.
680 ac_symcode='[ABCDGISTW]'
683 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
686 ac_symcode='[BCDEGRST]'
693 # If we're using GNU nm, then use its standard symbol codes.
694 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
695 ac_symcode='[ABCDGISTW]'
699 # Try without a prefix undercore, then with it.
700 for ac_symprfx in "" "_"; do
702 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
704 # Check to see that the pipe works correctly.
706 rm -f conftest.$ac_ext
707 cat > conftest.$ac_ext <<EOF
712 void nm_test_func(){}
716 int main(){nm_test_var='a';nm_test_func;return 0;}
719 if AC_TRY_EVAL(ac_compile); then
720 # Now try to grab the symbols.
723 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
725 # Try sorting and uniquifying the output.
726 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
727 mv -f "$ac_nlist"T "$ac_nlist"
732 # Make sure that we snagged all the symbols we need.
733 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
734 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
735 cat <<EOF > conftest.c
741 # Now generate the symbol file.
742 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
744 cat <<EOF >> conftest.c
745 #if defined (__STDC__) && __STDC__
746 # define lt_ptr_t void *
748 # define lt_ptr_t char *
752 /* The mapping between symbol names and symbols. */
758 lt_preloaded_symbols[] =
762 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
763 cat <<\EOF >> conftest.c
771 # Now try linking the two files.
772 mv conftest.$ac_objext conftestm.$ac_objext
774 ac_save_CFLAGS="$CFLAGS"
775 LIBS="conftestm.$ac_objext"
776 CFLAGS="$CFLAGS$no_builtin_flag"
777 if AC_TRY_EVAL(ac_link) && test -s conftest; then
780 echo "configure: failed program was:" >&AC_FD_CC
781 cat conftest.c >&AC_FD_CC
784 CFLAGS="$ac_save_CFLAGS"
786 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
789 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
792 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
795 echo "$progname: failed program was:" >&AC_FD_CC
796 cat conftest.c >&AC_FD_CC
800 # Do not use the global_symbol_pipe unless it works.
801 if test "$ac_pipe_works" = yes; then
802 if test x"$ac_symprfx" = x"_"; then
803 ac_cv_sys_symbol_underscore=yes
805 ac_cv_sys_symbol_underscore=no
809 ac_cv_sys_global_symbol_pipe=
815 if test -z "$ac_cv_sys_global_symbol_pipe"; then
818 AC_MSG_RESULT($ac_result)
821 # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
822 AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
823 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
824 AC_CHECK_TOOL(AS, as, false)
827 # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
828 # with an underscore?
829 AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
830 [AC_REQUIRE([AC_PROG_NM])dnl
831 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
832 AC_MSG_CHECKING([for _ prefix in compiled symbols])
833 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
834 [ac_cv_sys_symbol_underscore=no
835 cat > conftest.$ac_ext <<EOF
836 void nm_test_func(){}
837 int main(){nm_test_func;return 0;}
839 if AC_TRY_EVAL(ac_compile); then
840 # Now try to grab the symbols.
842 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
843 # See whether the symbols have a leading underscore.
844 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
845 ac_cv_sys_symbol_underscore=yes
847 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
850 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
854 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
857 echo "configure: failed program was:" >&AC_FD_CC
858 cat conftest.c >&AC_FD_CC
862 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
863 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
864 AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
867 # AC_CHECK_LIBM - check for math library
868 AC_DEFUN(AC_CHECK_LIBM, [
869 AC_CHECK_LIB(mw, _mwvalidcheckl)
873 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
874 # the libltdl convenience library, adds --enable-ltdl-convenience to
875 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
876 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
877 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
878 # '${top_builddir}/' (note the single quotes!) if your package is not
879 # flat, and, if you're not using automake, define top_builddir as
880 # appropriate in the Makefiles.
881 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
882 case "$enable_ltdl_convenience" in
883 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
884 "") enable_ltdl_convenience=yes
885 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
887 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
890 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
891 # the libltdl installable library, and adds --enable-ltdl-install to
892 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
893 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
894 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
895 # '${top_builddir}/' (note the single quotes!) if your package is not
896 # flat, and, if you're not using automake, define top_builddir as
897 # appropriate in the Makefiles.
898 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
899 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
900 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
901 case "$enable_ltdl_install" in
902 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
903 "") enable_ltdl_install=yes
904 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
907 if test x"$enable_ltdl_install" != x"no"; then
908 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
913 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
914 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
915 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
916 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
917 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
918 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
919 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
920 AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
921 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
922 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl