All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: openembedded-core@lists.openembedded.org,
	richard.purdie@linuxfoundation.org
Subject: [PATCH] pkg-config: allow kernel to be build with esdk
Date: Wed, 14 Jun 2017 07:03:01 -0700	[thread overview]
Message-ID: <1497448981-8637-1-git-send-email-sgw@linux.intel.com> (raw)

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@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



             reply	other threads:[~2017-06-14 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 14:03 Saul Wold [this message]
2017-06-20 14:03 ` [PATCH] pkg-config: allow kernel to be build with esdk Saul Wold
2017-06-23 14:47 ` Richard Purdie
2017-06-23 23:38   ` Saul Wold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497448981-8637-1-git-send-email-sgw@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.