DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 6/6] devtools: load target-specific compilation environment
Date: Tue, 13 Aug 2019 01:03:58 +0200
Message-ID: <20190812230358.988-7-thomas@monjalon.net> (raw)
In-Reply-To: <20190812230358.988-1-thomas@monjalon.net>

In order to re-use the same test environment as with
test-build.sh, the configuration file is loaded at each build,
after adjusting the variable DPDK_TARGET.

This is especially useful to set the variable PKG_CONFIG_PATH,
or define some meson options (without -D) in DPDK_MESON_OPTIONS.

The DPDK_TARGET values can be
	aarch64-*, powerpc64-*, x86_64-*.
The matching DPDK_TARGET values for test-build.sh are
	arm64-*, ppc_64-*, x86_64-*.
The advised expressions to use in the common configuration file are:
	if echo $DPDK_TARGET | grep -q '^a.*64-' ; then
	elif echo $DPDK_TARGET | grep -q '^p.*pc.*64' ; then
	elif echo $DPDK_TARGET | grep -q '^x86_64' ; then
	fi

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

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index f2b0b347b..a51a04d5a 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -29,15 +29,32 @@ else
 	exit 1
 fi
 
+default_path=$PATH
+default_pkgpath=$PKG_CONFIG_PATH
+
+reset_env ()
+{
+	export PATH=$default_path
+	export PKG_CONFIG_PATH=$default_pkgpath
+	unset DPDK_MESON_OPTIONS
+}
+
 build () # <directory> <target compiler> <meson options>
 {
 	builddir=$1
 	shift
 	targetcc=$1
 	shift
+	reset_env
+	DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+	. $srcdir/devtools/load-devel-config
 	if command -v $CC $targetcc >/dev/null 2>&1 ; then
 		if [ ! -f "$builddir/build.ninja" ] ; then
-			options="--werror -Dexamples=all $*"
+			options="--werror -Dexamples=all"
+			for option in $DPDK_MESON_OPTIONS ; do
+				options="$options -D$option"
+			done
+			options="$options $*"
 			echo "$MESON $options $srcdir $builddir"
 			$MESON $options $srcdir $builddir
 			unset CC
-- 
2.22.0


  parent reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 23:03 [dpdk-dev] [PATCH 0/6] build system improvements Thomas Monjalon
2019-08-12 23:03 ` [dpdk-dev] [PATCH 1/6] build: remove redundant libs from pkgconfig Thomas Monjalon
2019-08-13  9:37   ` Luca Boccassi
2019-08-12 23:03 ` [dpdk-dev] [PATCH 2/6] drivers: add some reasons for meson disabling Thomas Monjalon
2019-08-13  9:38   ` Luca Boccassi
2019-08-12 23:03 ` [dpdk-dev] [PATCH 3/6] net/mlx: fix meson build with custom dependency path Thomas Monjalon
2019-08-13  9:38   ` Luca Boccassi
2019-08-14  8:39   ` Matan Azrad
2019-08-12 23:03 ` [dpdk-dev] [PATCH 4/6] net/mlx: fix build with make and recent gcc Thomas Monjalon
2019-08-13  9:39   ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
2019-08-14 10:19   ` [dpdk-dev] " Matan Azrad
2019-08-12 23:03 ` [dpdk-dev] [PATCH 5/6] devtools: test compiler availability only once Thomas Monjalon
2019-08-13  9:40   ` Luca Boccassi
2019-08-12 23:03 ` Thomas Monjalon [this message]
2019-08-13  9:41   ` [dpdk-dev] [PATCH 6/6] devtools: load target-specific compilation environment Luca Boccassi
2019-09-12 16:23 ` [dpdk-dev] [PATCH 0/6] build system improvements Thomas Monjalon

Reply instructions:

You may reply publically 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=20190812230358.988-7-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git