Upgrade to ExtUtils-CBuilder-0.22
authorSteve Peters <steve@fisharerojo.org>
Sat, 9 Feb 2008 07:18:35 +0000 (07:18 +0000)
committerSteve Peters <steve@fisharerojo.org>
Sat, 9 Feb 2008 07:18:35 +0000 (07:18 +0000)
p4raw-id: //depot/perl@33263

lib/ExtUtils/CBuilder.pm
lib/ExtUtils/CBuilder/Base.pm
lib/ExtUtils/CBuilder/Platform/Unix.pm
lib/ExtUtils/CBuilder/Platform/Windows.pm
lib/ExtUtils/CBuilder/Platform/aix.pm
lib/ExtUtils/CBuilder/Platform/cygwin.pm
lib/ExtUtils/CBuilder/Platform/darwin.pm
lib/ExtUtils/CBuilder/Platform/dec_osf.pm
lib/ExtUtils/CBuilder/Platform/os2.pm

index fae01b1..077fecd 100644 (file)
@@ -5,7 +5,7 @@ use File::Path ();
 use File::Basename ();
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 $VERSION = eval $VERSION;
 
 # Okay, this is the brute-force method of finding out what kind of
index 0c08ab7..d12ebfd 100644 (file)
@@ -8,7 +8,7 @@ use Config;
 use Text::ParseWords;
 
 use vars qw($VERSION);
-$VERSION = '0.21';
+$VERSION = '0.22';
 
 sub new {
   my $class = shift;
index 3fa7378..f3d6967 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use ExtUtils::CBuilder::Base;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 sub link_executable {
index 7b74ae0..11662df 100644 (file)
@@ -9,7 +9,7 @@ use File::Spec;
 use ExtUtils::CBuilder::Base;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 sub new {
@@ -33,61 +33,14 @@ sub _compiler_type {
 }
 
 sub split_like_shell {
-  # As it turns out, Windows command-parsing is very different from
-  # Unix command-parsing.  Double-quotes mean different things,
-  # backslashes don't necessarily mean escapes, and so on.  So we
-  # can't use Text::ParseWords::shellwords() to break a command string
-  # into words.  The algorithm below was bashed out by Randy and Ken
-  # (mostly Randy), and there are a lot of regression tests, so we
-  # should feel free to adjust if desired.
-  
+  # Since Windows will pass the whole command string (not an argument
+  # array) to the target program and make the program parse it itself,
+  # we don't actually need to do any processing here.
   (my $self, local $_) = @_;
   
   return @$_ if defined() && UNIVERSAL::isa($_, 'ARRAY');
-  
-  my @argv;
-  return @argv unless defined() && length();
-  
-  my $arg = '';
-  my( $i, $quote_mode ) = ( 0, 0 );
-  
-  while ( $i < length() ) {
-    
-    my $ch      = substr( $_, $i  , 1 );
-    my $next_ch = substr( $_, $i+1, 1 );
-    
-    if ( $ch eq '\\' && $next_ch eq '"' ) {
-      $arg .= '"';
-      $i++;
-    } elsif ( $ch eq '\\' && $next_ch eq '\\' ) {
-      $arg .= '\\';
-      $i++;
-    } elsif ( $ch eq '"' && $next_ch eq '"' && $quote_mode ) {
-      $quote_mode = !$quote_mode;
-      $arg .= '"';
-      $i++;
-    } elsif ( $ch eq '"' && $next_ch eq '"' && !$quote_mode &&
-             ( $i + 2 == length()  ||
-               substr( $_, $i + 2, 1 ) eq ' ' )
-           ) { # for cases like: a"" => [ 'a' ]
-      push( @argv, $arg );
-      $arg = '';
-      $i += 2;
-    } elsif ( $ch eq '"' ) {
-      $quote_mode = !$quote_mode;
-    } elsif ( $ch eq ' ' && !$quote_mode ) {
-      push( @argv, $arg ) if $arg;
-      $arg = '';
-      ++$i while substr( $_, $i + 1, 1 ) eq ' ';
-    } else {
-      $arg .= $ch;
-    }
-    
-    $i++;
-  }
-  
-  push( @argv, $arg ) if defined( $arg ) && length( $arg );
-  return @argv;
+  return unless defined() && length();
+  return ($_);
 }
 
 sub arg_defines {
@@ -119,7 +72,7 @@ sub compile {
     cflags      => [
                      $self->split_like_shell($cf->{ccflags}),
                      $self->split_like_shell($cf->{cccdlflags}),
-                     $self->split_like_shell($cf->{extra_compiler_flags}),
+                     $self->split_like_shell($args{extra_compiler_flags}),
                    ],
     optimize    => [ $self->split_like_shell($cf->{optimize})    ],
     defines     => \@defines,
index 6ad2a68..6ecf80e 100644 (file)
@@ -5,7 +5,7 @@ use ExtUtils::CBuilder::Platform::Unix;
 use File::Spec;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub need_prelink { 1 }
index 623fe0a..9dcab67 100644 (file)
@@ -5,7 +5,7 @@ use File::Spec;
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub link_executable {
index 3b0cfb4..bf6e5ec 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub compile {
index cb7a9e3..bb90ab5 100644 (file)
@@ -6,7 +6,7 @@ use File::Spec;
 
 use vars qw($VERSION @ISA);
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
-$VERSION = '0.21';
+$VERSION = '0.22';
 
 sub link_executable {
   my $self = shift;
index 4657c59..5f37ebe 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.21';
+$VERSION = '0.22';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub need_prelink { 1 }