Skip to contentSkip to conversation

Building a package for target and native

DISCUSSION [email protected] 2 participants 2 messages Dec 8, 2016

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 17 lines · On 8 December 2016 at 13:03, <[email protected]> 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.

Quoted 8 lines

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