3 # ltconfig - Create a system-specific libtool.
4 # Generated automatically from ltconfig.in by configure.
5 # Copyright (C) 1996, 1997, Free Software Foundation, Inc.
6 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # A lot of this script is taken from autoconf-2.10.
29 # The name of this program.
30 progname
=`echo "$0" | sed 's%^.*/%%'`
36 ac_compile
='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
37 ac_link
='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
40 help="Try \`$progname --help' for more information."
42 # Sed substitution that helps us do robust quoting. It backslashifies
43 # metacharacters that are still active within double-quoted strings.
44 sed_quote_subst
='s/\([\\"$\\\\]\)/\\\1/g'
46 # Same as above, but don't quote variable references.
47 double_quote_subst
='s/\([\\"\\\\]\)/\\\1/g'
49 # AIX sometimes has problems with the GCC collect2 program. For some
50 # reason, if we set the COLLECT_NAMES environment variable, the problems
51 # vanish in a puff of smoke.
52 if test "${COLLECT_NAMES+set}" != set; then
60 # All known linkers require a `.a' archive for static linking.
76 old_CPPFLAGS
="$CPPFLAGS"
82 # Parse the command line options.
88 -*=*) optarg
=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
92 # If the previous option needs an argument, assign it.
93 if test -n "$prev"; then
101 Usage: $progname [OPTION]... LTMAIN [HOST]
103 Generate a system-specific libtool script.
105 --disable-shared do not build shared libraries
106 --disable-static do not build static libraries
107 --help display this help and exit
108 --no-verify do not verify that HOST is a valid host type
109 --quiet same as \`--silent'
110 --silent don't print informational messages
111 --srcdir=DIR find \`config.guess' in DIR
112 --version output version information and exit
113 --with-gcc assume that the GNU C compiler will be used
114 --with-gnu-ld assume that the C compiler uses the GNU linker
116 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
119 HOST is the canonical host system name [default=guessed].
124 --disable-shared) enable_shared
=no
;;
126 --disable-static) enable_static
=no
;;
128 --quiet |
--silent) silent
=yes ;;
130 --srcdir) prev
=srcdir
;;
131 --srcdir=*) srcdir
="$optarg" ;;
133 --no-verify) verify_host
=no
;;
135 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
137 --with-gcc) with_gcc
=yes ;;
138 --with-gnu-ld) with_gnu_ld
=yes ;;
141 echo "$progname: unrecognized option \`$option'" 1>&2
147 if test -z "$ltmain"; then
149 elif test -z "$host"; then
150 # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
151 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
152 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
156 echo "$progname: too many arguments" 1>&2
163 if test -z "$ltmain"; then
164 echo "$progname: you must specify a LTMAIN file" 1>&2
169 if test -f "$ltmain"; then :
171 echo "$progname: warning: \`$ltmain' does not exist" 1>&2
174 # Quote any args containing shell metacharacters.
179 *" "*|
*" "*|
*[\
[\
]\~\
#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
180 ltconfig_args
="$ltconfig_args '$arg'" ;;
181 *) ltconfig_args
="$ltconfig_args $arg" ;;
185 # A relevant subset of AC_INIT.
187 # File descriptor usage:
190 # 2 errors and warnings
191 # 3 some systems may open it to /dev/tty
192 # 4 used on the Kubota Titan
193 # 5 compiler messages saved in config.log
194 # 6 checking for... messages and results
195 if test "$silent" = yes; then
203 # Only set LANG and LC_ALL to C if already set.
204 # These must not be set unconditionally because not all systems understand
205 # e.g. LANG=C (notably SCO).
206 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
207 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
209 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
210 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
211 if (echo -n testing
; echo 1,2,3) |
sed s
/-n/xn
/ |
grep xn
>/dev
/null
; then
218 ac_n
= ac_c
='\c' ac_t
=
221 if test -z "$srcdir"; then
222 # Assume the source directory is the same one as the path to ltmain.sh.
223 srcdir
=`echo "$ltmain" | sed 's%/[^/]*$%%'`
224 test "$srcdir" = "$ltmain" && srcdir
=.
227 trap "$rm conftest*; exit 1" 1 2 15
228 if test "$verify_host" = yes; then
229 # Check for config.guess and config.sub.
231 for ac_dir
in $srcdir $srcdir/..
$srcdir/..
/..
; do
232 if test -f $ac_dir/config.guess
; then
237 if test -z "$ac_aux_dir"; then
238 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
242 ac_config_guess
=$ac_aux_dir/config.guess
243 ac_config_sub
=$ac_aux_dir/config.sub
245 # Make sure we can run config.sub.
246 if $ac_config_sub sun4
>/dev
/null
2>&1; then :
248 echo "$progname: cannot run $ac_config_sub" 1>&2
253 echo $ac_n "checking host system type""... $ac_c" 1>&6
256 case "$host_alias" in
258 if host_alias
=`$ac_config_guess`; then :
260 echo "$progname: cannot guess host type; you must specify one" 1>&2
265 host=`$ac_config_sub $host_alias`
266 echo "$ac_t$host" 1>&6
268 # Make sure the host verified.
269 test -z "$host" && exit 1
271 elif test -z "$host"; then
272 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
279 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
282 *-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
285 host_cpu
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
286 host_vendor
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
287 host_os
=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
289 # Determine commands to create old-style static archives.
290 old_archive_cmds
='$AR cru $oldlib$oldobjs'
291 old_postinstall_cmds
='chmod 644 $oldlib'
293 # Set a sane default for `AR'.
294 test -z "$AR" && AR
=ar
296 # If RANLIB is not set, then run the test.
297 if test "${RANLIB+set}" != "set"; then
300 echo $ac_n "checking for ranlib... $ac_c" 1>&6
301 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
303 test -z "$dir" && dir
=.
304 if test -f $dir/ranlib
; then
312 echo "$ac_t$result" 1>&6
315 if test -n "$RANLIB"; then
316 old_archive_cmds
="$old_archive_cmds;\$RANLIB \$oldlib"
317 old_postinstall_cmds
="$old_postinstall_cmds;\$RANLIB \$oldlib"
320 # Check to see if we are using GCC.
321 if test "$with_gcc" != yes ||
test -z "$CC"; then
322 # If CC is not set, then try to find GCC or a usable CC.
323 if test -z "$CC"; then
324 echo $ac_n "checking for gcc... $ac_c" 1>&6
325 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
328 test -z "$dir" && dir
=.
329 if test -f $dir/gcc
; then
336 if test -n "$CC"; then
343 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
344 if test -z "$CC"; then
345 echo $ac_n "checking for cc... $ac_c" 1>&6
346 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
349 test -z "$dir" && dir
=.
350 if test -f $dir/cc
; then
351 if test "$dir/cc" = "/usr/ucb/cc"; then
360 if test $cc_rejected = yes; then
361 # We found a bogon in the path, so make sure we never use it.
364 if test $# -gt 0; then
365 # We chose a different compiler from the bogus one.
366 # However, it has the same name, so the bogon will be chosen
367 # first if we set CC to just the name; use the full file name.
369 set dummy
"$dir/cc" "$@"
375 if test -n "$CC"; then
381 if test -z "$CC"; then
382 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
387 # Now see if the compiler is really GCC.
389 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
390 echo "$progname:390: checking whether we are using GNU C" >&5
393 cat > conftest.c
<<EOF
398 if { ac_try
='${CC-cc} -E conftest.c'; { (eval echo $progname:398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } |
egrep yes >/dev
/null
2>&1; then
402 echo "$ac_t$with_gcc" 1>&6
405 # Allow CC to be a program name with arguments.
409 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
411 profile_flag_pattern
=
412 special_shlib_compile_flags
=
417 if test "$with_gcc" = yes; then
418 profile_flag_pattern
='-pg?'
420 link_static_flag
='-static'
421 no_builtin_flag
=' -fno-builtin'
424 aix3
* | aix4
* | irix5
* | irix6
* | osf3
* | osf4
*)
425 # PIC is the default for these OSes.
433 # PORTME Check for PIC flags for the system compiler.
436 # All AIX code is PIC.
437 link_static_flag
='-bnso -bI:/lib/syscalls.exp'
441 # FIXME is there a better link_static_flag that works with the bundled CC?
443 link_static_flag
='${wl}-a ${wl}archive'
448 link_static_flag
='-non_shared'
449 # PIC (with -KPIC) is the default.
454 # We can build DLLs from non-PIC.
458 # All OSF/1 code is PIC.
460 link_static_flag
='-non_shared'
465 link_static_flag
='-dn'
466 special_shlib_compile_flags
='-belf'
471 link_static_flag
='-Bstatic'
477 link_static_flag
='-Bstatic'
483 link_static_flag
='-Bstatic'
492 if test -n "$pic_flag"; then
493 echo "$ac_t$pic_flag" 1>&6
495 # Check to make sure the pic_flag actually works.
496 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
499 save_CFLAGS
="$CFLAGS"
500 CFLAGS
="$CFLAGS $pic_flag -DPIC"
501 echo "$progname:501: checking if $compiler PIC flag $pic_flag works" >&5
502 if { (eval echo $progname:502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err
; } && test -s conftest.o
; then
503 # Append any errors to the config.log.
504 cat conftest.err
1>&5
506 # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
507 # reports no error. So, we need to grep stderr for (Bundled).
508 if grep '(Bundled)' conftest.err
>/dev
/null
; then
514 pic_flag
=" $pic_flag"
517 # Append any errors to the config.log.
518 cat conftest.err
1>&5
523 CFLAGS
="$save_CFLAGS"
526 echo "$ac_t"none
1>&6
529 # Check for any special shared library compilation flags.
530 if test -n "$special_shlib_compile_flags"; then
531 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
532 if echo "$old_CC $old_CFLAGS " |
egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev
/null
; then :
534 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
539 echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
541 echo 'main(){return(0);}' > conftest.c
542 save_LDFLAGS
="$LDFLAGS"
543 LDFLAGS
="$LDFLAGS $link_static_flag"
544 echo "$progname:544: checking if $compiler static flag $link_static_flag works" >&5
545 if { (eval echo $progname:545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
546 echo "$ac_t$link_static_flag" 1>&6
548 echo "$ac_t"none
1>&6
551 LDFLAGS
="$save_LDFLAGS"
554 if test -z "$LN_S"; then
555 # Check to see if we can use ln -s, or we need hard links.
556 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
558 if ln -s X conftestdata
2>/dev
/null
; then
564 if test "$LN_S" = "ln -s"; then
571 # Make sure LD is an absolute path.
572 if test -z "$LD"; then
574 if test "$with_gcc" = yes; then
575 # Check if gcc -print-prog-name=ld gives a path.
576 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
577 echo "$progname:577: checking for ld used by GCC" >&5
578 ac_prog
=`($CC -print-prog-name=ld) 2>&5`
580 # Accept absolute paths.
582 test -z "$LD" && LD
="$ac_prog"
585 # If it fails, then pretend we aren't using GCC.
589 # If it is relative, then search for the first ld in PATH.
593 elif test "$with_gnu_ld" = yes; then
594 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
595 echo "$progname:595: checking for GNU ld" >&5
597 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
598 echo "$progname:598: checking for non-GNU ld" >&5
601 if test -z "$LD"; then
602 IFS
="${IFS= }"; ac_save_ifs
="$IFS"; IFS
="${IFS}:"
603 for ac_dir
in $PATH; do
604 test -z "$ac_dir" && ac_dir
=.
605 if test -f "$ac_dir/$ac_prog"; then
606 LD
="$ac_dir/$ac_prog"
607 # Check to see if the program is GNU ld. I'd rather use --version,
608 # but apparently some GNU ld's only accept -v.
609 # Break only if it was the GNU/non-GNU ld that we prefer.
610 if "$LD" -v 2>&1 < /dev
/null |
egrep '(GNU|with BFD)' > /dev
/null
; then
611 test "$with_gnu_ld" != no
&& break
613 test "$with_gnu_ld" != yes && break
620 if test -n "$LD"; then
626 if test -z "$LD"; then
627 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
632 # Check to see if it really is or isn't GNU ld.
633 echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
634 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
635 if $LD -v 2>&1 </dev
/null |
egrep '(GNU|with BFD)' 1>&5; then
640 echo "$ac_t$with_gnu_ld" 1>&6
642 # See if the linker supports building shared libraries.
643 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
645 allow_undefined_flag
=
647 old_archive_from_new_cmds
=
648 export_dynamic_flag_spec
=
649 hardcode_libdir_flag_spec
=
650 hardcode_libdir_separator
=
653 hardcode_runpath_var
=no
654 hardcode_shlibpath_var
=unsupported
658 if test "$with_gnu_ld" = yes; then
659 # See if GNU ld supports shared libraries.
665 hardcode_shlibpath_var
=no
669 if $LD --help 2>&1 |
egrep ': supported targets:.* elf' > /dev
/null
; then
670 runpath_var
=LD_RUN_PATH
671 hardcode_runpath_var
=yes
679 if test "$ld_shlibs" = yes; then
680 archive_cmds
='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
681 hardcode_libdir_flag_spec
='${wl}-rpath $wl$libdir'
682 export_dynamic_flag_spec
='${wl}-export-dynamic'
685 # PORTME fill in a description of your system's linker (not GNU ld)
688 allow_undefined_flag
=unsupported
689 archive_cmds
='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE$deplibs;$AR cru $lib $objdir/$soname'
690 # Note: this linker hardcodes the directories in LIBPATH if there
691 # are no directories specified by -L.
693 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
694 # Neither direct hardcoding nor static linking is supported with a
696 hardcode_direct
=unsupported
701 allow_undefined_flag
=unsupported
702 archive_cmds
='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname'
707 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
708 # support. Future versions do this automatically, but an explicit c++rt0.o
709 # doesn't break anything, and helps significantly (at the cost of a little
712 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
715 hardcode_shlibpath_var
=no
718 # Unfortunately, older versions of FreeBSD 2 don't have this feature.
720 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
723 hardcode_shlibpath_var
=no
726 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
728 archive_cmds
='$CC -shared -o $lib$libobjs$deplibs'
729 hardcode_libdir_flag_spec
='-R$libdir'
732 hardcode_shlibpath_var
=no
736 archive_cmds
='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib'
737 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
743 archive_cmds
='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
744 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
750 archive_cmds
='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
751 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
755 # Tested with NetBSD 1.2 ld
756 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
757 hardcode_libdir_flag_spec
='-R$libdir'
759 hardcode_shlibpath_var
=no
763 # FIXME: unsure of OS/2 hardcoding properties
765 allow_undefined_flag
=unsupported
766 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 $objdir/$libname.def$deplibs'
767 old_archive_from_new_cmds
='emximp -o $libname.a $objdir/$libname.def'
771 allow_undefined_flag
=' -expect_unresolved'
772 archive_cmds
='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
773 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
774 hardcode_libdir_separator
=:
778 allow_undefined_flag
=' -expect_unresolved \*'
779 archive_cmds
='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
780 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
781 hardcode_libdir_separator
=:
785 archive_cmds
='$LD -G -o $lib$libobjs$deplibs'
790 archive_cmds
='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
791 hardcode_libdir_flag_spec
='-R$libdir'
792 hardcode_shlibpath_var
=no
796 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib$libobjs'
797 hardcode_libdir_flag_spec
='-L$libdir'
800 hardcode_shlibpath_var
=no
804 archive_cmds
='$LD -G -h $soname -o $lib$libobjs$deplibs'
805 hardcode_libdir_flag_spec
='-L$libdir'
808 hardcode_shlibpath_var
=no
817 echo "$ac_t$ld_shlibs" 1>&6
819 if test -z "$NM"; then
820 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
822 /*) ;; # Let the user override the test with a path.
824 IFS
="${IFS= }"; ac_save_ifs
="$IFS"; IFS
="${IFS}:"
825 for ac_dir
in /usr
/ucb
$PATH /bin
; do
826 test -z "$ac_dir" && dir
=.
827 if test -f $ac_dir/nm
; then
828 # Check to see if the nm accepts a BSD-compat flag.
829 if ($ac_dir/nm
-B /dev
/null
2>&1; exit 0) |
grep /dev
/null
>/dev
/null
; then
831 elif ($ac_dir/nm
-p /dev
/null
2>&1; exit 0) |
grep /dev
/null
>/dev
/null
; then
840 test -z "$NM" && NM
=nm
846 # Check for command to grab the raw symbol name followed by C symbol from nm.
847 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
849 # These are sane defaults that work on at least a few old systems.
850 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
852 # Character class describing NM global symbol codes.
853 symcode
='[BCDEGRSTU]'
855 # Regexp to match symbols that can be accessed directly from C.
856 sympat
='\([_A-Za-z][_A-Za-z0-9]*\)'
858 # Transform the above into a raw symbol and a C symbol.
861 # Define system-specific variables.
871 # If we're using GNU nm, then use its standard symbol codes.
872 if $NM -V 2>&1 |
egrep '(GNU|with BFD)' > /dev
/null
; then
873 symcode
='[ABCDGISTUW]'
876 # Write the raw and C identifiers.
877 global_symbol_pipe
="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
879 # Check to see that the pipe works correctly.
882 cat > conftest.c
<<EOF
884 void nm_test_func(){}
885 main(){nm_test_var='a';nm_test_func();return(0);}
888 echo "$progname:888: checking if global_symbol_pipe works" >&5
889 if { (eval echo $progname:889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o
; then
890 # Now try to grab the symbols.
892 if { echo "$progname:892: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
894 # Try sorting and uniquifying the output.
895 if sort "$nlist" |
uniq > "$nlist"T
; then
896 mv -f "$nlist"T
"$nlist"
897 wcout
=`wc "$nlist" 2>/dev/null`
898 count
=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
899 (test "$count" -ge 0) 2>/dev
/null || count
=-1
905 # Make sure that we snagged all the symbols we need.
906 if egrep ' nm_test_var$' "$nlist" >/dev
/null
; then
907 if egrep ' nm_test_func$' "$nlist" >/dev
/null
; then
908 cat <<EOF > conftest.c
914 # Now generate the symbol file.
915 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
917 cat <<EOF >> conftest.c
918 #if defined (__STDC__) && __STDC__
919 # define __ptr_t void *
921 # define __ptr_t char *
924 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
925 int dld_preloaded_symbol_count = $count;
927 /* The mapping between symbol names and symbols. */
932 dld_preloaded_symbols[] =
935 sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> conftest.c
936 cat <<\EOF
>> conftest.c
944 # Now try linking the two files.
945 mv conftest.o conftestm.o
947 save_CFLAGS
="$CFLAGS"
949 CFLAGS
="$CFLAGS$no_builtin_flag"
950 if { (eval echo $progname:950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest
; then
953 echo "$progname: failed program was:" >&5
958 echo "cannot find nm_test_func in $nlist" >&5
961 echo "cannot find nm_test_var in $nlist" >&5
964 echo "cannot run $global_symbol_pipe" >&5
967 echo "$progname: failed program was:" >&5
972 # Don't use the global_symbol_pipe unless it works.
973 echo "$ac_t$pipe_works" 1>&6
974 test "$pipe_works" = yes || global_symbol_pipe
=
976 # Check hardcoding attributes.
977 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
979 if test -n "$hardcode_libdir_flag_spec" || \
980 test "$hardcode_runpath_var" = yes; then
982 # We can hardcode non-existant directories.
983 if test "$hardcode_direct" != no
&& \
984 test "$hardcode_minus_L" != no
&& \
985 test "$hardcode_shlibpath_var" != no
; then
987 # Linking always hardcodes the temporary library directory.
988 hardcode_action
=relink
990 # We can link without hardcoding, and we can hardcode nonexisting dirs.
991 hardcode_action
=immediate
993 elif test "$hardcode_direct" != yes && \
994 test "$hardcode_minus_L" != yes && \
995 test "$hardcode_shlibpath_var" != yes; then
996 # We can't hardcode anything.
997 hardcode_action
=unsupported
999 # We can only hardcode existing directories.
1000 hardcode_action
=relink
1002 echo "$ac_t$hardcode_action" 1>&6
1003 test "$hardcode_action" = unsupported
&& can_build_shared
=no
1007 reload_cmds
='$LD$reload_flag -o $output$reload_objs'
1008 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1009 # PORTME Some linker may need a different reload flag.
1011 echo "$ac_t$reload_flag"
1012 test -n "$reload_flag" && reload_flag
=" $reload_flag"
1014 # PORTME Fill in your ld.so characteristics
1021 dynamic_linker
="$host_os ld.so"
1023 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1027 library_names_spec
='$libname.so.$versuffix $libname.a'
1028 shlibpath_var
=LIBPATH
1030 # AIX has no versioning support, so we append a major version to the name.
1031 soname_spec
='$libname.so.$major'
1034 freebsd2
* | freebsd3
*)
1036 library_names_spec
='$libname.so.$versuffix $libname.so'
1037 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1038 shlibpath_var
=LD_LIBRARY_PATH
1043 library_names_spec
='$libname.so.$versuffix'
1044 shlibpath_var
=LD_LIBRARY_PATH
1048 # Give a soname corresponding to the major version so that dld.sl refuses to
1049 # link against other versions.
1050 dynamic_linker
="$host_os dld.sl"
1052 shlibpath_var
=SHLIB_PATH
1053 library_names_spec
='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
1054 soname_spec
='$libname.sl.$major'
1055 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1056 postinstall_cmds
='chmod 555 $lib'
1061 soname_spec
='$libname.so'
1062 library_names_spec
='$libname.so.$versuffix $libname.so'
1063 shlibpath_var
=LD_LIBRARY_PATH
1066 # No shared lib support for Linux oldld, aout, or coff.
1067 linux-gnuoldld
* | linux-gnuaout
* | linux-gnucoff
*)
1071 # This must be Linux ELF.
1074 library_names_spec
='$libname.so.$versuffix $libname.so.$major $libname.so'
1075 soname_spec
='$libname.so.$major'
1076 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1077 shlibpath_var
=LD_LIBRARY_PATH
1079 if test -f /lib
/ld.so
.1; then
1080 dynamic_linker
='GNU ld.so'
1082 # Only the GNU ld.so supports shared libraries on MkLinux.
1084 powerpc
*) dynamic_linker
=no
;;
1085 *) dynamic_linker
='Linux ld.so' ;;
1092 library_names_spec
='$libname.so.$versuffix'
1093 finish_cmds
='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1094 shlibpath_var
=LD_LIBRARY_PATH
1099 library_names_spec
='$libname.dll'
1100 dynamic_linker
='OS/2 ld.exe'
1105 soname_spec
='$libname.so'
1106 library_names_spec
='$libname.so.$versuffix $libname.so'
1107 shlibpath_var
=LD_LIBRARY_PATH
1112 soname_spec
='$libname.so.$major'
1113 library_names_spec
='$libname.so.$versuffix $libname.so.$major $libname.so'
1114 shlibpath_var
=LD_LIBRARY_PATH
1119 library_names_spec
='$libname.so.$versuffix $libname.so.$major $libname.so'
1120 soname_spec
='$libname.so.$major'
1121 shlibpath_var
=LD_LIBRARY_PATH
1126 library_names_spec
='$libname.so.$versuffix'
1127 finish_cmds
='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1128 shlibpath_var
=LD_LIBRARY_PATH
1133 library_names_spec
='$libname.so.$versuffix $libname.so.$major $libname.so'
1134 soname_spec
='$libname.so.$major'
1135 shlibpath_var
=LD_LIBRARY_PATH
1142 echo "$ac_t$dynamic_linker"
1143 test "$dynamic_linker" = no
&& can_build_shared
=no
1145 # FIXME need to add library stripping features
1146 # strip -x works for most platforms, though not for static libraries on NetBSD
1147 # HP-UX requires "-r" for library stripping
1151 #echo $ac_n "checking for static library strip program... $ac_c" 1>&6
1152 #if test -n "$old_striplib"; then
1153 # echo "$ac_t$old_striplib" 1>&6
1155 # echo "$ac_t"none 1>&6
1158 #if test "$can_build_shared" = yes; then
1159 # echo $ac_n "checking for shared library strip program... $ac_c" 1>&6
1161 # if test -n "$striplib"; then
1162 # echo "$ac_t$striplib" 1>&6
1164 # echo "$ac_t"none 1>&6
1168 # Report the consequences.
1169 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1171 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1172 test "$can_build_shared" = "no" && enable_shared
=no
1174 # On AIX, shared libraries and static libraries use the same namespace, and
1175 # are all built from PIC.
1178 test "$enable_shared" = yes && enable_static
=no
1179 if test -n "$RANLIB"; then
1180 archive_cmds
="$archive_cmds;\$RANLIB \$lib"
1181 postinstall_cmds
='$RANLIB $lib'
1186 echo "$ac_t$enable_shared" 1>&6
1188 # Make sure either enable_shared or enable_static is yes.
1189 test "$enable_shared" = yes || enable_static
=yes
1191 echo "checking whether to build static libraries... $enable_static" 1>&6
1193 echo $ac_n "checking for objdir... $ac_c" 1>&6
1194 rm -f .libs
2>/dev
/null
1195 mkdir .libs
2>/dev
/null
1196 if test -d .libs
; then
1199 # MS-DOS does not allow filenames that begin with a dot.
1202 rmdir .libs
2>/dev
/null
1203 echo "$ac_t$objdir" 1>&6
1205 # Now quote all the things that may contain metacharacters.
1206 for var
in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1207 old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
1208 link_static_flag no_builtin_flag export_dynamic_flag_spec \
1209 profile_flag_pattern library_names_spec soname_spec RANLIB \
1210 old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
1211 archive_cmds postinstall_cmds \
1212 allow_undefined_flag finish_cmds global_symbol_pipe \
1213 striplib old_striplib \
1214 hardcode_libdir_flag_spec hardcode_libdir_separator
; do
1217 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
1218 old_postinstall_cmds | archive_cmds | postinstall_cmds | finish_cmds
)
1219 # Double-quote double-evaled strings.
1220 eval "$var=\`echo \"\$$var\" | sed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
1223 eval "$var=\`echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
1229 trap "$rm $ofile; exit 1" 1 2 15
1230 echo creating
$ofile
1235 # libtool - Provide generalized library-building support services.
1237 # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
1238 # This program was configured as follows,
1239 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1241 # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
1242 # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1245 # Compiler and other test output produced by $progname, useful for
1246 # debugging $progname, is in ./config.log if it exists.
1248 # The version of $progname that generated this script.
1249 LTCONFIG_VERSION="$VERSION"
1251 # Shell to use when invoking shell scripts.
1252 SHELL=${CONFIG_SHELL-/bin/sh}
1254 # Whether or not to build libtool libraries.
1255 build_libtool_libs=$enable_shared
1257 # Whether or not to build old-style libraries.
1258 build_old_libs=$enable_static
1261 host_alias="$host_alias"
1267 # The default C compiler.
1270 # The linker used to build libraries.
1273 # Whether we need hard or soft links.
1276 # A BSD-compatible nm program.
1279 # The name of the directory that contains temporary libtool files.
1282 # How to create reloadable object files.
1283 reload_flag="$reload_flag"
1284 reload_cmds="$reload_cmds"
1286 # How to pass a linker flag through the compiler.
1289 # Additional compiler flags for building library objects.
1290 pic_flag="$pic_flag"
1292 # Compiler flag to prevent dynamic linking.
1293 link_static_flag="$link_static_flag"
1295 # Compiler flag to turn off builtin functions.
1296 no_builtin_flag="$no_builtin_flag"
1298 # Compiler flag to allow reflexive dlopens.
1299 export_dynamic_flag_spec="$export_dynamic_flag_spec"
1301 # Pattern to match compiler flags for creating libNAME_p libraries:
1302 profile_flag_pattern="$profile_flag_pattern"
1304 # Library versioning type.
1305 version_type=$version_type
1307 # List of archive names. First name is the real one, the rest are links.
1308 # The last name is the one that the linker finds with -lNAME.
1309 library_names_spec="$library_names_spec"
1311 # The coded name of the library, if different from the real name.
1312 soname_spec="$soname_spec"
1314 # Commands used to build and install an old-style archive.
1316 old_archive_cmds="$old_archive_cmds"
1317 old_postinstall_cmds="$old_postinstall_cmds"
1319 # Create an old-style archive from a shared archive.
1320 old_archive_from_new_cmds="$old_archive_from_new_cmds"
1322 # Commands used to build and install a shared archive.
1323 archive_cmds="$archive_cmds"
1324 postinstall_cmds="$postinstall_cmds"
1326 # Flag that allows shared libraries with undefined symbols to be built.
1327 allow_undefined_flag="$allow_undefined_flag"
1329 # Commands used to finish a libtool library installation in a directory.
1330 finish_cmds="$finish_cmds"
1332 # Take the output of nm and produce a listing of raw symbols and C names.
1333 global_symbol_pipe="$global_symbol_pipe"
1335 # How to strip a library file.
1336 striplib="$striplib"
1337 old_striplib="$old_striplib"
1339 # This is the shared library runtime path variable.
1340 runpath_var=$runpath_var
1342 # This is the shared library path variable.
1343 shlibpath_var=$shlibpath_var
1345 # How to hardcode a shared library path into an executable.
1346 hardcode_action=$hardcode_action
1348 # Flag to hardcode \$libdir into a binary during linking.
1349 # This must work even if \$libdir does not exist.
1350 hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
1352 # Whether we need a single -rpath flag with a separated argument.
1353 hardcode_libdir_separator="$hardcode_libdir_separator"
1355 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1357 hardcode_direct=$hardcode_direct
1359 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1361 hardcode_minus_L=$hardcode_minus_L
1363 # Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the
1365 hardcode_runpath_var=$hardcode_runpath_var
1367 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1368 # the resulting binary.
1369 hardcode_shlibpath_var=$hardcode_shlibpath_var
1373 # Detect if we are using a relative or absolute path to ltmain.sh.
1375 /*) cat <<EOF2 >> $ofile
1376 # Execute the libtool backend.
1380 *) cat <<EOF3 >> $ofile
1381 # Find the path to this script.
1382 thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\`
1383 test "X\$0" = "X\$thisdir" && thisdir=.
1385 # Execute the libtool backend.
1391 echo 'exit 1' >> $ofile