Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 2 | Subject: [PATCH 06/12] libtool.m4: Handle "/" as a sysroot correctly |
| 3 | |
| 4 | Update libtool.m4 to resolve a problem with lt_sysroot not being properly |
| 5 | updated if the option '--with[-libtool]-sysroot' is not provided when |
| 6 | running the 'configure' script for a package so that "/" as a sysroot |
| 7 | is handled correctly by libtool. |
| 8 | |
| 9 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 10 | |
| 11 | Upstream Report: |
| 12 | http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html |
| 13 | |
| 14 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00018.html] |
| 15 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 16 | Index: 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 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` |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 28 | + # Treat "/" the same a an unset sysroot. |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 29 | + if test "$lt_sysroot" = /; then |
| 30 | + lt_sysroot= |
| 31 | + fi |
| 32 | fi |
| 33 | ;; #( |
| 34 | + yes|''|/) |
| 35 | + ;; #( |
| 36 | /*) |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 37 | lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"` |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 38 | ;; #( |
| 39 | - no|'') |
| 40 | - ;; #( |
| 41 | *) |
| 42 | AC_MSG_RESULT([$with_libtool_sysroot]) |
| 43 | AC_MSG_ERROR([The sysroot must be an absolute path.]) |