All of lore.kernel.org
 help / color / mirror / Atom feed
* Detecting build type within recipe (target, native or nativesdk)
@ 2013-07-25 23:57 Christian Gagneraud
  2013-07-26  2:04 ` ChenQi
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Gagneraud @ 2013-07-25 23:57 UTC (permalink / raw)
  To: yocto

Hi there,

Is there a way to detect what kind of build is going on (target, native 
or nativesdk) from within a recipe or a class?

Basically when using 'BBCLASSEXTEND = "native nativesdk"', how can I 
tweak the build behaviour depending of the build type?

Does anyone know an example recipe I could use as a reference for doing 
these kind of things?

Regards,
Chris


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Detecting build type within recipe (target, native or nativesdk)
  2013-07-25 23:57 Detecting build type within recipe (target, native or nativesdk) Christian Gagneraud
@ 2013-07-26  2:04 ` ChenQi
  0 siblings, 0 replies; 2+ messages in thread
From: ChenQi @ 2013-07-26  2:04 UTC (permalink / raw)
  To: yocto

On 07/26/2013 07:57 AM, Christian Gagneraud wrote:
> Hi there,
>
> Is there a way to detect what kind of build is going on (target, 
> native or nativesdk) from within a recipe or a class?
>
> Basically when using 'BBCLASSEXTEND = "native nativesdk"', how can I 
> tweak the build behaviour depending of the build type?
>
> Does anyone know an example recipe I could use as a reference for 
> doing these kind of things?
>
> Regards,
> Chris
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
1. Use suffixes such as _class-native, _class-target, etc.
I think this is the preferred way.
Please grep the repo for more info.

2. Use ${PN} value.
e.g. (from dpkg.inc)
do_install_append () {
         if [ "${PN}" = "dpkg-native" ]; then
                 # update-alternatives doesn't have an offline mode
                 rm ${D}${bindir}/update-alternatives
                 sed -i -e 
's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' 
${D}${bindir}/dpkg-*
         else
                 mv ${D}${bindir}/update-alternatives ${D}${sbindir}
                 sed -i -e 
's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' 
${D}${bindir}/dpkg-*
         fi
}

Best Regards,
Chen Qi



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-26  2:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 23:57 Detecting build type within recipe (target, native or nativesdk) Christian Gagneraud
2013-07-26  2:04 ` ChenQi

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.