Re: kconfig: support option env="" [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-13 Thread Sam Ravnborg
On Mon, Jan 14, 2008 at 04:49:48AM +0100, Roman Zippel wrote:
> Hi,
> 
> On Sun, 6 Jan 2008, Sam Ravnborg wrote:
> 
> > Please get back to me so we can finsih this patch and have it applied.
> > I will split the patch in two btw.
> 
> I reworked the patch a little and split it into three.

Thanks Roman.
I will test and apply tonight.

Removal of KERNELVERSION in patch #3 is wrong as the frontend
uses KERNELVERSION to display the kernel version in their title.
I will drop the deletion before I apply the patch.


> 
> > > + if (sym->flags & SYMBOL_AUTO)
> > > + sym->flags &= ~SYMBOL_WRITE;
> > > +
> > 
> > Why is this change needed?
> > It is non-obvious to me so please explain and I will add a comment.
> 
> Automatically generated symbols are not saved, this was previously not 
> needed as they weren't in the menu structure.
OK

> 
> > I did it like this:
> > menu_warn(current_entry,
> >   "config %s: redefining environment symbol 
> > from '%s' to '%s'",
> >   sym->name, env, sym2->name);
> 
> I omitted the prefix, it's inconsistent with other warnings.
OK

Thanks,
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kconfig: support option env="" [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-13 Thread Roman Zippel
Hi,

On Sun, 6 Jan 2008, Sam Ravnborg wrote:

> Please get back to me so we can finsih this patch and have it applied.
> I will split the patch in two btw.

I reworked the patch a little and split it into three.

> > +   if (sym->flags & SYMBOL_AUTO)
> > +   sym->flags &= ~SYMBOL_WRITE;
> > +
> 
> Why is this change needed?
> It is non-obvious to me so please explain and I will add a comment.

Automatically generated symbols are not saved, this was previously not 
needed as they weren't in the menu structure.

> I did it like this:
>   menu_warn(current_entry,
> "config %s: redefining environment symbol 
> from '%s' to '%s'",
> sym->name, env, sym2->name);

I omitted the prefix, it's inconsistent with other warnings.

bye, Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kconfig: support option env= [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-13 Thread Roman Zippel
Hi,

On Sun, 6 Jan 2008, Sam Ravnborg wrote:

 Please get back to me so we can finsih this patch and have it applied.
 I will split the patch in two btw.

I reworked the patch a little and split it into three.

  +   if (sym-flags  SYMBOL_AUTO)
  +   sym-flags = ~SYMBOL_WRITE;
  +
 
 Why is this change needed?
 It is non-obvious to me so please explain and I will add a comment.

Automatically generated symbols are not saved, this was previously not 
needed as they weren't in the menu structure.

 I did it like this:
   menu_warn(current_entry,
 config %s: redefining environment symbol 
 from '%s' to '%s',
 sym-name, env, sym2-name);

I omitted the prefix, it's inconsistent with other warnings.

bye, Roman
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kconfig: support option env= [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-13 Thread Sam Ravnborg
On Mon, Jan 14, 2008 at 04:49:48AM +0100, Roman Zippel wrote:
 Hi,
 
 On Sun, 6 Jan 2008, Sam Ravnborg wrote:
 
  Please get back to me so we can finsih this patch and have it applied.
  I will split the patch in two btw.
 
 I reworked the patch a little and split it into three.

Thanks Roman.
I will test and apply tonight.

Removal of KERNELVERSION in patch #3 is wrong as the frontend
uses KERNELVERSION to display the kernel version in their title.
I will drop the deletion before I apply the patch.


 
   + if (sym-flags  SYMBOL_AUTO)
   + sym-flags = ~SYMBOL_WRITE;
   +
  
  Why is this change needed?
  It is non-obvious to me so please explain and I will add a comment.
 
 Automatically generated symbols are not saved, this was previously not 
 needed as they weren't in the menu structure.
OK

 
  I did it like this:
  menu_warn(current_entry,
config %s: redefining environment symbol 
  from '%s' to '%s',
sym-name, env, sym2-name);
 
 I omitted the prefix, it's inconsistent with other warnings.
OK

Thanks,
Sam
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


kconfig: support option env="" [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-06 Thread Sam Ravnborg
Hi Roman.

Some time ago you sent the following patch which I have started
to review properly and test.
But it triggers a few questions / comments.

For reference (since it is so long ago I have kept most
of the patch but only a few places are commented.

Please get back to me so we can finsih this patch and have it applied.
I will split the patch in two btw.
One where option env= is introduced
and a second patch that kill the three hardcoded variables
in symbol.c (ARCH, KERNELVERSION and UNAME_RELEASE).

Sam

> The patch below adds some features to it:
> - it allows to import any environment variable by specifying "option env=..."
> - it generates a dependency on it, so the kernel config is updated if it 
> changes.
> 
> 
> Signed-off-by: Roman Zippel <[EMAIL PROTECTED]>
> 
> ---
>  init/Kconfig |4 ++
>  scripts/kconfig/expr.c   |   16 +-
>  scripts/kconfig/expr.h   |5 +--
>  scripts/kconfig/lkc.h|5 +++
>  scripts/kconfig/menu.c   |7 +++-
>  scripts/kconfig/qconf.cc |   15 ++---
>  scripts/kconfig/symbol.c |   53 
> +--
>  scripts/kconfig/util.c   |   25 +++-
>  scripts/kconfig/zconf.gperf  |1 
>  scripts/kconfig/zconf.hash.c_shipped |   45 -
>  10 files changed, 123 insertions(+), 53 deletions(-)
> 
> Index: linux-2.6/init/Kconfig
> ===
> --- linux-2.6.orig/init/Kconfig
> +++ linux-2.6/init/Kconfig
> @@ -7,6 +7,10 @@ config DEFCONFIG_LIST
>   default "/boot/config-$UNAME_RELEASE"
>   default "arch/$ARCH/defconfig"
>  
> +config ARCH
> + string
> + option env="ARCH"
> +
>  menu "General setup"
>  
>  config EXPERIMENTAL
> Index: linux-2.6/scripts/kconfig/expr.c
> ===
> --- linux-2.6.orig/scripts/kconfig/expr.c
> +++ linux-2.6/scripts/kconfig/expr.c
> @@ -87,7 +87,7 @@ struct expr *expr_copy(struct expr *org)
>   break;
>   case E_AND:
>   case E_OR:
> - case E_CHOICE:
> + case E_LIST:
>   e->left.expr = expr_copy(org->left.expr);
>   e->right.expr = expr_copy(org->right.expr);
>   break;
> @@ -217,7 +217,7 @@ int expr_eq(struct expr *e1, struct expr
>   expr_free(e2);
>   trans_count = old_count;
>   return res;
> - case E_CHOICE:
> + case E_LIST:
>   case E_RANGE:
>   case E_NONE:
>   /* panic */;
> @@ -648,7 +648,7 @@ struct expr *expr_transform(struct expr 
>   case E_EQUAL:
>   case E_UNEQUAL:
>   case E_SYMBOL:
> - case E_CHOICE:
> + case E_LIST:
>   break;
>   default:
>   e->left.expr = expr_transform(e->left.expr);
> @@ -932,7 +932,7 @@ struct expr *expr_trans_compare(struct e
>   break;
>   case E_SYMBOL:
>   return expr_alloc_comp(type, e->left.sym, sym);
> - case E_CHOICE:
> + case E_LIST:
>   case E_RANGE:
>   case E_NONE:
>   /* panic */;
> @@ -1000,9 +1000,9 @@ int expr_compare_type(enum expr_type t1,
>   if (t2 == E_OR)
>   return 1;
>   case E_OR:
> - if (t2 == E_CHOICE)
> + if (t2 == E_LIST)
>   return 1;
> - case E_CHOICE:
> + case E_LIST:
>   if (t2 == 0)
>   return 1;
>   default:
> @@ -1053,11 +1053,11 @@ void expr_print(struct expr *e, void (*f
>   fn(data, NULL, " && ");
>   expr_print(e->right.expr, fn, data, E_AND);
>   break;
> - case E_CHOICE:
> + case E_LIST:
>   fn(data, e->right.sym, e->right.sym->name);
>   if (e->left.expr) {
>   fn(data, NULL, " ^ ");
> - expr_print(e->left.expr, fn, data, E_CHOICE);
> + expr_print(e->left.expr, fn, data, E_LIST);
>   }
>   break;
>   case E_RANGE:
> Index: linux-2.6/scripts/kconfig/expr.h
> ===
> --- linux-2.6.orig/scripts/kconfig/expr.h
> +++ linux-2.6/scripts/kconfig/expr.h
> @@ -32,7 +32,7 @@ typedef enum tristate {
>  } tristate;
>  
>  enum expr_type {
> - E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, 
> E_RANGE
> + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, 
> E_RANGE
>  };
>  
>  union expr_data {
> @@ -105,7 +105,8 @@ struct symbol {
>  #define SYMBOL_HASHMASK  0xff
>  
>  enum prop_type {
> - P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, 
> P_RANGE
> + P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE,
> + P_SELECT, P_RANGE, P_ENV
>  };
>  
>  struct property {
> Index: 

kconfig: support option env= [Was: kconfig: use $K64BIT to set 64BIT with all*config targets]

2008-01-06 Thread Sam Ravnborg
Hi Roman.

Some time ago you sent the following patch which I have started
to review properly and test.
But it triggers a few questions / comments.

For reference (since it is so long ago I have kept most
of the patch but only a few places are commented.

Please get back to me so we can finsih this patch and have it applied.
I will split the patch in two btw.
One where option env= is introduced
and a second patch that kill the three hardcoded variables
in symbol.c (ARCH, KERNELVERSION and UNAME_RELEASE).

Sam

 The patch below adds some features to it:
 - it allows to import any environment variable by specifying option env=...
 - it generates a dependency on it, so the kernel config is updated if it 
 changes.
 
 
 Signed-off-by: Roman Zippel [EMAIL PROTECTED]
 
 ---
  init/Kconfig |4 ++
  scripts/kconfig/expr.c   |   16 +-
  scripts/kconfig/expr.h   |5 +--
  scripts/kconfig/lkc.h|5 +++
  scripts/kconfig/menu.c   |7 +++-
  scripts/kconfig/qconf.cc |   15 ++---
  scripts/kconfig/symbol.c |   53 
 +--
  scripts/kconfig/util.c   |   25 +++-
  scripts/kconfig/zconf.gperf  |1 
  scripts/kconfig/zconf.hash.c_shipped |   45 -
  10 files changed, 123 insertions(+), 53 deletions(-)
 
 Index: linux-2.6/init/Kconfig
 ===
 --- linux-2.6.orig/init/Kconfig
 +++ linux-2.6/init/Kconfig
 @@ -7,6 +7,10 @@ config DEFCONFIG_LIST
   default /boot/config-$UNAME_RELEASE
   default arch/$ARCH/defconfig
  
 +config ARCH
 + string
 + option env=ARCH
 +
  menu General setup
  
  config EXPERIMENTAL
 Index: linux-2.6/scripts/kconfig/expr.c
 ===
 --- linux-2.6.orig/scripts/kconfig/expr.c
 +++ linux-2.6/scripts/kconfig/expr.c
 @@ -87,7 +87,7 @@ struct expr *expr_copy(struct expr *org)
   break;
   case E_AND:
   case E_OR:
 - case E_CHOICE:
 + case E_LIST:
   e-left.expr = expr_copy(org-left.expr);
   e-right.expr = expr_copy(org-right.expr);
   break;
 @@ -217,7 +217,7 @@ int expr_eq(struct expr *e1, struct expr
   expr_free(e2);
   trans_count = old_count;
   return res;
 - case E_CHOICE:
 + case E_LIST:
   case E_RANGE:
   case E_NONE:
   /* panic */;
 @@ -648,7 +648,7 @@ struct expr *expr_transform(struct expr 
   case E_EQUAL:
   case E_UNEQUAL:
   case E_SYMBOL:
 - case E_CHOICE:
 + case E_LIST:
   break;
   default:
   e-left.expr = expr_transform(e-left.expr);
 @@ -932,7 +932,7 @@ struct expr *expr_trans_compare(struct e
   break;
   case E_SYMBOL:
   return expr_alloc_comp(type, e-left.sym, sym);
 - case E_CHOICE:
 + case E_LIST:
   case E_RANGE:
   case E_NONE:
   /* panic */;
 @@ -1000,9 +1000,9 @@ int expr_compare_type(enum expr_type t1,
   if (t2 == E_OR)
   return 1;
   case E_OR:
 - if (t2 == E_CHOICE)
 + if (t2 == E_LIST)
   return 1;
 - case E_CHOICE:
 + case E_LIST:
   if (t2 == 0)
   return 1;
   default:
 @@ -1053,11 +1053,11 @@ void expr_print(struct expr *e, void (*f
   fn(data, NULL,   );
   expr_print(e-right.expr, fn, data, E_AND);
   break;
 - case E_CHOICE:
 + case E_LIST:
   fn(data, e-right.sym, e-right.sym-name);
   if (e-left.expr) {
   fn(data, NULL,  ^ );
 - expr_print(e-left.expr, fn, data, E_CHOICE);
 + expr_print(e-left.expr, fn, data, E_LIST);
   }
   break;
   case E_RANGE:
 Index: linux-2.6/scripts/kconfig/expr.h
 ===
 --- linux-2.6.orig/scripts/kconfig/expr.h
 +++ linux-2.6/scripts/kconfig/expr.h
 @@ -32,7 +32,7 @@ typedef enum tristate {
  } tristate;
  
  enum expr_type {
 - E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, 
 E_RANGE
 + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, 
 E_RANGE
  };
  
  union expr_data {
 @@ -105,7 +105,8 @@ struct symbol {
  #define SYMBOL_HASHMASK  0xff
  
  enum prop_type {
 - P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, 
 P_RANGE
 + P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE,
 + P_SELECT, P_RANGE, P_ENV
  };
  
  struct property {
 Index: linux-2.6/scripts/kconfig/lkc.h
 ===
 --- linux-2.6.orig/scripts/kconfig/lkc.h
 +++