]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
ltmain.in: Handle trailing slashes on install commands
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 16 Apr 2022 17:58:15 +0000 (18:58 +0100)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 20 Nov 2024 14:41:17 +0000 (16:41 +0200)
A command like:

libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la
'/image/usr/lib/gnome-keyring/standalone/'

where the path ends with a trailing slash currently fails. This occurs in
software like gnome-keyring or pulseaudio and is because the comparision
code doesn't see the paths as equal. Strip both paths to ensure this works
reliably.

* build-aux/ltmain.in: Strip trailing slashes on install commands.
* NEWS: Update.

NEWS
build-aux/ltmain.in

diff --git a/NEWS b/NEWS
index 82aac9eab9307a4eef36ef2fccded1631c83cab1..ab986ba00f73fc2163fb88eb7e2fd20c8f0e0546 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 
   - Fix linking libraries at runtime with tcc by adding run path.
 
+  - Fix path comparison by removing trailing slashes on install commands.
+
 ** Changes in supported systems or compilers:
 
   - Support additional flang-based compilers, 'f18' and 'f95'.
index 4e2a63fdd13502d19c05510920d30ee3632176f1..be94b032d6097d1f35cfe24d3dc10408b23a4854 100644 (file)
@@ -2405,8 +2405,15 @@ func_mode_install ()
        func_append dir "$objdir"
 
        if test -n "$relink_command"; then
+         # Strip any trailing slash from the destination.
+         func_stripname '' '/' "$libdir"
+         destlibdir=$func_stripname_result
+
+         func_stripname '' '/' "$destdir"
+         s_destdir=$func_stripname_result
+
          # Determine the prefix the user has applied to our future dir.
-         inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+         inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
 
          # Don't allow the user to place us outside of our expected
          # location b/c this prevents finding dependent libraries that