All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, david.marchand@redhat.com,
	bruce.richardson@intel.com, stable@dpdk.org,
	Jerin Jacob <jerinj@marvell.com>,
	Luca Boccassi <bluca@debian.org>
Subject: [dpdk-dev] [PATCH v2 1/1] devtools: fix build test config inheritance from env
Date: Thu, 12 Nov 2020 15:22:33 +0100	[thread overview]
Message-ID: <20201112142233.1433309-1-thomas@monjalon.net> (raw)
In-Reply-To: <20201109210009.919129-1-thomas@monjalon.net>

The variables DPDK_MESON_OPTIONS, PATH, PKG_CONFIG_PATH,
CPPFLAGS, CFLAGS and LDFLAGS can be customized in the config file
loaded by devtools/load-devel-config at each build.
The configuration can be adjusted per target thanks to the value set
in the DPDK_TARGET variable.

PKG_CONFIG_PATH is specific to each target, so it must be empty
before configuring each build from the file according to DPDK_TARGET.
Inheriting a default PKG_CONFIG_PATH for all targets does not make sense
and is prone to confusion.

DPDK_MESON_OPTIONS might take a global initial value from environment
to customize a build test from the shell. Example:
	DPDK_MESON_OPTIONS="b_lto=true"
Some target-specific options can be added in the configuration file:
	DPDK_MESON_OPTIONS="$DPDK_MESON_OPTIONS kernel_dir=$MYKERNEL"

Fixes: 272236741258 ("devtools: load target-specific compilation environment")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
---
v2:
- unset PKG_CONFIG_PATH because empty is printed by meson
- add more comments
---
 devtools/test-meson-builds.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 0c95d1cc98..f32b5784f4 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -38,10 +38,10 @@ else
 fi
 
 default_path=$PATH
-default_pkgpath=$PKG_CONFIG_PATH
 default_cppflags=$CPPFLAGS
 default_cflags=$CFLAGS
 default_ldflags=$LDFLAGS
+default_meson_options=$DPDK_MESON_OPTIONS
 
 check_cc_flags () # <flag to check> <flag2> ...
 {
@@ -52,12 +52,14 @@ check_cc_flags () # <flag to check> <flag2> ...
 load_env () # <target compiler>
 {
 	targetcc=$1
+	# reset variables before target-specific config
 	export PATH=$default_path
-	export PKG_CONFIG_PATH=$default_pkgpath
+	unset PKG_CONFIG_PATH # global default makes no sense
 	export CPPFLAGS=$default_cppflags
 	export CFLAGS=$default_cflags
 	export LDFLAGS=$default_ldflags
-	unset DPDK_MESON_OPTIONS
+	export DPDK_MESON_OPTIONS=$default_meson_options
+	# set target hint for use in the loaded config file
 	if [ -n "$target_override" ] ; then
 		DPDK_TARGET=$target_override
 	elif command -v $targetcc >/dev/null 2>&1 ; then
-- 
2.28.0


  parent reply	other threads:[~2020-11-12 14:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 21:00 [dpdk-dev] [PATCH 1/1] devtools: fix build test config inheritance from env Thomas Monjalon
2020-11-10 10:14 ` Bruce Richardson
2020-11-10 10:45   ` Thomas Monjalon
2020-11-10 11:20     ` Bruce Richardson
2020-11-10 14:08       ` Jerin Jacob
2020-11-10 17:18 ` Ferruh Yigit
2020-11-10 17:55   ` Thomas Monjalon
2020-11-10 18:09     ` Ferruh Yigit
2020-11-11  9:18       ` Bruce Richardson
2020-11-11 10:37         ` Thomas Monjalon
2020-11-11 11:00           ` Bruce Richardson
2020-11-11 11:13             ` Ferruh Yigit
2020-11-11 11:18               ` Thomas Monjalon
2020-11-12 14:22 ` Thomas Monjalon [this message]
2020-11-12 14:36   ` [dpdk-dev] [PATCH v2 " David Marchand

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=20201112142233.1433309-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=stable@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 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.