From patchwork Wed Jan 29 17:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 65348 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4052EA052F; Wed, 29 Jan 2020 18:26:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 17CDE1C037; Wed, 29 Jan 2020 18:26:45 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 7ECEA1C029 for ; Wed, 29 Jan 2020 18:26:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580318803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WyEJQhUZdn4DLYjGGZtqw0jZGmkh2u6q2Ib0mDa8Ft4=; b=Ga2iGqb1EM8Wh310+dwNc8SItx3NatgPOiPZs8j2r6nAm8ABkqDM2G6PG70TZCBtcNe9Q0 rIYhkHecnSgev9KvObTGt3xgWuPAhLGGNZvwTYZm+lHLsrb/Sug2wwgnWQaJTbiu/eAurZ D183rcdT3GLRsKFQ9L6G3DpTyuLtR3M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-YxvRr1SCPdqdcjbv6JZGOw-1; Wed, 29 Jan 2020 12:26:39 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF7F98C0CA1; Wed, 29 Jan 2020 17:26:37 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-128.brq.redhat.com [10.40.204.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id A906384BC5; Wed, 29 Jan 2020 17:26:35 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, kevin.laatz@intel.com, aconole@redhat.com, nhorman@tuxdriver.com, akhil.goyal@nxp.com, anoobj@marvell.com Date: Wed, 29 Jan 2020 18:26:19 +0100 Message-Id: <20200129172621.28565-3-david.marchand@redhat.com> In-Reply-To: <20200129172621.28565-1-david.marchand@redhat.com> References: <20191220152058.10739-1-david.marchand@redhat.com> <20200129172621.28565-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: YxvRr1SCPdqdcjbv6JZGOw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2 2/4] build: split build helper 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" No functional change intended, prepare for reusing this code. The config and compilation parts are separated in helpers. Unsetting CC is moved to the caller of the helper. Signed-off-by: David Marchand --- devtools/test-meson-builds.sh | 46 ++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 688567714..aed175889 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -57,25 +57,27 @@ load_env () # . $srcdir/devtools/load-devel-config } -build () # +config () # { - builddir=$builds_dir/$1 + dir=$1 shift - targetcc=$1 + builddir=$1 shift - # skip build if compiler not available - command -v ${CC##* } >/dev/null 2>&1 || return 0 - load_env $targetcc || return 0 + options="--werror -Dexamples=all" + for option in $DPDK_MESON_OPTIONS ; do + options="$options -D$option" + done + options="$options $*" if [ ! -f "$builddir/build.ninja" ] ; then - options="--werror -Dexamples=all" - for option in $DPDK_MESON_OPTIONS ; do - options="$options -D$option" - done - options="$options $*" - echo "$MESON $options $srcdir $builddir" - $MESON $options $srcdir $builddir - unset CC + echo "$MESON $options $dir $builddir" + $MESON $options $dir $builddir fi +} + +compile () # +{ + builddir=$1 + shift if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then # for full output from ninja use "-v" echo "$ninja_cmd -v -C $builddir" @@ -90,6 +92,19 @@ build () # fi } +build () # +{ + targetdir=$1 + shift + targetcc=$1 + shift + # skip build if compiler not available + command -v ${CC##* } >/dev/null 2>&1 || return 0 + load_env $targetcc || return 0 + config $srcdir $builds_dir/$targetdir $* + compile $builds_dir/$targetdir +} + if [ "$1" = "-vv" ] ; then TEST_MESON_BUILD_VERY_VERBOSE=1 elif [ "$1" = "-v" ] ; then @@ -107,6 +122,7 @@ for c in gcc clang ; do for s in static shared ; do export CC="$CCACHE $c" build build-$c-$s $c --default-library=$s + unset CC done done @@ -125,11 +141,13 @@ c=aarch64-linux-gnu-gcc export CC="clang" build build-arm64-host-clang $c $use_shared \ --cross-file $srcdir/config/arm/arm64_armv8_linux_gcc +unset CC # all gcc/arm configurations for f in $srcdir/config/arm/arm64_[bdo]*gcc ; do export CC="$CCACHE gcc" build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) $c \ $use_shared --cross-file $f + unset CC done # Test installation of the x86-default target, to be used for checking