Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Ability to pass arguments to src_configure/src_compile
Date: Mon, 08 Sep 2008 09:31:06
Message-Id: b41005390809080231u1edac04cjf0e22d2d0cf4fdc7@mail.gmail.com
In Reply to: Re: [gentoo-dev] [RFC] Ability to pass arguments to src_configure/src_compile by "Santiago M. Mola"
1 On Mon, Sep 8, 2008 at 1:58 AM, Santiago M. Mola <coldwind@g.o> wrote:
2 > On Mon, Sep 8, 2008 at 10:44 AM, Alec Warner <antarus@g.o> wrote:
3 >>
4 >> Most obvious failure cases these days have build logs and the build
5 >> logs will specify what the configure command
6 >> was, so the only problematic area is looking at the ebuild to
7 >> determine what will happen during execution. Arguably having
8 >> an ebuildshell would assist here. However, ebuilds are already
9 >> sufficiently complicated by eclass inheritance that reading
10 >> many ebuilds is already difficult and I think this extension does not
11 >> make that significantly worse.
12 >
13 > If you're just dealing with the default phases, it's not too hard to
14 > say in advance the exact command that will be executed. Default phases
15 > are well-defined in PMS. So you can look at them to see what will
16 > happend if you define some variable.
17
18 The point is that it is not in the ebuild; you need to look it
19 up...unless you have all the default functions memorized? :)
20
21 >
22 > For example, for the proposed arguments for src_configure, a
23 > definition would be something like this (taken from Exherbo, just
24 > pretend it says USE instead OPTION and you're done):
25 > default_src_configure()
26 > {
27 > if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
28 > econf \
29 > "${DEFAULT_SRC_CONFIGURE_PARAMS[@]}" \
30 > $(for s in "${DEFAULT_SRC_CONFIGURE_OPTION_ENABLES}" ; do \
31 > option_enable ${s} ; \
32 > done ) \
33 > $(for s in "${DEFAULT_SRC_CONFIGURE_OPTION_WITHS}" ; do \
34 > option_with ${s} ; \
35 > done )
36 > fi
37 > }
38 >
39 > It's quite straightforward.
40 >
41 > Regards,
42 > --
43 > Santiago M. Mola
44 > Jabber ID: cooldwind@×××××.com
45 >
46 >