Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: aballier@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 13:36:03
Message-Id: 20130127143636.72c66a73@pomiocik.lan
In Reply to: Re: [gentoo-dev] [PATCH 2/5] Use explicit abi_* flags to select multilib targets. by Alexis Ballier
1 On Sun, 27 Jan 2013 09:34:13 -0300
2 Alexis Ballier <aballier@g.o> wrote:
3
4 > Very nice work; +1 on everything, it seems we'll finally get serious
5 > and official multilib support after all those years.
6 > I'm looking forward to get this in three :)
7
8 I am writing some kind of spec/summary right now.
9
10 > On Sat, 26 Jan 2013 23:08:13 +0100
11 > Michał Górny <mgorny@g.o> wrote:
12 > [...]
13 > > # @FUNCTION: multilib_get_enabled_abis
14 > > # @DESCRIPTION:
15 > > @@ -49,9 +64,20 @@ MULTILIB_USEDEP='multilib(-)?'
16 > > multilib_get_enabled_abis() {
17 > > debug-print-function ${FUNCNAME} "${@}"
18 > >
19 > > - if use multilib; then
20 > > - get_all_abis
21 > > - else
22 > > + local supported_abis=$(get_all_abis)
23 > > + local i found
24 > > + for i in "${_MULTILIB_FLAGS[@]}"; do
25 > > + local abi=${i#*:}
26 > > + local flag=${i%:*}
27 > > +
28 > > + if has "${abi}" ${supported_abis} && use "${flag}";
29 > > then
30 > > + echo "${abi}"
31 > > + found=1
32 > > + fi
33 > > + done
34 > > +
35 > > + if [[ ! ${found} ]]; then
36 > > + debug-print "${FUNCNAME}: no ABIs enabled, fallback
37 > > to ${DEFAULT_ABI}" echo ${DEFAULT_ABI}
38 > > fi
39 > > }
40 >
41 > Just one thing here: I may have missed something, but how do you ensure
42 > the DEFAULT_ABI is last in the list ? It seems to me you rely on the
43 > order of _MULTILIB_FLAGS. I'd just skip it explicitly (if the
44 > corresponding useflag is enabled) and print DEFAULT_ABI at the end to be
45 > on the safe side, if it has been skipped.
46
47 That seems like a reasonable idea. I'd have a second and third look
48 at the function, and see if it wouldn't be better to just iterate over
49 $(get_all_abis) in the outer loop.
50
51 --
52 Best regards,
53 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature