[oe] Making bitbake directives conditional

Michael Morrell Michael.Morrell at palm.com
Mon Jan 25 21:32:21 UTC 2010


>On Thursday 31 December 2009 19:55:52 Michael Morrell wrote:
>> I have two quick OE questions.
>> 
>> First, is it possible to use any of the "directives" in a bb file or conf
>>  file based on a condition?  For example, can I "inherit" a class or use
>>  "addtask" only under certain conditions.  I couldn't find a way to do
>>  this.

>The question is why do you need this? What would be your usecase? You could 
>achieve this with inherit ${MY_VAR} and then have MY_VAR be either "base" 
>(which is already included) or what you want... but this is kind of ugly >and hard to understand.

Agreed this might work, but is ugly.

One reason why I'd like to do this is so that "inherit package" which adds the package and package_write tasks isn't done if PACKAGES is empty (like for native package).  It is more efficient to not have these tasks scheduled and executed since they don't do anything in this case.

I was thinking about implementing something like:

  inherit <name> [if <cond>]

By the way, is there a difference between using "inherit" and assigning to the INHERIT variable?

  Michael




More information about the Openembedded-devel mailing list