Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 1 | libtool.m4: Change libtool to handle sysroots by default |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 2 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 3 | Rather than using no sysroot by default, always query gcc to obtain the sysroot. |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 4 | |
| 5 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 6 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 7 | Upstream-Status: Inappropriate [Upstream are unlikely to accept this change of default] |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 8 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 9 | --- |
| 10 | m4/libtool.m4 | 6 +++--- |
| 11 | 1 file changed, 3 insertions(+), 3 deletions(-) |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 12 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 13 | diff --git a/m4/libtool.m4 b/m4/libtool.m4 |
| 14 | index 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 18 | 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 Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 24 | # 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 27 | fi |
| 28 | ;; #( |
| 29 | + yes|''|/) |
| 30 | + ;; #( |
| 31 | /*) |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 32 | lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"` |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 33 | ;; #( |
| 34 | - no|'') |
| 35 | - ;; #( |
| 36 | *) |
| 37 | AC_MSG_RESULT([$with_libtool_sysroot]) |
| 38 | AC_MSG_ERROR([The sysroot must be an absolute path.]) |