Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: amd64@g.o, devrel@g.o, x11@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/2] Use new multilib flags in autotools-multilib.
Date: Wed, 23 Jan 2013 23:24:48
Message-Id: 1358983437-18752-3-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [RFC] Initial proof-of-concept for explicit x86 multilib flags by "Michał Górny"
1 This is mostly a proof-of-concept. If approved, I will work on moving
2 the code into a separate eclass, possibly named 'multilib-build' ;).
3 ---
4 gx86/eclass/autotools-multilib.eclass | 24 +++++++++++++++++++++---
5 1 file changed, 21 insertions(+), 3 deletions(-)
6
7 diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass
8 index 7c8697a..eef7bcc 100644
9 --- a/gx86/eclass/autotools-multilib.eclass
10 +++ b/gx86/eclass/autotools-multilib.eclass
11 @@ -32,7 +32,23 @@ inherit autotools-utils multilib
12
13 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
14
15 -IUSE=multilib
16 +# Declare all of them, profiles will control their visibility.
17 +IUSE='abi_x86_32 abi_x86_64'
18 +
19 +# @FUNCTION: _autotools-multilib_get_enabled_abis
20 +# @DESCRIPTION:
21 +# Get the list of enabled ABIs. The returned names are suitable for use
22 +# with multilib.eclass.
23 +#
24 +# If multilib is not enabled or not supported, returns an empty list.
25 +_autotools-multilib_get_enabled_abis() {
26 + debug-print-function ${FUNCNAME} "${@}"
27 +
28 + if use amd64; then
29 + use abi_x86_64 && echo amd64
30 + use abi_x86_32 && echo x86
31 + fi
32 +}
33
34 # @FUNCTION: autotools-multilib_foreach_abi
35 # @USAGE: argv...
36 @@ -46,9 +62,11 @@ IUSE=multilib
37 autotools-multilib_foreach_abi() {
38 local initial_dir=${BUILD_DIR:-${S}}
39
40 - if use multilib; then
41 + local multilib_abis=$(_autotools-multilib_get_enabled_abis)
42 +
43 + if [[ ${multilib_abis} ]]; then
44 local ABI
45 - for ABI in $(get_all_abis); do
46 + for ABI in ${multilib_abis}; do
47 multilib_toolchain_setup "${ABI}"
48 BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
49 done
50 --
51 1.8.1.1

Replies