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:
  kconfig: add named choice group
  kconfig: fix choice dependency check
  kconifg: 'select' considered less evil
  dontdiff: ignore timeconst.h
  dontdiff: add modules.order
  kbuild: fix unportability in gen_initramfs_list.sh
  kbuild: fix help output to show correct arch
  kbuild: show defconfig subdirs in make help
  kconfig: reversed borderlines in inputbox
  • Loading branch information
Linus Torvalds committed Apr 29, 2008
2 parents 8da5630 + 5a1aa8a commit f05c463
Show file tree
Hide file tree
Showing 11 changed files with 319 additions and 254 deletions.
2 changes: 2 additions & 0 deletions Documentation/dontdiff
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ mkprep
mktables
mktree
modpost
modules.order
modversions.h*
offset.h
offsets.h
Expand Down Expand Up @@ -171,6 +172,7 @@ sm_tbl*
split-include
tags
tftpboot.img
timeconst.h
times.h*
tkparse
trix_boot.h
Expand Down
17 changes: 9 additions & 8 deletions Documentation/kbuild/kconfig-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ applicable everywhere (see syntax).
Reverse dependencies can only be used with boolean or tristate
symbols.
Note:
select is evil.... select will by brute force set a symbol
equal to 'y' without visiting the dependencies. So abusing
select you are able to select a symbol FOO even if FOO depends
on BAR that is not set. In general use select only for
non-visible symbols (no prompts anywhere) and for symbols with
no dependencies. That will limit the usefulness but on the
other hand avoid the illegal configurations all over. kconfig
should one day warn about such things.
select should be used with care. select will force
a symbol to a value without visiting the dependencies.
By abusing select you are able to select a symbol FOO even
if FOO depends on BAR that is not set.
In general use select only for non-visible symbols
(no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid
the illegal configurations all over.
kconfig should one day warn about such things.

- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
This allows to limit the range of possible input values for int
Expand Down
27 changes: 24 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,10 @@ rpm: include/config/kernel.release FORCE
# Brief documentation of the typical targets used
# ---------------------------------------------------------------------------

boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig)
boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
boards := $(notdir $(boards))
board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
board-dirs := $(sort $(notdir $(board-dirs:/=)))

help:
@echo 'Cleaning targets:'
Expand Down Expand Up @@ -1221,14 +1223,19 @@ help:
@echo 'Documentation targets:'
@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
@echo ''
@echo 'Architecture specific targets ($(ARCH)):'
@echo 'Architecture specific targets ($(SRCARCH)):'
@$(if $(archhelp),$(archhelp),\
echo ' No architecture specific help defined for $(ARCH)')
echo ' No architecture specific help defined for $(SRCARCH)')
@echo ''
@$(if $(boards), \
$(foreach b, $(boards), \
printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
echo '')
@$(if $(board-dirs), \
$(foreach b, $(board-dirs), \
printf " %-16s - Show %s-specific targets\\n" help-$(b) $(b);) \
printf " %-16s - Show all of the above\\n" help-boards; \
echo '')

@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
Expand All @@ -1240,6 +1247,20 @@ help:
@echo 'For further info see the ./README file'


help-board-dirs := $(addprefix help-,$(board-dirs))

help-boards: $(help-board-dirs)

boards-per-dir = $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig))

$(help-board-dirs): help-%:
@echo 'Architecture specific targets ($(SRCARCH) $*):'
@$(if $(boards-per-dir), \
$(foreach b, $(boards-per-dir), \
printf " %-24s - Build for %s\\n" $*/$(b) $(subst _defconfig,,$(b));) \
echo '')


# Documentation targets
# ---------------------------------------------------------------------------
%docs: scripts_basic FORCE
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_initramfs_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ parse() {
str="${ftype} ${name} ${str} ${dev} ${maj} ${min}"
;;
"slink")
local target=`field 11 $(LC_ALL=C ls -l "${location}")`
local target=`readlink "${location}"`
str="${ftype} ${name} ${target} ${str}"
;;
*)
Expand Down
25 changes: 3 additions & 22 deletions scripts/kconfig/lex.zconf.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@

/* A lexical scanner generated by flex */

#define yy_create_buffer zconf_create_buffer
#define yy_delete_buffer zconf_delete_buffer
#define yy_flex_debug zconf_flex_debug
#define yy_init_buffer zconf_init_buffer
#define yy_flush_buffer zconf_flush_buffer
#define yy_load_buffer_state zconf_load_buffer_state
#define yy_switch_to_buffer zconf_switch_to_buffer
#define yyin zconfin
#define yyleng zconfleng
#define yylex zconflex
#define yylineno zconflineno
#define yyout zconfout
#define yyrestart zconfrestart
#define yytext zconftext
#define yywrap zconfwrap
#define yyalloc zconfalloc
#define yyrealloc zconfrealloc
#define yyfree zconffree

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
Expand Down Expand Up @@ -354,7 +335,7 @@ void zconffree (void * );

