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 D661EDE3 for ; Fri, 25 May 2018 16:52:32 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4D83E22657; Fri, 25 May 2018 10:52:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 25 May 2018 10:52:06 -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=oyS2bQY5LQYdnF H60euCUzjwKARMZwdzyM++l4s5mss=; b=TSZ2KN4aUAzSpgrfEkckRTNr2+5qOi qUPCpaKKZEmNXvVCMmFvpiy1uNOVVxoNSsWEuW1bccn+GN6VihOVuJiL0tbuWn/D Ww5aCzo1BdyoPutR5WzbqtuBW5Oy2SzIKwjXLnhNvuwjW4rjDuIAvXSi5dqqWZii 2tkWtItkUSYig= 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=oyS2bQY5LQYdnFH60euCUzjwKARMZwdzyM++l4s5mss=; b=Ww34rJVt 3UXVNONUTwbPmJb1Q0OnC512wK8PRuJn/INH1au/Z/ffCqauG/687kEkE0Y3jAjR nwc7aU/CSGyDrbr2EkCBgr9TTRDsWmr+doFFpD/aOU8jlhUtQoPkR/jmrPK8v3M1 yGeV7leAnM7XTi3s+vzDuutnJqs/oW1xrD7PaQhHgVVF0jm63+C+WvwDhFOtJmUz yFAJaLYP15Oywqjq4gfwcyXU28cEMrl8npkZsHQ9rGKlUhCf2nqRbe5RoUkNGzLq +hLa8zzVItKy4PGYm3AmEB6E7EnfMkxN/Y/Kr1YG0EehKYtTIj+CjX8N7a7YWMuo EMhYrdnGBbel6g== 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 (230.202.154.77.rev.sfr.net [77.154.202.230]) by mail.messagingengine.com (Postfix) with ESMTPA id 9FBB510324; Fri, 25 May 2018 10:52:04 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 25 May 2018 16:51:58 +0200 Message-Id: <20180525145158.5113-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 v2] 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: Fri, 25 May 2018 14:52:33 -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]. It can use the same configuration file as for the legacy test-build.sh. 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 --- MAINTAINERS | 1 + devtools/test-meson-builds.sh | 75 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 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..8ce0a1d31 --- /dev/null +++ b/devtools/test-meson-builds.sh @@ -0,0 +1,75 @@ +#! /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. + +default_path=$PATH + +# Load config options +. $(dirname $(readlink -e $0))/load-devel-config + +reset_env () +{ + export PATH=$default_path + unset CROSS + unset ARMV8_CRYPTO_LIB_PATH + unset FLEXRAN_SDK + unset LIBMUSDK_PATH + unset LIBSSO_SNOW3G_PATH + unset LIBSSO_KASUMI_PATH + unset LIBSSO_ZUC_PATH + unset PQOS_INSTALL_PATH +} + +cd $(dirname $(readlink -m $0))/.. + +load_config () +{ + reset_env + . $(dirname $(readlink -e $0))/load-devel-config + MESON=${MESON:-meson} +} + +build () # +{ + dir=$1 + shift + if [ ! -d "$dir" ] ; then + options="--werror -Dexamples=all $*" + # TODO: the configuration variables $DPDK_DEP_CFLAGS + # and $DPDK_DEP_LDFLAGS are not handled in this script + echo "$MESON $options $dir" + $MESON $options $dir + unset CC + fi + echo "ninja -C $dir" + ninja -C $dir +} + +# shared and static linked builds with gcc and clang +for c in gcc clang ; do + for s in static shared ; do + load_config + export CC="ccache $c" + build build-$c-$s --default-library=$s + done +done + +# test compilation with minimal x86 instruction set +load_config +build build-x86-default -Dmachine=nehalem + +# enable cross compilation if gcc cross-compiler is found +for f in config/arm/arm*gcc ; do + DPDK_TARGET=$(basename $f | tr '_' '-') + load_config + CROSS=${CROSS:-aarch64-linux-gnu-} + if ! command -v ${CROSS}gcc >/dev/null 2>&1 ; then + continue + fi + build build-$(echo $DPDK_TARGET | cut -d'-' -f-2) --cross-file $f +done -- 2.16.2