DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 5/6] devtools: test compiler availability only once
Date: Tue, 13 Aug 2019 01:03:57 +0200
Message-ID: <20190812230358.988-6-thomas@monjalon.net> (raw)
In-Reply-To: <20190812230358.988-1-thomas@monjalon.net>

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 <thomas@monjalon.net>
---
 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 () # <directory> <meson options>
+build () # <directory> <target compiler> <meson options>
 {
 	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


  parent reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 23:03 [dpdk-dev] [PATCH 0/6] build system improvements Thomas Monjalon
2019-08-12 23:03 ` [dpdk-dev] [PATCH 1/6] build: remove redundant libs from pkgconfig Thomas Monjalon
2019-08-13  9:37   ` Luca Boccassi
2019-08-12 23:03 ` [dpdk-dev] [PATCH 2/6] drivers: add some reasons for meson disabling Thomas Monjalon
2019-08-13  9:38   ` Luca Boccassi
2019-08-12 23:03 ` [dpdk-dev] [PATCH 3/6] net/mlx: fix meson build with custom dependency path Thomas Monjalon
2019-08-13  9:38   ` Luca Boccassi
2019-08-14  8:39   ` Matan Azrad
2019-08-12 23:03 ` [dpdk-dev] [PATCH 4/6] net/mlx: fix build with make and recent gcc Thomas Monjalon
2019-08-13  9:39   ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
2019-08-14 10:19   ` [dpdk-dev] " Matan Azrad
2019-08-12 23:03 ` Thomas Monjalon [this message]
2019-08-13  9:40   ` [dpdk-dev] [PATCH 5/6] devtools: test compiler availability only once Luca Boccassi
2019-08-12 23:03 ` [dpdk-dev] [PATCH 6/6] devtools: load target-specific compilation environment Thomas Monjalon
2019-08-13  9:41   ` Luca Boccassi
2019-09-12 16:23 ` [dpdk-dev] [PATCH 0/6] build system improvements Thomas Monjalon

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812230358.988-6-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git