From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CC4F91DB3 for ; Tue, 24 Apr 2018 14:33:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2018 05:33:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,322,1520924400"; d="scan'208";a="218970148" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by orsmga005.jf.intel.com with ESMTP; 24 Apr 2018 05:33:01 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, Bruce Richardson Date: Tue, 24 Apr 2018 13:32:55 +0100 Message-Id: <20180424123255.204330-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.14.3 Subject: [dpdk-dev] [PATCH] devtools: add test script for meson builds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 12:33:04 -0000 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 --- 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