Same idea than overriding PATH and PKG_CONFIG_PATH, it can be quite
useful to override compilation flags like CFLAGS, CPPFLAGS and LDFLAGS
for cross compilation or libraries that won't provide a pkg-config file.
Fixes:
272236741258 ("devtools: load target-specific compilation environment")
Signed-off-by: David Marchand <david.marchand@redhat.com>
default_path=$PATH
default_pkgpath=$PKG_CONFIG_PATH
+default_cppflags=$CPPFLAGS
+default_cflags=$CFLAGS
+default_ldflags=$LDFLAGS
load_env () # <target compiler>
{
targetcc=$1
export PATH=$default_path
export PKG_CONFIG_PATH=$default_pkgpath
+ export CPPFLAGS=$default_cppflags
+ 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')