]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (install mode): Try "ln -s -f" and "rm -f && ln -s"
authorBruno Haible <bruno@clisp.org>
Wed, 24 Aug 2005 15:59:04 +0000 (15:59 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 24 Aug 2005 15:59:04 +0000 (15:59 +0000)
to make a symlink for a shared library: the former is needed for
libraries `ln' depends on, the latter for Solaris /bin/ln.
Reported by Nelson H. F. Beebe <beebe@math.utah.edu>.

ChangeLog
ltmain.in

index c3b4a3489f9b53b02c129f43d436cbfeadeaa136..5bd4cc399a64a5d480be968e3f8aa28965be8113 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-08-24  Bruno Haible  <bruno@clisp.org>
 
+       * ltmain.in (install mode): Try "ln -s -f" and "rm -f && ln -s"
+       to make a symlink for a shared library: the former is needed for
+       libraries `ln' depends on, the latter for Solaris /bin/ln.
+       Reported by Nelson H. F. Beebe <beebe@math.utah.edu>.
+
        * ltmain.in (cwrappersource): return 127 if exec failed.
 
 2005-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
index 8d384a7ede78ec0adba0eb05e192ae8afe8fa38b..43144fe1a8110bc8fb85e952e58aa8fd3e29ef68 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -5624,11 +5624,14 @@ relink_command=\"$relink_command\""
 
          if test "$#" -gt 0; then
            # Delete the old symlinks, and create new ones.
+           # Try `ln -sf' first, because the `ln' binary might depend on
+           # the symlink we replace!  Solaris /bin/ln does not understand -f,
+           # so we also need to try rm && ln -s.
            for linkname
            do
              if test "$linkname" != "$realname"; then
-               $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
-               $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
              fi
            done
          fi