Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: fix modpost warnings for xtensa
  kbuild: be more foregiving on init section naming
  kbuild: rearrange a few function in modpost
  kbuild: use LDFLAGS_MODULE only for .ko links
  kconfig: remove unused members from struct symbol
  kconfig: attach help text to menus
  kbuild: fix up printing of Linux C Library version in scripts/ver_linux
  kbuild: do not do section mismatch checks on vmlinux in 2nd pass
  • Loading branch information
Linus Torvalds committed Jul 25, 2007
2 parents 4bf3b0b + cb7e51d commit 6a28a05
Show file tree
Hide file tree
Showing 15 changed files with 156 additions and 125 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C
MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS)
LDFLAGS_MODULE = -r
LDFLAGS_MODULE =
CFLAGS_KERNEL =
AFLAGS_KERNEL =

Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)

quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
cmd_link_multi-m = $(cmd_link_multi-y)

# We would rather have a list of rules like
# foo.o: $(foo-objs)
Expand Down
21 changes: 11 additions & 10 deletions scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,24 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))

# Step 2), invoke modpost
# Includes step 3,4
modpost = scripts/mod/modpost \
$(if $(CONFIG_MODVERSIONS),-m) \
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)

quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
cmd_modpost = scripts/mod/modpost \
$(if $(CONFIG_MODVERSIONS),-m) \
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
cmd_modpost = $(modpost) -s

PHONY += __modpost
__modpost: $(modules:.ko=.o) FORCE
$(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)

quiet_cmd_kernel-mod = MODPOST $@
cmd_kernel-mod = $(cmd_modpost) $@
cmd_kernel-mod = $(modpost) $@

PHONY += vmlinux
vmlinux.o: FORCE
$(call cmd,kernel-mod)

Expand All @@ -97,7 +98,7 @@ targets += $(modules:.ko=.mod.o)

# Step 6), final link of the modules
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
$(filter-out FORCE,$^)

$(modules): %.ko :%.o %.mod.o FORCE
Expand Down
31 changes: 15 additions & 16 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ static struct menu *rootEntry;

static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");

static const char *get_help(struct menu *menu)
{
if (menu_has_help(menu))
return menu_get_help(menu);
else
return nohelp_text;
}

static void strip(char *str)
{
char *p = str;
Expand Down Expand Up @@ -171,7 +179,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
int conf_string(struct menu *menu)
{
struct symbol *sym = menu->sym;
const char *def, *help;
const char *def;

while (1) {
printf("%*s%s ", indent - 1, "", menu->prompt->text);
Expand All @@ -186,10 +194,7 @@ int conf_string(struct menu *menu)
case '?':
/* print help */
if (line[1] == '\n') {
help = nohelp_text;
if (menu->sym->help)
help = menu->sym->help;
printf("\n%s\n", menu->sym->help);
printf("\n%s\n", get_help(menu));
def = NULL;
break;
}
Expand All @@ -207,7 +212,6 @@ static int conf_sym(struct menu *menu)
struct symbol *sym = menu->sym;
int type;
tristate oldval, newval;
const char *help;

while (1) {
printf("%*s%s ", indent - 1, "", menu->prompt->text);
Expand All @@ -233,7 +237,7 @@ static int conf_sym(struct menu *menu)
printf("/m");
if (oldval != yes && sym_tristate_within_range(sym, yes))
printf("/y");
if (sym->help)
if (menu_has_help(menu))
printf("/?");
printf("] ");
conf_askvalue(sym, sym_get_string_value(sym));
Expand Down Expand Up @@ -269,10 +273,7 @@ static int conf_sym(struct menu *menu)
if (sym_set_tristate_value(sym, newval))
return 0;
help:
help = nohelp_text;
if (sym->help)
help = sym->help;
printf("\n%s\n", help);
printf("\n%s\n", get_help(menu));
}
}

Expand Down Expand Up @@ -342,7 +343,7 @@ static int conf_choice(struct menu *menu)
goto conf_childs;
}
printf("[1-%d", cnt);
if (sym->help)
if (menu_has_help(menu))
printf("?");
printf("]: ");
switch (input_mode) {
Expand All @@ -359,8 +360,7 @@ static int conf_choice(struct menu *menu)
fgets(line, 128, stdin);
strip(line);
if (line[0] == '?') {
printf("\n%s\n", menu->sym->help ?
menu->sym->help : nohelp_text);
printf("\n%s\n", get_help(menu));
continue;
}
if (!line[0])
Expand Down Expand Up @@ -391,8 +391,7 @@ static int conf_choice(struct menu *menu)
if (!child)
continue;
if (line[strlen(line) - 1] == '?') {
printf("\n%s\n", child->sym->help ?
child->sym->help : nohelp_text);
printf("\n%s\n", get_help(child));
continue;
}
sym_set_choice_value(sym, child->sym);
Expand Down
4 changes: 1 addition & 3 deletions scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ enum {
struct symbol {
struct symbol *next;
char *name;
char *help;
enum symbol_type type;
struct symbol_value curr;
struct symbol_value def[4];
tristate visible;
int flags;
struct property *prop;
struct expr *dep, *dep2;
struct expr_value rev_dep;
};

Expand Down Expand Up @@ -139,7 +137,7 @@ struct menu {
struct property *prompt;
struct expr *dep;
unsigned int flags;
//char *help;
char *help;
struct file *file;
int lineno;
void *data;
Expand Down
10 changes: 2 additions & 8 deletions scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ static gboolean show_all = FALSE;
static gboolean show_debug = FALSE;
static gboolean resizeable = FALSE;

static char nohelp_text[] =
N_("Sorry, no help available for this option yet.\n");

GtkWidget *main_wnd = NULL;
GtkWidget *tree1_w = NULL; // left frame
GtkWidget *tree2_w = NULL; // right frame
Expand Down Expand Up @@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu)
GtkTextIter start, end;
const char *prompt = menu_get_prompt(menu);
gchar *name;
const char *help = _(nohelp_text);
const char *help;

if (!menu->sym)
help = "";
else if (menu->sym->help)
help = _(menu->sym->help);
help = _(menu_get_help(menu));

if (menu->sym && menu->sym->name)
name = g_strdup_printf(_(menu->sym->name));
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/kxgettext.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu)
menu->file == NULL ? "Root Menu" : menu->file->name,
menu->lineno);

if (menu->sym != NULL && menu->sym->help != NULL)
message__add(menu->sym->help, menu->sym->name,
if (menu->sym != NULL && menu_has_help(menu))
message__add(menu_get_help(menu), menu->sym->name,
menu->file == NULL ? "Root Menu" : menu->file->name,
menu->lineno);

Expand Down
2 changes: 2 additions & 0 deletions scripts/kconfig/lkc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu));
P(menu_get_prompt,const char *,(struct menu *menu));
P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu));

