DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: bruce.richardson@intel.com
Cc: bluca@debian.org, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] devtools: fix test of ninja install
Date: Sat, 14 Sep 2019 11:04:47 +0200	[thread overview]
Message-ID: <20190914090447.5707-1-thomas@monjalon.net> (raw)

When trying to compile some examples with libdpdk.pc,
the right environment (for default target) was not loaded.
The consequence is to not detect some dependencies because
of missing directories in PKG_CONFIG_PATH.

The environment preparation is moved to a dedicate function,
and called for the default target (cc),
before testing the install output of the default build.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/test-meson-builds.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 2eb9b23b0..08e83eb5c 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -37,11 +37,15 @@ fi
 default_path=$PATH
 default_pkgpath=$PKG_CONFIG_PATH
 
-reset_env ()
+load_env () # <target compiler>
 {
+	targetcc=$1
 	export PATH=$default_path
 	export PKG_CONFIG_PATH=$default_pkgpath
 	unset DPDK_MESON_OPTIONS
+	command -v $targetcc >/dev/null 2>&1 || return 1
+	DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+	. $srcdir/devtools/load-devel-config
 }
 
 build () # <directory> <target compiler> <meson options>
@@ -52,10 +56,7 @@ build () # <directory> <target compiler> <meson options>
 	shift
 	# skip build if compiler not available
 	command -v ${CC##* } >/dev/null 2>&1 || return 0
-	command -v $targetcc >/dev/null 2>&1 || return 0
-	reset_env
-	DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
-	. $srcdir/devtools/load-devel-config
+	load_env $targetcc || return 0
 	if [ ! -f "$builddir/build.ninja" ] ; then
 		options="--werror -Dexamples=all"
 		for option in $DPDK_MESON_OPTIONS ; do
@@ -128,6 +129,7 @@ build_path=build-x86-default
 export DESTDIR=$(pwd)/$build_path/install-root
 $ninja_cmd -C $build_path install
 
+load_env cc
 pc_file=$(find $DESTDIR -name libdpdk.pc)
 export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
 
-- 
2.23.0


             reply	other threads:[~2019-09-14  9:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-14  9:04 Thomas Monjalon [this message]
2019-09-16 15:48 ` Thomas Monjalon

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=20190914090447.5707-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).