* README, ltconfig, ltmain.sh: New libtool: 1.0c.
[bpt/guile.git] / ltmain.sh
index 09bbad6..0ab17a8 100644 (file)
--- 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 <gord@gnu.ai.mit.edu>, 1996
 #
 # 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]