autoconfig.mk: avoid apostophes around hex values
authorWolfgang Denk <[email protected]>
Sat, 16 Oct 2010 21:50:51 +0000 (23:50 +0200)
committerWolfgang Denk <[email protected]>
Mon, 18 Oct 2010 20:08:22 +0000 (22:08 +0200)
When generating include/autoconfig.mk, hex numbers would be quoted.
This caused some false positives during automatic testing of the
builds, and is known to cause some real issues for some Blackfin
configurations. Don't use apostophes for decimal and hex numbers (nor
for octal numbers).

Signed-off-by: Wolfgang Denk <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
tools/scripts/define2mk.sed

index af40bfaf2e8758607d5e64072063b883301ca40e..13e2845e76f013fdfe89515bb4ae1adb70453f82 100644 (file)
        s/="\(.*\)"$/=\1/;
        # Concatenate string values
        s/" *"//g;
-       # Wrap non-numeral values with quotes
-       s/=\(.*\?[^0-9].*\)$/=\"\1\"/;
+       # Assume strings as default - add quotes around values
+       s/=\(..*\)/="\1"/;
+       # but remove again from decimal numbers
+       s/="\([0-9][0-9]*\)"/=\1/;
+       # ... and from hex numbers
+       s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
        # Change '1' and empty values to "y" (not perfect, but
        # supports conditional compilation in the makefiles
        s/=$/=y/;