From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 3/4] build: use version number from config file Date: Wed, 27 Mar 2019 01:27:22 +0100 Message-ID: <1749617.k167B8UOoZ@xps> References: <20190307115448.54041-1-bruce.richardson@intel.com> <20190315182022.39976-1-bruce.richardson@intel.com> <20190315182022.39976-4-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, David Marchand , Luca Boccassi To: Bruce Richardson Return-path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 29FD21B3D2 for ; Wed, 27 Mar 2019 01:27:27 +0100 (CET) In-Reply-To: <20190315182022.39976-4-bruce.richardson@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 15/03/2019 19:20, Bruce Richardson: > Since we have the version number in a separate file at the root level, > we should not need to duplicate this in rte_version.h too. Best > approach here is to move the macros for specifying the year/month/etc. > parts from the version header file to the build config file - leaving > the other utility macros for e.g. printing the version string, where they > are. > > For "make", this is done by having a little bit of awk parse the version > file and pass the results through to the preprocessor for the config > generation stage. > > For "meson", this is done by parsing the version and adding it to the > standard dpdk_conf object. > > In both cases, we need to append a large number - in this case "99", > previously 16 in original code - to the version number when we want to do > version number comparisons. Without this, the release version e.g. 19.05.0 > will compare as less than it's RC's e.g. 19.05.0-rc4. With it, the > comparison is correct as "19.05.0.99 > 19.05.0-rc4.99". > > Signed-off-by: Bruce Richardson > Acked-by: Luca Boccassi > --- > V3: following Thomas review, include appending .99 to version numbers to > ensure correct comparison. Make sure the reason for this is properly > documented in the code for future reference. Add in "int" casts for > numeric values to strip leading zeros e.g. in "05" month. Acked-by: Thomas Monjalon