Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including specific header files in yocto build

I am attempting to include specific header files in a yocto build that are found in dev packages. The packages are boost and alsa.

I have included the bitbake recipe files into my image recipe which is a bbappend of a core recipe (console-trdx-image.bb) as an IMAGE_INSTALL += and bitbaked the image.

When I look in my build work directory, in the packages for alsa and boost all the files are resident where I want them to be - usr/include/alsa as an example.

I am having difficulty getting the built/installed package material into the rootfs of the image itself.

My .bbappend for alsa is as follows:

    do_install_append() {

    # Create alsa dirs
    install -d ${D}/${includedir}/alsa
    install -d ${D}/${includedir}/alsa/sound
    # Install headers
    install -m 0755 ${S}/include/*.h ${D}/${includedir}/alsa
    install -m 0755 ${S}/include/sound/*.h ${D}/${includedir}/alsa/sound

}

# Include these files in the install on the target
FILES_${PN} += "${includedir}/alsa/*.h"

When I look in /usr/include in the rootfs of the created image there isn't anything there. Not a sausage.

Anyone any ideas why?

Thanks!

like image 712
Chris Avatar asked Oct 19 '22 01:10

Chris


1 Answers

First, you don't need our bbappend, just to package header files.

If you just bitbake alsa-lib, you'll get (amongst other things): $ ls tmp-glibc/work/i586-oe-linux/alsa-lib/1.0.29-r0/packages-split/alsa-lib-dev/usr/include/ alsa sys In the subdirectory alsa, you'll find all the installed header files for the alsa library.

However, those header files will normally not be installed onto you rootfs, as that would be pointless (most of the time). If you want to be able to develop against alsa-lib directly on your target, you should all alsa-lib-dev to your image. Preferably by adding IMAGE_INSTALL += "alsa-lib-dev" in your image recipe. You can also add IMAGE_INSTALL_append = " alsa-lib-dev" to local.conf. Note the use of _append and the leading space in the string.

Doing either of these will add all the header files to your rootfs.

like image 115
Anders Avatar answered Nov 01 '22 18:11

Anders