Including specific header files in yocto build
Asked Answered
B

1

6

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!

Bob answered 28/9, 2015 at 9:23 Comment(2)
These files get packaged by the original recipe as far as I can see: headers end up in ${PN}-dev package by default. Are you sure your newly installed headers are not in the -dev package?Eolanda
When I look in the build area for alsa (alsa-lib/1.0.27.2-r0) they appear to be there in several locations but never get put into the image rootfs. When I look in packages-split/alsa-lib-dev/usr/include I just get one directory 'sys' but if I look into alsa-lib/1.0.27.2-r0/package/ I get the usr/include dir I expect. In the image dir under alsa-lib/1.0.27.2-r0 I also get the dirs I expect i.e. include, bin, lib etc.... but for some reason this does not end up on the final image rootfs.Bob
J
3

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.

Jamieson answered 29/9, 2015 at 6:15 Comment(1)
Thanks Anders it helped me to the point I needed to be at but I fixed it in the end with IMAGE_INSTALL += "alsa-dev" because the alsa-lib-dev package has a large number of ancilliary files that I don't need and doesn't seem to have the alsa ones I required (!)Bob

© 2022 - 2024 — McMap. All rights reserved.