[yocto] Building a package for target and native

Burton, Ross ross.burton at intel.com
Thu Dec 8 05:29:12 PST 2016


On 8 December 2016 at 13:03, <colin.helliwell at ln-systems.com> wrote:

> I’m creating a recipe for a 3rd party package.
>
> Part of its install is to create the target’s config file by running
> *itself* - obviously this doesn’t work as the target cpu is different to
> the host.
>
> I should be able to do a simple patch to alter the executable that the
> Makefile runs to generate the config file, but I’m trying to figure out the
> slickest (=correct!) way to get both architectures built.
>
> It looks like I can add
>
>    BBCLASSEXTEND=”native”
>
> to the recipe and then ‘bitbake mypkg-native’ will build for native, and
> ‘bitbake mypkg’ for the target.
>
> In which case, can I set up a dependency rule such that the target build
> is dependent on, i.e run after, the native?
>
> (The package itself will be pulled in with a   IMAGE_INSTALL += ” mypkg ”)
>
> Or is there a better approach to this in general?   e.g. a separate
> mypkg-native.bb which the target recipe then depends on.
>

If it's going to be running the main binary then BBCLASSEXTEND=native and
DEPENDS=mypkg-native will do what you want.  You can also tweak the native
build so that it just builds what is required instead of everything to save
time.

You'll have to patch the target makefile to run the binary from the native
sysroot and not the build, of course.

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20161208/760c8388/attachment.html>


More information about the yocto mailing list