[oe] getVar. setVar, "d", etc.

K. Richard Pixley rich.pixley at palm.com
Wed Feb 6 18:54:46 UTC 2008


Richard Purdie wrote:
> Once again I should remind people that := is usually a bad idea (see
> recent discussions).
That's counterintuitive and backwards from other build systems.  I've 
often pulled significant savings out of makefile based systems by 
switching from = to :=.  The problem being that "x = ${@ 
a_long_running_function() }" is a killer, especially when 
a_long_running_function is deterministic.  In that case, := requires 
exactly one call during assignment while = requires a fresh call for 
each and every reference.  The only down side of := assignments is that 
one needs to be savvy about sequencing assignments.  Luckily, with 
conditionals, any sequence of assignments can be expressed.

I used := in this situation specifically because of the sequence 
ordering.   The assignments in my example are dummies whose sole purpose 
is to force the side effects to happen at a predictable and early point 
in the run - specifically, before the assignment to SRC_URI.  If I don't 
force the side effects to happen at := time, then there's no reason to 
believe that they will have occurred prior to the expansion of ${PR} in 
${SRC_URI}.  (And, in fact, changing this doesn't affect my results).

I have discovered that converting the constructions into "python 
setting() {" seem to give them consistent contexts.  I don't understand 
why ${@ ... } lacks that context, but at least I have a way to proceed.  
Event handlers also seem to have consistent context so if I can reverse 
engineer what events actually exist, or force one to occur at the right 
time, then I should be able to get my assignments done early enough.

Neither these differences nor event handlers are very well described in 
the manual, btw.

Thanks for your help.  I think I'm over my hump now.  "python setting()" 
and event handlers should get me where I want to go now.

--rich






More information about the Openembedded-devel mailing list