]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
*** empty log message ***
authorGordon Matzigkeit <gord@gnu.ai.mit.edu>
Fri, 25 Jul 1997 17:11:35 +0000 (17:11 +0000)
committerGordon Matzigkeit <gord@gnu.org>
Fri, 25 Jul 1997 17:11:35 +0000 (17:11 +0000)
ChangeLog
NEWS
demo/Makefile.am
doc/libtool.texi
doc/platforms.texi
ltconfig.in
ltmain.sh.in

index af1a533514581515687ea54d36212e95ce0c2024..d5c7b466c094067c58fd7fb31fc199e4bc778362 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
+Fri Jul 25 10:13:49 1997  Gordon Matzigkeit  <gord@gnu.ai.mit.edu>
+
+       * ltmain.sh.in (link): Remove code for `-version-file', since it
+       has been long-deprecated.
+       Disable static linking if hardcode_direct is unsupported.
+
+       * ltconfig.in: Fix typo in test polarity.  From Mark Kettenis.
+
 Thu Jul 24 10:42:30 1997  Gordon Matzigkeit  <gord@gnu.ai.mit.edu>
 
+       * ltconfig.in (hardcode_direct): Set to `unsupported' if aix3 uses
+       a broken collect2.  Adapted out of test results from Mark
+       Kettenis.
+       (link_static_flag): Make sure the link_static_flag actually works
+       with a trivial binary.
+
        * ltmain.sh.in, ltconfig.in (export_dynamic_flag_spec): Renamed
        from export_dynamic_flag because we eval it in ltmain.sh.
 
