blob: eeb5ebf4161c19764e1b4186dd9e2455058ed23e [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 01/12] ltmain.in: Handle trailing slashes on install commands correctly
3
4A command like:
5
6libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/image/usr/lib/gnome-keyring/standalone/'
7
8where the path ends with a trailing slash currently fails. This occurs in
9software like gnome-keyring or pulseaudio and is because the comparision
10code doesn't see the paths as equal. Strip both paths to ensure this works
11reliably.
12
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14
15Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00010.html]
16
17diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
18--- a/build-aux/ltmain.in
19+++ b/build-aux/ltmain.in
20@@ -2356,8 +2356,14 @@ func_mode_install ()
21 func_append dir "$objdir"
22
23 if test -n "$relink_command"; then
24+ # Strip any trailing slash from the destination.
25+ func_stripname '' '/' "$libdir"
26+ destlibdir=$func_stripname_result
27+ func_stripname '' '/' "$destdir"
28+ s_destdir=$func_stripname_result
29+
30 # Determine the prefix the user has applied to our future dir.
31- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
32+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
33
34 # Don't allow the user to place us outside of our expected
35 # location b/c this prevents finding dependent libraries that