All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/2] toolchain-scripts.bbclass: Allow sourcing of subscript for environment
Date: Thu, 9 Oct 2014 18:27:16 -0500	[thread overview]
Message-ID: <543719D4.9080308@windriver.com> (raw)
In-Reply-To: <1412891594-9608-1-git-send-email-otavio@ossystems.com.br>

On 10/9/14, 4:53 PM, Otavio Salvador wrote:
> Sometimes we require extra environment settings to be available on the
> environment for proper SDK work. This were done, in past, using
> '_append' tasks however with the split of the environment in a
> canadian package this has been broken.
>
> The easier and more flexible solution is to use environment subscripts
> which are sources by the main script. These are now looked at:
>
>   $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh
>
> and sourced.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

I really like this approach.  However, is there any way for the subscripts to be 
arch specific?

--Mark

> ---
>   meta/classes/toolchain-scripts.bbclass |   10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
> index 6cc8eba..11ffbe5 100644
> --- a/meta/classes/toolchain-scripts.bbclass
> +++ b/meta/classes/toolchain-scripts.bbclass
> @@ -72,6 +72,16 @@ toolchain_shared_env_script () {
>   	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
>   	echo 'export ARCH=${ARCH}' >> $script
>   	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
> +
> +    cat >> $script <<EOF
> +
> +# Append environment subscripts
> +if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
> +    for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
> +	    source \$envfile
> +    done
> +fi
> +EOF
>   }
>
>   #we get the cached site config in the runtime
>



  parent reply	other threads:[~2014-10-09 23:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 21:53 [PATCH 1/2] toolchain-scripts.bbclass: Allow sourcing of subscript for environment Otavio Salvador
2014-10-09 21:53 ` [PATCH 2/2] meta-toolchain-qt: Fix environment population Otavio Salvador
2014-10-09 23:27 ` Mark Hatle [this message]
2014-10-10  0:41   ` [PATCH 1/2] toolchain-scripts.bbclass: Allow sourcing of subscript for environment Otavio Salvador
2014-10-10  0:53     ` Mark Hatle
2014-10-10 10:36       ` [PATCH] toolchains-scripts: Add support for target environment scripts Richard Purdie
2014-10-10 12:31         ` Otavio Salvador
2014-10-10 10:37       ` [PATCH 1/2] toolchain-scripts.bbclass: Allow sourcing of subscript for environment Richard Purdie
2014-10-10 13:17 ` Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=543719D4.9080308@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.