[dpdk-dev] [PATCH v2 4/6] devtools/test-meson-builds: add testing of pkg-config file
Bruce Richardson
bruce.richardson at intel.com
Fri Apr 26 18:50:41 CEST 2019
The pkg-config file generated as part of the build of DPDK should allow
applications to be built with an installed DPDK. We can test this as
part of the build by doing an install of DPDK to a temporary directory
within the build folder, and by then compiling up a few sample apps
using make working off that directory.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Luca Boccassi <bluca at debian.org>
---
devtools/test-meson-builds.sh | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 630a1a6fe..73f993b98 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -15,6 +15,11 @@ srcdir=$(dirname $(readlink -f $0))/..
MESON=${MESON:-meson}
use_shared="--default-library=shared"
+if command -v gmake >/dev/null 2>&1 ; then
+ MAKE=gmake
+else
+ MAKE=make
+fi
if command -v ninja >/dev/null 2>&1 ; then
ninja_cmd=ninja
elif command -v ninja-build >/dev/null 2>&1 ; then
@@ -90,3 +95,25 @@ if command -v $c >/dev/null 2>&1 ; then
$use_shared --cross-file $f
done
fi
+
+##############
+# Test installation of the x86-default target, to be used for checking
+# the sample apps build using the pkg-config file for cflags and libs
+###############
+build_path=build-x86-default
+DESTDIR=`pwd`/$build_path/install-root ; export DESTDIR
+$ninja_cmd -C $build_path install
+
+pc_file=$(find $DESTDIR -name libdpdk.pc)
+PKG_CONFIG_PATH=$(dirname $pc_file) ; export PKG_CONFIG_PATH
+
+# rather than hacking our environment, just edit the .pc file prefix value
+sed -i -e "s|prefix=|prefix=$DESTDIR|" $pc_file
+
+for example in helloworld l2fwd l3fwd skeleton timer; do
+ echo "## Building $example"
+ $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example
+done
+
+echo ""
+echo "## $0: Completed OK"
--
2.21.0
More information about the dev
mailing list