I am working with yocto linux recipes. I am trying to make a recipe which simply copies a prebuilt MyLibrary.a and its headers available on the built linux image. So, I have a libMyLibrary.a which I want to copy to /usr/lib. And MyLibrary's headers files MyLibrary.h and MyLibrary.hpp into /usr/include. Note that MyLibrary is already built and I just want to copy the binary and headers into desired locations of the built linux image.

So following is the recipe:

SUMMARY = "Script to make a static library available in yocto linux image"

FILES_${PN} += "${libdir}"

SRC_URI = "file://libMyLibrary.a \
           file://MyLibrary..hpp \
           file://MyLibrary..h \

S = "${WORKDIR}"

do_install () {
    install -d ${D}${libdir}
    install -d ${D}${includedir}
    install -m 0644 ${WORKDIR}/libMyLibrary.a ${D}${libdir}/
    install -m 0644 ${WORKDIR}/MyLibrary.h ${D}${includedir}/
    install -m 0644 ${WORKDIR}/MyLibrary.hpp ${D}${includedir}/

Initially I started with getting some errors in the do_install step. I resolved them but now the do_rootfs step is complaining about my bb file that is mylibrary_1.0.bb. I am pretty sure that the parent recipe that calls my recipe has no errors since it builds a lot of other recipes and mine is just additional to it. Also, the errors started to appear after I wrote the do_install step.

Can someone point out what is wrong with my recipe above?
Or is there a simple example recipe which copies a .a and its headers into the desired location i.e. /usr/lib and /usr/include like I am doing above?

  • Looks correct to me ... you will need to provide more details on the errors you are getting. Could it be that the licence (CLOSED) is not a known one? (at least by me :-) Also, why the two dots in the header file names? – Murray Jensen Jan 8 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.