diff --git a/NEWS b/NEWS
index 959ddd0a6e3eb4fdfa70a227067c496624a99f15..682732db3e80cef9737109deb3f9641a2995ea35 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,8 +6,8 @@ New in 1.0a:
   platforms, via new `-dlopen' and `-pre-dlopen' link flags.
 * New tests for a BSD-compatible `nm' program, required for dlopened
   modules.
-* FIXME: Deleted `dlname' mode, now that the internal structure of `.la'
-  files is a public interface.
+* Deleted `dlname' mode.  Dlopen applications should only use the
+  runtime search method described in (libtool)Finding the dlname.
 \f
 New in 1.0:
 * Bug fixes.
index b2e9f33f32cab875f5b7f47c33ed38ddf8612b45..578735abcb47b8db8b09c81b71b0eefb8629d770 100644 (file)
@@ -60,13 +60,14 @@ helldl: $(helldl_OBJECTS) $(helldl_DEPENDENCIES)
 hardcode: $(hardcode_tests)
 hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES)
        @rm -f hc-direct
+       @echo "You may ignore any linking errors from the following command:"
        @shlib=./.libs/libhello.a; \
          eval "`egrep '^library_names' libhello.la`"; \
          for lib in $$library_names; do \
            shlib="./.libs/$$lib"; \
          done; \
-         echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS)"; \
-         eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS)"
+         echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) || echo unsupported > $@"; \
+         eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) || echo unsupported > $@"
 
 hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
        @rm -f hc-minusL
index e620a1386a44d71cf6b3d8c0af6f616df817aa69..bfc5c9d08c492876da0dfc972148cd2132210955 100644 (file)
@@ -130,7 +130,6 @@ Invoking @code{libtool}
 
 * Compile mode::                Creating library object files.
 * Link mode::                   Generating executables and libraries.
-* Dlname mode::                 Obtaining a file name to @code{dlopen(3)}.
 * Install mode::                Making libraries and executables public.
 * Finish mode::                 Completing a library installation.
 * Uninstall mode::              Removing executables and libraries.
@@ -183,7 +182,7 @@ The libtool test suite
 * Test descriptions::           The contents of the test suite.
 * When tests fail::             What to do when a test fails.
 
-Maintainance notes for libtool
+Maintenance notes for libtool
 
 * New ports::                   How to port libtool to new systems.
 * Tested platforms::            When libtool was last tested.
@@ -936,7 +935,6 @@ Print libtool version information and exit.
 @menu
 * Compile mode::                Creating library object files.
 * Link mode::                   Generating executables and libraries.
-* Dlname mode::                 Obtaining a file name to @code{dlopen(3)}.
 * Install mode::                Making libraries and executables public.
 * Finish mode::                 Completing a library installation.
 * Uninstall mode::              Removing executables and libraries.
@@ -1029,22 +1027,6 @@ This method is often called @dfn{partial linking}.
 
 Otherwise, an executable program is created.
 
-@node Dlname mode
-@section Dlname mode
-@cindex Dlname mode
-@cindex Mode, dlname
-
-The @samp{dlname} mode simply prints the name of a libtool library that
-can be passed to the @code{dlopen(3)} function call (@pxref{Dlopened
-modules}).
-
-Each of the @var{mode-args} specifies a libtool library linked
-using the @samp{-export-dynamic} option (@pxref{Link mode}).  The names
-of the modules to load are printed to standard output, one per line.
-
-If one of the @var{mode-args} was not linked with
-@samp{-export-dynamic}, then an error is displayed.
-
 @node Install mode
 @section Install mode
 @cindex Install mode
@@ -1963,24 +1945,8 @@ After a library has been linked with @samp{-export-dynamic}, it can be
 dlopened.  Unfortunately, because of the variation in library names,
 your package needs to determine the correct file to dlopen.
 
-Dlname mode (@pxref{Dlname mode}) was designed for this purpose.  It
-returns the name that should be given as the first argument to a
-@code{dlopen(3)} function call.
-
-For example, on NetBSD 1.2:
-
-@example
-burger$ @kbd{libtool --mode=dlname libhello.la}
-libhello.so.3.12
-burger$
-@end example
-
-The trick is in finding a way to hardcode this name into your program at
-compilation time, so that it opens the correct library.
-
-An alternative implementation that avoids hardcoding is to determine the
-name at runtime, by finding the installed @samp{.la} file, and searching
-it for the following lines:
+The basic implementation is to determine the name at runtime, by finding
+the installed @samp{.la} file, and searching it for the following lines:
 
 @example
 # The name that we can @code{dlopen(3)}.
@@ -2024,8 +1990,8 @@ family of functions.  Some platforms do not even use the same function
 names (notably HP-UX, with its @samp{shl_load(3)} family).
 
 @item
-It is the burden of the libtool user to find a way to get the results of
-dlname mode (@pxref{Dlname mode}) into the call to @code{dlopen(3)}.
+The application developer must write a custom search function in order
+to discover the correct module filename to supply to @code{dlopen(3)}.
 @end itemize
 
 Each of these limitations will be addressed in GNU DLD
@@ -2234,7 +2200,7 @@ Please include the generated @code{libtool} script with your bug report,
 so that I can see what values @code{ltconfig} guessed for your system.
 
 @node Maintaining
-@chapter Maintainance notes for libtool
+@chapter Maintenance notes for libtool
 
 This chapter contains information that the libtool maintainer finds
 important.  It will be of no use to you unless you are considering
index 69ad1d89594e94914cebd4748d7fe27009b1045e..b463871f006a862ee8be391d3ddc335089a06bb1 100644 (file)
@@ -28,9 +28,9 @@ rs6000-ibm-aix3.2.5          gcc       0.9h      ok*
 sparc-sun-linux2.1.23        gcc       0.9h      ok
 sparc-sun-sunos4.1.4         cc        1.0       ok
 sparc-sun-sunos4.1.4         gcc       1.0       ok
-sparc-sun-solaris2.4         cc        0.9       ok
-sparc-sun-solaris2.4         gcc       0.9       ok
-sparc-sun-solaris2.5         cc        0.9       ok
+sparc-sun-solaris2.4         cc        1.0a      ok
+sparc-sun-solaris2.4         gcc       1.0a      ok
+sparc-sun-solaris2.5         cc        1.0a      ok
 sparc-sun-solaris2.5         gcc       1.0a      ok
 --------------------------------------------------------
 
index 2271e490442a0df24229be6c7d88b5633abff976..7c075b15297841bf8dddd3011efd5f6b8d88d3c7 100755 (executable)
@@ -606,8 +606,9 @@ else
     # Note: this linker hardcodes the directories in LIBPATH if there
     # are no directories specified by -L.
     hardcode_minus_L=yes
-    # Direct hardcoding is not supported with a broken collect2.
-    if test "$with_gcc" = yes && test -n "$link_static_flag"; then
+    if test "$with_gcc" = yes && test -z "$link_static_flag"; then
+      # Neither direct hardcoding nor static linking is supported with a
+      # broken collect2.
       hardcode_direct=unsupported
     fi
     ;;
index 92327a51481bb65ff66cc9dbd87a4a0b67e89cfe..570e968a625438c367efa92fdfbce6fbbf866bbe 100644 (file)
@@ -161,11 +161,11 @@ if test -z "$show_help"; then
     *)
       # Just use the default operation mode.
       if test -z "$mode"; then
-       if test -n "$nonopt"; then
-         echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-       else
-         echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-       fi
+        if test -n "$nonopt"; then
+          echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+        else
+          echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+        fi
       fi
       ;;
     esac
@@ -189,8 +189,8 @@ if test -z "$show_help"; then
     do
       # Quote any args containing shell metacharacters.
       case "$arg" in
-      *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*|*\"*)
-        quote_arg="'$arg'" ;;
+      *" "*|*"  "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*|*\"*)
+         quote_arg="'$arg'" ;;
       *) quote_arg="$arg" ;;
       esac
 
@@ -244,15 +244,15 @@ if test -z "$show_help"; then
       $show "$base_compile$pic_flag -DPIC $srcfile"
       if $run eval "$base_compile$pic_flag -DPIC $srcfile"; then :
       else
-       test -n "$obj" && $run $rm $obj
-       exit 1
+        test -n "$obj" && $run $rm $obj
+        exit 1
       fi
 
       # If we have no pic_flag, then copy the object into place and finish.
       if test -z "$pic_flag"; then
-       $show "$LN_S $obj $libobj"
-       $run $LN_S $obj $libobj
-       exit $?
+        $show "$LN_S $obj $libobj"
+        $run $LN_S $obj $libobj
+        exit $?
       fi
 
       # Just move the object, then go on to compile the next one
@@ -313,8 +313,14 @@ if test -z "$show_help"; then
     do
       case "$arg" in
       -static)
-        build_libtool_libs=no
-        build_old_libs=yes
+        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
+        fi
+       build_old_libs=yes
         break
         ;;
       esac
@@ -324,29 +330,29 @@ if test -z "$show_help"; then
     do
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
-       case "$prev" in
-       output)
-         compile_command="$compile_command @OUTPUT@"
-         finalize_command="$finalize_command @OUTPUT@"
-         args="$args $arg"
-         ;;
-       esac
-
-       case "$prev" in
+        case "$prev" in
+        output)
+          compile_command="$compile_command @OUTPUT@"
+          finalize_command="$finalize_command @OUTPUT@"
+          args="$args $arg"
+          ;;
+        esac
+
+        case "$prev" in
         dlfiles|dlprefiles)
-         case "$arg" in
-         *.la) ;;  # We handle this case below.
+          case "$arg" in
+          *.la) ;;  # We handle this case below.
           *)
             dlprefiles="$dlprefiles $arg"
-           test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
-           prev=
+            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
+            prev=
             ;;
           esac
           ;;
         *)
-         eval "$prev=\"\$arg\""
-         prev=
-         continue
+          eval "$prev=\"\$arg\""
+          prev=
+          continue
           ;;
         esac
       fi
@@ -358,268 +364,270 @@ if test -z "$show_help"; then
       -allow-undefined) allow_undefined=yes ;;
 
       -dlopen)
-       prev=dlfiles
-       continue
-       ;;
+        prev=dlfiles
+        continue
+        ;;
 
       -dlpreopen)
-       prev=dlprefiles
-       continue
-       ;;
+        prev=dlprefiles
+        continue
+        ;;
 
       -export-dynamic)
-       if test "$export_dynamic" != yes; then
-         export_dynamic=yes
-         compile_command="$compile_command "`eval echo "$export_dynamic_flag_spec"`
-         finalize_command="$finalize_command "`eval echo "$export_dynamic_flag_spec"`
-         # Add the symbol object into the linking commands.
-         compile_command="$compile_command @SYMFILE@"
-         finalize_command="$finalize_command @SYMFILE@"
+        if test "$export_dynamic" != yes; then
+          export_dynamic=yes
+          compile_command="$compile_command "`eval echo "$export_dynamic_flag_spec"`
+          finalize_command="$finalize_command "`eval echo "$export_dynamic_flag_spec"`
+          # Add the symbol object into the linking commands.
+          compile_command="$compile_command @SYMFILE@"
+          finalize_command="$finalize_command @SYMFILE@"
         fi
-       continue
-       ;;
+        continue
+        ;;
 
       -L*)
-       dir=`echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
-       case "$dir" in
-       /*)
-         ;;
-       *)
-         echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
-         exit 1
-         ;;
-       esac
-       deplibs="$deplibs $arg"
-       ;;
+        dir=`echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
+        case "$dir" in
+        /*)
+          ;;
+        *)
+          echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
+          exit 1
+          ;;
+        esac
+        deplibs="$deplibs $arg"
+        ;;
 
       -l*) deplibs="$deplibs $arg" ;;
 
       -o) prev=output ;;
 
       -rpath)
-       prev=install_libdir
-       continue
-       ;;
+        prev=install_libdir
+        continue
+        ;;
 
       -static)
-       link_static="`eval echo \"$link_static_flag\"`"
-       compile_command="$compile_command $link_static"
-       continue
-       ;;
-
-      -version-file)
-       echo "$progname: \`-version-file' has been replaced by \`-version-info'" 1>&2
-       echo "$help" 1>&2
-       exit 1
-       ;;
+        link_static="$link_static_flag"
+        test -n "$link_static" && compile_command="$compile_command $link_static"
+        continue
+        ;;
 
       -version-info)
-       prev=vinfo
-       continue
-       ;;
+        prev=vinfo
+        continue
+        ;;
 
       -*) CC="$CC $arg" ;; # Some other compiler flag.
 
       *.o)
-       # A standard object.
-       objs="$objs $arg"
-       ;;
+        # A standard object.
+        objs="$objs $arg"
+        ;;
 
       *.a)
-       # Find the relevant object directory and library name.
-       file=`echo "$arg" | sed 's%^.*/%%'`
-       dir=`echo "$arg" | sed 's%/[^/]*$%/%'`
-       test "$dir" = "$arg" && dir=
+        # Find the relevant object directory and library name.
+        file=`echo "$arg" | sed 's%^.*/%%'`
+        dir=`echo "$arg" | sed 's%/[^/]*$%/%'`
+        test "$dir" = "$arg" && dir=
 
-       # Standard archive.
-       objs="$objs $arg"
-       ;;
+        # Standard archive.
+        objs="$objs $arg"
+        ;;
 
       *.lo)
-       # A library object.
-       libobjs="$libobjs $arg"
-       ;;
+        # A library object.
+        libobjs="$libobjs $arg"
+        ;;
 
       *.la)
-       # A libtool-controlled library.
-
-       dlname=
-       libdir=
-       library_names=
-       old_library=
-
-       # Check to see that this really is a libtool archive.
-       if egrep "^# Generated by ltmain.sh" $arg >/dev/null 2>&1; then :
-       else
-         echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
-         exit 1
-       fi
-
-       # If there is no directory component, then add one.
-       case "$arg" in
-       */*) . $arg ;;
-       *) . ./$arg ;;
-       esac
-
-       if test -z "$libdir"; then
-         echo "$progname: \`$arg' contains no -rpath information" 1>&2
-         exit 1
-       fi
-
-       # Get the name of the library we link against.
-       linklib=
-       for l in $old_library $library_names; do
-         linklib="$l"
-       done
-
-       if test -z "$linklib"; then
-         echo "$progname: cannot find name of link library for \`$arg'" 1>&2
-         exit 1
-       fi
-
-       # Find the relevant object directory and library name.
-       name=`echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
-       dir=`echo "$arg" | sed 's%/[^/]*$%%'`
-       if test "$dir" = "$arg"; then
-         dir="$objdir"
-       else
-         dir="$dir/$objdir"
-       fi
-
-       # This library was specified with -dlopen.
-       if test "$prev" = dlfiles; then
-         dlfiles="$dlfiles $arg"
-         if test -z "$dlname"; then
-           # If there is no dlname, we need to preload.
-           prev=dlprefiles
-         else
-           # We should not create a dependency on this library.
-           prev=
-           continue
-         fi
-       fi
-
-       # The library was specified with -dlpreopen.
-       if test "$prev" = dlprefiles; then
-         # Prefer using a static library (so that no silly _DYNAMIC symbols
-         # are required to link).
-         if test -n "$old_library"; then
-           dlprefiles="$dlprefiles $dir/$old_library"
-         else
-           dlprefiles="$dlprefiles $dir/$linklib"
-         fi
-         prev=
-       fi
-
-       if test "$build_libtool_libs" = yes && test -n "$library_names"; then
-         link_against_libtool_libs="$link_against_libtool_libs $arg"
-         if test -n "$shlibpath_var"; then
-           # Make sure the rpath contains only unique directories.
-           case "$temp_rpath " in
-           "* $dir *") ;;
-           *) temp_rpath="$temp_rpath $dir" ;;
-           esac
-         fi
+        # A libtool-controlled library.
 
-         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
-             hardcode_libdir_flag=`eval echo \"$hardcode_libdir_flag_spec\"`
-             compile_command="$compile_command $hardcode_libdir_flag"
-             finalize_command="$finalize_command $hardcode_libdir_flag"
-           fi
-         elif test "$hardcode_runpath_var" = yes; then
-           # Do the same for the permanent run path.
-           case "$perm_rpath " in
-           "* $libdir *") ;;
-           *) perm_rpath="$perm_rpath $libdir" ;;
-           esac
-         fi
+        dlname=
+        libdir=
+        library_names=
+        old_library=
+
+        # Check to see that this really is a libtool archive.
+        if egrep "^# Generated by ltmain.sh" $arg >/dev/null 2>&1; then :
+        else
+          echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
+          exit 1
+        fi
+
+        # If there is no directory component, then add one.
+        case "$arg" in
+        */*) . $arg ;;
+        *) . ./$arg ;;
+        esac
 
+        if test -z "$libdir"; then
+          echo "$progname: \`$arg' contains no -rpath information" 1>&2
+          exit 1
+        fi
 
