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 | |
| 16 | diff --git a/m4/libtool.m4 b/m4/libtool.m4 |
| 17 | --- a/m4/libtool.m4 |
| 18 | +++ b/m4/libtool.m4 |
| 19 | @@ -1215,28 +1215,28 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) |
| 20 | # ---------------- |
| 21 | AC_DEFUN([_LT_WITH_SYSROOT], |
| 22 | [AC_MSG_CHECKING([for sysroot]) |
| 23 | -AC_ARG_WITH([sysroot], |
| 24 | -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], |
| 25 | +AC_ARG_WITH([libtool-sysroot], |
| 26 | +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@], |
| 27 | [Search for dependent libraries within DIR (or the compiler's sysroot |
| 28 | if not specified).])], |
| 29 | -[], [with_sysroot=no]) |
| 30 | +[], [with_libtool_sysroot=no]) |
| 31 | |
| 32 | dnl lt_sysroot will always be passed unquoted. We quote it here |
| 33 | dnl in case the user passed a directory name. |
| 34 | lt_sysroot= |
| 35 | -case $with_sysroot in #( |
| 36 | +case $with_libtool_sysroot in #( |
| 37 | yes) |
| 38 | if test yes = "$GCC"; then |
| 39 | lt_sysroot=`$CC --print-sysroot 2>/dev/null` |
| 40 | fi |
| 41 | ;; #( |
| 42 | /*) |
| 43 | - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` |
| 44 | + lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` |
| 45 | ;; #( |
| 46 | no|'') |
| 47 | ;; #( |
| 48 | *) |
| 49 | - AC_MSG_RESULT([$with_sysroot]) |
| 50 | + AC_MSG_RESULT([$with_libtool_sysroot]) |
| 51 | AC_MSG_ERROR([The sysroot must be an absolute path.]) |
| 52 | ;; |
| 53 | esac |
| 54 | diff --git a/tests/sysroot.at b/tests/sysroot.at |
| 55 | --- a/tests/sysroot.at |
| 56 | +++ b/tests/sysroot.at |
| 57 | @@ -64,7 +64,7 @@ while read file; do |
| 58 | done]) |
| 59 | |
| 60 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 61 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 62 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 63 | |
| 64 | #??? |
| 65 | if test PATH = "$shlibpath_var"; then |
| 66 | @@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 67 | AC_PROG_CC |
| 68 | AC_CONFIG_SRCDIR([lib2.c]) |
| 69 | LT_INIT |
| 70 | -sysroot=$with_sysroot |
| 71 | +sysroot=$with_libtool_sysroot |
| 72 | AC_SUBST([sysroot]) |
| 73 | AC_OUTPUT(Makefile) |
| 74 | ]]) |
| 75 | @@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 76 | AC_PROG_CC |
| 77 | AC_CONFIG_SRCDIR([prog.c]) |
| 78 | LT_INIT |
| 79 | -sysroot=$with_sysroot |
| 80 | +sysroot=$with_libtool_sysroot |
| 81 | AC_SUBST([sysroot]) |
| 82 | AC_OUTPUT(Makefile) |
| 83 | ]]) |
| 84 | diff --git a/tests/testsuite b/tests/testsuite |
| 85 | --- a/tests/testsuite |
| 86 | +++ b/tests/testsuite |
| 87 | @@ -48945,7 +48945,7 @@ $at_traceon; } |
| 88 | |
| 89 | |
| 90 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 91 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 92 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 93 | |
| 94 | #??? |
| 95 | if test PATH = "$shlibpath_var"; then |
| 96 | @@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 97 | AC_PROG_CC |
| 98 | AC_CONFIG_SRCDIR([lib2.c]) |
| 99 | LT_INIT |
| 100 | -sysroot=$with_sysroot |
| 101 | +sysroot=$with_libtool_sysroot |
| 102 | AC_SUBST([sysroot]) |
| 103 | AC_OUTPUT(Makefile) |
| 104 | _ATEOF |
| 105 | @@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 106 | AC_PROG_CC |
| 107 | AC_CONFIG_SRCDIR([prog.c]) |
| 108 | LT_INIT |
| 109 | -sysroot=$with_sysroot |
| 110 | +sysroot=$with_libtool_sysroot |
| 111 | AC_SUBST([sysroot]) |
| 112 | AC_OUTPUT(Makefile) |
| 113 | _ATEOF |
| 114 | @@ -49694,7 +49694,7 @@ $at_traceon; } |
| 115 | |
| 116 | |
| 117 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 118 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 119 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 120 | |
| 121 | #??? |
| 122 | if test PATH = "$shlibpath_var"; then |
| 123 | @@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 124 | AC_PROG_CC |
| 125 | AC_CONFIG_SRCDIR([lib2.c]) |
| 126 | LT_INIT |
| 127 | -sysroot=$with_sysroot |
| 128 | +sysroot=$with_libtool_sysroot |
| 129 | AC_SUBST([sysroot]) |
| 130 | AC_OUTPUT(Makefile) |
| 131 | _ATEOF |
| 132 | @@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 133 | AC_PROG_CC |
| 134 | AC_CONFIG_SRCDIR([prog.c]) |
| 135 | LT_INIT |
| 136 | -sysroot=$with_sysroot |
| 137 | +sysroot=$with_libtool_sysroot |
| 138 | AC_SUBST([sysroot]) |
| 139 | AC_OUTPUT(Makefile) |
| 140 | _ATEOF |
| 141 | @@ -50443,7 +50443,7 @@ $at_traceon; } |
| 142 | |
| 143 | |
| 144 | LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" |
| 145 | -configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" |
| 146 | +configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" |
| 147 | |
| 148 | #??? |
| 149 | if test PATH = "$shlibpath_var"; then |
| 150 | @@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 151 | AC_PROG_CC |
| 152 | AC_CONFIG_SRCDIR([lib2.c]) |
| 153 | LT_INIT |
| 154 | -sysroot=$with_sysroot |
| 155 | +sysroot=$with_libtool_sysroot |
| 156 | AC_SUBST([sysroot]) |
| 157 | AC_OUTPUT(Makefile) |
| 158 | _ATEOF |
| 159 | @@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign]) |
| 160 | AC_PROG_CC |
| 161 | AC_CONFIG_SRCDIR([prog.c]) |
| 162 | LT_INIT |
| 163 | -sysroot=$with_sysroot |
| 164 | +sysroot=$with_libtool_sysroot |
| 165 | AC_SUBST([sysroot]) |
| 166 | AC_OUTPUT(Makefile) |
| 167 | _ATEOF |