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

Robert P. J. Day rpjday at crashcourse.ca
Fri Jul 20 10:13:24 PDT 2012


On Fri, 20 Jul 2012, Bodke, Kishore K wrote:

>
>
> >-----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

  pretty sure you can't have spaces around the "=".

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the yocto mailing list