-         case "$hardcode_action" in
-         immediate)
-           if test "$hardcode_direct" = no; then
-             compile_command="$compile_command $dir/$linklib"
-           elif test "$hardcode_minus_L" = no; then
-             compile_command="$compile_command -L$dir -l$name"
-           elif test "$hardcode_shlibpath_var" = no; then
-             compile_shlibpath="$compile_shlibpath$dir:"
-             compile_command="$compile_command -l$name"
-           fi
-           ;;
-
-         relink)
-           # We need an absolute path.
-           case "$dir" in
-           /*) ;;
-           *)
-             absdir=`cd "$dir" && pwd`
-             if test -z "$absdir"; then
-               echo "$progname: cannot determine absolute directory name of \`$dir'" 1>&2
-               exit 1
-             fi
-             dir="$absdir"
-             ;;
-           esac
-
-           if test "$hardcode_direct" = yes; then
-             compile_command="$compile_command $dir/$linklib"
-           elif test "$hardcode_minus_L" = yes; then
-             compile_command="$compile_command -L$dir -l$name"
-           elif test "$hardcode_shlibpath_var" = yes; then
-             compile_shlibpath="$compile_shlibpath$dir:"
-             compile_command="$compile_command -l$name"
-           fi
-           ;;
-
-         *)
-           echo "$progname: \`$hardcode_action' is an unknown hardcode action" 1>&2
-           exit 1
-           ;;
-         esac
-
-         # Finalize command for both is simple: just hardcode it.
-         if test "$hardcode_direct" = yes; then
-           finalize_command="$finalize_command $libdir/$linklib"
-         elif test "$hardcode_minus_L" = yes; then
-           finalize_command="$finalize_command -L$libdir -l$name"
-         elif test "$hardcode_shlibpath_var" = yes; then
-           finalize_shlibpath="$finalize_shlibpath$libdir:"
-           finalize_command="$finalize_command -l$name"
+        # Get the name of the library we link against.
+        linklib=
+        for l in $old_library $library_names; do
+          linklib="$l"
+        done
+
+        if test -z "$linklib"; then
+          echo "$progname: cannot find name of link library for \`$arg'" 1>&2
+          exit 1
+        fi
+
+        # Find the relevant object directory and library name.
+        name=`echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+        dir=`echo "$arg" | sed 's%/[^/]*$%%'`
+        if test "$dir" = "$arg"; then
+          dir="$objdir"
+        else
+          dir="$dir/$objdir"
+        fi
+
+        # This library was specified with -dlopen.
+        if test "$prev" = dlfiles; then
+          dlfiles="$dlfiles $arg"
+          if test -z "$dlname"; then
+            # If there is no dlname, we need to preload.
+            prev=dlprefiles
+          else
+            # We should not create a dependency on this library.
+            prev=
+            continue
+          fi
+        fi
+
+        # The library was specified with -dlpreopen.
+        if test "$prev" = dlprefiles; then
+          # Prefer using a static library (so that no silly _DYNAMIC symbols
+          # are required to link).
+          if test -n "$old_library"; then
+            dlprefiles="$dlprefiles $dir/$old_library"
+          else
+            dlprefiles="$dlprefiles $dir/$linklib"
+          fi
+          prev=
+        fi
+
+        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
+          link_against_libtool_libs="$link_against_libtool_libs $arg"
+          if test -n "$shlibpath_var"; then
+            # Make sure the rpath contains only unique directories.
+            case "$temp_rpath " in
+            "* $dir *") ;;
+            *) temp_rpath="$temp_rpath $dir" ;;
+            esac
+          fi
+
+
+          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
+              hardcode_libdir_flag=`eval echo \"$hardcode_libdir_flag_spec\"`
+              compile_command="$compile_command $hardcode_libdir_flag"
+              finalize_command="$finalize_command $hardcode_libdir_flag"
+            fi
+          elif test "$hardcode_runpath_var" = yes; then
+            # Do the same for the permanent run path.
+            case "$perm_rpath " in
+            "* $libdir *") ;;
+            *) perm_rpath="$perm_rpath $libdir" ;;
+            esac
+          fi
+
+
+          case "$hardcode_action" in
+          immediate)
+            if test "$hardcode_direct" = no; then
+              compile_command="$compile_command $dir/$linklib"
+            elif test "$hardcode_minus_L" = no; then
+              compile_command="$compile_command -L$dir -l$name"
+            elif test "$hardcode_shlibpath_var" = no; then
+              compile_shlibpath="$compile_shlibpath$dir:"
+              compile_command="$compile_command -l$name"
+            fi
+            ;;
+
+          relink)
+            # We need an absolute path.
+            case "$dir" in
+            /*) ;;
+            *)
+              absdir=`cd "$dir" && pwd`
+              if test -z "$absdir"; then
+                echo "$progname: cannot determine absolute directory name of \`$dir'" 1>&2
+                exit 1
+              fi
+              dir="$absdir"
+              ;;
+            esac
+
+            if test "$hardcode_direct" = yes; then
+              compile_command="$compile_command $dir/$linklib"
+            elif test "$hardcode_minus_L" = yes; then
+              compile_command="$compile_command -L$dir -l$name"
+            elif test "$hardcode_shlibpath_var" = yes; then
+              compile_shlibpath="$compile_shlibpath$dir:"
+              compile_command="$compile_command -l$name"
+            fi
+            ;;
+
+          *)
+            echo "$progname: \`$hardcode_action' is an unknown hardcode action" 1>&2
+            exit 1
+            ;;
+          esac
+
+          # Finalize command for both is simple: just hardcode it.
+          if test "$hardcode_direct" = yes; then
+            finalize_command="$finalize_command $libdir/$linklib"
+          elif test "$hardcode_minus_L" = yes; then
+            finalize_command="$finalize_command -L$libdir -l$name"
+          elif test "$hardcode_shlibpath_var" = yes; then
+            finalize_shlibpath="$finalize_shlibpath$libdir:"
+            finalize_command="$finalize_command -l$name"
           else
             # We can't seem to hardcode it, guess we'll fake it.
-           finalize_command="$finalize_command -L$libdir -l$name"
-         fi
+            finalize_command="$finalize_command -L$libdir -l$name"
+          fi
         else
           # Transform directly to old archives if we don't build new libraries.
           if test -n "$pic_flag" && test -z "$old_library"; then
             echo "$progname: cannot find static library for \`$arg'" 1>&2
-           exit 1
+            exit 1
+          fi
+          test -n "$old_library" && linklib="$old_library"
+
+         if test "$hardcode_direct" != unsupported; then
+           compile_command="$compile_command $dir/$linklib"
+           finalize_command="$finalize_command $dir/$linklib"
+         else
+           # Here we assume that "$hardcode_minusL" != unsupported.
+           compile_command="$compile_command -L$dir -l$name"
+           finalize_command="$finalize_command -L$dir -l$name"
          fi
-         test -n "$old_library" && linklib="$old_library"
-          compile_command="$compile_command $dir/$linklib"
-         finalize_command="$finalize_command $dir/$linklib"
         fi
-       continue
-       ;;
+        continue
+        ;;
 
       *)
         echo "$progname: unknown file suffix for \`$arg'" 1>&2
-       echo "$help" 1>&2
-       exit 1
-       ;;
+        echo "$help" 1>&2
+        exit 1
+        ;;
       esac
 
       compile_command="$compile_command $arg"
@@ -664,37 +672,37 @@ if test -z "$show_help"; then
       age=0
 
       if test -n "$objs"; then
-       echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
-       exit 1
+        echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+        exit 1
       fi
 
       # How the heck are we supposed to write a wrapper for a shared library?
       if test -n "$link_against_libtool_libs"; then
         echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
-       exit 1
+        exit 1
       fi
 
       if test -n "$dlfiles$dlprefiles"; then
-       echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
-       # Nullify the symbol file.
-       compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
-       finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+        echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
+        # Nullify the symbol file.
+        compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
+        finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
       fi
 
       if test -z "$install_libdir"; then
-       echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
-       exit 1
+        echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
+        exit 1
       fi
 
       # Parse the version information argument.
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=':'
+      IFS="${IFS=       }"; save_ifs="$IFS"; IFS=':'
       set dummy $vinfo
       IFS="$save_ifs"
 
       if test -n "$5"; then
         echo "$progname: too many parameters to \`-version-info'" 1>&2
-       echo "$help" 1>&2
-       exit 1
+        echo "$help" 1>&2
+        exit 1
       fi
 
       test -n "$2" && current="$2"
@@ -705,28 +713,28 @@ if test -z "$show_help"; then
       case "$current" in
       0 | [1-9] | [1-9][0-9]*) ;;
       *)
-       echo "$progname: CURRENT \`$current' is not a nonnegative integer" 1>&2
+        echo "$progname: CURRENT \`$current' is not a nonnegative integer" 1>&2
         echo "$progname: \`$vinfo' is not valid version information" 1>&2
         exit 1
-       ;;
+        ;;
       esac
 
       case "$revision" in
       0 | [1-9] | [1-9][0-9]*) ;;
       *)
-       echo "$progname: REVISION \`$revision' is not a nonnegative integer" 1>&2
+        echo "$progname: REVISION \`$revision' is not a nonnegative integer" 1>&2
         echo "$progname: \`$vinfo' is not valid version information" 1>&2
         exit 1
-       ;;
+        ;;
       esac
 
       case "$age" in
       0 | [1-9] | [1-9][0-9]*) ;;
       *)
-       echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
+        echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
         echo "$progname: \`$vinfo' is not valid version information" 1>&2
         exit 1
-       ;;
+        ;;
       esac
 
       if test $age -gt $current; then
@@ -741,40 +749,40 @@ if test -z "$show_help"; then
       none) ;;
 
       linux)
-       version_vars="$version_vars major versuffix"
-       major=`expr $current - $age`
-       versuffix="$major.$age.$revision"
-       ;;
+        version_vars="$version_vars major versuffix"
+        major=`expr $current - $age`
+        versuffix="$major.$age.$revision"
+        ;;
 
       osf)
-       version_vars="$version_vars versuffix verstring"
-       major=`expr $current - $age`
-       versuffix="$current.$age.$revision"
-       verstring="$versuffix"
-
-       # Add in all the interfaces that we are compatible with.
-       loop=$age
-       while test $loop != 0; do
-         iface=`expr $current - $loop`
-         loop=`expr $loop - 1`
-         verstring="$verstring:${iface}.0"
-       done
-
-       # Make executables depend on our current version.
-       verstring="$verstring:${current}.0"
-       ;;
+        version_vars="$version_vars versuffix verstring"
+        major=`expr $current - $age`
+        versuffix="$current.$age.$revision"
+        verstring="$versuffix"
+
+        # Add in all the interfaces that we are compatible with.
+        loop=$age
+        while test $loop != 0; do
+          iface=`expr $current - $loop`
+          loop=`expr $loop - 1`
+          verstring="$verstring:${iface}.0"
+        done
+
+        # Make executables depend on our current version.
+        verstring="$verstring:${current}.0"
+        ;;
 
       sunos)
-       version_vars="$version_vars major versuffix"
-       major="$current"
-       versuffix="$current.$revision"
-       ;;
+        version_vars="$version_vars major versuffix"
+        major="$current"
+        versuffix="$current.$revision"
+        ;;
 
       *)
-       echo "$progname: unknown library version type \`$version_type'" 1>&2
-       echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-       exit 1
-       ;;
+        echo "$progname: unknown library version type \`$version_type'" 1>&2
+        echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+        exit 1
+        ;;
       esac
 
       # Create the output directory, or remove our outputs if we need to.
@@ -783,82 +791,82 @@ if test -z "$show_help"; then
         $run $rm $objdir/$libname.*
       else
         $show "$mkdir $objdir"
-       $run $mkdir $objdir || exit $?
+        $run $mkdir $objdir || exit $?
       fi
 
       # Check to see if the archive will have undefined symbols.
       if test "$allow_undefined" = yes; then
-       if test "$allow_undefined_flag" = unsupported; then
-         echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2
-         build_libtool_libs=no
-       fi
+        if test "$allow_undefined_flag" = unsupported; then
+          echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+          build_libtool_libs=no
+        fi
       else
-       # Clear the flag.
-       allow_undefined_flag=
+        # Clear the flag.
+        allow_undefined_flag=
       fi
 
       if test "$build_libtool_libs" = yes; then
-       # Get the real and link names of the library.
-       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\"`
-       else
-         soname="$realname"
-       fi
-
-       lib="$objdir/$realname"
-       linknames=
-       for link
-       do
-         linknames="$linknames $link"
-       done
-
-       # Use standard objects if they are PIC.
-       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\"`
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
-       for cmd in $cmds; do
-         IFS="$save_ifs"
-         $show "$cmd"
-         $run eval "$cmd" || exit $?
-       done
-       IFS="$save_ifs"
-
-       # Create links to the real library.
-       for link in $linknames; do
-         $show "(cd $objdir && $LN_S $realname $link)"
-         $run eval '(cd $objdir && $LN_S $realname $link)' || exit $?
-       done
-
-       # If -export-dynamic was specified, set the dlname.
-       if test "$export_dynamic" = yes; then
-         # On all known operating systems, these are identical.
-         dlname="$soname"
-       fi
+        # Get the real and link names of the library.
+        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\"`
+        else
+          soname="$realname"
+        fi
+
+        lib="$objdir/$realname"
+        linknames=
+        for link
+        do
+          linknames="$linknames $link"
+        done
+
+        # Use standard objects if they are PIC.
+        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\"`
+        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
+        for cmd in $cmds; do
+          IFS="$save_ifs"
+          $show "$cmd"
+          $run eval "$cmd" || exit $?
+        done
+        IFS="$save_ifs"
+
+        # Create links to the real library.
+        for link in $linknames; do
+          $show "(cd $objdir && $LN_S $realname $link)"
+          $run eval '(cd $objdir && $LN_S $realname $link)' || exit $?
+        done
+
+        # If -export-dynamic was specified, set the dlname.
+        if test "$export_dynamic" = yes; then
+          # On all known operating systems, these are identical.
+          dlname="$soname"
+        fi
       fi
       ;;
 
     *.lo | *.o)
       if test -n "$link_against_libtool_libs"; then
-       echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
-       exit 1
+        echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
+        exit 1
       fi
 
       if test -n "$deplibs"; then
-       echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
+        echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
       fi
 
       if test -n "$dlfiles$dlprefiles"; then
-       echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2
-       # Nullify the symbol file.
-       compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
-       finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+        echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2
+        # Nullify the symbol file.
+        compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
+        finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
       fi
 
       if test -n "$install_libdir"; then
@@ -866,37 +874,37 @@ if test -z "$show_help"; then
       fi
 
       if test -n "$vinfo"; then
-       echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
+        echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
       fi
 
       case "$output" in
       *.lo)
-       if test -n "$objs"; then
-         echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
-         exit 1
-       fi
-       libobj="$output"
-       obj=`echo "$output" | sed 's/\.lo$/.o/'`
-       ;;
+        if test -n "$objs"; then
+          echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
+          exit 1
+        fi
+        libobj="$output"
+        obj=`echo "$output" | sed 's/\.lo$/.o/'`
+        ;;
       *)
         libobj=
-       obj="$output"
-       ;;
+        obj="$output"
+        ;;
       esac
 
       # Delete the old objects.
       $run $rm $obj $libobj
 
       # Create the old-style object.
-      reload_objs="$objs"`echo "$libobjs " | sed -e 's/[^      ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+      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\"`
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
       for cmd in $cmds; do
         IFS="$save_ifs"
         $show "$cmd"
-       $run eval "$cmd" || exit $?
+        $run eval "$cmd" || exit $?
       done
       IFS="$save_ifs"
 
@@ -906,17 +914,17 @@ if test -z "$show_help"; then
       if test "$build_libtool_libs" != yes; 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 $?
-       exit 0
+        $show "echo timestamp > $libobj"
+        $run eval "echo timestamp > $libobj" || exit $?
+        exit 0
       fi
 
       if test -n "$pic_flag"; then
-       # Only do commands if we really have different PIC objects.
-       reload_objs="$libobjs"
-       output="$libobj"
+        # Only do commands if we really have different PIC objects.
+        reload_objs="$libobjs"
+        output="$libobj"
         cmds=`eval echo \"$reload_cmds\"`
-        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
+        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
         for cmd in $cmds; do
           IFS="$save_ifs"
           $show "$cmd"
@@ -938,34 +946,34 @@ if test -z "$show_help"; then
       fi
 
       if test -n "$vinfo"; then
-       echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
+        echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
       fi
 
       if test -n "$libobjs"; 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/ $//'`
+        # 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/ $//'`
       fi
 
       if test "$export_dynamic" = yes && test -n "$global_symbol_pipe" && test -n "$NM"; then
-       # Add our own program objects to the preloaded list.
-       dlprefiles=`echo "$objs$libobjs$dlprefiles " | sed -e 's/\.lo /.o/g' -e 's/ $//'`
+        # Add our own program objects to the preloaded list.
+        dlprefiles=`echo "$objs$libobjs$dlprefiles " | sed -e 's/\.lo /.o/g' -e 's/ $//'`
 
         # Discover the nlist of each of the dlfiles.
-       dlsyms="$objdir/${output}S.c"
-       nlist="$objdir/${output}.nm"
+        dlsyms="$objdir/${output}S.c"
+        nlist="$objdir/${output}.nm"
 
-       $run rm -f "$nlist" "$nlist"T
-       for arg in $dlprefiles; do
-         echo "extracting global symbols from \`$arg'"
-         $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-       done
+        $run rm -f "$nlist" "$nlist"T
+        for arg in $dlprefiles; do
+          echo "extracting global symbols from \`$arg'"
+          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+        done
 
-       # Parse the name list into a C file.
-       echo "creating $dlsyms"
-       if test -z "$run"; then
-         # Try sorting and uniquifying the output.
-         sort "$nlist" | uniq > "$nlist"T && mv -f "$nlist"T "$nlist"
+        # Parse the name list into a C file.
+        echo "creating $dlsyms"
+        if test -z "$run"; then
+          # Try sorting and uniquifying the output.
+          sort "$nlist" | uniq > "$nlist"T && mv -f "$nlist"T "$nlist"
 
           cat <<EOF > "$dlsyms"
 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
@@ -973,14 +981,14 @@ if test -z "$show_help"; then
 
 /* External symbol declarations for the compiler. */
 EOF
