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 6B5A1A0471 for ; Tue, 13 Aug 2019 01:04:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B7871BEA7; Tue, 13 Aug 2019 01:04:24 +0200 (CEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 0F3D71BE90 for ; Tue, 13 Aug 2019 01:04:22 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id DCD134A2; Mon, 12 Aug 2019 19:04:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 12 Aug 2019 19:04:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=NnD1mgh/UF vfMH7w42BJ+s48wf5elQ2c0R6qe/k0Ol0=; b=SV6Ji5rtp9zYGvROWUQ6/EpbUp FlrzzJZDAPBer/kA2+z+dSUl3aY5PSbvFYfzUQN2Bdq5NWyqsTu8LBsW+Jcf5YhD SZPsrVbvlUrDq8mB9XzuCnVa+U6yAc7WLq+AglCtCaxU9ea7PNpedQddk2/9RVeb 21nweeQen/3I3Sdr4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=NnD1mgh/UFvfMH7w42BJ+s48wf5elQ2c0R6qe/k0Ol0=; b=gms8GI0U rGUqoWYrK1fV5rywTwH928vhbxWEckdRJfVUVgVxF4CmrAY62mAH9AnkgWKMscvy EU7gKLikr1lPkkctjbkioyhhXIkDK0AFavUtqcCUcrSlaXr7sT+jvhrq26cVpNH7 0ZKLYkkaDkqvo4KRHymyIoo3TnwEHq8iLI1CGxk+YpCKZbp8QtLpTyzY9rbEJ254 MquaTDI4Ut4/cL5Nv3ife6LKYOWW8HVNFXNpMPr3tyhdUyZQ5CyeclJopJHAoHj2 1Pn5Pnh6OXRQ5m52+bycTdD7nEHyB6CDgwesm135bXHs2dShUgFZvHJjHp8ZF85/ l5iKDh2SDcEclw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddvhedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucfkphepjeejrddufeegrddvtdefrddukeegnecurf grrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecu vehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C66A780066; Mon, 12 Aug 2019 19:04:19 -0400 (EDT) From: Thomas Monjalon To: bruce.richardson@intel.com Cc: dev@dpdk.org Date: Tue, 13 Aug 2019 01:03:57 +0200 Message-Id: <20190812230358.988-6-thomas@monjalon.net> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190812230358.988-1-thomas@monjalon.net> References: <20190812230358.988-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 5/6] devtools: test compiler availability only once 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" The compilation test is skipped if the compiler is not available. In the case of gcc/arm, it was tested both in the generic function "build" and in the cross-compilation section. By passing the compiler as argument of the generic function, the test with "command" is done only once. This small clean-up has the benefit of introducing the compiler parameter to be used later in another improvement. Signed-off-by: Thomas Monjalon --- devtools/test-meson-builds.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 9fe0a04c9..f2b0b347b 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -29,11 +29,13 @@ else exit 1 fi -build () # +build () # { builddir=$1 shift - if command -v $CC >/dev/null 2>&1 ; then + targetcc=$1 + shift + if command -v $CC $targetcc >/dev/null 2>&1 ; then if [ ! -f "$builddir/build.ninja" ] ; then options="--werror -Dexamples=all $*" echo "$MESON $options $srcdir $builddir" @@ -71,7 +73,7 @@ for c in gcc clang ; do command -v $c >/dev/null 2>&1 || continue for s in static shared ; do export CC="ccache $c" - build build-$c-$s --default-library=$s + build build-$c-$s $c --default-library=$s done done @@ -83,22 +85,19 @@ ok=$(cc -march=$default_machine -E - < /dev/null > /dev/null 2>&1 || echo false) if [ "$ok" = "false" ] ; then default_machine='corei7' fi -build build-x86-default -Dlibdir=lib -Dmachine=$default_machine $use_shared +build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared -# enable cross compilation if gcc cross-compiler is found c=aarch64-linux-gnu-gcc -if command -v $c >/dev/null 2>&1 ; then - # compile the general v8a also for clang to increase coverage - export CC="clang" - build build-arm64-host-clang $use_shared \ - --cross-file $srcdir/config/arm/arm64_armv8_linux_gcc - - for f in $srcdir/config/arm/arm*gcc ; do - export CC="ccache gcc" - build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) \ - $use_shared --cross-file $f - done -fi +# generic armv8a with clang as host compiler +export CC="clang" +build build-arm64-host-clang $c $use_shared \ + --cross-file $srcdir/config/arm/arm64_armv8_linux_gcc +# all gcc/arm configurations +for f in $srcdir/config/arm/arm*gcc ; do + export CC="ccache gcc" + build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) $c \ + $use_shared --cross-file $f +done # Test installation of the x86-default target, to be used for checking # the sample apps build using the pkg-config file for cflags and libs -- 2.22.0