You probably need to add a dependency on glib-2.0 to your recipe, then
the needed pkgconfig will be in the target sysroot.
If you can copy-paste the entire recipe, that would help.
Alex
On Tue, 14 May 2019 at 11:06, Tong Chen wrote:
>
> Hi all:
> I'm adding some kernel extensions to poky. In summary, I need to extend
> kallsyms, and the new functionality depends on glib-2.0.
> So I added pkg-confi in the ./scripts/Makefile:
>
> HOSTCFLAGS_kallsyms.o := $(shell pkg-config --cflags glib-2.0)
> -I$(srctree)/scripts
> HOSTLDLIBS_kallsyms := $(shell pkg-config --libs glib-2.0) -ldw
>
> But when compiling with bitbake, the following error occurs:
>
> | Package glib-2.0 was not found in the pkg-config search path.
> | Perhaps you should add the directory containing `glib-2.0.pc'
> | to the PKG_CONFIG_PATH environment variable
> | No package 'glib-2.0' found
>
> Extrat the setting of PKG_CONFIG_PATH from temp/run.do_compile:
>
> Export
> PKG_CONFIG_PATH="/home/hchan/code/poky_new/poky/build_ctd/tmp/work/qemux86_64-poky-linux/linux-yocto/5.0.7+gitAUTOINC+d26eec23cf_891531d68e-r0/recipe-sysroot/usr/lib/pkgconfig
>
> :/home/hchan/code/poky_new/poky/build_ctd/tmp/work/qemux86_64-poky-linux/linux-yocto/5.0.7+gitAUTOINC+d26eec23cf_891531d68e-r0/recipe-sysroot/usr/share/pkgconfig"
>
> Look at the recipe-sysroot directory, where there is no corresponding
> glib-2.0.pc file, but in the recipe-sysroot-native directory, there is:
>
> ./recipe-sysroot-native/usr/lib/pkgconfig/glib-2.0.pc
>
> So my question is how to insert recipe-sysroot-native directory to
> PKG_CONFIG_PATH variable?
>
> I am not particularly familiar with poky/bitbake at the moment. By searching,
> I found these assignments. But not sure where to add it, and how to add:
>
> Hchan@hchan-ThinkPad:~/code/poky_new/poky$ grep --color -rnH 'export
> PKG_CONFIG_PATH=' ./meta*
> ./meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in:3:export
> PKG_CONFIG_PATH="@PATH_NATIVE@"
> ./meta/recipes-devtools/qemu/qemu.inc:85: export
> PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
> ./meta/classes/toolchain-scripts.bbclass:49: echo 'export
> PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig'
> >> $script
> ./meta/classes/toolchain-scripts.bbclass:72: echo 'export
> PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
>
> --
> Tom
>
> --
> ___
> linux-yocto mailing list
> linux-yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/linux-yocto
--
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto