devtools: allow non-standard toolchain in meson test

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>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
This commit is contained in:
Thomas Monjalon 2020-06-15 00:18:44 +02:00
parent 444e556776
commit 3932237f10

View File

@ -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>