[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions
From:       Zac Medico <zmedico () gentoo ! org>
Date:       2012-09-21 16:06:58
Message-ID: 505C90A2.90405 () gentoo ! org
[Download RAW message or body]

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
-- 
Thanks,
Zac

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic