From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D4F7D158087 for ; Mon, 17 Jan 2022 11:10:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5D41F2BC040; Mon, 17 Jan 2022 11:10:19 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7E4492BC036 for ; Mon, 17 Jan 2022 11:10:17 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: cross@gentoo.org, base-system@gentoo.org, chewi@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 2/4] autotools.eclass: use --system-acdir for aclocal Date: Mon, 17 Jan 2022 11:09:48 +0000 Message-Id: <20220117110950.139015-2-sam@gentoo.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220117110950.139015-1-sam@gentoo.org> References: <20220117110950.139015-1-sam@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 8017a760-ce98-462a-8360-d96327421d94 X-Archives-Hash: 09bac1e8757227fa1a7e6ca45a33a64b 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 (for the suggestion) Thanks-to: James Le Cuirot (rubberducking & sounding board) Signed-off-by: Sam James --- eclass/autotools.eclass | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index e2572290f0cbe..2cf7c076d01ed 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -332,8 +332,22 @@ 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 [[ ! -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" + [[ ! -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 -- 2.34.1