This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In makedef.pl, merge the code that reads config.sh
authorNicholas Clark <nick@ccl4.org>
Wed, 27 Jul 2011 21:21:14 +0000 (23:21 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 1 Aug 2011 09:53:56 +0000 (11:53 +0200)
For now, retain compatibility (bug compatibility?) by not processing ccflags
and optimize on Win32, WinCE and NetWare.

makedef.pl

index f84c009..e83eabc 100644 (file)
@@ -96,27 +96,23 @@ my $perlvars_h  = "perlvars.h";
 my $global_sym  = "global.sym";
 my $globvar_sym = "globvar.sym";
 my $perlio_sym  = "perlio.sym";
-my $static_ext = "";
 
 s/^/$TARG_DIR/ foreach($intrpvar_h, $perlvars_h, $global_sym, $globvar_sym,
                       $perlio_sym, $config_sh);
 
-unless ($PLATFORM eq 'win32' || $PLATFORM eq 'wince' || $PLATFORM eq 'netware') {
+{
     open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n";
     while (<CFG>) {
-       if (/^(?:ccflags|optimize)='(.+)'$/) {
+       if (/^(?:ccflags|optimize)='(.+)'$/
+           # Are the following strictly necessary? Added during refactoring
+           # to keep the same behaviour when merging other code into here.
+           && $PLATFORM ne 'win32' && $PLATFORM ne 'wince'
+           && $PLATFORM ne 'netware')  {
            $_ = $1;
            $define{$1} = 1 while /-D(\w+)/g;
        }
        $define{$1} = $2
-           if /^(config_args|archname|perl_patchlevel)='(.+)'$/;
-    }
-    close(CFG);
-}
-if ($PLATFORM eq 'win32' || $PLATFORM eq 'wince') {
-    open(CFG, '<', $config_sh) || die "Cannot open $config_sh: $!\n";
-    if ((join '', <CFG>) =~ /^static_ext='(.*)'$/m) {
-        $static_ext = $1;
+           if /^(config_args|archname|perl_patchlevel|static_ext)='(.+)'$/;
     }
     close(CFG);
 }
@@ -1266,6 +1262,7 @@ elsif ($PLATFORM eq 'netware') {
 # The VMS build scripts don't yet implement static extensions at all.
 
 if ($PLATFORM =~ /^win(?:32|ce)$/) {
+    my $static_ext = $define{static_ext} // "";
     # records of type boot_module for statically linked modules (except Dynaloader)
     $static_ext =~ s/\//__/g;
     $static_ext =~ s/\bDynaLoader\b//;