kconfig: Change the format of KERNELVERSION

Change the format of KERNELVERSION as it exists in Kconfig to match
it's format elsewhere. Specifically, change from a string format
"1.10.3" to a numerical format.

This format change is a backwards-incompatible change. Any out-of-tree
Kconfig sources that were accessing KERNELVERSION with
$(KERNELVERSION) will need to be ported.

This change is to fix a bug. KERNELVERSION should have always been in
a numerical format. It should have been in a numerical format because;

KERNELVERSION is in a numerical format as a CMake variable and as a C
macro.

The purpose of having KERNELVERSION available in Kconfig is to have
configuration depend on the version, but this is only possible if it
exists in a numerical format[0].

[0] A string comparison of two semver strings does not always result
in a correct version comparison.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-09-28 13:20:09 +02:00 committed by Anas Nashif
commit 8ade26267f

View file

@ -21,7 +21,7 @@ string(REPLACE " " ";" CONF_FILE_AS_LIST "${CONF_FILE}")
endif()
set(ENV{srctree} ${ZEPHYR_BASE})
set(ENV{KERNELVERSION} ${PROJECT_VERSION})
set(ENV{KERNELVERSION} ${KERNELVERSION})
set(ENV{KCONFIG_CONFIG} ${DOTCONFIG})
# Set environment variables so that Kconfig can prune Kconfig source
@ -34,7 +34,7 @@ add_custom_target(
menuconfig
${CMAKE_COMMAND} -E env
srctree=${ZEPHYR_BASE}
KERNELVERSION=${PROJECT_VERSION}
KERNELVERSION=${KERNELVERSION}
KCONFIG_CONFIG=${DOTCONFIG}
ARCH=$ENV{ARCH}
BOARD_DIR=$ENV{BOARD_DIR}