Re: [PATCH 2/6] kbuild: make CONFIG_*_VERSION always 6-digit

From: Masahiro Yamada
Date: Wed Nov 23 2022 - 10:06:17 EST


On Sat, Nov 19, 2022 at 4:53 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
>
> CONFIG_*_VERSION is the version number of a tool in a 5 or 6-digit form.
> This is fine in the Kconfig perspective because Kconfig supports numeric
> comparison (<, <=, >, >=).
>
> It is harder in Makefiles due to make's limited numerical capabilities.
> So, we ask for shell's "test" command when we compare versions, but it
> needs some process forks.
>
> test-{le,ge,lt,gt} macros can compare versions by using only built-in
> functions, but the number of digits must be aligned for those macros
> to work correctly.
>
> This commit (ab)uses Kconfig's hex type, which allows '0' prefixes,
> in order to make CONFIG_*_VERSION always 6-digit.
>
> For example with GCC 9.5, CONFIG_GCC_VERSION=90500 will be turned
> into CONFIG_GCC_VERSION=090500.
>
> I touched several Kconfig files so that versions are consistently
> compared against 6-digit numbers although this is not mandated.
>
> Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>


I terribly missed that CONFIG_*_VERSION changed the meaning
in C files (decimal -> octal).

I will drop this in V2.



--
Best Regards
Masahiro Yamada