[2/4] devtools: allow non-standard toolchain in meson test
Checks
Commit Message
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@monjalon.net>
---
devtools/test-meson-builds.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
@@ -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>