This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove constant.pm-specific behaviour from Internals::SvREADONLY
[perl5.git] / configpm
index 33137c6..fbc4710 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -280,12 +280,11 @@ sub import {
     return;
 }
 
-die "Perl lib version (%s) doesn't match executable '$0' version ($])"
+die "$0: Perl lib version (%s) doesn't match executable '$^X' version ($])"
     unless $^V;
 
 $^V eq %s
-    or die "Perl lib version (%s) doesn't match executable '$0' version (" .
-       sprintf("v%%vd",$^V) . ")";
+    or die sprintf "%%s: Perl lib version (%s) doesn't match executable '$^X' version (%%vd)", $0, $^V;
 
 ENDOFBEG
 
@@ -384,7 +383,7 @@ $fetch_string .= <<'EOT';
 EOT
 
 } else {
-    # We only have ' delimted.
+    # We only have ' delimited.
 
 $fetch_string .= <<'EOT';
     return undef unless $Config_SH_expanded =~ /\n$key=\'(.*?)\'\n/s;
@@ -1019,7 +1018,7 @@ EOF
   s{([\'\"])([^\'\"\s]+)\1}(C<$2>)g; # "date" command
   s{\'([A-Za-z_\- *=/]+)\'}(C<$1>)g; # 'ln -s'
   s{
-     (?<! [\w./<\'\"] )                # Only standalone file names
+     (?<! [\w./<\'\"\$] )              # Only standalone file names
      (?! e \. g \. )           # Not e.g.
      (?! \. \. \. )            # Not ...
      (?! \d )                  # Not 5.004
@@ -1119,6 +1118,13 @@ sub import {
     # 'configpm; was invoked with --cross option
     $platform = '***replace-marker***';
   }
+  #a Perl debugger can load a bunch of modules before -MCross with PERL5DB env
+  #var, stopping a cross compile Config.pm from being loaded because the native
+  #Config.pm was already use'd
+  if(exists $INC{'Config.pm'}) {
+    warn "Cross.pm found Config.pm is already loaded, reload required, will delete from %INC";
+    delete $INC{'Config.pm'};
+  }
   @INC = map {/\blib\b/?(do{local $_=$_;s/\blib\b/xlib\/$platform/;$_},$_):($_)} @INC;
   $::Cross::platform = $platform;
 }