path: root/tools
diff options
authorMasahiro Yamada <>2016-06-11 18:44:10 +0900
committerMasahiro Yamada <>2016-06-13 07:46:29 +0900
commitcd51878e34f6beef8ec7b66886e5a23a64b88653 (patch)
tree307d42475ac0b23bfebc0f0cb81c93ed18e340e8 /tools
parent6b96c1a1ca9e86e0f377f18dc470d054c4509c8a (diff)
tools: fix define2mk.sed to not add quotes around negative integers
The sed script, tools/scripts/define2mk.sed, converts config defines from C headers into include/ for the use in Makefiles. I found the tool adds quotes around negative integer values. For example, at the point of the v2016.07-rc1 tag, include/configs/microblaze-generic.h defines #define CONFIG_BOOTDELAY -1 /* -1 disables auto-boot */ Because it is an integer option, it should be converted to: CONFIG_BOOTDELAY=-1 But, the script actually converts it to: CONFIG_BOOTDELAY="-1" This is a fatal problem for the tools/ because it parses include/ for the config defines from the board headers. CONFIG_BOOTDELAY="-1" is considered as a string type option and it is dropped due to the type mismatch from the entry in Kconfig. This commit fixes the script so that the tools/ can correctly convert integer options with a negative value. Signed-off-by: Masahiro Yamada <>
Diffstat (limited to 'tools')
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed
index c641edfb01..0f00285f36 100644
--- a/tools/scripts/define2mk.sed
+++ b/tools/scripts/define2mk.sed
@@ -22,6 +22,8 @@
# but remove again from decimal numbers
+ # ... and from negative decimal numbers
+ s/="\(-[1-9][0-9]*\)"/=\1/;
# ... and from hex numbers
# ... and from configs defined from other configs
OpenPOWER on IntegriCloud