blob: 2126f829537aefe25db9899faa6ca550c48d7686 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From: Khem Raj <raj.khem@gmail.com>
2Subject: [PATCH 02/12] libtool.m4: Rename the --with-sysroot option to avoid conflict with gcc/binutils
3
4This patch renames the --with-sysroot option to --with-libtool-sysroot
5to avoid namespace conflict with binutils, gcc and other toolchain
6components since these componets also add that option to configure
7and this becomes confusing and conflicting otherwise.
8
9Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
10
11Upstream report:
12http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html
13
14Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00014.html]
15
Andrew Geissler9aee5002022-03-30 16:27:02 +000016Index: 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 Geisslereff27472021-10-29 15:35:00 -050021 AC_DEFUN([_LT_WITH_SYSROOT],
Andrew Geissler9aee5002022-03-30 16:27:02 +000022 [m4_require([_LT_DECL_SED])dnl
23 AC_MSG_CHECKING([for sysroot])
Andrew Geisslereff27472021-10-29 15:35:00 -050024-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 Geissler9aee5002022-03-30 16:27:02 +000044- lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
45+ lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
Andrew Geisslereff27472021-10-29 15:35:00 -050046 ;; #(
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 Geissler9aee5002022-03-30 16:27:02 +000055Index: 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 Geisslereff27472021-10-29 15:35:00 -050060 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 Geissler9aee5002022-03-30 16:27:02 +000068@@ -115,7 +115,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -050069 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 Geissler9aee5002022-03-30 16:27:02 +000077@@ -156,7 +156,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -050078 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 ]])
86diff --git a/tests/testsuite b/tests/testsuite
Patrick Williams56b44a92024-01-19 08:49:29 -060087index 24265e4..d388e3e 100755
Andrew Geisslereff27472021-10-29 15:35:00 -050088--- a/tests/testsuite
89+++ b/tests/testsuite
Patrick Williams56b44a92024-01-19 08:49:29 -060090@@ -48997,7 +48997,7 @@ $at_traceon; }
Andrew Geisslereff27472021-10-29 15:35:00 -050091
92
93 LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
94-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
95+configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
96
97 #???
98 if test PATH = "$shlibpath_var"; then
Patrick Williams56b44a92024-01-19 08:49:29 -060099@@ -49211,7 +49211,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500100 AC_PROG_CC
101 AC_CONFIG_SRCDIR([lib2.c])
102 LT_INIT
103-sysroot=$with_sysroot
104+sysroot=$with_libtool_sysroot
105 AC_SUBST([sysroot])
106 AC_OUTPUT(Makefile)
107 _ATEOF
Patrick Williams56b44a92024-01-19 08:49:29 -0600108@@ -49404,7 +49404,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500109 AC_PROG_CC
110 AC_CONFIG_SRCDIR([prog.c])
111 LT_INIT
112-sysroot=$with_sysroot
113+sysroot=$with_libtool_sysroot
114 AC_SUBST([sysroot])
115 AC_OUTPUT(Makefile)
116 _ATEOF
Patrick Williams56b44a92024-01-19 08:49:29 -0600117@@ -49761,7 +49761,7 @@ $at_traceon; }
Andrew Geisslereff27472021-10-29 15:35:00 -0500118
119
120 LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
121-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
122+configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
123
124 #???
125 if test PATH = "$shlibpath_var"; then
Patrick Williams56b44a92024-01-19 08:49:29 -0600126@@ -49975,7 +49975,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500127 AC_PROG_CC
128 AC_CONFIG_SRCDIR([lib2.c])
129 LT_INIT
130-sysroot=$with_sysroot
131+sysroot=$with_libtool_sysroot
132 AC_SUBST([sysroot])
133 AC_OUTPUT(Makefile)
134 _ATEOF
Patrick Williams56b44a92024-01-19 08:49:29 -0600135@@ -50168,7 +50168,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500136 AC_PROG_CC
137 AC_CONFIG_SRCDIR([prog.c])
138 LT_INIT
139-sysroot=$with_sysroot
140+sysroot=$with_libtool_sysroot
141 AC_SUBST([sysroot])
142 AC_OUTPUT(Makefile)
143 _ATEOF
Patrick Williams56b44a92024-01-19 08:49:29 -0600144@@ -50525,7 +50525,7 @@ $at_traceon; }
Andrew Geisslereff27472021-10-29 15:35:00 -0500145
146
147 LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
148-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
149+configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
150
151 #???
152 if test PATH = "$shlibpath_var"; then
Patrick Williams56b44a92024-01-19 08:49:29 -0600153@@ -50739,7 +50739,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500154 AC_PROG_CC
155 AC_CONFIG_SRCDIR([lib2.c])
156 LT_INIT
157-sysroot=$with_sysroot
158+sysroot=$with_libtool_sysroot
159 AC_SUBST([sysroot])
160 AC_OUTPUT(Makefile)
161 _ATEOF
Patrick Williams56b44a92024-01-19 08:49:29 -0600162@@ -50932,7 +50932,7 @@ AM_INIT_AUTOMAKE([foreign])
Andrew Geisslereff27472021-10-29 15:35:00 -0500163 AC_PROG_CC
164 AC_CONFIG_SRCDIR([prog.c])
165 LT_INIT
166-sysroot=$with_sysroot
167+sysroot=$with_libtool_sysroot
168 AC_SUBST([sysroot])
169 AC_OUTPUT(Makefile)
170 _ATEOF