Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | #!/usr/local/bin/perl -w |
2 | use File::Basename; | |
3 | ||
4 | # WARNING: This is site-specific. Change to the location | |
5 | # where you have installed dist-3.0PL70. | |
6 | @std_units = glob('/u/vieraat/vieraat/jhi/Perl/lib/dist/U/*.U'); | |
7 | $PWD = '/u/vieraat/vieraat/jhi/pp4/cfgperl'; | |
8 | ||
9 | chdir U if -d './U'; | |
10 | @perl_units = glob("$PWD/U/*/*.U"); | |
11 | push(@perl_units, @std_units); | |
12 | ||
13 | # Get the list of config.sh symbols. Be sure this is up to date! | |
14 | # (I run the U/mksample script first to be sure.) | |
15 | open(WANTED, "sort $PWD/Porting/config.sh|") || die "$0: open $PWD/Wanted: $!\n"; | |
16 | ||
17 | print <<'EOM'; | |
18 | This file contains a description of all the shell variables whose value is | |
19 | determined by the Configure script. Variables intended for use in C | |
20 | programs (e.g. I_UNISTD) are already described in config_h.SH. [`configpm' | |
21 | generates pod documentation for Config.pm from this file--please try to keep | |
22 | the formatting regular.] | |
23 | ||
24 | EOM | |
25 | ||
26 | foreach $file (@perl_units) { | |
27 | open(FH, "<$file") || die "$0: open $file: $!"; | |
28 | my $base = basename($file); | |
29 | $Loc = $file, next if $base eq 'Loc.U' and not defined $Loc; | |
30 | while (<FH>) { | |
31 | if (/^\?S:\w+[ \t:]/ .. /^\?S:.$/) { | |
32 | if (/^\?S:.$/) { | |
33 | ($var) = ((shift @var) =~ /^(\w+)/); | |
34 | unless (exists $expl{$var}) { | |
35 | $expl{$var} = [ @var, "\n" ]; | |
36 | $file{$var} = $base; | |
37 | } | |
38 | @var = (); | |
39 | } else { | |
40 | s/^\?S://; # Remove leading ?S: markers. | |
41 | s/^\s+/\t/; # Ensure all lines begin with tabs. | |
42 | push @var, $_; | |
43 | } | |
44 | } | |
45 | } | |
46 | close(FH) || die "$0: close $file: $!"; | |
47 | } | |
48 | ||
49 | die "$0: Couldn't locate Loc.U: $!" unless defined $Loc; | |
50 | ||
51 | open(FH, "<$Loc") || die "$0: open $Loc: $!"; | |
52 | while (<FH>) { | |
53 | if (/^\?(\w+):\1$/) { | |
54 | $var = $1; | |
55 | $expl{$var} = 1; | |
56 | $file{$var} = 'Loc.U'; | |
57 | } | |
58 | } | |
59 | close(FH) || die "$0: close $Loc: $!"; | |
60 | ||
61 | symbol: while (defined($var = <WANTED>)) { | |
62 | chomp $var; | |
63 | next symbol if $var =~ /^#/; # Skip comments | |
64 | next symbol if $var =~ /^$/; | |
65 | ($var, $val) = split(/=/, $var, 2); | |
66 | $gotit = 0; | |
67 | ||
68 | if (exists $expl{$var}) { | |
69 | if ($file{$var} eq 'Loc.U') { | |
70 | print "$var (Loc.U):\n"; | |
71 | if ($val eq "''") { | |
72 | # If we didn't have d_portable, this info might be | |
73 | # useful, but it still won't help with non-standard | |
74 | # stuff if perl is built on one system but installed | |
75 | # on others (this is common with Linux distributions, | |
76 | # for example). | |
77 | print <<EOE; | |
78 | This variable is defined but not used by Configure. | |
79 | The value is a plain '' and is not useful. | |
80 | ||
81 | EOE | |
82 | } else { | |
83 | print <<EOE; | |
84 | This variable is be used internally by Configure to determine the | |
85 | full pathname (if any) of the $var program. After Configure runs, | |
86 | the value is reset to a plain "$var" and is not useful. | |
87 | ||
88 | EOE | |
89 | } | |
90 | } else { | |
91 | print "$var ($file{$var}):\n"; | |
92 | print @{ $expl{$var} }; | |
93 | next symbol; | |
94 | } | |
95 | $gotit = 1; | |
96 | } | |
97 | warn "$0: couldn't find $var\n" | |
98 | if not $gotit and $var !~ /^(Author|Date|Header|Id|Locker|Log|Mcc|RCSfile|Revision|Source|State)$|_cflags$|^config_arg|^PERL_(REVISION|VERSION|SUBVERSION)$/; | |
99 | } |