Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274301
b: refs/heads/master
c: 953742c
h: refs/heads/master
i:
  274299: 839b5b8
v: v3
  • Loading branch information
Arnaud Lacombe committed Aug 30, 2011
1 parent aa7b576 commit 73efd9e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db57630b7a4f6991e6d5997fbc3cf6be55d76d23
refs/heads/master: 953742c8fe8ac45be453fee959d7be40cd89f920
28 changes: 26 additions & 2 deletions trunk/scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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
Expand Down
49 changes: 36 additions & 13 deletions trunk/scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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);
Expand Down
13 changes: 8 additions & 5 deletions trunk/scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions trunk/scripts/kconfig/nconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 3 additions & 19 deletions trunk/scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
# make oldconfig
#
use strict;
use Getopt::Long;

my $config = ".config";

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 73efd9e

Please sign in to comment.