diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 4 | ||||
-rw-r--r-- | scripts/multiconfig.sh | 44 |
2 files changed, 35 insertions, 13 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c664e39be6..4c333599c1 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -113,12 +113,12 @@ as-instr = $(call try-run,\ # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) cc-option = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) + $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6) cc-option-yn = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) + $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) # cc-option-align # Prefix align with either -falign or -malign diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh index 4190798a97..a5790428c8 100644 --- a/scripts/multiconfig.sh +++ b/scripts/multiconfig.sh @@ -170,7 +170,7 @@ do_savedefconfig () { # backslashes as an escape character while read -r line do - output_lines="$output_lines $line" + output_lines="$output_lines%$line" done < defconfig for img in $subimages @@ -185,42 +185,64 @@ do_savedefconfig () { tmp= match= + # "# CONFIG_FOO is not set" should not be divided. + # Use "%" as a separator, instead of a whitespace. + # "%" is unlikely to appear in defconfig context. + save_IFS=$IFS + IFS=% # coalesce common lines together for i in $output_lines do case "$i" in - "[+A-Z]*:$line") - tmp="$tmp $unmatched" + [+A-Z]*:$line) + tmp="$tmp%$unmatched" i=$(echo "$i" | \ - sed -e "s/^\([^:]\)*/\1$symbol/") - tmp="$tmp $i" + sed -e "s/^\([^:]*\)/\1$symbol/") + tmp="$tmp%$i" match=1 ;; - "$line") - tmp="$tmp $unmatched" - tmp="$tmp +$symbol:$i" + $line) + tmp="$tmp%$unmatched" + tmp="$tmp%+$symbol:$i" match=1 ;; *) - tmp="$tmp $i" + tmp="$tmp%$i" ;; esac done + # Restore the default separator for the outer for loop. + IFS=$save_IFS + if [ "$match" ]; then output_lines="$tmp" unmatched= else - unmatched="$unmatched $symbol:$line" + unmatched="$unmatched%$symbol:$line" fi done < defconfig done rm -f defconfig + touch defconfig + + save_IFS=$IFS + IFS=% + for line in $output_lines do - echo $line >> defconfig + case "$line" in + "") + # do not output blank lines + ;; + *) + echo $line >> defconfig + ;; + esac done + + IFS=$save_IFS } # Usage: |