On Sat, 19 Jan 2002 12:39:16 -0700, Tom Rini <[EMAIL PROTECTED]> wrote: >Hey all. I've just run into a situation where xconfig won't run because >there's > 2048 variables for it to deal with. If I'm reading the source >right, I should just be able to bump VARTABLE_SIZE in scripts/tkparse.c >and everything should just work (and from my quick testing, it does). >But I figured I'd check with more knowledgeable people, so is this >right? Thanks.
No good reason to make vartable a fixed size. This makes it dynamic and removes the limit problem. Added to my kbuild-2.5 tree, along with Bernd Petrovitsch's patch for mouse wheel. Index: 16.60/scripts/tkparse.c --- 16.60/scripts/tkparse.c Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/29_tkparse.c 1.1 644) +++ 16.60(w)/scripts/tkparse.c Sun, 20 Jan 2002 10:16:05 +1100 kaos +(linux-2.4/29_tkparse.c 1.1 644) @@ -77,9 +77,9 @@ static void syntax_error( const char * m * Find index of a specyfic variable in the symbol table. * Create a new entry if it does not exist yet. */ -#define VARTABLE_SIZE 2048 -struct variable vartable[VARTABLE_SIZE]; +struct variable *vartable; int max_varnum = 0; +static int vartable_size = 0; int get_varnum( char * name ) { @@ -88,8 +88,13 @@ int get_varnum( char * name ) for ( i = 1; i <= max_varnum; i++ ) if ( strcmp( vartable[i].name, name ) == 0 ) return i; - if (max_varnum > VARTABLE_SIZE-1) - syntax_error( "Too many variables defined." ); + while (max_varnum+1 > vartable_size) { + vartable = realloc(vartable, (vartable_size += 1000)*sizeof(*vartable)); + if (!vartable) { + fprintf(stderr, "tkparse realloc vartable failed\n"); + exit(1); + } + } vartable[++max_varnum].name = malloc( strlen( name )+1 ); strcpy( vartable[max_varnum].name, name ); return max_varnum; @@ -818,5 +823,6 @@ int main( int argc, const char * argv [] do_source ( "-" ); fix_conditionals ( config_list ); dump_tk_script ( config_list ); + free(vartable); return 0; } Index: 16.60/scripts/tkparse.h --- 16.60/scripts/tkparse.h Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/31_tkparse.h 1.1 644) +++ 16.60(w)/scripts/tkparse.h Sun, 20 Jan 2002 10:15:03 +1100 kaos +(linux-2.4/31_tkparse.h 1.1 644) @@ -115,7 +115,7 @@ struct variable char global_written; }; -extern struct variable vartable[]; +extern struct variable *vartable; extern int max_varnum; /* _______________________________________________ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel