From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5312D138010 for ; Tue, 2 Apr 2013 21:42:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0015DE0E60; Tue, 2 Apr 2013 21:42:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2A8C3E0DF6 for ; Tue, 2 Apr 2013 21:42:39 +0000 (UTC) Received: from pomiocik.lan (87-205-60-160.adsl.inetia.pl [87.205.60.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id C3C1F335E33; Tue, 2 Apr 2013 21:42:35 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/2] multilib-build: set MULTILIB_ABI as the 'global' ABI value. Date: Tue, 2 Apr 2013 23:43:31 +0200 Message-Id: <1364939012-29714-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <20130402234242.5c97d709@pomiocik.lan> References: <20130402234242.5c97d709@pomiocik.lan> 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-Archives-Salt: 07e29c24-9b57-4b6b-991b-2e28416c30c5 X-Archives-Hash: ef7e674dc7131cf0965599ed9d07a9b1 --- gx86/eclass/multilib-build.eclass | 41 ++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass index dbaed70..fdaed6b 100644 --- a/gx86/eclass/multilib-build.eclass +++ b/gx86/eclass/multilib-build.eclass @@ -25,10 +25,22 @@ esac inherit multibuild multilib +# @ECLASS-VARIABLE: MULTILIB_ABI +# @DEFAULT-UNSET +# @DESCRIPTION: +# The current ABI, in form of base arch and sub-ABI, joined using +# an underscore. It's equal to the flag name with 'abi_' prefix +# stripped. +# +# Exported by multilib_foreach_abi, multilib_parallel_foreach_abi, +# multilib_for_best_abi. +# +# Example values: x86_32, mips_n32 + # @ECLASS-VARIABLE: _MULTILIB_FLAGS # @INTERNAL # @DESCRIPTION: -# The list of multilib flags and corresponding ABI values. +# The list of corresponding USE flags and ABI values. _MULTILIB_FLAGS=( abi_x86_32:x86 abi_x86_64:amd64 @@ -56,6 +68,7 @@ _multilib_build_set_globals() { _multilib_build_set_globals # @FUNCTION: multilib_get_enabled_abis +# @INTERNAL # @DESCRIPTION: # Return the ordered list of enabled ABIs if multilib builds # are enabled. The best (most preferred) ABI will come last. @@ -74,7 +87,7 @@ multilib_get_enabled_abis() { local m_flag=${i%:*} if [[ ${m_abi} == ${abi} ]] && use "${m_flag}"; then - echo "${abi}" + echo "${m_flag#abi_}" found=1 fi done @@ -87,7 +100,7 @@ multilib_get_enabled_abis() { debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${abi}" debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}" - echo ${abi} + echo default fi } @@ -99,8 +112,26 @@ multilib_get_enabled_abis() { _multilib_multibuild_wrapper() { debug-print-function ${FUNCNAME} "${@}" - local ABI=${MULTIBUILD_VARIANT} - multilib_toolchain_setup "${ABI}" + local MULTILIB_ABI=${MULTIBUILD_VARIANT} + local i + + if [[ ${MULTILIB_ABI} != default ]]; then + local ABI + + for i in "${_MULTILIB_FLAGS[@]}"; do + local m_abi=${i#*:} + local m_flag=${i%:*} + + if [[ ${MULTILIB_ABI} == ${m_flag#abi_} ]]; then + local -x ABI=${m_abi} + break + fi + done + + [[ ${ABI} ]] || die "Unable to match ${MULTILIB_ABI} to an ABI!" + multilib_toolchain_setup "${ABI}" + fi + "${@}" } -- 1.8.1.5