1 |
commit: 00e19f7ec43cd9d94d894f87114fbfab0b405df3 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 10 07:12:24 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 10 07:13:14 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=00e19f7e |
7 |
|
8 |
autotools.eclass: sync with ::gentoo |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
eclass/autotools.eclass | 78 ++++++++++++++++++++++++++++++++++++------------- |
13 |
1 file changed, 57 insertions(+), 21 deletions(-) |
14 |
|
15 |
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass |
16 |
index 5a59c8d2d5..ded5436a45 100644 |
17 |
--- a/eclass/autotools.eclass |
18 |
+++ b/eclass/autotools.eclass |
19 |
@@ -1,4 +1,4 @@ |
20 |
-# Copyright 1999-2018 Gentoo Foundation |
21 |
+# Copyright 1999-2021 Gentoo Authors |
22 |
# Distributed under the terms of the GNU General Public License v2 |
23 |
|
24 |
# @ECLASS: autotools.eclass |
25 |
@@ -34,16 +34,19 @@ esac |
26 |
inherit libtool |
27 |
|
28 |
# @ECLASS-VARIABLE: WANT_AUTOCONF |
29 |
+# @PRE_INHERIT |
30 |
# @DESCRIPTION: |
31 |
# The major version of autoconf your package needs |
32 |
: ${WANT_AUTOCONF:=latest} |
33 |
|
34 |
# @ECLASS-VARIABLE: WANT_AUTOMAKE |
35 |
+# @PRE_INHERIT |
36 |
# @DESCRIPTION: |
37 |
# The major version of automake your package needs |
38 |
: ${WANT_AUTOMAKE:=latest} |
39 |
|
40 |
# @ECLASS-VARIABLE: WANT_LIBTOOL |
41 |
+# @PRE_INHERIT |
42 |
# @DESCRIPTION: |
43 |
# Do you want libtool? Valid values here are "latest" and "none". |
44 |
: ${WANT_LIBTOOL:=latest} |
45 |
@@ -54,18 +57,20 @@ inherit libtool |
46 |
# CONSTANT! |
47 |
# The latest major unstable and stable version/slot of automake available |
48 |
# on each arch. |
49 |
+# Only add unstable version if it is in a different slot than latest stable |
50 |
+# version. |
51 |
# List latest unstable version first to boost testing adoption rate because |
52 |
# most package manager dependency resolver will pick the first suitable |
53 |
# version. |
54 |
# If a newer slot is stable on any arch, and is NOT reflected in this list, |
55 |
# then circular dependencies may arise during emerge @system bootstraps. |
56 |
-# |
57 |
-# See bug 312315 and 465732 for further information and context. |
58 |
-# |
59 |
+# |
60 |
+# See bug #312315 and bug #465732 for further information and context. |
61 |
+# |
62 |
# Do NOT change this variable in your ebuilds! |
63 |
# If you want to force a newer minor version, you can specify the correct |
64 |
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE> |
65 |
-_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 ) |
66 |
+_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) |
67 |
|
68 |
_automake_atom="sys-devel/automake" |
69 |
_autoconf_atom="sys-devel/autoconf" |
70 |
@@ -73,7 +78,7 @@ if [[ -n ${WANT_AUTOMAKE} ]]; then |
71 |
case ${WANT_AUTOMAKE} in |
72 |
# Even if the package doesn't use automake, we still need to depend |
73 |
# on it because we run aclocal to process m4 macros. This matches |
74 |
- # the autoreconf tool, so this requirement is correct. #401605 |
75 |
+ # the autoreconf tool, so this requirement is correct, bug #401605. |
76 |
none) ;; |
77 |
latest) |
78 |
# Use SLOT deps if we can. For EAPI=0, we get pretty close. |
79 |
@@ -118,6 +123,7 @@ AUTOTOOLS_DEPEND="!<sys-devel/gettext-0.18.1.1-r3 |
80 |
RDEPEND="" |
81 |
|
82 |
# @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND |
83 |
+# @PRE_INHERIT |
84 |
# @DESCRIPTION: |
85 |
# Set to 'no' to disable automatically adding to DEPEND. This lets |
86 |
# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in |
87 |
@@ -139,6 +145,12 @@ unset _automake_atom _autoconf_atom |
88 |
# Additional options to pass to automake during |
89 |
# eautoreconf call. |
90 |
|
91 |
+# @ECLASS-VARIABLE: AT_NOEAUTOHEADER |
92 |
+# @DEFAULT_UNSET |
93 |
+# @DESCRIPTION: |
94 |
+# Don't run eautoheader command if set to 'yes'; only used to work around |
95 |
+# packages that don't want their headers being modified. |
96 |
+ |
97 |
# @ECLASS-VARIABLE: AT_NOEAUTOMAKE |
98 |
# @DEFAULT_UNSET |
99 |
# @DESCRIPTION: |
100 |
@@ -154,11 +166,13 @@ unset _automake_atom _autoconf_atom |
101 |
# particular options |
102 |
|
103 |
# @ECLASS-VARIABLE: AT_M4DIR |
104 |
+# @DEFAULT_UNSET |
105 |
# @DESCRIPTION: |
106 |
# Additional director(y|ies) aclocal should search |
107 |
: ${AT_M4DIR:=} |
108 |
|
109 |
# @ECLASS-VARIABLE: AT_SYS_M4DIR |
110 |
+# @DEFAULT_UNSET |
111 |
# @INTERNAL |
112 |
# @DESCRIPTION: |
113 |
# For system integrators, a list of additional aclocal search paths. |
114 |
@@ -177,13 +191,13 @@ unset _automake_atom _autoconf_atom |
115 |
eautoreconf() { |
116 |
local x g |
117 |
|
118 |
- # Subdirs often share a common build dir #529404. If so, we can't safely |
119 |
+ # Subdirs often share a common build dir, bug #529404. If so, we can't safely |
120 |
# run in parallel because many tools clobber the content in there. Libtool |
121 |
# and automake both `rm && cp` while aclocal reads the output. We might be |
122 |
# able to handle this if we split the steps and grab locks on the dirs the |
123 |
# tools actually write to. Then we'd run all the common tools that use |
124 |
# those inputs. Doing this in bash does not scale easily. |
125 |
- # If we do re-enable parallel support, make sure #426512 is handled. |
126 |
+ # If we do re-enable parallel support, make sure bug #426512 is handled. |
127 |
if [[ -z ${AT_NO_RECURSIVE} ]] ; then |
128 |
# Take care of subdirs |
129 |
for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS) ; do |
130 |
@@ -239,7 +253,7 @@ eautoreconf() { |
131 |
else |
132 |
eautoconf --force |
133 |
fi |
134 |
- eautoheader |
135 |
+ [[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader |
136 |
[[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS} |
137 |
|
138 |
if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then |
139 |
@@ -289,8 +303,8 @@ eaclocal_amflags() { |
140 |
[[ -e ${amflags_file} ]] || continue |
141 |
# setup the env in case the pkg does something crazy |
142 |
# in their ACLOCAL_AMFLAGS. like run a shell script |
143 |
- # which turns around and runs autotools. #365401 |
144 |
- # or split across multiple lines. #383525 |
145 |
+ # which turns around and runs autotools (bug #365401) |
146 |
+ # or split across multiple lines (bug #383525) |
147 |
autotools_env_setup |
148 |
aclocal_opts=$(sed -n \ |
149 |
"/^ACLOCAL_AMFLAGS[[:space:]]*=/{ \ |
150 |
@@ -312,7 +326,7 @@ eaclocal_amflags() { |
151 |
# specified parametes. The name of the tool run is the same of the function |
152 |
# without e prefix. |
153 |
# They also force installing the support files for safety. |
154 |
-# Respects AT_M4DIR for additional directories to search for macro's. |
155 |
+# Respects AT_M4DIR for additional directories to search for macros. |
156 |
eaclocal() { |
157 |
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ |
158 |
autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) |
159 |
@@ -360,6 +374,19 @@ eautoconf() { |
160 |
eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details." |
161 |
fi |
162 |
|
163 |
+ # Install config.guess and config.sub which are required by many macros |
164 |
+ # in autoconf >=2.70. |
165 |
+ local _gnuconfig |
166 |
+ case ${EAPI:-0} in |
167 |
+ 0|1|2|3|4|5|6) |
168 |
+ _gnuconfig="${EPREFIX}/usr/share/gnuconfig" |
169 |
+ ;; |
170 |
+ *) |
171 |
+ _gnuconfig="${BROOT}/usr/share/gnuconfig" |
172 |
+ ;; |
173 |
+ esac |
174 |
+ cp "${_gnuconfig}"/config.{guess,sub} . || die |
175 |
+ |
176 |
autotools_run_tool --at-m4flags autoconf "$@" |
177 |
} |
178 |
|
179 |
@@ -406,7 +433,7 @@ eautomake() { |
180 |
|| extra_opts+=( --foreign ) |
181 |
|
182 |
# Older versions of automake do not support --force-missing. But we want |
183 |
- # to use this whenever possible to update random bundled files #133489. |
184 |
+ # to use this whenever possible to update random bundled files, bug #133489. |
185 |
case $(_automake_version) in |
186 |
1.4|1.4[.-]*) ;; |
187 |
*) extra_opts+=( --force-missing ) ;; |
188 |
@@ -429,7 +456,16 @@ eautopoint() { |
189 |
# use gettext directly. So we have to copy it in manually since |
190 |
# we can't let `autopoint` do it for us. |
191 |
config_rpath_update() { |
192 |
- local dst src=$(type -P gettext | sed 's:bin/gettext:share/gettext/config.rpath:') |
193 |
+ local dst src |
194 |
+ |
195 |
+ case ${EAPI:-0} in |
196 |
+ 0|1|2|3|4|5|6) |
197 |
+ src="${EPREFIX}/usr/share/gettext/config.rpath" |
198 |
+ ;; |
199 |
+ *) |
200 |
+ src="${BROOT}/usr/share/gettext/config.rpath" |
201 |
+ ;; |
202 |
+ esac |
203 |
|
204 |
[[ $# -eq 0 ]] && set -- $(find -name config.rpath) |
205 |
[[ $# -eq 0 ]] && return 0 |
206 |
@@ -496,17 +532,17 @@ autotools_run_tool() { |
207 |
done |
208 |
|
209 |
if [[ ${EBUILD_PHASE} != "unpack" && ${EBUILD_PHASE} != "prepare" ]]; then |
210 |
- ewarn "QA Warning: running $1 in ${EBUILD_PHASE} phase" |
211 |
+ ewarn "QA Warning: running '$1' in ${EBUILD_PHASE} phase" |
212 |
fi |
213 |
|
214 |
if ${missing_ok} && ! type -P ${1} >/dev/null ; then |
215 |
- einfo "Skipping '$*' due $1 not installed" |
216 |
+ einfo "Skipping '$*' because '$1' not installed" |
217 |
return 0 |
218 |
fi |
219 |
|
220 |
autotools_env_setup |
221 |
|
222 |
- # Allow people to pass in full paths. #549268 |
223 |
+ # Allow people to pass in full paths, bug #549268 |
224 |
local STDERR_TARGET="${T}/${1##*/}.out" |
225 |
# most of the time, there will only be one run, but if there are |
226 |
# more, make sure we get unique log filenames |
227 |
@@ -520,7 +556,7 @@ autotools_run_tool() { |
228 |
fi |
229 |
|
230 |
if ${m4flags} ; then |
231 |
- set -- "${1}" $(autotools_m4dir_include) "${@:2}" $(autotools_m4sysdir_include) |
232 |
+ set -- "${1}" $(autotools_m4dir_include) $(autotools_m4sysdir_include) "${@:2}" |
233 |
fi |
234 |
|
235 |
# If the caller wants to probe something, then let them do it directly. |
236 |
@@ -535,13 +571,13 @@ autotools_run_tool() { |
237 |
"$@" >> "${STDERR_TARGET}" 2>&1 |
238 |
if ! eend $? && ${autofail} ; then |
239 |
echo |
240 |
- eerror "Failed Running $1 !" |
241 |
+ eerror "Failed running '$1'!" |
242 |
eerror |
243 |
- eerror "Include in your bugreport the contents of:" |
244 |
+ eerror "Include in your bug report the contents of:" |
245 |
eerror |
246 |
eerror " ${STDERR_TARGET}" |
247 |
echo |
248 |
- die "Failed Running $1 !" |
249 |
+ die "Failed running '$1'!" |
250 |
fi |
251 |
} |