/* Begin user sect3 */

#define zconfwrap(n) 1
#define zconfwrap() 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;
Expand Down Expand Up @@ -1535,7 +1516,7 @@ static int yy_get_next_buffer (void)

/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read );
(yy_n_chars), (size_t) num_to_read );

YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
Expand Down Expand Up @@ -2007,7 +1988,7 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )

/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lkc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ P(menu_get_help,const char *,(struct menu *menu));
/* symbol.c */
P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);

P(sym_lookup,struct symbol *,(const char *name, int isconst));
P(sym_lookup,struct symbol *,(const char *name, int flags));
P(sym_find,struct symbol *,(const char *name));
P(sym_re_search,struct symbol **,(const char *pattern));
P(sym_type_name,const char *,(enum symbol_type type));
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lxdialog/inputbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
box_y = y + 2;
box_x = (width - box_width) / 2;
draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
dlg.border.atr, dlg.dialog.atr);
dlg.dialog.atr, dlg.border.atr);

print_buttons(dialog, height, width, 0);

Expand Down
64 changes: 27 additions & 37 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,22 @@ void menu_finalize(struct menu *parent)
sym = parent->sym;
if (parent->list) {
if (sym && sym_is_choice(sym)) {
/* find the first choice value and find out choice type */
for (menu = parent->list; menu; menu = menu->next) {
if (menu->sym) {
current_entry = parent;
if (sym->type == S_UNKNOWN)
if (sym->type == S_UNKNOWN) {
/* find the first choice value to find out choice type */
current_entry = parent;
for (menu = parent->list; menu; menu = menu->next) {
if (menu->sym && menu->sym->type != S_UNKNOWN) {
menu_set_type(menu->sym->type);
current_entry = menu;
if (menu->sym->type == S_UNKNOWN)
menu_set_type(sym->type);
break;
break;
}
}
}
/* set the type of the remaining choice values */
for (menu = parent->list; menu; menu = menu->next) {
current_entry = menu;
if (menu->sym && menu->sym->type == S_UNKNOWN)
menu_set_type(sym->type);
}
parentdep = expr_alloc_symbol(sym);
} else if (parent->prompt)
parentdep = parent->prompt->visible.expr;
Expand Down Expand Up @@ -313,50 +317,36 @@ void menu_finalize(struct menu *parent)
}
}
for (menu = parent->list; menu; menu = menu->next) {
if (sym && sym_is_choice(sym) && menu->sym) {
if (sym && sym_is_choice(sym) &&
menu->sym && !sym_is_choice_value(menu->sym)) {
current_entry = menu;
menu->sym->flags |= SYMBOL_CHOICEVAL;
if (!menu->prompt)
menu_warn(menu, "choice value must have a prompt");
for (prop = menu->sym->prop; prop; prop = prop->next) {
if (prop->type == P_PROMPT && prop->menu != menu) {
prop_warn(prop, "choice values "
"currently only support a "
"single prompt");
}
if (prop->type == P_DEFAULT)
prop_warn(prop, "defaults for choice "
"values not supported");
"values not supported");
if (prop->menu == menu)
continue;
if (prop->type == P_PROMPT &&
prop->menu->parent->sym != sym)
prop_warn(prop, "choice value used outside its choice group");
}
current_entry = menu;
if (menu->sym->type == S_UNKNOWN)
menu_set_type(sym->type);
/* Non-tristate choice values of tristate choices must
* depend on the choice being set to Y. The choice
* values' dependencies were propagated to their
* properties above, so the change here must be re-
* propagated. */
* propagated.
*/
if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
basedep = expr_alloc_and(basedep, menu->dep);
basedep = expr_eliminate_dups(basedep);
menu->dep = basedep;
menu->dep = expr_alloc_and(basedep, menu->dep);
for (prop = menu->sym->prop; prop; prop = prop->next) {
if (prop->menu != menu)
continue;
dep = expr_alloc_and(expr_copy(basedep),
prop->visible.expr);
dep = expr_eliminate_dups(dep);
dep = expr_trans_bool(dep);
prop->visible.expr = dep;
if (prop->type == P_SELECT) {
struct symbol *es = prop_get_symbol(prop);
dep2 = expr_alloc_symbol(menu->sym);
dep = expr_alloc_and(dep2,
expr_copy(dep));
dep = expr_alloc_or(es->rev_dep.expr, dep);
dep = expr_eliminate_dups(dep);
es->rev_dep.expr = dep;
}
prop->visible.expr = expr_alloc_and(expr_copy(basedep),
prop->visible.expr);
}
}
menu_add_symbol(P_CHOICE, sym, NULL);
Expand Down
Loading

0 comments on commit f05c463

Please sign in to comment.