[uClibc-cvs] uClibc/extra/config Kconfig-language.txt, 1.1, 1.2 menu.c, 1.2, 1.3

Erik Andersen andersen at uclibc.org
Tue Nov 4 13:08:12 UTC 2003


Update of /var/cvs/uClibc/extra/config
In directory winder:/tmp/cvs-serv7696/extra/config

Modified Files:
	Kconfig-language.txt menu.c 
Log Message:
Rework the config system.  Better utilize the Kconfig language
which should simplify enabling arbitrary architectures.
 -Erik


Index: Kconfig-language.txt
===================================================================
RCS file: /var/cvs/uClibc/extra/config/Kconfig-language.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Kconfig-language.txt	8 Nov 2002 00:17:43 -0000	1.1
+++ Kconfig-language.txt	4 Nov 2003 13:07:47 -0000	1.2
@@ -18,7 +18,7 @@
 	+- ...
 
 Every entry has its own dependencies. These dependencies are used
-to determine the visible of an entry. Any child entry is only
+to determine the visibility of an entry. Any child entry is only
 visible if its parent entry is also visible.
 
 Menu entries
@@ -50,7 +50,7 @@
 
 - type definition: "bool"/"tristate"/"string"/"hex"/"integer"
   Every config option must have a type. There are only two basic types:
-  tristate and string, the other types base on these two. The type
+  tristate and string, the other types are based on these two. The type
   definition optionally accepts an input prompt, so these two examples
   are equivalent:
 
@@ -64,12 +64,12 @@
   to the user. Optionally dependencies only for this prompt can be added
   with "if".
 
-- default value: "default" <symbol> ["if" <expr>]
+- default value: "default" <expr> ["if" <expr>]
   A config option can have any number of default values. If multiple
   default values are visible, only the first defined one is active.
   Default values are not limited to the menu entry, where they are
   defined, this means the default can be defined somewhere else or be
-  overriden by an earlier definition.
+  overridden by an earlier definition.
   The default value is only assigned to the config symbol if no other
   value was set by the user (via the input prompt above). If an input
   prompt is visible the default value is presented to the user and can
@@ -81,7 +81,7 @@
   This defines a dependency for this menu entry. If multiple
   dependencies are defined they are connected with '&&'. Dependencies
   are applied to all other options within this menu entry (which also
-  accept "if" expression), so these two examples are equivalent:
+  accept an "if" expression), so these two examples are equivalent:
 
 	bool "foo" if BAR
 	default y if BAR
@@ -90,10 +90,28 @@
 	bool "foo"
 	default y
 
-- help text: "help"
+- reverse dependencies: "select" <symbol> ["if" <expr>]
+  While normal dependencies reduce the upper limit of a symbol (see
+  below), reverse dependencies can be used to force a lower limit of
+  another symbol. The value of the current menu symbol is used as the
+  minimal value <symbol> can be set to. If <symbol> is selected multiple
+  times, the limit is set to the largest selection.
+  Reverse dependencies can only be used with boolean or tristate
+  symbols.
+
+- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
+  This allows to limit the range of possible input values for integer
+  and hex symbols. The user can only input a value which is larger than
+  or equal to the first symbol and smaller than or equal to the second
+  symbol.
+
+- help text: "help" or "---help---"
   This defines a help text. The end of the help text is determined by
-  the level indentation, this means it ends at the first line which has
+  the indentation level, this means it ends at the first line which has
   a smaller indentation than the first line of the help text.
+  "---help---" and "help" do not differ in behaviour, "---help---" is
+  used to help visually seperate configuration logic from help within
+  the file as an aid to developers.
 
 
 Menu dependencies
@@ -109,8 +127,8 @@
            <symbol> '!=' <symbol>               (3)
            '(' <expr> ')'                       (4)
            '!' <expr>                           (5)
-           <expr> '||' <expr>                   (6)
-           <expr> '&&' <expr>                   (7)
+           <expr> '&&' <expr>                   (6)
+           <expr> '||' <expr>                   (7)
 
 Expressions are listed in decreasing order of precedence. 
 
@@ -123,14 +141,14 @@
     otherwise 'y'.
 (4) Returns the value of the expression. Used to override precedence.
 (5) Returns the result of (2-/expr/).
-(6) Returns the result of min(/expr/, /expr/).
-(7) Returns the result of max(/expr/, /expr/).
+(6) Returns the result of max(/expr/, /expr/).
+(7) Returns the result of min(/expr/, /expr/).
 
 An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
 respectively for calculations). A menu entry becomes visible when it's
 expression evaluates to 'm' or 'y'.
 
-There are two type of symbols: constant and nonconstant symbols.
+There are two types of symbols: constant and nonconstant symbols.
 Nonconstant symbols are the most common ones and are defined with the
 'config' statement. Nonconstant symbols consist entirely of alphanumeric
 characters or underscores.
@@ -142,7 +160,7 @@
 --------------
 
 The position of a menu entry in the tree is determined in two ways. First
-it can be specified explicitely:
+it can be specified explicitly:
 
 menu "Network device support"
 	depends NET
@@ -159,8 +177,8 @@
 
 The other way to generate the menu structure is done by analyzing the
 dependencies. If a menu entry somehow depends on the previous entry, it
-can be made a submenu of it. First the the previous (parent) symbol must
-be part of the dependency list and then one of these two condititions
+can be made a submenu of it. First, the previous (parent) symbol must
+be part of the dependency list and then one of these two conditions
 must be true:
 - the child entry must become invisible, if the parent is set to 'n'
 - the child entry must only be visible, if the parent is visible
@@ -177,7 +195,7 @@
 
 MODVERSIONS directly depends on MODULES, this means it's only visible if
 MODULES is different from 'n'. The comment on the other hand is always
-visible when MODULES it's visible (the (empty) dependency of MODULES is
+visible when MODULES is visible (the (empty) dependency of MODULES is
 also part of the comment dependencies).
 
 
@@ -188,12 +206,13 @@
 line starts with a keyword (except help texts). The following keywords
 end a menu entry:
 - config
+- menuconfig
 - choice/endchoice
 - comment
 - menu/endmenu
 - if/endif
 - source
-The first four also start the definition of a menu entry.
+The first five also start the definition of a menu entry.
 
 config:
 
@@ -203,6 +222,14 @@
 This defines a config symbol <symbol> and accepts any of above
 attributes as options.
 
+menuconfig:
+	"menuconfig" <symbol>
+	<config options>
+
+This is similiar to the simple config entry above, but it also gives a
+hint to front ends, that all suboptions should be displayed as a
+separate list of options.
+
 choices:
 
 	"choice"

Index: menu.c
===================================================================
RCS file: /var/cvs/uClibc/extra/config/menu.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- menu.c	5 Aug 2003 01:52:39 -0000	1.2
+++ menu.c	4 Nov 2003 13:07:47 -0000	1.3
@@ -275,9 +275,8 @@
 				break;
 			case P_SELECT:
 				sym2 = prop_get_symbol(prop);
-				if ((sym->type != S_BOOLEAN && sym->type != S_TRISTATE) ||
-				    (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE))
-					fprintf(stderr, "%s:%d:warning: enable is only allowed with boolean and tristate symbols\n",
+				if ((sym->type != S_BOOLEAN) || (sym2->type != S_BOOLEAN))
+					fprintf(stderr, "%s:%d:warning: enable is only allowed with booleans\n",
 						prop->file->name, prop->lineno);
 				break;
 			case P_RANGE:




More information about the uClibc-cvs mailing list