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

Paul Eggleton paul.eggleton at linux.intel.com
Tue Oct 14 08:35:51 PDT 2014


On Tuesday 23 September 2014 11:38:35 Matt Schuckmann wrote:
> Paul Eggleton wrote:
> > So the way our system works, we assume that a recipe will have a main
> > package and in the case of a library that that will contain the actual
> > library file; the dev package just contains headers and the non-
> > versioned symlink to the library. Thus if you install the -dev package,
> > it's assumed it won't be of any use unless you install the main
> > package, hence the hard dependency. Also, the -staticdev package
> > depends upon the -dev package. However, if the main package is empty,
> > it won't be produced at all, but the -dev package still depends upon it
> > and you'll get the error above. If all you want to do is ship a static
> > .a file in the -staticdev package and you're never going to have a main
> > package, probably the thing to do is just drop the dependency on the
> > main package, by adding the following to your recipe:
> > 
> > RDEPENDS_${PN}-dev = ""
> 
> Ok that did it.
> The final solution was to add
> RDEPENDS_${PN}-dev = ""
> To the library recipe file so that dev and staticdev don't depend on the
> binary package (because it's empty because it's a static library).
> 
> And to add the staticdev packages to the TOOLCHAIN_TARGET_TASK list in the
> image file. (question could this part be put in a package group, should
> it?)

It could be, that's largely up to how you want to package things for convenience.

> That was really hard for a beginner to figure out, I never would have gotten
> it without your help Paul. It makes sense now but I don't think I could
> have figured it out from just reading the documentation (partially because
> there is so much documentation and variation in how things are done).
> 
> It seems like there should be a repository of example recipes covering
> common cases like this, has anything been started?

Well, I'd hope that what we provide in the "Writing a new recipe" manual
section [1] should be helpful enough to get started, if not we should extend
or improve that. 

Another thing we should look at going forward is trying to avoid annoying
issues such as this one coming up at all. For example we could change the
RDEPENDS relationship here to an RRECOMMENDS and then it shouldn't cause the
error to occur. FYI I've opened an enhancement bug to track improving the
behaviour in this situation:

  https://bugzilla.yoctoproject.org/show_bug.cgi?id=6839

Cheers,
Paul

[1] http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#new-recipe-writing-a-new-recipe

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list