[yocto] how to install debug library into packages

杜 昊 stephanie2839 at hotmail.com
Fri Apr 15 09:03:20 PDT 2016


hello everyone,
I’m new here und also a newbie to learn yocto.

Now I am writing my master theis which is related to embeded system using yocto.
I have an ua-SDK(source code included) und i need to install the ua package into sato-image, which runs on a Raspberrypi.First of all, i write a recipe "opcua" like this:

    SUMMARY = "this ist a recipe for building opc-ua sdk package"
    LICENSE = "MIT & RCL & OpenSSL & LGPL-3.0 & Apache-2.0"
    LIC_FILES_CHKSUM = "file:///home/yocto/workspace/poky/rpiHouseHello/tmp/work/armv6-vfp-poky-linux-gnueabi/ua-new/1.0-r0/license-destdir/ua-new/generic_Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10
    SRC_URI = "file:///home/yocto/workspace/poky/rpiHouseHello/downloads/uasdkcppclient-src-linux32-x86-gcc4.5.1-v1.4.2-275.tar.gz"
    S = "${WORKDIR}/sdk/src"
    DEPENDS += "libxml2 openssl"
    inherit cmake
    INSANE_SKIP_ua-new += "dev-deps"

The opcua package is installed successfully after bitbake opcua, and then i try to add the generated opcua package into sato-image by writing another recipe"sato-with-ua" like this

    DESCRIPTION = ""
    IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-openssh hwcodecs  dbg-pkgs tools-debug debug-tweaks"
    LICENSE = "MIT"
    inherit core-image
    IMAGE_INSTALL += " ua ua-dbg ua-staticdev ua-dev"

it was also installed sucessfully.After that I extracted sdk from this image by using:

bitbake sato-with-ua -c populated_sdk

There is also no problem.After that I try to check the functionality of this extracted sdk.My tutor gave me a test project written by c++. I try to build this project in eclipse.

But here comes the problem. the point is that eclipse can not found debug libraries---lib*d(for example libuabased.a) by linking libraries.I found that there is libuabase.a but no libuabased.a in my package.location of the package:/home/yocto/workspace/poky/rpiHouse/tmp/work/armv6-vfp-poky-linux-gnueabi/opcua/1.0-r0/packages-split.  In eclipse we develop project in debug version so it also needs libraries in debug version.

I'm confused that why yocto installed only release library but not debug library. Both are included in source code. yocto can only install one type?
so i try to modify the opcua recipe to include the debug library into my packages-split. After reading the reference of yocto I added the follows to my recipe "opcua":

    PACKAGES =+ " ${PN}-alibd ${PN}-solibd"
    FILES_${PN}-alibd = "${libdir}/libstackd.so"
    FILES_${PN}-solibd = "${libdir}/libuabased.a ${libdir}/libuaclientd.a ${libdir}/libuapkid.a ${libdir}/libxmlparserd.a"

After bitbake opcua I got the two new packages ${PN}-alibd and ${PN}-solibd indeed, but both packages are empty.All of those libraries what i listet above are not included. My first question is that, does this variable ${libdir} indicate /usr/lib of our host maschine. but i found there is no lib*d.a file in that directory. so i think maybe i make a mistake by understanding this variable. what does this  ${libdir} refered to?

My second question, how to install those debug libraries into my packages after bitbake the recipe. my goal is that i can get those debug libraries in the sato-with-ua image und then extract the sdk from this image.This sdk included those debug libraries sothat i can link them in my eclipse to develop my project correctly.

i am so sorry that i told a long story. This is the first time i made something related with software. so I beg your appologise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160415/a6c46688/attachment.html>


More information about the yocto mailing list