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
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.
9 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12 http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html
14 Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00014.html]
16 diff --git a/m4/libtool.m4 b/m4/libtool.m4
19 @@ -1215,28 +1215,28 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
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])
32 dnl lt_sysroot will always be passed unquoted. We quote it here
33 dnl in case the user passed a directory name.
35 -case $with_sysroot in #(
36 +case $with_libtool_sysroot in #(
38 if test yes = "$GCC"; then
39 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
43 - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
44 + lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
49 - AC_MSG_RESULT([$with_sysroot])
50 + AC_MSG_RESULT([$with_libtool_sysroot])
51 AC_MSG_ERROR([The sysroot must be an absolute path.])
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
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"
65 if test PATH = "$shlibpath_var"; then
66 @@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign])
68 AC_CONFIG_SRCDIR([lib2.c])
70 -sysroot=$with_sysroot
71 +sysroot=$with_libtool_sysroot
75 @@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign])
77 AC_CONFIG_SRCDIR([prog.c])
79 -sysroot=$with_sysroot
80 +sysroot=$with_libtool_sysroot
84 diff --git a/tests/testsuite b/tests/testsuite
87 @@ -48945,7 +48945,7 @@ $at_traceon; }
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"
95 if test PATH = "$shlibpath_var"; then
96 @@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign])
98 AC_CONFIG_SRCDIR([lib2.c])
100 -sysroot=$with_sysroot
101 +sysroot=$with_libtool_sysroot
105 @@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign])
107 AC_CONFIG_SRCDIR([prog.c])
109 -sysroot=$with_sysroot
110 +sysroot=$with_libtool_sysroot
114 @@ -49694,7 +49694,7 @@ $at_traceon; }
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"
122 if test PATH = "$shlibpath_var"; then
123 @@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign])
125 AC_CONFIG_SRCDIR([lib2.c])
127 -sysroot=$with_sysroot
128 +sysroot=$with_libtool_sysroot
132 @@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign])
134 AC_CONFIG_SRCDIR([prog.c])
136 -sysroot=$with_sysroot
137 +sysroot=$with_libtool_sysroot
141 @@ -50443,7 +50443,7 @@ $at_traceon; }
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"
149 if test PATH = "$shlibpath_var"; then
150 @@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign])
152 AC_CONFIG_SRCDIR([lib2.c])
154 -sysroot=$with_sysroot
155 +sysroot=$with_libtool_sysroot
159 @@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign])
161 AC_CONFIG_SRCDIR([prog.c])
163 -sysroot=$with_sysroot
164 +sysroot=$with_libtool_sysroot