summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/CBuilder
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2008-02-09 07:18:35 +0000
committerSteve Peters <steve@fisharerojo.org>2008-02-09 07:18:35 +0000
commit20b7c8df8cc1e174ac3576beee98eb518942a02c (patch)
treed894dd31ee1816e79b2966e932602893d0d277ee /lib/ExtUtils/CBuilder
parent28c7948a097f6a8d750d5e835eabe8a13fd103e2 (diff)
downloadperl-20b7c8df8cc1e174ac3576beee98eb518942a02c.tar.gz
Upgrade to ExtUtils-CBuilder-0.22
p4raw-id: //depot/perl@33263
Diffstat (limited to 'lib/ExtUtils/CBuilder')
-rw-r--r--lib/ExtUtils/CBuilder/Base.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/Unix.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/Windows.pm61
-rw-r--r--lib/ExtUtils/CBuilder/Platform/aix.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/cygwin.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/darwin.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/dec_osf.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Platform/os2.pm2
8 files changed, 14 insertions, 61 deletions
diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm
index 0c08ab71b7..d12ebfdaa3 100644
--- a/lib/ExtUtils/CBuilder/Base.pm
+++ b/lib/ExtUtils/CBuilder/Base.pm
@@ -8,7 +8,7 @@ use Config;
use Text::ParseWords;
use vars qw($VERSION);
-$VERSION = '0.21';
+$VERSION = '0.22';
sub new {
my $class = shift;
diff --git a/lib/ExtUtils/CBuilder/Platform/Unix.pm b/lib/ExtUtils/CBuilder/Platform/Unix.pm
index 3fa73788c0..f3d696737d 100644
--- a/lib/ExtUtils/CBuilder/Platform/Unix.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Unix.pm
@@ -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 {
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm
index 7b74ae0d99..11662dff52 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm
@@ -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,
diff --git a/lib/ExtUtils/CBuilder/Platform/aix.pm b/lib/ExtUtils/CBuilder/Platform/aix.pm
index 6ad2a6842f..6ecf80efe6 100644
--- a/lib/ExtUtils/CBuilder/Platform/aix.pm
+++ b/lib/ExtUtils/CBuilder/Platform/aix.pm
@@ -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 }
diff --git a/lib/ExtUtils/CBuilder/Platform/cygwin.pm b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
index 623fe0a30c..9dcab67fe5 100644
--- a/lib/ExtUtils/CBuilder/Platform/cygwin.pm
+++ b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
@@ -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 {
diff --git a/lib/ExtUtils/CBuilder/Platform/darwin.pm b/lib/ExtUtils/CBuilder/Platform/darwin.pm
index 3b0cfb4c59..bf6e5ecf8f 100644
--- a/lib/ExtUtils/CBuilder/Platform/darwin.pm
+++ b/lib/ExtUtils/CBuilder/Platform/darwin.pm
@@ -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 {
diff --git a/lib/ExtUtils/CBuilder/Platform/dec_osf.pm b/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
index cb7a9e3da5..bb90ab51a8 100644
--- a/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
+++ b/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
@@ -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;
diff --git a/lib/ExtUtils/CBuilder/Platform/os2.pm b/lib/ExtUtils/CBuilder/Platform/os2.pm
index 4657c593ab..5f37ebe838 100644
--- a/lib/ExtUtils/CBuilder/Platform/os2.pm
+++ b/lib/ExtUtils/CBuilder/Platform/os2.pm
@@ -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 }