3 # Check that the various config.sh-clones have (at least) all the
4 # same symbols as the top-level config_h.SH so that the (potentially)
5 # needed symbols are not lagging after how Configure thinks the world
8 # VMS is probably not handled properly here, due to their own
9 # rather elaborate DCL scripting.
17 my $err = shift and select STDERR;
18 print "usage: $0 [--list]\n";
25 "help|?" => sub { usage (0); },
29 my $MASTER_CFG = "config_h.SH";
34 # This list contains both 5.8.x and 5.9.x files,
35 # we check from MANIFEST whether they are expected to be present.
36 # We can't base our check on $], because that's the version of the
37 # perl that we are running, not the version of the source tree.
38 "Cross/config.sh-arm-linux",
44 "plan9/config_sh.sample",
45 "vos/config.alpha.def",
50 "win32/config.gc64nox",
60 if (open(my $fh, $fn)) {
66 die "$0: Failed to open '$fn' for reading: $!\n";
70 sub config_h_SH_reader {
73 while (/[^\\]\$([a-z]\w+)/g) {
75 next if $v =~ /^(CONFIG_H|CONFIG_SH)$/;
81 read_file($MASTER_CFG,
82 config_h_SH_reader(\%MASTER_CFG));
88 $MANIFEST{$1}++ if /^(.+?)\t/;
91 my @MASTER_CFG = sort keys %MASTER_CFG;
95 for my $v (@MASTER_CFG) {
96 exists $cfg->{$v} and next;
101 print "$fn: missing '$v'\n";
107 unless (exists $MANIFEST{$cfg}) {
108 print STDERR "[skipping not-expected '$cfg']\n";
114 return if /^\#/ || /^\s*$/ || /^\:/;
115 if ($cfg eq 'configure.com') {
116 s/(\s*!.*|\s*)$//; # remove trailing comments or whitespace
117 return if ! /^\$\s+WC "(\w+)='(.*)'"$/;
121 # $foo='bar' # VOS 5.8.x specialty
122 # $foo=bar # VOS 5.8.x specialty
123 if (/^\$?(\w+)='(.*)'$/) {
126 elsif (/^\$?(\w+)=(.*)$/) {
129 elsif (/^\$\s+WC "(\w+)='(.*)'"$/) {
135 if ($cfg eq 'configure.com') {
136 $cfg{startperl}++; # Cheat.
138 check_cfg($cfg, \%cfg);
141 $opt_l and print "$_\n" for sort keys %lst;