From 476f3c84b23dd4f29084f479e9821d3cb529ed58 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Mon, 15 Sep 1997 22:21:47 +0000 Subject: [PATCH] * README, ltconfig, ltmain.sh: New libtool: 1.0c. --- ChangeLog | 4 ++ README | 2 +- ltconfig | 69 ++++++++++++++------- ltmain.sh | 181 ++++++++++++++++++++++++++++++++---------------------- 4 files changed, 160 insertions(+), 96 deletions(-) diff --git a/ChangeLog b/ChangeLog index b587fcb94..49115e2dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Sep 16 00:19:46 1997 Mikael Djurfeldt + + * README, ltconfig, ltmain.sh: New libtool: 1.0c. + Thu Sep 11 11:28:24 1997 Mikael Djurfeldt * ltmain.sh: Added a missing '\' before \n on line 32. diff --git a/README b/README index 9240c7d72..2458b17ed 100644 --- a/README +++ b/README @@ -98,7 +98,7 @@ Automake 1.1p --- a system for automatically generating Makefiles that `guile.m4' from the top directory of the Guile core disty to `/usr/local/share/aclocal. -libtool 0.9h --- a system for managing the zillion hairy options needed +libtool 1.0c --- a system for managing the zillion hairy options needed on various systems to produce shared libraries. Available in "ftp://alpha.gnu.ai.mit.edu/gnu". diff --git a/ltconfig b/ltconfig index b15967713..8279c0f7d 100755 --- a/ltconfig +++ b/ltconfig @@ -32,7 +32,7 @@ progname=`echo "$0" | sed 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.0b +VERSION=1.0c ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' rm="rm -f" @@ -610,6 +610,16 @@ case "$LD" in ;; esac +# Check to see if it really is or isn't GNU ld. +echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 +# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + with_gnu_ld=yes +else + with_gnu_ld=no +fi +echo $ac_t "$with_gnu_ld" 1>&6 + # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 @@ -696,8 +706,9 @@ else # FreeBSD 3, at last, uses gcc -shared to do shared libraries. freebsd3*) archive_cmds='$CC -shared -o $lib$libobjs$deplibs' + hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes - hardcode_minusL=yes + hardcode_minus_L=yes hardcode_shlibpath_var=no ;; @@ -792,27 +803,39 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 -# This is a sane default that works on at least a few old systems. -# [It comes from Ultrix. What could be older than Ultrix?!! ;)] -global_symbol_pipe="sed -e '/^.* [BCDEGRSTU] /!d' -e 's/^.* [BCDEGRSTU] \(.*\)$/\1 \1/'" +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRSTU]' -# Take a first stab at what the pipe should be. +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \1' + +# Define system-specific variables. +case "$host_os" in +aix*) + symcode='[BCDTU]' + ;; +solaris2*) + symcode='[BDTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - # We're using GNU nm. - global_symbol_pipe="sed -e '/^.* [ABCDGISTU] /!d' -e 's/^.* [ABCDGISTU] \(.*\)$/\1 \1/'" -else - # It's the system nm. - case "$host_os" in - aix*) - # Delete symbols that begin with a dot. - global_symbol_pipe="sed -e '/^.* [BCDTU] [^.]/!d' -e 's/^.* [BCDTU] \(.*\)$/\1 \1/'" - ;; - solaris2*) - global_symbol_pipe="sed -e '/^.* [BDTU] /!d' -e 's/^.* [BDTU] \(.*\)$/\1 \1/'" - ;; - esac + symcode='[ABCDGISTU]' fi +# Delete symbols that are not valid C identifiers. +global_symbol_pipe="sed -e '/^.* $symcode $sympat$/!d'" + +# Write the raw and C identifiers. +global_symbol_pipe="$global_symbol_pipe -e 's/^.* $symcode $sympat$/$symxfrm/'" + # Check to see that the pipe works correctly. pipe_works=no $rm conftest* @@ -822,11 +845,11 @@ void nm_test_func(){} main(){nm_test_var='a';nm_test_func();return(0);} EOF -echo "$progname:825: checking if global_symbol_pipe works" >&5 -if { (eval echo $progname:826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then +echo "$progname:848: checking if global_symbol_pipe works" >&5 +if { (eval echo $progname:849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:829: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:852: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -874,7 +897,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS='conftestm.o' CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 diff --git a/ltmain.sh b/ltmain.sh index 09bbad64d..0ab17a831 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,5 +1,5 @@ # ltmain.sh - Provide generalized library-building support services. -# Generated automatically from ltmain.sh.in by configure. +# Generated automatically from ltmain.in by configure. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # @@ -22,15 +22,16 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -echo=echo -if test X`$echo '\t'` = 'X\t'; then : +#FIXME: echo=echo +echo='printf %s\n' +if test "X`$echo '\t'`" = 'X\t'; then : else # The Solaris and AIX default echo program unquotes backslashes. # This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # So, we emulate echo with printf '%s\n' - echo='printf %s\\n' - if test X`$echo '\t'` = 'X\t'; then : + echo='printf %s\n' + if test "X`$echo '\t'`" = 'X\t'; then : else # Oops. We have no working printf. Try to find a not-so-buggy echo. echo=echo @@ -38,7 +39,7 @@ else save_PATH="$PATH" PATH="$PATH":/usr/ucb for dir in $PATH; do - if test -f $dir/echo && test X`$dir/echo '\t'` = 'X\t'; then + if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then echo="$dir/echo" break fi @@ -54,14 +55,14 @@ progname=`$echo "$0" | sed 's%^.*/%%'` # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.0b +VERSION=1.0c default_mode= help="Try \`$progname --help' for more information." magic="%%%MAGIC variable%%%" mkdir="mkdir" mv="mv -f" -objdir=.libs +objdir=_libs rm="rm -f" # Sed substitution that helps us do robust quoting. It backslashifies @@ -368,7 +369,7 @@ if test -z "$show_help"; then # link it into a program. if test "$build_libtool_libs" != yes; then $show "$echo timestamp > $libobj" - $run eval "$echo timestamp > \$libobj" || exit $? + $run eval "\$echo timestamp > \$libobj" || exit $? fi exit 0 @@ -389,14 +390,13 @@ if test -z "$show_help"; then dlprefiles= export_dynamic=no hardcode_libdirs= - install_libdir= libobjs= link_against_libtool_libs= - link_static= ltlibs= objs= prev= prevarg= + rpath= perm_rpath= temp_rpath= vinfo= @@ -405,14 +405,11 @@ if test -z "$show_help"; then for arg do case "$arg" in - -static) - if test "$build_libtool_libs" = yes; then - if test "$hardcode_direct" = unsupported && test -z "$link_static_flag"; then - $echo "$progname: warning: static linking is impossible in this configuration" 1>&2 - else - build_libtool_libs=no - fi + -all-static | -static) + if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + $echo "$progname: warning: complete static linking is impossible in this configuration" 1>&2 fi + build_libtool_libs=no build_old_libs=yes break ;; @@ -442,6 +439,11 @@ if test -z "$show_help"; then ;; esac ;; + rpath) + rpath="$rpath $arg" + prev= + continue + ;; *) eval "$prev=\"\$arg\"" prev= @@ -453,6 +455,14 @@ if test -z "$show_help"; then prevarg="$arg" case "$arg" in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + -allow-undefined) allow_undefined=yes continue @@ -471,7 +481,7 @@ if test -z "$show_help"; then -export-dynamic) if test "$export_dynamic" != yes; then export_dynamic=yes - arg=`eval $echo "$export_dynamic_flag_spec"` + arg=`eval \\$echo "$export_dynamic_flag_spec"` # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" @@ -497,16 +507,14 @@ if test -z "$show_help"; then -o) prev=output ;; -rpath) - prev=install_libdir + prev=rpath continue ;; -static) - link_static="$link_static_flag" - compile_command="$compile_command $link_static" - finalize_command="$finalize_command $link_static" + # We already handled this flag above. continue - ;; + ;; -version-info) prev=vinfo @@ -632,7 +640,7 @@ if test -z "$show_help"; then esac fi - + # FIXME: This is the magic to use -rpath. if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -647,7 +655,7 @@ if test -z "$show_help"; then fi if test -n "$libdir"; then - flag=`eval $echo \"$hardcode_libdir_flag_spec\"` + flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"` compile_command="$compile_command $flag" finalize_command="$finalize_command $flag" @@ -727,7 +735,7 @@ if test -z "$show_help"; then compile_command="$compile_command $dir/$linklib" finalize_command="$finalize_command $dir/$linklib" else - # Here we assume that "$hardcode_minusL" != unsupported. + # Here we assume that "$hardcode_minus_L" != unsupported. # This is valid on all known static and shared platforms. compile_command="$compile_command -L$dir -l$name" finalize_command="$finalize_command -L$dir -l$name" @@ -754,12 +762,6 @@ if test -z "$show_help"; then exit 1 fi - # Substitute the hardcoded libdirs into the compile commands. - if test -n "$hardcode_libdir_separator"; then - compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` - finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` - fi - oldlib= oldobjs= case "$output" in @@ -803,11 +805,18 @@ if test -z "$show_help"; then finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"` fi - if test -z "$install_libdir"; then + if test -z "$rpath"; then $echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2 + $echo "$help" 1>&2 exit 1 fi + set dummy $rpath + if test $# -gt 2; then + $echo "$progname: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo @@ -922,13 +931,13 @@ if test -z "$show_help"; then if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. - library_names=`eval $echo \"$library_names_spec\"` + library_names=`eval \\$echo \"$library_names_spec\"` set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then - soname=`eval $echo \"$soname_spec\"` + soname=`eval \\$echo \"$soname_spec\"` else soname="$realname" fi @@ -944,7 +953,7 @@ if test -z "$show_help"; then test -z "$pic_flag" && libobjs=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'` # Do each of the archive commands. - cmds=`eval $echo \"$archive_cmds\"` + cmds=`eval \\$echo \"$archive_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -984,7 +993,7 @@ if test -z "$show_help"; then finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"` fi - if test -n "$install_libdir"; then + if test -n "$rpath"; then $echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2 fi @@ -1014,7 +1023,7 @@ if test -z "$show_help"; then reload_objs="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'` output="$obj" - cmds=`eval $echo \"$reload_cmds\"` + cmds=`eval \\$echo \"$reload_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1030,7 +1039,7 @@ if test -z "$show_help"; then # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "$echo timestamp > $libobj" - $run eval "$echo timestamp > $libobj" || exit $? + $run eval "\$echo timestamp > $libobj" || exit $? exit 0 fi @@ -1038,7 +1047,7 @@ if test -z "$show_help"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs" output="$libobj" - cmds=`eval $echo \"$reload_cmds\"` + cmds=`eval \\$echo \"$reload_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1056,15 +1065,48 @@ if test -z "$show_help"; then ;; *) - if test -n "$install_libdir"; then - $echo "$progname: warning: \`-rpath' is ignored while linking programs" 1>&2 - fi - if test -n "$vinfo"; then $echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2 fi - if test -n "$libobjs"; then + if test -n "$rpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + # Put the magic libdir with the hardcode flag. + hardcode_libdirs="$libdir" + libdir="@HARDCODE_LIBDIRS@" + else + # Just accumulate the libdirs. + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + libdir= + fi + fi + + if test -n "$libdir"; then + flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"` + + compile_command="$compile_command $flag" + finalize_command="$finalize_command $flag" + fi + elif test "$hardcode_runpath_var" = yes; then + case "$perm_rpath " in + "* $libdir *") ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + fi + + # Substitute the hardcoded libdirs into the compile commands. + if test -n "$hardcode_libdir_separator"; then + compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` + finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` + fi + + if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'` finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'` @@ -1176,17 +1218,7 @@ EOF # We have no uninstalled library dependencies, so finalize right now. $show "$compile_command" $run eval "$compile_command" - status=$? - - # If we failed to link statically, then try again. - if test $status -ne 0 && test -n "$link_static"; then - $echo "$progname: cannot link \`$output' statically; retrying semi-dynamically" 1>&2 - compile_command=`$echo "$compile_command " | sed -e "s% $link_static % %" -e 's/ $//'` - $show "$compile_command" - $run eval "$compile_command" - status=$? - fi - exit $status + exit $? fi # Replace the output file specification. @@ -1278,11 +1310,15 @@ if test "\$libtool_install_magic" = "$magic"; then link_against_libtool_libs='$link_against_libtool_libs' finalize_command="$finalize_command" else - # When we are sourced in execute mode, \$file is already set. - test "\$libtool_execute_magic" = "$magic" || file="\$0" + # When we are sourced in execute mode, \$file and \$echo are already set. + if test "\$libtool_execute_magic" = "$magic"; then : + else + echo='$echo' + file="\$0" + fi # Find the directory that this script lives in. - thisdir=\`$echo "\$file" | sed 's%/[^/]*$%%'\` + thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\` test "x\$thisdir" = "x\$file" && thisdir=. # Try to get the absolute directory name. @@ -1310,7 +1346,7 @@ EOF $shlibpath_var="$temp_rpath\$$shlibpath_var" # Some systems cannot cope with colon-terminated $shlibpath_var - $shlibpath_var=\`$echo \$$shlibpath_var | sed -e 's/:*\$//'\` + $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\` export $shlibpath_var @@ -1325,7 +1361,7 @@ EOF do # Quote arguments (to preserve shell metacharacters). sed_quote_subst='$sed_quote_subst' - arg=\`$echo "\$arg" | sed "\$sed_quote_subst"\` + arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\` args="\$args \\"\$arg\\"" done @@ -1335,14 +1371,14 @@ EOF eval "exec \$program \$args" - $echo "\$0: cannot exec \$program \$args" + \$echo "\$0: cannot exec \$program \$args" exit 1 fi else # The program doesn't exist. - $echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2 - $echo "This script is just a wrapper for \$program." 1>&2 - $echo "See the $PACKAGE documentation for more information." 1>&2 + \$echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2 + \$echo "This script is just a wrapper for \$program." 1>&2 + \$echo "See the $PACKAGE documentation for more information." 1>&2 exit 1 fi fi @@ -1371,7 +1407,7 @@ EOF fi # Do each command in the archive commands. - cmds=`eval $echo \"$old_archive_cmds\"` + cmds=`eval \\$echo \"$old_archive_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1645,7 +1681,7 @@ EOF # Do each command in the postinstall commands. lib="$destdir/$realname" - cmds=`eval $echo \"$postinstall_cmds\"` + cmds=`eval \\$echo \"$postinstall_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1792,7 +1828,7 @@ EOF fi # Do each command in the postinstall commands. - cmds=`eval $echo \"$old_postinstall_cmds\"` + cmds=`eval \\$echo \"$old_postinstall_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1829,7 +1865,7 @@ EOF for libdir in $libdirs; do # Do each command in the postinstall commands. - cmds=`eval $echo \"$finish_cmds\"` + cmds=`eval \\$echo \"$finish_cmds\"` IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1971,7 +2007,7 @@ EOF exit 1 else # Display what would be done. - eval "$echo \"\$shlibpath_var=\$$shlibpath_var\"" + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" $echo "$cmd$args" exit 0 @@ -2154,6 +2190,7 @@ a program from several object files. The following components of LINK-COMMAND are treated specially: + -all-static do not do any dynamic linking at all -allow-undefined allow a libtool library to reference undefined symbols -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols @@ -2162,7 +2199,7 @@ The following components of LINK-COMMAND are treated specially: -lNAME OUTPUT-FILE requires the installed library libNAME -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -rpath LIBDIR the created library will eventually be installed in LIBDIR - -static do not do any dynamic linking or shared library creation + -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -- 2.20.1