]> git.sur5r.net Git - u-boot/commitdiff
tools: fix define2mk.sed to not add quotes around negative integers
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 11 Jun 2016 09:44:10 +0000 (18:44 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 12 Jun 2016 22:46:29 +0000 (07:46 +0900)
The sed script, tools/scripts/define2mk.sed, converts config defines
from C headers into include/autoconf.mk 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/moveconfig.py because it parses
include/autoconf.mk 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/moveconfig.py can
correctly convert integer options with a negative value.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
tools/scripts/define2mk.sed

index c641edfb0194ba81195e930b668c6250c90072d8..0f00285f367e4c1d429aee1f8e8b069a054c2280 100644 (file)
@@ -22,6 +22,8 @@
        s/=\(..*\)/="\1"/;
        # but remove again from decimal numbers
        s/="\([0-9][0-9]*\)"/=\1/;
+       # ... and from negative decimal numbers
+       s/="\(-[1-9][0-9]*\)"/=\1/;
        # ... and from hex numbers
        s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
        # ... and from configs defined from other configs