Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | From: Khem Raj <raj.khem@gmail.com> |
| 2 | Subject: [PATCH 02/12] libtool.m4: Rename the --with-sysroot option to avoid conflict with gcc/binutils |
| 3 | |
| 4 | This patch renames the --with-sysroot option to --with-libtool-sysroot |
| 5 | to avoid namespace conflict with binutils, gcc and other toolchain |
| 6 | components since these componets also add that option to configure |
| 7 | and this becomes confusing and conflicting otherwise. |
| 8 | |
| 9 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 10 | |
| 11 | Upstream report: |
| 12 | http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html |
| 13 | |
| 14 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00014.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 | @@ -1244,28 +1244,28 @@ _LT_DECL([], [ECHO], [1], [An echo progr |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 21 | AC_DEFUN([_LT_WITH_SYSROOT], |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 22 | [m4_require([_LT_DECL_SED])dnl |
| 23 | AC_MSG_CHECKING([for sysroot]) |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 24 | -AC_ARG_WITH([sysroot], |
| 25 | -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], |
| 26 | +AC_ARG_WITH([libtool-sysroot], |
| 27 | +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@], |
| 28 | [Search for dependent libraries within DIR (or the compiler's sysroot |
| 29 | if not specified).])], |
| 30 | -[], [with_sysroot=no]) |
| 31 | +[], [with_libtool_sysroot=no]) |
| 32 | |
| 33 | dnl lt_sysroot will always be passed unquoted. We quote it here |
| 34 | dnl in case the user passed a directory name. |
| 35 | lt_sysroot= |
| 36 | -case $with_sysroot in #( |
| 37 | +case $with_libtool_sysroot in #( |
| 38 | yes) |
| 39 | if test yes = "$GCC"; then |
| 40 | lt_sysroot=`$CC --print-sysroot 2>/dev/null` |
| 41 | fi |
| 42 | ;; #( |
| 43 | /*) |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 44 | - lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` |
| 45 | + lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"` |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 46 | ;; #( |
| 47 | no|'') |
| 48 | ;; #( |
| 49 | *) |
| 50 | - AC_MSG_RESULT([$with_sysroot]) |
| 51 | + AC_MSG_RESULT([$with_libtool_sysroot]) |
| 52 | AC_MSG_ERROR([The sysroot must be an absolute path.]) |
| 53 | ;; |
| 54 | esac |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 55 | Index: libtool-2.4.7/tests/sysroot.at |
| 56 | =================================================================== |
| 57 | --- libtool-2.4.7.orig/tests/sysroot.at |
| 58 | +++ libtool-2.4.7/tests/sysroot.at |
| 59 | @@ -65,7 +65,7 @@ while read file; do |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 60 | done]) |
| 61 | |
| 62 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 63 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 64 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 65 | |
| 66 | #??? |
| 67 | if test PATH = "$shlibpath_var"; then |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 68 | @@ -115,7 +115,7 @@ AM_INIT_AUTOMAKE([foreign]) |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 69 | AC_PROG_CC |
| 70 | AC_CONFIG_SRCDIR([lib2.c]) |
| 71 | LT_INIT |
| 72 | -sysroot=$with_sysroot |
| 73 | +sysroot=$with_libtool_sysroot |
| 74 | AC_SUBST([sysroot]) |
| 75 | AC_OUTPUT(Makefile) |
| 76 | ]]) |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 77 | @@ -156,7 +156,7 @@ AM_INIT_AUTOMAKE([foreign]) |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 78 | AC_PROG_CC |
| 79 | AC_CONFIG_SRCDIR([prog.c]) |
| 80 | LT_INIT |
| 81 | -sysroot=$with_sysroot |
| 82 | +sysroot=$with_libtool_sysroot |
| 83 | AC_SUBST([sysroot]) |
| 84 | AC_OUTPUT(Makefile) |
| 85 | ]]) |
| 86 | diff --git a/tests/testsuite b/tests/testsuite |
| 87 | --- a/tests/testsuite |
| 88 | +++ b/tests/testsuite |
| 89 | @@ -48945,7 +48945,7 @@ $at_traceon; } |
| 90 | |
| 91 | |
| 92 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 93 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 94 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 95 | |
| 96 | #??? |
| 97 | if test PATH = "$shlibpath_var"; then |
| 98 | @@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 99 | AC_PROG_CC |
| 100 | AC_CONFIG_SRCDIR([lib2.c]) |
| 101 | LT_INIT |
| 102 | -sysroot=$with_sysroot |
| 103 | +sysroot=$with_libtool_sysroot |
| 104 | AC_SUBST([sysroot]) |
| 105 | AC_OUTPUT(Makefile) |
| 106 | _ATEOF |
| 107 | @@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 108 | AC_PROG_CC |
| 109 | AC_CONFIG_SRCDIR([prog.c]) |
| 110 | LT_INIT |
| 111 | -sysroot=$with_sysroot |
| 112 | +sysroot=$with_libtool_sysroot |
| 113 | AC_SUBST([sysroot]) |
| 114 | AC_OUTPUT(Makefile) |
| 115 | _ATEOF |
| 116 | @@ -49694,7 +49694,7 @@ $at_traceon; } |
| 117 | |
| 118 | |
| 119 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 120 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 121 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 122 | |
| 123 | #??? |
| 124 | if test PATH = "$shlibpath_var"; then |
| 125 | @@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 126 | AC_PROG_CC |
| 127 | AC_CONFIG_SRCDIR([lib2.c]) |
| 128 | LT_INIT |
| 129 | -sysroot=$with_sysroot |
| 130 | +sysroot=$with_libtool_sysroot |
| 131 | AC_SUBST([sysroot]) |
| 132 | AC_OUTPUT(Makefile) |
| 133 | _ATEOF |
| 134 | @@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 135 | AC_PROG_CC |
| 136 | AC_CONFIG_SRCDIR([prog.c]) |
| 137 | LT_INIT |
| 138 | -sysroot=$with_sysroot |
| 139 | +sysroot=$with_libtool_sysroot |
| 140 | AC_SUBST([sysroot]) |
| 141 | AC_OUTPUT(Makefile) |
| 142 | _ATEOF |
| 143 | @@ -50443,7 +50443,7 @@ $at_traceon; } |
| 144 | |
| 145 | |
| 146 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 147 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 148 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 149 | |
| 150 | #??? |
| 151 | if test PATH = "$shlibpath_var"; then |
| 152 | @@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 153 | AC_PROG_CC |
| 154 | AC_CONFIG_SRCDIR([lib2.c]) |
| 155 | LT_INIT |
| 156 | -sysroot=$with_sysroot |
| 157 | +sysroot=$with_libtool_sysroot |
| 158 | AC_SUBST([sysroot]) |
| 159 | AC_OUTPUT(Makefile) |
| 160 | _ATEOF |
| 161 | @@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 162 | AC_PROG_CC |
| 163 | AC_CONFIG_SRCDIR([prog.c]) |
| 164 | LT_INIT |
| 165 | -sysroot=$with_sysroot |
| 166 | +sysroot=$with_libtool_sysroot |
| 167 | AC_SUBST([sysroot]) |
| 168 | AC_OUTPUT(Makefile) |
| 169 | _ATEOF |