[19.08,4/6] devtools/test-meson-builds: add testing of pkg-config file
diff mbox series

Message ID 20190503133537.58712-5-bruce.richardson@intel.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
  • improve building examples
Related show


Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson May 3, 2019, 1:35 p.m. UTC
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@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
 devtools/test-meson-builds.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff mbox series

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index fe11e3c0a..03ebc29ea 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -15,6 +15,11 @@  srcdir=$(dirname $(readlink -f $0))/..
+if command -v gmake >/dev/null 2>&1 ; then
+	MAKE=gmake
+	MAKE=make
 if command -v ninja >/dev/null 2>&1 ; then
 elif command -v ninja-build >/dev/null 2>&1 ; then
@@ -92,3 +97,21 @@  if command -v $c >/dev/null 2>&1 ; then
 			$use_shared --cross-file $f
+# 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
+export DESTDIR=$(pwd)/$build_path/install-root
+$ninja_cmd -C $build_path install
+pc_file=$(find $DESTDIR -name libdpdk.pc)
+export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
+# Pkg-config paths need to be relative to the destination dir not globally
+# this value is picked up by our example makefiles
+export DPDK_PC_PREFIX=$DESTDIR/usr/local
+for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
+	echo "## Building $example"
+	$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example