/* symbol.c */
P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ static void show_help(struct menu *menu)
struct gstr help = str_new();
struct symbol *sym = menu->sym;

if (sym->help)
if (menu_has_help(menu))
{
if (sym->name) {
str_printf(&help, "CONFIG_%s:\n\n", sym->name);
str_append(&help, _(sym->help));
str_append(&help, _(menu_get_help(menu)));
str_append(&help, "\n");
}
} else {
Expand Down
12 changes: 12 additions & 0 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu)
return menu;
}

bool menu_has_help(struct menu *menu)
{
return menu->help != NULL;
}

const char *menu_get_help(struct menu *menu)
{
if (menu->help)
return menu->help;
else
return "";
}
2 changes: 1 addition & 1 deletion scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void)
if (showDebug())
debug = debug_info(sym);

help = print_filter(_(sym->help));
help = print_filter(_(menu_get_help(menu)));
} else if (menu->prompt) {
head += "<big><b>";
head += print_filter(_(menu->prompt->text));
Expand Down
12 changes: 6 additions & 6 deletions scripts/kconfig/zconf.tab.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ yyreduce:
case 83:

{
current_entry->sym->help = (yyvsp[0].string);
current_entry->help = (yyvsp[0].string);
;}
break;

Expand Down Expand Up @@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu)
break;
}
}
if (sym->help) {
int len = strlen(sym->help);
while (sym->help[--len] == '\n')
sym->help[len] = 0;
fprintf(out, " help\n%s\n", sym->help);
if (menu->help) {
int len = strlen(menu->help);
while (menu->help[--len] == '\n')
menu->help[len] = 0;
fprintf(out, " help\n%s\n", menu->help);
}
fputc('\n', out);
}
Expand Down
12 changes: 6 additions & 6 deletions scripts/kconfig/zconf.y
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ help_start: T_HELP T_EOL

help: help_start T_HELPTEXT
{
current_entry->sym->help = $2;
current_entry->help = $2;
};

/* depends option */
Expand Down Expand Up @@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu)
break;
}
}
if (sym->help) {
int len = strlen(sym->help);
while (sym->help[--len] == '\n')
sym->help[len] = 0;
fprintf(out, " help\n%s\n", sym->help);
if (menu->help) {
int len = strlen(menu->help);
while (menu->help[--len] == '\n')
menu->help[len] = 0;
fprintf(out, " help\n%s\n", menu->help);
}
fputc('\n', out);
}
Expand Down
Loading

0 comments on commit 6a28a05

Please sign in to comment.