Skip to content

Commit

Permalink
Merge branch 'kconfig-for-40' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/mmarek/kbuild-2.6

* 'kconfig-for-40' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  xconfig: merge code path to conf_write()
  kconfig: do not record timestamp in .config
  gconfig: Hide unused left treeview when start up the interface
  gconfig: enable rules hint for main treeviews
  MAINTAINERS: Update KCONFIG entry
  kconfig-language: add to hints
  kconfig: Document the new "visible if" syntax
  kconfig: quiet commands when V=0
  kconfig: change update-po-config to reflect new layout of arch/um
  kconfig: make update-po-config work in KBUILD_OUTPUT
  kconfig: rearrange clean-files
  kconfig: change gconf to modify hostprogs-y like nconf and mconf
  kconfig: change qconf to modify hostprogs-y like nconf and mconf
  kconfig: only build kxgettext when needed
  nconfig: Silence unused return values from wattrset
  kconfig: Do not record timestamp in auto.conf and autoconf.h
  kconfig: get rid of unused flags
  kconfig: allow multiple inclusion of the same file
  kconfig: Avoid buffer underrun in choice input
  • Loading branch information
torvalds committed May 25, 2011
2 parents 9720d75 + d49e468 commit f3ae1c7
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 87 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -3917,6 +3917,10 @@ S: Flandernstrasse 101
S: D-73732 Esslingen
S: Germany

N: Roman Zippel
E: [email protected]
D: AFFS and HFS filesystems, m68k maintainer, new kernel configuration in 2.5

N: Leonard N. Zubkoff
W: http://www.dandelion.com/Linux/
D: BusLogic SCSI driver
Expand Down
32 changes: 31 additions & 1 deletion Documentation/kbuild/kconfig-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ applicable everywhere (see syntax).
That will limit the usefulness but on the other hand avoid
the illegal configurations all over.

- limiting menu display: "visible if" <expr>
This attribute is only applicable to menu blocks, if the condition is
false, the menu block is not displayed to the user (the symbols
contained there can still be selected by other symbols, though). It is
similar to a conditional "prompt" attribude for individual menu
entries. Default value of "visible" is true.

- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
This allows to limit the range of possible input values for int
and hex symbols. The user can only input a value which is larger than
Expand Down Expand Up @@ -303,7 +310,8 @@ menu:
"endmenu"

This defines a menu block, see "Menu structure" above for more
information. The only possible options are dependencies.
information. The only possible options are dependencies and "visible"
attributes.

if:

Expand Down Expand Up @@ -381,3 +389,25 @@ config FOO

limits FOO to module (=m) or disabled (=n).

Kconfig symbol existence
~~~~~~~~~~~~~~~~~~~~~~~~
The following two methods produce the same kconfig symbol dependencies
but differ greatly in kconfig symbol existence (production) in the
generated config file.

case 1:

config FOO
tristate "about foo"
depends on BAR

vs. case 2:

if BAR
config FOO
tristate "about foo"
endif

In case 1, the symbol FOO will always exist in the config file (given
no other dependencies). In case 2, the symbol FOO will only exist in
the config file if BAR is enabled.
5 changes: 0 additions & 5 deletions Documentation/kbuild/kconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ KCONFIG_OVERWRITECONFIG
If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
break symlinks when .config is a symlink to somewhere else.

KCONFIG_NOTIMESTAMP
--------------------------------------------------
If this environment variable exists and is non-null, the timestamp line
in generated .config files is omitted.

______________________________________________________________________
Environment variables for '{allyes/allmod/allno/rand}config'

Expand Down
5 changes: 2 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3597,10 +3597,9 @@ F: Documentation/hwmon/k8temp
F: drivers/hwmon/k8temp.c

KCONFIG
M: Roman Zippel <[email protected]>
M: Michal Marek <[email protected]>
L: [email protected]
Q: http://patchwork.kernel.org/project/linux-kbuild/list/
S: Maintained
S: Odd Fixes
F: Documentation/kbuild/kconfig-language.txt
F: scripts/kconfig/

