1 # This file fills in a config_h.SH template based on the data
2 # of the file config.def and outputs a config.sh.
4 if (open(CONFIG_DEF, "config.def")) {
6 if (/^([^=]+)='(.+)'$/) {
7 my ($var, $val) = ($1, $2);
10 warn "config.def: $.: illegal line: $_";
14 die "$0: Cannot open config.def: $!";
17 if (open(CONFIG_SH, "config_h.SH_orig")) {
19 last if /^sed <<!GROK!THIS!/;
22 last if /^!GROK!THIS!/;
25 s/\$cf_time/localtime/e;
26 s/\$myuname/$define{OSNAME}/;
27 s/\$seedfunc/$define{seedfunc}/;
28 if (/^#\$\w+\s+(\w+)/) {
29 if (exists $define{$1}) {
30 if ($define{$1} eq 'define') {
31 print "#define $1\t/**/\n";
33 print "#define $1 $define{$1}\n";
36 print "/*#define $1\t/**/\n";
38 } elsif (/^#define\s+(\S+)/) {
39 print "#define $1 $define{$1}\n";
40 } elsif (s/\$cpp_stuff/$define{cpp_stuff}/g) {
47 die "$0: Cannot open config_h.SH_orig: $!";