diff options
author | Sam James <sam@gentoo.org> | 2022-01-14 19:21:28 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-01-22 22:22:23 +0000 |
commit | 5593ef751758f5e45b470f678134b93dd6b17078 (patch) | |
tree | 325cecd2343d4900f1d8ce5a6f5daaa9b5d9688d /eclass/autotools.eclass | |
parent | autotools.eclass: don't inject -I${SYSROOT} to aclocal (diff) | |
download | gentoo-5593ef751758f5e45b470f678134b93dd6b17078.tar.gz gentoo-5593ef751758f5e45b470f678134b93dd6b17078.tar.bz2 gentoo-5593ef751758f5e45b470f678134b93dd6b17078.zip |
autotools.eclass: use --system-acdir for aclocal
We need to instruct aclocal that it might find macros in both
${BROOT} _and_ ${SYSROOT}.
- A classic example within BROOT is autoconf-archive.
- A classic example within SYSROOT is, say, libogg. A fair amount of
codec software installs its own macro to help locating it (but this
is in no ways limited to that genre/area).
The correct position for a dependency like libogg is DEPEND, and yet
the status quo doesn't mean that aclocal is obligated to check in ${ESYSROOT}
which is where DEPEND-class dependencies are guaranteed to be installed.
We can't rely on these being in BDEPEND -- in fact, most of the time,
they won't be. If we wanted to rely on macros always being provided by
BDEPEND, we'd have to duplicate a considerable number of dependencies
in both BDEPEND + DEPEND, with the unnecessary cross-compilation that would
entail too: it makes far more sense to just tell aclocal to look in the
right place (an extra location).
Bug: https://bugs.gentoo.org/710792
Closes: https://bugs.gentoo.org/677002
Closes: https://bugs.gentoo.org/738918
Thanks-to: David Michael <fedora.dm0@gmail.com> (for the suggestion)
Thanks-to: James Le Cuirot <chewi@gentoo.org> (rubberducking & sounding board)
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass/autotools.eclass')
-rw-r--r-- | eclass/autotools.eclass | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index e2572290f0cb..771673f4641a 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -332,8 +332,26 @@ eaclocal_amflags() { # They also force installing the support files for safety. # Respects AT_M4DIR for additional directories to search for macros. eaclocal() { + # Feed in a list of paths: + # - ${BROOT}/usr/share/aclocal + # - ${ESYSROOT}/usr/share/aclocal + # See bug #677002 + if [[ ${EAPI} != [56] ]] ; then + if [[ ! -f "${T}"/aclocal/dirlist ]] ; then + mkdir "${T}"/aclocal || die + cat <<- EOF > "${T}"/aclocal/dirlist || die + ${BROOT}/usr/share/aclocal + ${ESYSROOT}/usr/share/aclocal + EOF + fi + + local system_acdir=" --system-acdir=${T}/aclocal" + else + local system_acdir="" + fi + [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ - autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) + autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) ${system_acdir} } # @FUNCTION: _elibtoolize |