Move parent from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / Porting / checkcfgvar.pl
index 84e0f05..a757d6b 100644 (file)
@@ -18,6 +18,8 @@ my %MASTER_CFG;
 my @CFG = (
           # This list contains both 5.8.x and 5.9.x files,
           # we check from MANIFEST whether they are expected to be present.
+          # We can't base our check on $], because that's the version of the
+          # perl that we are running, not the version of the source tree.
           "Cross/config.sh-arm-linux",
           "epoc/config.sh",
           "NetWare/config.wc",
@@ -31,8 +33,8 @@ my @CFG = (
           "win32/config.vc",
           "win32/config.vc64",
           "win32/config.ce",
-          "wince/config.ce",
           "configure.com",
+          "Porting/config.sh",
          );
 
 sub read_file {
@@ -50,8 +52,7 @@ sub read_file {
 sub config_h_SH_reader {
     my $cfg = shift;
     return sub {
-       return if 1../^echo \"Extracting \$CONFIG_H/;
-       while (/[^\\]\$(\w+)/g) {
+       while (/[^\\]\$([a-z]\w+)/g) {
            my $v = $1;
            next if $v =~ /^(CONFIG_H|CONFIG_SH)$/;
            $cfg->{$v}++;
@@ -80,15 +81,17 @@ sub check_cfg {
 
 for my $cfg (@CFG) {
     unless (exists $MANIFEST{$cfg}) {
-       print "[skipping not-expected '$cfg']\n";
+       print STDERR "[skipping not-expected '$cfg']\n";
        next;
     }
     my %cfg;
     read_file($cfg,
              sub {
-                 return if /^\#/ || /^\s*$/;
-                 return if $cfg eq 'configure.com' &&
-                           ! /^\$\s+WC "(\w+)='(.*)'"$/;
+                 return if /^\#/ || /^\s*$/ || /^\:/;
+                 if ($cfg eq 'configure.com') {
+                     s/(\s*!.*|\s*)$//; # remove trailing comments or whitespace
+                     return if ! /^\$\s+WC "(\w+)='(.*)'"$/;
+                 }
                  # foo='bar'
                  # foo=bar
                  # $foo='bar' # VOS 5.8.x specialty
@@ -105,5 +108,8 @@ for my $cfg (@CFG) {
                      warn "$cfg:$.:$_";
                  }
              });
+    if ($cfg eq 'configure.com') {
+       $cfg{startperl}++; # Cheat.
+    }
     check_cfg($cfg, \%cfg);
 }