1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-20 14:38:20 +02:00
openwrt/scripts/config
Nicolas Pitre 75dcaf3d23 config: fix relational operators for bool and tristate symbols
Since commit 31847b67bec0 ("kconfig: allow use of relations other than
(in)equality") it is possible to use relational operators in Kconfig
statements. However, those operators give unexpected results when
applied to bool/tristate values:

	(n < y) = y (correct)
	(m < y) = y (correct)
	(n < m) = n (wrong)

This happens because relational operators process bool and tristate
symbols as strings and m sorts before n. It makes little sense to do a
lexicographical compare on bool and tristate values though.

Documentation/kbuild/kconfig-language.txt states that expression can have
a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations).
Let's make it so for relational comparisons with bool/tristate
expressions as well and document them. If at least one symbol is an
actual string then the lexicographical compare works just as before.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[rebased against OpenWrt kconfig, slightly reword commit message]
(backported from upstream 9059a3493efea6492451430c7e2fa0af799a2abb)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-06-20 14:14:16 +02:00
..
lxdialog
.gitignore scripts/config: add qconf files to .gitignore 2017-11-02 15:58:45 +01:00
conf.c config: Change conf.c remove compiler warnings 2018-07-30 10:43:36 +02:00
confdata.c
expr.c config: fix relational operators for bool and tristate symbols 2019-06-20 14:14:16 +02:00
expr.h
images.c scripts/config: import qconf 2017-11-02 15:58:45 +01:00
list.h
lkc_proto.h
lkc.h
Makefile build: cleanup leftover qconf files 2018-02-13 11:35:35 +01:00
mconf.c merge: base: update base-files and basic config 2017-12-08 19:41:18 +01:00
menu.c
qconf.cc scripts/config: import qconf 2017-11-02 15:58:45 +01:00
qconf.h scripts/config: import qconf 2017-11-02 15:58:45 +01:00
README
symbol.c scripts/config: properly handle select on symbols with unmet direct dependencies 2016-08-03 20:03:36 +02:00
util.c
zconf.gperf
zconf.hash.c_shipped config: regenerate *_shipped sources 2019-06-20 14:14:16 +02:00
zconf.l
zconf.lex.c_shipped config: regenerate *_shipped sources 2019-06-20 14:14:16 +02:00
zconf.tab.c_shipped
zconf.y

These files were taken from the Linux 3.9 Kernel
Configuration System and modified for the OpenWrt Buildroot.