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 Still use "libjava" here to placate dejagnu.
47 AM_INIT_AUTOMAKE(libjava, 0.0.7)
49 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
50 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
51 # are probably using a cross compiler, which will not be able to fully
52 # link an executable. This should really be fixed in autoconf
55 AC_DEFUN(LIB_AC_PROG_CC,
56 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
57 AC_CHECK_PROG(CC, gcc, gcc)
58 if test -z "$CC"; then
59 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
60 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
65 if test $ac_cv_prog_gcc = yes; then
67 dnl Check whether -g works, even if CFLAGS is set, in case the package
68 dnl plays around with CFLAGS (such as to build both debugging and
69 dnl normal versions of a library), tasteless as that idea is.
70 ac_test_CFLAGS="${CFLAGS+set}"
71 ac_save_CFLAGS="$CFLAGS"
74 if test "$ac_test_CFLAGS" = set; then
75 CFLAGS="$ac_save_CFLAGS"
76 elif test $ac_cv_prog_cc_g = yes; then
83 test "${CFLAGS+set}" = set || CFLAGS="-g"
89 # Likewise for AC_PROG_CXX.
90 AC_DEFUN(LIB_AC_PROG_CXX,
91 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
92 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
93 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
97 if test $ac_cv_prog_gxx = yes; then
99 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
100 dnl plays around with CXXFLAGS (such as to build both debugging and
101 dnl normal versions of a library), tasteless as that idea is.
102 ac_test_CXXFLAGS="${CXXFLAGS+set}"
103 ac_save_CXXFLAGS="$CXXFLAGS"
106 if test "$ac_test_CXXFLAGS" = set; then
107 CXXFLAGS="$ac_save_CXXFLAGS"
108 elif test $ac_cv_prog_cxx_g = yes; then
115 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
121 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
122 # run it explicitly here, it will be run implicitly before
123 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
124 # be run before AC_CANONICAL_HOST.
127 AC_CHECK_TOOL(AS, as)
128 AC_CHECK_TOOL(AR, ar)
129 AC_CHECK_TOOL(RANLIB, ranlib, :)
135 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
136 # at least currently, we never actually build a program, so we never
137 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
138 # fails, because we are probably configuring with a cross compiler
139 # which cant create executables. So we include AC_EXEEXT to keep
140 # automake happy, but we dont execute it, since we dont care about
146 # configure.host sets the following important variables
147 # libgcj_cflags - host specific C compiler flags
148 # libgcj_cxxflags - host specific C++ compiler flags
149 # libgcj_javaflags - host specific Java compiler flags
155 . [$]{libgcj_basedir}/configure.host
157 case [$]{libgcj_basedir} in
158 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
159 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
162 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
163 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
164 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
165 AC_SUBST(LIBGCJ_CFLAGS)
166 AC_SUBST(LIBGCJ_CXXFLAGS)
167 AC_SUBST(LIBGCJ_JAVAFLAGS)
170 # Do all the work for Automake. This macro actually does too much --
171 # some checks are only needed if your package does certain things.
172 # But this isn't really a big deal.
177 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
179 AC_DEFUN(AM_INIT_AUTOMAKE,
180 [AC_REQUIRE([AC_PROG_INSTALL])
185 dnl test to see if srcdir already configured
186 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
187 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
190 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
191 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
192 AC_REQUIRE([AM_SANITY_CHECK])
193 AC_REQUIRE([AC_ARG_PROGRAM])
194 dnl FIXME This is truly gross.
195 missing_dir=`cd $ac_aux_dir && pwd`
196 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
197 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
198 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
199 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
200 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
201 AC_REQUIRE([AC_PROG_MAKE_SET])])
204 # Check to make sure that the build environment is sane.
207 AC_DEFUN(AM_SANITY_CHECK,
208 [AC_MSG_CHECKING([whether build environment is sane])
211 echo timestamp > conftestfile
212 # Do `set' in a subshell so we don't clobber the current shell's
213 # arguments. Must try -L first in case configure is actually a
214 # symlink; some systems play weird games with the mod time of symlinks
215 # (eg FreeBSD returns the mod time of the symlink's containing
218 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
219 if test "[$]*" = "X"; then
221 set X `ls -t $srcdir/configure conftestfile`
223 if test "[$]*" != "X $srcdir/configure conftestfile" \
224 && test "[$]*" != "X conftestfile $srcdir/configure"; then
226 # If neither matched, then we have a broken ls. This can happen
227 # if, for instance, CONFIG_SHELL is bash and it inherits a
228 # broken ls alias from the environment. This has actually
229 # happened. Such a system could not be considered "sane".
230 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
231 alias in your environment])
234 test "[$]2" = conftestfile
240 AC_MSG_ERROR([newly created file is older than distributed files!
241 Check your system clock])
246 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
247 dnl The program must properly implement --version.
248 AC_DEFUN(AM_MISSING_PROG,
249 [AC_MSG_CHECKING(for working $2)
250 # Run test in a subshell; some versions of sh will print an error if
251 # an executable is not found, even if stderr is redirected.
252 # Redirect stdin to placate older versions of autoconf. Sigh.
253 if ($2 --version) < /dev/null > /dev/null 2>&1; then
258 AC_MSG_RESULT(missing)
262 # Add --enable-maintainer-mode option to configure.
267 AC_DEFUN(AM_MAINTAINER_MODE,
268 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
269 dnl maintainer-mode is disabled by default
270 AC_ARG_ENABLE(maintainer-mode,
271 [ --enable-maintainer-mode enable make rules and dependencies not useful
272 (and sometimes confusing) to the casual installer],
273 USE_MAINTAINER_MODE=$enableval,
274 USE_MAINTAINER_MODE=no)
275 AC_MSG_RESULT($USE_MAINTAINER_MODE)
276 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
277 MAINT=$MAINTAINER_MODE_TRUE
282 # Define a conditional.
284 AC_DEFUN(AM_CONDITIONAL,
295 # Like AC_CONFIG_HEADER, but automatically create stamp file.
297 AC_DEFUN(AM_CONFIG_HEADER,
299 AC_CONFIG_HEADER([$1])
300 dnl When config.status generates a header, we must update the stamp-h file.
301 dnl This file resides in the same directory as the config header
302 dnl that is generated. We must strip everything past the first ":",
303 dnl and everything past the last "/".
304 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
305 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
306 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
308 for am_file in <<$1>>; do
309 case " <<$>>CONFIG_HEADERS " in
310 *" <<$>>am_file "*<<)>>
311 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
314 am_indx=`expr "<<$>>am_indx" + 1`
319 # serial 35 AC_PROG_LIBTOOL
320 AC_DEFUN(AC_PROG_LIBTOOL,
321 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
323 # Save cache, so that ltconfig can load it
326 # Actually configure libtool. ac_aux_dir is where install-sh is found.
327 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
328 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
329 DLLTOOL="$DLLTOOL" AS="$AS" \
330 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
331 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
332 || AC_MSG_ERROR([libtool configure failed])
334 # Reload cache, that may have been modified by ltconfig
337 # This can be used to rebuild libtool when needed
338 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
340 # Always use our own libtool.
341 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
344 # Redirect the config.log output again, so that the ltconfig log is not
345 # clobbered by the next message.
349 AC_DEFUN(AC_LIBTOOL_SETUP,
351 AC_REQUIRE([AC_ENABLE_SHARED])dnl
352 AC_REQUIRE([AC_ENABLE_STATIC])dnl
353 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
354 AC_REQUIRE([AC_CANONICAL_HOST])dnl
355 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
356 AC_REQUIRE([AC_PROG_RANLIB])dnl
357 AC_REQUIRE([AC_PROG_CC])dnl
358 AC_REQUIRE([AC_PROG_LD])dnl
359 AC_REQUIRE([AC_PROG_NM])dnl
360 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
361 AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
362 AC_REQUIRE([AC_PROG_LN_S])dnl
365 # Check for any special flags to pass to ltconfig.
366 libtool_flags="--cache-file=$cache_file"
367 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
368 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
369 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
370 test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
371 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
372 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
373 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
375 # Some flags need to be propagated to the compiler or linker for good
379 # Find out which ABI we are using.
380 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
381 if AC_TRY_EVAL(ac_compile); then
382 case "`/usr/bin/file conftest.o`" in
398 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
399 SAVE_CFLAGS="$CFLAGS"
400 CFLAGS="$CFLAGS -belf"
401 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
402 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
403 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
404 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
405 CFLAGS="$SAVE_CFLAGS"
410 AC_SYS_LIBTOOL_CYGWIN
415 # enable the --disable-libtool-lock switch
417 AC_ARG_ENABLE(libtool-lock,
418 [ --disable-libtool-lock force libtool not to do file locking],
419 need_locks=$enableval,
422 if test x"$need_locks" = xno; then
423 libtool_flags="$libtool_flags --disable-lock"
427 # AC_LIBTOOL_DLOPEN - check for dlopen support
428 AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
430 # AC_ENABLE_SHARED - implement the --enable-shared flag
431 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
432 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
434 AC_DEFUN(AC_ENABLE_SHARED,
435 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
436 AC_ARG_ENABLE(shared,
437 changequote(<<, >>)dnl
438 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
440 [p=${PACKAGE-default}
442 yes) enable_shared=yes ;;
443 no) enable_shared=no ;;
446 # Look at the argument we got. We use all the common list separators.
447 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
448 for pkg in $enableval; do
449 if test "X$pkg" = "X$p"; then
456 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
459 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
460 AC_DEFUN(AC_DISABLE_SHARED,
461 [AC_ENABLE_SHARED(no)])
463 # AC_ENABLE_STATIC - implement the --enable-static flag
464 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
465 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
467 AC_DEFUN(AC_ENABLE_STATIC,
468 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
469 AC_ARG_ENABLE(static,
470 changequote(<<, >>)dnl
471 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
473 [p=${PACKAGE-default}
475 yes) enable_static=yes ;;
476 no) enable_static=no ;;
479 # Look at the argument we got. We use all the common list separators.
480 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
481 for pkg in $enableval; do
482 if test "X$pkg" = "X$p"; then
489 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
492 # AC_DISABLE_STATIC - set the default static flag to --disable-static
493 AC_DEFUN(AC_DISABLE_STATIC,
494 [AC_ENABLE_STATIC(no)])
497 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
498 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
499 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
501 AC_DEFUN(AC_ENABLE_FAST_INSTALL,
502 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
503 AC_ARG_ENABLE(fast-install,
504 changequote(<<, >>)dnl
505 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
507 [p=${PACKAGE-default}
509 yes) enable_fast_install=yes ;;
510 no) enable_fast_install=no ;;
512 enable_fast_install=no
513 # Look at the argument we got. We use all the common list separators.
514 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
515 for pkg in $enableval; do
516 if test "X$pkg" = "X$p"; then
517 enable_fast_install=yes
523 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
526 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
527 AC_DEFUN(AC_DISABLE_FAST_INSTALL,
528 [AC_ENABLE_FAST_INSTALL(no)])
531 # AC_PROG_LD - find the path to the GNU or non-GNU linker
534 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
535 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
536 AC_REQUIRE([AC_PROG_CC])dnl
537 AC_REQUIRE([AC_CANONICAL_HOST])dnl
538 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
540 if test "$ac_cv_prog_gcc" = yes; then
541 # Check if gcc -print-prog-name=ld gives a path.
542 AC_MSG_CHECKING([for ld used by GCC])
543 ac_prog=`($CC -print-prog-name=ld) 2>&5`
545 # Accept absolute paths.
547 /* | [A-Za-z]:[\\/]*)
548 re_direlt='/[^/][^/]*/\.\./'
550 # Canonicalize the path of ld
551 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
552 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
553 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
555 test -z "$LD" && LD="$ac_prog"
558 # If it fails, then pretend we aren't using GCC.
562 # If it is relative, then search for the first ld in PATH.
566 elif test "$with_gnu_ld" = yes; then
567 AC_MSG_CHECKING([for GNU ld])
569 AC_MSG_CHECKING([for non-GNU ld])
571 AC_CACHE_VAL(ac_cv_path_LD,
572 [if test -z "$LD"; then
573 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
574 for ac_dir in $PATH; do
575 test -z "$ac_dir" && ac_dir=.
576 if test -f "$ac_dir/$ac_prog"; then
577 ac_cv_path_LD="$ac_dir/$ac_prog"
578 # Check to see if the program is GNU ld. I'd rather use --version,
579 # but apparently some GNU ld's only accept -v.
580 # Break only if it was the GNU/non-GNU ld that we prefer.
581 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
582 test "$with_gnu_ld" != no && break
584 test "$with_gnu_ld" != yes && break
590 ac_cv_path_LD="$LD" # Let the user override the test with a path.
593 if test -n "$LD"; then
598 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
603 AC_DEFUN(AC_PROG_LD_GNU,
604 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
605 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
606 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
607 ac_cv_prog_gnu_ld=yes
613 # AC_PROG_NM - find the path to a BSD-compatible name lister
615 [AC_MSG_CHECKING([for BSD-compatible nm])
616 AC_CACHE_VAL(ac_cv_path_NM,
617 [if test -n "$NM"; then
618 # Let the user override the test.
621 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
622 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
623 test -z "$ac_dir" && ac_dir=.
624 if test -f $ac_dir/nm; then
625 # Check to see if the nm accepts a BSD-compat flag.
626 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
627 # nm: unknown option "B" ignored
628 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
629 ac_cv_path_NM="$ac_dir/nm -B"
631 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
632 ac_cv_path_NM="$ac_dir/nm -p"
635 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
636 continue # so that we can try to find one that supports BSD flags
641 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
648 # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
649 # by C symbol name from nm.
650 AC_DEFUN(AC_SYS_NM_PARSE,
651 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
652 AC_REQUIRE([AC_PROG_NM])dnl
653 # Check for command to grab the raw symbol name followed by C symbol from nm.
654 AC_MSG_CHECKING([command to parse $NM output])
655 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
656 [# These are sane defaults that work on at least a few old systems.
657 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
660 # Character class describing NM global symbol codes.
661 ac_symcode='[BCDEGRST]'
663 # Regexp to match symbols that can be accessed directly from C.
664 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
666 # Transform the above into a raw symbol and a C symbol.
667 ac_symxfrm='\1 \2\3 \3'
669 # Transform an extracted symbol line into a proper C declaration
670 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
672 # Define system-specific variables.
678 ac_symcode='[ABCDGISTW]'
681 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
684 ac_symcode='[BCDEGRST]'
691 # If we're using GNU nm, then use its standard symbol codes.
692 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
693 ac_symcode='[ABCDGISTW]'
697 # Try without a prefix undercore, then with it.
698 for ac_symprfx in "" "_"; do
700 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
702 # Check to see that the pipe works correctly.
704 rm -f conftest.$ac_ext
705 cat > conftest.$ac_ext <<EOF
710 void nm_test_func(){}
714 int main(){nm_test_var='a';nm_test_func;return 0;}
717 if AC_TRY_EVAL(ac_compile); then
718 # Now try to grab the symbols.
721 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
723 # Try sorting and uniquifying the output.
724 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
725 mv -f "$ac_nlist"T "$ac_nlist"
730 # Make sure that we snagged all the symbols we need.
731 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
732 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
733 cat <<EOF > conftest.c
739 # Now generate the symbol file.
740 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
742 cat <<EOF >> conftest.c
743 #if defined (__STDC__) && __STDC__
744 # define lt_ptr_t void *
746 # define lt_ptr_t char *
750 /* The mapping between symbol names and symbols. */
756 lt_preloaded_symbols[] =
760 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
761 cat <<\EOF >> conftest.c
769 # Now try linking the two files.
770 mv conftest.$ac_objext conftestm.$ac_objext
772 ac_save_CFLAGS="$CFLAGS"
773 LIBS="conftestm.$ac_objext"
774 CFLAGS="$CFLAGS$no_builtin_flag"
775 if AC_TRY_EVAL(ac_link) && test -s conftest; then
778 echo "configure: failed program was:" >&AC_FD_CC
779 cat conftest.c >&AC_FD_CC
782 CFLAGS="$ac_save_CFLAGS"
784 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
787 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
790 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
793 echo "$progname: failed program was:" >&AC_FD_CC
794 cat conftest.c >&AC_FD_CC
798 # Do not use the global_symbol_pipe unless it works.
799 if test "$ac_pipe_works" = yes; then
800 if test x"$ac_symprfx" = x"_"; then
801 ac_cv_sys_symbol_underscore=yes
803 ac_cv_sys_symbol_underscore=no
807 ac_cv_sys_global_symbol_pipe=
813 if test -z "$ac_cv_sys_global_symbol_pipe"; then
816 AC_MSG_RESULT($ac_result)
819 # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
820 AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
821 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
822 AC_CHECK_TOOL(AS, as, false)
825 # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
826 # with an underscore?
827 AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
828 [AC_REQUIRE([AC_PROG_NM])dnl
829 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
830 AC_MSG_CHECKING([for _ prefix in compiled symbols])
831 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
832 [ac_cv_sys_symbol_underscore=no
833 cat > conftest.$ac_ext <<EOF
834 void nm_test_func(){}
835 int main(){nm_test_func;return 0;}
837 if AC_TRY_EVAL(ac_compile); then
838 # Now try to grab the symbols.
840 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
841 # See whether the symbols have a leading underscore.
842 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
843 ac_cv_sys_symbol_underscore=yes
845 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
848 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
852 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
855 echo "configure: failed program was:" >&AC_FD_CC
856 cat conftest.c >&AC_FD_CC
860 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
861 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
862 AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
865 # AC_CHECK_LIBM - check for math library
866 AC_DEFUN(AC_CHECK_LIBM, [
867 AC_CHECK_LIB(mw, _mwvalidcheckl)
871 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
872 # the libltdl convenience library, adds --enable-ltdl-convenience to
873 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
874 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
875 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
876 # '${top_builddir}/' (note the single quotes!) if your package is not
877 # flat, and, if you're not using automake, define top_builddir as
878 # appropriate in the Makefiles.
879 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
880 case "$enable_ltdl_convenience" in
881 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
882 "") enable_ltdl_convenience=yes
883 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
885 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
888 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
889 # the libltdl installable library, and adds --enable-ltdl-install to
890 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
891 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
892 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
893 # '${top_builddir}/' (note the single quotes!) if your package is not
894 # flat, and, if you're not using automake, define top_builddir as
895 # appropriate in the Makefiles.
896 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
897 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
898 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
899 case "$enable_ltdl_install" in
900 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
901 "") enable_ltdl_install=yes
902 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
905 if test x"$enable_ltdl_install" != x"no"; then
906 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
911 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
912 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
913 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
914 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
915 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
916 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
917 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
918 AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
919 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
920 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl