blob: c104e904cc4dee42d62c30f11c5c3b9939f09f27 [file] [log] [blame]
Patrick Williams56b44a92024-01-19 08:49:29 -06001libtool.m4: Change libtool to handle sysroots by default
Andrew Geisslereff27472021-10-29 15:35:00 -05002
Patrick Williams56b44a92024-01-19 08:49:29 -06003Rather than using no sysroot by default, always query gcc to obtain the sysroot.
Andrew Geisslereff27472021-10-29 15:35:00 -05004
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6
Patrick Williams56b44a92024-01-19 08:49:29 -06007Upstream-Status: Inappropriate [Upstream are unlikely to accept this change of default]
Andrew Geisslereff27472021-10-29 15:35:00 -05008
Patrick Williams56b44a92024-01-19 08:49:29 -06009---
10 m4/libtool.m4 | 6 +++---
11 1 file changed, 3 insertions(+), 3 deletions(-)
Andrew Geisslereff27472021-10-29 15:35:00 -050012
Patrick Williams56b44a92024-01-19 08:49:29 -060013diff --git a/m4/libtool.m4 b/m4/libtool.m4
14index 2f31d24..bd90775 100644
15--- a/m4/libtool.m4
16+++ b/m4/libtool.m4
17@@ -1254,18 +1254,18 @@ dnl lt_sysroot will always be passed unquoted. We quote it here
Andrew Geisslereff27472021-10-29 15:35:00 -050018 dnl in case the user passed a directory name.
19 lt_sysroot=
20 case $with_libtool_sysroot in #(
21- yes)
22+ no)
23 if test yes = "$GCC"; then
Patrick Williams56b44a92024-01-19 08:49:29 -060024 # Trim trailing / since we'll always append absolute paths and we want
25 # to avoid //, if only for less confusing output for the user.
26 lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
Andrew Geisslereff27472021-10-29 15:35:00 -050027 fi
28 ;; #(
29+ yes|''|/)
30+ ;; #(
31 /*)
Andrew Geissler9aee5002022-03-30 16:27:02 +000032 lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
Andrew Geisslereff27472021-10-29 15:35:00 -050033 ;; #(
34- no|'')
35- ;; #(
36 *)
37 AC_MSG_RESULT([$with_libtool_sysroot])
38 AC_MSG_ERROR([The sysroot must be an absolute path.])