Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Cc: mgorny@g.o, amd64@g.o, releng@g.o, x11@g.o
Subject: Re: [gentoo-dev] [PATCH 2/5] Use explicit abi_* flags to select multilib targets.
Date: Sun, 27 Jan 2013 12:34:29
Message-Id: 20130127093413.6919d22b@gentoo.org
In Reply to: [gentoo-dev] [PATCH 2/5] Use explicit abi_* flags to select multilib targets. by "Michał Górny"
1 Very nice work; +1 on everything, it seems we'll finally get serious
2 and official multilib support after all those years.
3 I'm looking forward to get this in three :)
4
5
6 On Sat, 26 Jan 2013 23:08:13 +0100
7 Michał Górny <mgorny@g.o> wrote:
8 [...]
9 > # @FUNCTION: multilib_get_enabled_abis
10 > # @DESCRIPTION:
11 > @@ -49,9 +64,20 @@ MULTILIB_USEDEP='multilib(-)?'
12 > multilib_get_enabled_abis() {
13 > debug-print-function ${FUNCNAME} "${@}"
14 >
15 > - if use multilib; then
16 > - get_all_abis
17 > - else
18 > + local supported_abis=$(get_all_abis)
19 > + local i found
20 > + for i in "${_MULTILIB_FLAGS[@]}"; do
21 > + local abi=${i#*:}
22 > + local flag=${i%:*}
23 > +
24 > + if has "${abi}" ${supported_abis} && use "${flag}";
25 > then
26 > + echo "${abi}"
27 > + found=1
28 > + fi
29 > + done
30 > +
31 > + if [[ ! ${found} ]]; then
32 > + debug-print "${FUNCNAME}: no ABIs enabled, fallback
33 > to ${DEFAULT_ABI}" echo ${DEFAULT_ABI}
34 > fi
35 > }
36
37 Just one thing here: I may have missed something, but how do you ensure
38 the DEFAULT_ABI is last in the list ? It seems to me you rely on the
39 order of _MULTILIB_FLAGS. I'd just skip it explicitly (if the
40 corresponding useflag is enabled) and print DEFAULT_ABI at the end to be
41 on the safe side, if it has been skipped.
42
43 Alexis.

Replies