--- gx86/eclass/multilib-build.eclass | 45 ++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 24 deletions(-)
diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass index b1afd85..4321e45 100644 --- a/gx86/eclass/multilib-build.eclass +++ b/gx86/eclass/multilib-build.eclass @@ -23,7 +23,7 @@ case ${EAPI:-0} in *) die "EAPI=${EAPI} is not supported" ;; esac -inherit multilib multiprocessing +inherit multibuild multilib # @ECLASS-VARIABLE: _MULTILIB_FLAGS # @INTERNAL @@ -85,6 +85,19 @@ multilib_get_enabled_abis() { fi } +# @FUNCTION: _multilib_multibuild_wrapper +# @USAGE: <argv>... +# @INTERNAL +# @DESCRIPTION: +# Initialize the environment for ABI selected for multibuild. +_multilib_multibuild_wrapper() { + debug-print-function ${FUNCNAME} "${@}" + + local ABI=${MULTIBUILD_VARIANT} + multilib_toolchain_setup "${ABI}" + "${@}" +} + # @FUNCTION: multilib_foreach_abi # @USAGE: <argv>... # @DESCRIPTION: @@ -95,14 +108,11 @@ multilib_get_enabled_abis() { # If multilib support is disabled, it just runs the commands. No setup # is done. multilib_foreach_abi() { - local initial_dir=${BUILD_DIR:-${S}} + debug-print-function ${FUNCNAME} "${@}" - local ABI - for ABI in $(multilib_get_enabled_abis); do - multilib_toolchain_setup "${ABI}" - local BUILD_DIR=${initial_dir%%/}-${ABI} - "${@}" | tee -a "${T}/build-${ABI}.log" - done + local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) + + multibuild_foreach _multilib_multibuild_wrapper "${@}" } # @FUNCTION: multilib_parallel_foreach_abi @@ -118,24 +128,11 @@ multilib_foreach_abi() { # # Useful for running configure scripts. multilib_parallel_foreach_abi() { - local initial_dir=${BUILD_DIR:-${S}} - - multijob_init - - local ABI - for ABI in $(multilib_get_enabled_abis); do - ( - multijob_child_init - - multilib_toolchain_setup "${ABI}" - local BUILD_DIR=${initial_dir%%/}-${ABI} - "${@}" 2>&1 | tee -a "${T}/build-${ABI}.log" - ) & + debug-print-function ${FUNCNAME} "${@}" - multijob_post_fork - done + local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) - multijob_finish + multibuild_parallel_foreach _multilib_multibuild_wrapper "${@}" } # @FUNCTION: multilib_check_headers -- 1.8.1.4