3 # ltconfig - Create a system-specific libtool.
4 # Copyright (C) 1996-1998 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 # The HP-UX ksh and POSIX shell print the target directory to stdout
51 if test "${CDPATH+set}" = set; then CDPATH
=; export CDPATH
; fi
53 if test "X${echo_test_string+set}" != "Xset"; then
54 # find a string as large as possible, as long as the shell can cope with it
55 for cmd
in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
56 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
57 if (echo_test_string
="`eval $cmd`") 2>/dev
/null
&&
58 echo_test_string
="`eval $cmd`" &&
59 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev
/null
; then
65 if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
66 test "X`($echo "$echo_test_string") 2>/dev/null`" != X
"$echo_test_string"; then
67 # The Solaris, AIX, and Digital Unix default echo programs unquote
68 # backslashes. This makes it impossible to quote backslashes using
69 # echo "$something" | sed 's/\\/\\\\/g'
71 # So, first we look for a working echo in the user's PATH.
73 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
74 for dir
in $PATH /usr
/ucb
; do
75 if test -f $dir/echo &&
76 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
77 test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
84 if test "X$echo" = Xecho
; then
85 # We didn't find a better echo, so look for alternatives.
86 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
87 test "X`(print -r "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
88 # This shell has a builtin print -r that does the trick.
90 elif test -f /bin
/ksh
&& test "X$CONFIG_SHELL" != X
/bin
/ksh
; then
91 # If we have ksh, try running ltconfig again with it.
92 ORIGINAL_CONFIG_SHELL
="${CONFIG_SHELL-/bin/sh}"
93 export ORIGINAL_CONFIG_SHELL
96 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
100 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
101 test "X`($echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
104 elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
105 test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
106 CONFIG_SHELL
="$ORIGINAL_CONFIG_SHELL"
108 SHELL
="$CONFIG_SHELL"
110 echo="$CONFIG_SHELL $0 --fallback-echo"
111 elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
112 test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X
"$echo_test_string"; then
113 echo="$CONFIG_SHELL $0 --fallback-echo"
115 # maybe with a smaller string...
118 for cmd
in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
119 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev
/null
; then
125 if test "$prev" != 'sed 50q "$0"'; then
126 echo_test_string
=`eval $prev`
127 export echo_test_string
128 exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
130 # Oops. We lost completely, so just stick with echo.
138 # Sed substitution that helps us do robust quoting. It backslashifies
139 # metacharacters that are still active within double-quoted strings.
141 sed_quote_subst
='s/\([\\"\\`$\\\\]\)/\\\1/g'
143 # Same as above, but do not quote variable references.
144 double_quote_subst
='s/\([\\"\\`\\\\]\)/\\\1/g'
146 # The name of this program.
147 progname
=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
153 ac_compile
='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
154 ac_link
='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
157 help="Try \`$progname --help' for more information."
160 default_ofile
=libtool
163 # All known linkers require a `.a' archive for static linking.
172 ofile
="$default_ofile"
183 old_CPPFLAGS
="$CPPFLAGS"
188 old_DLLTOOL
="$DLLTOOL"
191 # Parse the command line options.
197 -*=*) optarg
=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
201 # If the previous option needs an argument, assign it.
202 if test -n "$prev"; then
203 eval "$prev=\$option"
210 Usage: $progname [OPTION]... [HOST [LTMAIN]]
212 Generate a system-specific libtool script.
214 --debug enable verbose shell tracing
215 --disable-shared do not build shared libraries
216 --disable-static do not build static libraries
217 --help display this help and exit
218 --no-verify do not verify that HOST is a valid host type
219 -o, --output=FILE specify the output file [default=$default_ofile]
220 --quiet same as \`--silent'
221 --silent do not print informational messages
222 --srcdir=DIR find \`config.guess' in DIR
223 --version output version information and exit
224 --with-gcc assume that the GNU C compiler will be used
225 --with-gnu-ld assume that the C compiler uses the GNU linker
226 --disable-lock disable file locking
228 LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
229 that provides basic libtool functionality.
231 HOST is the canonical host system name [default=guessed].
237 echo "$progname: enabling shell trace mode"
241 --disable-shared) enable_shared
=no
;;
243 --disable-static) enable_static
=no
;;
245 --quiet | --silent) silent
=yes ;;
247 --srcdir) prev
=srcdir
;;
248 --srcdir=*) srcdir
="$optarg" ;;
250 --no-verify) verify_host
=no
;;
252 --output | -o) prev
=ofile
;;
253 --output=*) ofile
="$optarg" ;;
255 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
257 --with-gcc) with_gcc
=yes ;;
258 --with-gnu-ld) with_gnu_ld
=yes ;;
260 --disable-lock) need_locks
=no
;;
263 echo "$progname: unrecognized option \`$option'" 1>&2
269 if test -z "$ltmain"; then
271 elif test -z "$host"; then
272 # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
273 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
274 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
278 echo "$progname: too many arguments" 1>&2
285 if test -z "$ltmain"; then
286 echo "$progname: you must specify a LTMAIN file" 1>&2
291 if test ! -f "$ltmain"; then
292 echo "$progname: \`$ltmain' does not exist" 1>&2
297 # Quote any args containing shell metacharacters.
302 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
303 ltconfig_args
="$ltconfig_args '$arg'" ;;
304 *) ltconfig_args
="$ltconfig_args $arg" ;;
308 # A relevant subset of AC_INIT.
310 # File descriptor usage:
313 # 2 errors and warnings
314 # 3 some systems may open it to /dev/tty
315 # 4 used on the Kubota Titan
316 # 5 compiler messages saved in config.log
317 # 6 checking for... messages and results
318 if test "$silent" = yes; then
326 # Only set LANG and LC_ALL to C if already set.
327 # These must not be set unconditionally because not all systems understand
328 # e.g. LANG=C (notably SCO).
329 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
330 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
332 if (echo "testing\c"; echo 1,2,3) | grep c
>/dev
/null
; then
333 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
334 if (echo -n testing
; echo 1,2,3) | sed s
/-n/xn
/ | grep xn
>/dev
/null
; then
341 ac_n
= ac_c
='\c' ac_t
=
344 if test -z "$srcdir"; then
345 # Assume the source directory is the same one as the path to LTMAIN.
346 srcdir
=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
347 test "$srcdir" = "$ltmain" && srcdir
=.
350 trap "$rm conftest*; exit 1" 1 2 15
351 if test "$verify_host" = yes; then
352 # Check for config.guess and config.sub.
354 for ac_dir
in $srcdir $srcdir/..
$srcdir/..
/..
; do
355 if test -f $ac_dir/config.guess
; then
360 if test -z "$ac_aux_dir"; then
361 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
365 ac_config_guess
=$ac_aux_dir/config.guess
366 ac_config_sub
=$ac_aux_dir/config.sub
368 # Make sure we can run config.sub.
369 if $SHELL $ac_config_sub sun4
>/dev
/null
2>&1; then :
371 echo "$progname: cannot run $ac_config_sub" 1>&2
376 echo $ac_n "checking host system type""... $ac_c" 1>&6
379 case "$host_alias" in
381 if host_alias
=`$SHELL $ac_config_guess`; then :
383 echo "$progname: cannot guess host type; you must specify one" 1>&2
388 host=`$SHELL $ac_config_sub $host_alias`
389 echo "$ac_t$host" 1>&6
391 # Make sure the host verified.
392 test -z "$host" && exit 1
394 elif test -z "$host"; then
395 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
402 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
405 linux
*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
408 host_cpu
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
409 host_vendor
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
410 host_os
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
414 # AIX sometimes has problems with the GCC collect2 program. For some
415 # reason, if we set the COLLECT_NAMES environment variable, the problems
416 # vanish in a puff of smoke.
417 if test "${COLLECT_NAMES+set}" != set; then
424 # Determine commands to create old-style static archives.
425 old_archive_cmds
='$AR cru $oldlib$oldobjs'
426 old_postinstall_cmds
='chmod 644 $oldlib'
427 old_postuninstall_cmds
=
429 # Set a sane default for `AR'.
430 test -z "$AR" && AR
=ar
432 # If RANLIB is not set, then run the test.
433 if test "${RANLIB+set}" != "set"; then
436 echo $ac_n "checking for ranlib... $ac_c" 1>&6
437 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
439 test -z "$dir" && dir
=.
440 if test -f $dir/ranlib
; then
448 echo "$ac_t$result" 1>&6
451 if test -n "$RANLIB"; then
452 old_archive_cmds
="$old_archive_cmds~\$RANLIB \$oldlib"
453 old_postinstall_cmds
="\$RANLIB \$oldlib~$old_postinstall_cmds"
456 # Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
457 test -z "$DLLTOOL" && DLLTOOL
=dlltool
458 test -z "$AS" && AS
=as
460 # Check to see if we are using GCC.
461 if test "$with_gcc" != yes || test -z "$CC"; then
462 # If CC is not set, then try to find GCC or a usable CC.
463 if test -z "$CC"; then
464 echo $ac_n "checking for gcc... $ac_c" 1>&6
465 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
468 test -z "$dir" && dir
=.
469 if test -f $dir/gcc
; then
476 if test -n "$CC"; then
483 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
484 if test -z "$CC"; then
485 echo $ac_n "checking for cc... $ac_c" 1>&6
486 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
489 test -z "$dir" && dir
=.
490 if test -f $dir/cc
; then
491 if test "$dir/cc" = "/usr/ucb/cc"; then
500 if test $cc_rejected = yes; then
501 # We found a bogon in the path, so make sure we never use it.
504 if test $# -gt 0; then
505 # We chose a different compiler from the bogus one.
506 # However, it has the same name, so the bogon will be chosen
507 # first if we set CC to just the name; use the full file name.
509 set dummy
"$dir/cc" "$@"
515 if test -n "$CC"; then
521 if test -z "$CC"; then
522 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
527 # Now see if the compiler is really GCC.
529 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
530 echo "$progname:530: checking whether we are using GNU C" >&5
533 cat > conftest.c
<<EOF
538 if { ac_try
='${CC-cc} -E conftest.c'; { (eval echo $progname:538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev
/null
2>&1; then
542 echo "$ac_t$with_gcc" 1>&6
545 # Allow CC to be a program name with arguments.
549 echo $ac_n "checking for object suffix... $ac_c" 1>&6
551 echo 'int i = 1;' > conftest.c
552 echo "$progname:552: checking for object suffix" >& 5
553 if { (eval echo $progname:553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; }; then
554 # Append any warnings to the config.log.
555 cat conftest.err
1>&5
557 for ac_file
in conftest.
*; do
560 *) objext
=`echo $ac_file | sed -e s/conftest.//` ;;
564 cat conftest.err
1>&5
565 echo "$progname: failed program was:" >&5
569 echo "$ac_t$objext" 1>&6
571 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
573 special_shlib_compile_flags
=
578 if test "$with_gcc" = yes; then
580 link_static_flag
='-static'
583 aix3
* | aix4
* | irix5
* | irix6
* | osf3
* | osf4
*)
584 # PIC is the default for these OSes.
586 cygwin32
* | mingw32
* | os2
*)
587 # We can build DLLs from non-PIC.
590 # FIXME: we need at least 68020 code to build shared libraries, but
591 # adding the `-m68020' flag to GCC prevents building anything better,
593 pic_flag
='-m68020 -resident32 -malways-restore-a4'
600 # PORTME Check for PIC flags for the system compiler.
603 # All AIX code is PIC.
604 link_static_flag
='-bnso -bI:/lib/syscalls.exp'
607 hpux9
* | hpux10
* | hpux11
*)
608 # Is there a better link_static_flag that works with the bundled CC?
610 link_static_flag
="${wl}-a ${wl}archive"
616 link_static_flag
='-non_shared'
617 # PIC (with -KPIC) is the default.
620 cygwin32
* | mingw32
* | os2
*)
621 # We can build DLLs from non-PIC.
625 # All OSF/1 code is PIC.
627 link_static_flag
='-non_shared'
632 link_static_flag
='-dn'
633 special_shlib_compile_flags
='-belf'
638 link_static_flag
='-Bstatic'
644 link_static_flag
='-Bstatic'
648 sysv4.2uw2
* | sysv5
*)
650 link_static_flag
='-Bstatic'
656 link_static_flag
='-Bstatic'
665 if test -n "$pic_flag"; then
666 echo "$ac_t$pic_flag" 1>&6
668 # Check to make sure the pic_flag actually works.
669 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
671 echo "int some_variable = 0;" > conftest.c
672 save_CFLAGS
="$CFLAGS"
673 CFLAGS
="$CFLAGS $pic_flag -DPIC"
674 echo "$progname:674: checking if $compiler PIC flag $pic_flag works" >&5
675 if { (eval echo $progname:675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.
$objext; then
676 # Append any warnings to the config.log.
677 cat conftest.err
1>&5
679 # On HP-UX, both CC and GCC only warn that PIC is supported... then they
680 # create non-PIC objects. So, if there were any warnings, we assume that
681 # PIC is not supported.
682 if test -s conftest.err
; then
688 pic_flag
=" $pic_flag"
691 # Append any errors to the config.log.
692 cat conftest.err
1>&5
697 CFLAGS
="$save_CFLAGS"
700 echo "$ac_t"none
1>&6
703 # Check to see if options -o and -c are simultaneously supported by compiler
704 echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
706 echo "int some_variable = 0;" > conftest.c
707 save_CFLAGS
="$CFLAGS"
708 CFLAGS
="$CFLAGS -c -o conftest2.o"
709 echo "$progname:709: checking if $compiler supports -c -o file.o" >&5
710 if { (eval echo $progname:710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest2.o
; then
712 # The compiler can only warn and ignore the option if not recognized
713 # So say no if there are warnings
714 if test -s conftest.err
; then
722 # Append any errors to the config.log.
723 cat conftest.err
1>&5
727 CFLAGS
="$save_CFLAGS"
730 if test x
"$compiler_c_o" = x
"yes"; then
731 # Check to see if we can write to a .lo
732 echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
734 echo "int some_variable = 0;" > conftest.c
735 save_CFLAGS
="$CFLAGS"
736 CFLAGS
="$CFLAGS -c -o conftest.lo"
737 echo "$progname:737: checking if $compiler supports -c -o file.lo" >&5
738 if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.lo
; then
740 # The compiler can only warn and ignore the option if not recognized
741 # So say no if there are warnings
742 if test -s conftest.err
; then
750 # Append any errors to the config.log.
751 cat conftest.err
1>&5
755 CFLAGS
="$save_CFLAGS"
761 # Check to see if we can do hard links to lock some files if needed
762 hard_links
="nottested"
763 if test "$compiler_c_o" = no
&& test "$need_locks" != no
; then
764 # do not overwrite the value of need_locks provided by the user
765 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
768 ln conftest.a conftest.b
2>/dev
/null
&& hard_links
=no
770 ln conftest.a conftest.b
2>&5 || hard_links
=no
771 ln conftest.a conftest.b
2>/dev
/null
&& hard_links
=no
772 echo "$ac_t$hard_links" 1>&6
774 if test "$hard_links" = no
; then
775 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
782 if test "$with_gcc" = yes; then
783 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
784 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
786 echo "int some_variable = 0;" > conftest.c
787 save_CFLAGS
="$CFLAGS"
788 CFLAGS
="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
789 echo "$progname:789: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
790 if { (eval echo $progname:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.o
; then
792 # The compiler can only warn and ignore the option if not recognized
793 # So say no if there are warnings
794 if test -s conftest.err
; then
796 compiler_rtti_exceptions
=no
799 compiler_rtti_exceptions
=yes
802 # Append any errors to the config.log.
803 cat conftest.err
1>&5
804 compiler_rtti_exceptions
=no
807 CFLAGS
="$save_CFLAGS"
810 if test "$compiler_rtti_exceptions" = "yes"; then
811 no_builtin_flag
=' -fno-builtin -fno-rtti -fno-exceptions'
813 no_builtin_flag
=' -fno-builtin'
818 # Check for any special shared library compilation flags.
819 if test -n "$special_shlib_compile_flags"; then
820 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
821 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev
/null
; then :
823 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
828 echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
830 echo 'main(){return(0);}' > conftest.c
831 save_LDFLAGS
="$LDFLAGS"
832 LDFLAGS
="$LDFLAGS $link_static_flag"
833 echo "$progname:833: checking if $compiler static flag $link_static_flag works" >&5
834 if { (eval echo $progname:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
835 echo "$ac_t$link_static_flag" 1>&6
837 echo "$ac_t"none
1>&6
840 LDFLAGS
="$save_LDFLAGS"
843 if test -z "$LN_S"; then
844 # Check to see if we can use ln -s, or we need hard links.
845 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
847 if ln -s X conftestdata
2>/dev
/null
; then
853 if test "$LN_S" = "ln -s"; then
860 # Make sure LD is an absolute path.
861 if test -z "$LD"; then
863 if test "$with_gcc" = yes; then
864 # Check if gcc -print-prog-name=ld gives a path.
865 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
866 echo "$progname:866: checking for ld used by GCC" >&5
867 ac_prog
=`($CC -print-prog-name=ld) 2>&5`
869 # Accept absolute paths.
871 re_direlt
='/[^/][^/]*/\.\./'
872 sub_uncdrive
='s%^\([A-Za-z]\):/%//\1/%'
873 # Canonicalize the path of ld
874 while echo $ac_prog | grep "$re_direlt" > /dev
/null
2>&1; do
875 ac_prog
=`echo $ac_prog| sed "s%$re_direlt%/%"`
879 # Convert to a UNC path for cygwin
880 test -z "$LD" && LD
=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
883 test -z "$LD" && LD
="$ac_prog"
888 ## FIXME: The code fails later on if we try to use an $LD with
889 ## '\\' path separators.
892 re_direlt
='\\[^\\][^\\]*\\\.\.\(\\\)'
893 sub_uncdrive
='s%^\([A-Za-z]\):\\%//\1/%'
894 sub_uncdir
='s%\\%/%g'
895 # Canonicalize the path of ld
896 while echo $ac_prog | grep "$re_direlt" > /dev
/null
2>&1; do
897 ac_prog
=`echo $ac_prog| sed "s%$re_direlt%\1%"`
901 # Convert to a UNC path for cygwin
902 test -z "$LD" && LD
=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
905 test -z "$LD" && LD
="$ac_prog"
910 # If it fails, then pretend we are not using GCC.
914 # If it is relative, then search for the first ld in PATH.
918 elif test "$with_gnu_ld" = yes; then
919 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
920 echo "$progname:920: checking for GNU ld" >&5
922 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
923 echo "$progname:923: checking for non-GNU ld" >&5
926 if test -z "$LD"; then
927 IFS
="${IFS= }"; ac_save_ifs
="$IFS"; IFS
="${IFS}:"
928 for ac_dir
in $PATH; do
929 test -z "$ac_dir" && ac_dir
=.
930 if test -f "$ac_dir/$ac_prog"; then
931 LD
="$ac_dir/$ac_prog"
932 # Check to see if the program is GNU ld. I'd rather use --version,
933 # but apparently some GNU ld's only accept -v.
934 # Break only if it was the GNU/non-GNU ld that we prefer.
935 if "$LD" -v 2>&1 < /dev
/null
| egrep '(GNU|with BFD)' > /dev
/null
; then
936 test "$with_gnu_ld" != no
&& break
938 test "$with_gnu_ld" != yes && break
945 if test -n "$LD"; then
951 if test -z "$LD"; then
952 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
957 # Check to see if it really is or is not GNU ld.
958 echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
959 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
960 if $LD -v 2>&1 </dev
/null
| egrep '(GNU|with BFD)' 1>&5; then
965 echo "$ac_t$with_gnu_ld" 1>&6
967 # See if the linker supports building shared libraries.
968 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
970 allow_undefined_flag
=
974 old_archive_from_new_cmds
=
975 export_dynamic_flag_spec
=
976 whole_archive_flag_spec
=
977 hardcode_libdir_flag_spec
=
978 hardcode_libdir_separator
=
981 hardcode_shlibpath_var
=unsupported
986 # On AIX, the GNU linker works like the native linker.
992 if test "$with_gnu_ld" = yes; then
994 # See if GNU ld supports shared libraries.
997 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)'
998 hardcode_libdir_flag_spec
='-L$libdir'
1003 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
1005 hardcode_minus_L
=yes
1006 hardcode_shlibpath_var
=no
1009 cygwin32
* | mingw32
*)
1010 if test "$with_gcc" = yes; then
1011 # hardcode_libdir_flag_spec is actually meaningless, as there is
1012 # no search path for DLLs.
1013 hardcode_libdir_flag_spec
='-L$libdir'
1014 allow_undefined_flag
=unsupported
1017 #define WIN32_LEAN_AND_MEAN
1018 #include <windows.h>
1019 #undef WIN32_LEAN_AND_MEAN
1022 BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
1024 #include <cygwin/cygwin_dll.h>
1025 DECLARE_CYGWIN_DLL( DllMain );
1026 HINSTANCE __hDllInstance_base;
1029 DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
1031 __hDllInstance_base = hInst;
1035 archive_cmds
='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
1036 $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
1037 $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
1038 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1039 $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1040 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1041 $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1042 $rm ltdll.$objext $soname-base $soname-exp'
1043 archive_sym_cmds
='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
1044 cat "$export_symbols" >> $lib-def~
1045 $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
1046 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1047 $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1048 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1049 $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1050 $rm ltdll.$objext $soname-base $soname-exp'
1051 old_archive_from_new_cmds
='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
1053 # When not using gcc, we currently assume that we are using
1054 # Microsoft Visual C++.
1056 # hardcode_libdir_flag_spec is actually meaningless, as there is
1057 # no search path for DLLs.
1058 hardcode_libdir_flag_spec
=' '
1059 allow_undefined_flag
=unsupported
1060 # Tell ltmain to make .lib files, not .a files.
1062 # FIXME: Setting linknames here is a bad hack.
1063 archive_cmds
='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1064 # The linker will automatically build a .lib file if we build a DLL.
1065 old_archive_from_new_cmds
='true'
1066 # FIXME: Should let the user specify the lib program.
1067 old_archive_cmds
='lib /OUT:$oldlib$oldobjs'
1068 fix_srcfile_path
='`cygpath -w $srcfile`'
1073 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev
/null
; then
1074 archive_cmds
='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
1075 archive_sym_cmds
='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs'
1082 if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then
1083 runpath_var
=LD_RUN_PATH
1084 hardcode_libdir_flag_spec
='${wl}--rpath ${wl}$libdir'
1085 export_dynamic_flag_spec
='${wl}--export-dynamic'
1086 whole_archive_flag_spec
='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
1089 # PORTME fill in a description of your system's linker (not GNU ld)
1092 allow_undefined_flag
=unsupported
1093 archive_cmds
='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
1094 $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1095 archive_sym_cmds
='$LD -o $objdir/$soname$libobjs$deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1096 # Note: this linker hardcodes the directories in LIBPATH if there
1097 # are no directories specified by -L.
1098 hardcode_minus_L
=yes
1099 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1100 # Neither direct hardcoding nor static linking is supported with a
1102 hardcode_direct
=unsupported
1107 allow_undefined_flag
=unsupported
1108 archive_cmds
='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp else cat $export_symbols > $lib.exp~
1109 $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
1110 archive_sym_cmds
='$CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
1112 hardcode_minus_L
=yes
1116 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)'
1117 hardcode_libdir_flag_spec
='-L$libdir'
1118 hardcode_minus_L
=yes
1121 cygwin32
* | mingw32
*)
1122 if test "$with_gcc" = yes; then
1123 # hardcode_libdir_flag_spec is actually meaningless, as there is
1124 # no search path for DLLs.
1125 hardcode_libdir_flag_spec
='-L$libdir'
1126 allow_undefined_flag
=unsupported
1129 #define WIN32_LEAN_AND_MEAN
1130 #include <windows.h>
1131 #undef WIN32_LEAN_AND_MEAN
1134 BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
1136 #include <cygwin/cygwin_dll.h>
1137 DECLARE_CYGWIN_DLL( DllMain );
1138 HINSTANCE __hDllInstance_base;
1141 DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
1143 __hDllInstance_base = hInst;
1147 archive_cmds
='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
1148 $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
1149 $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
1150 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1151 $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1152 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1153 $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1154 $rm ltdll.$objext $soname-base $soname-exp'
1155 archive_sym_cmds
='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
1156 cat "$export_symbols" >> $lib-def~
1157 $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
1158 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1159 $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1160 $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
1161 $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
1162 $rm ltdll.$objext $soname-base $soname-exp'
1163 old_archive_from_new_cmds
='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
1165 # When not using gcc, we currently assume that we are using
1166 # Microsoft Visual C++.
1167 # hardcode_libdir_flag_spec is actually meaningless, as there is
1168 # no search path for DLLs.
1169 hardcode_libdir_flag_spec
=' '
1170 allow_undefined_flag
=unsupported
1171 # Tell ltmain to make .lib files, not .a files.
1173 # FIXME: Setting linknames here is a bad hack.
1174 archive_cmds
='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1175 # The linker will automatically build a .lib file if we build a DLL.
1176 old_archive_from_new_cmds
='true'
1177 # FIXME: Should let the user specify the lib program.
1178 old_archive_cmds
='lib /OUT:$oldlib$oldobjs'
1179 fix_srcfile_path
='`cygpath -w $srcfile`'
1183 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1184 # support. Future versions do this automatically, but an explicit c++rt0.o
1185 # does not break anything, and helps significantly (at the cost of a little
1188 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
1189 hardcode_libdir_flag_spec
='-R$libdir'
1191 hardcode_minus_L
=yes
1192 hardcode_shlibpath_var
=no
1195 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1197 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
1199 hardcode_minus_L
=yes
1200 hardcode_shlibpath_var
=no
1203 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
1205 archive_cmds
='$CC -shared -o $lib$libobjs$deplibs'
1206 hardcode_libdir_flag_spec
='-R$libdir'
1209 hardcode_shlibpath_var
=no
1213 archive_cmds
='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
1214 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
1216 hardcode_minus_L
=yes
1217 export_dynamic_flag_spec
='${wl}-E'
1221 archive_cmds
='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
1222 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
1224 hardcode_minus_L
=yes
1225 export_dynamic_flag_spec
='${wl}-E'
1229 if test "$with_gcc" = yes; then
1230 archive_cmds
='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
1232 archive_cmds
='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
1234 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
1238 # Tested with NetBSD 1.2 ld
1239 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
1240 hardcode_libdir_flag_spec
='-R$libdir'
1242 hardcode_shlibpath_var
=no
1246 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
1247 hardcode_libdir_flag_spec
='-R$libdir'
1249 hardcode_shlibpath_var
=no
1253 hardcode_libdir_flag_spec
='-L$libdir'
1254 hardcode_minus_L
=yes
1255 allow_undefined_flag
=unsupported
1256 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 $objdir/$libname.def'
1257 old_archive_from_new_cmds
='emximp -o $objdir/$libname.a $objdir/$libname.def'
1261 if test "$with_gcc" = yes; then
1262 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
1263 archive_cmds
='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
1265 allow_undefined_flag
=' -expect_unresolved \*'
1266 archive_cmds
='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
1268 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
1269 hardcode_libdir_separator
=:
1273 archive_cmds
='$LD -G -o $lib$libobjs$deplibs'
1278 no_undefined_flag
=' -z text'
1279 # $CC -shared without GNU ld will not create a library from C++
1280 # object files and a static libstdc++, better avoid it by now
1281 archive_cmds
='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs'
1282 archive_sym_cmds
='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
1283 $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp'
1284 hardcode_libdir_flag_spec
='-R$libdir'
1285 hardcode_shlibpath_var
=no
1287 # Solaris 2 before 2.5 hardcodes -L paths.
1290 hardcode_minus_L
=yes
1296 # Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
1297 if test "$with_gcc" = yes; then
1298 archive_cmds
='$CC -shared ${wl}-Bstatic -o $lib$libobjs$deplibs'
1300 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
1302 hardcode_libdir_flag_spec
='-L$libdir'
1304 hardcode_minus_L
=yes
1305 hardcode_shlibpath_var
=no
1309 archive_cmds
='$LD -G -h $soname -o $lib$libobjs$deplibs'
1310 hardcode_libdir_flag_spec
='-L$libdir'
1313 hardcode_shlibpath_var
=no
1317 archive_cmds
='$LD -G -h $soname -o $lib$libobjs$deplibs'
1318 hardcode_libdir_flag_spec
='-L$libdir'
1321 hardcode_shlibpath_var
=no
1330 echo "$ac_t$ld_shlibs" 1>&6
1332 if test -z "$NM"; then
1333 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1335 /* | [A
-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
1337 IFS
="${IFS= }"; ac_save_ifs
="$IFS"; IFS
="${IFS}:"
1338 for ac_dir
in /usr
/ucb
/usr
/ccs
/bin
$PATH /bin
; do
1339 test -z "$ac_dir" && ac_dir
=.
1340 if test -f $ac_dir/nm
; then
1341 # Check to see if the nm accepts a BSD-compat flag.
1342 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1343 # nm: unknown option "B" ignored
1344 if ($ac_dir/nm
-B /dev
/null
2>&1 | sed '1q'; exit 0) | egrep /dev
/null
>/dev
/null
; then
1346 elif ($ac_dir/nm
-p /dev
/null
2>&1 | sed '1q'; exit 0) | egrep /dev
/null
>/dev
/null
; then
1355 test -z "$NM" && NM
=nm
1358 echo "$ac_t$NM" 1>&6
1361 # Check for command to grab the raw symbol name followed by C symbol from nm.
1362 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1364 # These are sane defaults that work on at least a few old systems.
1365 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1367 # Character class describing NM global symbol codes.
1368 symcode
='[BCDEGRSTU]'
1370 # Regexp to match symbols that can be accessed directly from C.
1371 sympat
='\([_A-Za-z][_A-Za-z0-9]*\)'
1373 # Transform the above into a raw symbol and a C symbol.
1376 # Define system-specific variables.
1381 sunos
* | cygwin32
* | mingw32
*)
1382 sympat
='_\([_A-Za-z][_A-Za-z0-9]*\)'
1386 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
1387 symcode
='[BCDEGRST]'
1394 # If we're using GNU nm, then use its standard symbol codes.
1395 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev
/null
; then
1396 symcode
='[ABCDGISTUW]'
1400 cygwin32
* | mingw32
*)
1401 # We do not want undefined symbols on cygwin32. The user must
1402 # arrange to define them via -l arguments.
1403 symcode
='[ABCDGISTW]'
1407 # Write the raw and C identifiers.
1408 global_symbol_pipe
="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
1410 # Check to see that the pipe works correctly.
1413 cat > conftest.c
<<EOF
1418 void nm_test_func(){}
1422 main(){nm_test_var='a';nm_test_func();return(0);}
1425 echo "$progname:1425: checking if global_symbol_pipe works" >&5
1426 if { (eval echo $progname:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.
$objext; then
1427 # Now try to grab the symbols.
1429 if { echo "$progname:1429: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1431 # Try sorting and uniquifying the output.
1432 if sort "$nlist" | uniq > "$nlist"T
; then
1433 mv -f "$nlist"T
"$nlist"
1434 wcout
=`wc "$nlist" 2>/dev/null`
1435 count
=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1436 (test "$count" -ge 0) 2>/dev
/null
|| count
=-1
1442 # Make sure that we snagged all the symbols we need.
1443 if egrep ' nm_test_var$' "$nlist" >/dev
/null
; then
1444 if egrep ' nm_test_func$' "$nlist" >/dev
/null
; then
1445 cat <<EOF > conftest.c
1451 # Now generate the symbol file.
1452 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1454 cat <<EOF >> conftest.c
1455 #if defined (__STDC__) && __STDC__
1456 # define __ptr_t void *
1458 # define __ptr_t char *
1461 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1462 int dld_preloaded_symbol_count = $count;
1464 /* The mapping between symbol names and symbols. */
1469 dld_preloaded_symbols[] =
1472 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
1473 cat <<\EOF
>> conftest.c
1481 # Now try linking the two files.
1482 mv conftest.
$objext conftestm.
$objext
1484 save_CFLAGS
="$CFLAGS"
1485 LIBS
="conftestm.$objext"
1486 CFLAGS
="$CFLAGS$no_builtin_flag"
1487 if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
1490 echo "$progname: failed program was:" >&5
1495 echo "cannot find nm_test_func in $nlist" >&5
1498 echo "cannot find nm_test_var in $nlist" >&5
1501 echo "cannot run $global_symbol_pipe" >&5
1504 echo "$progname: failed program was:" >&5
1509 # Do not use the global_symbol_pipe unless it works.
1510 echo "$ac_t$pipe_works" 1>&6
1511 test "$pipe_works" = yes || global_symbol_pipe
=
1513 # Check hardcoding attributes.
1514 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1516 if test -n "$hardcode_libdir_flag_spec" || \
1517 test -n "$runpath_var"; then
1519 # We can hardcode non-existant directories.
1520 if test "$hardcode_direct" != no
&& \
1521 test "$hardcode_minus_L" != no
&& \
1522 test "$hardcode_shlibpath_var" != no
; then
1524 # Linking always hardcodes the temporary library directory.
1525 hardcode_action
=relink
1527 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1528 hardcode_action
=immediate
1531 # We cannot hardcode anything, or else we can only hardcode existing
1533 hardcode_action
=unsupported
1535 echo "$ac_t$hardcode_action" 1>&6
1539 reload_cmds
='$LD$reload_flag -o $output$reload_objs'
1540 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1541 # PORTME Some linkers may need a different reload flag.
1543 echo "$ac_t$reload_flag" 1>&6
1544 test -n "$reload_flag" && reload_flag
=" $reload_flag"
1546 # PORTME Fill in your ld.so characteristics
1548 libname_spec
='lib$name'
1556 dynamic_linker
="$host_os ld.so"
1557 sys_lib_search_path
="/lib /usr/lib /usr/local/lib"
1558 check_shared_deplibs_method
='none'
1559 # Need to set the preceding variable on all platforms that support
1560 # interlibrary dependencies.
1561 # 'none' -- dependencies not supported.
1562 # 'pass_all' -- all dependencies passed with no checks.
1563 # 'test_compile' -- check by making test program.
1564 # 'file_regex' -- check by looking for filenames that look like the shared
1565 # library in the library path.
1566 # 'file_magic [regex]' -- check by looking for files in library path which
1567 # responds to the "file" command with a given regex. This is actually a
1568 # superset of the file_regex command. If you have file on your system, you'll
1569 # want to use this instead.
1570 # Notes: regexes are run through expr.
1572 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1576 library_names_spec
='${libname}${release}.so$versuffix $libname.a'
1577 shlibpath_var
=LIBPATH
1579 # AIX has no versioning support, so we append a major version to the name.
1580 soname_spec
='${libname}${release}.so$major'
1584 library_names_spec
='$libname.ixlibrary $libname.a'
1585 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1586 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'
1591 library_names_spec
='${libname}.so.$major ${libname}.so'
1592 soname_spec
='${libname}.so'
1593 finish_cmds
='PATH="$PATH:/sbin" ldconfig $libdir'
1594 shlibpath_var
=LD_LIBRARY_PATH
1597 cygwin32
* | mingw32
*)
1598 version_type
=windows
1599 if test "$with_gcc" = yes; then
1600 library_names_spec
='${libname}`echo ${release} | sed -e 's
/[.
]/-/g
'`${versuffix}.dll $libname.a'
1602 library_names_spec
='${libname}`echo ${release} | sed -e 's
/[.
]/-/g
'`${versuffix}.dll $libname.lib'
1604 dynamic_linker
='Win32 ld.exe'
1605 libname_spec
='$name'
1609 freebsd2
* | freebsd3
*)
1610 objformat
=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1611 version_type
=freebsd
-$objformat
1612 library_names_spec
='${libname}${release}.so$versuffix $libname.so'
1613 finish_cmds
='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
1614 shlibpath_var
=LD_LIBRARY_PATH
1619 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so'
1620 shlibpath_var
=LD_LIBRARY_PATH
1623 hpux9
* | hpux10
* | hpux11
*)
1624 # Give a soname corresponding to the major version so that dld.sl refuses to
1625 # link against other versions.
1626 dynamic_linker
="$host_os dld.sl"
1628 shlibpath_var
=SHLIB_PATH
1629 library_names_spec
='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1630 soname_spec
='${libname}${release}.sl$major'
1631 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1632 postinstall_cmds
='chmod 555 $lib'
1637 soname_spec
='${libname}${release}.so'
1638 library_names_spec
='${libname}${release}.so$versuffix $libname.so'
1639 shlibpath_var
=LD_LIBRARY_PATH
1644 soname_spec
='${libname}${release}.so'
1645 library_names_spec
='${libname}${release}.so$versuffix $libname.so'
1646 shlibpath_var
=LD_LIBRARYN32_PATH
1649 # No shared lib support for Linux oldld, aout, or coff.
1650 linux
-gnuoldld* | linux
-gnuaout* | linux
-gnucoff*)
1654 # This must be Linux ELF.
1657 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1658 soname_spec
='${libname}${release}.so$major'
1659 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1660 shlibpath_var
=LD_LIBRARY_PATH
1661 check_shared_deplibs_method
='file_magic ELF 32-bit LSB shared object'
1662 sys_lib_search_path
="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`"
1664 if test -f /lib
/ld.so
.1; then
1665 dynamic_linker
='GNU ld.so'
1667 # Only the GNU ld.so supports shared libraries on MkLinux.
1669 powerpc
*) dynamic_linker
=no
;;
1670 *) dynamic_linker
='Linux ld.so' ;;
1677 library_names_spec
='${libname}${release}.so$versuffix'
1678 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1679 shlibpath_var
=LD_LIBRARY_PATH
1683 libname_spec
='$name'
1684 library_names_spec
='$libname.dll $libname.a'
1685 dynamic_linker
='OS/2 ld.exe'
1686 shlibpath_var
=LIBPATH
1691 soname_spec
='${libname}${release}.so'
1692 library_names_spec
='${libname}${release}.so$versuffix $libname.so'
1693 shlibpath_var
=LD_LIBRARY_PATH
1694 check_shared_deplibs_method
='pass_all'
1699 soname_spec
='${libname}${release}.so$major'
1700 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1701 shlibpath_var
=LD_LIBRARY_PATH
1706 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1707 soname_spec
='${libname}${release}.so$major'
1708 shlibpath_var
=LD_LIBRARY_PATH
1709 # ldd complains unless libraries are executable
1710 postinstall_cmds
='chmod +x $lib'
1715 library_names_spec
='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1716 finish_cmds
='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1717 shlibpath_var
=LD_LIBRARY_PATH
1722 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1723 soname_spec
='${libname}${release}.so$major'
1724 shlibpath_var
=LD_LIBRARY_PATH
1729 library_names_spec
='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
1730 soname_spec
='${libname}${release}.so.$major'
1731 shlibpath_var
=LD_LIBRARY_PATH
1736 library_names_spec
='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1737 soname_spec
='${libname}${release}.so$major'
1738 shlibpath_var
=LD_LIBRARY_PATH
1745 echo "$ac_t$dynamic_linker" 1>&6
1746 test "$dynamic_linker" = no
&& can_build_shared
=no
1748 # Report the final consequences.
1749 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1751 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1752 test "$can_build_shared" = "no" && enable_shared
=no
1754 # On AIX, shared libraries and static libraries use the same namespace, and
1755 # are all built from PIC.
1758 test "$enable_shared" = yes && enable_static
=no
1759 if test -n "$RANLIB"; then
1760 archive_cmds
="$archive_cmds~\$RANLIB \$lib"
1761 postinstall_cmds
='$RANLIB $lib'
1766 echo "$ac_t$enable_shared" 1>&6
1768 # Make sure either enable_shared or enable_static is yes.
1769 test "$enable_shared" = yes || enable_static
=yes
1771 echo "checking whether to build static libraries... $enable_static" 1>&6
1773 echo $ac_n "checking for objdir... $ac_c" 1>&6
1774 rm -f .libs
2>/dev
/null
1775 mkdir .libs
2>/dev
/null
1776 if test -d .libs
; then
1779 # MS-DOS does not allow filenames that begin with a dot.
1782 rmdir .libs
2>/dev
/null
1783 echo "$ac_t$objdir" 1>&6
1785 # Copy echo and quote the copy, instead of the original, because it is
1788 if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
1789 ltecho
="$CONFIG_SHELL \$0 --fallback-echo"
1793 # Only quote variables if we're using ltmain.sh.
1796 # Now quote all the things that may contain metacharacters.
1797 for var
in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1798 old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \
1799 reload_flag reload_cmds wl \
1800 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
1801 whole_archive_flag_spec libname_spec library_names_spec soname_spec \
1802 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
1803 old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
1804 check_shared_deplibs_method allow_undefined_flag no_undefined_flag \
1805 finish_cmds finish_eval global_symbol_pipe \
1806 hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path \
1807 compiler_c_o compiler_o_lo need_locks
; do
1810 reload_cmds
| old_archive_cmds
| old_archive_from_new_cmds
| \
1811 old_postinstall_cmds
| old_postuninstall_cmds
| \
1812 archive_cmds
| archive_sym_cmds
| \
1813 postinstall_cmds
| postuninstall_cmds
| \
1814 finish_cmds
| sys_lib_search_path
)
1815 # Double-quote double-evaled strings.
1816 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
1819 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
1825 *'\$0 --fallback-echo"')
1826 ltecho
=`$echo "X$ltecho" |
1827 $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
1831 trap "$rm \"$ofile\"; exit 1" 1 2 15
1832 echo "creating $ofile"
1834 cat <<EOF > "$ofile"
1837 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1838 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
1839 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1841 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
1842 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1844 # This program is free software; you can redistribute it and/or modify
1845 # it under the terms of the GNU General Public License as published by
1846 # the Free Software Foundation; either version 2 of the License, or
1847 # (at your option) any later version.
1849 # This program is distributed in the hope that it will be useful, but
1850 # WITHOUT ANY WARRANTY; without even the implied warranty of
1851 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1852 # General Public License for more details.
1854 # You should have received a copy of the GNU General Public License
1855 # along with this program; if not, write to the Free Software
1856 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1858 # As a special exception to the GNU General Public License, if you
1859 # distribute this file as part of a program that contains a
1860 # configuration script generated by Autoconf, you may include it under
1861 # the same distribution terms that you use for the rest of that program.
1863 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
1864 Xsed="sed -e s/^X//"
1866 # The HP-UX ksh and POSIX shell print the target directory to stdout
1868 if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1870 ### BEGIN LIBTOOL CONFIG
1876 # Double-quote the variables that need it (for aesthetics).
1877 for var
in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1878 old_LN_S old_DLLTOOL old_AS
; do
1879 eval "$var=\\\"\$var\\\""
1882 # Just create a config file.
1883 cfgfile
="$ofile.cfg"
1884 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
1885 echo "creating $cfgfile"
1887 cat <<EOF > "$cfgfile"
1888 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
1889 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
1894 cat <<EOF >> "$cfgfile"
1895 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1897 # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
1898 # LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
1899 # DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
1902 # Compiler and other test output produced by $progname, useful for
1903 # debugging $progname, is in ./config.log if it exists.
1905 # The version of $progname that generated this script.
1906 LTCONFIG_VERSION=$VERSION
1908 # Shell to use when invoking shell scripts.
1911 # Whether or not to build shared libraries.
1912 build_libtool_libs=$enable_shared
1914 # Whether or not to build static libraries.
1915 build_old_libs=$enable_static
1918 host_alias=$host_alias
1921 # An echo program that does not interpret backslashes.
1927 # The default C compiler.
1930 # The linker used to build libraries.
1933 # Whether we need hard or soft links.
1936 # A BSD-compatible nm program.
1939 # Used on cygwin32: DLL creation program.
1942 # Used on cygwin32: assembler.
1945 # The name of the directory that contains temporary libtool files.
1948 # How to create reloadable object files.
1949 reload_flag=$reload_flag
1950 reload_cmds=$reload_cmds
1952 # How to pass a linker flag through the compiler.
1955 # Object file suffix (normally "o").
1958 # Old archive suffix (normally "a").
1961 # Additional compiler flags for building library objects.
1964 # Does compiler simultaneously support -c and -o options
1965 compiler_c_o=$compiler_c_o
1967 # Can we write directly to a .lo ?
1968 compiler_o_lo=$compiler_o_lo
1970 # Must we lock files when doing compilation ?
1971 need_locks=$need_locks
1973 # Compiler flag to prevent dynamic linking.
1974 link_static_flag=$link_static_flag
1976 # Compiler flag to turn off builtin functions.
1977 no_builtin_flag=$no_builtin_flag
1979 # Compiler flag to allow reflexive dlopens.
1980 export_dynamic_flag_spec=$export_dynamic_flag_spec
1982 # Compiler flag to generate shared objects directly from archives.
1983 whole_archive_flag_spec=$whole_archive_flag_spec
1985 # Library versioning type.
1986 version_type=$version_type
1988 # Format of library name prefix.
1989 libname_spec=$libname_spec
1991 # List of archive names. First name is the real one, the rest are links.
1992 # The last name is the one that the linker finds with -lNAME.
1993 library_names_spec=$library_names_spec
1995 # The coded name of the library, if different from the real name.
1996 soname_spec=$soname_spec
1998 # Commands used to build and install an old-style archive.
2000 old_archive_cmds=$old_archive_cmds
2001 old_postinstall_cmds=$old_postinstall_cmds
2002 old_postuninstall_cmds=$old_postuninstall_cmds
2004 # Create an old-style archive from a shared archive.
2005 old_archive_from_new_cmds=$old_archive_from_new_cmds
2007 # Commands used to build and install a shared archive.
2008 archive_cmds=$archive_cmds
2009 archive_sym_cmds=$archive_sym_cmds
2010 postinstall_cmds=$postinstall_cmds
2011 postuninstall_cmds=$postuninstall_cmds
2013 # Method to check whether dependent libraries are shared objects.
2014 check_shared_deplibs_method=$check_shared_deplibs_method
2016 # Flag that allows shared libraries with undefined symbols to be built.
2017 allow_undefined_flag=$allow_undefined_flag
2019 # Flag that forces no undefined symbols.
2020 no_undefined_flag=$no_undefined_flag
2022 # Commands used to finish a libtool library installation in a directory.
2023 finish_cmds=$finish_cmds
2025 # Same as above, but a single script fragment to be evaled but not shown.
2026 finish_eval=$finish_eval
2028 # Take the output of nm and produce a listing of raw symbols and C names.
2029 global_symbol_pipe=$global_symbol_pipe
2031 # This is the shared library runtime path variable.
2032 runpath_var=$runpath_var
2034 # This is the shared library path variable.
2035 shlibpath_var=$shlibpath_var
2037 # How to hardcode a shared library path into an executable.
2038 hardcode_action=$hardcode_action
2040 # Flag to hardcode \$libdir into a binary during linking.
2041 # This must work even if \$libdir does not exist.
2042 hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2044 # Whether we need a single -rpath flag with a separated argument.
2045 hardcode_libdir_separator=$hardcode_libdir_separator
2047 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2049 hardcode_direct=$hardcode_direct
2051 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2053 hardcode_minus_L=$hardcode_minus_L
2055 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2056 # the resulting binary.
2057 hardcode_shlibpath_var=$hardcode_shlibpath_var
2059 # System search path for libraries
2060 sys_lib_search_path=$sys_lib_search_path
2062 # Fix the shell variable \$srcfile for the compiler.
2063 fix_srcfile_path="$fix_srcfile_path"
2068 echo '### END LIBTOOL CONFIG' >> "$ofile"
2072 cat <<\EOF
>> "$ofile"
2074 # AIX sometimes has problems with the GCC collect2 program. For some
2075 # reason, if we set the COLLECT_NAMES environment variable, the problems
2076 # vanish in a puff of smoke.
2077 if test "${COLLECT_NAMES+set}" != set; then
2079 export COLLECT_NAMES
2085 # Append the ltmain.sh script.
2086 cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
2092 # Compile the libtool program.
2093 echo "FIXME: would compile $ltmain"