[yocto] How to include static library and headers in sdk

Paul Eggleton paul.eggleton at linux.intel.com
Tue Sep 23 02:09:55 PDT 2014


On Monday 22 September 2014 18:57:03 Matt Schuckmann wrote:
> I've got a custom image and 2 custom recipes both very simple libraries that
> use cmake. I included the libraries into my image by adding
> EXTRA_IMAGEDEPENDS += "simple1"
> EXTRA_IMAGEDEPENDS += "simple2"
> To my image recipe.

Except this doesn't actually add those things into your image, it only ensures
they are built alongside it. To actually add them to the image you need to
ensure you add them to IMAGE_INSTALL; see:

http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage

> When I build my image (i.e. bitbake custom-image ) I can see that the
> library header files and .a files are placed in the correct place in the
> sysroot directory.
> 
> However when I try to create an sdk (i.e. bitbake custom-image -c
> populate_sdk) and then install the SDK the headers and .a files are nowhere
> to be found in the installed sysroot.

If you want all -staticdev packages in the SDK for the libraries in your
image, add the following to your local.conf (or the image recipe, doesn't
matter which):

 SDKIMAGE_FEATURES = "dev-pkgs dbg-pkgs staticdev-pkgs"

If you want a single staticdev package in the SDK you'd need to add the
following instead:

 TOOLCHAIN_HOST_TASK_append = " simple1-staticdev"

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list