diff options
author | Bruce Richardson <bruce.richardson@intel.com> | 2018-05-29 16:42:43 +0200 |
---|---|---|
committer | Thomas Monjalon <thomas@monjalon.net> | 2018-05-29 17:36:59 +0200 |
commit | a55277a788dfba015602cf0a56a6e584b5b2ec7d (patch) | |
tree | 07c2c6ca177eeddfc2a1ccb33b845d255f112810 /devtools | |
parent | 6561392c617a9bbc256c0ebe74b036441fed97da (diff) | |
download | dpdk-next-eventdev-a55277a788dfba015602cf0a56a6e584b5b2ec7d.zip dpdk-next-eventdev-a55277a788dfba015602cf0a56a6e584b5b2ec7d.tar.gz dpdk-next-eventdev-a55277a788dfba015602cf0a56a6e584b5b2ec7d.tar.xz |
devtools: add test script for meson builds
To simplify testing with the meson and ninja builds, we can add a script
to set up and do multiple builds. Currently this script sets up:
* clang and gcc builds
* builds using static and shared linkage for binaries (libs are always
built as both)
* a build using the lowest instruction-set level for x86 (-march=nehalem)
* cross-builds for each cross-file listed in config/arm
Each build is configured in a directory ending in *-build, and then for
the build stage, we just call ninja in each directory in turn. [i.e. we
assume every directory starting with "build-" is a meson build, which is
probably an ok assumption].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'devtools')
-rwxr-xr-x | devtools/test-meson-builds.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh new file mode 100755 index 0000000..9868c32 --- /dev/null +++ b/devtools/test-meson-builds.sh @@ -0,0 +1,46 @@ +#! /bin/sh -e +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +# Run meson to auto-configure the various builds. +# * all builds get put in a directory whose name starts with "build-" +# * if a build-directory already exists we assume it was properly configured +# Run ninja after configuration is done. + +srcdir=$(dirname $(readlink -m $0))/.. +MESON=${MESON:-meson} + +build () # <directory> <meson options> +{ + builddir=$1 + shift + if [ ! -d "$builddir" ] ; then + options="--werror -Dexamples=all $*" + echo "$MESON $options $srcdir $builddir" + $MESON $options $srcdir $builddir + unset CC + fi + echo "ninja -C $builddir" + ninja -C $builddir +} + +# shared and static linked builds with gcc and clang +for c in gcc clang ; do + for s in static shared ; do + export CC="ccache $c" + build build-$c-$s --default-library=$s + done +done + +# test compilation with minimal x86 instruction set +build build-x86-default -Dmachine=nehalem + +# enable cross compilation if gcc cross-compiler is found +for f in config/arm/arm*gcc ; do + c=aarch64-linux-gnu-gcc + if ! command -v $c >/dev/null 2>&1 ; then + continue + fi + export CC="ccache $c" + build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) --cross-file $f +done |