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'
52 # All known linkers require a `.a' archive for static linking.
68 old_CPPFLAGS="$CPPFLAGS"
74 # Parse the command line options.
80 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
84 # If the previous option needs an argument, assign it.
85 if test -n "$prev"; then
93 Usage: $progname [OPTION]... LTMAIN [HOST]
95 Generate a system-specific libtool script.
97 --disable-shared do not build shared libraries
98 --disable-static do not build static libraries
99 --help display this help and exit
100 --no-verify do not verify that HOST is a valid host type
101 --quiet same as \`--silent'
102 --silent don't print informational messages
103 --srcdir=DIR find \`config.guess' in DIR
104 --version output version information and exit
105 --with-gcc assume that the GNU C compiler will be used
106 --with-gnu-ld assume that the C compiler uses the GNU linker
108 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
111 HOST is the canonical host system name [default=guessed].
116 --disable-shared) enable_shared=no ;;
118 --disable-static) enable_static=no ;;
120 --quiet | --silent) silent=yes ;;
122 --srcdir) prev=srcdir ;;
123 --srcdir=*) srcdir="$optarg" ;;
125 --no-verify) verify_host=no ;;
127 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
129 --with-gcc) with_gcc=yes ;;
130 --with-gnu-ld) with_gnu_ld=yes ;;
133 echo "$progname: unrecognized option \`$option'" 1>&2
139 if test -z "$ltmain"; then
141 elif test -z "$host"; then
142 # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
143 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
144 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
148 echo "$progname: too many arguments" 1>&2
155 if test -z "$ltmain"; then
156 echo "$progname: you must specify a LTMAIN file" 1>&2
161 if test -f "$ltmain"; then :
163 echo "$progname: warning: \`$ltmain' does not exist" 1>&2
166 # Quote any args containing shell metacharacters.
171 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
172 ltconfig_args="$ltconfig_args '$arg'" ;;
173 *) ltconfig_args="$ltconfig_args $arg" ;;
177 # A relevant subset of AC_INIT.
179 # File descriptor usage:
182 # 2 errors and warnings
183 # 3 some systems may open it to /dev/tty
184 # 4 used on the Kubota Titan
185 # 5 compiler messages saved in config.log
186 # 6 checking for... messages and results
187 if test "$silent" = yes; then
195 # Only set LANG and LC_ALL to C if already set.
196 # These must not be set unconditionally because not all systems understand
197 # e.g. LANG=C (notably SCO).
198 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
199 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
201 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
202 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
203 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
210 ac_n= ac_c='\c' ac_t=
213 if test -z "$srcdir"; then
214 # Assume the source directory is the same one as the path to ltmain.sh.
215 srcdir=`echo "$ltmain" | sed 's%/[^/]*$%%'`
216 test "$srcdir" = "$ltmain" && srcdir=.
219 trap "$rm conftest*; exit 1" 1 2 15
220 if test "$verify_host" = yes; then
221 # Check for config.guess and config.sub.
223 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
224 if test -f $ac_dir/config.guess; then
229 if test -z "$ac_aux_dir"; then
230 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
234 ac_config_guess=$ac_aux_dir/config.guess
235 ac_config_sub=$ac_aux_dir/config.sub
237 # Make sure we can run config.sub.
238 if $ac_config_sub sun4 >/dev/null 2>&1; then :
240 echo "$progname: cannot run $ac_config_sub" 1>&2
245 echo $ac_n "checking host system type""... $ac_c" 1>&6
248 case "$host_alias" in
250 if host_alias=`$ac_config_guess`; then :
252 echo "$progname: cannot guess host type; you must specify one" 1>&2
257 host=`$ac_config_sub $host_alias`
258 echo "$ac_t$host" 1>&6
260 # Make sure the host verified.
261 test -z "$host" && exit 1
263 elif test -z "$host"; then
264 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
271 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
274 *-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
277 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
278 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
279 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
283 # AIX sometimes has problems with the GCC collect2 program. For some
284 # reason, if we set the COLLECT_NAMES environment variable, the problems
285 # vanish in a puff of smoke.
286 if test "${COLLECT_NAMES+set}" != set; then
293 # Determine commands to create old-style static archives.
294 old_archive_cmds='$AR cru $oldlib$oldobjs'
295 old_postinstall_cmds='chmod 644 $oldlib'
297 # Set a sane default for `AR'.
298 test -z "$AR" && AR=ar
300 # If RANLIB is not set, then run the test.
301 if test "${RANLIB+set}" != "set"; then
304 echo $ac_n "checking for ranlib... $ac_c" 1>&6
305 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
307 test -z "$dir" && dir=.
308 if test -f $dir/ranlib; then
316 echo "$ac_t$result" 1>&6
319 if test -n "$RANLIB"; then
320 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
321 old_postinstall_cmds="$old_postinstall_cmds;\$RANLIB \$oldlib"
324 # Check to see if we are using GCC.
325 if test "$with_gcc" != yes || test -z "$CC"; then
326 # If CC is not set, then try to find GCC or a usable CC.
327 if test -z "$CC"; then
328 echo $ac_n "checking for gcc... $ac_c" 1>&6
329 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
332 test -z "$dir" && dir=.
333 if test -f $dir/gcc; then
340 if test -n "$CC"; then
347 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
348 if test -z "$CC"; then
349 echo $ac_n "checking for cc... $ac_c" 1>&6
350 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
353 test -z "$dir" && dir=.
354 if test -f $dir/cc; then
355 if test "$dir/cc" = "/usr/ucb/cc"; then
364 if test $cc_rejected = yes; then
365 # We found a bogon in the path, so make sure we never use it.
368 if test $# -gt 0; then
369 # We chose a different compiler from the bogus one.
370 # However, it has the same name, so the bogon will be chosen
371 # first if we set CC to just the name; use the full file name.
373 set dummy "$dir/cc" "$@"
379 if test -n "$CC"; then
385 if test -z "$CC"; then
386 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
391 # Now see if the compiler is really GCC.
393 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
394 echo "$progname:394: checking whether we are using GNU C" >&5
397 cat > conftest.c <<EOF
402 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
406 echo "$ac_t$with_gcc" 1>&6
409 # Allow CC to be a program name with arguments.
413 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
415 profile_flag_pattern=
416 special_shlib_compile_flags=
421 if test "$with_gcc" = yes; then
422 profile_flag_pattern='-pg?'
424 link_static_flag='-static'
425 no_builtin_flag=' -fno-builtin'
428 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
429 # PIC is the default for these OSes.
432 # We can build DLLs from non-PIC.
439 # PORTME Check for PIC flags for the system compiler.
442 # All AIX code is PIC.
443 link_static_flag='-bnso -bI:/lib/syscalls.exp'
447 # Is there a better link_static_flag that works with the bundled CC?
449 link_static_flag='${wl}-a ${wl}archive'
455 link_static_flag='-non_shared'
456 # PIC (with -KPIC) is the default.
460 # We can build DLLs from non-PIC.
464 # All OSF/1 code is PIC.
466 link_static_flag='-non_shared'
471 link_static_flag='-dn'
472 special_shlib_compile_flags='-belf'
477 link_static_flag='-Bstatic'
483 link_static_flag='-Bstatic'
489 link_static_flag='-Bstatic'
498 if test -n "$pic_flag"; then
499 echo "$ac_t$pic_flag" 1>&6
501 # Check to make sure the pic_flag actually works.
502 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
505 save_CFLAGS="$CFLAGS"
506 CFLAGS="$CFLAGS $pic_flag -DPIC"
507 echo "$progname:507: checking if $compiler PIC flag $pic_flag works" >&5
508 if { (eval echo $progname:508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
509 # Append any errors to the config.log.
510 cat conftest.err 1>&5
512 # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
513 # reports no error. So, we need to grep stderr for (Bundled).
514 if grep '(Bundled)' conftest.err >/dev/null; then
520 pic_flag=" $pic_flag"
523 # Append any errors to the config.log.
524 cat conftest.err 1>&5
529 CFLAGS="$save_CFLAGS"
532 echo "$ac_t"none 1>&6
535 # Check for any special shared library compilation flags.
536 if test -n "$special_shlib_compile_flags"; then
537 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
538 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
540 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
545 echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
547 echo 'main(){return(0);}' > conftest.c
548 save_LDFLAGS="$LDFLAGS"
549 LDFLAGS="$LDFLAGS $link_static_flag"
550 echo "$progname:550: checking if $compiler static flag $link_static_flag works" >&5
551 if { (eval echo $progname:551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
552 echo "$ac_t$link_static_flag" 1>&6
554 echo "$ac_t"none 1>&6
557 LDFLAGS="$save_LDFLAGS"
560 if test -z "$LN_S"; then
561 # Check to see if we can use ln -s, or we need hard links.
562 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
564 if ln -s X conftestdata 2>/dev/null; then
570 if test "$LN_S" = "ln -s"; then
577 # Make sure LD is an absolute path.
578 if test -z "$LD"; then
580 if test "$with_gcc" = yes; then
581 # Check if gcc -print-prog-name=ld gives a path.
582 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
583 echo "$progname:583: checking for ld used by GCC" >&5
584 ac_prog=`($CC -print-prog-name=ld) 2>&5`
586 # Accept absolute paths.
588 test -z "$LD" && LD="$ac_prog"
591 # If it fails, then pretend we aren't using GCC.
595 # If it is relative, then search for the first ld in PATH.
599 elif test "$with_gnu_ld" = yes; then
600 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
601 echo "$progname:601: checking for GNU ld" >&5
603 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
604 echo "$progname:604: checking for non-GNU ld" >&5
607 if test -z "$LD"; then
608 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
609 for ac_dir in $PATH; do
610 test -z "$ac_dir" && ac_dir=.
611 if test -f "$ac_dir/$ac_prog"; then
612 LD="$ac_dir/$ac_prog"
613 # Check to see if the program is GNU ld. I'd rather use --version,
614 # but apparently some GNU ld's only accept -v.
615 # Break only if it was the GNU/non-GNU ld that we prefer.
616 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
617 test "$with_gnu_ld" != no && break
619 test "$with_gnu_ld" != yes && break
626 if test -n "$LD"; then
632 if test -z "$LD"; then
633 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
638 # Check to see if it really is or isn't GNU ld.
639 echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
640 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
641 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
646 echo "$ac_t$with_gnu_ld" 1>&6
648 # See if the linker supports building shared libraries.
649 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
651 allow_undefined_flag=
653 old_archive_from_new_cmds=
654 export_dynamic_flag_spec=
655 hardcode_libdir_flag_spec=
656 hardcode_libdir_separator=
659 hardcode_runpath_var=no
660 hardcode_shlibpath_var=unsupported
664 if test "$with_gnu_ld" = yes; then
665 # See if GNU ld supports shared libraries.
671 hardcode_shlibpath_var=no
675 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
676 runpath_var=LD_RUN_PATH
677 hardcode_runpath_var=yes
685 if test "$ld_shlibs" = yes; then
686 archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
687 hardcode_libdir_flag_spec='${wl}-rpath $wl$libdir'
688 export_dynamic_flag_spec='${wl}-export-dynamic'
691 # PORTME fill in a description of your system's linker (not GNU ld)
694 allow_undefined_flag=unsupported
695 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'
696 # Note: this linker hardcodes the directories in LIBPATH if there
697 # are no directories specified by -L.
699 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
700 # Neither direct hardcoding nor static linking is supported with a
702 hardcode_direct=unsupported
707 allow_undefined_flag=unsupported
708 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'
713 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
714 # support. Future versions do this automatically, but an explicit c++rt0.o
715 # doesn't break anything, and helps significantly (at the cost of a little
718 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
721 hardcode_shlibpath_var=no
724 # Unfortunately, older versions of FreeBSD 2 don't have this feature.
726 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
729 hardcode_shlibpath_var=no
732 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
734 archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
735 hardcode_libdir_flag_spec='-R$libdir'
738 hardcode_shlibpath_var=no
742 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib'
743 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
749 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
750 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
756 archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
757 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
761 # Tested with NetBSD 1.2 ld
762 archive_cmds='$LD -Bshareable -o $lib$libobjs'
763 hardcode_libdir_flag_spec='-R$libdir'
765 hardcode_shlibpath_var=no
769 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
770 hardcode_libdir_flag_spec='-R$libdir'
772 hardcode_shlibpath_var=no
776 hardcode_libdir_flag_spec='-L$libdir'
778 allow_undefined_flag=unsupported
779 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;e
780 mxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def'
781 old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
785 allow_undefined_flag=' -expect_unresolved \*'
786 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
787 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
788 hardcode_libdir_separator=:
792 archive_cmds='$LD -G -o $lib$libobjs$deplibs'
798 i386) archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' ;;
799 *) archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' ;;
801 hardcode_libdir_flag_spec='-R$libdir'
802 hardcode_shlibpath_var=no
806 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
807 hardcode_libdir_flag_spec='-L$libdir'
810 hardcode_shlibpath_var=no
814 archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
815 hardcode_libdir_flag_spec='-L$libdir'
818 hardcode_shlibpath_var=no
827 echo "$ac_t$ld_shlibs" 1>&6
829 if test -z "$NM"; then
830 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
832 /*) ;; # Let the user override the test with a path.
834 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
835 for ac_dir in /usr/ucb $PATH /bin; do
836 test -z "$ac_dir" && dir=.
837 if test -f $ac_dir/nm; then
838 # Check to see if the nm accepts a BSD-compat flag.
839 if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
841 elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
850 test -z "$NM" && NM=nm
856 # Check for command to grab the raw symbol name followed by C symbol from nm.
857 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
859 # These are sane defaults that work on at least a few old systems.
860 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
862 # Character class describing NM global symbol codes.
863 symcode='[BCDEGRSTU]'
865 # Regexp to match symbols that can be accessed directly from C.
866 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
868 # Transform the above into a raw symbol and a C symbol.
871 # Define system-specific variables.
881 # If we're using GNU nm, then use its standard symbol codes.
882 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
883 symcode='[ABCDGISTUW]'
886 # Write the raw and C identifiers.
887 global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
889 # Check to see that the pipe works correctly.
892 cat > conftest.c <<EOF
897 void nm_test_func(){}
901 main(){nm_test_var='a';nm_test_func();return(0);}
904 echo "$progname:900: checking if global_symbol_pipe works" >&5
905 if { (eval echo $progname:901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
906 # Now try to grab the symbols.
908 if { echo "$progname:904: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
910 # Try sorting and uniquifying the output.
911 if sort "$nlist" | uniq > "$nlist"T; then
912 mv -f "$nlist"T "$nlist"
913 wcout=`wc "$nlist" 2>/dev/null`
914 count=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
915 (test "$count" -ge 0) 2>/dev/null || count=-1
921 # Make sure that we snagged all the symbols we need.
922 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
923 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
924 cat <<EOF > conftest.c
930 # Now generate the symbol file.
931 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
933 cat <<EOF >> conftest.c
934 #if defined (__STDC__) && __STDC__
935 # define __ptr_t void *
937 # define __ptr_t char *
940 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
941 int dld_preloaded_symbol_count = $count;
943 /* The mapping between symbol names and symbols. */
948 dld_preloaded_symbols[] =
951 sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> conftest.c
952 cat <<\EOF >> conftest.c
960 # Now try linking the two files.
961 mv conftest.o conftestm.o
963 save_CFLAGS="$CFLAGS"
965 CFLAGS="$CFLAGS$no_builtin_flag"
966 if { (eval echo $progname:962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
969 echo "$progname: failed program was:" >&5
974 echo "cannot find nm_test_func in $nlist" >&5
977 echo "cannot find nm_test_var in $nlist" >&5
980 echo "cannot run $global_symbol_pipe" >&5
983 echo "$progname: failed program was:" >&5
988 # Don't use the global_symbol_pipe unless it works.
989 echo "$ac_t$pipe_works" 1>&6
990 test "$pipe_works" = yes || global_symbol_pipe=
992 # Check hardcoding attributes.
993 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
995 if test -n "$hardcode_libdir_flag_spec" || \
996 test "$hardcode_runpath_var" = yes; then
998 # We can hardcode non-existant directories.
999 if test "$hardcode_direct" != no && \
1000 test "$hardcode_minus_L" != no && \
1001 test "$hardcode_shlibpath_var" != no; then
1003 # Linking always hardcodes the temporary library directory.
1004 hardcode_action=relink
1006 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1007 hardcode_action=immediate
1009 elif test "$hardcode_direct" != yes && \
1010 test "$hardcode_minus_L" != yes && \
1011 test "$hardcode_shlibpath_var" != yes; then
1012 # We can't hardcode anything.
1013 hardcode_action=unsupported
1015 # We can only hardcode existing directories.
1016 hardcode_action=relink
1018 echo "$ac_t$hardcode_action" 1>&6
1019 test "$hardcode_action" = unsupported && can_build_shared=no
1023 reload_cmds='$LD$reload_flag -o $output$reload_objs'
1024 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1025 # PORTME Some linker may need a different reload flag.
1027 echo "$ac_t$reload_flag"
1028 test -n "$reload_flag" && reload_flag=" $reload_flag"
1030 # PORTME Fill in your ld.so characteristics
1032 libname_spec='lib$name'
1038 dynamic_linker="$host_os ld.so"
1040 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1044 library_names_spec='$libname.so.$versuffix $libname.a'
1045 shlibpath_var=LIBPATH
1047 # AIX has no versioning support, so we append a major version to the name.
1048 soname_spec='$libname.so.$major'
1051 freebsd2* | freebsd3*)
1053 library_names_spec='$libname.so.$versuffix $libname.so'
1054 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1055 shlibpath_var=LD_LIBRARY_PATH
1060 library_names_spec='$libname.so.$versuffix'
1061 shlibpath_var=LD_LIBRARY_PATH
1065 # Give a soname corresponding to the major version so that dld.sl refuses to
1066 # link against other versions.
1067 dynamic_linker="$host_os dld.sl"
1069 shlibpath_var=SHLIB_PATH
1070 library_names_spec='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
1071 soname_spec='$libname.sl.$major'
1072 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1073 postinstall_cmds='chmod 555 $lib'
1078 soname_spec='$libname.so'
1079 library_names_spec='$libname.so.$versuffix $libname.so'
1080 shlibpath_var=LD_LIBRARY_PATH
1083 # No shared lib support for Linux oldld, aout, or coff.
1084 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1088 # This must be Linux ELF.
1091 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1092 soname_spec='$libname.so.$major'
1093 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1094 shlibpath_var=LD_LIBRARY_PATH
1096 if test -f /lib/ld.so.1; then
1097 dynamic_linker='GNU ld.so'
1099 # Only the GNU ld.so supports shared libraries on MkLinux.
1101 powerpc*) dynamic_linker=no ;;
1102 *) dynamic_linker='Linux ld.so' ;;
1109 library_names_spec='$libname.so.$versuffix'
1110 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1111 shlibpath_var=LD_LIBRARY_PATH
1116 libname_spec='$name'
1117 library_names_spec='$libname.dll $libname.a'
1118 dynamic_linker='OS/2 ld.exe'
1119 shlibpath_var=LIBPATH
1124 soname_spec='$libname.so'
1125 library_names_spec='$libname.so.$versuffix $libname.so'
1126 shlibpath_var=LD_LIBRARY_PATH
1131 soname_spec='$libname.so.$major'
1132 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1133 shlibpath_var=LD_LIBRARY_PATH
1138 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1139 soname_spec='$libname.so.$major'
1140 shlibpath_var=LD_LIBRARY_PATH
1145 library_names_spec='$libname.so.$versuffix'
1146 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1147 shlibpath_var=LD_LIBRARY_PATH
1152 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1153 soname_spec='$libname.so.$major'
1154 shlibpath_var=LD_LIBRARY_PATH
1161 echo "$ac_t$dynamic_linker"
1162 test "$dynamic_linker" = no && can_build_shared=no
1164 # FIXME add checks for striplib and old_striplib here.
1165 # strip -x works for most platforms, though not for static libraries on NetBSD
1166 # HP-UX requires "-r" for library stripping
1170 # Report the final consequences.
1171 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1173 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1174 test "$can_build_shared" = "no" && enable_shared=no
1176 # On AIX, shared libraries and static libraries use the same namespace, and
1177 # are all built from PIC.
1180 test "$enable_shared" = yes && enable_static=no
1181 if test -n "$RANLIB"; then
1182 archive_cmds="$archive_cmds;\$RANLIB \$lib"
1183 postinstall_cmds='$RANLIB $lib'
1188 echo "$ac_t$enable_shared" 1>&6
1190 # Make sure either enable_shared or enable_static is yes.
1191 test "$enable_shared" = yes || enable_static=yes
1193 echo "checking whether to build static libraries... $enable_static" 1>&6
1195 echo $ac_n "checking for objdir... $ac_c" 1>&6
1196 rm -f .libs 2>/dev/null
1197 mkdir .libs 2>/dev/null
1198 if test -d .libs; then
1201 # MS-DOS does not allow filenames that begin with a dot.
1204 rmdir .libs 2>/dev/null
1205 echo "$ac_t$objdir" 1>&6
1207 # Now quote all the things that may contain metacharacters.
1208 for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1209 old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
1210 link_static_flag no_builtin_flag export_dynamic_flag_spec \
1211 profile_flag_pattern libname_spec library_names_spec soname_spec RANLIB \
1212 old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
1213 archive_cmds postinstall_cmds \
1214 allow_undefined_flag finish_cmds global_symbol_pipe \
1215 striplib old_striplib \
1216 hardcode_libdir_flag_spec hardcode_libdir_separator; do
1219 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
1220 old_postinstall_cmds | archive_cmds | postinstall_cmds | finish_cmds)
1221 # Double-quote double-evaled strings.
1222 eval "$var=\`echo \"\$$var\" | sed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
1225 eval "$var=\`echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
1231 trap "$rm $ofile; exit 1" 1 2 15
1232 echo creating $ofile
1237 # libtool - Provide generalized library-building support services.
1239 # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
1240 # This program was configured as follows,
1241 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1243 # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
1244 # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1247 # Compiler and other test output produced by $progname, useful for
1248 # debugging $progname, is in ./config.log if it exists.
1250 # The version of $progname that generated this script.
1251 LTCONFIG_VERSION="$VERSION"
1253 # Shell to use when invoking shell scripts.
1254 SHELL=${CONFIG_SHELL-/bin/sh}
1256 # Whether or not to build libtool libraries.
1257 build_libtool_libs=$enable_shared
1259 # Whether or not to build old-style libraries.
1260 build_old_libs=$enable_static
1263 host_alias="$host_alias"
1269 # The default C compiler.
1272 # The linker used to build libraries.
1275 # Whether we need hard or soft links.
1278 # A BSD-compatible nm program.
1281 # The name of the directory that contains temporary libtool files.
1284 # How to create reloadable object files.
1285 reload_flag="$reload_flag"
1286 reload_cmds="$reload_cmds"
1288 # How to pass a linker flag through the compiler.
1291 # Additional compiler flags for building library objects.
1292 pic_flag="$pic_flag"
1294 # Compiler flag to prevent dynamic linking.
1295 link_static_flag="$link_static_flag"
1297 # Compiler flag to turn off builtin functions.
1298 no_builtin_flag="$no_builtin_flag"
1300 # Compiler flag to allow reflexive dlopens.
1301 export_dynamic_flag_spec="$export_dynamic_flag_spec"
1303 # Pattern to match compiler flags for creating libNAME_p libraries:
1304 profile_flag_pattern="$profile_flag_pattern"
1306 # Library versioning type.
1307 version_type=$version_type
1309 # Format of library name prefix.
1310 libname_spec="$libname_spec"
1312 # List of archive names. First name is the real one, the rest are links.
1313 # The last name is the one that the linker finds with -lNAME.
1314 library_names_spec="$library_names_spec"
1316 # The coded name of the library, if different from the real name.
1317 soname_spec="$soname_spec"
1319 # Commands used to build and install an old-style archive.
1321 old_archive_cmds="$old_archive_cmds"
1322 old_postinstall_cmds="$old_postinstall_cmds"
1324 # Create an old-style archive from a shared archive.
1325 old_archive_from_new_cmds="$old_archive_from_new_cmds"
1327 # Commands used to build and install a shared archive.
1328 archive_cmds="$archive_cmds"
1329 postinstall_cmds="$postinstall_cmds"
1331 # Flag that allows shared libraries with undefined symbols to be built.
1332 allow_undefined_flag="$allow_undefined_flag"
1334 # Commands used to finish a libtool library installation in a directory.
1335 finish_cmds="$finish_cmds"
1337 # Take the output of nm and produce a listing of raw symbols and C names.
1338 global_symbol_pipe="$global_symbol_pipe"
1340 # How to strip a library file.
1341 striplib="$striplib"
1342 old_striplib="$old_striplib"
1344 # This is the shared library runtime path variable.
1345 runpath_var=$runpath_var
1347 # This is the shared library path variable.
1348 shlibpath_var=$shlibpath_var
1350 # How to hardcode a shared library path into an executable.
1351 hardcode_action=$hardcode_action
1353 # Flag to hardcode \$libdir into a binary during linking.
1354 # This must work even if \$libdir does not exist.
1355 #hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
1357 # Whether we need a single -rpath flag with a separated argument.
1358 hardcode_libdir_separator="$hardcode_libdir_separator"
1360 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1362 hardcode_direct=$hardcode_direct
1364 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1366 hardcode_minus_L=$hardcode_minus_L
1368 # Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the
1370 hardcode_runpath_var=$hardcode_runpath_var
1372 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1373 # the resulting binary.
1374 hardcode_shlibpath_var=$hardcode_shlibpath_var
1380 cat <<\EOF >> $ofile
1381 # AIX sometimes has problems with the GCC collect2 program. For some
1382 # reason, if we set the COLLECT_NAMES environment variable, the problems
1383 # vanish in a puff of smoke.
1384 if test "${COLLECT_NAMES+set}" != set; then
1386 export COLLECT_NAMES
1393 # Detect if we are using a relative or absolute path to ltmain.sh.
1395 /*) cat <<EOF >> $ofile
1396 # Execute the libtool backend.
1400 *) cat <<EOF >> $ofile
1401 # Find the path to this script.
1402 thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\`
1403 test "X\$0" = "X\$thisdir" && thisdir=.
1405 # Execute the libtool backend.
1411 echo 'exit 1' >> $ofile