diff --git a/[refs] b/[refs] index 2b25bea17221..282265d35521 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: db57630b7a4f6991e6d5997fbc3cf6be55d76d23 +refs/heads/master: 953742c8fe8ac45be453fee959d7be40cd89f920 diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index ba573fe7c74d..82d2eb285b70 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -33,9 +33,17 @@ silentoldconfig: $(obj)/conf $(Q)mkdir -p include/generated $< --$@ $(Kconfig) -localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf +# if no path is given, then use src directory to find file +ifdef LSMOD +LSMOD_F := $(LSMOD) +ifeq ($(findstring /,$(LSMOD)),) + LSMOD_F := $(objtree)/$(LSMOD) +endif +endif + +localmodconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)mkdir -p include/generated - $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config + $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config $(Q)if [ -f .config ]; then \ cmp -s .tmp.config .config || \ (mv -f .config .config.old.1; \ @@ -48,6 +56,22 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf fi $(Q)rm -f .tmp.config +localyesconfig: $(obj)/streamline_config.pl $(obj)/conf + $(Q)mkdir -p include/generated + $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config + $(Q)sed -i s/=m/=y/ .tmp.config + $(Q)if [ -f .config ]; then \ + cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf --silentoldconfig $(Kconfig); \ + mv -f .config.old.1 .config.old) \ + else \ + mv -f .tmp.config .config; \ + $(obj)/conf --silentoldconfig $(Kconfig); \ + fi + $(Q)rm -f .tmp.config + # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files # The symlink is used to repair a deficiency in arch/um diff --git a/trunk/scripts/kconfig/confdata.c b/trunk/scripts/kconfig/confdata.c index 59b667cae5f3..5a58965d8800 100644 --- a/trunk/scripts/kconfig/confdata.c +++ b/trunk/scripts/kconfig/confdata.c @@ -503,17 +503,6 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) fprintf(fp, "#define %s%s%s 1\n", CONFIG_, sym->name, suffix); } - /* - * Generate the __enabled_CONFIG_* and - * __enabled_CONFIG_*_MODULE macros for use by the - * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is - * generated even for booleans so that the IS_ENABLED() macro - * works. - */ - fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n", - sym->name, (*value == 'y')); - fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n", - sym->name, (*value == 'm')); break; } case S_HEX: { @@ -564,6 +553,35 @@ static struct conf_printer header_printer_cb = .print_comment = header_print_comment, }; +/* + * Generate the __enabled_CONFIG_* and __enabled_CONFIG_*_MODULE macros for + * use by the IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is + * generated even for booleans so that the IS_ENABLED() macro works. + */ +static void +header_print__enabled_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) +{ + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: { + fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n", + sym->name, (*value == 'y')); + fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n", + sym->name, (*value == 'm')); + break; + } + default: + break; + } +} + +static struct conf_printer header__enabled_printer_cb = +{ + .print_symbol = header_print__enabled_symbol, + .print_comment = header_print_comment, +}; + /* * Tristate printer * @@ -945,11 +963,16 @@ int conf_write_autoconf(void) conf_write_heading(out_h, &header_printer_cb, NULL); for_all_symbols(i, sym) { + if (!sym->name) + continue; + sym_calc_value(sym); - if (!(sym->flags & SYMBOL_WRITE) || !sym->name) + + conf_write_symbol(out_h, sym, &header__enabled_printer_cb, NULL); + + if (!(sym->flags & SYMBOL_WRITE)) continue; - /* write symbol to auto.conf, tristate and header files */ conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1); conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1); diff --git a/trunk/scripts/kconfig/menu.c b/trunk/scripts/kconfig/menu.c index 8c2a97e60faf..d66008639a43 100644 --- a/trunk/scripts/kconfig/menu.c +++ b/trunk/scripts/kconfig/menu.c @@ -10,7 +10,8 @@ #include "lkc.h" -static const char nohelp_text[] = "There is no help available for this option."; +static const char nohelp_text[] = N_( + "There is no help available for this option.\n"); struct menu rootmenu; static struct menu **last_entry_ptr; @@ -594,14 +595,16 @@ struct gstr get_relations_str(struct symbol **sym_arr) void menu_get_ext_help(struct menu *menu, struct gstr *help) { struct symbol *sym = menu->sym; - const char *help_text = nohelp_text; if (menu_has_help(menu)) { - if (sym->name) + if (sym->name) { str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); - help_text = menu_get_help(menu); + str_append(help, _(menu_get_help(menu))); + str_append(help, "\n"); + } + } else { + str_append(help, nohelp_text); } - str_printf(help, "%s\n", _(help_text)); if (sym) get_symbol_str(help, sym); } diff --git a/trunk/scripts/kconfig/nconf.c b/trunk/scripts/kconfig/nconf.c index b113c50209e3..39ca1f1640ea 100644 --- a/trunk/scripts/kconfig/nconf.c +++ b/trunk/scripts/kconfig/nconf.c @@ -182,6 +182,8 @@ setmod_text[] = N_( "This feature depends on another which\n" "has been configured as a module.\n" "As a result, this feature will be built as a module."), +nohelp_text[] = N_( +"There is no help available for this option.\n"), load_config_text[] = N_( "Enter the name of the configuration file you wish to load.\n" "Accept the name shown to restore the configuration you\n" diff --git a/trunk/scripts/kconfig/streamline_config.pl b/trunk/scripts/kconfig/streamline_config.pl index ec7afce4c88d..a4fe923c0131 100644 --- a/trunk/scripts/kconfig/streamline_config.pl +++ b/trunk/scripts/kconfig/streamline_config.pl @@ -43,7 +43,6 @@ # make oldconfig # use strict; -use Getopt::Long; my $config = ".config"; @@ -113,17 +112,10 @@ sub find_config { find_config; -# Parse options -my $localmodconfig = 0; -my $localyesconfig = 0; - -GetOptions("localmodconfig" => \$localmodconfig, - "localyesconfig" => \$localyesconfig); - # Get the build source and top level Kconfig file (passed in) my $ksource = $ARGV[0]; my $kconfig = $ARGV[1]; -my $lsmod_file = $ENV{'LSMOD'}; +my $lsmod_file = $ARGV[2]; my @makefiles = `find $ksource -name Makefile 2>/dev/null`; chomp @makefiles; @@ -304,11 +296,7 @@ sub read_kconfig { if (defined($lsmod_file)) { if ( ! -f $lsmod_file) { - if ( -f $ENV{'objtree'}."/".$lsmod_file) { - $lsmod_file = $ENV{'objtree'}."/".$lsmod_file; - } else { - die "$lsmod_file not found"; - } + die "$lsmod_file not found"; } if ( -x $lsmod_file) { # the file is executable, run it @@ -433,11 +421,7 @@ sub parse_config_dep_select if (/^(CONFIG.*)=(m|y)/) { if (defined($configs{$1})) { - if ($localyesconfig) { - $setconfigs{$1} = 'y'; - } else { - $setconfigs{$1} = $2; - } + $setconfigs{$1} = $2; } elsif ($2 eq "m") { print "# $1 is not set\n"; next;