[dpdk-dev] [PATCH] mk: Rework gcc version detection to permit versions newer than 4.x

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Feb 20 15:04:56 CET 2015


Hi Panu,

2015-02-18 14:11, Panu Matilainen:
> Separately comparing major and minor versions becomes seriously clumsy
> when with major version changes, convert the entire version string into
> a numeric value (ie 4.6.0 becomes 460 and 5.0.0 becomes 500) and use
> that for comparisons. This simplifies the comparisons and makes
> gcc 5.0 naturally recognized at least as capable as newest 4.x.
> 
> This three-digit scheme would run into trouble if gcc ever went to
> two-digit version segments, but that hasn't happened in the last 10+
> years so it seems like a safe assumption.
> 
> Signed-off-by: Panu Matilainen <pmatilai at redhat.com>

Yes this version checking was totally buggy.
Thanks for improving it.

I have a comment about the conversion of old versions checks.

> -ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1)
> +ifneq ($(shell test $(GCC_VERSION) -le 430 && echo 1), 1)

The previous check was a buggy "if not <= 4.3.x"
Your check is "if not <= 4.3.0"
So it's a bit different.
And I think we should remove negation to make it simpler:
	"if >= 4.4.0"

I have the same comment for other changes in the patch.



More information about the dev mailing list