From gentoo-dev Sat Sep 22 15:16:24 2012 From: Luca Barbato Date: Sat, 22 Sep 2012 15:16:24 +0000 To: gentoo-dev Subject: Re: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions Message-Id: <505DD648.8030401 () gentoo ! org> X-MARC-Message: https://marc.info/?l=gentoo-dev&m=134832713227382 On 09/21/2012 06:06 PM, Zac Medico wrote: > On 09/20/2012 10:34 AM, Ambroz Bizjak wrote: >> The question now is, how should this method for checking >> --crosscompile be implemented? In particular, we have two options: >> >> - Environment variable. If so, how to call it? Possible names are >> CROSSCOMPILE, GENTOO_CROSSCOMPILE, PORTAGE_CROSSCOMPILE, >> ECROSSCOMPILE... For more generic names (CROSSCOMPILE) it needs to be >> taken into account that they may inadvertently affect packages. >> However environment vars have the benefit that it's easy to pass them >> through programs and scripts. >> >> - Internal function, similar to "use". Probably "is_crosscompile". >> This may look nicer and reduces the risk of collisions. > > Since it's just a boolean flag, we could have a special "crosscompile" > USE flag for this, so that the use() function could be used like we > currently use it for the "test" USE flag. The flag would be forced on or > off based on your configuration, similar to the "test" flag [1], so > there wouldn't be any danger of the flag being accidentally enabled or > disabled. The flag could be bound to FEATURES=crosscompile, or some > other package manager configuration variable. Note that if we add a > --crosscompile option to emerge, then we'll also have to add it to the > ebuid(1) command, so maybe it's better to forgo the commandline option > and just toggle it with a configuration variable like > FEATURES=crosscompile. Also, it's conceivable that you could drop the > CROSS_HDEPEND variable, in favor of HDEPEND="crosscompile? ( foo )" > syntax (somewhat in alignment with Brian Harring's DEPENDENCIES proposal). > > [1] https://bugs.gentoo.org/show_bug.cgi?id=373209 > I like the idea. lu