1 |
commit: 5593ef751758f5e45b470f678134b93dd6b17078 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 14 19:21:28 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 22 22:22:23 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5593ef75 |
7 |
|
8 |
autotools.eclass: use --system-acdir for aclocal |
9 |
|
10 |
We need to instruct aclocal that it might find macros in both |
11 |
${BROOT} _and_ ${SYSROOT}. |
12 |
|
13 |
- A classic example within BROOT is autoconf-archive. |
14 |
|
15 |
- A classic example within SYSROOT is, say, libogg. A fair amount of |
16 |
codec software installs its own macro to help locating it (but this |
17 |
is in no ways limited to that genre/area). |
18 |
|
19 |
The correct position for a dependency like libogg is DEPEND, and yet |
20 |
the status quo doesn't mean that aclocal is obligated to check in ${ESYSROOT} |
21 |
which is where DEPEND-class dependencies are guaranteed to be installed. |
22 |
|
23 |
We can't rely on these being in BDEPEND -- in fact, most of the time, |
24 |
they won't be. If we wanted to rely on macros always being provided by |
25 |
BDEPEND, we'd have to duplicate a considerable number of dependencies |
26 |
in both BDEPEND + DEPEND, with the unnecessary cross-compilation that would |
27 |
entail too: it makes far more sense to just tell aclocal to look in the |
28 |
right place (an extra location). |
29 |
|
30 |
Bug: https://bugs.gentoo.org/710792 |
31 |
Closes: https://bugs.gentoo.org/677002 |
32 |
Closes: https://bugs.gentoo.org/738918 |
33 |
Thanks-to: David Michael <fedora.dm0 <AT> gmail.com> (for the suggestion) |
34 |
Thanks-to: James Le Cuirot <chewi <AT> gentoo.org> (rubberducking & sounding board) |
35 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
36 |
|
37 |
eclass/autotools.eclass | 20 +++++++++++++++++++- |
38 |
1 file changed, 19 insertions(+), 1 deletion(-) |
39 |
|
40 |
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass |
41 |
index e2572290f0cb..771673f4641a 100644 |
42 |
--- a/eclass/autotools.eclass |
43 |
+++ b/eclass/autotools.eclass |
44 |
@@ -332,8 +332,26 @@ eaclocal_amflags() { |
45 |
# They also force installing the support files for safety. |
46 |
# Respects AT_M4DIR for additional directories to search for macros. |
47 |
eaclocal() { |
48 |
+ # Feed in a list of paths: |
49 |
+ # - ${BROOT}/usr/share/aclocal |
50 |
+ # - ${ESYSROOT}/usr/share/aclocal |
51 |
+ # See bug #677002 |
52 |
+ if [[ ${EAPI} != [56] ]] ; then |
53 |
+ if [[ ! -f "${T}"/aclocal/dirlist ]] ; then |
54 |
+ mkdir "${T}"/aclocal || die |
55 |
+ cat <<- EOF > "${T}"/aclocal/dirlist || die |
56 |
+ ${BROOT}/usr/share/aclocal |
57 |
+ ${ESYSROOT}/usr/share/aclocal |
58 |
+ EOF |
59 |
+ fi |
60 |
+ |
61 |
+ local system_acdir=" --system-acdir=${T}/aclocal" |
62 |
+ else |
63 |
+ local system_acdir="" |
64 |
+ fi |
65 |
+ |
66 |
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ |
67 |
- autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) |
68 |
+ autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) ${system_acdir} |
69 |
} |
70 |
|
71 |
# @FUNCTION: _elibtoolize |