From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EF6F7A0524; Thu, 30 Jan 2020 17:00:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35E271C068; Thu, 30 Jan 2020 17:00:40 +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 EFA4D1C044 for ; Thu, 30 Jan 2020 17:00:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580400037; 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=V9P1sb0i9UOEGssiU6PRP8bXQF4VckTs3RYvJAe0hF8=; b=RnWsZZGwgfnma7S41xaV/ZbHQygzInqXQxdPR/VB+Mx3+MXYR/TpJS4JPGrAbidDIkepo8 lbkAcV1j5RJIzl5yVf8XdRtIVrdNqvoUm9gai0lnCLAFhPohy31utsNzDwSorWrwhri6op x21vlVRM+Lq7dUldzdhXcXcjA6iLRHo= 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-174-Y6MXWNAwPQavCRyRbW7YiA-1; Thu, 30 Jan 2020 11:00:33 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 469B613EB; Thu, 30 Jan 2020 16:00:32 +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 3C1AA1001B30; Thu, 30 Jan 2020 16:00:27 +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, bluca@debian.org, fiona.trahe@intel.com, ferruh.yigit@intel.com Date: Thu, 30 Jan 2020 17:00:07 +0100 Message-Id: <20200130160009.6549-3-david.marchand@redhat.com> In-Reply-To: <20200130160009.6549-1-david.marchand@redhat.com> References: <20191220152058.10739-1-david.marchand@redhat.com> <20200130160009.6549-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: Y6MXWNAwPQavCRyRbW7YiA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v3 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 Acked-by: Luca Boccassi --- Changelog since v2: - changed indent in config(), - removed useless shift in compile(), --- devtools/test-meson-builds.sh | 48 ++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 688567714..fb6c404e5 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -57,25 +57,27 @@ load_env () # =09. $srcdir/devtools/load-devel-config } =20 -build () # +config () # { -=09builddir=3D$builds_dir/$1 +=09dir=3D$1 =09shift -=09targetcc=3D$1 +=09builddir=3D$1 =09shift -=09# skip build if compiler not available -=09command -v ${CC##* } >/dev/null 2>&1 || return 0 -=09load_env $targetcc || return 0 -=09if [ ! -f "$builddir/build.ninja" ] ; then -=09=09options=3D"--werror -Dexamples=3Dall" -=09=09for option in $DPDK_MESON_OPTIONS ; do -=09=09=09options=3D"$options -D$option" -=09=09done -=09=09options=3D"$options $*" -=09=09echo "$MESON $options $srcdir $builddir" -=09=09$MESON $options $srcdir $builddir -=09=09unset CC +=09if [ -f "$builddir/build.ninja" ] ; then +=09=09return =09fi +=09options=3D"--werror -Dexamples=3Dall" +=09for option in $DPDK_MESON_OPTIONS ; do +=09=09options=3D"$options -D$option" +=09done +=09options=3D"$options $*" +=09echo "$MESON $options $dir $builddir" +=09$MESON $options $dir $builddir +} + +compile () # +{ +=09builddir=3D$1 =09if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then =09=09# for full output from ninja use "-v" =09=09echo "$ninja_cmd -v -C $builddir" @@ -90,6 +92,19 @@ build () # =09fi } =20 +build () # +{ +=09targetdir=3D$1 +=09shift +=09targetcc=3D$1 +=09shift +=09# skip build if compiler not available +=09command -v ${CC##* } >/dev/null 2>&1 || return 0 +=09load_env $targetcc || return 0 +=09config $srcdir $builds_dir/$targetdir $* +=09compile $builds_dir/$targetdir +} + if [ "$1" =3D "-vv" ] ; then =09TEST_MESON_BUILD_VERY_VERBOSE=3D1 elif [ "$1" =3D "-v" ] ; then @@ -107,6 +122,7 @@ for c in gcc clang ; do =09for s in static shared ; do =09=09export CC=3D"$CCACHE $c" =09=09build build-$c-$s $c --default-library=3D$s +=09=09unset CC =09done done =20 @@ -125,11 +141,13 @@ c=3Daarch64-linux-gnu-gcc export CC=3D"clang" build build-arm64-host-clang $c $use_shared \ =09--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 =09export CC=3D"$CCACHE gcc" =09build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) $c \ =09=09$use_shared --cross-file $f +=09unset CC done =20 # Test installation of the x86-default target, to be used for checking --=20 2.23.0