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 5988E1386BE for ; Sat, 26 Jan 2013 22:08:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D920C21C049; Sat, 26 Jan 2013 22:08:21 +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 DEA5D21C046 for ; Sat, 26 Jan 2013 22:08:20 +0000 (UTC) Received: from pomiocik.lan (159-205-85-177.adsl.inetia.pl [159.205.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 6637033DBB9; Sat, 26 Jan 2013 22:08:18 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: amd64@gentoo.org, releng@gentoo.org, x11@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/5] Use explicit abi_* flags to select multilib targets. Date: Sat, 26 Jan 2013 23:08:13 +0100 Message-Id: <1359238096-13232-3-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1359238096-13232-1-git-send-email-mgorny@gentoo.org> References: <1359238096-13232-1-git-send-email-mgorny@gentoo.org> 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: e28fe9dd-e60e-426c-bb59-7b14991f0912 X-Archives-Hash: 71a35d319dac1fb9713e7cb19348560a This time, following suggestions from Alexis Ballier, the complete list of USE flags and corresponding ABIs is stored in a single variable. I have removed the arch hack and all selected ABIs are validated against $(get_all_abis) from multilib.eclass. --- gx86/eclass/multilib-build.eclass | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass index 20d4f1c..a6104e0 100644 --- a/gx86/eclass/multilib-build.eclass +++ b/gx86/eclass/multilib-build.eclass @@ -25,7 +25,14 @@ esac inherit multilib multiprocessing -IUSE=multilib +# @ECLASS-VARIABLE: _MULTILIB_FLAGS +# @INTERNAL +# @DESCRIPTION: +# The list of multilib flags and corresponding ABI values. +_MULTILIB_FLAGS=( + abi_x86_32:x86 + abi_x86_64:amd64 +) # @ECLASS-VARIABLE: MULTILIB_USEDEP # @DESCRIPTION: @@ -37,7 +44,15 @@ IUSE=multilib # RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}] # net-libs/libbar[ssl,${MULTILIB_USEDEP}]" # @CODE -MULTILIB_USEDEP='multilib(-)?' + +_multilib_build_set_globals() { + local flags=( "${_MULTILIB_FLAGS[@]%:*}" ) + local usedeps=${flags[@]/%/(-)?} + + IUSE=${flags[*]} + MULTILIB_USEDEP=${usedeps// /,} +} +_multilib_build_set_globals # @FUNCTION: multilib_get_enabled_abis # @DESCRIPTION: @@ -49,9 +64,20 @@ MULTILIB_USEDEP='multilib(-)?' multilib_get_enabled_abis() { debug-print-function ${FUNCNAME} "${@}" - if use multilib; then - get_all_abis - else + local supported_abis=$(get_all_abis) + local i found + for i in "${_MULTILIB_FLAGS[@]}"; do + local abi=${i#*:} + local flag=${i%:*} + + if has "${abi}" ${supported_abis} && use "${flag}"; then + echo "${abi}" + found=1 + fi + done + + if [[ ! ${found} ]]; then + debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${DEFAULT_ABI}" echo ${DEFAULT_ABI} fi } -- 1.8.1.1