From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 264B32E81 for ; Tue, 29 May 2018 16:42:52 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A7FEB21C51; Tue, 29 May 2018 10:42:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 29 May 2018 10:42:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=kjc1DXRGR9zK3/ BazXRKgW2GabQBCRIoXQMo8s/F5to=; b=Pu/ktM1H3G9x3mZegU19Feydru+3kJ hnjD37jRKGVMzWdvrzU9K0xPAY4Jk75er/Vrpvj+AtCNATa7QOUM7bRGk8cCQrL3 WU+t/rlbc58x9/lv8zjENOsmCkYBL+kdpkKPYe0Yx3CVC5dnmSkPxw8QSIUMHQAU TzMWSu9GmSVW0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=kjc1DXRGR9zK3/BazXRKgW2GabQBCRIoXQMo8s/F5to=; b=G0eCfe2k RwOuwKszZqTJX3tK6dH+M1mKyw0pBMkjOrQTqQ5YEbT+m4lDz2zZVVSFvQNXovQW 9Ww7cH1lYq1xNItVLqJm6KYf3TfVX62qsdAtUntD87k1i9A0BOKODto7VL7mdg+I xYTV22xSU7I4vmtSjSeam9JxA0gmhfpcxDJ+ejsL6FHhXWhaoVunLdR50FZIa96h q9Trim/c9JqyBZbB2iOBsOivimRQCBdSxVeg+cFyOqyMPl6L5JEs7VM8KPSNG8xT FXu5YitwIsDc5FHWGV7Cifd0DnNU1L8U/3tlMnGxU6jlyMsCgJEOFyNTf1sixqda oPEBWC/HNt6wJQ== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 07935E5037; Tue, 29 May 2018 10:42:50 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 29 May 2018 16:42:43 +0200 Message-Id: <20180529144243.9619-1-thomas@monjalon.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180424123255.204330-1-bruce.richardson@intel.com> References: <20180424123255.204330-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v5] 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, 29 May 2018 14:42:52 -0000 From: Bruce Richardson 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 Signed-off-by: Thomas Monjalon --- v2: it is a rework with 3 major changes - automatically stop on error thanks to -e - directory name starts with "build-" - optionally load a config file to get some environment variables v3: - remove forcing "cd": use current directory - remove CROSS: use hard-written aarch64-linux-gnu-gcc - remove config load in script start v4: - remove config file loading (will be improved and sent later) - the v4 is closer to what Bruce sent as v1 v5: - specify srcdir to build from anywhere - use ccache for ARM --- MAINTAINERS | 1 + devtools/test-meson-builds.sh | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 devtools/test-meson-builds.sh diff --git a/MAINTAINERS b/MAINTAINERS index e56c72687..4d015fe53 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -86,6 +86,7 @@ F: devtools/get-maintainer.sh F: devtools/git-log-fixes.sh F: devtools/load-devel-config F: devtools/test-build.sh +F: devtools/test-meson-builds.sh F: license/ diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh new file mode 100755 index 000000000..9868c325b --- /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 () # +{ + 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 -- 2.16.2