[dpdk-dev] [PATCH 2/4] devtools: allow non-standard toolchain in meson test

Thomas Monjalon thomas at monjalon.net
Mon Jun 15 00:57:45 CEST 2020


If a compiler is not found in $PATH, the compilation test is skipped.
In some cases, the compiler could be found after extending $PATH
in an environment configuration script (called by load-devel-config).

The decision to skip is deferred to a later stage, after loading the
configuration script.

In such case, the variable DPDK_TARGET, used by the configuration script
as input, is the compiler name.

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 devtools/test-meson-builds.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 602167e43a..1d80a029aa 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -52,9 +52,15 @@ load_env () # <target compiler>
 	export CFLAGS=$default_cflags
 	export LDFLAGS=$default_ldflags
 	unset DPDK_MESON_OPTIONS
-	command -v $targetcc >/dev/null 2>&1 || return 1
-	DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+	if command -v $targetcc >/dev/null 2>&1 ; then
+		DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+	else # toolchain not yet in PATH: its name should be enough
+		DPDK_TARGET=$targetcc
+	fi
+	# config input: $DPDK_TARGET
 	. $srcdir/devtools/load-devel-config
+	# config output: $DPDK_MESON_OPTIONS, $PATH, $PKG_CONFIG_PATH, etc
+	command -v $targetcc >/dev/null 2>&1 || return 1
 }
 
 config () # <dir> <builddir> <meson options>
-- 
2.26.2



More information about the dev mailing list