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

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


On Tuesday 23 September 2014 09:43:55 Matt Schuckmann wrote:
> > -----Original Message-----
> > From: Paul Eggleton [mailto:paul.eggleton at linux.intel.com]
> > Sent: Tuesday, September 23, 2014 2:10 AM
> > To: Matt Schuckmann
> > Cc: yocto at yoctoproject.org
> > Subject: Re: [yocto] How to include static library and headers in sdk
> > 
> > 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:
> If I add my simple1 and simple2 recipes to IMAGE_INSTALL I get the following
> error in the do_rootfs task: * opkg_install_cmd: Cannot install package
> simple1.
> 
> I assumed that this is because there really is nothing to install in the
> image as this is a static library with nothing that should go in the image.
> > 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"
> 
> Again if I try adding this to my image recipe I get a similar error
> * opkg_install_cmd: Cannot install package simple1-staticdev.
> 
> For reference here is my simple1 recipe, maybe I'm missing something in
> there.
> 
> DESCRIPTION = "Simple library 1."
> LICENSE = "CLOSED"
> LIC_FILES_CHKSUM = ""
> 
> SRC_URI = "git://git@gitlab.work.net/libs/simple1.git;protocol=ssh"
> SRCREV = "${AUTOREV}"
> 
> S = "${WORKDIR}/git"
> 
> inherit pkgconfig cmake

So is your recipe actually producing any packages at all? i.e. are any of the 
directories under packages-split within the workdir for the recipe non-empty? 
At the moment it looks like it isn't producing anything.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list