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 B1C2BA04FA; Sun, 2 Feb 2020 22:09:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DAEF11BFF8; Sun, 2 Feb 2020 22:09:07 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id A8288DE3 for ; Sun, 2 Feb 2020 22:09:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580677743; 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=eqjr4mJFozFugHyo6pe32gEYgFF2PrrcVbBOy7WHzqj+fEyyeuZagNjwDXB3PpvQg5ZYYa S9YH5ZBc9rs4jxPrK6Oci8fRJy7v2jLiMmabmf/T04waP0PFiMqn4gAQxrCut1ND7pch8s YnpNaSRqcsCREz/b6l7Y1zYQSCqVeCg= 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-395-tNLpNra-MlWPl8siEZhrag-1; Sun, 02 Feb 2020 16:08:59 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACCD8107ACC7; Sun, 2 Feb 2020 21:08:57 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-51.brq.redhat.com [10.40.204.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4180887ECB; Sun, 2 Feb 2020 21:08:55 +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: Sun, 2 Feb 2020 22:08:33 +0100 Message-Id: <20200202210835.29791-3-david.marchand@redhat.com> In-Reply-To: <20200202210835.29791-1-david.marchand@redhat.com> References: <20191220152058.10739-1-david.marchand@redhat.com> <20200202210835.29791-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: tNLpNra-MlWPl8siEZhrag-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 v4 2/3] 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