-         if test -f "$nlist"; then
-           # Prevent the only kind of circular reference mistake we can make.
-           sed -e '/ dld_preloaded_symbols$/d' -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$dlsyms"
-         else
-           echo "/* NONE */" >> "$dlsyms"
-         fi
+          if test -f "$nlist"; then
+            # Prevent the only kind of circular reference mistake we can make.
+            sed -e '/ dld_preloaded_symbols$/d' -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$dlsyms"
+          else
+            echo "/* NONE */" >> "$dlsyms"
+          fi
 
-         cat <<\EOF >> "$dlsyms"
+          cat <<\EOF >> "$dlsyms"
 
 #if defined (__STDC__) && __STDC__
 # define __ptr_t void *
@@ -997,56 +1005,56 @@ dld_preloaded_symbols[] =
 {
 EOF
 
-         if test -f "$nlist"; then
-           sed 's/^\(.*\) \(.*\)$/  {"\1", \&\2},/' < "$nlist" >> "$dlsyms"
-         fi
+          if test -f "$nlist"; then
+            sed 's/^\(.*\) \(.*\)$/  {"\1", \&\2},/' < "$nlist" >> "$dlsyms"
+          fi
 
           cat <<\EOF >> "$dlsyms"
   {0},
 };
 EOF
-       fi
-       $run rm -f "$nlist" "$nlist"T
+        fi
+        $run rm -f "$nlist" "$nlist"T
 
-       # Now compile the dynamic symbol file.
-       $show "(cd $objdir && $CC -c$no_builtin_flag \"${output}S.c\")"
-       $run eval '(cd $objdir && $CC -c$no_builtin_flag "${output}S.c")' || exit $?
+        # Now compile the dynamic symbol file.
+        $show "(cd $objdir && $CC -c$no_builtin_flag \"${output}S.c\")"
+        $run eval '(cd $objdir && $CC -c$no_builtin_flag "${output}S.c")' || exit $?
 
-       # Transform the symbol file into the correct name.
-       compile_command=`echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
-       finalize_command=`echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
+        # Transform the symbol file into the correct name.
+        compile_command=`echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
+        finalize_command=`echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
       elif test "$export_dynamic" != yes; then
         test -n "$dlfiles$dlprefiles" && echo "$progname: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
       else
