From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mail.openembedded.org (Postfix) with ESMTP id DA959781D3 for ; Tue, 20 Jun 2017 14:03:28 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2017 07:03:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="116621337" Received: from swold-mobl2.amr.corp.intel.com ([10.254.183.143]) by fmsmga005.fm.intel.com with ESMTP; 20 Jun 2017 07:03:10 -0700 Message-ID: <1497967390.13914.61.camel@linux.intel.com> From: Saul Wold To: openembedded-core@lists.openembedded.org, richard.purdie@linuxfoundation.org Date: Tue, 20 Jun 2017 07:03:10 -0700 In-Reply-To: <1497448981-8637-1-git-send-email-sgw@linux.intel.com> References: <1497448981-8637-1-git-send-email-sgw@linux.intel.com> X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Subject: Re: [PATCH] pkg-config: allow kernel to be build with esdk X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 14:03:29 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Ping on this patch? It has been tested with a variety of shells (sh, bash, dash, ash).  Is there any further concerns? Sau! On Wed, 2017-06-14 at 07:03 -0700, Saul Wold wrote: > 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 > --- >  .../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 >