[OE-core] [PATCH] pkg-config: allow kernel to be build with esdk
Saul Wold
sgw at linux.intel.com
Wed Jun 14 14:03:01 UTC 2017
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 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.
This script also replaces the default pkg-config-native script.
[YOCTO #11155]
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
.../pkgconfig/pkgconfig/pkg-config.in | 22 ++++++++++++++++++++++
meta/recipes-devtools/pkgconfig/pkgconfig_git.bb | 14 ++++++++++----
2 files changed, 32 insertions(+), 4 deletions(-)
create mode 100644 meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config.in
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config.in b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config.in
new file mode 100644
index 0000000..dabec47
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config.in
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+do_native=0
+
+parentpid=`ps -o ppid= -p $$`
+parentpid_info=`ps -wo comm= -o args= -p $parentpid`
+
+# in this case we are in the esdk and being called from
+# the kernel's make menuconfig
+if [ "pkg-config-native" = "`basename $0`" ] ||
+ ([ "$OE_SKIP_SDK_CHECK" = "1" ] &&
+ ( echo $parentpid_info | grep -q check-lxdialog )) ; then
+ do_native=1
+fi
+
+if [ $do_native -eq 1 ] ; then
+ PKG_CONFIG_PATH="@PATH_NATIVE@"
+ PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+ unset PKG_CONFIG_SYSROOT_DIR
+fi
+
+pkg-config.real "$@"
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
index e634021..3ec7458 100644
--- a/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -12,6 +12,7 @@ SRCREV = "edf8e6f0ea77ede073f07bff0d2ae1fc7a38103b"
PV = "0.29.2+git${SRCPV}"
SRC_URI = "git://anongit.freedesktop.org/pkg-config \
+ file://pkg-config.in \
file://pkg-config-native.in \
file://fix-glib-configure-libtool-usage.patch \
file://0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch \
@@ -47,11 +48,16 @@ FILES_${PN} += "${datadir}/aclocal/pkg.m4"
# specifying an appropriate provide.
RPROVIDES_${PN} += "pkgconfig(pkg-config)"
+do_install_append () {
+ 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.in > ${B}/pkg-config
+ install -m755 ${B}/pkg-config ${D}${bindir}/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
+ install -m755 ${B}/pkg-config ${D}${bindir}/pkg-config-native
}
--
2.7.4
More information about the Openembedded-core
mailing list