summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/tests/preprocess/escape/Kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-12-30 22:59:27 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-03 10:17:17 +0100
commit997b70f585ef9bf2171c3f435efee3967e3036ec (patch)
treed55e7840d814f39c7c5aa532790e96d90c075b32 /scripts/kconfig/tests/preprocess/escape/Kconfig
parent273dbe5f87de8d6129a68ad40e87922fb6e783b6 (diff)
downloadbarebox-997b70f585ef9bf2171c3f435efee3967e3036ec.tar.gz
barebox-997b70f585ef9bf2171c3f435efee3967e3036ec.tar.xz
kconfig: sync to Linux 4.20
The previous sync was commit 18895514dc5e ("kconfig: update to v3.18-rc6"). Some commits were applied on top of that since then, but equivalent fixups were done in Linux. So, this commit overwrites everything scripts/kconfig/ with the one from Linux 4.20 Highlights: - 'silentoldconfig' has been renamed to 'syncconfig' (the top Makefile needs to be adjusted) - 'testconfig' target has been added for unit-tests (the top Makefile needs to export PYTHON3 because the test frame relies on Python3 and pytest) - The perfect hash table generated by gperf has been removed - The localization support has been removed - The 'option env=VAR' has been replaced with more generic variable reference syntax $(VAR) (./Kconfig and common/Kconfig need to be adjusted) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/kconfig/tests/preprocess/escape/Kconfig')
-rw-r--r--scripts/kconfig/tests/preprocess/escape/Kconfig44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/kconfig/tests/preprocess/escape/Kconfig b/scripts/kconfig/tests/preprocess/escape/Kconfig
new file mode 100644
index 0000000000..4e3f444455
--- /dev/null
+++ b/scripts/kconfig/tests/preprocess/escape/Kconfig
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: GPL-2.0
+
+# Shorthand
+warning = $(warning-if,y,$(1))
+
+# You can not pass commas directly to a function since they are treated as
+# delimiters. You can use the following trick to do so.
+comma := ,
+$(warning,hello$(comma) world)
+
+# Like Make, single quotes, double quotes, spaces are treated verbatim.
+# The following prints the text as-is.
+$(warning, ' " '" ' ''' "'")
+
+# Unlike Make, '$' has special meaning only when it is followed by '('.
+# No need to escape '$' itself.
+$(warning,$)
+$(warning,$$)
+$ := 1
+$(warning,$($))
+
+# You need a trick to escape '$' followed by '('
+# The following should print "$(X)". It should not be expanded further.
+dollar := $
+$(warning,$(dollar)(X))
+
+# You need a trick to treat unbalanced parentheses.
+# The following should print "(".
+left_paren := (
+$(warning,$(left_paren))
+
+# A simple expanded should not be expanded multiple times.
+# The following should print "$(X)". It should not be expanded further.
+Y := $(dollar)(X)
+$(warning,$(Y))
+
+# The following should print "$(X)" as well.
+Y = $(dollar)(X)
+$(warning,$(Y))
+
+# The following should print "$(".
+# It should not be emit "unterminated reference" error.
+unterminated := $(dollar)(
+$(warning,$(unterminated))