8686120
perl-update-ExtUtils-CBuilder-0.24
8686120
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Base.pm perl-5.10.0/lib/ExtUtils/CBuilder/Base.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Base.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Base.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -6,9 +6,10 @@
8686120
 use Cwd ();
8686120
 use Config;
8686120
 use Text::ParseWords;
8686120
+use IO::File;
8686120
 
8686120
 use vars qw($VERSION);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 
8686120
 sub new {
8686120
   my $class = shift;
8686120
@@ -118,10 +119,8 @@
8686120
   
8686120
   my $tmpfile = File::Spec->catfile(File::Spec->tmpdir, 'compilet.c');
8686120
   {
8686120
-    local *FH;
8686120
-    open FH, "> $tmpfile" or die "Can't create $tmpfile: $!";
8686120
-    print FH "int boot_compilet() { return 1; }\n";
8686120
-    close FH;
8686120
+    my $FH = IO::File->new("> $tmpfile") or die "Can't create $tmpfile: $!";
8686120
+    print $FH "int boot_compilet() { return 1; }\n";
8686120
   }
8686120
 
8686120
   my ($obj_file, @lib_files);
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Changes perl-5.10.0/lib/ExtUtils/CBuilder/Changes
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Changes	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Changes	2009-03-11 20:13:30.000000000 +0100
8686120
@@ -1,5 +1,31 @@
8686120
 Revision history for Perl extension ExtUtils::CBuilder.
8686120
 
8686120
+ - Added 'gnu' and 'gnukfreebsd' as Unix variants. [Niko Tyni]
8686120
+
8686120
+ - Brought in some VMS fixes from bleadperl: "Correct and complete
8686120
+   CBuilder's handling of external libraries when linking on VMS."
8686120
+   [Craig Berry]
8686120
+
8686120
+0.23 - Sat Apr 19 22:28:03 2008
8686120
+
8686120
+ - Fixed some problems (some old, some new) with Strawberry Perl on
8686120
+   Windows. [Alberto Simo~es]
8686120
+
8686120
+ - Will now install in the core perl lib directory when the user's
8686120
+   perl is new enough to have us in core. [Yi Ma Mao]
8686120
+
8686120
+0.22 - Fri Feb  8 21:52:21 2008
8686120
+
8686120
+ - Replaced the split_like_shell() method on Windows with a
8686120
+   near-no-op, which is probably more correct and has the benefit of
8686120
+   not messing up UNC paths. [John R. LoVerso, see
8686120
+   http://rt.cpan.org/Ticket/Display.html?id=26545]
8686120
+
8686120
+ - Fixed extra_compiler_flags on Windows, they were being
8686120
+   ignored. [Robert May]
8686120
+
8686120
+0.21 - Tue Oct 30 06:46:01 2007
8686120
+
8686120
  - Clean up perl_src path using Cwd::realpath().  Only affects usage
8686120
    as part of the perl core.
8686120
 
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/Unix.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/Unix.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/Unix.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/Unix.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -4,7 +4,7 @@
8686120
 use ExtUtils::CBuilder::Base;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Base);
8686120
 
8686120
 sub link_executable {
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/VMS.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/VMS.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/VMS.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/VMS.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -4,7 +4,7 @@
8686120
 use ExtUtils::CBuilder::Base;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.22';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Base);
8686120
 
8686120
 use File::Spec::Functions qw(catfile catdir);
8686120
@@ -134,7 +134,7 @@
8686120
   # In general, we pass through the basic libraries from %Config unchanged.
8686120
   # The one exception is that if we're building in the Perl source tree, and
8686120
   # a library spec could be resolved via a logical name, we go to some trouble
8686120
-  # to insure that the copy in the local tree is used, rather than one to
8686120
+  # to ensure that the copy in the local tree is used, rather than one to
8686120
   # which a system-wide logical may point.
8686120
   if ($self->perl_src) {
8686120
     my($lib,$locspec,$type);
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/Windows.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/Windows.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/Windows.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/Windows.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -7,9 +7,10 @@
8686120
 use File::Spec;
8686120
 
8686120
 use ExtUtils::CBuilder::Base;
8686120
+use IO::File;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Base);
8686120
 
8686120
 sub new {
8686120
@@ -33,61 +34,24 @@
8686120
 }
8686120
 
8686120
 sub split_like_shell {
8686120
-  # As it turns out, Windows command-parsing is very different from
8686120
-  # Unix command-parsing.  Double-quotes mean different things,
8686120
-  # backslashes don't necessarily mean escapes, and so on.  So we
8686120
-  # can't use Text::ParseWords::shellwords() to break a command string
8686120
-  # into words.  The algorithm below was bashed out by Randy and Ken
8686120
-  # (mostly Randy), and there are a lot of regression tests, so we
8686120
-  # should feel free to adjust if desired.
8686120
-  
8686120
+  # Since Windows will pass the whole command string (not an argument
8686120
+  # array) to the target program and make the program parse it itself,
8686120
+  # we don't actually need to do any processing here.
8686120
   (my $self, local $_) = @_;
8686120
   
8686120
   return @$_ if defined() && UNIVERSAL::isa($_, 'ARRAY');
8686120
-  
8686120
-  my @argv;
8686120
-  return @argv unless defined() && length();
8686120
-  
8686120
-  my $arg = '';
8686120
-  my( $i, $quote_mode ) = ( 0, 0 );
8686120
-  
8686120
-  while ( $i < length() ) {
8686120
-    
8686120
-    my $ch      = substr( $_, $i  , 1 );
8686120
-    my $next_ch = substr( $_, $i+1, 1 );
8686120
-    
8686120
-    if ( $ch eq '\\' && $next_ch eq '"' ) {
8686120
-      $arg .= '"';
8686120
-      $i++;
8686120
-    } elsif ( $ch eq '\\' && $next_ch eq '\\' ) {
8686120
-      $arg .= '\\';
8686120
-      $i++;
8686120
-    } elsif ( $ch eq '"' && $next_ch eq '"' && $quote_mode ) {
8686120
-      $quote_mode = !$quote_mode;
8686120
-      $arg .= '"';
8686120
-      $i++;
8686120
-    } elsif ( $ch eq '"' && $next_ch eq '"' && !$quote_mode &&
8686120
-	      ( $i + 2 == length()  ||
8686120
-		substr( $_, $i + 2, 1 ) eq ' ' )
8686120
-	    ) { # for cases like: a"" => [ 'a' ]
8686120
-      push( @argv, $arg );
8686120
-      $arg = '';
8686120
-      $i += 2;
8686120
-    } elsif ( $ch eq '"' ) {
8686120
-      $quote_mode = !$quote_mode;
8686120
-    } elsif ( $ch eq ' ' && !$quote_mode ) {
8686120
-      push( @argv, $arg ) if $arg;
8686120
-      $arg = '';
8686120
-      ++$i while substr( $_, $i + 1, 1 ) eq ' ';
8686120
-    } else {
8686120
-      $arg .= $ch;
8686120
-    }
8686120
-    
8686120
-    $i++;
8686120
-  }
8686120
-  
8686120
-  push( @argv, $arg ) if defined( $arg ) && length( $arg );
8686120
-  return @argv;
8686120
+  return unless defined() && length();
8686120
+  return ($_);
8686120
+}
8686120
+
8686120
+sub do_system {
8686120
+  # See above
8686120
+  my $self = shift;
8686120
+  my $cmd = join(" ",
8686120
+		 grep length,
8686120
+		 map {$a=$_;$a=~s/\t/ /g;$a=~s/^\s+|\s+$//;$a}
8686120
+		 grep defined, @_);
8686120
+  return $self->SUPER::do_system($cmd);
8686120
 }
8686120
 
8686120
 sub arg_defines {
8686120
@@ -119,7 +83,7 @@
8686120
     cflags      => [
8686120
                      $self->split_like_shell($cf->{ccflags}),
8686120
                      $self->split_like_shell($cf->{cccdlflags}),
8686120
-                     $self->split_like_shell($cf->{extra_compiler_flags}),
8686120
+                     $self->split_like_shell($args{extra_compiler_flags}),
8686120
                    ],
8686120
     optimize    => [ $self->split_like_shell($cf->{optimize})    ],
8686120
     defines     => \@defines,
8686120
@@ -329,18 +293,16 @@
8686120
   $self->add_to_cleanup($script);
8686120
   print "Generating script '$script'\n" if !$self->{quiet};
8686120
 
8686120
-  open( SCRIPT, ">$script" )
8686120
+  my $SCRIPT = IO::File->new( ">$script" )
8686120
     or die( "Could not create script '$script': $!" );
8686120
 
8686120
-  print SCRIPT join( "\n",
8686120
+  print $SCRIPT join( "\n",
8686120
     map { ref $_ ? @{$_} : $_ }
8686120
     grep defined,
8686120
     delete(
8686120
       @spec{ qw(includes cflags optimize defines perlinc) } )
8686120
   );
8686120
 
8686120
-  close SCRIPT;
8686120
-
8686120
   push @{$spec{includes}}, '@"' . $script . '"';
8686120
 
8686120
   return %spec;
8686120
@@ -402,10 +364,10 @@
8686120
 
8686120
   print "Generating script '$script'\n" if !$self->{quiet};
8686120
 
8686120
-  open( SCRIPT, ">$script" )
8686120
+  my $SCRIPT = IO::File->new( ">$script" )
8686120
     or die( "Could not create script '$script': $!" );
8686120
 
8686120
-  print SCRIPT join( "\n",
8686120
+  print $SCRIPT join( "\n",
8686120
     map { ref $_ ? @{$_} : $_ }
8686120
     grep defined,
8686120
     delete(
8686120
@@ -414,8 +376,6 @@
8686120
                 def_file implib map_file)            } )
8686120
   );
8686120
 
8686120
-  close SCRIPT;
8686120
-
8686120
   push @{$spec{lddlflags}}, '@"' . $script . '"';
8686120
 
8686120
   return %spec;
8686120
@@ -459,7 +419,7 @@
8686120
 
8686120
   print "Generating script '$script'\n" if !$self->{quiet};
8686120
 
8686120
-  open( SCRIPT, ">$script" )
8686120
+  my $SCRIPT = IO::File->new( ">$script" )
8686120
     or die( "Could not create script '$script': $!" );
8686120
 
8686120
   # XXX Borland "response files" seem to be unable to accept macro
8686120
@@ -467,15 +427,13 @@
8686120
   # backslash doesn't work, and any level of quotes are stripped. The
8686120
   # result is is a floating point number in the source file where a
8686120
   # string is expected. So we leave the macros on the command line.
8686120
-  print SCRIPT join( "\n",
8686120
+  print $SCRIPT join( "\n",
8686120
     map { ref $_ ? @{$_} : $_ }
8686120
     grep defined,
8686120
     delete(
8686120
       @spec{ qw(includes cflags optimize perlinc) } )
8686120
   );
8686120
 
8686120
-  close SCRIPT;
8686120
-
8686120
   push @{$spec{includes}}, '@"' . $script . '"';
8686120
 
8686120
   return %spec;
8686120
@@ -525,29 +483,25 @@
8686120
   print "Generating scripts '$ld_script' and '$ld_libs'.\n" if !$self->{quiet};
8686120
 
8686120
   # Script 1: contains options & names of object files.
8686120
-  open( LD_SCRIPT, ">$ld_script" )
8686120
+  my $LD_SCRIPT = IO::File->new( ">$ld_script" )
8686120
     or die( "Could not create linker script '$ld_script': $!" );
8686120
 
8686120
-  print LD_SCRIPT join( " +\n",
8686120
+  print $LD_SCRIPT join( " +\n",
8686120
     map { @{$_} }
8686120
     grep defined,
8686120
     delete(
8686120
       @spec{ qw(lddlflags libpath other_ldflags startup objects) } )
8686120
   );
8686120
 
8686120
-  close LD_SCRIPT;
8686120
-
8686120
   # Script 2: contains name of libs to link against.
8686120
-  open( LD_LIBS, ">$ld_libs" )
8686120
+  my $LD_LIBS = IO::File->new( ">$ld_libs" )
8686120
     or die( "Could not create linker script '$ld_libs': $!" );
8686120
 
8686120
-  print LD_LIBS join( " +\n",
8686120
+  print $LD_LIBS join( " +\n",
8686120
      (delete $spec{libperl}  || ''),
8686120
     @{delete $spec{perllibs} || []},
8686120
   );
8686120
 
8686120
-  close LD_LIBS;
8686120
-
8686120
   push @{$spec{lddlflags}}, '@"' . $ld_script  . '"';
8686120
   push @{$spec{perllibs}},  '@"' . $ld_libs    . '"';
8686120
 
8686120
@@ -669,32 +623,30 @@
8686120
 
8686120
   print "Generating script '$script'\n" if !$self->{quiet};
8686120
 
8686120
-  open( SCRIPT, ">$script" )
8686120
+  my $SCRIPT = IO::File->new( ">$script" )
8686120
     or die( "Could not create script '$script': $!" );
8686120
 
8686120
-  print( SCRIPT 'SEARCH_DIR(' . $_ . ")\n" )
8686120
+  print $SCRIPT ( 'SEARCH_DIR(' . $_ . ")\n" )
8686120
     for @{delete $spec{libpath} || []};
8686120
 
8686120
   # gcc takes only one startup file, so the first object in startup is
8686120
   # specified as the startup file and any others are shifted into the
8686120
   # beginning of the list of objects.
8686120
   if ( $spec{startup} && @{$spec{startup}} ) {
8686120
-    print SCRIPT 'STARTUP(' . shift( @{$spec{startup}} ) . ")\n";
8686120
+    print $SCRIPT 'STARTUP(' . shift( @{$spec{startup}} ) . ")\n";
8686120
     unshift @{$spec{objects}},
8686120
       @{delete $spec{startup} || []};
8686120
   }
8686120
 
8686120
-  print SCRIPT 'INPUT(' . join( ',',
8686120
+  print $SCRIPT 'INPUT(' . join( ',',
8686120
     @{delete $spec{objects}  || []}
8686120
   ) . ")\n";
8686120
 
8686120
-  print SCRIPT 'INPUT(' . join( ' ',
8686120
+  print $SCRIPT 'INPUT(' . join( ' ',
8686120
      (delete $spec{libperl}  || ''),
8686120
     @{delete $spec{perllibs} || []},
8686120
   ) . ")\n";
8686120
 
8686120
-  close SCRIPT;
8686120
-
8686120
   push @{$spec{other_ldflags}}, '"' . $script . '"';
8686120
 
8686120
   return %spec;
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/aix.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/aix.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/aix.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/aix.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -5,7 +5,7 @@
8686120
 use File::Spec;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
8686120
 
8686120
 sub need_prelink { 1 }
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/cygwin.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/cygwin.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/cygwin.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/cygwin.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -5,7 +5,7 @@
8686120
 use ExtUtils::CBuilder::Platform::Unix;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
8686120
 
8686120
 sub link_executable {
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/darwin.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/darwin.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/darwin.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/darwin.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -4,7 +4,7 @@
8686120
 use ExtUtils::CBuilder::Platform::Unix;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
8686120
 
8686120
 sub compile {
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/dec_osf.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/dec_osf.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/dec_osf.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -6,7 +6,7 @@
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 
8686120
 sub link_executable {
8686120
   my $self = shift;
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/os2.pm perl-5.10.0/lib/ExtUtils/CBuilder/Platform/os2.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/Platform/os2.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/Platform/os2.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -4,7 +4,7 @@
8686120
 use ExtUtils::CBuilder::Platform::Unix;
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
8686120
 
8686120
 sub need_prelink { 1 }
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder/t/01-basic.t perl-5.10.0/lib/ExtUtils/CBuilder/t/01-basic.t
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder/t/01-basic.t	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder/t/01-basic.t	2009-03-11 20:08:15.000000000 +0100
8686120
@@ -53,6 +53,16 @@
8686120
 }
8686120
 
8686120
 my @words = $b->split_like_shell(' foo bar');
8686120
-ok @words, 2;
8686120
-ok $words[0], 'foo';
8686120
-ok $words[1], 'bar';
8686120
+
8686120
+skip(
8686120
+    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
8686120
+    @words, 2
8686120
+  );
8686120
+skip(
8686120
+    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
8686120
+    $words[0], 'foo'
8686120
+);
8686120
+skip(
8686120
+    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
8686120
+    $words[1], 'bar'
8686120
+);
8686120
diff -urN perl-5.10.0.orig/lib/ExtUtils/CBuilder.pm perl-5.10.0/lib/ExtUtils/CBuilder.pm
8686120
--- perl-5.10.0.orig/lib/ExtUtils/CBuilder.pm	2007-12-18 11:47:07.000000000 +0100
8686120
+++ perl-5.10.0/lib/ExtUtils/CBuilder.pm	2009-03-11 20:12:36.000000000 +0100
8686120
@@ -5,7 +5,7 @@
8686120
 use File::Basename ();
8686120
 
8686120
 use vars qw($VERSION @ISA);
8686120
-$VERSION = '0.21';
8686120
+$VERSION = '0.24';
8686120
 $VERSION = eval $VERSION;
8686120
 
8686120
 # Okay, this is the brute-force method of finding out what kind of
8686120
@@ -36,6 +36,8 @@
8686120
 		 sunos     Unix
8686120
 		 cygwin    Unix
8686120
 		 os2       Unix
8686120
+		 gnu       Unix
8686120
+		 gnukfreebsd Unix
8686120
 		 
8686120
 		 dos       Windows
8686120
 		 MSWin32   Windows