summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
commit7acb77a6e7bddd4c4c5aa975bbf976927c013798 (patch)
tree4139829ec6edb85f73774bb95cdec376758bfc73 /scripts
parent64d58d4c8cd6a89ee218301ec0dc0ebfec91a4db (diff)
Merge with 2.1.43.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Configure22
-rw-r--r--scripts/header.tk23
-rw-r--r--scripts/mkdep.c1
-rw-r--r--scripts/tkcond.c4
-rw-r--r--scripts/tkgen.c28
-rw-r--r--scripts/tkparse.c10
-rw-r--r--scripts/tkparse.h1
7 files changed, 88 insertions, 1 deletions
diff --git a/scripts/Configure b/scripts/Configure
index c774e32be..79a2ce28a 100644
--- a/scripts/Configure
+++ b/scripts/Configure
@@ -363,6 +363,28 @@ function hex () {
}
#
+# define_string sets the value of a string argument
+#
+# define_string define value
+#
+function define_string () {
+ echo "$1="'"'$2'"' >>$CONFIG
+ echo "#define $1 "'"'$2'"' >>$CONFIG_H
+ eval "$1=$2"
+}
+
+#
+# string processes a string argument
+#
+# string question define default
+#
+function string () {
+ old=$(eval echo "\${$2}")
+ def=${old:-$3}
+ readln "$1 ($2) [$def] " "$def" "$old"
+ define_string "$2" "$ans"
+}
+#
# choice processes a choice list (1-out-of-n)
#
# choice question choice-list default
diff --git a/scripts/header.tk b/scripts/header.tk
index 763eca6db..54637138a 100644
--- a/scripts/header.tk
+++ b/scripts/header.tk
@@ -209,6 +209,10 @@ proc read_config { filename } {
set cmd "global $var; set $var $value"
eval $cmd
}
+ if [regexp {([0-9A-Za-z_]+)="([0-9A-Za-z]+)"} $line foo var value] {
+ set cmd "global $var; set $var $value"
+ eval $cmd
+ }
}
close $file1
update_choices
@@ -260,6 +264,16 @@ proc write_hex { file1 file2 varname variable dep } {
}
}
+proc write_string { file1 file2 varname variable dep } {
+ if { $dep == 0 } \
+ then { puts $file1 "# $varname is not set"; \
+ puts $file2 "#undef $varname"} \
+ else {
+ puts $file1 "$varname=\"$variable\""; \
+ puts $file2 "#define $varname \"$variable\""; \
+ }
+}
+
proc option_name {w mnum line text helpidx} {
button $w.x$line.l -text "$text" -relief groove -anchor w
$w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
@@ -312,6 +326,15 @@ proc hex { w mnum line text variable } {
int $w $mnum $line $text $variable
}
+proc istring { w mnum line text variable } {
+ frame $w.x$line
+ entry $w.x$line.x -width 18 -relief sunken -borderwidth 2 \
+ -textvariable $variable
+ option_name $w $mnum $line $text $variable
+ pack $w.x$line.x -anchor w -side right -fill y
+ pack $w.x$line -anchor w -fill both -expand on
+}
+
proc minimenu { w mnum line text variable helpidx } {
frame $w.x$line
menubutton $w.x$line.x -textvariable $variable -menu \
diff --git a/scripts/mkdep.c b/scripts/mkdep.c
index 4afbd7381..2ac2e514c 100644
--- a/scripts/mkdep.c
+++ b/scripts/mkdep.c
@@ -6,7 +6,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <errno.h>
#include <sys/fcntl.h>
#include <sys/mman.h>
diff --git a/scripts/tkcond.c b/scripts/tkcond.c
index 9cc10fa4f..41b370f43 100644
--- a/scripts/tkcond.c
+++ b/scripts/tkcond.c
@@ -195,6 +195,7 @@ struct condition * get_token_cond(struct condition ** cond, int depth)
if( cfg->tok != tok_bool
&& cfg->tok != tok_int
&& cfg->tok != tok_hex
+ && cfg->tok != tok_string
&& cfg->tok != tok_tristate
&& cfg->tok != tok_choice
&& cfg->tok != tok_dep_tristate)
@@ -358,6 +359,7 @@ void fix_conditionals(struct kconfig * scfg)
case tok_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
case tok_choice:
case tok_make:
/*
@@ -402,6 +404,7 @@ void fix_conditionals(struct kconfig * scfg)
case tok_dep_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
for(cfg1=cfg;cfg1 != NULL; cfg1 = cfg1->next)
{
switch(cfg1->tok)
@@ -412,6 +415,7 @@ void fix_conditionals(struct kconfig * scfg)
case tok_dep_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
if( strcmp(cfg->optionname, cfg1->optionname) == 0)
{
cfg->flags |= CFG_DUP;
diff --git a/scripts/tkgen.c b/scripts/tkgen.c
index a3aea9055..15f8f7bfd 100644
--- a/scripts/tkgen.c
+++ b/scripts/tkgen.c
@@ -289,6 +289,7 @@ void generate_if(struct kconfig * item,
break;
case tok_int:
case tok_hex:
+ case tok_string:
printf("} then { ");
printf(".menu%d.config.f.x%d.x configure -state normal -fore [ cget .ref -foreground ]; ", menu_num, line_num);
printf(".menu%d.config.f.x%d.l configure -state normal; ", menu_num, line_num);
@@ -487,6 +488,10 @@ void generate_if_for_outfile(struct kconfig * item,
printf("} then { write_hex $cfg $autocfg %s $%s $notmod }\n",
item->optionname, item->optionname);
break;
+ case tok_string:
+ printf("} then { write_string $cfg $autocfg %s $%s $notmod }\n",
+ item->optionname, item->optionname);
+ break;
case tok_make:
printf("} then { do_make {%s} }\n",item->value);
break;
@@ -646,6 +651,7 @@ static void find_menu_size(struct kconfig *cfg,
case tok_dep_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
case tok_choose:
tot++;
break;
@@ -702,6 +708,7 @@ void dump_tk_script(struct kconfig *scfg)
case tok_dep_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
case tok_choose:
/*
* If we have overfilled the menu, then go to the next one.
@@ -862,6 +869,19 @@ void dump_tk_script(struct kconfig *scfg)
cfg->label,
cfg->optionname);
break;
+ case tok_string:
+ if( cfg->menu_number != menu_num )
+ {
+ end_proc(menu_num);
+ start_proc(menulabel, cfg->menu_number, FALSE);
+ menu_num = cfg->menu_number;
+ }
+ printf("\tistring $w.config.f %d %d \"%s\" %s\n",
+ cfg->menu_number,
+ cfg->menu_line,
+ cfg->label,
+ cfg->optionname);
+ break;
default:
break;
}
@@ -951,6 +971,7 @@ void dump_tk_script(struct kconfig *scfg)
break;
case tok_int:
case tok_hex:
+ case tok_string:
printf("set %s %s\n", cfg->optionname, cfg->value);
break;
case tok_choose:
@@ -985,6 +1006,7 @@ void dump_tk_script(struct kconfig *scfg)
{
case tok_int:
case tok_hex:
+ case tok_string:
case tok_bool:
case tok_tristate:
case tok_dep_tristate:
@@ -1050,6 +1072,12 @@ void dump_tk_script(struct kconfig *scfg)
cfg->optionname,
cfg->optionname);
}
+ else if (cfg->tok == tok_string )
+ {
+ printf("\twrite_string $cfg $autocfg %s $%s $notmod\n",
+ cfg->optionname,
+ cfg->optionname);
+ }
else if (cfg->tok == tok_make )
{
printf("\tdo_make {%s}\n",cfg->value);
diff --git a/scripts/tkparse.c b/scripts/tkparse.c
index 2a000217c..98d1393ca 100644
--- a/scripts/tkparse.c
+++ b/scripts/tkparse.c
@@ -370,6 +370,11 @@ void parse(char * pnt) {
tok = tok_hex;
pnt += 3;
}
+ else if (strncmp(pnt, "string", 6) == 0)
+ {
+ tok = tok_string;
+ pnt += 6;
+ }
else if (strncmp(pnt, "if", 2) == 0)
{
tok = tok_if;
@@ -457,6 +462,7 @@ void parse(char * pnt) {
break;
case tok_int:
case tok_hex:
+ case tok_string:
pnt = get_qstring(pnt, &kcfg->label);
pnt = get_string(pnt, &kcfg->optionname);
pnt = get_string(pnt, &kcfg->value);
@@ -702,6 +708,9 @@ int main(int argc, char * argv[])
case tok_hex:
printf("hex ");
break;
+ case tok_string:
+ printf("istring ");
+ break;
case tok_comment:
printf("comment ");
break;
@@ -732,6 +741,7 @@ int main(int argc, char * argv[])
case tok_dep_tristate:
case tok_int:
case tok_hex:
+ case tok_string:
printf("%s %s\n", cfg->label, cfg->optionname);
break;
case tok_if:
diff --git a/scripts/tkparse.h b/scripts/tkparse.h
index 911abdfbe..af7beac93 100644
--- a/scripts/tkparse.h
+++ b/scripts/tkparse.h
@@ -12,6 +12,7 @@ enum token {
tok_fi,
tok_int,
tok_hex,
+ tok_string,
tok_make,
tok_define,
tok_choose,