X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Fscripts%2Fdefine2mk.sed;h=c641edfb0194ba81195e930b668c6250c90072d8;hb=8e728aa915ab220e40ef68fe2b53f2fae5fbc42e;hp=6464627ea437e1d0d7b0c0edb8d669804f96809a;hpb=521dcd30b9cc5b72cd27ae04104f19369251aa20;p=u-boot diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed index 6464627ea4..c641edfb01 100644 --- a/tools/scripts/define2mk.sed +++ b/tools/scripts/define2mk.sed @@ -7,19 +7,25 @@ # # Only process values prefixed with #define CONFIG_ -/^#define CONFIG_[A-Za-z0-9_]\+/ { +/^#define CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*/ { # Strip the #define prefix s/#define *//; # Change to form CONFIG_*=VALUE - s/ \+/=/; + s/ */=/; # Drop trailing spaces s/ *$//; # drop quotes around string values 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/; + # ... and from configs defined from other configs + s/="\(CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*\)"/=$(\1)/; # Change '1' and empty values to "y" (not perfect, but # supports conditional compilation in the makefiles s/=$/=y/;