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