Expand Down
38 changes: 23 additions & 15 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,23 @@ localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
# The symlink is used to repair a deficiency in arch/um
update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
$(Q)echo " GEN config"
$(Q)xgettext --default-domain=linux \
--add-comments --keyword=_ --keyword=N_ \
--from-code=UTF-8 \
--files-from=scripts/kconfig/POTFILES.in \
$(Q)xgettext --default-domain=linux \
--add-comments --keyword=_ --keyword=N_ \
--from-code=UTF-8 \
--files-from=$(srctree)/scripts/kconfig/POTFILES.in \
--directory=$(srctree) --directory=$(objtree) \
--output $(obj)/config.pot
$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
$(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
$(Q)(for i in `ls arch/*/Kconfig`; \
$(Q)ln -fs Kconfig.x86 arch/um/Kconfig
$(Q)(for i in `ls $(srctree)/arch/*/Kconfig`; \
do \
echo " GEN $$i"; \
$(obj)/kxgettext $$i \
>> $(obj)/config.pot; \
done )
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
--output $(obj)/linux.pot
$(Q)rm -f arch/um/Kconfig.arch
$(Q)rm -f $(srctree)/arch/um/Kconfig
$(Q)rm -f $(obj)/config.pot

PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
Expand Down Expand Up @@ -168,8 +169,11 @@ conf-objs := conf.o zconf.tab.o
mconf-objs := mconf.o zconf.tab.o $(lxdialog)
nconf-objs := nconf.o zconf.tab.o nconf.gui.o
kxgettext-objs := kxgettext.o zconf.tab.o
qconf-cxxobjs := qconf.o
qconf-objs := kconfig_load.o zconf.tab.o
gconf-objs := gconf.o kconfig_load.o zconf.tab.o

hostprogs-y := conf qconf gconf kxgettext
hostprogs-y := conf

ifeq ($(MAKECMDGOALS),nconfig)
hostprogs-y += nconf
Expand All @@ -179,6 +183,10 @@ ifeq ($(MAKECMDGOALS),menuconfig)
hostprogs-y += mconf
endif

ifeq ($(MAKECMDGOALS),update-po-config)
hostprogs-y += kxgettext
endif

ifeq ($(MAKECMDGOALS),xconfig)
qconf-target := 1
endif
Expand All @@ -188,16 +196,15 @@ endif


ifeq ($(qconf-target),1)
qconf-cxxobjs := qconf.o
qconf-objs := kconfig_load.o zconf.tab.o
hostprogs-y += qconf
endif

ifeq ($(gconf-target),1)
gconf-objs := gconf.o kconfig_load.o zconf.tab.o
hostprogs-y += gconf
endif

clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
.tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck
clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
clean-files += mconf qconf gconf nconf
clean-files += config.pot linux.pot

Expand Down Expand Up @@ -321,11 +328,12 @@ $(obj)/%.moc: $(src)/%.h
$(KC_QT_MOC) -i $< -o $@

$(obj)/lkc_defs.h: $(src)/lkc_proto.h
sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
$(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'

# Extract gconf menu items for I18N support
$(obj)/gconf.glade.h: $(obj)/gconf.glade
intltool-extract --type=gettext/glade $(obj)/gconf.glade
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
$(obj)/gconf.glade

###
# The following requires flex/bison/gperf
Expand Down
20 changes: 3 additions & 17 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,6 @@ int conf_write(const char *name)
const char *basename;
const char *str;
char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
time_t now;
int use_timestamp = 1;
char *env;

dirname[0] = 0;
Expand Down Expand Up @@ -598,19 +596,11 @@ int conf_write(const char *name)
if (!out)
return 1;

time(&now);
env = getenv("KCONFIG_NOTIMESTAMP");
if (env && *env)
use_timestamp = 0;

fprintf(out, _("#\n"
"# Automatically generated make config: don't edit\n"
"# %s\n"
"%s%s"
"#\n"),
rootmenu.prompt->text,
use_timestamp ? "# " : "",
use_timestamp ? ctime(&now) : "");
rootmenu.prompt->text);

if (!conf_get_changed())
sym_clear_all_valid();
Expand Down Expand Up @@ -784,7 +774,6 @@ int conf_write_autoconf(void)
const char *str;
const char *name;
FILE *out, *tristate, *out_h;
time_t now;
int i;

sym_clear_all_valid();
Expand All @@ -811,22 +800,19 @@ int conf_write_autoconf(void)
return 1;
}

time(&now);
fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n"
"# %s\n"
"# %s"
"#\n",
rootmenu.prompt->text, ctime(&now));
rootmenu.prompt->text);
fprintf(tristate, "#\n"
"# Automatically generated - do not edit\n"
"\n");
fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n"
" * %s\n"
" * %s"
" */\n",
rootmenu.prompt->text, ctime(&now));
rootmenu.prompt->text);

