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 3CE4A239 for ; Sat, 26 May 2018 11:54:30 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CC93521BF6; Sat, 26 May 2018 05:54:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 26 May 2018 05:54:29 -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=PnjpNjw6+ZhQ6S szljxum8zXTyw3x0KkciESpeB2pRc=; b=o63EQnoiqLZr8yqrZKI+xJXNIE/twB gpN8CbV/0Iukltvros8LrZ2kQBV7esxBCAxO5y4c1+bcYhOQ7M/wdVRUxyaUCUOR 7DzuCglsOJbzU8cTxmasSDx2jc2ScHEdm/QBYG2fGq/eo3pqmA+OPJWFytjYGygW hbYAGfkEQI1HE= 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=PnjpNjw6+ZhQ6Sszljxum8zXTyw3x0KkciESpeB2pRc=; b=TnfA26XB qMmk+lZhg+Pty+9yj7RXlQjQId2nUbWzHkpUOc41y8/uId671ULTJ3g6kGAGXdcL bWXOxM2xA5iqUvG3w5bZzW1nskIIx29HBcLHI0iCKG5aZJlF7+q1xfj89t+0eGbI qCuAn+oB2Bh2P67IEPUmPUyKugQz90jsK1CsX5N4xC0fJJvXeKrtSvHXQxWgRWYO vFSTL0KcTLtGU4MDJxs/CUet4NbslKfouF8eeSNLY+ZD86Kyl9co6sDZ1t9AG4if FpfiHB8SqSgowB4tZAxk6hEXRKnt5Wles2k31g0mEF4Qo7ABhWC/CjYwEzdgK/ib tVjIuvE62FJQXg== 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 (218.15.136.77.rev.sfr.net [77.136.15.218]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B44210273; Sat, 26 May 2018 05:54:27 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Bruce Richardson Date: Sat, 26 May 2018 11:54:24 +0200 Message-Id: <20180526095424.7369-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 v3] 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: Sat, 26 May 2018 09:54:30 -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 v3: - remove forcing "cd": use current directory - remove CROSS: use hard-written aarch64-linux-gnu-gcc - remove config load in script start --- MAINTAINERS | 1 + devtools/test-meson-builds.sh | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 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..3283dbb7f --- /dev/null +++ b/devtools/test-meson-builds.sh @@ -0,0 +1,68 @@ +#! /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 + +reset_env () +{ + export PATH=$default_path + 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 +} + +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 + if ! command -v aarch64-linux-gnu-gcc >/dev/null 2>&1 ; then + continue + fi + build build-$(echo $DPDK_TARGET | cut -d'-' -f-2) --cross-file $f +done -- 2.16.2