[yocto] how to include a static library in SDK?

Anders Darander anders at chargestorm.se
Wed Mar 29 06:11:08 PDT 2017


Hi,

* Jovic, Vladimir <vladimir.jovic at ifm.com> [170329 11:10]:

> Hello,

> I have a recipe that creates a static library. The directory is as follows:
> example-staticlib/
> example-staticlib/example-staticlib_0.1.bb
> example-staticlib/files/
> example-staticlib/files/lib.c
> example-staticlib/files/lib.h
> example-staticlib/files/Makefile

> Files content is:


> 1.     example-staticlib_0.1.bb :

> DESCRIPTION = "example stared library"
> LICENSE = "LGPLv2"
> LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/LGPL-2.0;md5=9427b8ccf5cf3df47c29110424c9641a"
> SRC_URI = "file://lib.c \
>            file://lib.h \
>            file://Makefile"
> PR = "r0"
> S = "${WORKDIR}"
> ALLOW_EMPTY_${PN} = "1"
> do_install () {
>             oe_runmake install DEST=${D}
> }
> TOOLCHAIN_TARGET_TASK += "example-staticlib-dev"
> TOOLCHAIN_TARGET_TASK += "example-staticlib-staticdev"

If you only want this staticdev package, the line above should go into
your *image* recipe, not `example-staticlib`.




> When I do:
> bitbake core-image-minimal -c populate_sdk

Did you ever add:

TOOLCHAIN_TARGET_TASK += "example-staticlib-staticdev"

to core-image-minimal.bb or core-image-minimal.bbappend?

> I can see that the library and the header are in build/tmp/sysroot
> but when I call the generated script in build/tmp/deploy/sdk/ to install the sdk, I can see that the library is not installed in the sdk sysroot. The header is there, but the static library is not.

> I also tried adding this to local.conf:
> EXTRA_IMAGE_FEATURES += "staticdev-pkgs"
> but that also didn't install the library.

Like Ross stated, if you want *all* staticdev packages, you need to add

SDKIMAGE_FEATURES += "staticdev-pkgs"


Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB



More information about the yocto mailing list