From: Bruce Richardson <bruce.richardson@intel.com>
To: thomas@monjalon.net
Cc: dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] devtools: add test script for meson builds
Date: Tue, 24 Apr 2018 13:32:55 +0100 [thread overview]
Message-ID: <20180424123255.204330-1-bruce.richardson@intel.com> (raw)
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 ending in "-build" is a meson build, which is
probably an ok assumption].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
devtools/test-meson-builds.sh | 55 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100755 devtools/test-meson-builds.sh
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
new file mode 100755
index 000000000..07a0f4e3c
--- /dev/null
+++ b/devtools/test-meson-builds.sh
@@ -0,0 +1,55 @@
+#! /bin/sh
+# 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 ends in "-build"
+# * if a build-directory already exists we assume it was properly configured
+mesonbuilds ()
+{
+ if [ "$MESON" == "" ]; then
+ MESON=meson;
+ fi;
+ _MESON="$MESON --werror -Dexamples=all";
+
+ # configure shared and static linked builds with gcc and clang
+ for c in gcc clang; do
+ for s in static shared; do
+ builddir=$c-$s-build;
+ if [ -d $builddir ]; then
+ continue;
+ fi
+ echo CC="ccache $c" $_MESON --default-library=$s -Ddefault_library=$s $builddir;
+ CC="ccache $c" $_MESON --default-library=$s -Ddefault_library=$s $builddir || break;
+ done;
+ done;
+
+ # test compilation with minimal x86 instruction set
+ if [ ! -d default-build ] ; then
+ cmd="$_MESON -Dmachine=nehalem default-build";
+ echo $cmd && $cmd || break
+ fi
+
+ # enable cross compilation if gcc cross-compiler is found
+ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1 ; then
+ for f in config/arm/arm*gcc; do
+ builddir=`basename $f | awk -F'_' '{print $2}'`;
+ builddir=$builddir-build;
+ if [ -d $builddir ]; then
+ continue;
+ fi
+ cmd="$_MESON --cross-file $f $builddir";
+ echo $cmd && $cmd || break;
+ done;
+ fi;
+}
+
+run_ninja ()
+{
+ for d in *-build ; do
+ ninja -C $d || break
+ done
+}
+
+mesonbuilds
+run_ninja
--
2.14.3
next reply other threads:[~2018-04-24 12:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 12:32 Bruce Richardson [this message]
2018-04-24 14:36 ` Bruce Richardson
2018-04-24 14:38 ` Bruce Richardson
2018-05-25 14:51 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2018-05-25 15:18 ` Bruce Richardson
2018-05-26 9:32 ` Thomas Monjalon
2018-05-28 9:33 ` Bruce Richardson
2018-05-28 10:26 ` Thomas Monjalon
2018-05-28 13:20 ` Bruce Richardson
2018-05-29 10:38 ` Thomas Monjalon
2018-05-29 10:59 ` Bruce Richardson
2018-05-26 9:54 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2018-05-26 11:21 ` [dpdk-dev] [PATCH v4] " Thomas Monjalon
2018-05-28 9:39 ` Bruce Richardson
2018-05-29 14:42 ` [dpdk-dev] [PATCH v5] " Thomas Monjalon
2018-05-29 14:58 ` Richardson, Bruce
2018-05-29 15:37 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180424123255.204330-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).