summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2019-09-14 10:56:32 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-09-15 20:51:04 +0200
commitbd253daa7717835f88bbc58b09a94d0060380396 (patch)
tree2e3cd1249e763fd0f8d798260e9563a89f028ce3
parentbe7e90917e481ce593ef7b44bc2043ddc861ac9c (diff)
downloaddpdk-bd253daa7717835f88bbc58b09a94d0060380396.zip
dpdk-bd253daa7717835f88bbc58b09a94d0060380396.tar.gz
dpdk-bd253daa7717835f88bbc58b09a94d0060380396.tar.xz
devtools: fix test of ninja install
When trying to compile some examples with libdpdk.pc, the right environment (for default target) was not loaded. The consequence is to not detect some dependencies because of missing directories in PKG_CONFIG_PATH. The environment preparation is moved to a dedicate function, and called for the default target (cc), before testing the install output of the default build. Fixes: 272236741258 ("devtools: load target-specific compilation environment") Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
-rwxr-xr-xdevtools/test-meson-builds.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 2eb9b23..08e83eb 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -37,11 +37,15 @@ fi
default_path=$PATH
default_pkgpath=$PKG_CONFIG_PATH
-reset_env ()
+load_env () # <target compiler>
{
+ targetcc=$1
export PATH=$default_path
export PKG_CONFIG_PATH=$default_pkgpath
unset DPDK_MESON_OPTIONS
+ command -v $targetcc >/dev/null 2>&1 || return 1
+ DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+ . $srcdir/devtools/load-devel-config
}
build () # <directory> <target compiler> <meson options>
@@ -52,10 +56,7 @@ build () # <directory> <target compiler> <meson options>
shift
# skip build if compiler not available
command -v ${CC##* } >/dev/null 2>&1 || return 0
- command -v $targetcc >/dev/null 2>&1 || return 0
- reset_env
- DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
- . $srcdir/devtools/load-devel-config
+ load_env $targetcc || return 0
if [ ! -f "$builddir/build.ninja" ] ; then
options="--werror -Dexamples=all"
for option in $DPDK_MESON_OPTIONS ; do
@@ -128,6 +129,7 @@ build_path=build-x86-default
export DESTDIR=$(pwd)/$build_path/install-root
$ninja_cmd -C $build_path install
+load_env cc
pc_file=$(find $DESTDIR -name libdpdk.pc)
export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH