Commit Graph

606 Commits

Author SHA1 Message Date
Michal Marek bac6aa865b xconfig: Abort close if configuration cannot be saved
Give the user an opportunity to fix the error or save the configuration
under a different path.

Reported-by: Hiromu Yakura <hiromu1996@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-25 15:50:34 +02:00
Arnaud Lacombe eb4cf5a642 kconfig: fix missing "0x" prefix from S_HEX symbol in autoconf.h
The specialized printer for headers (espectially autoconf.h) is missing
fixup code for S_HEX symbol's "0x" prefix. As long as kconfig does not
warn for such missing prefix, this code is needed. Fix this.

In the same time, fix some nits in `header_print_symbol()'.

Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>

Broken-by: Arnaud Lacombe <lacombar@gmail.com>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-18 16:29:29 +02:00
Arnaud Lacombe a1e806550e kconfig/nconf: remove useless conditionnal
After the test

	if (!submenu || ...)
		continue;

the variable `submenu' can _not_ be NULL, so do not test for this
situation.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-13 13:54:01 +02:00
Arnaud Lacombe f98ee76955 kconfig/nconf: prevent segfault on empty menu
nconf does not check the validity of the current menu when help is
requested (with either <F2>, '?' or 'h'). This leads to a NULL pointer
dereference when an empty menu is encountered.

The following reduced testcase exposes the problem:

config DEP
        bool

menu "FOO"

config BAR
        bool "BAR"
        depends on DEP

endmenu

Issue will happen when entering menu "FOO" and requesting help.

nconf is the only front-end which do not filter the validity of the
current menu. Such filter can not really happen beforehand as other key
which does not deals with the current menu might be entered by the user,
so just bails out earlier if we encounter an invalid menu.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Cc: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Reported-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-13 13:48:11 +02:00
Arnaud Lacombe 5416857867 kconfig/nconf: use the generic menu_get_ext_help()
nconf is the only front-end which does not use this helper, but prefer
to copy/paste the code. The test wrt. menu validity added in this
version of the code is bogus anyway as an invalid menu will get
dereferenced a few line below by calling menu_get_prompt().

For now, convert nconf to use menu_get_ext_help(), as do every other
front-end. We will deals with menu validity checks properly in a
separate commit.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Cc: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-13 13:48:08 +02:00
Raghavendra D Prabhu e9882ac0e5 nconfig: Avoid Wunused-but-set warning
I am seeing Wunused-but-set warning while make nconfig.  Looks like
active_menu is not used. Removing it fixes the warning.

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-13 13:47:09 +02:00
Michal Marek 5c74cd4cc7 Merge branch 'kconfig-trivial' of git://github.com/lacombar/linux-2.6 into kbuild/kconfig 2011-07-04 11:24:10 +02:00
Arnaud Lacombe ab63f58f25 kconfig/conf: mark xfgets() private
This function has not much reason to be public. In the mean time, convert
declaration from K&R C to ISO C.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02 01:04:40 -04:00
Arnaud Lacombe 131c60a95e kconfig: remove pending prototypes for kconfig_load()
Commit 5a6f8d2bd9 removed `kconfig_load()',
however, it missed an hidden prototypes in `lkc.h'. Fix this.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02 01:04:39 -04:00
Arnaud Lacombe 32543999f3 kconfig/conf: add command line options' description
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02 01:04:39 -04:00
Arnaud Lacombe 275744cc8d kconfig/conf: reduce the scope of `defconfig_file'
This variable is not used outside of main() so there is not much reason keeping
it global. Ensure it is initialized as gcc has no way to know that normal
execution path expect only one option switch to be given on the command line
(except when we request help). As a result, we always initialize
`defconfig_file' before using it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02 01:04:38 -04:00
Arnaud Lacombe 8494453ad5 kconfig: use calloc() for expr allocation
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02 01:04:37 -04:00
Arnaud Lacombe e54e692ba6 kconfig: introduce specialized printer
Make conf_write_symbol() grammar agnostic to be able to use it from different
code path. These path pass a printer callback which will print a symbol's name
and its value in different format.

conf_write_symbol()'s job become mostly only to prepare a string for the
printer. This avoid to have to pass specialized flag to generic
functions

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
[mmarek: rebased on top of de12518 (kconfig: autogenerated config_is_xxx
macro)]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-01 16:23:27 +02:00
Arnaud Lacombe ec6452a5ec kconfig: do not overwrite symbol direct dependency in assignment
Considering the following configuration:

config F
    bool "F"

choice AB
    bool "AB"
config A
    bool "A"
config B
    bool "B"
endchoice

if A
config D
    bool
    default y if F
    select E
config E
    bool "E"
endif

if B
config D
    bool
    default y if F
    select E
config E
    bool "E"
endif

The following configuration:

 CONFIG_F=y
 CONFIG_A=y
 # CONFIG_B is not set
 CONFIG_D=y
 CONFIG_E=y

emits a spurious warning:

(D) selects E which has unmet direct dependencies (B)

If a symbol appears in two different branch of the tree, it should inherit the
dependency of both parent, not just the last one.

Reported-by: Yann E. Morin <yann.morin.1998@anciens.enib.fr>
Tested-by: Yann E. Morin <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-24 17:21:27 +02:00
Arnaud Lacombe 2f76b358f9 kconfig: regen parser
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-09 14:04:45 -04:00
Arnaud Lacombe 378dbb2cf5 kconfig: migrate parser to implicit rules
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-09 14:04:44 -04:00
Arnaud Lacombe 674eed8a6a kconfig/zconf.l: do not ask to generate backup
This avoids the creation of a top-level `lex.backup' when the lexer gets
re-generated.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-09 14:04:44 -04:00
Arnaud Lacombe b96a0d0c78 kconfig: kill no longer needed reference to YYDEBUG
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-09 14:04:43 -04:00
Arnaud Lacombe 61f956f576 kconfig: constify `kconf_id_lookup'
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-09 14:04:42 -04:00
Michal Marek 36fee53510 Merge branch 'kconfig-trivial' of git://github.com/lacombar/linux-2.6 into kbuild/kconfig 2011-06-08 18:03:57 +02:00
Arnaud Lacombe 1ea3ad4e93 kconfig/gconf: silent missing prototype warnings
As the `gconf' frontend is un-maintained, go the easy way by silencing
the "warning: no previous prototype for '<fn>'" warnings.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:23 -04:00
Arnaud Lacombe f8aea775c1 kconfig/gconf: kill deadcode
The only call site of renderer_toggled() has been commented out since Apr. 2003,
as per Linus' Linux history repository:

 commit e7f67eb3c0570aa50c1cc0707b478a6d93bdc255
 Author: Roman Zippel <zippel@linux-m68k.org>
 Date:   Fri Apr 4 04:18:05 2003 -0800

    [PATCH] gconf update

    A gconf update by Romain Li<C3><A9>vin <roms@tilp.info>
    - fixed bug when double-clicking for changing value.
    - expand row when enabling a row with a submenu.
    - various bug fixes

As this result in a warning:

scripts/kconfig/gconf.c:891:13: warning: 'renderer_toggled' defined but not used

just nuke that code.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:22 -04:00
Arnaud Lacombe 5a6f8d2bd9 kconfig: nuke LKC_DIRECT_LINK cruft
This interface is not (and has never been ?) used by any frontend, just get rid
of it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:20 -04:00
Arnaud Lacombe 84250386ef kconfig: nuke reference to SWIG
SWIG is not used (yet?) to create kconfig binding, so there is no point
referencing it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:18 -04:00
Arnaud Lacombe 02d95c96c3 kconfig: add missing <stdlib.h> inclusion
This header is needed when using {m,re}alloc(3) and free(3) function family.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:16 -04:00
Arnaud Lacombe dd003306a4 kconfig: add missing <ctype.h> inclusion
This header is needed when using isspace(3) function family.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:15 -04:00
Arnaud Lacombe 10a4b2772e kconfig: add missing <stdarg.h> inclusion
This header is needed when using va_{start,end,copy}(3) functions family.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:13 -04:00
Arnaud Lacombe 75f1468bea kconfig: fix return code for invalid boolean symbol in conf_set_sym_val()
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:11 -04:00
Arnaud Lacombe d8fc320079 kconfig: annotate non-trivial fall-trough
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06 15:32:10 -04:00
Michal Marek ac9a126571 Merge branch 'kbuild/kconfig-for-40' into kbuild/kconfig 2011-05-25 15:33:20 +02:00
Michal Marek 4c54f0f846 kconfig: Only generate config_is_xxx for bool and tristate options
For strings and integers, the config_is_xxx macros are useless and
sometimes misleading:

  #define CONFIG_INITRAMFS_SOURCE ""
  #define config_is_initramfs_source() 1

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-25 15:26:25 +02:00
Arnaud Lacombe d49e46875c xconfig: merge code path to conf_write()
Avoid to have multiple path saving the config. This fixes an error check
miss when the window is being closed and the user requested the config
to be written.

Reported-by: Hiromu Yakura <hiromu1996@gmail.com>
Pointed-out-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-25 15:05:07 +02:00
Michal Marek 51f31afd12 Merge branch 'kbuild/kconfig-for-40' into kbuild/kconfig 2011-05-24 17:16:21 +02:00
Arnaud Lacombe bdebd4892e kconfig: do not record timestamp in .config
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-24 16:13:40 +02:00
Eduardo Silva 6ef3d36eee gconfig: Hide unused left treeview when start up the interface
When the gconfig program starts in full mode view, it shows the
left treeview which belongs to the 'split mode view'. The patch
fix this visual issue.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-24 15:41:51 +02:00
Eduardo Silva 2626e67402 gconfig: enable rules hint for main treeviews
Due to the large amount of rows in the treeviews, is difficult to
match columns with rows, setting the rules hint to 'true' allows the
treeview to alternate background colors in the rows making the data
more readable.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-24 15:41:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD de125187dc kconfig: autogenerated config_is_xxx macro
this will allow to use to use

	if(config_is_xxx())
	if(config_is_xxx_module())

in the code instead of

	#ifdef CONFIG_xxx
	#ifdef CONFIG_xxx_MODULE

and now let the compiler remove the non usefull code and not the
pre-processor

as done in the mach-types for arm as exmaple

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-17 15:59:23 +02:00
Peter Foley 2d80eb0fa3 kconfig: quiet commands when V=0
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:41:15 +02:00
Peter Foley bdc69ca4cf kconfig: change update-po-config to reflect new layout of arch/um
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:41:02 +02:00
Peter Foley a24a1b8e2a kconfig: make update-po-config work in KBUILD_OUTPUT
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:40:45 +02:00
Peter Foley b24d7d7b98 kconfig: rearrange clean-files
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:40:33 +02:00
Peter Foley d02ab886dc kconfig: change gconf to modify hostprogs-y like nconf and mconf
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:40:16 +02:00
Peter Foley f19430496a kconfig: change qconf to modify hostprogs-y like nconf and mconf
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:39:44 +02:00
Peter Foley 1f594715bd kconfig: only build kxgettext when needed
Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-29 10:39:11 +02:00
Stephen Boyd 10175ba65f nconfig: Silence unused return values from wattrset
Ignore the return value from wattrset since we ignore the return
value in nconf.gui.c as well.

scripts/kconfig/nconf.c: In function 'print_function_line':
scripts/kconfig/nconf.c:376: warning: value computed is not used
scripts/kconfig/nconf.c:380: warning: value computed is not used
scripts/kconfig/nconf.c:387: warning: value computed is not used
scripts/kconfig/nconf.c: In function 'show_menu':
scripts/kconfig/nconf.c:956: warning: value computed is not used
scripts/kconfig/nconf.c:961: warning: value computed is not used
scripts/kconfig/nconf.c:963: warning: value computed is not used
scripts/kconfig/nconf.c:965: warning: value computed is not used

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-19 09:21:52 +02:00
Michal Marek c33724a438 kconfig: Do not record timestamp in auto.conf and autoconf.h
Timestamps in file data are useless and there is already one in .config

Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-18 14:20:38 +02:00
Yann E. MORIN 2b2112f617 kconfig: get rid of unused flags
Now that we detect recusrion of sourced files, get rid of
now unused flags.

Regenerate lex.zconf.c_shipped file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-15 15:12:57 +02:00
Yann E. MORIN f094f8a1b2 kconfig: allow multiple inclusion of the same file
Allow 'source'ing the same file from multiple places (eg. from
different files, and/or under different conditions).

To avoid circular inclusion, scan the source-ancestry of the
current file, and abort if already sourced in this branch.

Regenerate the pre-parsed lex.zconf.c_shipped file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-15 15:12:48 +02:00
Ben Hutchings 466de91835 kconfig: Avoid buffer underrun in choice input
commit 40aee729b3 ('kconfig: fix default
value for choice input') fixed some cases where kconfig would select
the wrong option from a choice with a single valid option and thus
enter an infinite loop.

However, this broke the test for user input of the form 'N?', because
when kconfig selects the single valid option the input is zero-length
and the test will read the byte before the input buffer.  If this
happens to contain '?' (as it will in a mips build on Debian unstable
today) then kconfig again enters an infinite loop.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org [2.6.17+]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-04-08 12:05:20 +02:00
Uwe Kleine-König cce1dac871 trivial: Fix Steven's Copyright typos
OK, the copyright allows you to write a copy, still I think the lawyers
prefer the correct spelling.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
LKML-Reference: <1295899921-11333-1-git-send-email-u.kleine-koenig@pengutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-02-08 17:14:31 -05:00
Linus Torvalds f28b1c8aaa Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  nconf: handle comment entries within choice/endchoice
  kconfig: fix warning
  kconfig: Make expr_copy() take a const argument
  kconfig: simplify select-with-unmet-direct-dependency warning
  kconfig: add more S_INT and S_HEX consistency checks
  kconfig: fix `zconfdebug' extern declaration
  kconfig/conf: merge duplicate switch's case
  kconfig: fix typos
  kbuild/gconf: add dummy inline for bind_textdomain_codeset()
  kbuild/nconf: fix spaces damage
  kconfig: nuke second argument of conf_write_symbol()
  kconfig: do not define AUTOCONF_INCLUDED
  kconfig: the day kconfig warns about "select"-abuse has come
2011-01-10 08:28:17 -08:00
Peter Korsgaard 39177ec362 nconf: handle comment entries within choice/endchoice
Equivalent to af6c1598 (kconfig: handle comment entries within
choice/endchoice), but for nconfig instead.

Implement support for comment entries within choice groups. Comment entries
are displayed visually distinct from normal configs, and selecting them is
a no-op.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-01-07 15:45:28 +01:00
Jan Beulich 7ad1227818 kconfig: fix undesirable side effect of adding "visible" menu attribute
This lead to non-selected, non-user-selectable options to be written
out to .config. This is not only pointless, but also preventing the
user to be prompted should any of those options eventually become
visible (e.g. by de-selecting the *_AUTO options the "visible"
attribute was added for.

Furthermore it is quite logical for the "visible" attribute of a menu
to control the visibility of all contained prompts, which is what the
patch does.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-29 23:31:34 +01:00
Arnaud Lacombe 0597fcd08b kconfig: fix warning
In file included from scripts/kconfig/zconf.tab.c:2502:
scripts/kconfig/expr.c:1033: warning: no previous prototype for 'expr_simplify_unmet_dep'

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-27 21:46:47 +01:00
Michal Marek 17742dc743 kconfig: Make expr_copy() take a const argument
Fixes
scripts/kconfig/expr.c: In function ‘expr_get_leftmost_symbol’:
scripts/kconfig/expr.c:1026:2: warning: passing argument 1 of ‘expr_copy’ discards qualifiers from pointer target type
scripts/kconfig/expr.c:67:14: note: expected ‘struct expr *’ but argument is of type ‘const struct expr *’

Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-21 17:59:16 +01:00
Arnaud Lacombe 1137c56b74 kconfig: simplify select-with-unmet-direct-dependency warning
This is an attempt to simplify the expressing printed by kconfig when a
symbol is selected but still has direct unmet dependency.

First, the symbol reverse dependency is split in sub-expression. Then,
each sub-expression is checked to ensure that it does not contains the
unmet dependency. This removes the false-positive symbols and fixed symbol
which already have the correct dependency. Finally, only the symbol
responsible of the "select" is printed, instead of its full dependency tree.

CC: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-21 17:59:14 +01:00
Arnaud Lacombe ab60bd0b92 kconfig: add more S_INT and S_HEX consistency checks
This patch add more number consistency checkg, trying to catch the following
situation:

config FOO0
	hex
	default 42

config FOO1
	string

config BAR0
	int
	default FOO1

config BAR1
	hex
	default FOO1

config FOO2
	hex
	default 42h

config FOO3
	int
	default "1bar"

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 23:15:32 +01:00
Arnaud Lacombe 4ce2c1e8e8 kconfig: fix `zconfdebug' extern declaration
This symbol is only exist if YYDEBUG is defined.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:42:12 +01:00
Arnaud Lacombe bf128f5265 kconfig/conf: merge duplicate switch's case
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:42:11 +01:00
Arnaud Lacombe 579fb8e741 kconfig: fix typos
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:42:11 +01:00
Arnaud Lacombe 1ebfa5198e kbuild/gconf: add dummy inline for bind_textdomain_codeset()
This symbols is used by gconf.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:42:11 +01:00
Arnaud Lacombe fe04ce0bf9 kbuild/nconf: fix spaces damage
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:42:11 +01:00
Arnaud Lacombe 0dce631092 kconfig: nuke second argument of conf_write_symbol()
Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol().

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
[mmarek: Fix unused variable warning in conf_write()]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 14:26:51 +01:00
Arnaud Lacombe 6e71fabe9e kconfig: do not define AUTOCONF_INCLUDED
AUTOCONF_INCLUDED is not checked is not used within the tree and its parent
header, `autoconf.h', is safe to be re-included.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-15 13:38:25 +01:00
Arnaud Lacombe 09899c93b1 kconfig: regen parser
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-22 11:27:32 -02:00
Arnaud Lacombe 86e187ff9b kconfig: add an option to determine a menu's visibility
This option is aimed to add the possibility to control a menu's visibility
without adding dependency to the expression to all the submenu.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-22 11:27:17 -02:00
Andy Whitcroft 020e773f6b kconfig: sym_expand_string_value: allow for string termination when reallocing
When expanding a parameterised string we may run out of space, this
triggers a realloc.  When computing the new allocation size we do not
allow for the terminating '\0'.  Allow for this when calculating the new
length.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-01 17:06:00 -04:00
Steven Rostedt 8ef17fa2ef kconfig: Have streamline_config process menuconfigs too
Some menuconfigs in the Kconfig files have prompts and dependencies.
Currently, streamline_config misses these, and this can cause
streamline_config to keep modules enabled that should not be, and
even worse, not enable those that should.

This patch makes streamline_config process menuconfigs just like it
would process a config.

Reported-by: member graysky <graysky@archlinux.us>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29 01:07:23 -04:00
Steven Rostedt 20d1904733 kconfig: Fix streamline_config to read multi line deps in Kconfig files
I noticed that some Kconfig files have multi line dependencies
that continue with a backslash. Those dependencies on the next
line will be missed by streamline_config.

For example:

config CS89x0
	tristate "CS89x0 support"
	depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \
		|| ARCH_IXDP2X01 || MACH_MX31ADS)

The "|| ARCH_IXDP2X01 || MACH_MX31ADS)" will not be processed.

This patch adds code to handle this case.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29 01:07:10 -04:00
hiromu cf5a189d4a kconfig: Fix missing declaration of variable $dir in streamline_config.pl
On Fri, Aug 17, 2010 at 01:43PM +0800, Américo Wang wrote:
> Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
>
> BTW, I think we should add "use strict;" too.

Then I added "use strict;" to streamline_config.pl, I saw another
warning.

> Global symbol "$dir" requires explicit package name at
scripts/kconfig/streamline_config.pl line 286.
> Global symbol "$dir" requires explicit package name at
scripts/kconfig/streamline_config.pl line 287.
> Global symbol "$dir" requires explicit package name at
scripts/kconfig/streamline_config.pl line 288.

Then I added "my $dir;" to line 285.

Cc: Américo Wang <xiyou.wangcong@gmail.com>
Cc: Toralf Foerster <toralf.foerster@gmx.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hiromu Yakura <hiromu1996@gmail.com>
LKML-Reference: <1282042158.7160.9.camel@hiromu-Macbook>

[ changed to just add my in front of $dir instead of new line ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29 01:04:16 -04:00
hiromu yagura ccece60ac6 kconfig: Fix variable name typo %prompts in streamline_config.pl
When I added "use strict;" to streamline_config.pl, I saw the following
warnings:

> Global symbol "%prompt" requires explicit package name at
scripts/kconfig/streamline_config.pl line 183.
> Global symbol "%prompt" requires explicit package name at
scripts/kconfig/streamline_config.pl line 368.

The declaration of %prompt was incorrect, and should have been %prompts.

Cc: Toralf Foerster <toralf.foerster@gmx.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hiromu Yakura <hiromu1996@gmail.com>
LKML-Reference: <1281845597.11566.5.camel@camp10-laptop>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29 01:04:14 -04:00
Steven Rostedt 4908980b24 kconfig: Make localmodconfig handle environment variables
The commit 838a2e55e6
 kbuild: migrate all arch to the kconfig mainmenu upgrade

Broke make localmodconfig. The reason was that it added a
environment variable to the kconfig source, which the
streamline_config.pl could not handle.

This patch changes streamline_config.pl to handle kconfig sources
using environment variables in their names.

Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29 01:03:42 -04:00
Michal Marek 70c74e59db Merge branch 'message-callback' into kbuild/kconfig
Conflicts:
	scripts/kconfig/nconf.c
2010-10-28 00:54:25 +02:00
Michal Marek b1f7d6e190 Revert "kconfig: Temporarily disable dependency warnings"
This reverts commit 71ebc01, which was a 2.6.36-only stopgap solution.

Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-12 15:12:23 +02:00
Michal Marek 239060b93b Merge branch 'kbuild/rc-fixes' into kbuild/kconfig
We need to revert the temporary hack in 71ebc01, hence the merge.
2010-10-12 15:09:06 +02:00
Kyle McMartin e9203c9882 kbuild: fix oldnoconfig to do the right thing
Commit 861b4ea4 broke oldnoconfig when removed the oldnoconfig checks on
                       if (input_mode == nonint_oldconfig ||
                           input_mode == oldnoconfig) {
                               if (input_mode == nonint_oldconfig &&
                                   sym->name &&
                                    !sym_is_choice_value(sym)) {
to avoid oldnoconfig chugging through the else stanza.

Fix that to restore expected behaviour (which I've confirmed in the
Fedora kernel build that the configs end up looking the same.)

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-09 23:55:08 +02:00
Michal Marek 71ebc01d3a kconfig: Temporarily disable dependency warnings
After fixing a use-after-free bug in kconfig, a 'make defconfig' or
'make allmodconfig' fills the screen with warnings that were not
detected before. Given that we are close to the release now, disable the
warnings temporarily and deal with them after 2.6.36.

Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-09 23:19:07 +02:00
Will Newton 1408b15b98 kconfig: Use PATH_MAX instead of 128 for path buffer sizes.
This prevents the buffers being overflowed when using a config
file with a long name. PATH_MAX is used elsewhere in the same
file, so use it here as well.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-04 15:40:04 +02:00
Arnaud Lacombe ff5ff6060b kconfig: delay symbol direct dependency initialization
This fixes the use-after-free and associated crash in kconfig introduced
in commit 246cf9c26b.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-04 15:13:13 +02:00
Michal Marek 19c29f3260 kconfig: Fix realloc usage()
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-30 22:26:39 +02:00
Michal Marek a01ebe154c kconfig: Propagate const
Commit 2e7a091 made struct file->name a const char*, but forgot to
constify all users of it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-30 22:17:48 +02:00
Naohiro Aota 8bea7548ee kconfig: Don't go out from read config loop when you read new symbol
commit 8baefd30b5 of linux-next replaced
a `switch()' statement with some `if()' statements, but left `break's
in the `switch()' statement untouched. This cause read config loop to
exit and so "make oldconfig" is not much usable (see below).

> $ make oldconfig
><snip>
> scripts/kconfig/conf --oldconfig Kconfig
> #
> # using defaults found in /boot/config-2.6.34-ccs-r1
> #
> *
> * Restart config...
> *
> *
> * General setup
> *
> Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [N/y/?] (NEW)

(I've already have "CONFIG_EXPERIMENTAL=y" in the old config file. But
that's not read here.)

This patch should fix this problem.

Signed-off-by: Naohiro Aota <naota@elisp.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-30 21:59:32 +02:00
Michal Marek 0455029bea Merge branch 'kbuild/kconfig/kbuild-generic-v7' of http://github.com/lacombar/linux-2.6 into kbuild/kconfig
* 'kbuild/kconfig/kbuild-generic-v7' of http://github.com/lacombar/linux-2.6:
  kbuild: migrate all arch to the kconfig mainmenu upgrade
  kconfig: expand file names
  kconfig: use the file's name of sourced file
  kconfig: constify file name
  kconfig: don't emit warning upon rootmenu's prompt redefinition
  kconfig: replace KERNELVERSION usage by the mainmenu's prompt
  kconfig: delay gconf window initialization
  kconfig: expand by default the rootmenu's prompt
  kconfig: add a symbol string expansion helper
  kconfig: regen parser
  kconfig: implement the `mainmenu' directive
  kconfig: allow PACKAGE to be defined on the compiler's command-line
  kconfig: rephrase help texts/comments not to include the package name
  kconfig: allow build-time definition of the internal config prefix
  kconfig: rephrase help text not to mention the internal prefix
  kconfig: replace a `switch()' statement by a more flexible `if()' statement
2010-09-27 23:24:53 +02:00
Junio C Hamano 8c41e5e363 kconfig: fix menuconfig on debian lenny
In 60f33b8 (kconfig: get rid of stray a.o, support ncursesw, 2006-01-15),
support to link menuconfig with ncursesw library was added.  To compute
the linker command option -l, we check "libncursesw.{so,a,dylib}" to allow
ncursesw to be used as a replacement ncurses.  However, when checking what
header file to include, we do not check /usr/include/ncursesw directory.

Add /usr/include/ncursesw to the list of directories that are checked.
With this patch, on my Debian Lenny box with libncursesw5-dev package but
not libncurses5-dev package, I can say "make menuconfig".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-20 14:09:31 +02:00
Arnaud Lacombe 838a2e55e6 kbuild: migrate all arch to the kconfig mainmenu upgrade
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:54:11 -04:00
Arnaud Lacombe c7abe8630a kconfig: expand file names
This will allow to use the following construct in source files:

config FOO
    string
    default "foo"

source "$FOO/Kconfig"

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:54:07 -04:00
Arnaud Lacombe e82dae9083 kconfig: use the file's name of sourced file
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:54:04 -04:00
Arnaud Lacombe 2e7a091833 kconfig: constify file name
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:54:00 -04:00
Arnaud Lacombe ba6ff60d5e kconfig: don't emit warning upon rootmenu's prompt redefinition
This silences the warning printed upon prompt redefinition for the rootmenu.
We will encounter this redefinition when a "mainmenu" statement is specified and
override the default prompt.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:53:57 -04:00
Arnaud Lacombe 0954828fcb kconfig: replace KERNELVERSION usage by the mainmenu's prompt
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 22:53:53 -04:00
Arnaud Lacombe c55c9d571a kconfig: delay gconf window initialization
Delay the window initialization to let the rootmenu's prompt be
initialized as it will be used to get the window's title.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2010-09-19 22:53:49 -04:00
Arnaud Lacombe f6ce00b8cc kconfig: expand by default the rootmenu's prompt
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:53 -04:00
Arnaud Lacombe 76a540958a kconfig: add a symbol string expansion helper
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:48 -04:00
Arnaud Lacombe c0920a1cbd kconfig: regen parser
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:44 -04:00
Arnaud Lacombe 8ea13e2c87 kconfig: implement the `mainmenu' directive
If specified, the directive must be placed at the top of the Kconfig file.

We need to change the grammar to make the mainmenu directive set the
`rootmenu' prompt. This reflect how menu_add_prompt() works internally, ie.
set the prompt of the `current_entry', pointing originally to `rootmenu'.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:39 -04:00
Arnaud Lacombe ef211607ed kconfig: allow PACKAGE to be defined on the compiler's command-line
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:35 -04:00
Arnaud Lacombe 652cf9821d kconfig: rephrase help texts/comments not to include the package name
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@xenotime.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:30 -04:00
Arnaud Lacombe ffb5957bc4 kconfig: allow build-time definition of the internal config prefix
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:26 -04:00
Arnaud Lacombe 59dfa24da7 kconfig: rephrase help text not to mention the internal prefix
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:21 -04:00
Arnaud Lacombe 8baefd30b5 kconfig: replace a `switch()' statement by a more flexible `if()' statement
With the upcoming dynamical configuration prefix, we can no longer assume that
the prefix will start by a 'C'. As such, we can no longer hardcode this value in
the `case ...:', so replace the `switch() { ... }' statement by a more flexible
'if () { ... }' statement.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19 18:19:16 -04:00
Justin P. Mattock cec1921ec9 scripts/kconfig/gconf.glade Update broken web addresses.
As discussed, remove the DOCTYPE declaration since libglade validates
the file against itself..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-17 16:54:42 +02:00
Michal Marek 458452f4a9 kconfig: Simplify Makefile for xconfig
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-13 13:41:31 +02:00
Alexander Stein 20f4ad8a19 Fix QT4 moc, cflags libs detection on dual QT3/Qt4 systems
On system with QT3 and QT4 qmake in PATH may be from QT3. So we use
pkg-config for proper QT4 detection.
By reqesting cflags and libs for either QtCore, QtGui and QtSupport include
dirs and libs get listed several times, but so we won't mis anything

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-13 13:01:30 +02:00
Stephen Boyd aee08ed499 nconfig: Fix help for choice menus
When getting the help for a choice menu with a help section (for example
the "Choose SLAB allocator" menu) nconfig pops up a window with nothing
inside it. This is due to show_help() passing an empty string to
show_scroll_win()'s 3rd argument. The option really does have help
though, but it isn't a config symbol, so just add the help text for
the option, and don't try to add anything else like the config option
name.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-13 12:43:22 +02:00
Kyle McMartin 71d8066265 kbuild: fix oldnoconfig to do the right thing
Commit 861b4ea4 broke oldnoconfig when removed the oldnoconfig checks on
                       if (input_mode == nonint_oldconfig ||
                           input_mode == oldnoconfig) {
                               if (input_mode == nonint_oldconfig &&
                                   sym->name &&
                                    !sym_is_choice_value(sym)) {
to avoid oldnoconfig chugging through the else stanza.

Fix that to restore expected behaviour (which I've confirmed in the
Fedora kernel build that the configs end up looking the same.)

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-08 13:55:37 +02:00
Michal Marek 76a136c4a6 xconfig: Change the titlebar if using Qt3
Qt4 is now used by default and will get more testing. In case someone
still uses Qt3 and reports a bug, make it easy to recognize that this is
Qt3.

Acked-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-06 13:31:50 +02:00
Alexander Stein 133c5f7c10 kconfig qconf: port to QT4
A straight forward port to QT4 using qt3to4 and compiling against
  qt3support

* Use pkg-config to detect QT4 which is hopefully portable enough
* If no QT4, QT3 will by tried instead
* Classes renamed using qt3to4
  * If build using QT3 renamed to QT3 class names using defines
* ConfigInfoView::menu has to be renamed as QT4 moc strips struct from
  struct menu and creates a name conflict
* QT2 support has been dropped
* The hidden options inserted in 39a4897c1b
  are use in native API

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-01 16:14:29 +02:00
Arnaud Lacombe c94d3fb01f kbuild: use getopt_long(), not its _only() variant
NetBSD lacks getopt_long_only() whereas getopt_long() works just fine.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-31 13:33:41 +02:00
Arnaud Lacombe 9ba9568259 kbuild: don't overwrite HOST_EXTRACFLAGS
This might be used by the user to specify extra arguments for the host
compiler.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-26 13:59:43 +02:00
Michal Marek e981b06076 Merge commit 'v2.6.36-rc1' into kbuild/rc-fixes 2010-08-20 13:53:08 +02:00
Arnaud Lacombe c24035b9ed kbuild: fix typo
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-17 11:00:43 +02:00
Arnaud Lacombe 7080e47bb2 kbuild: don't include `check-lxdialog' ldflags in global HOST_LOADLIBES
On BSD systems, `check-lxdialog' would select -lcurses as the default
curses library which would conflict with -lncurses at runtime: curses'
compatible symbols are getting handled by the system's curses library while the
ncurses-specific symbols are getting handled by the ports' ncurses.

This fixes `nconf' segmentation fault on these systems.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-17 10:35:40 +02:00
Michal Marek 42368c37fb kconfig: Allow frontends to display messages themselves
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-17 10:21:19 +02:00
Arnaud Lacombe 94bedeca77 kbuild: confdata.c explicitly reference errno, thus need <errno.h>
This fixes:
% gmake LKC_GENPARSER=1 menuconfig
[...]
scripts/kconfig/confdata.c:739: error: 'errno' undeclared (first use in this function)
scripts/kconfig/confdata.c:739: error: (Each undeclared identifier is reported only once
scripts/kconfig/confdata.c:739: error: for each function it appears in.)
scripts/kconfig/confdata.c:739: error: 'ENOENT' undeclared (first use in this function)

triggered on NetBSD.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-17 09:11:38 +02:00
Nir Tzachar a72f3e2b82 nconfig: add search support
Remove the old hotkeys feature, and replace it by an interactive string
search.
From nconfig help:

Searching: pressing '/' triggers interactive search mode.
           nconfig performs a case insensitive search for the string
           in the menu prompts (no regex support).
           Pressing the up/down keys highlights the previous/next
           matching item. Backspace removes one character from the
           match string. Pressing either '/' again or ESC exits
           search mode. All other keys behave normally.

Miscellaneous other changes (including Rundy's and Justin's input).

Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-16 22:04:55 +02:00
Sam Ravnborg 3643f849d7 kconfig: fix segfault when detecting recursive dependency
Following sample Kconfig generated a segfault:

config FOO
        bool
        select PERF_EVENTS if HAVE_HW_BREAKPOINT

config PERF_EVENTS
        bool

config HAVE_HW_BREAKPOINT
        bool
        depends on PERF_EVENTS

Fix by reverting back to a valid property if there was no
property on the stack of symbols.

The above pattern were seen in sh Kconfig.
A fix for the Kconfig file has been sent to the sh folks.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-15 00:32:13 +02:00
Sam Ravnborg 84062dd3a6 kconfig: fix savedefconfig with choice marked optional
savedefconfig failed to save the correct minimal config
when it encountered a choice marked optional.

Consider following minimal configuration:
$cat Kconfig
choice
	prompt "choice"
	optional

config A
	bool "a"

config B
	bool "b"

endchoice

$cat .config | grep -v ^#
CONFIG_A=y

$conf --savedefconfig=defconfig Kconfig

would before this fix result in an empty file, because
kconfig would assume that CONFIG_A=y is a default value.
But because the choice is optional the default is that
both A and B are =n.

Fix so we handle optional choices correct.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-15 00:32:12 +02:00
Linus Torvalds 090b710e8a Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kconfig: Fix warning: ignoring return value of 'fgets'
  kconfig: Fix warning: ignoring return value of 'fwrite'
  nconfig: Fix segfault when menu is empty
  kconfig: fix tristate choice with minimal config
  kconfig: fix savedefconfig for tristate choices
2010-08-13 17:56:27 -07:00
Jean Sacren 4418a2b904 kconfig: Fix warning: ignoring return value of 'fgets'
This fix facilitates fgets() either it returns on success or on error or
when end of file occurs.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-13 00:40:35 +02:00
Jean Sacren bf5e327a30 kconfig: Fix warning: ignoring return value of 'fwrite'
This fix facilitates fwrite() in both confdata.c and expr.c, either it
succeeds in writing, or an error occurs, or the end of file is reached.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-13 00:40:26 +02:00
Andrej Gelenberg 866af407da nconfig: Fix segfault when menu is empty
nconf crush with segfault if press right arrow in empty menu.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-13 00:34:15 +02:00
Sam Ravnborg a64b44ead0 kconfig: fix tristate choice with minimal config
If a minimal config did not specify the value
of all choice values, the resulting configuration
could have wrong values.

Consider following example:
config M
        def_bool y
        option modules
choice
        prompt "choice list"
config A
        tristate "a"
config B
	tristate "b"
endchoice

With a defconfig like this:
CONFIG_M=y
CONFIG_A=y

The resulting configuration would have

    CONFIG_A=m

which was unexpected.

The problem was not not all choice values were set and thus
kconfig calculated a wrong value.

The fix is to set all choice values when we
read a defconfig files.

conf_set_all_new_symbols() is refactored such that
random choice values are now handled by a dedicated function.
And new choice values are set by set_all_choice_values().

This was not the minimal fix, but the fix that resulted
in the most readable code.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reported-by: Arve Hjønnevåg <arve@android.com>
Tested-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-12 10:55:02 +02:00
Sam Ravnborg 801690caf1 kconfig: fix savedefconfig for tristate choices
savedefconfig failed to save choice symbols equal to 'y'
for tristate choices.
This resulted in this value being lost.

In particular is fixes an issue where

	make ARCH=avr32 atngw100_defconfig
	make ARCH=avr32 savedefconfig
	cp defconfig arch/avr32/configs/atngw100_defconfig
	make ARCH=avr32 atngw100_defconfig
	diff -u .config .config.old

failed to produce an identical .config.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-12 10:55:02 +02:00
Sam Ravnborg 1482834971 kconfig: fix make oldconfig
Linus wrote:
 This seems to make "make oldconfig" a _lot_ more verbose than it
 used to be. In a very annoying way.

 I just did a quick git bisect. It's introduced by commit 4062f1a4c0
 ("kconfig: use long options in conf") by Sam Ravnborg. Apparently that
 thing is totally buggy, and doesn't just change the option names, but
 actively breaks them.

The old behaviour (from years ago) were reintroduced by accident.  Fix
this so we are back to the version that are silent if there is nothing
to ask about.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-06 09:17:02 -07:00
Linus Torvalds f43100ae39 Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  scripts/dtc: Fix a resource leak
  Documentation: fix ubuntu distro name
  MAINTAINERS: Update kbuild git URLs
  Add support for the C variable in the coccicheck script
  Add scripts/coccinelle/deref_null.cocci
  Add scripts/coccinelle/err_cast.cocci
  Add scripts/coccinelle/resource_size.cocci
  Add scripts/coccinelle/alloc/kzalloc-simple.cocci
  Add scripts/coccinelle/alloc/drop_kmalloc_cast.cocci
  Add Documentation/coccinelle.txt
  Add a target to use the Coccinelle checker
  scripts: decodecode: remove bashisms
  Makefile: clarify a comment
  checkkconfigsymbols.sh: Kconfig symbols sometimes have lowercase letters
  scripts: add nconf into gitignore file
2010-08-05 14:20:14 -07:00
Michal Marek 7a996d3ab1 Merge commit 'v2.6.35' into kbuild/kconfig
Conflicts:
	scripts/kconfig/Makefile
2010-08-04 14:05:07 +02:00
Sam Ravnborg 7cf3d73b43 kconfig: add savedefconfig
savedefconfig will save a minimal config to a file
named "defconfig".

The config symbols are saved in the same order as
they appear in the menu structure so it should
be possible to map them to the relevant menus
if desired.

The implementation was tested against several minimal
configs for arm which was created using brute-force.

There was one regression related to default numbers
which had their valid range further limited by another symbol.

Sample:

config FOO
	int "foo"
	default 4

config BAR
	int "bar"
	range 0 FOO

If FOO is set to 3 then BAR cannot take a value higher than 3.
But the current implementation will set BAR equal to 4.

This is seldomly used and the final configuration is OK,
and the fix was non-trivial.
So it was documented in the code and left as is.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:32 +02:00
Sam Ravnborg 49192f266f kconfig: code refactoring in confdata.c
Add a a few local functions to avoid some code duplication
No functional changes.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:32 +02:00
Sam Ravnborg c252147de6 kconfig: refactor code in symbol.c
Move logic to determine default for a choice to
a separate function.
No functional changes.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:32 +02:00
Sam Ravnborg 0748cb3e1f kconfig: add alldefconfig
alldefconfig create a configuration with all values set
to their default value (form the Kconfig files).

This may be useful when we try to use more sensible default
values and may also be used in combination with
the minimal defconfigs.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:32 +02:00
Roman Zippel d595cea624 kconfig: print more info when we see a recursive dependency
Consider following kconfig file:

config TEST1
	bool "test 1"
	depends on TEST2

config TEST2
	bool "test 2"
	depends on TEST1

Previously kconfig would report:

foo:6:error: found recursive dependency: TEST2 -> TEST1 -> TEST2

With the following patch kconfig reports:
foo:5:error: recursive dependency detected!
foo:5:  symbol TEST2 depends on TEST1
foo:1:  symbol TEST1 depends on TEST2

Note that we now report where the offending symbols are defined.
This can be a great help for complex situations involving
several files.

Patch is originally from Roman Zippel with a few adjustments by Sam.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:31 +02:00
Sam Ravnborg 59e89e3ddf kconfig: save location of config symbols
When we add a new config symbol save the file/line
so we later can refer to their location.

The information is saved as a property to a config symbol
because we may have multiple definitions of the same symbol.

This has the side-effect that a symbol always has
at least one property.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:31 +02:00
Sam Ravnborg 861b4ea4cc kconfig: change nonint_oldconfig to listnewconfig
Rename to a name that better match the other kconfig targets.

listnewconfig shall read as:

- list new options compared to current configuration

New options are now written to stdout so one can redirect the output.

Do not exit with an error code if there is new options.

These are feature changes compared to the original
nonint_oldconfig - but as this feature has not yet been in a
released kernel it should not matter.

It is still possible to do:

make listnewconfig
lookup new config options in Kconfig*
edit .config

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:31 +02:00
Sam Ravnborg ef61ca88c5 kconfig: rename loose_nonint_oldconfig => oldnoconfig
Rename target to something that fall more in line
with the other kconfig targets.

oldnoconfig shall read as:

- read the old configuration and set all new options to no

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:31 +02:00
Sam Ravnborg 4062f1a4c0 kconfig: use long options in conf
The list of options supported by conf is growing
and their abbreviation did not resemble anything usefull.

So drop the single letter options in favour of long options.

The long options are named equal to what we know from
the make target.
The internal implmentation was changed to match this,
resulting in much more readable code.

Support for short options is dropped - no one is supposed
to call this program direct anyway.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 13:49:31 +02:00
Ulf Magnusson ac1ffde1ba kconfig: fix MODULES-related bug in case of no .config
There seems to be a kconfig bug due to MODULES not always being
evaluated if no .config is found. Take the following Kconfig as an
example:

config MODULES
	def_bool y

config FOO
	def_tristate m

With no .config, the following configuration is generated:

CONFIG_MODULES=y
CONFIG_FOO=y

With an empty .config, the following:

CONFIG_MODULES=y
CONFIG_FOO=m

Tristate choice statements can also exhibit the problem, due to having an
implicit rev_dep (select) containing "m".

The problem is that MODULES is never evaluted in conf_read_simple() unless
there's a .config. The following patch fixes this.

Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-07-29 16:56:02 +02:00
Peter Korsgaard 1244b41d00 kconfig: make randconfig fair for booleans
Give boolean symbols a 50% chance of getting enabled, rather than 67%.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-07-26 15:40:52 +02:00
Stephen Boyd 58f915a311 nconfig: Fix segfault when help contains special characters
nconfig segfaults when help text contains the character '%'. For a quick
example, navigate to the kernel compression options and get the help for
bzip2. Doing so triggers a call to mvwprintw() with a string containing
'%' and no extra arguments to fill in the specifier's value. Fix this
case by printing the literal string retrieved from the kconfig.

 #0  0x00002b52b6b11d83 in vfprintf () from /lib/libc.so.6
 #1  0x00002b52b6bad010 in __vsnprintf_chk () from /lib/libc.so.6
 #2  0x00002b52b623991b in _nc_printf_string () from
 /lib/libncursesw.so.5
 #3  0x00002b52b6234cff in vwprintw () from /lib/libncursesw.so.5
 #4  0x00002b52b6234db9 in mvwprintw () from /lib/libncursesw.so.5
 #5  0x00000000004151d8 in fill_window (win=0x21b64c0,
     text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression ratio and
     speed is intermediate.\nDecompression speed is slowest among the
     three.  The kernel\nsize is about 10% smaller with bzip2, in
     comparison to gzip.\nBzip2 us"...)
     at scripts/kconfig/nconf.gui.c:229
 #6  0x0000000000416335 in show_scroll_win (main_window=0x21a5630,
         title=0x157fa30 "Bzip2",
 	    text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression
 	    ratio and speed is intermediate.\nDecompression speed is
 	    slowest among the three.  The kernel\nsize is about 10%
 	    smaller with bzip2, in comparison to gzip.\nBzip2 us"...)
     at scripts/kconfig/nconf.gui.c:535
 #7  0x00000000004055b2 in show_help (menu=0x157f9d0)
         at scripts/kconfig/nconf.c:1257
 #8  0x0000000000405897 in conf_choice (menu=0x157f130)
 	    at scripts/kconfig/nconf.c:1321
 #9  0x0000000000405326 in conf (menu=0x157d130) at
 	    scripts/kconfig/nconf.c:1208
 #10 0x00000000004052e8 in conf (menu=0xb434a0) at
 	    scripts/kconfig/nconf.c:1203
 #11 0x0000000000406092 in main (ac=2, av=0x7fff96a93c38)

Cc: Michal Marek <mmarek@suse.cz>
Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-07-23 11:23:42 +02:00
Jan Beulich 0a28c47b8d kconfig: Don't write invisible choice values
This makes it so "make oldconfig" really prompts for any choice where
options that previously weren't visible just became so. Previously one
would have to remember to go over all choice values and check whether
some that previously couldn't be selected now can be.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-07-08 14:38:14 +02:00
Catalin Marinas 246cf9c26b kbuild: Warn on selecting symbols with unmet direct dependencies
The "select" statement in Kconfig files allows the enabling of options
even if they have unmet direct dependencies (i.e. "depends on" expands
to "no"). Currently, the "depends on" clauses are used in calculating
the visibility but they do not affect the reverse dependencies in any
way.

The patch introduces additional tracking of the "depends on" statements
and prints a warning on selecting an option if its direct dependencies
are not met.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-07-02 14:53:09 +02:00
Justin P. Mattock 60c8eca69f scripts:conf.c Fix warning: variable 'type' set but not used
Not sure if this is correct or not, but with
make menuconfig
  HOSTCC  scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function 'conf_sym':
scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
scripts/kconfig/conf.c: In function 'conf_choice':
scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
  HOSTLD  scripts/kconfig/mconf

I get this using gcc 4.6.0 the below change fixes this form me.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-12 00:07:50 +02:00
Linus Torvalds c1518f12ba Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  gconfig: fix build failure on fedora 13
2010-06-04 15:37:21 -07:00
Li Zefan e7401d8321 menuconfig: truncate list items
Truncate list items to fit in a single line, otherwise those items
which have long prompts will cover some other items.

This follows the behavior of menubox.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-03 13:41:02 +02:00
Li Zefan 42ef223c4a menuconfig: fix to center checklist correctly in a corner case
Run:
	make ARCH=arm menuconfig

And then select "System Type" -> "ARM system type". The kconfig
"choice" menu at this point looks empty.

It's because config ARCH_S3C2410 has a long prompt:

config ARCH_S3C2410
        bool "Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443, S3C2450"
	...

menuconfig centers the checklist according to this prompt without
considering the width of the list, and then things get wrong.

Reported-by: Nobin Mathew <nobin.mathew@gmail.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-03 13:41:02 +02:00
Américo Wang 073ed10363 scripts: add nconf into gitignore file
scripts/kconfig/nconf is generated by 'make nconfig',
add it into .gitignore.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-03 10:12:40 +02:00
Richard Kennedy cbab05f041 gconfig: fix build failure on fedora 13
Making gconfig fails on fedora 13 as the linker cannot resolve dlsym.

Adding libdl to the link command fixes this.

make shows this error :-
    /usr/bin/ld: scripts/kconfig/kconfig_load.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
    /usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
    /lib64/libdl.so.2: could not read symbols: Invalid operation

tested on x86_64 fedora 13.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-03 10:05:18 +02:00
Li Zefan 39a4897c1b xconfig: add support to show hidden options which have prompts
This feature has been supported in menuconfig and gconfig, so
here add it to xconfig.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:33 +02:00
Li Zefan 120d63e633 xconfig: remove unused function
Remove ConfigInfoView::setSource().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:33 +02:00
Li Zefan c1f96f091e xconfig: clean up
@ok is a pointer to a bool var, so we should check the value of
*ok. But actually we don't need to check it, so just remove the
if statement.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:33 +02:00
Li Zefan c10d03caf3 gconfig: fix null pointer warning
In gconfig if you enable "Show all options", you'll see some "(null)"
config options, and clicking those options triggers a warning:

(gconf:9368): Gtk-CRITICAL **: gtk_text_buffer_insert_with_tags: assertion `text != NULL' failed

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:33 +02:00
Li Zefan e0bb7fe2d7 gconfig: fix to tag NEW symbols correctly
The logic should be reversed.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:32 +02:00
Li Zefan f9447c4939 menuconfig: improive help text a bit
Suggested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:32 +02:00
Li Zefan 3fb9acb329 kconfig: fix to tag NEW symbols correctly
Those configs are not new:

  $ cat .config
  ...
  CONFIG_NAMESPACES=y
  ...
  CONFIG_BLOCK=y
  ...

But are tagged as NEW:

  $ yes "" | make config > myconf
  $ cat myconf | grep '(NEW)'
  Namespaces support (NAMESPACES) [Y/?] (NEW) y
  ...
  Enable the block layer (BLOCK) [Y/?] (NEW) y
  ...

You can also notice this bug when using gconfig/xconfig.

It's because the SYMBOL_DEF_USER bit of an invisible symbol is cleared
when the config file is read:

int conf_read(const char *name)
{
	...
	for_all_symbols(i, sym) {
		if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
			/* Reset values of generates values, so they'll appear
			 * as new, if they should become visible, but that
			 * doesn't quite work if the Kconfig and the saved
			 * configuration disagree.
			 */
			if (sym->visible == no && !conf_unsaved)
				sym->flags &= ~SYMBOL_DEF_USER;
	...
}

But a menu item which represents an invisible symbol is still
visible, if it's sub-menu is visible, so its SYMBOL_DEF_USER
bit should be set to indicate it's not NEW.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:32 +02:00
Li Zefan 70ed074718 kconfig: print the range of integer/hex symbol in help text
Without this patch, one has to refer to the Kconfig file to find
out the range of an integer/hex symbol.

  │ Symbol: NR_CPUS [=4]
  │ Type  : integer
  │ Range : [2 8]
  │ Prompt: Maximum number of CPUs
  │   Defined at arch/x86/Kconfig:761
  │   Depends on: SMP [=y] && !MAXSMP [=n]
  │   Location:
  │     -> Processor type and features

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:10:32 +02:00
Li Zefan b040b44c35 kconfig: print symbol type in help text
Randy suggested to print out the symbol type in gconfig.

Note this change does more than Randy's suggestion, that it also
affects menuconfig and "make config".

  │ Symbol: BLOCK [=y]
  │ Type  : boolean
  │ Prompt: Enable the block layer
  │   Defined at block/Kconfig:4
  │   Depends on: EMBEDDED [=n]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 15:09:12 +02:00
Aristeu Rozanski f0778c8c41 kconfig: introduce nonint_oldconfig and loose_nonint_oldconfig
This patch has been around for a long time in Fedora and Red Hat Enterprise
Linux kernels and it may be useful for others. The nonint_oldconfig target
will fail and print the unset config options while loose_nonint_oldconfig will
simply let the config option unset. They're useful in distro kernel packages
where the config files are built using a combination of smaller config files.

Arjan van de Ven wrote the initial nonint_config and Roland McGrath added the
loose_nonint_oldconfig.

Signed-off-by: Arjan van de Ven <arjan@redhat.com> [defunct email]
Whatevered-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
[mmarek: whitespace fixes]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-02 14:40:09 +02:00
Linus Torvalds 1f73897861 Merge branch 'for-35' of git://repo.or.cz/linux-kbuild
* 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits)
  kbuild: Revert part of e8d400a to resolve a conflict
  kbuild: Fix checking of scm-identifier variable
  gconfig: add support to show hidden options that have prompts
  menuconfig: add support to show hidden options which have prompts
  gconfig: remove show_debug option
  gconfig: remove dbg_print_ptype() and dbg_print_stype()
  kconfig: fix zconfdump()
  kconfig: some small fixes
  add random binaries to .gitignore
  kbuild: Include gen_initramfs_list.sh and the file list in the .d file
  kconfig: recalc symbol value before showing search results
  .gitignore: ignore *.lzo files
  headerdep: perlcritic warning
  scripts/Makefile.lib: Align the output of LZO
  kbuild: Generate modules.builtin in make modules_install
  Revert "kbuild: specify absolute paths for cscope"
  kbuild: Do not unnecessarily regenerate modules.builtin
  headers_install: use local file handles
  headers_check: fix perl warnings
  export_report: fix perl warnings
  ...
2010-06-01 08:55:52 -07:00
Toralf Förster 1743192819 kconfig: Hide error output in find command in streamline_config.pl
Finding the list of Makefiles in streamline-config should not report errors.

Also move the "chomp" to the @makefiles array instead of doing it in the
for loop. This is more efficient, and does not make it any less readable
by C programmers.

Signed-off-by: Toralf Foerster <toralf.foerster@gmx.de>
LKML-Reference: <201005262022.02928.toralf.foerster@gmx.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-05-28 10:34:41 -04:00
Toralf Foerster 1d1d1feafd kconfig: Fix typo in comment in streamline_config.pl
Signed-off-by: Toralf Foerster <toralf.foerster@gmx.de>
LKML-Reference: <201005281025.52753.toralf.foerster@gmx.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-05-28 10:34:07 -04:00
Toralf Foerster e5199edb9e kconfig: Make a variable local in streamline_config.pl
Proper perl requires that local variables should be declared with 'my',
otherwise this may produce errors.

Signed-off-by: Toralf Foerster <toralf.foerster@gmx.de>
LKML-Reference: <201005281025.00358.toralf.foerster@gmx.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-05-28 10:31:25 -04:00
Li Zefan 06f9a55cf7 gconfig: add support to show hidden options that have prompts
There's a button in gconfig to "Show all options", but I think
normally we are not interested in those configs which have no
prompt and thus can't be changed, so here I add a new button to
show hidden options which have prompts.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:19 +02:00
Li Zefan 22c7eca61e menuconfig: add support to show hidden options which have prompts
Usage:
  Press <Z> to show all config symbols which have prompts.

Quote Tim Bird:

| I've been bitten by this numerous times.  I most often
| use ftrace on ARM, but when I go back to x86, I almost
| always go through a sequence of searching for the
| function graph tracer in the menus, then realizing it's
| completely missing until I disable CC_OPTIMIZE_FOR_SIZE.
|
| Is there any way to have the menu item appear, but be
| unsettable unless the SIZE option is disabled?  I'm
| not a Kconfig guru...

I myself found this useful too. For example, I need to test
ftrace/tracing and want to be sure all the tracing features are
enabled, so I  enter the "Tracers" menu, and press <Z> to
see if there is any config hidden.

I also noticed gconfig and xconfig have a button "Show all options",
but that's a bit too much, and I think normally what we are not
interested in those configs which have no prompt thus can't be
changed by users.

Exmaple:

      --- Tracers
      -*-   Kernel Function Tracer
      - -     Kernel Function Graph Tracer
      [*]   Interrupts-off Latency Tracer
      - -   Preemption-off Latency Tracer
      [*]   Sysprof Tracer

Here you can see 2 tracers are not selectable, and then can find
out how to make them selectable.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:19 +02:00
Li Zefan 7b5d87215b gconfig: remove show_debug option
This option is a no-op, so remove it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:18 +02:00
Li Zefan 2944235430 gconfig: remove dbg_print_ptype() and dbg_print_stype()
Just use sym_get_type() and prop_get_type_name().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:18 +02:00
Li Zefan c6ccc30fd7 kconfig: fix zconfdump()
zconfdump(), which is used for debugging, can't recognize P_SELECT,
P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"),
and output something like this:

config X86
  boolean
  default y
  unknown prop 6!
  unknown prop 6!
  unknown prop 6!
  ...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:18 +02:00
Li Zefan 4280eae099 kconfig: some small fixes
- fix a typo in documentation
- fix a typo in a printk on error
- fix comments in dialog_inputbox()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-04-14 15:34:18 +02:00
Li Zefan da6df879b9 kconfig: recalc symbol value before showing search results
A symbol's value won't be recalc-ed until we save config file or
enter the menu where the symbol sits.

So If I enable OPTIMIZE_FOR_SIZE, and search FUNCTION_GRAPH_TRACER:

  Symbol: FUNCTION_GRAPH_TRACER [=y]
  Prompt: Kernel Function Graph Tracer
    Defined at kernel/trace/Kconfig:140
    Depends on: ... [=y] && (!X86_32 [=y] || !CC_OPTIMIZE_FOR_SIZE [=y])
    ...

From the dependency it should result in FUNCTION_GRAPH_TRACER=n,
but it still shows FUNCTION_GRAPH_TRACER=y.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-03-23 12:29:07 +01:00
Thomas Weber 31a2d31dbd kconfig: util: Fix typo in comment
sting replaced with string

Signed-off-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-15 15:17:01 +01:00
Michal Marek 3cebbb81c7 kconfig: Simplify LSMOD= handling
Signed-off-by: Michal Marek <mmarek@suse.cz>
LKML-Reference: <20100203162014.GA10956@sepie.suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-02-03 11:45:25 -05:00
Steven Rostedt 615f0833aa kconfig: Add LSMOD=file to override the lsmod for localmodconfig
Doing the following:

	make LSMOD=file localmodconfig

Will make the streamline-config code use the given file instead of
lsmod. If the file is an executable, it will execute it, otherwise
it will read it as text.

	make LSMOD=/my/local/path/lsmod localmodconfig

The above will execute the lsmod in /my/local/path instead of the
lsmods that may be located elsewhere.

	make LSMOD=embedded_board_lsmod localmodconfig

The above will read the "embedded_board_lsmod" as a text file. This
is useful if you are doing a cross compile and need to run the
config against modules that exist on an embedded device.

Note, if the LSMOD= file does is not a path, it will add the
path to the object directory. That is, the above example will look
for "embedded_board_lsmod" in the directory that the binary will
be built in (the O=dir directory).

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

 On branch config/linus
2010-02-02 21:58:00 -05:00
Steven Rostedt 88f66ea98d kconfig: Look in both /bin and /sbin for lsmod in streamline_config.pl
Distributions now have lsmod in /bin instead of /sbin. But to handle
both cases, we look for it in /sbin /bin /usr/bin and /usr/sbin.
If lsmod is not found in any of those paths, it defaults to use
just lsmod and hopes that it lies in the path of the user.

Tested-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-02-02 13:01:01 -05:00
Andi Kleen e66f25d7d1 Improve kconfig symbol hashing
While looking for something else I noticed that the symbol
hash function used by kconfig is quite poor. It doesn't
use any of the standard hash techniques but simply
adds up the string and then uses power of two masking,
which is both known to perform poorly.

The current x86 kconfig has over 7000 symbols.

When I instrumented it showed that the minimum hash chain
length was 16 and a significant number of them was over
30.

It didn't help that the hash table size was only 256 buckets.

This patch increases the hash table size to a larger prime
and switches to a FNV32 hash. I played around with a couple of hash
functions, but that one seemed to perform best with reasonable
hash table sizes.

Increasing the hash table size even further didn't
seem like a good idea, because there are a couple of global
walks which walk the complete hash table.

I also moved the unnamed bucket to 0. It's still the longest
of all the buckets (44 entries), but hopefully it's not
often hit except for the global walk which doesn't care.

The result is a much nicer distribution:
(first column bucket length, second number of buckets with that length)

1: 3505
2: 1236
3: 294
4: 52
5: 3
47: 1		<--- this is the unnamed symbols bucket

There are still some 5+ buckets, but increasing the hash table
even more would be likely not worth it.

This also cleans up the code slightly by removing hard coded
magic numbers.

I didn't notice a big performance difference either way
on my Nehalem system, but I presume it'll help somewhat
on slower systems.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02 14:33:55 +01:00
Nir Tzachar 68c16edddf nconfig: minor fix
This patch fixes two problems reported by Jan Engelhardt:
1) Border is now properly placed, to always be visible
2) Long menu items are properly displayed

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02 14:33:55 +01:00
Michal Marek 851190c930 nconfig: mark local functions as such
scripts/kconfig/nconf.gui.c:23: warning: no previous prototype for 'set_normal_colors'
scripts/kconfig/nconf.gui.c:68: warning: no previous prototype for 'normal_color_theme'
scripts/kconfig/nconf.gui.c💯 warning: no previous prototype for 'no_colors_theme'
scripts/kconfig/nconf.c:455: warning: no previous prototype for 'process_special_keys'
scripts/kconfig/nconf.c:487: warning: no previous prototype for 'get_next_hot'
scripts/kconfig/nconf.c:506: warning: no previous prototype for 'canbhot'
scripts/kconfig/nconf.c:514: warning: no previous prototype for 'is_hot'
scripts/kconfig/nconf.c:522: warning: no previous prototype for 'make_hot'
scripts/kconfig/nconf.c:582: warning: no previous prototype for 'item_make'
scripts/kconfig/nconf.c:626: warning: no previous prototype for 'item_add_str'
scripts/kconfig/nconf.c:656: warning: no previous prototype for 'item_tag'
scripts/kconfig/nconf.c:668: warning: no previous prototype for 'curses_item_index'
scripts/kconfig/nconf.c:673: warning: no previous prototype for 'item_data'
scripts/kconfig/nconf.c:684: warning: no previous prototype for 'item_is_tag'
scripts/kconfig/nconf.c:691: warning: no previous prototype for 'set_config_filename'

Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02 14:33:55 +01:00
nir.tzachar@gmail.com 692d97c380 kconfig: new configuration interface (nconfig)
This patch was inspired by the kernel projects page, where an ncurses
replacement for menuconfig was mentioned (by Sam Ravnborg).

Building on menuconfig, this patch implements a more modern look
interface using ncurses and ncurses' satellite libraries (menu, panel,
form). The implementation does not depend on lxdialog, which is
currently distributed with the kernel.

Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02 14:33:55 +01:00
Vadim Bendebury (вб) da60fbbcb6 menuconfig: wrap long help lines
Help text for certain config options is very extensive (the text
includes the names of all  other options the option in question depends
on). Long lines are not wrapped, making it impossible to see the list
without scrolling horizontally.

This patch adds some logic which wraps help screen lines at word
boundaries to prevent truncating.

Tested by running

  ARCH=powerpc make menuconfig O=/tmp/build

which shows that the long lines are now wrapped, and

 ARCH=powerpc make xconfig O=/tmp/build

to demonstrate that it still compiles and operates as expected.

Signed-off-by: Vadim Bendebury <vbendeb@google.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02 14:33:55 +01:00
Steven Rostedt 13d7e93856 kconfig: Check for if conditions in Kconfig for localmodconfig
The streamline_config.pl misses the if conditions for checking
dependencies. For Kconfigs with the following construct:

 if MEDIA_SUPPORT

 config VIDEO_DEV

 [...]

If VIDEO_DEV was enabled, the script will miss the fact that MEDIA_SUPPORT
is also needed.

This patch changes streamline_config.pl to include if conditions into
the dependencies of configs.

Reported-by: Anton Blanchard <anton@sambo.org>
Tested-by: Anton Blanchard <anton@sambo.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-01-06 17:56:12 -05:00
Steven Rostedt 17263baf95 kconfig: Create include/generated for localmodconfig
If someone downloads a brand new kernel and runs localmodconfig or
localyesconfig, the ending result will report:

 *** Error during update of the kernel configuration.

This is because localmodconfig and localyesconfig must create the
include/generated directory to place the autoconf.h file.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-01-06 16:43:08 -05:00
Michal Marek bc081dd6e9 kbuild: generate modules.builtin
To make it easier for module-init-tools and scripts like mkinitrd to
distinguish builtin and missing modules, install a modules.builtin file
listing all builtin modules. This is done by generating an additional
config file (tristate.conf) with tristate options set to uppercase 'Y'
or 'M'. If we source that config file, the builtin modules appear in
obj-Y.

Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:16 +01:00
Michal Marek 32197c7ffb kbuild: create include/generated in silentoldconfig
The toplevel Makefile creates the directory if it runs silentoldconfig
automatically, but if run manually, it fails:

  $ make mrproper
  $ make defconfig && make silentoldconfig
  *** Default configuration is based on 'x86_64_defconfig'
  #
  # configuration written to .config
  #
  scripts/kconfig/conf -s arch/x86/Kconfig

  *** Error during update of the kernel configuration.
  ...

Move the mkdir command to the silentoldconfig target to make it work.

Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:16 +01:00
Sam Ravnborg 264a268380 kbuild: move autoconf.h to include/generated
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:15 +01:00
Jiri Kosina d014d04386 Merge branch 'for-next' into for-linus
Conflicts:

	kernel/irq/chip.c
2009-12-07 18:36:35 +01:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Steven Rostedt 463bf90007 kconfig: Fix make O=<dir> local{mod,yes}config
When the output directory is something other than the kernel source,
the streamline_config script gets confused. This patch passes in the
source directory to the script so that it can find the proper files.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-11-20 09:45:55 -05:00
Josh Triplett 6516657180 kconfig: Mark various internal functions static
kconfig's keyword hash, lexer, and parser define various functions used
only locally.  Declare these functions as static, and regenerate the
corresponding generated files.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
2009-11-15 15:00:16 -08:00
Josh Triplett 1456edbb14 kconfig: Make zconf.y work with current bison
zconf.y includes zconf.hash.c from the initial code section.
zconf.hash.c references the token constants from zconf.y.  However,
current bison defines the token constants after the initial code
section, making zconf.hash.c fail to compile.  Move the include of
zconf.hash.c later in zconf.y, so bison puts it after the token
constants.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
2009-10-15 11:10:12 -07:00
Trevor Keith 4356f48907 kbuild: add static to prototypes
Warnings found via gcc -Wmissing-prototypes.

Signed-off-by: Trevor Keith <tsrk@tsrk.net>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:44 +02:00
Diego Elio 'Flameeyes' Pettenò 78222caaee gconfig: disable "typeahead find" search in treeviews
When typeahead find is enabled, using 'y', 'n' and 'm' to change the status
of the configuration items will also start up the search system, making you
jump around the configuration.

Disabling the enable_search property does not mean that search is not
possible, it only disables the typeahead; to execute a search in the
treeview, you can just call it up explicitly (i.e.: on most systems that
will be Ctrl-f).

Signed-off-by: Diego Elio 'Flameeyes' Pettenò  <flameeyes@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:43 +02:00
Cheng Renquan 4779105e03 kconfig: make use of menu_get_ext_help in gconfig
Futhermore, gconfig interface lack the "search a symbol" function, do later.

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
[sam: fix SEGV in gconfig]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:42 +02:00
Cheng Renquan 66c4bd8085 kconfig: make use of menu_get_ext_help in "make config"
Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:42 +02:00
Cheng Renquan d74c15f3b7 kconfig: make use of menu_get_ext_help in qconfig
Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:41 +02:00
Cheng Renquan 1d525e7c1f kconfig: make use of menu_get_ext_help in menuconfig
The removed functions are moved into menu.c for sharing with
gconfig & xconfig & config.

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:41 +02:00
Cheng Renquan 6bd5999d1a kconfig: add menu_get_ext_help function to display more information
The three functions are moved from mconf.c, then they can be shared in
all menuconfig & gconfig & xconfig & config.

  +void menu_get_ext_help(struct menu *menu, struct gstr *help)
  +static void get_prompt_str(struct gstr *r, struct property *prop)
  +void get_symbol_str(struct gstr *r, struct symbol *sym)

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:41 +02:00
Cheng Renquan 544e433a9e kconfig: add symbol value to help find the real depend
Sometimes when configuring need to disable some unused item, but the item is
selected by many other items, it's hard to find the real dependency which
selected it, This patch add every symbol's value accompanied to make it
possible to find the real dependency easily.

An example is CONFIG_RFKILL,

  ---------------------- RF switch subsystem support ----------------------
  | CONFIG_RFKILL:                                                        |
  |                                                                       |
  | Say Y here if you want to have control over RF switches               |
  | found on many WiFi and Bluetooth cards.                               |
  |                                                                       |
  | To compile this driver as a module, choose M here: the                |
  | module will be called rfkill.                                         |
  |                                                                       |
  | Symbol: RFKILL [=m]                                                   |
  | Prompt: RF switch subsystem support                                   |
  |   Defined at net/rfkill/Kconfig:4                                     |
  |   Depends on: NET [=y]                                                |
  |   Location:                                                           |
  |     -> Networking support (NET [=y])                                  |
  |   Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC |
  |                                                                       |
  ----------------------------------------------------------------( 99%)---

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:41 +02:00
Steven Rostedt 48586218b6 kconfig: add missing dependency of conf to localyesconfig
There's a dependency missing.

$ make localyesconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
using config: '/boot/config-2.6.27.25-78.2.56.fc9.x86_64'
/bin/sh: line 8: scripts/kconfig/conf: No such file or directory
make[1]: *** [localyesconfig] Error 127
make: *** [localyesconfig] Error 2

Thus the script failed to run. But the sed command that converts the '=m'
to '=y' still ran. This gives us a distro config with all modules
converted to built in!

The missing dependency was for conf for localyesconfig. This
dependency was already set for localmodconfig.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-21 12:42:20 -04:00
Steven Rostedt a7c02602a8 kconfig: test if a .config already exists
If one were to run localmodconfig or localyesconfig without having
a .config already in the file, then the end of the process would give
a warning when it tries to move the old .config to .config.old.

This patch adds a test to check if .config exists and avoid the moves
if it does not.

[ Impact: remove warning after make localmodconfig ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 22:15:55 -04:00
Steven Rostedt a9024838d0 kconfig: make local .config default for streamline_config
As Andi Kleen pointed out, most people would expect that the local .config
file to be based for a streamline config. This patch changes the order
of searching for a config file to consider the .config in the local
directory first.

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 22:04:05 -04:00
Steven Rostedt 810b2be656 kconfig: test for /boot/config-uname after /proc/config.gz in localconfig
Many distros put their config in /boot/config-`uname -r`, add a check
for that right after /proc/config.gz

Reported-by: Alan Jenkins <sourcejedi.lkml@googlemail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 22:03:45 -04:00
Steven Rostedt d08ca2771e kconfig: unset IKCONFIG_PROC and clean up nesting
Due to cut and paste error IKCONFIG was both set and cleared.
It was suppose to be IKCONFIG_PROC to be cleared.

Also cleaned up if nesting.

Reported-by: Alan Jenkins <sourcejedi.lkml@googlemail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 22:02:40 -04:00
Steven Rostedt cdfc47950a kconfig: search for a config to base the local(mod|yes)config on
Instead of using the .config in the local directory. This patch
changes streamline_config.pl to search various locations for a config.

Here's the list and order of search:

  /proc/config.gz
  /boot/vmlinuz-`uname -r`
  vmlinux  # local to the directory
  /lib/modules/`uname -r`/kernel/kernel/configs.ko
  kernel/configs.ko
  kernel/configs.o
  .config

Once it finds a file that contains a config (it checks if the binary
objects have configs first) it then uses it to create the .config
with minimum modules needed.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 22:02:00 -04:00
Steven Rostedt 744ffcbe86 kconfig: enable CONFIG_IKCONFIG from streamline_config.pl
Ingo Molnar suggested that the streamline_config.pl should enable
CONFIG_IKCONFIG to keep the current config in the kernel.
Then we can use scripts/extract-ikconfig to find the current
modules.

This patch changes streamline_config.pl to check if CONFIG_IKCONFIG
is not set, and if it is not, it enables it to be a module.

[ Impact: make current config options easier to find ]

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:58:54 -04:00
Steven Rostedt ea2c1894b6 kconfig: do not warn about modules built in
The streamline_config.pl finds all the configs that are needed to
compile the currently loaded modules. After it creates the .config
file, it tests to make sure all the configs that are needed were
set.

It only looks at the configs that are modules, it does not look
at the builtin configs. This causes unnecessary warnings about modules
not being covered.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:58:41 -04:00
Steven Rostedt 74398d3224 kconfig: streamline_config.pl do not stop with no depends
If a config does not have a prompt, it must be selected.
streamline_config.pl keeps track of all configs that select other configs.
If a config that does not have a prompt needs to be set to enable a
current module, it will include all configs that select it.
Note, streamline_config.pl does not enable modules that are not already
enabled. It only keeps enabled those that were enabled and might be
needed to compile the current modules.

The code to find the selects of a config is after the code that
adds the depends. But if a config needed selects but had no dependencies,
it would not be set. Because the code would stop before getting to
the select.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:56:31 -04:00
Steven Rostedt 281c9dadc3 kconfig: add make localyesconfig option
This adds the option localyesconfig to make. This is similar to
localmodconfig, but after it removes unnecessary modules it runs

  sed -i s/=m/=y/

on the .config file. It then runs "make silentoldconfig" to fix any
wholes that were created by the conversion of modules to core.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:55:49 -04:00
Steven Rostedt 03fa25da83 kconfig: make localmodconfig to run streamline_config.pl
Running the streamline_config.pl script manually can still be confusing
for some users. This patch adds the localmodconfig option. This will
automatically run streamline_config.pl on the current .config and
then run "make silentoldconfig" to fix any wholes that might have been
created.

 $ make localmodconfig

This will remove any module configurations in .config that are not needed
to compile the modules that are loaded.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:54:28 -04:00
Steven Rostedt dcc60243e7 kconfig: add streamline_config.pl to scripts
streamline_config.pl is a very powerful tool. For those that install
a kernel to a new box using the config file from the distribution know that
it can take forever to compile the kernel.

Making a custom config file that will still boot your box, but bring
down the compile time of the kernel can be quit painful, and to ask
someone that reported a bug to do this can be a large burdon since that
person may not even know how to build a kernel.

This script will perform "lsmod" to find all the modules loaded on the
current running system. It will read all the Makefiles to map which
CONFIG enables a module. It will read the Kconfig files to find the
dependencies and selects that may be needed to support a CONFIG.
Finally, it reads the .config file and removes any module "=m" that is
not needed to enable the currently loaded modules. The output goes to
standard out.

Here's a way to run the script. From the Linux directory that holds
a distribution .config.

 $ scripts/kconfig/streamline_config.pl arch/x86/Kconfig > config-sl
 $ mv .config config-save
 $ mv config-sl .config
 $ make oldconfig

Now you have a .config that will still build all your modules, but also
take much less time to build the kernel.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 21:49:43 -04:00
Arnaud Lacombe d0e1e09568 kconfig: initialize the screen before using curses(3) functions
This is needed on non ncurses based implementation to get a properly
initialized `stdscr' in main().

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-07-17 23:06:08 +02:00
Arnaud Lacombe 668cdedfdb kconfig: variable argument lists needs `stdarg.h'
Fix build on non GNU based platforms.

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-07-17 23:05:05 +02:00
Markus Heidelberg 12122f6232 kconfig: do not hardcode "include/config/auto.conf" filename
Regardless of KCONFIG_AUTOCONFIG, the filename written as a Make target
into "include/config/auto.conf.cmd" was always the default one.

Of course this doesn't make it work for the Kernel kbuild system, since
there the filename is hardcoded at several places in the Makefiles.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:51 +02:00
Markus Heidelberg 284026cdfb kconfig: do not hardcode ".config" filename
Rather than hardcoding ".config" use conf_get_configname(), which also
respects the environment variable KCONFIG_CONFIG.

This fixes "make silentoldconfig" when KCONFIG_CONFIG is used and also
suggests the given filename for "Load" and "Save as" in qconf.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:51 +02:00
Markus Heidelberg 8d90c97e46 kconfig qconf: fix the type of the desktop widget
QApplication::desktop() returns a pointer to QDesktopWidget, not to
QWidget.

Fixes the following compiler error after a quick conversion with 'qt3to4',
which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.

scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':
scripts/kconfig/qconf.cc:1289: error: cannot convert 'QDesktopWidget*' to 'QWidget*' in initialization

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:50 +02:00
Markus Heidelberg fbb8637444 kconfig qconf: add namespace for use of Key_ enum values
They are defined in the 'Qt' namespace.

Fixes the following compiler errors after a quick conversion with 'qt3to4',
which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.

scripts/kconfig/qconf.cc: In member function 'virtual void ConfigLineEdit::keyPressEvent(QKeyEvent*)':
scripts/kconfig/qconf.cc:311: error: 'Key_Escape' was not declared in this scope
scripts/kconfig/qconf.cc:313: error: 'Key_Return' was not declared in this scope
scripts/kconfig/qconf.cc:314: error: 'Key_Enter' was not declared in this scope

scripts/kconfig/qconf.cc: In member function 'virtual void ConfigList::keyPressEvent(QKeyEvent*)':
scripts/kconfig/qconf.cc:653: error: 'Key_Escape' was not declared in this scope
scripts/kconfig/qconf.cc:666: error: 'Key_Return' was not declared in this scope
scripts/kconfig/qconf.cc:667: error: 'Key_Enter' was not declared in this scope
scripts/kconfig/qconf.cc:681: error: 'Key_Space' was not declared in this scope
scripts/kconfig/qconf.cc:684: error: 'Key_N' was not declared in this scope
scripts/kconfig/qconf.cc:687: error: 'Key_M' was not declared in this scope
scripts/kconfig/qconf.cc:690: error: 'Key_Y' was not declared in this scope

scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':
scripts/kconfig/qconf.cc:1329: error: 'CTRL' was not declared in this scope
scripts/kconfig/qconf.cc:1329: error: 'Key_Q' was not declared in this scope
scripts/kconfig/qconf.cc:1331: error: 'Key_L' was not declared in this scope
scripts/kconfig/qconf.cc:1333: error: 'Key_S' was not declared in this scope
scripts/kconfig/qconf.cc:1340: error: 'Key_F' was not declared in this scope

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:50 +02:00
Markus Heidelberg 7298b93601 kconfig qconf: fix namespace for Horizontal and Vertical enum values
They were used as QSplitter::Horizontal resp. QSplitter::Vertical, but
are defined in the 'Qt' namespace.

Fixes the following compiler errors after a quick conversion with 'qt3to4',
which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.

scripts/kconfig/qconf.cc: In constructor 'ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow*, const char*)':
scripts/kconfig/qconf.cc:1213: error: 'Vertical' is not a member of 'QSplitter'

scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':
scripts/kconfig/qconf.cc:1304: error: 'Horizontal' is not a member of 'QSplitter'
scripts/kconfig/qconf.cc:1311: error: 'Vertical' is not a member of 'QSplitter'

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:49 +02:00
Markus Heidelberg 98403a9138 kconfig qconf: fix -Wall compiler warnings
These compiler warnings occure when adding -Wall to HOSTCXXFLAGS in
/Makefile

scripts/kconfig/qconf.h: In constructor ‘ConfigInfoView::ConfigInfoView(QWidget*, const char*)’:
scripts/kconfig/qconf.h:274: warning: ‘ConfigInfoView::menu’ will be initialized after
scripts/kconfig/qconf.h:273: warning:   ‘symbol* ConfigInfoView::sym’
scripts/kconfig/qconf.cc:922: warning:   when initialized here

scripts/kconfig/qconf.cc: In member function ‘void ConfigMainWindow::setMenuLink(menu*)’:
scripts/kconfig/qconf.cc:1498: warning: enumeration value ‘menuMode’ not handled in switch
scripts/kconfig/qconf.cc:1498: warning: enumeration value ‘listMode’ not handled in switch

scripts/kconfig/qconf.cc: In member function ‘void ConfigMainWindow::saveSettings()’:
scripts/kconfig/qconf.cc:1664: warning: enumeration value ‘menuMode’ not handled in switch
scripts/kconfig/qconf.cc:1664: warning: enumeration value ‘listMode’ not handled in switch

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:48 +02:00
Markus Heidelberg c26dd719a5 gitignore: ignore Kconfig i18n files
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:47 +02:00
Markus Heidelberg 590a585729 kconfig: add a note about the deps to the 'silentoldconfig' help
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:46 +02:00
Markus Heidelberg 6f26e5e412 kconfig: fix typo "mconfig" to "menuconfig" in a comment
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:46 +02:00
Peter Korsgaard af6c159885 kconfig: handle comment entries within choice/endchoice
Implement support for comment entries within choice groups. Comment entries
are displayed visually distinct from normal configs, and selecting them is
a no-op.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-06-09 22:37:34 +02:00
Sam Ravnborg 612c280ef2 kconfig: fix update-po-config to accect backslash in input
Massimo Maiurana reported (slightly edited):

=====
In latest 2.6.29 "make update-po-config" fails at msguniq invocation
with an "invalid control sequence" error.
The offending string is the following, and it's located in
drivers/staging/panel/Kconfig:72:

    "'\e[L' which are specific to the LCD, and a few ANSI codes. The"

looks to me like gettext expects strings in printf format, so in
this case it thinks "\e" is a control sequence but doesn't recognise
it as a valid one.

A valid solution would be to tell kxgettext to automatically
escape this kind of strings in the */config.pot he produces, so that
msguniq would not complain.
=====

This patch implements the suggested escaping.

Reported-by: Massimo Maiurana <maiurana@gmail.com>
Tested-by: Massimo Maiurana <maiurana@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-04-11 08:18:07 +02:00
Ingo Molnar b0fe551000 kconfig: improve seed in randconfig
'make randconfig' uses glibc's rand function, and the seed of
that PRNG is set via:

			srand(time(NULL));

But 'time()' only increases once every second - freezing the
randconfig result within a single second.

My Nehalem testbox does randconfig much faster than 1 second
 and i have a few scripts that do 'randconfig until condition X'
loops.

Those scripts currently waste a lot of CPU time due to randconfig
changing its seed only once per second currently.

Change the seed to be micrseconds based. (I checked the statistical
spread of the seed - the now.tv_sec*now.tv_usec multiplication
there further improves it.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
[sam: fix for systems where usec is zero - noticed by Geert Uytterhoeven]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-03-15 23:02:07 +01:00
Sam Ravnborg 184832c981 kconfig: fix randconfig for choice blocks
Ingo Molnar reported that 'make randconfig' was not covering
choice blocks properly, resulting in certain config options
being left out of randconfig testing altogether.

With the following patch we:
- properly randomize choice value for normal choice blocks
- properly randomize for multi choice blocks
- added several comments to explain what is going on

The root cause of the bug was that SYMBOL_VALID was set on the
symbol representing the choice block so clearing this did
the trick initially.
But testign revealed a few more issues that is now fixed.

Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-03-15 22:54:57 +01:00
Sam Ravnborg 7826005e5a kconfig: improve error messages for bad source statements
We now say where we detect the second source of a file,
and where we detect a recursively source of the same file.
This makes it easier to fix such errors.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2009-01-02 20:43:22 +01:00
Sam Ravnborg cf82607a90 kconfig: struct property commented
No functional changes

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-02 20:43:21 +01:00
Sam Ravnborg 5b2cf365a8 kconfig: add comments to symbol flags
No functional changes - only comments.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-02 20:43:21 +01:00
Sam Ravnborg eaa2a87460 kconfig: explain symbol value defaults
Added a few comments - no functional change.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-02 20:43:20 +01:00
Sam Ravnborg f6682f9157 kconfig: fix options to check-lxdialog.sh
As noted by Bernhard - fix it up.

Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-12-03 22:11:14 +01:00
Al Viro ce97e13e52 fix allmodconfig breakage
If you use KCONFIG_ALLCONFIG (even with empty file) you get broken
allmodconfig/allyesconfig; CONFIG_MODULES gets turned off, with obvious
massive fallout.

Breakage had been introduced when conf_set_all_new_symbols() got used
for allmodconfig et.al.

What happens is that sym_calc_value(modules_sym) done in
conf_read_simple() sets SYMBOL_VALID on both modules_sym and MODULES.
When we get to conf_set_all_new_symbols(), we set sym->def[S_DEF_USER]
on everything, but it has no effect on sym->curr for the symbols that
already have SYMBOL_VALID - these are stuck.

Solution: use sym_clear_all_valid() in there.  Note that it makes
reevaluation of modules_sym redundant - sym_clear_all_valid() will do
that itself.

[ Fixes http://bugzilla.kernel.org/show_bug.cgi?id=11512, says Alexey ]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-26 09:35:05 -07:00
Al Viro 61bee20445 x86, um: get rid of arch/um/Kconfig.arch
Teach scripts/kconfig/Makefile and top-level Makefile that arch/*/Makefile
is allowed to say Kconfig := <whatever I want instead of arch/blah/Kconfig>.
Rewrite arch/um/Kconfig and arch/um/Kconfig.<subarch> so that the latter
would be top-level one (and include the pieces of the former).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-22 22:55:23 -07:00
zippel@linux-m68k.org 661b0680f7 kconfig: readd lost change count
Commit f072181e64 ("kconfig: drop the
""trying to assign nonexistent symbol" warning") simply dropped the
warnings, but it does a little more than that, it also marks the current
.config as needed saving, so add this back.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-09-29 08:03:01 -07:00
zippel@linux-m68k.org 204c96f609 kconfig: fix silentoldconfig
Recent changes to oldconfig have mixed up the silentoldconfig handling,
so this fixes that by clearly separating that special mode, e.g.
KCONFIG_NOSILENTUPDATE is only relevant here, the .config is written as
needed.

This will also properly close Bug 11230.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-09-29 08:03:01 -07:00
Sam Ravnborg f072181e64 kconfig: drop the ""trying to assign nonexistent symbol" warning
They really stand out now that make *config is less chatty - and
they are generally ignored - so drop them.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Adrian Bunk <bunk@kernel.org>
2008-08-04 22:29:37 +02:00
Sam Ravnborg 22127f246d kconfig: always write out .config
Always write out .config also in the case where config
did not change.
This fixes: http://bugzilla.kernel.org/show_bug.cgi?id=11230

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Adrian Bunk <bunk@kernel.org>
2008-08-04 22:18:07 +02:00
Adrian Bunk be2be1d590 kconfig: scripts/kconfig/zconf.l: add %option noinput
gcc 4.3 correctly determines that input() is unused and gives the
following warning:

<--  snip  -->

...
  HOSTCC  scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
...

<--  snip  -->

Fix it by adding %option noinput to scripts/kconfig/zconf.l and
regeneration of scripts/kconfig/lex.zconf.c_shipped.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-30 22:29:50 +02:00
Sam Ravnborg 09748e178b kconfig: make defconfig is no longer chatty
make defconfig generated a lot of output
then noone actually read.
Use conf_set_all_new_symbols() to generate the default
configuration and avoid the chatty output.

A typical run now looks like this:
$ make  defconfig
*** Default configuration is based on 'i386_defconfig'
arch/x86/configs/i386_defconfig:13:warning: trying to assign nonexistent symbol SEMAPHORE_SLEEPERS
arch/x86/configs/i386_defconfig:176:warning: trying to assign nonexistent symbol PREEMPT_BKL
...
arch/x86/configs/i386_defconfig:1386:warning: trying to assign nonexistent symbol INSTRUMENTATION
$

As an added benefit we now clearly see the warnings generated
in the start of the process.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2008-07-25 22:12:51 +02:00
Sam Ravnborg cd9140e1e7 kconfig: make oldconfig is now less chatty
Previously when running "make oldconfig" we saw all the propmt lines
from kconfig and noone actully read this.

With this patch the user will only see output if there is new symbols.
This will be seen as "make oldconfig" runs which does not generate any output.

A typical run now looks like this:

$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
$

If a new symbol is found then we restart the config process like this:
$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
*
* Restart config...
*
*
* General setup
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
Local version - append to kernel release (LOCALVERSION) []
...

The bahaviour is similar to what we know when running the implicit
oldconfig target "make silentoldconfig".
"make silentoldconfig" are run as part of the kernel build process
if the configuration has changed.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2008-07-25 22:12:50 +02:00
Sam Ravnborg f443d2eccf kconfig: speed up all*config + randconfig
Drop the chatty mode when we generate the all*config, randconfig
configurations.
Ths speeds up the process considerably and noone looked
at the output anyway.
This patch uses the conf_set_all_new_symbols() function
just added to kconfig.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2008-07-25 22:12:49 +02:00
Roman Zippel dc7862e5a6 kconfig: set all new symbols automatically
Add conf_set_all_new_symbols() which set all symbols (which don't have a
value yet) to a specifed value.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-25 22:12:48 +02:00
Christophe Jaillet 107f43a0f7 kconfig: incorrect 'len' field initialisation ?
1) The field 'len' of the 'gstr' structure seems to track the size of the memory
already allocated for the "growable string". So the value of this field should be
the same as the 'malloc()' just above, shouldn't it ?

Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-05-19 20:14:49 +02:00
Sam Ravnborg c4143a8303 kconfig: fix MAC OS X warnings in menuconfig
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Timur Tabi <timur@freescale.com>
2008-05-04 21:03:20 +02:00
Sam Ravnborg b44158de9e kconfig: made check-lxdialog more portable
OS-X shell did not like 'echo -e' so implement
suggestion from Al Viro to use a more portable construct.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-By: Timur Tabi <timur@freescale.com>
2008-05-01 19:29:47 +02:00
Roman Zippel 5a1aa8a1af kconfig: add named choice group
As choice dependency are now fully checked, it's quite easy to add support
for named choices. This lifts the restriction that a choice value can only
appear once, although it still has to be within the same group,
but multiple choices can be joined by giving them a name.
While at it I cleaned up a little the choice type logic to simplify it a
bit.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-28 23:05:48 +02:00
Roman Zippel 4898117886 kconfig: fix choice dependency check
Properly check the dependency of choices as a group.
Also fix that sym_check_deps() correctly terminates the dependency loop
error check (otherwise it would continue printing the dependency chain).

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-28 23:04:57 +02:00
Roel Kluin 79d6e539df kconfig: reversed borderlines in inputbox
Fix reversal of dlg.border.atr and dlg.dialog.atr for draw_box()
Makes the inputbox look like expected

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-28 22:27:26 +02:00
Sam Ravnborg 4217516e52 kconfig: fix broken target update-po-config
Massimo Maiurana reported:
In the latest kernel "make update-po-config" fails because it tries
to open arch/Kconfig/Kconfig, since the ls command doesn't
distinguish between files and directories.

Cc: Massimo Maiurana <maiurana@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-25 21:15:41 +02:00
Roman Zippel 587c90616a kconfig: fix select in combination with default
> The attached .config (with current -git) results in a compile
> error since it contains:
>
> CONFIG_X86=y
> # CONFIG_EMBEDDED is not set
> CONFIG_SERIO=m
> CONFIG_SERIO_I8042=y
>
> Looking at drivers/input/serio/Kconfig I simply don't get how this
> can happen.

You've hit the rather subtle rules of select vs default. What happened is
that SERIO is selected to m, but SERIO_I8042 isn't selected so the default
of y is used instead.
We already had the problem in the past that select and default don't work
well together, so this patch cleans this up and makes the rule hopefully
more straightforward. Basically now the value is calculated like this:

	(value && dependency) || select

where the value is the user choice (if available and the symbol is
visible) or default.

In this case it means SERIO and SERIO_I8042 are both set to y due to their
default and if SERIO didn't had the default, then the SERIO_I8042 value
would be limited to m due to the dependency.

I tested this patch with more 10000 random configs and above case is the
only the difference that showed up, so I hope there is nothing that
depended on the old more complex and subtle rules.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Tested-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-02-13 22:30:09 +01:00
Sam Ravnborg 603d49885e kconfig: ignore select of unknown symbol
We have had warnings for a long time about select of unknow symbol
but the warnings does not really makes sense since we may
select a symbol that is relevant and defined in one
arch but not in another arch.
And as long as we do not use a common set of Kconfig files
for all archs lets just ignore this case.

Previously we have used this to find bad uses of
select but we need a more relaible method to do so.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2008-02-03 08:58:07 +01:00
Sam Ravnborg 36ef805bd5 kconfig: mark config as changed when loading an alternate config
Michal Zachar <mgzachar@mail.t-com.sk> reported that
menuconfig did not save the new config when loading
an alternate config unless he altered it manually.

Mark config as changed upon load of alternate config fixed this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Roman Zippel <zippel@linux-m68k.org>
2008-02-03 08:58:07 +01:00
Jan Beulich f5eaa323eb kconfig: tristate choices with mixed tristate and boolean values
Change kconfig behavior so that mixing bool and tristate config
settings in a choice is possible and has the desired effect of offering
just the tristate options individually if the choice gets set to M, and
a normal boolean selection if the choice gets set to Y.

Also fix scripts/kconfig/conf's handling of children of choice values -
there may be more than one immediate child, and all of them need to be
processed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: "Roman Zippel" <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-01-28 23:21:18 +01:00
Adrian Bunk 9649ef878d kconfig: remove "enable"
Kconfig had a synonym "enable" for "select" that was neither documented
nor used.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-01-28 23:21:18 +01:00
Roman Zippel 80daa56008 kconfig: use environment option
Use the environment option to provide the ARCH symbol
and the KERNELVERSION symbol.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-01-28 23:14:39 +01:00