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 927FCA0471 for ; Tue, 13 Aug 2019 01:05:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FD431BEAC; Tue, 13 Aug 2019 01:04:26 +0200 (CEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id B4AA31BE9F for ; Tue, 13 Aug 2019 01:04:23 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C8118498; Mon, 12 Aug 2019 19:04:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 12 Aug 2019 19:04:23 -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=jbni+SahdU UEXRXc0qqZELPj+NJhjMaw6J8wBE3pC8I=; b=SjojAn4R9R8p4/jO68trnHt/HX b6FFHem4amdITYziCBOBH8efVRw/iF4Qhlr/yH3CuCBHiVd+OH6+CK0pDjkdw89M 1HtvbeDddU8clQeh5LtQ90q/QCTvFJ/U63xuYaoXIpbFzaNU4YetRYvL/+5mvEh/ qJoE70kHNUsFLjrFc= 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=jbni+SahdUUEXRXc0qqZELPj+NJhjMaw6J8wBE3pC8I=; b=Q/ifN6VI el+oHfvv54lbRHJ8gTTTs341nIhwVG0QndA+MtP7OH+ycbo2rj7SgYAyMuhG9F7t Jf/Fs+XdBcWERFOC+1xIn8foB24p7SKvEAYHIBBo2b9NhGpHhl1QFzH4TSQoTChG nqMkSUz2GiO6SC+eejdGrSY/08aYMx4/8ywkJQLBciN8QDAzoMKmI3/tTj/ZPI8c KBLDTxtAhr8r9eFpk9HOkKzJ37ryx+AMwjmcA/4snQa5vd+XXtYMp/MRkIr123Az N0C+IlgtwQlpoRm0Ut9zSm4WRjXOLJ3X13WuWvoP4MkDm+pqCccZNRlDLpSlXkqm +vKhUl7e48WmrQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddvhedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucfkphepjeejrddufeegrddvtdefrddukeegnecurf grrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecu vehluhhsthgvrhfuihiivgepge 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 A9A0C80059; Mon, 12 Aug 2019 19:04:21 -0400 (EDT) From: Thomas Monjalon To: bruce.richardson@intel.com Cc: dev@dpdk.org Date: Tue, 13 Aug 2019 01:03:58 +0200 Message-Id: <20190812230358.988-7-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 6/6] devtools: load target-specific compilation environment 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" In order to re-use the same test environment as with test-build.sh, the configuration file is loaded at each build, after adjusting the variable DPDK_TARGET. This is especially useful to set the variable PKG_CONFIG_PATH, or define some meson options (without -D) in DPDK_MESON_OPTIONS. The DPDK_TARGET values can be aarch64-*, powerpc64-*, x86_64-*. The matching DPDK_TARGET values for test-build.sh are arm64-*, ppc_64-*, x86_64-*. The advised expressions to use in the common configuration file are: if echo $DPDK_TARGET | grep -q '^a.*64-' ; then elif echo $DPDK_TARGET | grep -q '^p.*pc.*64' ; then elif echo $DPDK_TARGET | grep -q '^x86_64' ; then fi Signed-off-by: Thomas Monjalon --- devtools/test-meson-builds.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index f2b0b347b..a51a04d5a 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -29,15 +29,32 @@ else exit 1 fi +default_path=$PATH +default_pkgpath=$PKG_CONFIG_PATH + +reset_env () +{ + export PATH=$default_path + export PKG_CONFIG_PATH=$default_pkgpath + unset DPDK_MESON_OPTIONS +} + build () # { builddir=$1 shift targetcc=$1 shift + reset_env + DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p') + . $srcdir/devtools/load-devel-config if command -v $CC $targetcc >/dev/null 2>&1 ; then if [ ! -f "$builddir/build.ninja" ] ; then - options="--werror -Dexamples=all $*" + 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 -- 2.22.0