3 # ltconfig - Create a system-specific libtool.
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
5 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # A lot of this script is taken from autoconf-2.10.
28 # Check that we are running under the correct shell.
29 SHELL
=${CONFIG_SHELL-/bin/sh}
31 if test "X$1" = X--no-reexec
; then
32 # Discard the --no-reexec flag, and continue.
34 elif test "X$1" = X--fallback-echo
; then
35 # used as fallback echo
41 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
42 # Yippee, $echo works!
45 # Restart under the correct shell.
46 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
49 # Find the correct PATH separator. Usually this is `:', but
50 # DJGPP uses `;' like DOS.
51 if test "X${PATH_SEPARATOR+set}" != "Xset"; then
52 UNAME
=${UNAME-`uname 2>/dev/null`}
54 *-DOS) PATH_SEPARATOR
=';' ;;
55 *) PATH_SEPARATOR
=':' ;;
59 # The HP-UX ksh and POSIX shell print the target directory to stdout
61 if test "${CDPATH+set}" = set; then CDPATH
=; export CDPATH
; fi
63 if test "X${echo_test_string+set}" != "Xset"; then
64 # find a string as large as possible, as long as the shell can cope with it
65 for cmd
in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
66 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
67 if (echo_test_string
="`eval $cmd`") 2>/dev
/null
&&
68 echo_test_string
="`eval $cmd`" &&
69 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev
/null
; then
75 if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
76 test "X`($echo "$echo_test_string") 2>/dev/null`" != X
"$echo_test_string"; then
77 # The Solaris, AIX, and Digital Unix default echo programs unquote
78 # backslashes. This makes it impossible to quote backslashes using
79 # echo "$something" | sed 's/\\/\\\\/g'
81 # So, first we look for a working echo in the user's PATH.
83 IFS
="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
84 for dir
in $PATH /usr
/ucb
; do
85 if test -f $dir/echo &&
86 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
87 test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
94 if test "X$echo" = Xecho
; then
95 # We didn't find a better echo, so look for alternatives.
96 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
97 test "X`(print -r "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
98 # This shell has a builtin print -r that does the trick.
100 elif test -f /bin
/ksh
&& test "X$CONFIG_SHELL" != X
/bin
/ksh
; then
101 # If we have ksh, try running ltconfig again with it.
102 ORIGINAL_CONFIG_SHELL
="${CONFIG_SHELL-/bin/sh}"
103 export ORIGINAL_CONFIG_SHELL
104 CONFIG_SHELL
=/bin
/ksh
106 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
110 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
111 test "X`($echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
114 elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
115 test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
116 CONFIG_SHELL
="$ORIGINAL_CONFIG_SHELL"
118 SHELL
="$CONFIG_SHELL"
120 echo="$CONFIG_SHELL $0 --fallback-echo"
121 elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
122 test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
123 echo="$CONFIG_SHELL $0 --fallback-echo"
125 # maybe with a smaller string...
128 for cmd
in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
129 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev
/null
; then
135 if test "$prev" != 'sed 50q "$0"'; then
136 echo_test_string
=`eval $prev`
137 export echo_test_string
138 exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
140 # Oops. We lost completely, so just stick with echo.
148 # Sed substitution that helps us do robust quoting. It backslashifies
149 # metacharacters that are still active within double-quoted strings.
151 sed_quote_subst
='s/\([\\"\\`$\\\\]\)/\\\1/g'
153 # Same as above, but do not quote variable references.
154 double_quote_subst
='s/\([\\"\\`\\\\]\)/\\\1/g'
156 # Sed substitution to delay expansion of an escaped shell variable in a
157 # double_quote_subst'ed string.
158 delay_variable_subst
='s/\\\\\\\\\\\$/\\\\\\$/g'
160 # The name of this program.
161 progname
=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
167 TIMESTAMP
=" (1.385 1999/03/15 17:24:54)"
168 ac_compile
='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
169 ac_link
='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
172 help="Try \`$progname --help' for more information."
175 default_ofile
=libtool
178 # All known linkers require a `.a' archive for static linking.
180 enable_fast_install
=yes
181 enable_dlopen
=unknown
189 ofile
="$default_ofile"
202 old_CPPFLAGS
="$CPPFLAGS"
207 old_DLLTOOL
="$DLLTOOL"
210 # Parse the command line options.
216 -*=*) optarg
=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
220 # If the previous option needs an argument, assign it.
221 if test -n "$prev"; then
222 eval "$prev=\$option"
229 Usage: $progname [OPTION]... [HOST [LTMAIN]]
231 Generate a system-specific libtool script.
233 --debug enable verbose shell tracing
234 --disable-shared do not build shared libraries
235 --disable-static do not build static libraries
236 --disable-fast-install do not optimize for fast installation
237 --enable-dlopen enable dlopen support
238 --enable-dlopen-self enable support for dlopening programs
239 --help display this help and exit
240 --no-verify do not verify that HOST is a valid host type
241 -o, --output=FILE specify the output file [default=$default_ofile]
242 --quiet same as \`--silent'
243 --silent do not print informational messages
244 --srcdir=DIR find \`config.guess' in DIR
245 --version output version information and exit
246 --with-gcc assume that the GNU C compiler will be used
247 --with-gnu-ld assume that the C compiler uses the GNU linker
248 --disable-lock disable file locking
249 --cache-file=FILE configure cache file
251 LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
252 that provides basic libtool functionality.
254 HOST is the canonical host system name [default=guessed].
260 echo "$progname: enabling shell trace mode"
264 --disable-shared) enable_shared
=no
;;
266 --disable-static) enable_static
=no
;;
268 --disable-fast-install) enable_fast_install
=no
;;
270 --enable-dlopen) enable_dlopen
=yes ;;
272 --quiet |
--silent) silent
=yes ;;
274 --srcdir) prev
=srcdir
;;
275 --srcdir=*) srcdir
="$optarg" ;;
277 --no-verify) verify_host
=no
;;
279 --output |
-o) prev
=ofile
;;
280 --output=*) ofile
="$optarg" ;;
282 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
284 --with-gcc) with_gcc
=yes ;;
285 --with-gnu-ld) with_gnu_ld
=yes ;;
287 --disable-lock) need_locks
=no
;;
289 --cache-file=*) cache_file
="$optarg" ;;
292 echo "$progname: unrecognized option \`$option'" 1>&2
298 if test -z "$ltmain"; then
300 elif test -z "$host"; then
301 # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
302 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
303 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
307 echo "$progname: too many arguments" 1>&2
314 if test -z "$ltmain"; then
315 echo "$progname: you must specify a LTMAIN file" 1>&2
320 if test ! -f "$ltmain"; then
321 echo "$progname: \`$ltmain' does not exist" 1>&2
326 # Quote any args containing shell metacharacters.
331 *" "*|
*" "*|
*[\
[\
]\~\
#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
332 ltconfig_args
="$ltconfig_args '$arg'" ;;
333 *) ltconfig_args
="$ltconfig_args $arg" ;;
337 # A relevant subset of AC_INIT.
339 # File descriptor usage:
342 # 2 errors and warnings
343 # 3 some systems may open it to /dev/tty
344 # 4 used on the Kubota Titan
345 # 5 compiler messages saved in config.log
346 # 6 checking for... messages and results
347 if test "$silent" = yes; then
355 # Only set LANG and LC_ALL to C if already set.
356 # These must not be set unconditionally because not all systems understand
357 # e.g. LANG=C (notably SCO).
358 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
359 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
361 if test -n "$cache_file" && test -r "$cache_file"; then
362 echo "loading cache $cache_file within ltconfig"
366 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
367 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
368 if (echo -n testing
; echo 1,2,3) |
sed s
/-n/xn
/ |
grep xn
>/dev
/null
; then
375 ac_n
= ac_c
='\c' ac_t
=
378 if test -z "$srcdir"; then
379 # Assume the source directory is the same one as the path to LTMAIN.
380 srcdir
=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
381 test "$srcdir" = "$ltmain" && srcdir
=.
384 trap "$rm conftest*; exit 1" 1 2 15
385 if test "$verify_host" = yes; then
386 # Check for config.guess and config.sub.
388 for ac_dir
in $srcdir $srcdir/..
$srcdir/..
/..
; do
389 if test -f $ac_dir/config.guess
; then
394 if test -z "$ac_aux_dir"; then
395 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
399 ac_config_guess
=$ac_aux_dir/config.guess
400 ac_config_sub
=$ac_aux_dir/config.sub
402 # Make sure we can run config.sub.
403 if $SHELL $ac_config_sub sun4
>/dev
/null
2>&1; then :
405 echo "$progname: cannot run $ac_config_sub" 1>&2
410 echo $ac_n "checking host system type""... $ac_c" 1>&6
413 case "$host_alias" in
415 if host_alias
=`$SHELL $ac_config_guess`; then :
417 echo "$progname: cannot guess host type; you must specify one" 1>&2
422 host=`$SHELL $ac_config_sub $host_alias`
423 echo "$ac_t$host" 1>&6
425 # Make sure the host verified.
426 test -z "$host" && exit 1
428 elif test -z "$host"; then
429 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
436 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
439 linux
*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
442 host_cpu
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
443 host_vendor
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
444 host_os
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
448 # AIX sometimes has problems with the GCC collect2 program. For some
449 # reason, if we set the COLLECT_NAMES environment variable, the problems
450 # vanish in a puff of smoke.
451 if test "${COLLECT_NAMES+set}" != set; then
458 # Determine commands to create old-style static archives.
459 old_archive_cmds
='$AR cru $oldlib$oldobjs'
460 old_postinstall_cmds
='chmod 644 $oldlib'
461 old_postuninstall_cmds
=
463 # Set a sane default for `AR'.
464 test -z "$AR" && AR
=ar
466 # If RANLIB is not set, then run the test.
467 if test "${RANLIB+set}" != "set"; then
470 echo $ac_n "checking for ranlib... $ac_c" 1>&6
471 IFS
="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
473 test -z "$dir" && dir
=.
474 if test -f $dir/ranlib
; then
482 echo "$ac_t$result" 1>&6
485 if test -n "$RANLIB"; then
486 old_archive_cmds
="$old_archive_cmds~\$RANLIB \$oldlib"
487 old_postinstall_cmds
="\$RANLIB \$oldlib~$old_postinstall_cmds"
490 # Set sane defaults for `DLLTOOL' and `AS', used on cygwin.
491 test -z "$DLLTOOL" && DLLTOOL
=dlltool
492 test -z "$AS" && AS
=as
494 # Check to see if we are using GCC.
495 if test "$with_gcc" != yes ||
test -z "$CC"; then
496 # If CC is not set, then try to find GCC or a usable CC.
497 if test -z "$CC"; then
498 echo $ac_n "checking for gcc... $ac_c" 1>&6
499 IFS
="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
502 test -z "$dir" && dir
=.
503 if test -f $dir/gcc
; then
510 if test -n "$CC"; then
517 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
518 if test -z "$CC"; then
519 echo $ac_n "checking for cc... $ac_c" 1>&6
520 IFS
="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
523 test -z "$dir" && dir
=.
524 if test -f $dir/cc
; then
525 if test "$dir/cc" = "/usr/ucb/cc"; then
534 if test $cc_rejected = yes; then
535 # We found a bogon in the path, so make sure we never use it.
538 if test $# -gt 0; then
539 # We chose a different compiler from the bogus one.
540 # However, it has the same name, so the bogon will be chosen
541 # first if we set CC to just the name; use the full file name.
543 set dummy
"$dir/cc" "$@"
549 if test -n "$CC"; then
555 if test -z "$CC"; then
556 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
561 # Now see if the compiler is really GCC.
563 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
564 echo "$progname:564: checking whether we are using GNU C" >&5
567 cat > conftest.c
<<EOF
572 if { ac_try
='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } |
egrep yes >/dev
/null
2>&1; then
576 echo "$ac_t$with_gcc" 1>&6
579 # Allow CC to be a program name with arguments.
583 echo $ac_n "checking for object suffix... $ac_c" 1>&6
585 echo 'int i = 1;' > conftest.c
586 echo "$progname:586: checking for object suffix" >& 5
587 if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; }; then
588 # Append any warnings to the config.log.
589 cat conftest.err
1>&5
591 for ac_file
in conftest.
*; do
594 *) objext
=`echo $ac_file | sed -e s/conftest.//` ;;
598 cat conftest.err
1>&5
599 echo "$progname: failed program was:" >&5
603 echo "$ac_t$objext" 1>&6
605 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
607 special_shlib_compile_flags
=
612 if test "$with_gcc" = yes; then
614 link_static_flag
='-static'
617 beos
* | irix5
* | irix6
* | osf3
* | osf4
*)
618 # PIC is the default for these OSes.
621 # Below there is a dirty hack to force normal static linking with -ldl
622 # The problem is because libdl dynamically linked with both libc and
623 # libC (AIX C++ library), which obviously doesn't included in libraries
624 # list by gcc. This cause undefined symbols with -static flags.
625 # This hack allows C programs to be linked with "-static -ldl", but
626 # we not sure about C++ programs.
627 link_static_flag
="$link_static_flag ${wl}-lC"
629 cygwin
* | mingw
* | os2
*)
630 # We can build DLLs from non-PIC.
633 # FIXME: we need at least 68020 code to build shared libraries, but
634 # adding the `-m68020' flag to GCC prevents building anything better,
636 pic_flag
='-m68020 -resident32 -malways-restore-a4'
643 # PORTME Check for PIC flags for the system compiler.
646 # All AIX code is PIC.
647 link_static_flag
='-bnso -bI:/lib/syscalls.exp'
650 hpux9
* | hpux10
* | hpux11
*)
651 # Is there a better link_static_flag that works with the bundled CC?
653 link_static_flag
="${wl}-a ${wl}archive"
659 link_static_flag
='-non_shared'
660 # PIC (with -KPIC) is the default.
663 cygwin
* | mingw
* | os2
*)
664 # We can build DLLs from non-PIC.
668 # All OSF/1 code is PIC.
670 link_static_flag
='-non_shared'
675 link_static_flag
='-dn'
676 special_shlib_compile_flags
='-belf'
681 link_static_flag
='-Bstatic'
687 link_static_flag
='-Bstatic'
691 sysv4.2uw2
* | sysv4.3
* | sysv5
*)
693 link_static_flag
='-Bstatic'
699 link_static_flag
='-Bstatic'
708 if test -n "$pic_flag"; then
709 echo "$ac_t$pic_flag" 1>&6
711 # Check to make sure the pic_flag actually works.
712 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
714 echo "int some_variable = 0;" > conftest.c
715 save_CFLAGS
="$CFLAGS"
716 CFLAGS
="$CFLAGS $pic_flag -DPIC"
717 echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5
718 if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.
$objext; then
719 # Append any warnings to the config.log.
720 cat conftest.err
1>&5
723 hpux9
* | hpux10
* | hpux11
*)
724 # On HP-UX, both CC and GCC only warn that PIC is supported... then they
725 # create non-PIC objects. So, if there were any warnings, we assume that
726 # PIC is not supported.
727 if test -s conftest.err
; then
733 pic_flag
=" $pic_flag"
738 pic_flag
=" $pic_flag"
742 # Append any errors to the config.log.
743 cat conftest.err
1>&5
748 CFLAGS
="$save_CFLAGS"
751 echo "$ac_t"none
1>&6
754 # Check to see if options -o and -c are simultaneously supported by compiler
755 echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
757 echo "int some_variable = 0;" > conftest.c
758 save_CFLAGS
="$CFLAGS"
759 CFLAGS
="$CFLAGS -c -o conftest2.o"
760 echo "$progname:760: checking if $compiler supports -c -o file.o" >&5
761 if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest2.o
; then
763 # The compiler can only warn and ignore the option if not recognized
764 # So say no if there are warnings
765 if test -s conftest.err
; then
773 # Append any errors to the config.log.
774 cat conftest.err
1>&5
778 CFLAGS
="$save_CFLAGS"
781 if test x
"$compiler_c_o" = x
"yes"; then
782 # Check to see if we can write to a .lo
783 echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
785 echo "int some_variable = 0;" > conftest.c
786 save_CFLAGS
="$CFLAGS"
787 CFLAGS
="$CFLAGS -c -o conftest.lo"
788 echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5
789 if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.lo
; then
791 # The compiler can only warn and ignore the option if not recognized
792 # So say no if there are warnings
793 if test -s conftest.err
; then
801 # Append any errors to the config.log.
802 cat conftest.err
1>&5
806 CFLAGS
="$save_CFLAGS"
812 # Check to see if we can do hard links to lock some files if needed
813 hard_links
="nottested"
814 if test "$compiler_c_o" = no
&& test "$need_locks" != no
; then
815 # do not overwrite the value of need_locks provided by the user
816 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
819 ln conftest.a conftest.b
2>/dev
/null
&& hard_links
=no
821 ln conftest.a conftest.b
2>&5 || hard_links
=no
822 ln conftest.a conftest.b
2>/dev
/null
&& hard_links
=no
823 echo "$ac_t$hard_links" 1>&6
825 if test "$hard_links" = no
; then
826 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
833 if test "$with_gcc" = yes; then
834 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
835 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
837 echo "int some_variable = 0;" > conftest.c
838 save_CFLAGS
="$CFLAGS"
839 CFLAGS
="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
840 echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
841 if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.o
; then
843 # The compiler can only warn and ignore the option if not recognized
844 # So say no if there are warnings
845 if test -s conftest.err
; then
847 compiler_rtti_exceptions
=no
850 compiler_rtti_exceptions
=yes
853 # Append any errors to the config.log.
854 cat conftest.err
1>&5
855 compiler_rtti_exceptions
=no
858 CFLAGS
="$save_CFLAGS"
861 if test "$compiler_rtti_exceptions" = "yes"; then
862 no_builtin_flag
=' -fno-builtin -fno-rtti -fno-exceptions'
864 no_builtin_flag
=' -fno-builtin'
869 # Check for any special shared library compilation flags.
870 if test -n "$special_shlib_compile_flags"; then
871 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
872 if echo "$old_CC $old_CFLAGS " |
egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev
/null
; then :
874 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
879 echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
881 echo 'main(){return(0);}' > conftest.c
882 save_LDFLAGS
="$LDFLAGS"
883 LDFLAGS
="$LDFLAGS $link_static_flag"
884 echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5
885 if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
886 echo "$ac_t$link_static_flag" 1>&6
888 echo "$ac_t"none
1>&6
891 LDFLAGS
="$save_LDFLAGS"
894 if test -z "$LN_S"; then
895 # Check to see if we can use ln -s, or we need hard links.
896 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
898 if ln -s X conftestdata
2>/dev
/null
; then
904 if test "$LN_S" = "ln -s"; then
911 # Make sure LD is an absolute path.
912 if test -z "$LD"; then
914 if test "$with_gcc" = yes; then
915 # Check if gcc -print-prog-name=ld gives a path.
916 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
917 echo "$progname:917: checking for ld used by GCC" >&5
918 ac_prog
=`($CC -print-prog-name=ld) 2>&5`
920 # Accept absolute paths.
921 /* |
[A-Za-z
]:[\\/]*)
922 re_direlt
='/[^/][^/]*/\.\./'
923 # Canonicalize the path of ld
924 ac_prog
=`echo $ac_prog| sed 's%\\\\%/%g'`
925 while echo $ac_prog |
grep "$re_direlt" > /dev
/null
2>&1; do
926 ac_prog
=`echo $ac_prog| sed "s%$re_direlt%/%"`
928 test -z "$LD" && LD
="$ac_prog"
931 # If it fails, then pretend we are not using GCC.
935 # If it is relative, then search for the first ld in PATH.
939 elif test "$with_gnu_ld" = yes; then
940 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
941 echo "$progname:941: checking for GNU ld" >&5
943 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
944 echo "$progname:944: checking for non-GNU ld" >&5
947 if test -z "$LD"; then
948 IFS
="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
949 for ac_dir
in $PATH; do
950 test -z "$ac_dir" && ac_dir
=.
951 if test -f "$ac_dir/$ac_prog"; then
952 LD
="$ac_dir/$ac_prog"
953 # Check to see if the program is GNU ld. I'd rather use --version,
954 # but apparently some GNU ld's only accept -v.
955 # Break only if it was the GNU/non-GNU ld that we prefer.
956 if "$LD" -v 2>&1 < /dev
/null |
egrep '(GNU|with BFD)' > /dev
/null
; then
957 test "$with_gnu_ld" != no
&& break
959 test "$with_gnu_ld" != yes && break
966 if test -n "$LD"; then
972 if test -z "$LD"; then
973 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
978 # Check to see if it really is or is not GNU ld.
979 echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
980 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
981 if $LD -v 2>&1 </dev
/null |
egrep '(GNU|with BFD)' 1>&5; then
986 echo "$ac_t$with_gnu_ld" 1>&6
988 extra_compiler_flags
=
989 extra_compiler_flags_value
=
990 if test "$with_gcc" = yes; then
991 extra_compiler_flags_value
="-B|-b|-V"
992 extra_compiler_flags
="-B*|-b*|-V*"
993 # Check to see what are the possible multilibing options
994 echo $ac_n "checking what multilib options $compiler supports ... $ac_c" 1>&6
996 if ${CC-cc} -print-multi-lib >/dev
/null
2>&1; then
997 for dir
in `${CC-cc} -print-multi-lib 2>/dev/null`; do
998 multilibopts
="$multilibopts`echo $dir | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`"
1001 # Kill any whitespace at the beginning and end
1002 multilibopts
=`echo $multilibopts`
1003 if test -n "$multilibopts"; then
1004 extra_compiler_flags
="$extra_compiler_flags`echo $multilibopts | sed -e 's/ -/|-/g' -e 's/^-/|-/'`"
1005 echo "$ac_t$multilibopts" 1>&6
1007 echo "$ac_t"none
1>&6
1011 # See if the linker supports building shared libraries.
1012 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
1014 allow_undefined_flag
=
1016 need_lib_prefix
=unknown
1017 need_version
=unknown
1018 # when you set need_version to no, make sure it does not cause -set_version
1019 # flags to be left without arguments
1021 archive_expsym_cmds
=
1022 old_archive_from_new_cmds
=
1023 export_dynamic_flag_spec
=
1024 whole_archive_flag_spec
=
1025 thread_safe_flag_spec
=
1026 hardcode_libdir_flag_spec
=
1027 hardcode_libdir_separator
=
1030 hardcode_shlibpath_var
=unsupported
1032 always_export_symbols
=no
1033 export_symbols_cmds
='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1034 # include_expsyms should be a list of space-separated symbols to be *always*
1035 # included in the symbol list
1037 # exclude_expsyms can be an egrep regular expression of symbols to exclude
1038 # it will be wrapped by ` (' and `)$', so one must not match beginning or
1039 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1040 # as well as any symbol that contains `d'.
1045 # FIXME: the MSVC++ port hasn't been tested in a loooong time
1046 # When not using gcc, we currently assume that we are using
1047 # Microsoft Visual C++.
1048 if test "$with_gcc" != yes; then
1053 freebsd2
* | sunos4
*)
1054 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_"
1060 if test "$with_gnu_ld" = yes; then
1061 # If archive_cmds runs LD, not CC, wlarc should be empty
1064 # See if GNU ld supports shared libraries.
1067 # On AIX, the GNU linker is very broken
1071 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
1072 *** to be unable to reliably create shared libraries on AIX.
1073 *** Therefore, libtool is disabling shared libraries support. If you
1074 *** really care for shared libraries, you may want to modify your PATH
1075 *** so that a non-GNU linker is found, and then restart.
1081 archive_cmds
='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1082 hardcode_libdir_flag_spec
='-L$libdir'
1083 hardcode_minus_L
=yes
1087 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
1090 hardcode_minus_L
=yes
1091 hardcode_shlibpath_var
=no
1095 if $LD --help 2>&1 |
egrep ': supported targets:.* elf' > /dev
/null
; then
1096 archive_cmds
='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1103 # hardcode_libdir_flag_spec is actually meaningless, as there is
1104 # no search path for DLLs.
1105 hardcode_libdir_flag_spec
='-L$libdir'
1106 allow_undefined_flag
=unsupported
1107 always_export_symbols
=yes
1109 # Extract the symbol export list from an `--export-all' def file,
1110 # then regenerate the def file from the symbol export list, so that
1111 # the compiled dll only exports the symbol export list.
1112 export_symbols_cmds
='rm -f $objdir/$soname-ltdll.c~
1113 sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
1114 (cd $objdir && $CC -c $soname-ltdll.c)~
1115 $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
1116 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
1118 archive_expsym_cmds
='echo EXPORTS > $objdir/$soname-def~
1120 for symbol in `cat $export_symbols`; do
1121 echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
1122 _lt_hint=`expr 1 + \$_lt_hint`;
1124 $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1125 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1126 $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1127 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1128 $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
1130 old_archive_from_new_cmds
='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
1134 if $LD --help 2>&1 |
egrep ': supported targets:.* elf' > /dev
/null
; then
1135 archive_cmds
='$CC -shared $libobjs $deplibs $compiler_flags $linkopts ${wl}-soname $wl$soname -o $lib'
1136 archive_expsym_cmds
='$CC -shared $libobjs $deplibs $compiler_flags $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1143 if test "$ld_shlibs" = yes; then
1144 runpath_var
=LD_RUN_PATH
1145 hardcode_libdir_flag_spec
='${wl}--rpath ${wl}$libdir'
1146 export_dynamic_flag_spec
='${wl}--export-dynamic'
1147 whole_archive_flag_spec
="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1150 # PORTME fill in a description of your system's linker (not GNU ld)
1153 allow_undefined_flag
=unsupported
1154 always_export_symbols
=yes
1155 archive_expsym_cmds
='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1156 # Note: this linker hardcodes the directories in LIBPATH if there
1157 # are no directories specified by -L.
1158 hardcode_minus_L
=yes
1159 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1160 # Neither direct hardcoding nor static linking is supported with a
1162 hardcode_direct
=unsupported
1167 allow_undefined_flag
=
1168 if test "$with_gcc" = yes; then
1169 if strings `${CC} -print-prog-name=collect2` | \
1170 grep resolve_lib_name
>/dev
/null
1172 # We have reworked collect2
1175 # We have old collect2
1176 hardcode_direct
=unsupported
1178 archive_cmds
='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
1180 always_export_symbols
=yes
1181 archive_expsym_cmds
='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
1184 hardcode_minus_L
=yes
1185 # Though LIBPATH variable hardcodes shlibpath into executable,
1186 # it doesn't affect searching for -l* libraries; this confuses
1188 hardcode_shlibpath_var
=unsupported
1189 hardcode_libdir_flag_spec
='-L$libdir'
1193 archive_cmds
='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1194 hardcode_libdir_flag_spec
='-L$libdir'
1195 hardcode_minus_L
=yes
1199 # When not using gcc, we currently assume that we are using
1200 # Microsoft Visual C++.
1201 # hardcode_libdir_flag_spec is actually meaningless, as there is
1202 # no search path for DLLs.
1203 hardcode_libdir_flag_spec
=' '
1204 allow_undefined_flag
=unsupported
1205 # Tell ltmain to make .lib files, not .a files.
1207 # FIXME: Setting linknames here is a bad hack.
1208 archive_cmds
='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1209 # The linker will automatically build a .lib file if we build a DLL.
1210 old_archive_from_new_cmds
='true'
1211 # FIXME: Should let the user specify the lib program.
1212 old_archive_cmds
='lib /OUT:$oldlib$oldobjs'
1213 fix_srcfile_path
='`cygpath -w $srcfile`'
1221 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1222 # support. Future versions do this automatically, but an explicit c++rt0.o
1223 # does not break anything, and helps significantly (at the cost of a little
1226 archive_cmds
='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
1227 hardcode_libdir_flag_spec
='-R$libdir'
1229 hardcode_minus_L
=no
# verified on 2.2.6
1230 hardcode_shlibpath_var
=no
1233 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1235 archive_cmds
='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1237 hardcode_minus_L
=yes
1238 hardcode_shlibpath_var
=no
1241 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1243 archive_cmds
='$CC -shared -o $lib $libobjs $deplibs $compiler_flags $linkopts'
1244 hardcode_libdir_flag_spec
='-R$libdir'
1247 hardcode_shlibpath_var
=no
1251 archive_cmds
='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
1252 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
1254 hardcode_minus_L
=yes
1255 export_dynamic_flag_spec
='${wl}-E'
1259 archive_cmds
='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts'
1260 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
1262 hardcode_minus_L
=yes
1263 export_dynamic_flag_spec
='${wl}-E'
1267 if test "$with_gcc" = yes; then
1268 archive_cmds
='$CC -shared $libobjs $deplibs $compiler_flags $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
1270 archive_cmds
='$LD -shared $libobjs $deplibs $compiler_flags $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
1272 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
1273 hardcode_libdir_separator
=:
1277 if echo __ELF__ |
$CC -E - |
grep __ELF__
>/dev
/null
; then
1278 archive_cmds
='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
1280 archive_cmds
='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
1282 hardcode_libdir_flag_spec
='${wl}-R$libdir'
1284 hardcode_shlibpath_var
=no
1288 archive_cmds
='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1289 hardcode_libdir_flag_spec
='-R$libdir'
1291 hardcode_shlibpath_var
=no
1295 hardcode_libdir_flag_spec
='-L$libdir'
1296 hardcode_minus_L
=yes
1297 allow_undefined_flag
=unsupported
1298 archive_cmds
='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
1299 old_archive_from_new_cmds
='emximp -o $objdir/$libname.a $objdir/$libname.def'
1303 if test "$with_gcc" = yes; then
1304 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
1305 archive_cmds
='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
1307 allow_undefined_flag
=' -expect_unresolved \*'
1308 archive_cmds
='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
1310 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
1311 hardcode_libdir_separator
=:
1315 archive_cmds
='$LD -G -o $lib $libobjs $deplibs $linkopts'
1320 no_undefined_flag
=' -z text'
1321 # $CC -shared without GNU ld will not create a library from C++
1322 # object files and a static libstdc++, better avoid it by now
1323 archive_cmds
='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
1324 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1325 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
1326 hardcode_libdir_flag_spec
='-R$libdir'
1327 hardcode_shlibpath_var
=no
1331 # Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
1332 if test "$with_gcc" = yes; then
1333 # Use -fPIC here because libgcc is multilibbed
1334 archive_cmds
='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts'
1336 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
1338 hardcode_libdir_flag_spec
='-L$libdir'
1340 hardcode_minus_L
=yes
1341 hardcode_shlibpath_var
=no
1345 archive_cmds
='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1348 hardcode_shlibpath_var
=no
1349 export_dynamic_flag_spec
='-Bexport'
1353 archive_cmds
='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1354 hardcode_libdir_flag_spec
='-L$libdir'
1357 hardcode_shlibpath_var
=no
1361 archive_cmds
='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1362 hardcode_libdir_flag_spec
='-L$libdir'
1365 hardcode_shlibpath_var
=no
1374 echo "$ac_t$ld_shlibs" 1>&6
1376 if test -z "$NM"; then
1377 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1379 /* |
[A-Za-z
]:[/\\]*) ;; # Let the user override the test with a path.
1381 IFS
="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1382 for ac_dir
in $PATH /usr
/ucb
/usr
/ccs
/bin
/bin
; do
1383 test -z "$ac_dir" && ac_dir
=.
1384 if test -f $ac_dir/nm
; then
1385 # Check to see if the nm accepts a BSD-compat flag.
1386 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1387 # nm: unknown option "B" ignored
1388 if ($ac_dir/nm
-B /dev
/null
2>&1 |
sed '1q'; exit 0) |
egrep /dev
/null
>/dev
/null
; then
1391 elif ($ac_dir/nm
-p /dev
/null
2>&1 |
sed '1q'; exit 0) |
egrep /dev
/null
>/dev
/null
; then
1395 NM
=${NM="$ac_dir/nm"} # keep the first match, but
1396 continue # so that we can try to find one that supports BSD flags
1401 test -z "$NM" && NM
=nm
1404 echo "$ac_t$NM" 1>&6
1407 # Check for command to grab the raw symbol name followed by C symbol from nm.
1408 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1410 # These are sane defaults that work on at least a few old systems.
1411 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1413 # Character class describing NM global symbol codes.
1414 symcode
='[BCDEGRST]'
1416 # Regexp to match symbols that can be accessed directly from C.
1417 sympat
='\([_A-Za-z][_A-Za-z0-9]*\)'
1419 # Transform the above into a raw symbol and a C symbol.
1420 symxfrm
='\1 \2\3 \3'
1422 # Transform an extracted symbol line into a proper C declaration
1423 global_symbol_to_cdecl
="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1425 # Define system-specific variables.
1431 symcode
='[ABCDGISTW]'
1433 hpux
*) # Its linker distinguishes data from code symbols
1434 global_symbol_to_cdecl
="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1437 symcode
='[BCDEGRST]'
1444 # If we're using GNU nm, then use its standard symbol codes.
1445 if $NM -V 2>&1 |
egrep '(GNU|with BFD)' > /dev
/null
; then
1446 symcode
='[ABCDGISTW]'
1449 # Try without a prefix undercore, then with it.
1450 for ac_symprfx
in "" "_"; do
1452 # Write the raw and C identifiers.
1453 global_symbol_pipe
="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
1455 # Check to see that the pipe works correctly.
1458 cat > conftest.c
<<EOF
1463 void nm_test_func(){}
1467 main(){nm_test_var='a';nm_test_func();return(0);}
1470 echo "$progname:1447: checking if global_symbol_pipe works" >&5
1471 if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.
$objext; then
1472 # Now try to grab the symbols.
1474 if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1476 # Try sorting and uniquifying the output.
1477 if sort "$nlist" |
uniq > "$nlist"T
; then
1478 mv -f "$nlist"T
"$nlist"
1483 # Make sure that we snagged all the symbols we need.
1484 if egrep ' nm_test_var$' "$nlist" >/dev
/null
; then
1485 if egrep ' nm_test_func$' "$nlist" >/dev
/null
; then
1486 cat <<EOF > conftest.c
1492 # Now generate the symbol file.
1493 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
1495 cat <<EOF >> conftest.c
1496 #if defined (__STDC__) && __STDC__
1497 # define lt_ptr_t void *
1499 # define lt_ptr_t char *
1503 /* The mapping between symbol names and symbols. */
1508 lt_preloaded_symbols[] =
1511 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
1512 cat <<\EOF
>> conftest.c
1520 # Now try linking the two files.
1521 mv conftest.
$objext conftestm.
$objext
1523 save_CFLAGS
="$CFLAGS"
1524 LIBS
="conftestm.$objext"
1525 CFLAGS
="$CFLAGS$no_builtin_flag"
1526 if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
1529 echo "$progname: failed program was:" >&5
1534 echo "cannot find nm_test_func in $nlist" >&5
1537 echo "cannot find nm_test_var in $nlist" >&5
1540 echo "cannot run $global_symbol_pipe" >&5
1543 echo "$progname: failed program was:" >&5
1548 # Do not use the global_symbol_pipe unless it works.
1549 if test "$pipe_works" = yes; then
1555 echo "$ac_t$pipe_works" 1>&6
1557 if test -z "$global_symbol_pipe"; then
1558 global_symbol_to_cdecl
=
1561 # Check hardcoding attributes.
1562 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1564 if test -n "$hardcode_libdir_flag_spec" || \
1565 test -n "$runpath_var"; then
1567 # We can hardcode non-existant directories.
1568 if test "$hardcode_direct" != no
&& \
1569 test "$hardcode_minus_L" != no
&& \
1570 test "$hardcode_shlibpath_var" != no
; then
1572 # Linking always hardcodes the temporary library directory.
1573 hardcode_action
=relink
1575 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1576 hardcode_action
=immediate
1579 # We cannot hardcode anything, or else we can only hardcode existing
1581 hardcode_action
=unsupported
1583 echo "$ac_t$hardcode_action" 1>&6
1587 reload_cmds
='$LD$reload_flag -o $output$reload_objs'
1588 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1589 # PORTME Some linkers may need a different reload flag.
1591 echo "$ac_t$reload_flag" 1>&6
1592 test -n "$reload_flag" && reload_flag
=" $reload_flag"
1594 # PORTME Fill in your ld.so characteristics
1596 libname_spec
='lib$name'
1603 shlibpath_overrides_runpath
=unknown
1605 dynamic_linker
="$host_os ld.so"
1606 sys_lib_dlsearch_path_spec
="/lib /usr/lib"
1607 sys_lib_search_path_spec
="/lib /usr/lib /usr/local/lib"
1609 file_magic_test_file
=
1610 deplibs_check_method
='unknown'
1611 # Need to set the preceding variable on all platforms that support
1612 # interlibrary dependencies.
1613 # 'none' -- dependencies not supported.
1614 # `unknown' -- same as none, but documents that we really don't know.
1615 # 'pass_all' -- all dependencies passed with no checks.
1616 # 'test_compile' -- check by making test program.
1617 # 'file_magic [regex]' -- check by looking for files in library path
1618 # which responds to the $file_magic_cmd with a given egrep regex.
1619 # If you have `file' or equivalent on your system and you're not sure
1620 # whether `pass_all' will *always* work, you probably want this one.
1621 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1625 library_names_spec
='${libname}${release}.so$versuffix $libname.a'
1626 shlibpath_var
=LIBPATH
1628 # AIX has no versioning support, so we append a major version to the name.
1629 soname_spec
='${libname}${release}.so$major'
1634 # AIX has no versioning support, so currently we can not hardcode correct
1635 # soname into executable. Probably we can add versioning support to
1636 # collect2, so additional links can be useful in future.
1637 # We preserve .a as extension for shared libraries though AIX4.2
1638 # and later linker supports .so
1639 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
1640 shlibpath_var
=LIBPATH
1641 deplibs_check_method
=pass_all
1645 library_names_spec
='$libname.ixlibrary $libname.a'
1646 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1647 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'
1651 library_names_spec
='${libname}.so'
1652 dynamic_linker
="$host_os ld.so"
1653 shlibpath_var
=LIBRARY_PATH
1658 library_names_spec
='${libname}.so$major ${libname}.so'
1659 soname_spec
='${libname}.so'
1660 finish_cmds
='PATH="$PATH:/sbin" ldconfig $libdir'
1661 shlibpath_var
=LD_LIBRARY_PATH
1662 deplibs_check_method
='file_magic ELF 32-bit LSB shared object'
1663 file_magic_cmd
=/usr
/bin
/file
1664 file_magic_test_file
=/shlib
/libc.so
1665 sys_lib_search_path_spec
="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1666 sys_lib_dlsearch_path_spec
="/shlib /usr/lib /usr/local/lib"
1667 # the default ld.so.conf also contains /usr/contrib/lib and
1668 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1669 # libtool to hard-code these into programs
1673 version_type
=windows
1674 if test "$with_gcc" = yes; then
1675 library_names_spec
='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
1677 library_names_spec
='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1679 dynamic_linker
='Win32 ld.exe'
1680 deplibs_check_method
='file_magic file format pei*-i386.*architecture: i386'
1681 file_magic_cmd
='objdump -f'
1683 # FIXME: first we should search . and the directory the executable is in
1692 objformat
=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1693 version_type
=freebsd-
$objformat
1694 case "$version_type" in
1696 deplibs_check_method
='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
1697 file_magic_cmd
=/usr
/bin
/file
1698 file_magic_test_file
=`echo /usr/lib/libc.so*`
1699 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1704 deplibs_check_method
=unknown
1705 library_names_spec
='${libname}${release}.so$versuffix $libname.so$versuffix'
1709 finish_cmds
='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
1710 shlibpath_var
=LD_LIBRARY_PATH
1715 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so'
1716 shlibpath_var
=LD_LIBRARY_PATH
1719 hpux9
* | hpux10
* | hpux11
*)
1720 # Give a soname corresponding to the major version so that dld.sl refuses to
1721 # link against other versions.
1722 dynamic_linker
="$host_os dld.sl"
1726 shlibpath_var
=SHLIB_PATH
1727 library_names_spec
='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1728 soname_spec
='${libname}${release}.sl$major'
1729 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1730 postinstall_cmds
='chmod 555 $lib'
1735 soname_spec
='${libname}${release}.so'
1736 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1737 shlibpath_var
=LD_LIBRARY_PATH
1738 deplibs_check_method
="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all?
1739 file_magic_cmd
=/usr
/bin
/file
1740 file_magic_test_file
=`echo /lib/libc.so*`
1741 shlibpath_overrides_runpath
=no
1748 soname_spec
='${libname}${release}.so'
1749 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1750 case "$LD" in # libtool.m4 will add one of these switches to LD
1751 *-32|
*"-32 ") libsuff
= shlibsuff
= libmagic
=32-bit;;
1752 *-n32|
*"-n32 ") libsuff
=32 shlibsuff
=N32 libmagic
=N32
;;
1753 *-64|
*"-64 ") libsuff
=64 shlibsuff
=64 libmagic
=64-bit;;
1754 *) libsuff
= shlibsuff
= libmagic
=never-match
;;
1756 shlibpath_var
=LD_LIBRARY
${shlibsuff}_PATH
1757 shlibpath_overrides_runpath
=no
1758 # even though /usr/local/lib is always searched, the man-page says
1759 # shared libraries should not be installed there if they use an ABI
1760 # different from -32, so we'd better not search for shared libraries
1762 sys_lib_search_path_spec
="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
1763 sys_lib_dlsearch_path_spec
="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
1764 deplibs_check_method
="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all?
1765 file_magic_cmd
=/usr
/bin
/file
1766 file_magic_test_file
=`echo /lib${libsuff}/libc.so*`
1769 # No shared lib support for Linux oldld, aout, or coff.
1770 linux-gnuoldld
* | linux-gnuaout
* | linux-gnucoff
*)
1774 # This must be Linux ELF.
1779 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1780 soname_spec
='${libname}${release}.so$major'
1781 finish_cmds
='PATH="$PATH:/sbin" ldconfig -n $libdir'
1782 shlibpath_var
=LD_LIBRARY_PATH
1783 shlibpath_overrides_runpath
=no
1784 deplibs_check_method
='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
1785 file_magic_cmd
=/usr
/bin
/file
1786 file_magic_test_file
=`echo /lib/libc.so* /lib/libc-*.so`
1788 if test -f /lib
/ld.so
.1; then
1789 dynamic_linker
='GNU ld.so'
1791 # Only the GNU ld.so supports shared libraries on MkLinux.
1793 powerpc
*) dynamic_linker
=no
;;
1794 *) dynamic_linker
='Linux ld.so' ;;
1800 sys_lib_search_path_spec
="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
1801 sys_lib_dlsearch_path_spec
="/lib${libsuff} /usr/lib${libsuff}"
1808 if echo __ELF__ |
$CC -E - |
grep __ELF__
>/dev
/null
; then
1809 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1810 finish_cmds
='PATH="$PATH:/sbin" ldconfig -m $libdir'
1811 dynamic_linker
='NetBSD (a.out) ld.so'
1813 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1814 soname_spec
='${libname}${release}.so$major'
1815 dynamic_linker
='NetBSD ld.elf_so'
1817 shlibpath_var
=LD_LIBRARY_PATH
1822 if test "$with_gnu_ld" = yes; then
1826 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1827 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1828 shlibpath_var
=LD_LIBRARY_PATH
1832 libname_spec
='$name'
1834 library_names_spec
='$libname.dll $libname.a'
1835 dynamic_linker
='OS/2 ld.exe'
1836 shlibpath_var
=LIBPATH
1841 soname_spec
='${libname}${release}.so'
1842 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1843 shlibpath_var
=LD_LIBRARY_PATH
1844 # deplibs_check_method='pass_all'
1845 # Although pass_all appears to work, it copies symbols from static libraries
1846 # into shared ones and exports them. So, when a program is linked with two
1847 # or more libraries that have got copies of the same symbols, link fails
1848 # This was only tested on osf4:
1849 deplibs_check_method
='file_magic COFF format alpha shared library'
1850 file_magic_cmd
=/usr
/bin
/file
1851 file_magic_test_file
=/shlib
/libc.so
1852 sys_lib_search_path_spec
="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1853 sys_lib_dlsearch_path_spec
="$sys_lib_search_path_spec"
1858 soname_spec
='${libname}${release}.so$major'
1859 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1860 shlibpath_var
=LD_LIBRARY_PATH
1867 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1868 soname_spec
='${libname}${release}.so$major'
1869 shlibpath_var
=LD_LIBRARY_PATH
1870 shlibpath_overrides_runpath
=yes
1871 # ldd complains unless libraries are executable
1872 postinstall_cmds
='chmod +x $lib'
1873 deplibs_check_method
="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
1874 file_magic_cmd
=/usr
/bin
/file
1875 file_magic_test_file
=/lib
/libc.so
1880 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1881 finish_cmds
='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1882 shlibpath_var
=LD_LIBRARY_PATH
1883 shlibpath_overrides_runpath
=yes
1884 if test "$with_gnu_ld" = yes; then
1890 sysv4.2uw2
* | sysv4.3
* | sysv5
*)
1892 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1893 soname_spec
='${libname}${release}.so$major'
1894 shlibpath_var
=LD_LIBRARY_PATH
1895 case "$host_vendor" in
1897 deplibs_check_method
='pass_all'
1904 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1905 soname_spec
='${libname}${release}.so$major'
1906 shlibpath_var
=LD_LIBRARY_PATH
1913 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1914 soname_spec
='${libname}${release}.so$major'
1915 shlibpath_var
=LD_LIBRARY_PATH
1922 echo "$ac_t$dynamic_linker" 1>&6
1923 test "$dynamic_linker" = no
&& can_build_shared
=no
1925 # Report the final consequences.
1926 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1928 if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
1929 case "$deplibs_check_method" in
1931 file_magic_regex
="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
1932 if eval $file_magic_cmd \
$file_magic_test_file 2> /dev
/null |
1933 egrep "$file_magic_regex" > /dev
/null
; then
1938 *** Warning: the command libtool uses to detect shared libraries,
1939 *** $file_magic_cmd, produces output that libtool cannot recognize.
1940 *** The result is that libtool may fail to recognize shared libraries
1941 *** as such. This will affect the creation of libtool libraries that
1942 *** depend on shared libraries, but programs linked with such libtool
1943 *** libraries will work regardless of this problem. Nevertheless, you
1944 *** may want to report the problem to your system manager and/or to
1945 *** bug-libtool@gnu.org
1952 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1953 test "$can_build_shared" = "no" && enable_shared
=no
1955 # On AIX, shared libraries and static libraries use the same namespace, and
1956 # are all built from PIC.
1959 test "$enable_shared" = yes && enable_static
=no
1960 if test -n "$RANLIB"; then
1961 archive_cmds
="$archive_cmds~\$RANLIB \$lib"
1962 postinstall_cmds
='$RANLIB $lib'
1967 test "$enable_shared" = yes && enable_static
=no
1971 echo "$ac_t$enable_shared" 1>&6
1973 # Make sure either enable_shared or enable_static is yes.
1974 test "$enable_shared" = yes || enable_static
=yes
1976 echo "checking whether to build static libraries... $enable_static" 1>&6
1978 if test "$hardcode_action" = relink
; then
1979 # Fast installation is not supported
1980 enable_fast_install
=no
1981 elif test "$shlibpath_overrides_runpath" = yes ||
1982 test "$enable_shared" = no
; then
1983 # Fast installation is not necessary
1984 enable_fast_install
=needless
1987 echo $ac_n "checking for objdir... $ac_c" 1>&6
1988 rm -f .libs
2>/dev
/null
1989 mkdir .libs
2>/dev
/null
1990 if test -d .libs
; then
1993 # MS-DOS does not allow filenames that begin with a dot.
1996 rmdir .libs
2>/dev
/null
1997 echo "$ac_t$objdir" 1>&6
1999 if test "x$enable_dlopen" != xyes
; then
2000 enable_dlopen
=unknown
2001 enable_dlopen_self
=unknown
2002 enable_dlopen_self_static
=unknown
2004 if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
2005 lt_cv_dlopen
=no lt_cv_dlopen_libs
=
2006 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
2007 echo "$progname:1977: checking for dlopen" >&5
2008 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
2009 echo $ac_n "(cached) $ac_c" 1>&6
2011 cat > conftest.
$ac_ext <<EOF
2012 #line 1982 "ltconfig"
2013 /* System header to define __stub macros and hopefully few prototypes,
2014 which can conflict with char dlopen(); below. */
2016 /* Override any gcc2 internal prototype to avoid an error. */
2017 /* We use char because int might match the return type of a gcc2
2018 builtin and then its argument prototype would still apply. */
2023 /* The GNU C library defines this for functions which it implements
2024 to always fail with ENOSYS. Some functions are actually named
2025 something starting with __ and the normal name is an alias. */
2026 #if defined (__stub_dlopen) || defined (__stub___dlopen)
2034 if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
${ac_exeext}; then
2036 eval "ac_cv_func_dlopen=yes"
2038 echo "$progname: failed program was:" >&5
2039 cat conftest.
$ac_ext >&5
2041 eval "ac_cv_func_dlopen=no"
2046 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
2047 echo "$ac_t""yes" 1>&6
2048 lt_cv_dlopen
="dlopen"
2050 echo "$ac_t""no" 1>&6
2051 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2052 echo "$progname:2022: checking for dlopen in -ldl" >&5
2053 ac_lib_var
=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
2054 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2055 echo $ac_n "(cached) $ac_c" 1>&6
2057 ac_save_LIBS
="$LIBS"
2059 cat > conftest.
$ac_ext <<EOF
2060 #line 2030 "ltconfig"
2061 /* Override any gcc2 internal prototype to avoid an error. */
2062 /* We use char because int might match the return type of a gcc2
2063 builtin and then its argument prototype would still apply. */
2070 if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
${ac_exeext}; then
2072 eval "ac_cv_lib_$ac_lib_var=yes"
2074 echo "$progname: failed program was:" >&5
2075 cat conftest.
$ac_ext >&5
2077 eval "ac_cv_lib_$ac_lib_var=no"
2080 LIBS
="$ac_save_LIBS"
2083 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2084 echo "$ac_t""yes" 1>&6
2085 lt_cv_dlopen
="dlopen" lt_cv_dlopen_libs
="-ldl"
2087 echo "$ac_t""no" 1>&6
2088 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
2089 echo "$progname:2059: checking for dld_link in -ldld" >&5
2090 ac_lib_var
=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
2091 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2092 echo $ac_n "(cached) $ac_c" 1>&6
2094 ac_save_LIBS
="$LIBS"
2096 cat > conftest.
$ac_ext <<EOF
2097 #line 2067 "ltconfig"
2098 /* Override any gcc2 internal prototype to avoid an error. */
2099 /* We use char because int might match the return type of a gcc2
2100 builtin and then its argument prototype would still apply. */
2107 if { (eval echo $progname:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
${ac_exeext}; then
2109 eval "ac_cv_lib_$ac_lib_var=yes"
2111 echo "$progname: failed program was:" >&5
2112 cat conftest.
$ac_ext >&5
2114 eval "ac_cv_lib_$ac_lib_var=no"
2117 LIBS
="$ac_save_LIBS"
2120 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2121 echo "$ac_t""yes" 1>&6
2122 lt_cv_dlopen
="dld_link" lt_cv_dlopen_libs
="-ldld"
2124 echo "$ac_t""no" 1>&6
2125 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
2126 echo "$progname:2096: checking for shl_load" >&5
2127 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
2128 echo $ac_n "(cached) $ac_c" 1>&6
2130 cat > conftest.
$ac_ext <<EOF
2131 #line 2101 "ltconfig"
2132 /* System header to define __stub macros and hopefully few prototypes,
2133 which can conflict with char shl_load(); below. */
2135 /* Override any gcc2 internal prototype to avoid an error. */
2136 /* We use char because int might match the return type of a gcc2
2137 builtin and then its argument prototype would still apply. */
2142 /* The GNU C library defines this for functions which it implements
2143 to always fail with ENOSYS. Some functions are actually named
2144 something starting with __ and the normal name is an alias. */
2145 #if defined (__stub_shl_load) || defined (__stub___shl_load)
2153 if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
${ac_exeext}; then
2155 eval "ac_cv_func_shl_load=yes"
2157 echo "$progname: failed program was:" >&5
2158 cat conftest.
$ac_ext >&5
2160 eval "ac_cv_func_shl_load=no"
2165 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
2166 echo "$ac_t""yes" 1>&6
2167 lt_cv_dlopen
="shl_load"
2169 echo "$ac_t""no" 1>&6
2170 echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6
2171 echo "$progname:2141: checking for LoadLibrary" >&5
2172 if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then
2173 echo $ac_n "(cached) $ac_c" 1>&6
2175 cat > conftest.
$ac_ext <<EOF
2176 #line 2146 "ltconfig"
2177 /* System header to define __stub macros and hopefully few prototypes,
2178 which can conflict with char LoadLibrary(); below. */
2180 /* Override any gcc2 internal prototype to avoid an error. */
2181 /* We use char because int might match the return type of a gcc2
2182 builtin and then its argument prototype would still apply. */
2187 /* The GNU C library defines this for functions which it implements
2188 to always fail with ENOSYS. Some functions are actually named
2189 something starting with __ and the normal name is an alias. */
2190 #if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary)
2198 if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
${ac_exeext}; then
2200 eval "ac_cv_func_LoadLibrary=yes"
2202 echo "$progname: failed program was:" >&5
2203 cat conftest.
$ac_ext >&5
2205 eval "ac_cv_func_LoadLibrary=no"
2210 if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then
2211 echo "$ac_t""yes" 1>&6
2212 lt_cv_dlopen
="LoadLibrary"
2214 echo "$ac_t""no" 1>&6
2231 if test "x$lt_cv_dlopen" != xno
; then
2235 case "$lt_cv_dlopen" in
2237 for ac_hdr
in dlfcn.h
; do
2238 ac_safe
=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2239 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2240 echo "$progname:2210: checking for $ac_hdr" >&5
2241 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2242 echo $ac_n "(cached) $ac_c" 1>&6
2244 cat > conftest.
$ac_ext <<EOF
2245 #line 2215 "ltconfig"
2249 ac_try
="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
2250 { (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2251 ac_err
=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2252 if test -z "$ac_err"; then
2254 eval "ac_cv_header_$ac_safe=yes"
2257 echo "$progname: failed program was:" >&5
2258 cat conftest.
$ac_ext >&5
2260 eval "ac_cv_header_$ac_safe=no"
2264 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2265 echo "$ac_t""yes" 1>&6
2267 echo "$ac_t""no" 1>&6
2271 if test "x$ac_cv_header_dlfcn_h" = xyes
; then
2272 CPPFLAGS
="$CPPFLAGS -DHAVE_DLFCN_H"
2274 eval LDFLAGS
=\"\
$LDFLAGS $export_dynamic_flag_spec\"
2275 LIBS
="$lt_cv_dlopen_libs $LIBS"
2277 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
2278 echo "$progname:2248: checking whether a program can dlopen itself" >&5
2279 if test "${lt_cv_dlopen_self+set}" = set; then
2280 echo $ac_n "(cached) $ac_c" 1>&6
2282 if test "$cross_compiling" = yes; then
2283 lt_cv_dlopen_self
=cross
2285 cat > conftest.c
<<EOF
2286 #line 2256 "ltconfig"
2295 # define LTDL_GLOBAL RTLD_GLOBAL
2298 # define LTDL_GLOBAL DL_GLOBAL
2300 # define LTDL_GLOBAL 0
2304 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2305 find out it does not work in some platform. */
2306 #ifndef LTDL_LAZY_OR_NOW
2308 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2311 # define LTDL_LAZY_OR_NOW DL_LAZY
2314 # define LTDL_LAZY_OR_NOW RTLD_NOW
2317 # define LTDL_LAZY_OR_NOW DL_NOW
2319 # define LTDL_LAZY_OR_NOW 0
2326 fnord() { int i=42;}
2327 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2328 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2329 if(ptr1 || ptr2) exit(0); } exit(1); }
2332 if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
&& (.
/conftest
; exit) 2>/dev
/null
2334 lt_cv_dlopen_self
=yes
2336 echo "$progname: failed program was:" >&5
2337 cat conftest.
$ac_ext >&5
2339 lt_cv_dlopen_self
=no
2346 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2348 if test "$lt_cv_dlopen_self" = yes; then
2349 LDFLAGS
="$LDFLAGS $link_static_flag"
2350 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2351 echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5
2352 if test "${lt_cv_dlopen_self_static+set}" = set; then
2353 echo $ac_n "(cached) $ac_c" 1>&6
2355 if test "$cross_compiling" = yes; then
2356 lt_cv_dlopen_self_static
=cross
2358 cat > conftest.c
<<EOF
2359 #line 2329 "ltconfig"
2368 # define LTDL_GLOBAL RTLD_GLOBAL
2371 # define LTDL_GLOBAL DL_GLOBAL
2373 # define LTDL_GLOBAL 0
2377 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2378 find out it does not work in some platform. */
2379 #ifndef LTDL_LAZY_OR_NOW
2381 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2384 # define LTDL_LAZY_OR_NOW DL_LAZY
2387 # define LTDL_LAZY_OR_NOW RTLD_NOW
2390 # define LTDL_LAZY_OR_NOW DL_NOW
2392 # define LTDL_LAZY_OR_NOW 0
2399 fnord() { int i=42;}
2400 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2401 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2402 if(ptr1 || ptr2) exit(0); } exit(1); }
2405 if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
&& (.
/conftest
; exit) 2>/dev
/null
2407 lt_cv_dlopen_self_static
=yes
2409 echo "$progname: failed program was:" >&5
2410 cat conftest.
$ac_ext >&5
2412 lt_cv_dlopen_self_static
=no
2419 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2424 case "$lt_cv_dlopen_self" in
2425 yes|no
) enable_dlopen_self
=$lt_cv_dlopen_self ;;
2426 *) enable_dlopen_self
=unknown
;;
2429 case "$lt_cv_dlopen_self_static" in
2430 yes|no
) enable_dlopen_self_static
=$lt_cv_dlopen_self_static ;;
2431 *) enable_dlopen_self_static
=unknown
;;
2435 # Copy echo and quote the copy, instead of the original, because it is
2438 if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2439 ltecho
="$CONFIG_SHELL \$0 --fallback-echo"
2443 LTCONFIG_VERSION
="$VERSION"
2445 # Only quote variables if we're using ltmain.sh.
2448 # Now quote all the things that may contain metacharacters.
2449 for var
in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
2450 old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2451 reload_flag reload_cmds wl \
2452 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2453 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2454 library_names_spec soname_spec \
2455 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2456 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
2457 file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
2458 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2459 hardcode_libdir_flag_spec hardcode_libdir_separator \
2460 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2461 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms \
2462 extra_compiler_flags extra_compiler_flags_value
; do
2465 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2466 old_postinstall_cmds | old_postuninstall_cmds | \
2467 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2468 postinstall_cmds | postuninstall_cmds | \
2469 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec
)
2470 # Double-quote double-evaled strings.
2471 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2474 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2480 *'\$0 --fallback-echo"')
2481 ltecho
=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2485 trap "$rm \"$ofile\"; exit 1" 1 2 15
2486 echo "creating $ofile"
2488 cat <<EOF > "$ofile"
2491 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2492 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2493 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2495 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
2496 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2498 # This program is free software; you can redistribute it and/or modify
2499 # it under the terms of the GNU General Public License as published by
2500 # the Free Software Foundation; either version 2 of the License, or
2501 # (at your option) any later version.
2503 # This program is distributed in the hope that it will be useful, but
2504 # WITHOUT ANY WARRANTY; without even the implied warranty of
2505 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2506 # General Public License for more details.
2508 # You should have received a copy of the GNU General Public License
2509 # along with this program; if not, write to the Free Software
2510 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2512 # As a special exception to the GNU General Public License, if you
2513 # distribute this file as part of a program that contains a
2514 # configuration script generated by Autoconf, you may include it under
2515 # the same distribution terms that you use for the rest of that program.
2517 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2518 Xsed="sed -e s/^X//"
2520 # The HP-UX ksh and POSIX shell print the target directory to stdout
2522 if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
2524 ### BEGIN LIBTOOL CONFIG
2530 # Double-quote the variables that need it (for aesthetics).
2531 for var
in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
2532 old_LN_S old_DLLTOOL old_AS
; do
2533 eval "$var=\\\"\$var\\\""
2536 # Just create a config file.
2537 cfgfile
="$ofile.cfg"
2538 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2539 echo "creating $cfgfile"
2541 cat <<EOF > "$cfgfile"
2542 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2543 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2548 cat <<EOF >> "$cfgfile"
2549 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2551 # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2552 # LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
2553 # DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
2556 # Compiler and other test output produced by $progname, useful for
2557 # debugging $progname, is in ./config.log if it exists.
2559 # The version of $progname that generated this script.
2560 LTCONFIG_VERSION=$LTCONFIG_VERSION
2562 # Shell to use when invoking shell scripts.
2565 # Whether or not to build shared libraries.
2566 build_libtool_libs=$enable_shared
2568 # Whether or not to build static libraries.
2569 build_old_libs=$enable_static
2571 # Whether or not to optimize for fast installation.
2572 fast_install=$enable_fast_install
2575 host_alias=$host_alias
2578 # An echo program that does not interpret backslashes.
2584 # The default C compiler.
2587 # The linker used to build libraries.
2590 # Whether we need hard or soft links.
2593 # A BSD-compatible nm program.
2596 # Used on cygwin: DLL creation program.
2599 # Used on cygwin: assembler.
2602 # The name of the directory that contains temporary libtool files.
2605 # How to create reloadable object files.
2606 reload_flag=$reload_flag
2607 reload_cmds=$reload_cmds
2609 # How to pass a linker flag through the compiler.
2612 # Object file suffix (normally "o").
2615 # Old archive suffix (normally "a").
2618 # Additional compiler flags for building library objects.
2621 # Does compiler simultaneously support -c and -o options
2622 compiler_c_o=$compiler_c_o
2624 # Can we write directly to a .lo ?
2625 compiler_o_lo=$compiler_o_lo
2627 # Must we lock files when doing compilation ?
2628 need_locks=$need_locks
2630 # Do we need the lib prefix for modules?
2631 need_lib_prefix=$need_lib_prefix
2633 # Do we need a version for libraries?
2634 need_version=$need_version
2636 # Whether dlopen is supported.
2637 dlopen=$enable_dlopen
2639 # Whether dlopen of programs is supported.
2640 dlopen_self=$enable_dlopen_self
2642 # Whether dlopen of statically linked programs is supported.
2643 dlopen_self_static=$enable_dlopen_self_static
2645 # Compiler flag to prevent dynamic linking.
2646 link_static_flag=$link_static_flag
2648 # Compiler flag to turn off builtin functions.
2649 no_builtin_flag=$no_builtin_flag
2651 # Compiler flag to allow reflexive dlopens.
2652 export_dynamic_flag_spec=$export_dynamic_flag_spec
2654 # Compiler flag to generate shared objects directly from archives.
2655 whole_archive_flag_spec=$whole_archive_flag_spec
2657 # Compiler flag to generate thread-safe objects.
2658 thread_safe_flag_spec=$thread_safe_flag_spec
2660 # Library versioning type.
2661 version_type=$version_type
2663 # Format of library name prefix.
2664 libname_spec=$libname_spec
2666 # List of archive names. First name is the real one, the rest are links.
2667 # The last name is the one that the linker finds with -lNAME.
2668 library_names_spec=$library_names_spec
2670 # The coded name of the library, if different from the real name.
2671 soname_spec=$soname_spec
2673 # Commands used to build and install an old-style archive.
2675 old_archive_cmds=$old_archive_cmds
2676 old_postinstall_cmds=$old_postinstall_cmds
2677 old_postuninstall_cmds=$old_postuninstall_cmds
2679 # Create an old-style archive from a shared archive.
2680 old_archive_from_new_cmds=$old_archive_from_new_cmds
2682 # Commands used to build and install a shared archive.
2683 archive_cmds=$archive_cmds
2684 archive_expsym_cmds=$archive_expsym_cmds
2685 postinstall_cmds=$postinstall_cmds
2686 postuninstall_cmds=$postuninstall_cmds
2688 # Case patterns for extra compiler flags needed for linking
2689 extra_compiler_flags=$extra_compiler_flags
2690 extra_compiler_flags_value=$extra_compiler_flags_value
2692 # Method to check whether dependent libraries are shared objects.
2693 deplibs_check_method=$deplibs_check_method
2695 # Command to use when deplibs_check_method == file_magic
2696 file_magic_cmd=$file_magic_cmd
2698 # Flag that allows shared libraries with undefined symbols to be built.
2699 allow_undefined_flag=$allow_undefined_flag
2701 # Flag that forces no undefined symbols.
2702 no_undefined_flag=$no_undefined_flag
2704 # Commands used to finish a libtool library installation in a directory.
2705 finish_cmds=$finish_cmds
2707 # Same as above, but a single script fragment to be evaled but not shown.
2708 finish_eval=$finish_eval
2710 # Take the output of nm and produce a listing of raw symbols and C names.
2711 global_symbol_pipe=$global_symbol_pipe
2713 # Transform the output of nm in a proper C declaration
2714 global_symbol_to_cdecl=$global_symbol_to_cdecl
2716 # This is the shared library runtime path variable.
2717 runpath_var=$runpath_var
2719 # This is the shared library path variable.
2720 shlibpath_var=$shlibpath_var
2722 # Is shlibpath searched before the hard-coded library search path?
2723 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2725 # How to hardcode a shared library path into an executable.
2726 hardcode_action=$hardcode_action
2728 # Flag to hardcode \$libdir into a binary during linking.
2729 # This must work even if \$libdir does not exist.
2730 hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2732 # Whether we need a single -rpath flag with a separated argument.
2733 hardcode_libdir_separator=$hardcode_libdir_separator
2735 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2737 hardcode_direct=$hardcode_direct
2739 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2741 hardcode_minus_L=$hardcode_minus_L
2743 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2744 # the resulting binary.
2745 hardcode_shlibpath_var=$hardcode_shlibpath_var
2747 # Compile-time system search path for libraries
2748 sys_lib_search_path_spec=$sys_lib_search_path_spec
2750 # Run-time system search path for libraries
2751 sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2753 # Fix the shell variable \$srcfile for the compiler.
2754 fix_srcfile_path="$fix_srcfile_path"
2756 # Set to yes if exported symbols are required
2757 always_export_symbols=$always_export_symbols
2759 # The command to extract exported symbols
2760 export_symbols_cmds=$export_symbols_cmds
2762 # Symbols that should not be listed in the preloaded symbols
2763 exclude_expsyms=$exclude_expsyms
2765 # Symbols that must always be exported
2766 include_expsyms=$include_expsyms
2772 echo '### END LIBTOOL CONFIG' >> "$ofile"
2776 cat <<\EOF
>> "$ofile"
2778 # AIX sometimes has problems with the GCC collect2 program. For some
2779 # reason, if we set the COLLECT_NAMES environment variable, the problems
2780 # vanish in a puff of smoke.
2781 if test "${COLLECT_NAMES+set}" != set; then
2783 export COLLECT_NAMES
2789 # Append the ltmain.sh script.
2790 cat "$ltmain" >> "$ofile" ||
(rm -f "$ofile"; exit 1)
2796 # Compile the libtool program.
2797 echo "FIXME: would compile $ltmain"
2801 test -n "$cache_file" ||
exit 0
2805 cat > confcache
<<\EOF
2806 # This file is a shell script that caches the results of configure
2807 # tests run on this system so they can be shared between configure
2808 # scripts and configure runs. It is not useful on other systems.
2809 # If it contains results you don't want to keep, you may remove or edit it.
2811 # By default, configure uses ./config.cache as the cache file,
2812 # creating it if it does not exist already. You can give configure
2813 # the --cache-file=FILE option to use a different cache file; that is
2814 # what configure does when it calls configure scripts in
2815 # subdirectories, so they share the cache.
2816 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2817 # config.status only pays attention to the cache file if you give it the
2818 # --recheck option to rerun configure.
2821 # The following way of writing the cache mishandles newlines in values,
2822 # but we know of no workaround that is simple, portable, and efficient.
2823 # So, don't put newlines in cache variables' values.
2824 # Ultrix sh set writes to stderr and can't be redirected directly,
2825 # and sets the high bit in the cache file unless we assign to the vars.
2827 case `(ac_space=' '; set | grep ac_space) 2>&1` in
2829 # `set' does not quote correctly, so add quotes (double-quote substitution
2830 # turns \\\\ into \\, and sed turns \\ into \).
2832 -e "s/'/'\\\\''/g" \
2833 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2836 # `set' quotes correctly as required by POSIX, so do not add quotes.
2837 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2840 if cmp -s $cache_file confcache
; then
2843 if test -w $cache_file; then
2844 echo "updating cache $cache_file"
2845 cat confcache
> $cache_file
2847 echo "not updating unwritable cache $cache_file"