commit:     63f8947e8f7dcdbef199aca7794000da12dd17ba
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Thu Mar 13 15:12:06 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 29 12:24:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63f8947e

autotools.eclass: add slibtool dir for aclocal

When using slibtoolize it needs the /usr/share/slibtool/slibtool.m4 file
to properly create the configure script. The current method of using it
is to set AT_SYS_M4DIR in make.conf, while this works for most cases it
does not work for app-crypt/tpm2-tss which uses ACLOCAL_AMFLAGS with the
'--install' argument in Makefile.am which results in it trying to
install .m4 files to /usr/share/slibtool. This thankfully fails due to
sandbox.

To solve this problem the /usr/share/slibtool path can be directly
added to "${T}"/aclocal/dirlist if the LIBTOOLIZE variable is set to
'slibtoolize'.

Closes: https://bugs.gentoo.org/950648
Signed-off-by: orbea <orbea <AT> riseup.net>
Part-of: https://github.com/gentoo/gentoo/pull/41062
Closes: https://github.com/gentoo/gentoo/pull/41062
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/autotools.eclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index f179d5f950e7..1866bb5fa629 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -378,7 +378,14 @@ eaclocal() {
        # See bug #677002
        if [[ ! -f "${T}"/aclocal/dirlist ]] ; then
                mkdir "${T}"/aclocal || die
-               cat <<- EOF > "${T}"/aclocal/dirlist || die
+               if [[ "${LIBTOOLIZE:-}" == 'slibtoolize' ]]; then
+                       cat <<- EOF > "${T}"/aclocal/dirlist || die
+                               ${BROOT}/usr/share/slibtool
+                               ${ESYSROOT}/usr/share/slibtool
+                       EOF
+               fi
+
+               cat <<- EOF >> "${T}"/aclocal/dirlist || die
                        ${BROOT}/usr/share/aclocal
                        ${ESYSROOT}/usr/share/aclocal
                EOF

Reply via email to