eclass/autotools.eclass: Use proper arguments to has_version checking for automake...
authorAlexis Ballier <aballier@gentoo.org>
Wed, 16 May 2018 12:13:08 +0000 (14:13 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 16 May 2018 12:18:43 +0000 (14:18 +0200)
Bug: https://bugs.gentoo.org/655326

eclass/autotools.eclass

index ea85e73a8042586ca0a92d2249c87957d498236e..2bc70f7b3c001605810bd6f4c707ea07f73372fa 100644 (file)
@@ -442,10 +442,17 @@ autotools_env_setup() {
        if [[ ${WANT_AUTOMAKE} == "latest" ]]; then
                local pv
                for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do
-                       # has_version respects ROOT, but in this case, we don't want it to,
-                       # thus "ROOT=/" prefix;
                        # Break on first hit to respect _LATEST_AUTOMAKE order.
-                       ROOT=/ has_version "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
+                       local hv_args=""
+                       case ${EAPI:-0} in
+                               5|6)
+                                       hv_args="--host-root"
+                                       ;;
+                               7)
+                                       hv_args="-b"
+                                       ;;
+                       esac
+                       ROOT=/ 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[*]}"