-       # We keep going just in case the user didn't refer to
-       # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
-       # really was required.
-       echo "$progname: not configured to extract global symbols from dlpreopened files" 1>&2
-
-       # Nullify the symbol file.
-       compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
-       finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+        # We keep going just in case the user didn't refer to
+        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
+        # really was required.
+        echo "$progname: not configured to extract global symbols from dlpreopened files" 1>&2
+
+        # Nullify the symbol file.
+        compile_command=`echo "$compile_command" | sed "s% @SYMFILE@%%"`
+        finalize_command=`echo "$finalize_command" | sed "s% @SYMFILE@%%"`
       fi
 
       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
-       # Replace the output file specification.
-       compile_command=`echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
-       finalize_command=`echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
-
-       # We have no uninstalled library dependencies, so finalize right now.
-       $show "$compile_command"
-       $run $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 $compile_command
-         status=$?
-       fi
-       exit $status
+        # Replace the output file specification.
+        compile_command=`echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
+        finalize_command=`echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
+
+        # We have no uninstalled library dependencies, so finalize right now.
+        $show "$compile_command"
+        $run $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 $compile_command
+          status=$?
+        fi
+        exit $status
       fi
 
       # Replace the output file specification.
@@ -1062,48 +1070,48 @@ EOF
 
       if test -n "$shlibpath_var"; then
         # We should set the shlibpath_var
-       rpath=
-       for dir in $temp_rpath; do
-         case "$dir" in
-         /*)
-           # Absolute path.
-           rpath="$rpath$dir:"
-           ;;
-         *)
-           # Relative path: add a thisdir entry.
-           rpath="$rpath\$thisdir/$dir:"
-           ;;
-         esac
-       done
-       temp_rpath="$rpath"
+        rpath=
+        for dir in $temp_rpath; do
+          case "$dir" in
+          /*)
+            # Absolute path.
+            rpath="$rpath$dir:"
+            ;;
+          *)
+            # Relative path: add a thisdir entry.
+            rpath="$rpath\$thisdir/$dir:"
+            ;;
+          esac
+        done
+        temp_rpath="$rpath"
       fi
 
       # Delete the old output file.
       $run $rm $output
 
       if test -n "$compile_shlibpath"; then
-       compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
+        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
       fi
       if test -n "$finalize_shlibpath"; then
-       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
       fi
 
       if test -n "$perm_rpath"; then
-       # We should set the runpath_var.
-       rpath=
-       for dir in $perm_rpath; do
-         rpath="$rpath$dir:"
-       done
-       compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
-       finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
+        # We should set the runpath_var.
+        rpath=
+        for dir in $perm_rpath; do
+          rpath="$rpath$dir:"
+        done
+        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
+        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
       fi
 
       case "$hardcode_action" in
       relink)
-       # AGH! Flame the AIX and HP-UX people for me, will ya?
-       echo "$progname: warning: using a buggy system linker" 1>&2
-       echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
-       ;;
+        # AGH! Flame the AIX and HP-UX people for me, will ya?
+        echo "$progname: warning: using a buggy system linker" 1>&2
+        echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
+        ;;
       esac
 
       $show "$compile_command"
@@ -1114,10 +1122,10 @@ EOF
 
       # Only actually do things if our run command is non-null.
       if test -z "$run"; then
-       $rm $output
-       trap "$rm $output; exit 1" 1 2 15
+        $rm $output
+        trap "$rm $output; exit 1" 1 2 15
 
-       cat > $output <<EOF
+        cat > $output <<EOF
 #! /bin/sh
 
 # $output - temporary wrapper script for $objdir/$output
@@ -1163,9 +1171,9 @@ else
     export PATH
 EOF
 
-       # Export our shlibpath_var if we have one.
-       if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-         cat >> $output <<EOF
+        # Export our shlibpath_var if we have one.
+        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+          cat >> $output <<EOF
 
     # Add our own library path to $shlibpath_var
     $shlibpath_var="$temp_rpath\$$shlibpath_var"
@@ -1175,7 +1183,7 @@ EOF
 
     export $shlibpath_var
 EOF
-       fi
+        fi
 
         cat >> $output <<EOF
 
@@ -1192,7 +1200,7 @@ EOF
   fi
 fi
 EOF
-       chmod +x $output
+        chmod +x $output
       fi
       exit 0
       ;;
@@ -1205,23 +1213,23 @@ EOF
       oldlib="$objdir/$libname.a"
 
       # Transform .lo files to .o files.
-      oldobjs="$objs"`echo "$libobjs " | sed -e 's/[^  ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+      oldobjs="$objs"`echo "$libobjs " | sed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
 
       if test -d "$objdir"; then
-       $show "$rm $oldlib"
-       $run $rm $oldlib
+        $show "$rm $oldlib"
+        $run $rm $oldlib
       else
-       $show "$mkdir $objdir"
-       $run $mkdir $objdir
+        $show "$mkdir $objdir"
+        $run $mkdir $objdir
       fi
 
       # Do each command in the archive commands.
       cmds=`eval echo \"$old_archive_cmds\"`
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
       for cmd in $cmds; do
         IFS="$save_ifs"
         $show "$cmd"
-       $run eval "$cmd" || exit $?
+        $run eval "$cmd" || exit $?
       done
       IFS="$save_ifs"
     fi
@@ -1236,7 +1244,7 @@ EOF
 
       # Only create the output if not a dry run.
       if test -z "$run"; then
-       cat > $output <<EOF
+        cat > $output <<EOF
 # $output - a libtool library file
 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
 
@@ -1287,8 +1295,8 @@ EOF
     do
       if test -n "$dest"; then
         files="$files $dest"
-       dest="$arg"
-       continue
+        dest="$arg"
+        continue
       fi
 
       case "$arg" in
@@ -1298,19 +1306,19 @@ EOF
       -m) prev="-m" ;;
       -o) prev="-o" ;;
       -s)
-       stripme=" -s"
-       continue
-       ;;
+        stripme=" -s"
+        continue
+        ;;
       -*) ;;
 
       *)
-       # If the previous option needed an argument, then skip it.
-       if test -n "$prev"; then
-         prev=
-       else
-         dest="$arg"
-         continue
-       fi
+        # If the previous option needed an argument, then skip it.
+        if test -n "$prev"; then
+          prev=
+        else
+          dest="$arg"
+          continue
+        fi
         ;;
       esac
       install_prog="$install_prog $arg"
@@ -1332,7 +1340,7 @@ EOF
       if test -z "$dest"; then
         echo "$progname: no file or destination specified" 1>&2
       else
-       echo "$progname: you must specify a destination" 1>&2
+        echo "$progname: you must specify a destination" 1>&2
       fi
       echo "$help" 1>&2
       exit 1
@@ -1356,21 +1364,21 @@ EOF
       if test $# -gt 2; then
         echo "$progname: \`$dest' is not a directory" 1>&2
         echo "$help" 1>&2
-       exit 1
+        exit 1
       fi
     fi
     case "$destdir" in
     /*) ;;
     *)
       for file in $files; do
-       case "$file" in
-       *.lo) ;;
-       *)
-         echo "$progname: \`$destdir' must be an absolute directory name" 1>&2
-         echo "$help" 1>&2
-         exit 1
-         ;;
-       esac
+        case "$file" in
+        *.lo) ;;
+        *)
+          echo "$progname: \`$destdir' must be an absolute directory name" 1>&2
+          echo "$help" 1>&2
+          exit 1
+          ;;
+        esac
       done
       ;;
     esac
@@ -1383,69 +1391,69 @@ EOF
       # Do each installation.
       case "$file" in
       *.a)
-       # Do the static libraries later.
-       staticlibs="$staticlibs $file"
-       ;;
+        # Do the static libraries later.
+        staticlibs="$staticlibs $file"
+        ;;
 
       *.la)
-       # Check to see that this really is a libtool archive.
-       if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
-       else
-         echo "$progname: \`$file' is not a valid libtool archive" 1>&2
-         echo "$help" 1>&2
-         exit 1
-       fi
-
-       library_names=
-       old_library=
-       # If there is no directory component, then add one.
-       case "$file" in
-       */*) . $file ;;
-       *) . ./$file ;;
-       esac
-
-       # Add the libdir to current_libdirs if it is the destination.
-       if test "$destdir" = "$libdir"; then
-         case "$current_libdirs " in
-         "* $libdir *") ;;
-         *) current_libdirs="$current_libdirs $libdir" ;;
-         esac
-       else
-         # Note the libdir as a future libdir.
-         case "$future_libdirs " in
-         "* $libdir *") ;;
-         *) future_libdirs="$future_libdirs $libdir" ;;
-         esac
-       fi
-
-       dir="`echo "$file" | sed 's%/[^/]*$%%'`/"
-       test "$dir" = "$file/" && dir=
-       dir="$dir$objdir"
-
-       # See the names of the shared library.
-       set dummy $library_names
-       if test -n "$2"; then
-         realname="$2"
-         shift
-         shift
-
-         # Install the shared library and build the symlinks.
-         $show "$install_prog $dir/$realname $destdir/$realname"
-         $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
-         test "X$dlname" = "X$realname" && dlname=
-
-         # Support stripping libraries.
-         if test -n "$stripme"; then
-           if test -n "$striplib"; then
-             $show "$striplib $destdir/$realname"
-             $run $striplib $destdir/$realname || exit $?
-           else
-             echo "$progname: warning: no library stripping program" 1>&2
-           fi
-         fi
+        # Check to see that this really is a libtool archive.
+        if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
+        else
+          echo "$progname: \`$file' is not a valid libtool archive" 1>&2
+          echo "$help" 1>&2
+          exit 1
+        fi
+
+        library_names=
+        old_library=
+        # If there is no directory component, then add one.
+        case "$file" in
+        */*) . $file ;;
+        *) . ./$file ;;
+        esac
 
-         if test $# -gt 0; then
-           # Delete the old symlinks.
+        # Add the libdir to current_libdirs if it is the destination.
+        if test "$destdir" = "$libdir"; then
+          case "$current_libdirs " in
+          "* $libdir *") ;;
+          *) current_libdirs="$current_libdirs $libdir" ;;
+          esac
+        else
+          # Note the libdir as a future libdir.
+          case "$future_libdirs " in
+          "* $libdir *") ;;
+          *) future_libdirs="$future_libdirs $libdir" ;;
+          esac
+        fi
+
+        dir="`echo "$file" | sed 's%/[^/]*$%%'`/"
+        test "$dir" = "$file/" && dir=
+        dir="$dir$objdir"
+
+        # See the names of the shared library.
+        set dummy $library_names
+        if test -n "$2"; then
+          realname="$2"
+          shift
+          shift
+
+          # Install the shared library and build the symlinks.
+          $show "$install_prog $dir/$realname $destdir/$realname"
+          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
+          test "X$dlname" = "X$realname" && dlname=
+
+          # Support stripping libraries.
+          if test -n "$stripme"; then
+            if test -n "$striplib"; then
+              $show "$striplib $destdir/$realname"
+              $run $striplib $destdir/$realname || exit $?
+            else
+              echo "$progname: warning: no library stripping program" 1>&2
+            fi
+          fi
+
+          if test $# -gt 0; then
+            # Delete the old symlinks.
             rmcmd="$rm"
             for linkname
             do
@@ -1454,155 +1462,155 @@ EOF
             $show "$rmcmd"
             $run $rmcmd
 
-           # ... and create new ones.
-           for linkname
-           do
-             test "X$dlname" = "X$linkname" && dlname=
-             $show "(cd $destdir && $LN_S $realname $linkname)"
-             $run eval "(cd $destdir && $LN_S $realname $linkname)"
-           done
-         fi
+            # ... and create new ones.
+            for linkname
+            do
+              test "X$dlname" = "X$linkname" && dlname=
+              $show "(cd $destdir && $LN_S $realname $linkname)"
+              $run eval "(cd $destdir && $LN_S $realname $linkname)"
+            done
+          fi
+
+          if test -n "$dlname"; then
+            # Install the dynamically-loadable library.
+            $show "$install_prog $dir/$dlname $destdir/$dlname"
+            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
+          fi
+
+          # Do each command in the postinstall commands.
+          lib="$destdir/$realname"
+          cmds=`eval echo \"$postinstall_cmds\"`
+          IFS="${IFS=   }"; save_ifs="$IFS"; IFS=';'
+          for cmd in $cmds; do
+            IFS="$save_ifs"
+            $show "$cmd"
+            $run eval "$cmd" || exit $?
+          done
+          IFS="$save_ifs"
+        fi
 
-         if test -n "$dlname"; then
-           # Install the dynamically-loadable library.
-           $show "$install_prog $dir/$dlname $destdir/$dlname"
-           $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
-         fi
+        # Install the pseudo-library for information purposes.
+        name=`echo "$file" | sed 's%^.*/%%'`
+        $show "$install_prog $file $destdir/$name"
+        $run $install_prog $file $destdir/$name || exit $?
 