for_all_symbols(i, sym) {
sym_calc_value(sym);
Expand Down
4 changes: 0 additions & 4 deletions scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ struct file {
struct file *parent;
const char *name;
int lineno;
int flags;
};

#define FILE_BUSY 0x0001
#define FILE_SCANNED 0x0002

typedef enum tristate {
no, mod, yes
} tristate;
Expand Down
12 changes: 8 additions & 4 deletions scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void init_left_tree(void)

gtk_tree_view_set_model(view, model1);
gtk_tree_view_set_headers_visible(view, TRUE);
gtk_tree_view_set_rules_hint(view, FALSE);
gtk_tree_view_set_rules_hint(view, TRUE);

column = gtk_tree_view_column_new();
gtk_tree_view_append_column(view, column);
Expand Down Expand Up @@ -298,7 +298,7 @@ void init_right_tree(void)

gtk_tree_view_set_model(view, model2);
gtk_tree_view_set_headers_visible(view, TRUE);
gtk_tree_view_set_rules_hint(view, FALSE);
gtk_tree_view_set_rules_hint(view, TRUE);

column = gtk_tree_view_column_new();
gtk_tree_view_append_column(view, column);
Expand Down Expand Up @@ -756,7 +756,6 @@ void on_load_clicked(GtkButton * button, gpointer user_data)
void on_single_clicked(GtkButton * button, gpointer user_data)
{
view_mode = SINGLE_VIEW;
gtk_paned_set_position(GTK_PANED(hpaned), 0);
gtk_widget_hide(tree1_w);
current = &rootmenu;
display_tree_part();
Expand All @@ -782,7 +781,6 @@ void on_split_clicked(GtkButton * button, gpointer user_data)
void on_full_clicked(GtkButton * button, gpointer user_data)
{
view_mode = FULL_VIEW;
gtk_paned_set_position(GTK_PANED(hpaned), 0);
gtk_widget_hide(tree1_w);
if (tree2)
gtk_tree_store_clear(tree2);
Expand Down Expand Up @@ -1444,6 +1442,12 @@ static void display_tree(struct menu *menu)
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
|| (view_mode == FULL_VIEW)
|| (view_mode == SPLIT_VIEW))*/

/* Change paned position if the view is not in 'split mode' */
if (view_mode == SINGLE_VIEW || view_mode == FULL_VIEW) {
gtk_paned_set_position(GTK_PANED(hpaned), 0);
}

if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
|| (view_mode == FULL_VIEW)
|| (view_mode == SPLIT_VIEW)) {
Expand Down
33 changes: 19 additions & 14 deletions scripts/kconfig/lex.zconf.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -2363,11 +2363,11 @@ void zconf_initscan(const char *name)

current_file = file_lookup(name);
current_file->lineno = 1;
current_file->flags = FILE_BUSY;
}

void zconf_nextfile(const char *name)
{
struct file *iter;
struct file *file = file_lookup(name);
struct buffer *buf = malloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
Expand All @@ -2383,18 +2383,25 @@ void zconf_nextfile(const char *name)
buf->parent = current_buf;
current_buf = buf;

if (file->flags & FILE_BUSY) {
printf("%s:%d: do not source '%s' from itself\n",
zconf_curname(), zconf_lineno(), name);
exit(1);
}
if (file->flags & FILE_SCANNED) {
printf("%s:%d: file '%s' is already sourced from '%s'\n",
zconf_curname(), zconf_lineno(), name,
file->parent->name);
exit(1);
for (iter = current_file->parent; iter; iter = iter->parent ) {
if (!strcmp(current_file->name,iter->name) ) {
printf("%s:%d: recursive inclusion detected. "
"Inclusion path:\n current file : '%s'\n",
zconf_curname(), zconf_lineno(),
zconf_curname());
iter = current_file->parent;
while (iter && \
strcmp(iter->name,current_file->name)) {
printf(" included from: '%s:%d'\n",
iter->name, iter->lineno-1);
iter = iter->parent;
}
if (iter)
printf(" included from: '%s:%d'\n",
iter->name, iter->lineno+1);
exit(1);
}
}
file->flags |= FILE_BUSY;
file->lineno = 1;
file->parent = current_file;
current_file = file;
Expand All @@ -2404,8 +2411,6 @@ static void zconf_endfile(void)
{
struct buffer *parent;

current_file->flags |= FILE_SCANNED;
current_file->flags &= ~FILE_BUSY;
current_file = current_file->parent;

parent = current_buf->parent;
Expand Down
Loading

0 comments on commit f3ae1c7

Please sign in to comment.