How to set environment variables inside a recipe?


Bodke, Kishore K <kishore.k.bodke@...>
 

Hi,

 

I am writing a recipe to build a driver specific for  my BSP.

 

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?

 

Any suggestions would be helpful.

 

Thanks

Kishore.


Paul Eggleton
 

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.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre


Bodke, Kishore K <kishore.k.bodke@...>
 

-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton@...]
Sent: Friday, July 20, 2012 3:14 AM
To: Bodke, Kishore K
Cc: yocto@...
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.


Robert P. J. Day
 

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



-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton@...]
Sent: Friday, July 20, 2012 3:14 AM
To: Bodke, Kishore K
Cc: yocto@...
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
========================================================================


Bodke, Kishore K <kishore.k.bodke@...>
 

-----Original Message-----
From: Robert P. J. Day [mailto:rpjday@...]
Sent: Friday, July 20, 2012 10:13 AM
To: Bodke, Kishore K
Cc: Paul Eggleton; yocto@...
Subject: Re: [yocto] How to set environment variables inside a recipe?

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



-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton@...]
Sent: Friday, July 20, 2012 3:14 AM
To: Bodke, Kishore K
Cc: yocto@...
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 "=".
Yes, the spaces was an issue.
Works fine now.

Thanks
Kishore.