[yocto] How to set environment variables inside a recipe?

Bodke, Kishore K kishore.k.bodke at intel.com
Fri Jul 20 10:05:16 PDT 2012



>-----Original Message-----
>From: Paul Eggleton [mailto:paul.eggleton at linux.intel.com]
>Sent: Friday, July 20, 2012 3:14 AM
>To: Bodke, Kishore K
>Cc: yocto at yoctoproject.org
>Subject: Re: [yocto] How to set environment variables inside a recipe?
>
>On Thursday 19 July 2012 18:16:45 Bodke, Kishore K wrote:
>> The driver needs a bunch of environmental variables to be set ( specific to
>> driver only ) to build.
>>
>> Right now to move forward I am doing like below in my recipe to build it.
>>
>> export  AAA = "${S}"
>> export BBB = "${B}"
>> export CCC = "{S}/build-system"
>> export DDD = "{S}/env-files"
>>
>> Is this right way to do?  Are there any other ways to set the environment
>> variables inside a recipe?
>
>This is valid; I would recommend setting them within the function though (e.g.
>do_configure) rather than at the recipe level, assuming that works for your
>case.

If I set outside the do_configure it builds fine. 
But If I do inside 
do_confiugre() {
 export  AAA = "${S}"
 export BBB = "${B}"
 export CCC = "{S}/build-system"
 export DDD = "{S}/env-files"
}

run.do_configure.20832: line 78: export: `=': not a valid identifier
NOTE: task do_configure: Failed

Is the syntax wrong here? What is the correct syntax?

Thanks
Kishore.



More information about the yocto mailing list