-         # Do each command in the postinstall commands.
-         lib="$destdir/$realname"
-         cmds=`eval echo \"$postinstall_cmds\"`
-         IFS="${IFS=   }"; save_ifs="$IFS"; IFS=';'
-         for cmd in $cmds; do
-           IFS="$save_ifs"
-           $show "$cmd"
-           $run eval "$cmd" || exit $?
-         done
-         IFS="$save_ifs"
-       fi
-
-       # Install the pseudo-library for information purposes.
-       name=`echo "$file" | sed 's%^.*/%%'`
-       $show "$install_prog $file $destdir/$name"
-       $run $install_prog $file $destdir/$name || exit $?
-
-       # Maybe install the static library, too.
-       test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-       ;;
+        # Maybe install the static library, too.
+        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+        ;;
 
       *.lo)
         # Install (i.e. copy) a libtool object.
 
         # Figure out destination file name, if it wasn't already specified.
         if test -n "$destname"; then
-         destfile="$destdir/$destname"
-       else
-         destfile=`echo "$file" | sed 's%^.*/%%'`
-         destfile="$destdir/$destfile"
+          destfile="$destdir/$destname"
+        else
+          destfile=`echo "$file" | sed 's%^.*/%%'`
+          destfile="$destdir/$destfile"
         fi
 
-       # Deduce the name of the destination old-style object file.
-       case "$destfile" in
-       *.lo)
-         staticdest=`echo "$destfile" | sed 's/\.lo$/\.o/'`
-         ;;
-       *.o)
-         staticdest="$destfile"
-         destfile=
-         ;;
-       *)
-         echo "$progname: cannot copy a libtool object to \`$destfile'" 1>&2
-         echo "$help" 1>&2
-         exit 1
+        # Deduce the name of the destination old-style object file.
+        case "$destfile" in
+        *.lo)
+          staticdest=`echo "$destfile" | sed 's/\.lo$/\.o/'`
+          ;;
+        *.o)
+          staticdest="$destfile"
+          destfile=
           ;;
-       esac
+        *)
+          echo "$progname: cannot copy a libtool object to \`$destfile'" 1>&2
+          echo "$help" 1>&2
+          exit 1
+          ;;
+        esac
 
-       # Install the libtool object if requested.
-       if test -n "$destfile"; then
-         $show "$install_prog $file $destfile"
-         $run $install_prog $file $destfile || exit $?
-       fi
+        # Install the libtool object if requested.
+        if test -n "$destfile"; then
+          $show "$install_prog $file $destfile"
+          $run $install_prog $file $destfile || exit $?
+        fi
 
