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