commit:     0be276b1530c1e98974b9bc0986ad57f882cb6bf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 29 14:26:52 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 29 14:29:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0be276b1

autotools.eclass: import ::prefix automake has_version edgecase logic

During bootstrapping, an automake may not exist yet (which is
sometimes fine if an ebuild doesn't actually need it).

Make the check non-fatal for prefix where automake doesn't
yet exist inside BROOT. We could probably do a bit better
here and inspect PATH but this is the logic which
has been used in ::prefix for a looong time, and it's
currently breaking bootstraps, so let's get it fixed.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/autotools.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index d6c5b7f0ec0d..025a93d207a4 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -525,8 +525,18 @@ autotools_env_setup() {
                        esac
                        has_version ${hv_args} "=sys-devel/automake-${pv}*" && 
export WANT_AUTOMAKE="${pv}" && break
                done
-               [[ ${WANT_AUTOMAKE} == "latest" ]] && \
-                       die "Cannot find the latest automake! Tried 
${_LATEST_AUTOMAKE[*]}"
+
+               # During bootstrap in prefix there might be no automake merged 
yet
+               # due to --nodeps, but still available somewhere in PATH.
+               # For example, ncurses needs local libtool on aix and hpux.
+               # So, make the check non-fatal where automake doesn't yet
+               # exist within BROOT. (We could possibly do better here
+               # and inspect PATH, but I'm not sure there's much point.)
+               if use prefix && [[ ! -x "${BROOT}"/usr/bin/automake ]] ; then
+                       [[ ${WANT_AUTOMAKE} == "latest" ]] && ewarn "Ignoring 
missing automake during Prefix bootstrap! Tried ${_LATEST_AUTOMAKE[*]}"
+               else
+                       [[ ${WANT_AUTOMAKE} == "latest" ]] && die "Cannot find 
the latest automake! Tried ${_LATEST_AUTOMAKE[*]}"
+               fi
        fi
        [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.71
 }

Reply via email to