blob: a221dab5283619beebe88e2e5c6757bf60b2be61 [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
Andrew Geissler9aee5002022-03-30 16:27:02 +000016Index: libtool-2.4.7/m4/libtool.m4
17===================================================================
18--- libtool-2.4.7.orig/m4/libtool.m4
19+++ libtool-2.4.7/m4/libtool.m4
20@@ -1254,16 +1254,20 @@ dnl lt_sysroot will always be passed unq
Andrew Geisslereff27472021-10-29 15:35:00 -050021 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`
Andrew Geissler9aee5002022-03-30 16:27:02 +000028+ # Treat "/" the same a an unset sysroot.
Andrew Geisslereff27472021-10-29 15:35:00 -050029+ if test "$lt_sysroot" = /; then
30+ lt_sysroot=
31+ fi
32 fi
33 ;; #(
34+ yes|''|/)
35+ ;; #(
36 /*)
Andrew Geissler9aee5002022-03-30 16:27:02 +000037 lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
Andrew Geisslereff27472021-10-29 15:35:00 -050038 ;; #(
39- no|'')
40- ;; #(
41 *)
42 AC_MSG_RESULT([$with_libtool_sysroot])
43 AC_MSG_ERROR([The sysroot must be an absolute path.])