1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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 dnl OpenLDAP Autoconf Macros
15 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
17 dnl Copyright 1998-2005 The OpenLDAP Foundation.
18 dnl All rights reserved.
20 dnl Redistribution and use in source and binary forms, with or without
21 dnl modification, are permitted only as authorized by the OpenLDAP
24 dnl A copy of this license is available in the file LICENSE in the
25 dnl top-level directory of the distribution or, alternatively, at
26 dnl <http://www.OpenLDAP.org/license.html>.
28 builtin(include, build/openldap.m4)dnl
30 # Do all the work for Automake. This macro actually does too much --
31 # some checks are only needed if your package does certain things.
32 # But this isn't really a big deal.
37 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
39 AC_DEFUN(AM_INIT_AUTOMAKE,
40 [AC_REQUIRE([AC_PROG_INSTALL])
41 dnl We require 2.13 because we rely on SHELL being computed by configure.
47 dnl test to see if srcdir already configured
48 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
49 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
52 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
53 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
54 AC_REQUIRE([AM_SANITY_CHECK])
55 AC_REQUIRE([AC_ARG_PROGRAM])
56 dnl FIXME This is truly gross.
57 missing_dir=`cd $ac_aux_dir && pwd`
58 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
59 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
60 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
61 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
62 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
63 dnl Set install_sh for make dist
64 install_sh="$missing_dir/install-sh"
65 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
67 dnl We check for tar when the user configures the end package.
68 dnl This is sad, since we only need this for "dist". However,
69 dnl there's no other good way to do it. We prefer GNU tar if
70 dnl we can find it. If we can't find a tar, it doesn't really matter.
71 AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
72 dnl We need awk for the "check" target. The system "awk" is bad on
74 AC_REQUIRE([AC_PROG_AWK])
76 if test -n "$AMTAR"; then
77 if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
83 AC_REQUIRE([AC_PROG_MAKE_SET])])
86 # Check to make sure that the build environment is sane.
89 AC_DEFUN(AM_SANITY_CHECK,
90 [AC_MSG_CHECKING([whether build environment is sane])
93 echo timestamp > conftestfile
94 # Do `set' in a subshell so we don't clobber the current shell's
95 # arguments. Must try -L first in case configure is actually a
96 # symlink; some systems play weird games with the mod time of symlinks
97 # (eg FreeBSD returns the mod time of the symlink's containing
100 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
101 if test "[$]*" = "X"; then
103 set X `ls -t $srcdir/configure conftestfile`
105 if test "[$]*" != "X $srcdir/configure conftestfile" \
106 && test "[$]*" != "X conftestfile $srcdir/configure"; then
108 # If neither matched, then we have a broken ls. This can happen
109 # if, for instance, CONFIG_SHELL is bash and it inherits a
110 # broken ls alias from the environment. This has actually
111 # happened. Such a system could not be considered "sane".
112 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
113 alias in your environment])
116 test "[$]2" = conftestfile
122 AC_MSG_ERROR([newly created file is older than distributed files!
123 Check your system clock])
128 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
129 dnl The program must properly implement --version.
130 AC_DEFUN(AM_MISSING_PROG,
131 [AC_MSG_CHECKING(for working $2)
132 # Run test in a subshell; some versions of sh will print an error if
133 # an executable is not found, even if stderr is redirected.
134 # Redirect stdin to placate older versions of autoconf. Sigh.
135 if ($2 --version) < /dev/null > /dev/null 2>&1; then
140 AC_MSG_RESULT(missing)
144 # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
146 # serial 46 AC_PROG_LIBTOOL
148 AC_DEFUN([AC_PROG_LIBTOOL],
149 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
151 # This can be used to rebuild libtool when needed
152 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
154 # Always use our own libtool.
155 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
158 # Prevent multiple expansion
159 define([AC_PROG_LIBTOOL], [])
162 AC_DEFUN([AC_LIBTOOL_SETUP],
164 AC_REQUIRE([AC_ENABLE_SHARED])dnl
165 AC_REQUIRE([AC_ENABLE_STATIC])dnl
166 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
167 AC_REQUIRE([AC_CANONICAL_HOST])dnl
168 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
169 AC_REQUIRE([AC_PROG_CC])dnl
170 AC_REQUIRE([AC_PROG_LD])dnl
171 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
172 AC_REQUIRE([AC_PROG_NM])dnl
173 AC_REQUIRE([LT_AC_PROG_SED])dnl
175 AC_REQUIRE([AC_PROG_LN_S])dnl
176 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
177 AC_REQUIRE([AC_OBJEXT])dnl
178 AC_REQUIRE([AC_EXEEXT])dnl
181 _LT_AC_PROG_ECHO_BACKSLASH
182 # Only perform the check for file, if the check method requires it
183 case $deplibs_check_method in
185 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
191 AC_CHECK_TOOL(RANLIB, ranlib, :)
192 AC_CHECK_TOOL(STRIP, strip, :)
194 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
195 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
196 enable_win32_dll=yes, enable_win32_dll=no)
198 AC_ARG_ENABLE(libtool-lock,
199 [ --disable-libtool-lock avoid locking (might break parallel builds)])
200 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
202 # Some flags need to be propagated to the compiler or linker for good
206 # Find out which ABI we are using.
207 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
208 if AC_TRY_EVAL(ac_compile); then
209 case `/usr/bin/file conftest.$ac_objext` in
225 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
226 SAVE_CFLAGS="$CFLAGS"
227 CFLAGS="$CFLAGS -belf"
228 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
231 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
233 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
234 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
235 CFLAGS="$SAVE_CFLAGS"
239 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
240 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
241 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
242 AC_CHECK_TOOL(AS, as, false)
243 AC_CHECK_TOOL(OBJDUMP, objdump, false)
245 # recent cygwin and mingw systems supply a stub DllMain which the user
246 # can override, but on older systems we have to supply one
247 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
249 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
251 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
254 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
255 # old mingw systems require "-dll" to link a DLL, while more recent ones
257 SAVE_CFLAGS="$CFLAGS"
258 CFLAGS="$CFLAGS -mdll"
259 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
260 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
261 CFLAGS="$SAVE_CFLAGS" ;;
262 *-*-cygwin* | *-*-pw32*)
263 # cygwin systems need to pass --dll to the linker, and not link
264 # crt.o which will require a WinMain@16 definition.
265 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
275 # AC_LIBTOOL_HEADER_ASSERT
276 # ------------------------
277 AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
278 [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
279 [lt_cv_func_assert_works],
282 if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
283 case `$CC --version 2>/dev/null` in
284 [[12]].*) lt_cv_func_assert_works=no ;;
285 *) lt_cv_func_assert_works=yes ;;
291 if test "x$lt_cv_func_assert_works" = xyes; then
292 AC_CHECK_HEADERS(assert.h)
294 ])# AC_LIBTOOL_HEADER_ASSERT
297 # --------------------
298 AC_DEFUN([_LT_AC_CHECK_DLFCN],
299 [AC_CHECK_HEADERS(dlfcn.h)
300 ])# _LT_AC_CHECK_DLFCN
302 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
303 # ---------------------------------
304 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
305 [AC_REQUIRE([AC_CANONICAL_HOST])
306 AC_REQUIRE([AC_PROG_NM])
307 AC_REQUIRE([AC_OBJEXT])
308 # Check for command to grab the raw symbol name followed by C symbol from nm.
309 AC_MSG_CHECKING([command to parse $NM output])
310 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
312 # These are sane defaults that work on at least a few old systems.
313 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
315 # Character class describing NM global symbol codes.
316 symcode='[[BCDEGRST]]'
318 # Regexp to match symbols that can be accessed directly from C.
319 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
321 # Transform the above into a raw symbol and a C symbol.
324 # Transform an extracted symbol line into a proper C declaration
325 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
327 # Transform an extracted symbol line into symbol name and symbol address
328 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
330 # Define system-specific variables.
335 cygwin* | mingw* | pw32*)
336 symcode='[[ABCDGISTW]]'
338 hpux*) # Its linker distinguishes data from code symbols
339 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
340 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
343 symcode='[[BCDEGRST]]'
346 symcode='[[BCDEGQRST]]'
356 # Handle CRLF in mingw tool chain
360 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
364 # If we're using GNU nm, then use its standard symbol codes.
365 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
366 symcode='[[ABCDGISTW]]'
369 # Try without a prefix undercore, then with it.
370 for ac_symprfx in "" "_"; do
372 # Write the raw and C identifiers.
373 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
375 # Check to see that the pipe works correctly.
378 cat > conftest.$ac_ext <<EOF
383 void nm_test_func(){}
387 int main(){nm_test_var='a';nm_test_func();return(0);}
390 if AC_TRY_EVAL(ac_compile); then
391 # Now try to grab the symbols.
393 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
394 # Try sorting and uniquifying the output.
395 if sort "$nlist" | uniq > "$nlist"T; then
396 mv -f "$nlist"T "$nlist"
401 # Make sure that we snagged all the symbols we need.
402 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
403 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
404 cat <<EOF > conftest.$ac_ext
410 # Now generate the symbol file.
411 eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
413 cat <<EOF >> conftest.$ac_ext
414 #if defined (__STDC__) && __STDC__
415 # define lt_ptr void *
417 # define lt_ptr char *
421 /* The mapping between symbol names and symbols. */
426 lt_preloaded_symbols[[]] =
429 sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
430 cat <<\EOF >> conftest.$ac_ext
438 # Now try linking the two files.
439 mv conftest.$ac_objext conftstm.$ac_objext
441 save_CFLAGS="$CFLAGS"
442 LIBS="conftstm.$ac_objext"
443 CFLAGS="$CFLAGS$no_builtin_flag"
444 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
448 CFLAGS="$save_CFLAGS"
450 echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
453 echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
456 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
459 echo "$progname: failed program was:" >&AC_FD_CC
460 cat conftest.$ac_ext >&5
462 rm -f conftest* conftst*
464 # Do not use the global_symbol_pipe unless it works.
465 if test "$pipe_works" = yes; then
468 lt_cv_sys_global_symbol_pipe=
472 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
473 if test -z "$lt_cv_sys_global_symbol_pipe"; then
474 global_symbol_to_cdecl=
475 global_symbol_to_c_name_address=
477 global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
478 global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
480 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
482 AC_MSG_RESULT(failed)
486 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
488 # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
489 # ---------------------------------
490 AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
491 [# Find the correct PATH separator. Usually this is `:', but
492 # DJGPP uses `;' like DOS.
493 if test "X${PATH_SEPARATOR+set}" != Xset; then
494 UNAME=${UNAME-`uname 2>/dev/null`}
496 *-DOS) lt_cv_sys_path_separator=';' ;;
497 *) lt_cv_sys_path_separator=':' ;;
499 PATH_SEPARATOR=$lt_cv_sys_path_separator
501 ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
503 # _LT_AC_PROG_ECHO_BACKSLASH
504 # --------------------------
505 # Add some code to the start of the generated configure script which
506 # will find an echo command which doesn't interpret backslashes.
507 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
508 [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
509 [AC_DIVERT_PUSH(NOTICE)])
510 _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
512 # Check that we are running under the correct shell.
513 SHELL=${CONFIG_SHELL-/bin/sh}
517 # Remove one level of quotation (which was required for Make).
518 ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
523 if test "X[$]1" = X--no-reexec; then
524 # Discard the --no-reexec flag, and continue.
526 elif test "X[$]1" = X--fallback-echo; then
527 # Avoid inline document here, it may be left over
529 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
530 # Yippee, $echo works!
533 # Restart under the correct shell.
534 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
537 if test "X[$]1" = X--fallback-echo; then
538 # used as fallback echo
546 # The HP-UX ksh and POSIX shell print the target directory to stdout
548 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
550 if test -z "$ECHO"; then
551 if test "X${echo_test_string+set}" != Xset; then
552 # find a string as large as possible, as long as the shell can cope with it
553 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
554 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
555 if (echo_test_string="`eval $cmd`") 2>/dev/null &&
556 echo_test_string="`eval $cmd`" &&
557 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
564 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
565 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
566 test "X$echo_testing_string" = "X$echo_test_string"; then
569 # The Solaris, AIX, and Digital Unix default echo programs unquote
570 # backslashes. This makes it impossible to quote backslashes using
571 # echo "$something" | sed 's/\\/\\\\/g'
573 # So, first we look for a working echo in the user's PATH.
575 IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
576 for dir in $PATH /usr/ucb; do
577 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
578 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
579 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
580 test "X$echo_testing_string" = "X$echo_test_string"; then
587 if test "X$echo" = Xecho; then
588 # We didn't find a better echo, so look for alternatives.
589 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
590 echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
591 test "X$echo_testing_string" = "X$echo_test_string"; then
592 # This shell has a builtin print -r that does the trick.
594 elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
595 test "X$CONFIG_SHELL" != X/bin/ksh; then
596 # If we have ksh, try running configure again with it.
597 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
598 export ORIGINAL_CONFIG_SHELL
599 CONFIG_SHELL=/bin/ksh
601 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
605 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
606 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
607 test "X$echo_testing_string" = "X$echo_test_string"; then
610 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
611 test "X$echo_testing_string" = 'X\t' &&
612 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
613 test "X$echo_testing_string" = "X$echo_test_string"; then
614 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
616 SHELL="$CONFIG_SHELL"
618 echo="$CONFIG_SHELL [$]0 --fallback-echo"
619 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
620 test "X$echo_testing_string" = 'X\t' &&
621 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
622 test "X$echo_testing_string" = "X$echo_test_string"; then
623 echo="$CONFIG_SHELL [$]0 --fallback-echo"
625 # maybe with a smaller string...
628 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
629 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
636 if test "$prev" != 'sed 50q "[$]0"'; then
637 echo_test_string=`eval $prev`
638 export echo_test_string
639 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
641 # Oops. We lost completely, so just stick with echo.
650 # Copy echo and quote the copy suitably for passing to libtool from
651 # the Makefile, instead of quoting the original, which is used later.
653 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
654 ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
659 ])# _LT_AC_PROG_ECHO_BACKSLASH
661 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
662 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
663 # ------------------------------------------------------------------
664 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
665 [if test "$cross_compiling" = yes; then :
668 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
669 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
670 lt_status=$lt_dlunknown
671 cat > conftest.$ac_ext <<EOF
672 [#line __oline__ "configure"
673 #include "confdefs.h"
682 # define LT_DLGLOBAL RTLD_GLOBAL
685 # define LT_DLGLOBAL DL_GLOBAL
687 # define LT_DLGLOBAL 0
691 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
692 find out it does not work in some platform. */
693 #ifndef LT_DLLAZY_OR_NOW
695 # define LT_DLLAZY_OR_NOW RTLD_LAZY
698 # define LT_DLLAZY_OR_NOW DL_LAZY
701 # define LT_DLLAZY_OR_NOW RTLD_NOW
704 # define LT_DLLAZY_OR_NOW DL_NOW
706 # define LT_DLLAZY_OR_NOW 0
714 extern "C" void exit (int);
717 void fnord() { int i=42;}
720 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
721 int status = $lt_dlunknown;
725 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
726 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
727 /* dlclose (self); */
733 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
734 (./conftest; exit; ) 2>/dev/null
737 x$lt_dlno_uscore) $1 ;;
738 x$lt_dlneed_uscore) $2 ;;
739 x$lt_unknown|x*) $3 ;;
747 ])# _LT_AC_TRY_DLOPEN_SELF
749 # AC_LIBTOOL_DLOPEN_SELF
750 # -------------------
751 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
752 [if test "x$enable_dlopen" != xyes; then
753 enable_dlopen=unknown
754 enable_dlopen_self=unknown
755 enable_dlopen_self_static=unknown
762 lt_cv_dlopen="load_add_on"
764 lt_cv_dlopen_self=yes
767 cygwin* | mingw* | pw32*)
768 lt_cv_dlopen="LoadLibrary"
773 AC_CHECK_FUNC([shl_load],
774 [lt_cv_dlopen="shl_load"],
775 [AC_CHECK_LIB([dld], [shl_load],
776 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
777 [AC_CHECK_FUNC([dlopen],
778 [lt_cv_dlopen="dlopen"],
779 [AC_CHECK_LIB([dl], [dlopen],
780 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
781 [AC_CHECK_LIB([svld], [dlopen],
782 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
783 [AC_CHECK_LIB([dld], [dld_link],
784 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
793 if test "x$lt_cv_dlopen" != xno; then
799 case $lt_cv_dlopen in
801 save_CPPFLAGS="$CPPFLAGS"
802 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
803 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
805 save_LDFLAGS="$LDFLAGS"
806 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
809 LIBS="$lt_cv_dlopen_libs $LIBS"
811 AC_CACHE_CHECK([whether a program can dlopen itself],
812 lt_cv_dlopen_self, [dnl
813 _LT_AC_TRY_DLOPEN_SELF(
814 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
815 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
818 if test "x$lt_cv_dlopen_self" = xyes; then
819 LDFLAGS="$LDFLAGS $link_static_flag"
820 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
821 lt_cv_dlopen_self_static, [dnl
822 _LT_AC_TRY_DLOPEN_SELF(
823 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
824 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
828 CPPFLAGS="$save_CPPFLAGS"
829 LDFLAGS="$save_LDFLAGS"
834 case $lt_cv_dlopen_self in
835 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
836 *) enable_dlopen_self=unknown ;;
839 case $lt_cv_dlopen_self_static in
840 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
841 *) enable_dlopen_self_static=unknown ;;
844 ])# AC_LIBTOOL_DLOPEN_SELF
846 AC_DEFUN([_LT_AC_LTCONFIG_HACK],
847 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
848 # Sed substitution that helps us do robust quoting. It backslashifies
849 # metacharacters that are still active within double-quoted strings.
851 sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
853 # Same as above, but do not quote variable references.
854 double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
856 # Sed substitution to delay expansion of an escaped shell variable in a
857 # double_quote_subst'ed string.
858 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
864 default_ofile=libtool
867 # All known linkers require a `.a' archive for static linking (except M$VC,
868 # which needs '.lib').
870 ltmain="$ac_aux_dir/ltmain.sh"
871 ofile="$default_ofile"
872 with_gnu_ld="$lt_cv_prog_gnu_ld"
873 need_locks="$enable_libtool_lock"
878 # Set sane defaults for various variables
879 test -z "$AR" && AR=ar
880 test -z "$AR_FLAGS" && AR_FLAGS=cru
881 test -z "$AS" && AS=as
882 test -z "$CC" && CC=cc
883 test -z "$DLLTOOL" && DLLTOOL=dlltool
884 test -z "$LD" && LD=ld
885 test -z "$LN_S" && LN_S="ln -s"
886 test -z "$MAGIC_CMD" && MAGIC_CMD=file
887 test -z "$NM" && NM=nm
888 test -z "$OBJDUMP" && OBJDUMP=objdump
889 test -z "$RANLIB" && RANLIB=:
890 test -z "$STRIP" && STRIP=:
891 test -z "$ac_objext" && ac_objext=o
893 if test x"$host" != x"$build"; then
894 ac_tool_prefix=${host_alias}-
899 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
902 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
907 # AIX sometimes has problems with the GCC collect2 program. For some
908 # reason, if we set the COLLECT_NAMES environment variable, the problems
909 # vanish in a puff of smoke.
910 if test "X${COLLECT_NAMES+set}" != Xset; then
917 # Determine commands to create old-style static archives.
918 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
919 old_postinstall_cmds='chmod 644 $oldlib'
920 old_postuninstall_cmds=
922 if test -n "$RANLIB"; then
925 old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
928 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
931 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
934 # Allow CC to be a program name with arguments.
938 AC_MSG_CHECKING([for objdir])
939 rm -f .libs 2>/dev/null
940 mkdir .libs 2>/dev/null
941 if test -d .libs; then
944 # MS-DOS does not allow filenames that begin with a dot.
947 rmdir .libs 2>/dev/null
948 AC_MSG_RESULT($objdir)
952 [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
953 pic_mode="$withval", pic_mode=default)
954 test -z "$pic_mode" && pic_mode=default
956 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
957 # in isolation, and that seeing it set (from the cache) indicates that
958 # the associated values are set (in the cache) correctly too.
959 AC_MSG_CHECKING([for $compiler option to produce PIC])
960 AC_CACHE_VAL(lt_cv_prog_cc_pic,
964 lt_cv_prog_cc_static=
965 lt_cv_prog_cc_no_builtin=
966 lt_cv_prog_cc_can_build_shared=$can_build_shared
968 if test "$GCC" = yes; then
969 lt_cv_prog_cc_wl='-Wl,'
970 lt_cv_prog_cc_static='-static'
974 # Below there is a dirty hack to force normal static linking with -ldl
975 # The problem is because libdl dynamically linked with both libc and
976 # libC (AIX C++ library), which obviously doesn't included in libraries
977 # list by gcc. This cause undefined symbols with -static flags.
978 # This hack allows C programs to be linked with "-static -ldl", but
979 # not sure about C++ programs.
980 lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
983 # FIXME: we need at least 68020 code to build shared libraries, but
984 # adding the `-m68020' flag to GCC prevents building anything better,
986 lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
988 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
989 # PIC is the default for these OSes.
992 # PIC is the default on this platform
993 # Common symbols not allowed in MH_DYLIB files
994 lt_cv_prog_cc_pic='-fno-common'
996 cygwin* | mingw* | pw32* | os2*)
997 # This hack is so that the source file can tell whether it is being
998 # built for inclusion in a dll (and should export symbols for example).
999 lt_cv_prog_cc_pic='-DDLL_EXPORT'
1002 if test -d /usr/nec; then
1003 lt_cv_prog_cc_pic=-Kconform_pic
1007 lt_cv_prog_cc_pic='-fPIC'
1011 # PORTME Check for PIC flags for the system compiler.
1013 aix3* | aix4* | aix5*)
1014 lt_cv_prog_cc_wl='-Wl,'
1015 # All AIX code is PIC.
1016 if test "$host_cpu" = ia64; then
1017 # AIX 5 now supports IA64 processor
1018 lt_cv_prog_cc_static='-Bstatic'
1020 lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1024 hpux9* | hpux10* | hpux11*)
1025 # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1026 lt_cv_prog_cc_wl='-Wl,'
1027 lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1028 lt_cv_prog_cc_pic='+Z'
1031 irix5* | irix6* | nonstopux*)
1032 lt_cv_prog_cc_wl='-Wl,'
1033 lt_cv_prog_cc_static='-non_shared'
1034 # PIC (with -KPIC) is the default.
1037 cygwin* | mingw* | pw32* | os2*)
1038 # This hack is so that the source file can tell whether it is being
1039 # built for inclusion in a dll (and should export symbols for example).
1040 lt_cv_prog_cc_pic='-DDLL_EXPORT'
1044 lt_cv_prog_cc_pic='-KPIC'
1045 lt_cv_prog_cc_static='-Bstatic'
1048 osf3* | osf4* | osf5*)
1049 # All OSF/1 code is PIC.
1050 lt_cv_prog_cc_wl='-Wl,'
1051 lt_cv_prog_cc_static='-non_shared'
1055 lt_cv_prog_cc_pic='-Kpic'
1056 lt_cv_prog_cc_static='-dn'
1057 lt_cv_prog_cc_shlib='-belf'
1061 lt_cv_prog_cc_pic='-KPIC'
1062 lt_cv_prog_cc_static='-Bstatic'
1063 lt_cv_prog_cc_wl='-Wl,'
1067 lt_cv_prog_cc_pic='-PIC'
1068 lt_cv_prog_cc_static='-Bstatic'
1069 lt_cv_prog_cc_wl='-Qoption ld '
1072 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1073 lt_cv_prog_cc_pic='-KPIC'
1074 lt_cv_prog_cc_static='-Bstatic'
1075 lt_cv_prog_cc_wl='-Wl,'
1079 lt_cv_prog_cc_pic='-pic'
1080 lt_cv_prog_cc_static='-Bstatic'
1084 if test -d /usr/nec ;then
1085 lt_cv_prog_cc_pic='-Kconform_pic'
1086 lt_cv_prog_cc_static='-Bstatic'
1091 lt_cv_prog_cc_can_build_shared=no
1096 if test -z "$lt_cv_prog_cc_pic"; then
1097 AC_MSG_RESULT([none])
1099 AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1101 # Check to make sure the pic_flag actually works.
1102 AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1103 AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1104 save_CFLAGS="$CFLAGS"
1105 CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1106 AC_TRY_COMPILE([], [], [dnl
1108 hpux9* | hpux10* | hpux11*)
1109 # On HP-UX, both CC and GCC only warn that PIC is supported... then
1110 # they create non-PIC objects. So, if there were any warnings, we
1111 # assume that PIC is not supported.
1112 if test -s conftest.err; then
1113 lt_cv_prog_cc_pic_works=no
1115 lt_cv_prog_cc_pic_works=yes
1119 lt_cv_prog_cc_pic_works=yes
1123 lt_cv_prog_cc_pic_works=no
1125 CFLAGS="$save_CFLAGS"
1128 if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1130 lt_cv_prog_cc_can_build_shared=no
1132 lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1135 AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1138 # Check for any special shared library compilation flags.
1139 if test -n "$lt_cv_prog_cc_shlib"; then
1140 AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1141 if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
1143 AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
1144 lt_cv_prog_cc_can_build_shared=no
1148 AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
1149 AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
1150 lt_cv_prog_cc_static_works=no
1151 save_LDFLAGS="$LDFLAGS"
1152 LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
1153 AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
1154 LDFLAGS="$save_LDFLAGS"
1157 # Belt *and* braces to stop my trousers falling down:
1158 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
1159 AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
1161 pic_flag="$lt_cv_prog_cc_pic"
1162 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
1163 wl="$lt_cv_prog_cc_wl"
1164 link_static_flag="$lt_cv_prog_cc_static"
1165 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
1166 can_build_shared="$lt_cv_prog_cc_can_build_shared"
1169 # Check to see if options -o and -c are simultaneously supported by compiler
1170 AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
1171 AC_CACHE_VAL([lt_cv_compiler_c_o], [
1172 $rm -r conftest 2>/dev/null
1175 echo "int some_variable = 0;" > conftest.$ac_ext
1177 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1178 # that will create temporary files in the current directory regardless of
1179 # the output directory. Thus, making CWD read-only will cause this test
1180 # to fail, enabling locking or at least warning the user not to do parallel
1183 save_CFLAGS="$CFLAGS"
1184 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
1186 if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
1187 # The compiler can only warn and ignore the option if not recognized
1188 # So say no if there are warnings
1189 if test -s out/conftest.err; then
1190 lt_cv_compiler_c_o=no
1192 lt_cv_compiler_c_o=yes
1195 # Append any errors to the config.log.
1196 cat out/conftest.err 1>&AC_FD_CC
1197 lt_cv_compiler_c_o=no
1199 CFLAGS="$save_CFLAGS"
1205 $rm -r conftest 2>/dev/null
1207 compiler_c_o=$lt_cv_compiler_c_o
1208 AC_MSG_RESULT([$compiler_c_o])
1210 if test x"$compiler_c_o" = x"yes"; then
1211 # Check to see if we can write to a .lo
1212 AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
1213 AC_CACHE_VAL([lt_cv_compiler_o_lo], [
1214 lt_cv_compiler_o_lo=no
1215 save_CFLAGS="$CFLAGS"
1216 CFLAGS="$CFLAGS -c -o conftest.lo"
1217 save_objext="$ac_objext"
1219 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1220 # The compiler can only warn and ignore the option if not recognized
1221 # So say no if there are warnings
1222 if test -s conftest.err; then
1223 lt_cv_compiler_o_lo=no
1225 lt_cv_compiler_o_lo=yes
1228 ac_objext="$save_objext"
1229 CFLAGS="$save_CFLAGS"
1231 compiler_o_lo=$lt_cv_compiler_o_lo
1232 AC_MSG_RESULT([$compiler_o_lo])
1237 # Check to see if we can do hard links to lock some files if needed
1238 hard_links="nottested"
1239 if test "$compiler_c_o" = no && test "$need_locks" != no; then
1240 # do not overwrite the value of need_locks provided by the user
1241 AC_MSG_CHECKING([if we can lock with hard links])
1244 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1246 ln conftest.a conftest.b 2>&5 || hard_links=no
1247 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1248 AC_MSG_RESULT([$hard_links])
1249 if test "$hard_links" = no; then
1250 AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
1257 if test "$GCC" = yes; then
1258 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
1259 AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
1260 echo "int some_variable = 0;" > conftest.$ac_ext
1261 save_CFLAGS="$CFLAGS"
1262 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
1263 compiler_rtti_exceptions=no
1264 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1265 # The compiler can only warn and ignore the option if not recognized
1266 # So say no if there are warnings
1267 if test -s conftest.err; then
1268 compiler_rtti_exceptions=no
1270 compiler_rtti_exceptions=yes
1273 CFLAGS="$save_CFLAGS"
1274 AC_MSG_RESULT([$compiler_rtti_exceptions])
1276 if test "$compiler_rtti_exceptions" = "yes"; then
1277 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
1279 no_builtin_flag=' -fno-builtin'
1283 # See if the linker supports building shared libraries.
1284 AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
1286 allow_undefined_flag=
1288 need_lib_prefix=unknown
1289 need_version=unknown
1290 # when you set need_version to no, make sure it does not cause -set_version
1291 # flags to be left without arguments
1293 archive_expsym_cmds=
1294 old_archive_from_new_cmds=
1295 old_archive_from_expsyms_cmds=
1296 export_dynamic_flag_spec=
1297 whole_archive_flag_spec=
1298 thread_safe_flag_spec=
1299 hardcode_into_libs=no
1300 hardcode_libdir_flag_spec=
1301 hardcode_libdir_separator=
1304 hardcode_shlibpath_var=unsupported
1306 link_all_deplibs=unknown
1307 always_export_symbols=no
1308 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1309 # include_expsyms should be a list of space-separated symbols to be *always*
1310 # included in the symbol list
1312 # exclude_expsyms can be an egrep regular expression of symbols to exclude
1313 # it will be wrapped by ` (' and `)$', so one must not match beginning or
1314 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1315 # as well as any symbol that contains `d'.
1316 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1317 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1318 # platforms (ab)use it in PIC code, but their linkers get confused if
1319 # the symbol is explicitly referenced. Since portable code cannot
1320 # rely on this symbol name, it's probably fine to never include it in
1321 # preloaded symbol tables.
1322 extract_expsyms_cmds=
1325 cygwin* | mingw* | pw32*)
1326 # FIXME: the MSVC++ port hasn't been tested in a loooong time
1327 # When not using gcc, we currently assume that we are using
1328 # Microsoft Visual C++.
1329 if test "$GCC" != yes; then
1339 if test "$with_gnu_ld" = yes; then
1340 # If archive_cmds runs LD, not CC, wlarc should be empty
1343 # See if GNU ld supports shared libraries.
1345 aix3* | aix4* | aix5*)
1346 # On AIX, the GNU linker is very broken
1347 # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
1351 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
1352 *** to be unable to reliably create shared libraries on AIX.
1353 *** Therefore, libtool is disabling shared libraries support. If you
1354 *** really care for shared libraries, you may want to modify your PATH
1355 *** so that a non-GNU linker is found, and then restart.
1361 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1362 hardcode_libdir_flag_spec='-L$libdir'
1363 hardcode_minus_L=yes
1365 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1366 # that the semantics of dynamic libraries on AmigaOS, at least up
1367 # to version 4, is to share data among multiple programs linked
1368 # with the same dynamic library. Since this doesn't match the
1369 # behavior of shared libraries on other platforms, we can use
1375 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1376 allow_undefined_flag=unsupported
1377 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1378 # support --undefined. This deserves some investigation. FIXME
1379 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1385 cygwin* | mingw* | pw32*)
1386 # hardcode_libdir_flag_spec is actually meaningless, as there is
1387 # no search path for DLLs.
1388 hardcode_libdir_flag_spec='-L$libdir'
1389 allow_undefined_flag=unsupported
1390 always_export_symbols=yes
1392 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1393 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
1394 test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1395 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1396 else $CC -o impgen impgen.c ; fi)~
1397 $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
1399 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1401 # cygwin and mingw dlls have different entry points and sets of symbols
1403 # FIXME: what about values for MSVC?
1404 dll_entry=__cygwin_dll_entry@12
1405 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1409 dll_entry=_DllMainCRTStartup@12
1410 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1414 # mingw and cygwin differ, and it's simplest to just exclude the union
1415 # of the two symbol sets.
1416 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1418 # recent cygwin and mingw systems supply a stub DllMain which the user
1419 # can override, but on older systems we have to supply one (in ltdll.c)
1420 if test "x$lt_cv_need_dllmain" = "xyes"; then
1421 ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
1422 ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
1423 test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1429 # Extract the symbol export list from an `--export-all' def file,
1430 # then regenerate the def file from the symbol export list, so that
1431 # the compiled dll only exports the symbol export list.
1432 # Be careful not to strip the DATA tag left be newer dlltools.
1433 export_symbols_cmds="$ltdll_cmds"'
1434 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1435 sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1437 # If the export-symbols file already is a .def file (1st line
1438 # is EXPORTS), use it as is.
1439 # If DATA tags from a recent dlltool are present, honour them!
1440 archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
1441 cp $export_symbols $output_objdir/$soname-def;
1443 echo EXPORTS > $output_objdir/$soname-def;
1445 cat $export_symbols | while read symbol; do
1448 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1449 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
1450 *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
1452 _lt_hint=`expr 1 + \$_lt_hint`;
1456 $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1457 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1458 $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1459 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
1460 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1464 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1465 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1468 archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1469 archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1474 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1478 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1479 *** create shared libraries on Solaris systems. Therefore, libtool
1480 *** is disabling shared libraries support. We urge you to upgrade GNU
1481 *** binutils to release 2.9.1 or newer. Another option is to modify
1482 *** your PATH or compiler configuration so that the native linker is
1483 *** used, and then restart.
1486 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1487 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1488 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1495 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1498 hardcode_shlibpath_var=no
1502 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1503 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1504 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1511 if test "$ld_shlibs" = yes; then
1512 runpath_var=LD_RUN_PATH
1513 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1514 export_dynamic_flag_spec='${wl}--export-dynamic'
1516 cygwin* | mingw* | pw32*)
1517 # dlltool doesn't understand --whole-archive et. al.
1518 whole_archive_flag_spec=
1521 # ancient GNU ld didn't support --whole-archive et. al.
1522 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1523 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1525 whole_archive_flag_spec=
1531 # PORTME fill in a description of your system's linker (not GNU ld)
1534 allow_undefined_flag=unsupported
1535 always_export_symbols=yes
1536 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
1537 # Note: this linker hardcodes the directories in LIBPATH if there
1538 # are no directories specified by -L.
1539 hardcode_minus_L=yes
1540 if test "$GCC" = yes && test -z "$link_static_flag"; then
1541 # Neither direct hardcoding nor static linking is supported with a
1543 hardcode_direct=unsupported
1548 if test "$host_cpu" = ia64; then
1549 # On IA64, the linker does run time linking by default, so we don't
1550 # have to do anything special.
1551 aix_use_runtimelinking=no
1552 exp_sym_flag='-Bexport'
1555 aix_use_runtimelinking=no
1557 # Test if we are trying to use run time linking or normal
1558 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
1559 # need to do runtime linking.
1560 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
1561 for ld_flag in $LDFLAGS; do
1564 aix_use_runtimelinking=yes
1571 exp_sym_flag='-bexport'
1572 no_entry_flag='-bnoentry'
1575 # When large executables or shared objects are built, AIX ld can
1576 # have problems creating the table of contents. If linking a library
1577 # or program results in "error TOC overflow" add -mminimal-toc to
1578 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
1579 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
1583 hardcode_libdir_separator=':'
1584 if test "$GCC" = yes; then
1585 case $host_os in aix4.[[012]]|aix4.[[012]].*)
1586 collect2name=`${CC} -print-prog-name=collect2`
1587 if test -f "$collect2name" && \
1588 strings "$collect2name" | grep resolve_lib_name >/dev/null
1590 # We have reworked collect2
1593 # We have old collect2
1594 hardcode_direct=unsupported
1595 # It fails to find uninstalled libraries when the uninstalled
1596 # path is not listed in the libpath. Setting hardcode_minus_L
1597 # to unsupported forces relinking
1598 hardcode_minus_L=yes
1599 hardcode_libdir_flag_spec='-L$libdir'
1600 hardcode_libdir_separator=
1604 shared_flag='-shared'
1607 if test "$host_cpu" = ia64; then
1608 shared_flag='${wl}-G'
1610 if test "$aix_use_runtimelinking" = yes; then
1611 shared_flag='${wl}-G'
1613 shared_flag='${wl}-bM:SRE'
1618 # It seems that -bexpall can do strange things, so it is better to
1619 # generate a list of symbols to export.
1620 always_export_symbols=yes
1621 if test "$aix_use_runtimelinking" = yes; then
1622 # Warning - without using the other runtime loading flags (-brtl),
1623 # -berok will link without error, but may produce a broken library.
1624 allow_undefined_flag='-berok'
1625 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
1626 archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
1628 if test "$host_cpu" = ia64; then
1629 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
1630 allow_undefined_flag="-z nodefs"
1631 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
1633 hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
1634 # Warning - without using the other run time loading flags,
1635 # -berok will link without error, but may produce a broken library.
1636 allow_undefined_flag='${wl}-berok'
1637 # This is a bit strange, but is similar to how AIX traditionally builds
1638 # it's shared libraries.
1639 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
1645 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1646 hardcode_libdir_flag_spec='-L$libdir'
1647 hardcode_minus_L=yes
1648 # see comment about different semantics on the GNU ld section
1652 cygwin* | mingw* | pw32*)
1653 # When not using gcc, we currently assume that we are using
1654 # Microsoft Visual C++.
1655 # hardcode_libdir_flag_spec is actually meaningless, as there is
1656 # no search path for DLLs.
1657 hardcode_libdir_flag_spec=' '
1658 allow_undefined_flag=unsupported
1659 # Tell ltmain to make .lib files, not .a files.
1661 # FIXME: Setting linknames here is a bad hack.
1662 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1663 # The linker will automatically build a .lib file if we build a DLL.
1664 old_archive_from_new_cmds='true'
1665 # FIXME: Should let the user specify the lib program.
1666 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1667 fix_srcfile_path='`cygpath -w "$srcfile"`'
1670 darwin* | rhapsody*)
1672 rhapsody* | darwin1.[[012]])
1673 allow_undefined_flag='-undefined suppress'
1676 allow_undefined_flag='-flat_namespace -undefined suppress'
1679 # FIXME: Relying on posixy $() will cause problems for
1680 # cross-compilation, but unfortunately the echo tests do not
1681 # yet detect zsh echo's removal of \ escapes. Also zsh mangles
1682 # `"' quotes if we put them in here... so don't!
1683 archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
1684 # We need to add '_' to the symbols in $export_symbols first
1685 #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
1687 hardcode_shlibpath_var=no
1688 whole_archive_flag_spec='-all_load $convenience'
1695 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1696 # support. Future versions do this automatically, but an explicit c++rt0.o
1697 # does not break anything, and helps significantly (at the cost of a little
1700 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1701 hardcode_libdir_flag_spec='-R$libdir'
1703 hardcode_shlibpath_var=no
1706 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1708 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1710 hardcode_minus_L=yes
1711 hardcode_shlibpath_var=no
1714 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1716 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1717 hardcode_libdir_flag_spec='-R$libdir'
1719 hardcode_shlibpath_var=no
1722 hpux9* | hpux10* | hpux11*)
1724 hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
1725 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1727 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1728 hardcode_libdir_separator=:
1730 hardcode_minus_L=yes # Not in the search PATH, but as the default
1731 # location of the library.
1732 export_dynamic_flag_spec='${wl}-E'
1735 irix5* | irix6* | nonstopux*)
1736 if test "$GCC" = yes; then
1737 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1738 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1740 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1741 hardcode_libdir_flag_spec='-rpath $libdir'
1743 hardcode_libdir_separator=:
1744 link_all_deplibs=yes
1748 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1749 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
1751 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
1753 hardcode_libdir_flag_spec='-R$libdir'
1755 hardcode_shlibpath_var=no
1759 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1761 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1762 hardcode_libdir_separator=:
1763 hardcode_shlibpath_var=no
1768 hardcode_shlibpath_var=no
1769 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1770 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
1771 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1772 export_dynamic_flag_spec='${wl}-E'
1775 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
1776 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1777 hardcode_libdir_flag_spec='-R$libdir'
1780 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
1781 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1788 hardcode_libdir_flag_spec='-L$libdir'
1789 hardcode_minus_L=yes
1790 allow_undefined_flag=unsupported
1791 archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
1792 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1796 if test "$GCC" = yes; then
1797 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1798 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1800 allow_undefined_flag=' -expect_unresolved \*'
1801 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1803 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1804 hardcode_libdir_separator=:
1807 osf4* | osf5*) # as osf3* with the addition of -msym flag
1808 if test "$GCC" = yes; then
1809 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1810 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1811 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1813 allow_undefined_flag=' -expect_unresolved \*'
1814 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1815 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
1816 $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
1818 #Both c and cxx compiler support -rpath directly
1819 hardcode_libdir_flag_spec='-rpath $libdir'
1821 hardcode_libdir_separator=:
1825 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1826 hardcode_shlibpath_var=no
1827 runpath_var=LD_RUN_PATH
1828 hardcode_runpath_var=yes
1829 export_dynamic_flag_spec='${wl}-Bexport'
1833 # gcc --version < 3.0 without binutils cannot create self contained
1834 # shared libraries reliably, requiring libgcc.a to resolve some of
1835 # the object symbols generated in some cases. Libraries that use
1836 # assert need libgcc.a to resolve __eprintf, for example. Linking
1837 # a copy of libgcc.a into every shared library to guarantee resolving
1838 # such symbols causes other problems: According to Tim Van Holder
1839 # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
1840 # (to the application) exception stack for one thing.
1841 no_undefined_flag=' -z defs'
1842 if test "$GCC" = yes; then
1843 case `$CC --version 2>/dev/null` in
1847 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
1848 *** create self contained shared libraries on Solaris systems, without
1849 *** introducing a dependency on libgcc.a. Therefore, libtool is disabling
1850 *** -no-undefined support, which will at least allow you to build shared
1851 *** libraries. However, you may find that when you link such libraries
1852 *** into an application without using GCC, you have to manually add
1853 *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
1854 *** upgrade to a newer version of GCC. Another option is to rebuild your
1855 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
1862 # $CC -shared without GNU ld will not create a library from C++
1863 # object files and a static libstdc++, better avoid it by now
1864 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1865 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1866 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1867 hardcode_libdir_flag_spec='-R$libdir'
1868 hardcode_shlibpath_var=no
1870 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
1871 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1872 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1874 link_all_deplibs=yes
1878 if test "x$host_vendor" = xsequent; then
1879 # Use $CC to link under sequent, because it throws in some extra .o
1880 # files that make .init and .fini sections work.
1881 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
1883 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1885 hardcode_libdir_flag_spec='-L$libdir'
1887 hardcode_minus_L=yes
1888 hardcode_shlibpath_var=no
1892 case $host_vendor in
1894 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1895 hardcode_direct=yes # is this really true???
1898 ## LD is ld it makes a PLAMLIB
1899 ## CC just makes a GrossModule.
1900 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
1901 reload_cmds='$CC -r -o $output$reload_objs'
1905 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1906 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
1909 runpath_var='LD_RUN_PATH'
1910 hardcode_shlibpath_var=no
1914 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1915 hardcode_shlibpath_var=no
1916 export_dynamic_flag_spec='-Bexport'
1920 no_undefined_flag=' -z text'
1921 # $CC -shared without GNU ld will not create a library from C++
1922 # object files and a static libstdc++, better avoid it by now
1923 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1924 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1925 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1926 hardcode_libdir_flag_spec=
1927 hardcode_shlibpath_var=no
1928 runpath_var='LD_RUN_PATH'
1932 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1933 hardcode_libdir_flag_spec='-L$libdir'
1934 hardcode_shlibpath_var=no
1938 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1939 hardcode_libdir_flag_spec='-L$libdir'
1940 hardcode_shlibpath_var=no
1944 if test -d /usr/nec; then
1945 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1946 hardcode_shlibpath_var=no
1947 runpath_var=LD_RUN_PATH
1948 hardcode_runpath_var=yes
1954 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
1957 hardcode_shlibpath_var=no
1958 hardcode_runpath_var=yes
1959 runpath_var=LD_RUN_PATH
1962 sysv5uw7* | unixware7*)
1963 no_undefined_flag='${wl}-z ${wl}text'
1964 if test "$GCC" = yes; then
1965 archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
1967 archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
1969 runpath_var='LD_RUN_PATH'
1970 hardcode_shlibpath_var=no
1978 AC_MSG_RESULT([$ld_shlibs])
1979 test "$ld_shlibs" = no && can_build_shared=no
1981 # Check hardcoding attributes.
1982 AC_MSG_CHECKING([how to hardcode library paths into programs])
1984 if test -n "$hardcode_libdir_flag_spec" || \
1985 test -n "$runpath_var"; then
1987 # We can hardcode non-existant directories.
1988 if test "$hardcode_direct" != no &&
1989 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1990 # have to relink, otherwise we might link with an installed library
1991 # when we should be linking with a yet-to-be-installed one
1992 ## test "$hardcode_shlibpath_var" != no &&
1993 test "$hardcode_minus_L" != no; then
1994 # Linking always hardcodes the temporary library directory.
1995 hardcode_action=relink
1997 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1998 hardcode_action=immediate
2001 # We cannot hardcode anything, or else we can only hardcode existing
2003 hardcode_action=unsupported
2005 AC_MSG_RESULT([$hardcode_action])
2009 AC_MSG_CHECKING([whether stripping libraries is possible])
2010 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2011 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2012 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2013 AC_MSG_RESULT([yes])
2018 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2019 test -z "$deplibs_check_method" && deplibs_check_method=unknown
2021 # PORTME Fill in your ld.so characteristics
2022 AC_MSG_CHECKING([dynamic linker characteristics])
2024 libname_spec='lib$name'
2031 shlibpath_overrides_runpath=unknown
2033 dynamic_linker="$host_os ld.so"
2034 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2035 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2040 library_names_spec='${libname}${release}.so$versuffix $libname.a'
2041 shlibpath_var=LIBPATH
2043 # AIX has no versioning support, so we append a major version to the name.
2044 soname_spec='${libname}${release}.so$major'
2051 hardcode_into_libs=yes
2052 if test "$host_cpu" = ia64; then
2053 # AIX 5 supports IA64
2054 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2055 shlibpath_var=LD_LIBRARY_PATH
2057 # With GCC up to 2.95.x, collect2 would create an import file
2058 # for dependence libraries. The import file would start with
2059 # the line `#! .'. This would cause the generated library to
2060 # depend on `.', always an invalid library. This was fixed in
2061 # development snapshots of GCC prior to 3.0.
2063 aix4 | aix4.[[01]] | aix4.[[01]].*)
2064 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2066 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2073 # AIX (on Power*) has no versioning support, so currently we can
2074 # not hardcode correct soname into executable. Probably we can
2075 # add versioning support to collect2, so additional links can
2076 # be useful in future.
2077 if test "$aix_use_runtimelinking" = yes; then
2078 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2079 # instead of lib<name>.a to let people know that these are not
2080 # typical AIX shared libraries.
2081 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2083 # We preserve .a as extension for shared libraries through AIX4.2
2084 # and later when we are not doing run time linking.
2085 library_names_spec='${libname}${release}.a $libname.a'
2086 soname_spec='${libname}${release}.so$major'
2088 shlibpath_var=LIBPATH
2090 hardcode_into_libs=yes
2094 library_names_spec='$libname.ixlibrary $libname.a'
2095 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2096 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
2100 library_names_spec='${libname}.so'
2101 dynamic_linker="$host_os ld.so"
2102 shlibpath_var=LIBRARY_PATH
2108 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2109 soname_spec='${libname}${release}.so$major'
2110 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2111 shlibpath_var=LD_LIBRARY_PATH
2112 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2113 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2114 export_dynamic_flag_spec=-rdynamic
2115 # the default ld.so.conf also contains /usr/contrib/lib and
2116 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2117 # libtool to hard-code these into programs
2120 cygwin* | mingw* | pw32*)
2121 version_type=windows
2124 case $GCC,$host_os in
2126 library_names_spec='$libname.dll.a'
2127 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2128 postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2129 dldir=$destdir/`dirname \$dlpath`~
2130 test -d \$dldir || mkdir -p \$dldir~
2131 $install_prog .libs/$dlname \$dldir/$dlname'
2132 postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2133 dlpath=$dir/\$dldll~
2137 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2138 sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
2141 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2144 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
2147 dynamic_linker='Win32 ld.exe'
2148 # FIXME: first we should search . and the directory the executable is in
2152 darwin* | rhapsody*)
2153 dynamic_linker="$host_os dyld"
2157 # FIXME: Relying on posixy $() will cause problems for
2158 # cross-compilation, but unfortunately the echo tests do not
2159 # yet detect zsh echo's removal of \ escapes.
2160 library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
2161 soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2162 shlibpath_overrides_runpath=yes
2163 shlibpath_var=DYLD_LIBRARY_PATH
2171 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2172 version_type=freebsd-$objformat
2173 case $version_type in
2175 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2180 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2184 shlibpath_var=LD_LIBRARY_PATH
2187 shlibpath_overrides_runpath=yes
2190 shlibpath_overrides_runpath=no
2191 hardcode_into_libs=yes
2200 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2201 soname_spec='${libname}${release}.so$major'
2202 shlibpath_var=LD_LIBRARY_PATH
2203 hardcode_into_libs=yes
2206 hpux9* | hpux10* | hpux11*)
2207 # Give a soname corresponding to the major version so that dld.sl refuses to
2208 # link against other versions.
2209 dynamic_linker="$host_os dld.sl"
2213 shlibpath_var=SHLIB_PATH
2214 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2215 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2216 soname_spec='${libname}${release}.sl$major'
2217 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2218 postinstall_cmds='chmod 555 $lib'
2221 irix5* | irix6* | nonstopux*)
2223 nonstopux*) version_type=nonstopux ;;
2224 *) version_type=irix ;;
2228 soname_spec='${libname}${release}.so$major'
2229 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2231 irix5* | nonstopux*)
2235 case $LD in # libtool.m4 will add one of these switches to LD
2236 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2237 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2238 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2239 *) libsuff= shlibsuff= libmagic=never-match;;
2243 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2244 shlibpath_overrides_runpath=no
2245 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2246 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2249 # No shared lib support for Linux oldld, aout, or coff.
2250 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
2254 # This must be Linux ELF.
2259 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2260 soname_spec='${libname}${release}.so$major'
2261 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2262 shlibpath_var=LD_LIBRARY_PATH
2263 shlibpath_overrides_runpath=no
2264 # This implies no fast_install, which is unacceptable.
2265 # Some rework will be needed to allow for fast_install
2266 # before this can be enabled.
2267 hardcode_into_libs=yes
2269 # We used to test for /lib/ld.so.1 and disable shared libraries on
2270 # powerpc, because MkLinux only supported shared libraries with the
2271 # GNU dynamic linker. Since this was broken with cross compilers,
2272 # most powerpc-linux boxes support dynamic linking these days and
2273 # people can always --disable-shared, the test was removed, and we
2274 # assume the GNU/Linux dynamic linker is in use.
2275 dynamic_linker='GNU/Linux ld.so'
2282 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2283 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2284 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2285 dynamic_linker='NetBSD (a.out) ld.so'
2287 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2288 soname_spec='${libname}${release}.so$major'
2289 dynamic_linker='NetBSD ld.elf_so'
2291 shlibpath_var=LD_LIBRARY_PATH
2292 shlibpath_overrides_runpath=yes
2293 hardcode_into_libs=yes
2298 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2299 shlibpath_var=LD_LIBRARY_PATH
2300 shlibpath_overrides_runpath=yes
2307 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2309 openbsd2.[[89]] | openbsd2.[[89]].*)
2310 shlibpath_overrides_runpath=no
2313 shlibpath_overrides_runpath=yes
2317 shlibpath_overrides_runpath=yes
2319 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2320 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2321 shlibpath_var=LD_LIBRARY_PATH
2325 libname_spec='$name'
2327 library_names_spec='$libname.dll $libname.a'
2328 dynamic_linker='OS/2 ld.exe'
2329 shlibpath_var=LIBPATH
2332 osf3* | osf4* | osf5*)
2335 soname_spec='${libname}${release}.so$major'
2336 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2337 shlibpath_var=LD_LIBRARY_PATH
2338 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2339 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2340 hardcode_into_libs=yes
2345 soname_spec='${libname}${release}.so$major'
2346 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2347 shlibpath_var=LD_LIBRARY_PATH
2354 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2355 soname_spec='${libname}${release}.so$major'
2356 shlibpath_var=LD_LIBRARY_PATH
2357 shlibpath_overrides_runpath=yes
2358 hardcode_into_libs=yes
2359 # ldd complains unless libraries are executable
2360 postinstall_cmds='chmod +x $lib'
2365 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2366 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2367 shlibpath_var=LD_LIBRARY_PATH
2368 shlibpath_overrides_runpath=yes
2369 if test "$with_gnu_ld" = yes; then
2375 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2377 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2378 soname_spec='${libname}${release}.so$major'
2379 shlibpath_var=LD_LIBRARY_PATH
2380 case $host_vendor in
2382 shlibpath_overrides_runpath=no
2384 export_dynamic_flag_spec='${wl}-Blargedynsym'
2385 runpath_var=LD_RUN_PATH
2393 shlibpath_overrides_runpath=no
2394 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2401 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2402 soname_spec='${libname}${release}.so$major'
2403 shlibpath_var=LD_LIBRARY_PATH
2410 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2411 soname_spec='${libname}${release}.so$major'
2412 shlibpath_var=LD_LIBRARY_PATH
2416 if test -d /usr/nec ;then
2418 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2419 soname_spec='$libname.so.$major'
2420 shlibpath_var=LD_LIBRARY_PATH
2428 AC_MSG_RESULT([$dynamic_linker])
2429 test "$dynamic_linker" = no && can_build_shared=no
2431 # Report the final consequences.
2432 AC_MSG_CHECKING([if libtool supports shared libraries])
2433 AC_MSG_RESULT([$can_build_shared])
2435 AC_MSG_CHECKING([whether to build shared libraries])
2436 test "$can_build_shared" = "no" && enable_shared=no
2438 # On AIX, shared libraries and static libraries use the same namespace, and
2439 # are all built from PIC.
2442 test "$enable_shared" = yes && enable_static=no
2443 if test -n "$RANLIB"; then
2444 archive_cmds="$archive_cmds~\$RANLIB \$lib"
2445 postinstall_cmds='$RANLIB $lib'
2450 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2451 test "$enable_shared" = yes && enable_static=no
2455 AC_MSG_RESULT([$enable_shared])
2457 AC_MSG_CHECKING([whether to build static libraries])
2458 # Make sure either enable_shared or enable_static is yes.
2459 test "$enable_shared" = yes || enable_static=yes
2460 AC_MSG_RESULT([$enable_static])
2462 if test "$hardcode_action" = relink; then
2463 # Fast installation is not supported
2464 enable_fast_install=no
2465 elif test "$shlibpath_overrides_runpath" = yes ||
2466 test "$enable_shared" = no; then
2467 # Fast installation is not necessary
2468 enable_fast_install=needless
2471 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2472 if test "$GCC" = yes; then
2473 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2476 AC_LIBTOOL_DLOPEN_SELF
2478 if test "$enable_shared" = yes && test "$GCC" = yes; then
2479 case $archive_cmds in
2481 # FIXME: we may have to deal with multi-command sequences.
2484 # Test whether the compiler implicitly links with -lc since on some
2485 # systems, -lgcc has to come before -lc. If gcc already passes -lc
2486 # to ld, don't add -lc before -lgcc.
2487 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
2488 AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
2490 echo 'static int dummy;' > conftest.$ac_ext
2492 if AC_TRY_EVAL(ac_compile); then
2495 libobjs=conftest.$ac_objext
2497 wl=$lt_cv_prog_cc_wl
2503 save_allow_undefined_flag=$allow_undefined_flag
2504 allow_undefined_flag=
2505 if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
2507 lt_cv_archive_cmds_need_lc=no
2509 lt_cv_archive_cmds_need_lc=yes
2511 allow_undefined_flag=$save_allow_undefined_flag
2513 cat conftest.err 1>&5
2515 AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
2519 need_lc=${lt_cv_archive_cmds_need_lc-yes}
2521 # The second clause should only fire when bootstrapping the
2522 # libtool distribution, otherwise you forgot to ship ltmain.sh
2523 # with your package, and you will get complaints that there are
2524 # no rules to generate ltmain.sh.
2525 if test -f "$ltmain"; then
2528 # If there is no Makefile yet, we rely on a make rule to execute
2529 # `config.status --recheck' to rerun these tests and create the
2530 # libtool script then.
2531 test -f Makefile && make "$ltmain"
2534 if test -f "$ltmain"; then
2535 trap "$rm \"${ofile}T\"; exit 1" 1 2 15
2538 echo creating $ofile
2540 # Now quote all the things that may contain metacharacters while being
2541 # careful not to overquote the AC_SUBSTed values. We take copies of the
2542 # variables and quote the copies for generation of the libtool script.
2543 for var in echo old_CC old_CFLAGS SED \
2544 AR AR_FLAGS CC LD LN_S NM SHELL \
2545 reload_flag reload_cmds wl \
2546 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2547 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2548 library_names_spec soname_spec \
2549 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2550 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2551 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2552 old_striplib striplib file_magic_cmd export_symbols_cmds \
2553 deplibs_check_method allow_undefined_flag no_undefined_flag \
2554 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2555 global_symbol_to_c_name_address \
2556 hardcode_libdir_flag_spec hardcode_libdir_separator \
2557 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2558 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2561 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2562 old_postinstall_cmds | old_postuninstall_cmds | \
2563 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2564 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2565 postinstall_cmds | postuninstall_cmds | \
2566 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2567 # Double-quote double-evaled strings.
2568 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2571 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2576 cat <<__EOF__ > "${ofile}T"
2579 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2580 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2581 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
2583 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2584 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2586 # This program is free software; you can redistribute it and/or modify
2587 # it under the terms of the GNU General Public License as published by
2588 # the Free Software Foundation; either version 2 of the License, or
2589 # (at your option) any later version.
2591 # This program is distributed in the hope that it will be useful, but
2592 # WITHOUT ANY WARRANTY; without even the implied warranty of
2593 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2594 # General Public License for more details.
2596 # You should have received a copy of the GNU General Public License
2597 # along with this program; if not, write to the Free Software
2598 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2600 # As a special exception to the GNU General Public License, if you
2601 # distribute this file as part of a program that contains a
2602 # configuration script generated by Autoconf, you may include it under
2603 # the same distribution terms that you use for the rest of that program.
2605 # A sed that does not truncate output.
2608 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2609 Xsed="${SED} -e s/^X//"
2611 # The HP-UX ksh and POSIX shell print the target directory to stdout
2613 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2615 # ### BEGIN LIBTOOL CONFIG
2617 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2619 # Shell to use when invoking shell scripts.
2622 # Whether or not to build shared libraries.
2623 build_libtool_libs=$enable_shared
2625 # Whether or not to build static libraries.
2626 build_old_libs=$enable_static
2628 # Whether or not to add -lc for building shared libraries.
2629 build_libtool_need_lc=$need_lc
2631 # Whether or not to optimize for fast installation.
2632 fast_install=$enable_fast_install
2635 host_alias=$host_alias
2638 # An echo program that does not interpret backslashes.
2643 AR_FLAGS=$lt_AR_FLAGS
2645 # The default C compiler.
2648 # Is the compiler the GNU C compiler?
2651 # The linker used to build libraries.
2654 # Whether we need hard or soft links.
2657 # A BSD-compatible nm program.
2660 # A symbol stripping program
2663 # Used to examine libraries when file_magic_cmd begins "file"
2664 MAGIC_CMD=$MAGIC_CMD
2666 # Used on cygwin: DLL creation program.
2669 # Used on cygwin: object dumper.
2672 # Used on cygwin: assembler.
2675 # The name of the directory that contains temporary libtool files.
2678 # How to create reloadable object files.
2679 reload_flag=$lt_reload_flag
2680 reload_cmds=$lt_reload_cmds
2682 # How to pass a linker flag through the compiler.
2685 # Object file suffix (normally "o").
2688 # Old archive suffix (normally "a").
2691 # Executable file suffix (normally "").
2694 # Additional compiler flags for building library objects.
2695 pic_flag=$lt_pic_flag
2698 # Does compiler simultaneously support -c and -o options?
2699 compiler_c_o=$lt_compiler_c_o
2701 # Can we write directly to a .lo ?
2702 compiler_o_lo=$lt_compiler_o_lo
2704 # Must we lock files when doing compilation ?
2705 need_locks=$lt_need_locks
2707 # Do we need the lib prefix for modules?
2708 need_lib_prefix=$need_lib_prefix
2710 # Do we need a version for libraries?
2711 need_version=$need_version
2713 # Whether dlopen is supported.
2714 dlopen_support=$enable_dlopen
2716 # Whether dlopen of programs is supported.
2717 dlopen_self=$enable_dlopen_self
2719 # Whether dlopen of statically linked programs is supported.
2720 dlopen_self_static=$enable_dlopen_self_static
2722 # Compiler flag to prevent dynamic linking.
2723 link_static_flag=$lt_link_static_flag
2725 # Compiler flag to turn off builtin functions.
2726 no_builtin_flag=$lt_no_builtin_flag
2728 # Compiler flag to allow reflexive dlopens.
2729 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
2731 # Compiler flag to generate shared objects directly from archives.
2732 whole_archive_flag_spec=$lt_whole_archive_flag_spec
2734 # Compiler flag to generate thread-safe objects.
2735 thread_safe_flag_spec=$lt_thread_safe_flag_spec
2737 # Library versioning type.
2738 version_type=$version_type
2740 # Format of library name prefix.
2741 libname_spec=$lt_libname_spec
2743 # List of archive names. First name is the real one, the rest are links.
2744 # The last name is the one that the linker finds with -lNAME.
2745 library_names_spec=$lt_library_names_spec
2747 # The coded name of the library, if different from the real name.
2748 soname_spec=$lt_soname_spec
2750 # Commands used to build and install an old-style archive.
2752 old_archive_cmds=$lt_old_archive_cmds
2753 old_postinstall_cmds=$lt_old_postinstall_cmds
2754 old_postuninstall_cmds=$lt_old_postuninstall_cmds
2756 # Create an old-style archive from a shared archive.
2757 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
2759 # Create a temporary old-style archive to link instead of a shared archive.
2760 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
2762 # Commands used to build and install a shared archive.
2763 archive_cmds=$lt_archive_cmds
2764 archive_expsym_cmds=$lt_archive_expsym_cmds
2765 postinstall_cmds=$lt_postinstall_cmds
2766 postuninstall_cmds=$lt_postuninstall_cmds
2768 # Commands to strip libraries.
2769 old_striplib=$lt_old_striplib
2770 striplib=$lt_striplib
2772 # Method to check whether dependent libraries are shared objects.
2773 deplibs_check_method=$lt_deplibs_check_method
2775 # Command to use when deplibs_check_method == file_magic.
2776 file_magic_cmd=$lt_file_magic_cmd
2778 # Flag that allows shared libraries with undefined symbols to be built.
2779 allow_undefined_flag=$lt_allow_undefined_flag
2781 # Flag that forces no undefined symbols.
2782 no_undefined_flag=$lt_no_undefined_flag
2784 # Commands used to finish a libtool library installation in a directory.
2785 finish_cmds=$lt_finish_cmds
2787 # Same as above, but a single script fragment to be evaled but not shown.
2788 finish_eval=$lt_finish_eval
2790 # Take the output of nm and produce a listing of raw symbols and C names.
2791 global_symbol_pipe=$lt_global_symbol_pipe
2793 # Transform the output of nm in a proper C declaration
2794 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
2796 # Transform the output of nm in a C name address pair
2797 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
2799 # This is the shared library runtime path variable.
2800 runpath_var=$runpath_var
2802 # This is the shared library path variable.
2803 shlibpath_var=$shlibpath_var
2805 # Is shlibpath searched before the hard-coded library search path?
2806 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2808 # How to hardcode a shared library path into an executable.
2809 hardcode_action=$hardcode_action
2811 # Whether we should hardcode library paths into libraries.
2812 hardcode_into_libs=$hardcode_into_libs
2814 # Flag to hardcode \$libdir into a binary during linking.
2815 # This must work even if \$libdir does not exist.
2816 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
2818 # Whether we need a single -rpath flag with a separated argument.
2819 hardcode_libdir_separator=$lt_hardcode_libdir_separator
2821 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2823 hardcode_direct=$hardcode_direct
2825 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2827 hardcode_minus_L=$hardcode_minus_L
2829 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2830 # the resulting binary.
2831 hardcode_shlibpath_var=$hardcode_shlibpath_var
2833 # Variables whose values should be saved in libtool wrapper scripts and
2834 # restored at relink time.
2835 variables_saved_for_relink="$variables_saved_for_relink"
2837 # Whether libtool must link a program against all its dependency libraries.
2838 link_all_deplibs=$link_all_deplibs
2840 # Compile-time system search path for libraries
2841 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
2843 # Run-time system search path for libraries
2844 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
2846 # Fix the shell variable \$srcfile for the compiler.
2847 fix_srcfile_path="$fix_srcfile_path"
2849 # Set to yes if exported symbols are required.
2850 always_export_symbols=$always_export_symbols
2852 # The commands to list exported symbols.
2853 export_symbols_cmds=$lt_export_symbols_cmds
2855 # The commands to extract the exported symbol list from a shared archive.
2856 extract_expsyms_cmds=$lt_extract_expsyms_cmds
2858 # Symbols that should not be listed in the preloaded symbols.
2859 exclude_expsyms=$lt_exclude_expsyms
2861 # Symbols that must always be exported.
2862 include_expsyms=$lt_include_expsyms
2864 # ### END LIBTOOL CONFIG
2870 cat <<\EOF >> "${ofile}T"
2872 # AIX sometimes has problems with the GCC collect2 program. For some
2873 # reason, if we set the COLLECT_NAMES environment variable, the problems
2874 # vanish in a puff of smoke.
2875 if test "X${COLLECT_NAMES+set}" != Xset; then
2877 export COLLECT_NAMES
2884 cygwin* | mingw* | pw32* | os2*)
2885 cat <<'EOF' >> "${ofile}T"
2886 # This is a source program that is used to create dlls on Windows
2887 # Don't remove nor modify the starting and closing comments
2888 # /* ltdll.c starts here */
2889 # #define WIN32_LEAN_AND_MEAN
2890 # #include <windows.h>
2891 # #undef WIN32_LEAN_AND_MEAN
2892 # #include <stdio.h>
2894 # #ifndef __CYGWIN__
2895 # # ifdef __CYGWIN32__
2896 # # define __CYGWIN__ __CYGWIN32__
2900 # #ifdef __cplusplus
2903 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2904 # #ifdef __cplusplus
2909 # #include <cygwin/cygwin_dll.h>
2910 # DECLARE_CYGWIN_DLL( DllMain );
2912 # HINSTANCE __hDllInstance_base;
2915 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2917 # __hDllInstance_base = hInst;
2920 # /* ltdll.c ends here */
2921 # This is a source program that is used to create import libraries
2922 # on Windows for dlls which lack them. Don't remove nor modify the
2923 # starting and closing comments
2924 # /* impgen.c starts here */
2925 # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
2927 # This file is part of GNU libtool.
2929 # This program is free software; you can redistribute it and/or modify
2930 # it under the terms of the GNU General Public License as published by
2931 # the Free Software Foundation; either version 2 of the License, or
2932 # (at your option) any later version.
2934 # This program is distributed in the hope that it will be useful,
2935 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2936 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2937 # GNU General Public License for more details.
2939 # You should have received a copy of the GNU General Public License
2940 # along with this program; if not, write to the Free Software
2941 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2944 # #include <stdio.h> /* for printf() */
2945 # #include <unistd.h> /* for open(), lseek(), read() */
2946 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
2947 # #include <string.h> /* for strdup() */
2949 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
2951 # #define O_BINARY 0
2954 # static unsigned int
2955 # pe_get16 (fd, offset)
2959 # unsigned char b[2];
2960 # lseek (fd, offset, SEEK_SET);
2962 # return b[0] + (b[1]<<8);
2965 # static unsigned int
2966 # pe_get32 (fd, offset)
2970 # unsigned char b[4];
2971 # lseek (fd, offset, SEEK_SET);
2973 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2976 # static unsigned int
2980 # unsigned char *b = ptr;
2981 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2990 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2991 # unsigned long export_rva, export_size, nsections, secptr, expptr;
2992 # unsigned long name_rvas, nexp;
2993 # unsigned char *expdata, *erva;
2994 # char *filename, *dll_name;
2996 # filename = argv[1];
2998 # dll = open(filename, O_RDONLY|O_BINARY);
3002 # dll_name = filename;
3004 # for (i=0; filename[i]; i++)
3005 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
3006 # dll_name = filename + i +1;
3008 # pe_header_offset = pe_get32 (dll, 0x3c);
3009 # opthdr_ofs = pe_header_offset + 4 + 20;
3010 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
3012 # if (num_entries < 1) /* no exports */
3015 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
3016 # export_size = pe_get32 (dll, opthdr_ofs + 100);
3017 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3018 # secptr = (pe_header_offset + 4 + 20 +
3019 # pe_get16 (dll, pe_header_offset + 4 + 16));
3022 # for (i = 0; i < nsections; i++)
3025 # unsigned long secptr1 = secptr + 40 * i;
3026 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3027 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3028 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3029 # lseek(dll, secptr1, SEEK_SET);
3030 # read(dll, sname, 8);
3031 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
3033 # expptr = fptr + (export_rva - vaddr);
3034 # if (export_rva + export_size > vaddr + vsize)
3035 # export_size = vsize - (export_rva - vaddr);
3040 # expdata = (unsigned char*)malloc(export_size);
3041 # lseek (dll, expptr, SEEK_SET);
3042 # read (dll, expdata, export_size);
3043 # erva = expdata - export_rva;
3045 # nexp = pe_as32 (expdata+24);
3046 # name_rvas = pe_as32 (expdata+32);
3048 # printf ("EXPORTS\n");
3049 # for (i = 0; i<nexp; i++)
3051 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3052 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3057 # /* impgen.c ends here */
3063 # We use sed instead of cat because bash on DJGPP gets confused if
3064 # if finds mixed CR/LF and LF-only lines. Since sed operates in
3065 # text mode, it properly converts lines to CR/LF. This bash problem
3066 # is reportedly fixed, but why not run on old versions too?
3067 sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3069 mv -f "${ofile}T" "$ofile" || \
3070 (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3074 ])# _LT_AC_LTCONFIG_HACK
3076 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3077 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3079 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3080 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3082 # AC_ENABLE_SHARED - implement the --enable-shared flag
3083 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
3084 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3086 AC_DEFUN([AC_ENABLE_SHARED],
3087 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3088 AC_ARG_ENABLE(shared,
3089 changequote(<<, >>)dnl
3090 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3091 changequote([, ])dnl
3092 [p=${PACKAGE-default}
3094 yes) enable_shared=yes ;;
3095 no) enable_shared=no ;;
3098 # Look at the argument we got. We use all the common list separators.
3099 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3100 for pkg in $enableval; do
3101 if test "X$pkg" = "X$p"; then
3108 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3111 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3112 AC_DEFUN([AC_DISABLE_SHARED],
3113 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3114 AC_ENABLE_SHARED(no)])
3116 # AC_ENABLE_STATIC - implement the --enable-static flag
3117 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
3118 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3120 AC_DEFUN([AC_ENABLE_STATIC],
3121 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3122 AC_ARG_ENABLE(static,
3123 changequote(<<, >>)dnl
3124 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3125 changequote([, ])dnl
3126 [p=${PACKAGE-default}
3128 yes) enable_static=yes ;;
3129 no) enable_static=no ;;
3132 # Look at the argument we got. We use all the common list separators.
3133 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3134 for pkg in $enableval; do
3135 if test "X$pkg" = "X$p"; then
3142 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3145 # AC_DISABLE_STATIC - set the default static flag to --disable-static
3146 AC_DEFUN([AC_DISABLE_STATIC],
3147 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3148 AC_ENABLE_STATIC(no)])
3151 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3152 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3153 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3155 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3156 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3157 AC_ARG_ENABLE(fast-install,
3158 changequote(<<, >>)dnl
3159 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3160 changequote([, ])dnl
3161 [p=${PACKAGE-default}
3163 yes) enable_fast_install=yes ;;
3164 no) enable_fast_install=no ;;
3166 enable_fast_install=no
3167 # Look at the argument we got. We use all the common list separators.
3168 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3169 for pkg in $enableval; do
3170 if test "X$pkg" = "X$p"; then
3171 enable_fast_install=yes
3177 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3180 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
3181 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3182 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3183 AC_ENABLE_FAST_INSTALL(no)])
3185 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
3186 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
3187 # Where MODE is either `yes' or `no'. If omitted, it defaults to
3189 AC_DEFUN([AC_LIBTOOL_PICMODE],
3190 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3191 pic_mode=ifelse($#,1,$1,default)])
3194 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
3195 AC_DEFUN([AC_PATH_TOOL_PREFIX],
3196 [AC_MSG_CHECKING([for $1])
3197 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3200 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3203 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3206 ac_save_MAGIC_CMD="$MAGIC_CMD"
3207 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3208 dnl $ac_dummy forces splitting on constant user-supplied paths.
3209 dnl POSIX.2 word splitting is done only on the output of word expansions,
3210 dnl not every word. This closes a longstanding sh security hole.
3211 ac_dummy="ifelse([$2], , $PATH, [$2])"
3212 for ac_dir in $ac_dummy; do
3213 test -z "$ac_dir" && ac_dir=.
3214 if test -f $ac_dir/$1; then
3215 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3216 if test -n "$file_magic_test_file"; then
3217 case $deplibs_check_method in
3219 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3220 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3221 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3222 egrep "$file_magic_regex" > /dev/null; then
3227 *** Warning: the command libtool uses to detect shared libraries,
3228 *** $file_magic_cmd, produces output that libtool cannot recognize.
3229 *** The result is that libtool may fail to recognize shared libraries
3230 *** as such. This will affect the creation of libtool libraries that
3231 *** depend on shared libraries, but programs linked with such libtool
3232 *** libraries will work regardless of this problem. Nevertheless, you
3233 *** may want to report the problem to your system manager and/or to
3234 *** bug-libtool@gnu.org
3244 MAGIC_CMD="$ac_save_MAGIC_CMD"
3247 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3248 if test -n "$MAGIC_CMD"; then
3249 AC_MSG_RESULT($MAGIC_CMD)
3256 # AC_PATH_MAGIC - find a file program which can recognise a shared library
3257 AC_DEFUN([AC_PATH_MAGIC],
3258 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
3259 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
3260 if test -z "$lt_cv_path_MAGIC_CMD"; then
3261 if test -n "$ac_tool_prefix"; then
3262 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
3270 # AC_PROG_LD - find the path to the GNU or non-GNU linker
3271 AC_DEFUN([AC_PROG_LD],
3272 [AC_ARG_WITH(gnu-ld,
3273 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
3274 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3275 AC_REQUIRE([AC_PROG_CC])dnl
3276 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3277 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3278 AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3280 if test "$GCC" = yes; then
3281 # Check if gcc -print-prog-name=ld gives a path.
3282 AC_MSG_CHECKING([for ld used by GCC])
3285 # gcc leaves a trailing carriage return which upsets mingw
3286 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3288 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3291 # Accept absolute paths.
3292 [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
3293 re_direlt='/[[^/]][[^/]]*/\.\./'
3294 # Canonicalize the path of ld
3295 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3296 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3297 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3299 test -z "$LD" && LD="$ac_prog"
3302 # If it fails, then pretend we aren't using GCC.
3306 # If it is relative, then search for the first ld in PATH.
3310 elif test "$with_gnu_ld" = yes; then
3311 AC_MSG_CHECKING([for GNU ld])
3313 AC_MSG_CHECKING([for non-GNU ld])
3315 AC_CACHE_VAL(lt_cv_path_LD,
3316 [if test -z "$LD"; then
3317 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3318 for ac_dir in $PATH; do
3319 test -z "$ac_dir" && ac_dir=.
3320 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3321 lt_cv_path_LD="$ac_dir/$ac_prog"
3322 # Check to see if the program is GNU ld. I'd rather use --version,
3323 # but apparently some GNU ld's only accept -v.
3324 # Break only if it was the GNU/non-GNU ld that we prefer.
3325 if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3326 test "$with_gnu_ld" != no && break
3328 test "$with_gnu_ld" != yes && break
3334 lt_cv_path_LD="$LD" # Let the user override the test with a path.
3337 if test -n "$LD"; then
3342 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3347 AC_DEFUN([AC_PROG_LD_GNU],
3348 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3349 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3350 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3351 lt_cv_prog_gnu_ld=yes
3353 lt_cv_prog_gnu_ld=no
3355 with_gnu_ld=$lt_cv_prog_gnu_ld
3358 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
3359 # -- PORTME Some linkers may need a different reload flag.
3360 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3361 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
3362 [lt_cv_ld_reload_flag='-r'])
3363 reload_flag=$lt_cv_ld_reload_flag
3364 test -n "$reload_flag" && reload_flag=" $reload_flag"
3367 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
3368 # -- PORTME fill in with the dynamic library characteristics
3369 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3370 [AC_CACHE_CHECK([how to recognise dependent libraries],
3371 lt_cv_deplibs_check_method,
3372 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3373 lt_cv_file_magic_test_file=
3374 lt_cv_deplibs_check_method='unknown'
3375 # Need to set the preceding variable on all platforms that support
3376 # interlibrary dependencies.
3377 # 'none' -- dependencies not supported.
3378 # `unknown' -- same as none, but documents that we really don't know.
3379 # 'pass_all' -- all dependencies passed with no checks.
3380 # 'test_compile' -- check by making test program.
3381 # 'file_magic [[regex]]' -- check by looking for files in library path
3382 # which responds to the $file_magic_cmd with a given egrep regex.
3383 # If you have `file' or equivalent on your system and you're not sure
3384 # whether `pass_all' will *always* work, you probably want this one.
3388 lt_cv_deplibs_check_method=pass_all
3392 lt_cv_deplibs_check_method=pass_all
3396 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3397 lt_cv_file_magic_cmd='/usr/bin/file -L'
3398 lt_cv_file_magic_test_file=/shlib/libc.so
3401 cygwin* | mingw* | pw32*)
3402 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3403 lt_cv_file_magic_cmd='$OBJDUMP -f'
3406 darwin* | rhapsody*)
3407 lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3408 lt_cv_file_magic_cmd='/usr/bin/file -L'
3410 rhapsody* | darwin1.[[012]])
3411 lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3414 lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3420 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3423 # Not sure whether the presence of OpenBSD here was a mistake.
3424 # Let's accept both of them until this is cleared up.
3425 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
3426 lt_cv_file_magic_cmd=/usr/bin/file
3427 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3431 lt_cv_deplibs_check_method=pass_all
3436 lt_cv_deplibs_check_method=pass_all
3440 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3441 lt_cv_file_magic_cmd=/usr/bin/file
3442 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3445 irix5* | irix6* | nonstopux*)
3447 irix5* | nonstopux*)
3448 # this will be overridden with pass_all, but let us keep it just in case
3449 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3453 *-32|*"-32 ") libmagic=32-bit;;
3454 *-n32|*"-n32 ") libmagic=N32;;
3455 *-64|*"-64 ") libmagic=64-bit;;
3456 *) libmagic=never-match;;
3458 # this will be overridden with pass_all, but let us keep it just in case
3459 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
3462 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3463 lt_cv_deplibs_check_method=pass_all
3466 # This must be Linux ELF.
3469 alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3470 lt_cv_deplibs_check_method=pass_all ;;
3472 # glibc up to 2.1.1 does not perform some relocations on ARM
3473 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
3475 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3479 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3480 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
3482 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
3487 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3488 lt_cv_file_magic_cmd=/usr/bin/file
3489 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3493 lt_cv_file_magic_cmd=/usr/bin/file
3494 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3495 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3496 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
3498 lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3502 osf3* | osf4* | osf5*)
3503 # this will be overridden with pass_all, but let us keep it just in case
3504 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3505 lt_cv_file_magic_test_file=/shlib/libc.so
3506 lt_cv_deplibs_check_method=pass_all
3510 lt_cv_deplibs_check_method=pass_all
3514 lt_cv_deplibs_check_method=pass_all
3515 lt_cv_file_magic_test_file=/lib/libc.so
3518 sysv5uw[[78]]* | sysv4*uw2*)
3519 lt_cv_deplibs_check_method=pass_all
3522 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3523 case $host_vendor in
3525 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3526 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3529 lt_cv_deplibs_check_method=pass_all
3532 lt_cv_file_magic_cmd='/bin/file'
3533 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3536 lt_cv_file_magic_cmd='/bin/file'
3537 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3538 lt_cv_file_magic_test_file=/lib/libc.so
3541 lt_cv_deplibs_check_method=pass_all
3547 file_magic_cmd=$lt_cv_file_magic_cmd
3548 deplibs_check_method=$lt_cv_deplibs_check_method
3552 # AC_PROG_NM - find the path to a BSD-compatible name lister
3553 AC_DEFUN([AC_PROG_NM],
3554 [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3555 AC_MSG_CHECKING([for BSD-compatible nm])
3556 AC_CACHE_VAL(lt_cv_path_NM,
3557 [if test -n "$NM"; then
3558 # Let the user override the test.
3561 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3562 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3563 test -z "$ac_dir" && ac_dir=.
3564 tmp_nm=$ac_dir/${ac_tool_prefix}nm
3565 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3566 # Check to see if the nm accepts a BSD-compat flag.
3567 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3568 # nm: unknown option "B" ignored
3569 # Tru64's nm complains that /dev/null is an invalid object file
3570 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3571 lt_cv_path_NM="$tmp_nm -B"
3573 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3574 lt_cv_path_NM="$tmp_nm -p"
3577 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3578 continue # so that we can try to find one that supports BSD flags
3583 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3586 AC_MSG_RESULT([$NM])
3589 # AC_CHECK_LIBM - check for math library
3590 AC_DEFUN([AC_CHECK_LIBM],
3591 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3594 *-*-beos* | *-*-cygwin* | *-*-pw32*)
3595 # These system don't have libm
3598 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3599 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
3602 AC_CHECK_LIB(m, main, LIBM="-lm")
3607 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3608 # the libltdl convenience library and LTDLINCL to the include flags for
3609 # the libltdl header and adds --enable-ltdl-convenience to the
3610 # configure arguments. Note that LIBLTDL and LTDLINCL are not
3611 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
3612 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
3613 # with '${top_builddir}/' and LTDLINCL will be prefixed with
3614 # '${top_srcdir}/' (note the single quotes!). If your package is not
3615 # flat and you're not using automake, define top_builddir and
3616 # top_srcdir appropriately in the Makefiles.
3617 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3618 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3619 case $enable_ltdl_convenience in
3620 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3621 "") enable_ltdl_convenience=yes
3622 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3624 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3625 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3626 # For backwards non-gettext consistent compatibility...
3630 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3631 # the libltdl installable library and LTDLINCL to the include flags for
3632 # the libltdl header and adds --enable-ltdl-install to the configure
3633 # arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
3634 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
3635 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
3636 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
3637 # with '${top_srcdir}/' (note the single quotes!). If your package is
3638 # not flat and you're not using automake, define top_builddir and
3639 # top_srcdir appropriately in the Makefiles.
3640 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3641 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3642 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3643 AC_CHECK_LIB(ltdl, main,
3644 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3645 [if test x"$enable_ltdl_install" = xno; then
3646 AC_MSG_WARN([libltdl not installed, but installation disabled])
3648 enable_ltdl_install=yes
3651 if test x"$enable_ltdl_install" = x"yes"; then
3652 ac_configure_args="$ac_configure_args --enable-ltdl-install"
3653 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3654 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3656 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3660 # For backwards non-gettext consistent compatibility...
3665 AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
3666 AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
3667 AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
3668 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
3669 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
3670 AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
3671 AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
3673 # This is just to silence aclocal about the macro not being used
3674 ifelse([AC_DISABLE_FAST_INSTALL])
3676 # NOTE: This macro has been submitted for inclusion into #
3677 # GNU Autoconf as AC_PROG_SED. When it is available in #
3678 # a released version of Autoconf we should remove this #
3679 # macro and use it instead. #
3682 # Check for a fully-functional sed program, that truncates
3683 # as few characters as possible. Prefer GNU sed if found.
3684 AC_DEFUN([LT_AC_PROG_SED],
3685 [AC_MSG_CHECKING([for a sed that does not truncate output])
3686 AC_CACHE_VAL(lt_cv_path_SED,
3687 [# Loop through the user's path and test for sed and gsed.
3688 # Then use that list of sed's as ones to test for truncation.
3689 as_executable_p="test -f"
3690 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3694 test -z "$as_dir" && as_dir=.
3695 for ac_prog in sed gsed; do
3696 for ac_exec_ext in '' $ac_executable_extensions; do
3697 if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3698 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3704 # Create a temporary directory, and hook for its removal unless debugging.
3707 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3708 trap '{ (exit 1); exit 1; }' 1 2 13 15
3711 # Create a (secure) tmp directory for tmp files.
3714 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3715 test -n "$tmp" && test -d "$tmp"
3718 tmp=$TMPDIR/sed$$-$RANDOM
3719 (umask 077 && mkdir $tmp)
3722 echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3723 { (exit 1); exit 1; }
3727 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3728 # along with /bin/sed that truncates output.
3729 for _sed in $_sed_list /usr/xpg4/bin/sed; do
3730 test ! -f ${_sed} && break
3731 cat /dev/null > "$tmp/sed.in"
3733 echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3734 # Check for GNU sed and select it if it is found.
3735 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3736 lt_cv_path_SED=${_sed}
3740 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3741 mv "$tmp/sed.tmp" "$tmp/sed.in"
3742 cp "$tmp/sed.in" "$tmp/sed.nl"
3743 echo >>"$tmp/sed.nl"
3744 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3745 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3746 # 40000 chars as input seems more than enough
3747 test $_count -gt 10 && break
3748 _count=`expr $_count + 1`
3749 if test $_count -gt $_max; then
3751 lt_cv_path_SED=$_sed
3757 if test "X$SED" != "X"; then
3762 AC_MSG_RESULT([$SED])
3768 # @defmac AC_PROG_CC_STDC
3769 # @maindex PROG_CC_STDC
3771 # If the C compiler in not in ANSI C mode by default, try to add an option
3772 # to output variable @code{CC} to make it so. This macro tries various
3773 # options that select ANSI C on some system or another. It considers the
3774 # compiler to be in ANSI C mode if it handles function prototypes correctly.
3776 # If you use this macro, you should check after calling it whether the C
3777 # compiler has been set to accept ANSI C; if not, the shell variable
3778 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
3779 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
3780 # program @code{ansi2knr}, which comes with Ghostscript.
3783 AC_DEFUN(AM_PROG_CC_STDC,
3784 [AC_REQUIRE([AC_PROG_CC])
3785 AC_BEFORE([$0], [AC_C_INLINE])
3786 AC_BEFORE([$0], [AC_C_CONST])
3787 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
3788 dnl a magic option to avoid problems with ANSI preprocessor commands
3790 dnl FIXME: can't do this because then AC_AIX won't work due to a
3791 dnl circular dependency.
3792 dnl AC_BEFORE([$0], [AC_PROG_CPP])
3793 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
3794 AC_CACHE_VAL(am_cv_prog_cc_stdc,
3795 [am_cv_prog_cc_stdc=no
3797 # Don't try gcc -ansi; that turns off useful extensions and
3798 # breaks some systems' header files.
3799 # AIX -qlanglvl=ansi
3800 # Ultrix and OSF/1 -std1
3801 # HP-UX 10.20 and later -Ae
3802 # HP-UX older versions -Aa -D_HPUX_SOURCE
3803 # SVR4 -Xc -D__EXTENSIONS__
3804 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3806 CC="$ac_save_CC $ac_arg"
3808 [#include <stdarg.h>
3810 #include <sys/types.h>
3811 #include <sys/stat.h>
3812 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3813 struct buf { int x; };
3814 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3815 static char *e (p, i)
3821 static char *f (char * (*g) (char **, int), char **p, ...)
3826 s = g (p, va_arg (v,int));
3830 int test (int i, double x);
3831 struct s1 {int (*f) (int a);};
3832 struct s2 {int (*f) (double a);};
3833 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3837 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3839 [am_cv_prog_cc_stdc="$ac_arg"; break])
3843 if test -z "$am_cv_prog_cc_stdc"; then
3844 AC_MSG_RESULT([none needed])
3846 AC_MSG_RESULT($am_cv_prog_cc_stdc)
3848 case "x$am_cv_prog_cc_stdc" in
3850 *) CC="$CC $am_cv_prog_cc_stdc" ;;
3854 dnl From Jim Meyering.
3858 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
3859 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
3860 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
3861 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
3862 [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
3864 gwinsz_in_termios_h=no
3865 if test $am_cv_sys_posix_termios = yes; then
3867 [#include <sys/types.h>
3868 # include <termios.h>
3872 ], gwinsz_in_termios_h=yes)
3875 if test $gwinsz_in_termios_h = no; then
3877 [#include <sys/types.h>
3878 # include <sys/ioctl.h>
3882 ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
3885 if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
3886 AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
3887 [Define if TIOCGWINSZ requires sys/ioctl.h])
3891 dnl From Jim Meyering.
3895 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
3896 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
3897 [AC_TRY_LINK([#include <sys/types.h>
3899 #include <termios.h>],
3900 [/* SunOS 4.0.3 has termios.h but not the library calls. */
3902 am_cv_sys_posix_termios=yes,
3903 am_cv_sys_posix_termios=no)])
3906 # From Ulrich Drepper.
3910 AC_DEFUN(AM_TYPE_PTRDIFF_T,
3911 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
3912 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
3913 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
3914 if test $am_cv_type_ptrdiff_t = yes; then
3915 AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])