Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o, ambrop7@×××××.com
Subject: Re: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions
Date: Fri, 21 Sep 2012 16:08:14
Message-Id: 505C90A2.90405@gentoo.org
In Reply to: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions by Ambroz Bizjak
1 On 09/20/2012 10:34 AM, Ambroz Bizjak wrote:
2 > The question now is, how should this method for checking
3 > --crosscompile be implemented? In particular, we have two options:
4 >
5 > - Environment variable. If so, how to call it? Possible names are
6 > CROSSCOMPILE, GENTOO_CROSSCOMPILE, PORTAGE_CROSSCOMPILE,
7 > ECROSSCOMPILE... For more generic names (CROSSCOMPILE) it needs to be
8 > taken into account that they may inadvertently affect packages.
9 > However environment vars have the benefit that it's easy to pass them
10 > through programs and scripts.
11 >
12 > - Internal function, similar to "use". Probably "is_crosscompile".
13 > This may look nicer and reduces the risk of collisions.
14
15 Since it's just a boolean flag, we could have a special "crosscompile"
16 USE flag for this, so that the use() function could be used like we
17 currently use it for the "test" USE flag. The flag would be forced on or
18 off based on your configuration, similar to the "test" flag [1], so
19 there wouldn't be any danger of the flag being accidentally enabled or
20 disabled. The flag could be bound to FEATURES=crosscompile, or some
21 other package manager configuration variable. Note that if we add a
22 --crosscompile option to emerge, then we'll also have to add it to the
23 ebuid(1) command, so maybe it's better to forgo the commandline option
24 and just toggle it with a configuration variable like
25 FEATURES=crosscompile. Also, it's conceivable that you could drop the
26 CROSS_HDEPEND variable, in favor of HDEPEND="crosscompile? ( foo )"
27 syntax (somewhat in alignment with Brian Harring's DEPENDENCIES proposal).
28
29 [1] https://bugs.gentoo.org/show_bug.cgi?id=373209
30 --
31 Thanks,
32 Zac

Replies