blob: 999971241fa94170730ea051c17d3fb6ffcb2453 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 06/12] libtool.m4: Handle "/" as a sysroot correctly
3
4Update libtool.m4 to resolve a problem with lt_sysroot not being properly
5updated if the option '--with[-libtool]-sysroot' is not provided when
6running the 'configure' script for a package so that "/" as a sysroot
7is handled correctly by libtool.
8
9Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
10
11Upstream Report:
12http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
13
14Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00018.html]
15
16---
17diff --git a/m4/libtool.m4 b/m4/libtool.m4
18--- a/m4/libtool.m4
19+++ b/m4/libtool.m4
20@@ -1225,16 +1225,21 @@ dnl lt_sysroot will always be passed unquoted. We quote it here
21 dnl in case the user passed a directory name.
22 lt_sysroot=
23 case $with_libtool_sysroot in #(
24- yes)
25+ no)
26 if test yes = "$GCC"; then
27 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
28+ # Treat "/" the same a an unset sysroot. It seems to be more
29+ # compatible across host platforms that way!?
30+ if test "$lt_sysroot" = /; then
31+ lt_sysroot=
32+ fi
33 fi
34 ;; #(
35+ yes|''|/)
36+ ;; #(
37 /*)
38 lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
39 ;; #(
40- no|'')
41- ;; #(
42 *)
43 AC_MSG_RESULT([$with_libtool_sysroot])
44 AC_MSG_ERROR([The sysroot must be an absolute path.])