-       # Install the old object if enabled.
-       if test "$build_old_libs" = yes; then
-         # Deduce the name of the old-style object file.
-         staticobj=`echo "$file" | sed 's/\.lo$/\.o/'`
+        # Install the old object if enabled.
+        if test "$build_old_libs" = yes; then
+          # Deduce the name of the old-style object file.
+          staticobj=`echo "$file" | sed 's/\.lo$/\.o/'`
 
-         $show "$install_prog $staticobj $staticdest"
-         $run $install_prog $staticobj $staticdest || exit $?
-       fi
-       exit 0
-       ;;
+          $show "$install_prog $staticobj $staticdest"
+          $run $install_prog $staticobj $staticdest || exit $?
+        fi
+        exit 0
+        ;;
 
       *)
-       # Do a test to see if this is really a libtool program.
-       if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
-         # This variable tells wrapper scripts just to set variables rather
-         # than running their programs.
-         libtool_install_magic="$magic"
-         link_against_libtool_libs=
-         finalize_command=
-
-         # If there is no directory component, then add one.
-         case "$file" in
-         */*) . $file ;;
-         *) . ./$file ;;
-         esac
-
-         # Check the variables that should have been set.
-         if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
-           echo "$progname: invalid libtool wrapper script \`$file'" 1>&2
-           exit 1
-         fi
+        # Do a test to see if this is really a libtool program.
+        if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
+          # This variable tells wrapper scripts just to set variables rather
+          # than running their programs.
+          libtool_install_magic="$magic"
+          link_against_libtool_libs=
+          finalize_command=
+
+          # If there is no directory component, then add one.
+          case "$file" in
+          */*) . $file ;;
+          *) . ./$file ;;
+          esac
 
-         finalize=yes
-         for lib in $link_against_libtool_libs; do
-           # Check to see that each library is installed.
-           libdir=
-           if test -f "$lib"; then
-             # If there is no directory component, then add one.
-             case "$lib" in
-             */*) . $lib ;;
-             *) . ./$lib ;;
-             esac
-           fi
-           libfile="$libdir/`echo "$lib" | sed 's%^.*/%%g'`"
-           if test -z "$libdir"; then
-             echo "$progname: warning: \`$lib' contains no -rpath information" 1>&2
-           elif test -f "$libfile"; then :
-           else
-             echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-             finalize=no
-           fi
-         done
-
-         if test "$hardcode_action" = relink; then
-           if test "$finalize" = yes; then
-             echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
-             $show "$finalize_command"
-             if $run $finalize_command; then :
-             else
-               echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
-               continue
-             fi
-             file="$objdir/$file"T
-           else
-             echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
-           fi
-         else
-           # Install the binary that we compiled earlier.
-           dir=`echo "$file" | sed 's%/[^/]*$%%'`
-           if test "$file" = "$dir"; then
-             file="$objdir/$file"
-           else
-             file="$dir/$objdir/`echo "$file" | sed 's%^.*/%%'`"
-           fi
-         fi
-       fi
+          # Check the variables that should have been set.
+          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
+            echo "$progname: invalid libtool wrapper script \`$file'" 1>&2
+            exit 1
+          fi
+
+          finalize=yes
+          for lib in $link_against_libtool_libs; do
+            # Check to see that each library is installed.
+            libdir=
+            if test -f "$lib"; then
+              # If there is no directory component, then add one.
+              case "$lib" in
+              */*) . $lib ;;
+              *) . ./$lib ;;
+              esac
+            fi
+            libfile="$libdir/`echo "$lib" | sed 's%^.*/%%g'`"
+            if test -z "$libdir"; then
+              echo "$progname: warning: \`$lib' contains no -rpath information" 1>&2
+            elif test -f "$libfile"; then :
+            else
+              echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+              finalize=no
+            fi
+          done
+
+          if test "$hardcode_action" = relink; then
+            if test "$finalize" = yes; then
+              echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
+              $show "$finalize_command"
+              if $run $finalize_command; then :
+              else
+                echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
+                continue
+              fi
+              file="$objdir/$file"T
+            else
+              echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
+            fi
+          else
+            # Install the binary that we compiled earlier.
+            dir=`echo "$file" | sed 's%/[^/]*$%%'`
+            if test "$file" = "$dir"; then
+              file="$objdir/$file"
+            else
+              file="$dir/$objdir/`echo "$file" | sed 's%^.*/%%'`"
+            fi
+          fi
+        fi
 
-       $show "$install_prog$stripme $file $dest"
-       $run $install_prog$stripme $file $dest || exit $?
-       ;;
+        $show "$install_prog$stripme $file $dest"
+        $run $install_prog$stripme $file $dest || exit $?
+        ;;
       esac
     done
 
@@ -1617,17 +1625,17 @@ EOF
 
       # Support stripping libraries.
       if test -n "$stripme"; then
-       if test -n "$old_striplib"; then
-         $show "$old_striplib $oldlib"
-         $run $old_striplib $oldlib || exit $?
-       else
-         echo "$progname: warning: no static library stripping program" 1>&2
-       fi
+        if test -n "$old_striplib"; then
+          $show "$old_striplib $oldlib"
+          $run $old_striplib $oldlib || exit $?
+        else
+          echo "$progname: warning: no static library stripping program" 1>&2
+        fi
       fi
 
       # Do each command in the postinstall commands.
       cmds=`eval echo \"$old_postinstall_cmds\"`
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
       for cmd in $cmds; do
         IFS="$save_ifs"
         $show "$cmd"
@@ -1658,19 +1666,19 @@ EOF
     if test -n "$finish_cmds" && test -n "$libdirs"; then
       for dir
       do
-       libdirs="$libdirs $dir"
+        libdirs="$libdirs $dir"
       done
 
       for libdir in $libdirs; do
-       # Do each command in the postinstall commands.
-       cmds=`eval echo \"$finish_cmds\"`
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
-       for cmd in $cmds; do
-         IFS="$save_ifs"
-         $show "$cmd"
-         $run eval "$cmd"
-       done
-       IFS="$save_ifs"
+        # Do each command in the postinstall commands.
+        cmds=`eval echo \"$finish_cmds\"`
+        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
+        for cmd in $cmds; do
+          IFS="$save_ifs"
+          $show "$cmd"
+          $run eval "$cmd"
+        done
+        IFS="$save_ifs"
       done
     fi
 
@@ -1711,28 +1719,28 @@ EOF
 
       case "$name" in
       *.la)
-       # Possibly a libtool archive, so verify it.
-       if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
-         . $dir/$name
-
-         # Delete the libtool libraries and symlinks.
-         for n in $library_names; do
-           rmfiles="$rmfiles $dir/$n"
-           test "X$n" = "X$dlname" && dlname=
-         done
-         test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
-         test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
-
-         # FIXME: should reinstall the best remaining shared library.
-       fi
-       ;;
+        # Possibly a libtool archive, so verify it.
+        if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
+          . $dir/$name
+
+          # Delete the libtool libraries and symlinks.
+          for n in $library_names; do
+            rmfiles="$rmfiles $dir/$n"
+            test "X$n" = "X$dlname" && dlname=
+          done
+          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
+          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
+
+          # FIXME: should reinstall the best remaining shared library.
+        fi
+        ;;
 
       *.lo)
-       if test "$build_old_libs" = yes; then
-         oldobj=`echo "$name" | sed 's/\.lo$/\.o/'`
-         rmfiles="$rmfiles $dir/$oldobj"
-       fi
-       ;;
+        if test "$build_old_libs" = yes; then
+          oldobj=`echo "$name" | sed 's/\.lo$/\.o/'`
+          rmfiles="$rmfiles $dir/$oldobj"
+        fi
+        ;;
       esac
 
       $show "$rm $rmfiles"
@@ -1844,7 +1852,7 @@ The following components of LINK-COMMAND are treated specially:
   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
   -static           do not do any dynamic linking or shared library creation
   -version-info CURRENT[:REVISION[:AGE]]
-                   specify library version info [each variable defaults to 0]
+                    specify library version info [each variable defaults to 0]
 
 All other options (arguments beginning with \`-') are ignored.