This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
d_Gconvert hints and Glossary
[perl5.git] / configpm
index 6b5252c..d8339fa 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -60,7 +60,7 @@ $in_v = 0;
 
 while (<>) {
     next if m:^#!/bin/sh:;
-    # Catch CONFIGDOTSH=true and PERL_VERSION=n line from Configure.
+    # Catch PERL_CONFIG_SH=true and PERL_VERSION=n line from Configure.
     s/^(\w+)=(true|\d+)\s*$/$1='$2'\n/;
     my ($k,$v) = ($1,$2);
     # grandfather PATCHLEVEL and SUBVERSION and CONFIG
@@ -71,7 +71,7 @@ while (<>) {
        elsif ($k eq 'PERL_SUBVERSION') {
            push @v_others, "SUBVERSION='$v'\n";
        }
-       elsif ($k eq 'CONFIGDOTSH') {
+       elsif ($k eq 'PERL_CONFIG_SH') {
            push @v_others, "CONFIG='$v'\n";
        }
     }
@@ -249,7 +249,7 @@ sub config_sh {
 
 sub config_re {
     my $re = shift;
-    my @matches = ($config_sh =~ /^$re=.*\n/mg);
+    my @matches = grep /^$re=/, split /^/, $config_sh;
     @matches ? (print @matches) : print "$re: not found\n";
 }
 
@@ -274,8 +274,20 @@ if ($OS2::is_aout) {
         $preconfig{$_} = $v eq 'undef' ? undef : $v;
     }
 }
+$preconfig{d_fork} = undef unless $OS2::can_fork; # Some funny cases can't
 sub TIEHASH { bless {%preconfig} }
 ENDOFSET
+  # Extract the name of the DLL from the makefile to avoid duplication
+  my ($f) = grep -r, qw(GNUMakefile Makefile);
+  my $dll;
+  if (open my $fh, '<', $f) {
+    while (<$fh>) {
+      $dll = $1, last if /^PERL_DLL_BASE\s*=\s*(\S*)\s*$/;
+    }
+  }
+  print CONFIG <<ENDOFSET if $dll;
+\$preconfig{dll_name} = '$dll';
+ENDOFSET
 } else {
   print CONFIG <<'ENDOFSET';
 sub TIEHASH { bless {} }
@@ -408,20 +420,25 @@ $text = 0;
 $/ = '';
 
 sub process {
-  s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m;
-  my $c = substr $1, 0, 1;
-  unless ($seen{$c}++) {
-    print CONFIG <<EOF if $text;
+  if (s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m) {
+    my $c = substr $1, 0, 1;
+    unless ($seen{$c}++) {
+      print CONFIG <<EOF if $text;
 =back
 
 EOF
-    print CONFIG <<EOF;
+      print CONFIG <<EOF;
 =head2 $c
 
 =over 4
 
 EOF
-    $text = 1;
+     $text = 1;
+    }
+  }
+  elsif (!$text || !/\A\t/) {
+    warn "Expected a Configure variable header",
+      ($text ? " or another paragraph of description" : () );
   }
   s/n't/n\00t/g;               # leave can't, won't etc untouched
   s/^\t\s+(.*)/\n\t$1\n/gm;    # Indented lines ===> paragraphs
@@ -474,11 +491,11 @@ require $config_pm;
 import Config;
 
 die "$0: $config_pm not valid"
-       unless $Config{'CONFIGDOTSH'} eq 'true';
+       unless $Config{'PERL_CONFIG_SH'} eq 'true';
 
 die "$0: error processing $config_pm"
        if defined($Config{'an impossible name'})
-       or $Config{'CONFIGDOTSH'} ne 'true' # test cache
+       or $Config{'PERL_CONFIG_SH'} ne 'true' # test cache
        ;
 
 die "$0: error processing $config_pm"