pkg-config-native: allow kernel to be build with esdk
PATCH v2 1/1 pkg-config-native: allow kernel to be build with esdk
When the kernel's menuconfig target is called while using the esdk or an esdk-based container, the pkg-config info that is found is not correct. The pkg-config info is for the target, but we need the eSDK's information in order to build the host based menuconfig.
The new pkg-config-native script checks both that it's in SDK and being called from the check-lxdialog script in order to limit the scope of when the pkg-config automagically switches to pkg-config-native.
[YOCTO #11155]
Signed-off-by Saul Wold <[email protected]>
--- .../pkgconfig/pkgconfig/pkg-config-native.in | 25 ++++++++++++++++++---- meta/recipes-devtools/pkgconfig/pkgconfig_git.bb | 10 +++++---- 2 files changed, 27 insertions(+), 8 deletions(-)
meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in +21 -4
@@ -1,7 +1,24 @@ #! /bin/sh -PKG_CONFIG_PATH="@PATH_NATIVE@" -PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@" -unset PKG_CONFIG_SYSROOT_DIR +# Orignal pkg-config-native action when called as pkg-config-native +# NO Change here +if [ "pkg-config-native" = "`basename $0`" ] ; then + PKG_CONFIG_PATH="@PATH_NATIVE@" + PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@" + unset PKG_CONFIG_SYSROOT_DIR +else + # in this case we are in the esdk + if [ "$OE_SKIP_SDK_CHECK" = "1" ] ; then + parentpid=`ps -o ppid= -p $$` + parentpid_info=`ps -wo comm= -o args= -p $parentpid` -pkg-config "$@" + # check if we are being called from the kernel's make menuconfig + if ( echo $parentpid_info | grep -q check-lxdialog ) ; then + PKG_CONFIG_PATH="@PATH_NATIVE@" + PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@" + unset PKG_CONFIG_SYSROOT_DIR + fi + fi +fi + +pkg-config.real "$@"
meta/recipes-devtools/pkgconfig/pkgconfig_git.bb +6 -4
@@ -50,8 +50,10 @@ RPROVIDES_${PN} += "pkgconfig(pkg-config)" # Install a pkg-config-native wrapper that will use the native sysroot instead # of the MACHINE sysroot, for using pkg-config when building native tools. do_install_append_class-native () { - sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \ - -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \ - < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native - install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native + mv ${D}${bindir}/pkg-config ${D}${bindir}/pkg-config.real + sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \ + -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \ + < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native + install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native + ln -s pkg-config-native ${D}${bindir}/pkg-config }
Signature · 1 line
2.7.5