diff options
author | Steve Hay <SteveHay@planit.com> | 2008-04-22 09:41:44 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2008-04-22 09:41:44 +0000 |
commit | c3fb68a339256eb39318fec1e6d5a4f251f9f503 (patch) | |
tree | 34596b5026037ae64006562cd9d3f3446486af81 /lib/ExtUtils | |
parent | b5701e9edddf3f3df00cee80e48223f19407a9bc (diff) | |
download | perl-c3fb68a339256eb39318fec1e6d5a4f251f9f503.tar.gz |
Upgrade to ExtUtils-CBuilder-0.23
Wipes out local mods in 01-basic.t from #33339 (which are superseded
by changes in 0.23), but keeps local mods for VMS from #32277 (which
are still not in 0.23)
p4raw-id: //depot/perl@33721
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/CBuilder.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Base.pm | 9 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Changes | 18 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/Unix.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/VMS.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/Windows.pm | 55 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/aix.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/cygwin.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/darwin.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/dec_osf.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/os2.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/t/01-basic.t | 23 |
12 files changed, 70 insertions, 51 deletions
diff --git a/lib/ExtUtils/CBuilder.pm b/lib/ExtUtils/CBuilder.pm index 209200def4..7b97e0770f 100644 --- a/lib/ExtUtils/CBuilder.pm +++ b/lib/ExtUtils/CBuilder.pm @@ -5,7 +5,7 @@ use File::Path (); use File::Basename (); use vars qw($VERSION @ISA); -$VERSION = '0.22_01'; +$VERSION = '0.23'; $VERSION = eval $VERSION; # Okay, this is the brute-force method of finding out what kind of diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm index d12ebfdaa3..59b43b9d28 100644 --- a/lib/ExtUtils/CBuilder/Base.pm +++ b/lib/ExtUtils/CBuilder/Base.pm @@ -6,9 +6,10 @@ use File::Basename; use Cwd (); use Config; use Text::ParseWords; +use IO::File; use vars qw($VERSION); -$VERSION = '0.22'; +$VERSION = '0.23'; sub new { my $class = shift; @@ -118,10 +119,8 @@ sub have_compiler { my $tmpfile = File::Spec->catfile(File::Spec->tmpdir, 'compilet.c'); { - local *FH; - open FH, "> $tmpfile" or die "Can't create $tmpfile: $!"; - print FH "int boot_compilet() { return 1; }\n"; - close FH; + my $FH = IO::File->new("> $tmpfile") or die "Can't create $tmpfile: $!"; + print $FH "int boot_compilet() { return 1; }\n"; } my ($obj_file, @lib_files); diff --git a/lib/ExtUtils/CBuilder/Changes b/lib/ExtUtils/CBuilder/Changes index fbf6f4a120..5105cf9e1c 100644 --- a/lib/ExtUtils/CBuilder/Changes +++ b/lib/ExtUtils/CBuilder/Changes @@ -1,5 +1,23 @@ Revision history for Perl extension ExtUtils::CBuilder. + - Fixed some problems (some old, some new) with Strawberry Perl on + Windows. [Alberto Simo~es] + + - Will now install in the core perl lib directory when the user's + perl is new enough to have us in core. [Yi Ma Mao] + +0.22 - Fri Feb 8 21:52:21 2008 + + - Replaced the split_like_shell() method on Windows with a + near-no-op, which is probably more correct and has the benefit of + not messing up UNC paths. [John R. LoVerso, see + http://rt.cpan.org/Ticket/Display.html?id=26545] + + - Fixed extra_compiler_flags on Windows, they were being + ignored. [Robert May] + +0.21 - Tue Oct 30 06:46:01 2007 + - Clean up perl_src path using Cwd::realpath(). Only affects usage as part of the perl core. diff --git a/lib/ExtUtils/CBuilder/Platform/Unix.pm b/lib/ExtUtils/CBuilder/Platform/Unix.pm index f3d696737d..7138dff027 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.22'; +$VERSION = '0.23'; @ISA = qw(ExtUtils::CBuilder::Base); sub link_executable { diff --git a/lib/ExtUtils/CBuilder/Platform/VMS.pm b/lib/ExtUtils/CBuilder/Platform/VMS.pm index ab22cb23ac..e6babe8653 100644 --- a/lib/ExtUtils/CBuilder/Platform/VMS.pm +++ b/lib/ExtUtils/CBuilder/Platform/VMS.pm @@ -4,7 +4,7 @@ use strict; use ExtUtils::CBuilder::Base; use vars qw($VERSION @ISA); -$VERSION = '0.22'; +$VERSION = '0.23_01'; @ISA = qw(ExtUtils::CBuilder::Base); use File::Spec::Functions qw(catfile catdir); diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm index 11662dff52..e44f3bf2e6 100644 --- a/lib/ExtUtils/CBuilder/Platform/Windows.pm +++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm @@ -7,9 +7,10 @@ use File::Basename; use File::Spec; use ExtUtils::CBuilder::Base; +use IO::File; use vars qw($VERSION @ISA); -$VERSION = '0.22'; +$VERSION = '0.23'; @ISA = qw(ExtUtils::CBuilder::Base); sub new { @@ -43,6 +44,16 @@ sub split_like_shell { return ($_); } +sub do_system { + # See above + my $self = shift; + my $cmd = join(" ", + grep length, + map {$a=$_;$a=~s/\t/ /g;$a=~s/^\s+|\s+$//;$a} + grep defined, @_); + return $self->SUPER::do_system($cmd); +} + sub arg_defines { my ($self, %args) = @_; s/"/\\"/g foreach values %args; @@ -282,18 +293,16 @@ sub write_compiler_script { $self->add_to_cleanup($script); print "Generating script '$script'\n" if !$self->{quiet}; - open( SCRIPT, ">$script" ) + my $SCRIPT = IO::File->new( ">$script" ) or die( "Could not create script '$script': $!" ); - print SCRIPT join( "\n", + print $SCRIPT join( "\n", map { ref $_ ? @{$_} : $_ } grep defined, delete( @spec{ qw(includes cflags optimize defines perlinc) } ) ); - close SCRIPT; - push @{$spec{includes}}, '@"' . $script . '"'; return %spec; @@ -355,10 +364,10 @@ sub write_linker_script { print "Generating script '$script'\n" if !$self->{quiet}; - open( SCRIPT, ">$script" ) + my $SCRIPT = IO::File->new( ">$script" ) or die( "Could not create script '$script': $!" ); - print SCRIPT join( "\n", + print $SCRIPT join( "\n", map { ref $_ ? @{$_} : $_ } grep defined, delete( @@ -367,8 +376,6 @@ sub write_linker_script { def_file implib map_file) } ) ); - close SCRIPT; - push @{$spec{lddlflags}}, '@"' . $script . '"'; return %spec; @@ -412,7 +419,7 @@ sub write_compiler_script { print "Generating script '$script'\n" if !$self->{quiet}; - open( SCRIPT, ">$script" ) + my $SCRIPT = IO::File->new( ">$script" ) or die( "Could not create script '$script': $!" ); # XXX Borland "response files" seem to be unable to accept macro @@ -420,15 +427,13 @@ sub write_compiler_script { # backslash doesn't work, and any level of quotes are stripped. The # result is is a floating point number in the source file where a # string is expected. So we leave the macros on the command line. - print SCRIPT join( "\n", + print $SCRIPT join( "\n", map { ref $_ ? @{$_} : $_ } grep defined, delete( @spec{ qw(includes cflags optimize perlinc) } ) ); - close SCRIPT; - push @{$spec{includes}}, '@"' . $script . '"'; return %spec; @@ -478,29 +483,25 @@ sub write_linker_script { print "Generating scripts '$ld_script' and '$ld_libs'.\n" if !$self->{quiet}; # Script 1: contains options & names of object files. - open( LD_SCRIPT, ">$ld_script" ) + my $LD_SCRIPT = IO::File->new( ">$ld_script" ) or die( "Could not create linker script '$ld_script': $!" ); - print LD_SCRIPT join( " +\n", + print $LD_SCRIPT join( " +\n", map { @{$_} } grep defined, delete( @spec{ qw(lddlflags libpath other_ldflags startup objects) } ) ); - close LD_SCRIPT; - # Script 2: contains name of libs to link against. - open( LD_LIBS, ">$ld_libs" ) + my $LD_LIBS = IO::File->new( ">$ld_libs" ) or die( "Could not create linker script '$ld_libs': $!" ); - print LD_LIBS join( " +\n", + print $LD_LIBS join( " +\n", (delete $spec{libperl} || ''), @{delete $spec{perllibs} || []}, ); - close LD_LIBS; - push @{$spec{lddlflags}}, '@"' . $ld_script . '"'; push @{$spec{perllibs}}, '@"' . $ld_libs . '"'; @@ -622,32 +623,30 @@ sub write_linker_script { print "Generating script '$script'\n" if !$self->{quiet}; - open( SCRIPT, ">$script" ) + my $SCRIPT = IO::File->new( ">$script" ) or die( "Could not create script '$script': $!" ); - print( SCRIPT 'SEARCH_DIR(' . $_ . ")\n" ) + print $SCRIPT ( 'SEARCH_DIR(' . $_ . ")\n" ) for @{delete $spec{libpath} || []}; # gcc takes only one startup file, so the first object in startup is # specified as the startup file and any others are shifted into the # beginning of the list of objects. if ( $spec{startup} && @{$spec{startup}} ) { - print SCRIPT 'STARTUP(' . shift( @{$spec{startup}} ) . ")\n"; + print $SCRIPT 'STARTUP(' . shift( @{$spec{startup}} ) . ")\n"; unshift @{$spec{objects}}, @{delete $spec{startup} || []}; } - print SCRIPT 'INPUT(' . join( ',', + print $SCRIPT 'INPUT(' . join( ',', @{delete $spec{objects} || []} ) . ")\n"; - print SCRIPT 'INPUT(' . join( ' ', + print $SCRIPT 'INPUT(' . join( ' ', (delete $spec{libperl} || ''), @{delete $spec{perllibs} || []}, ) . ")\n"; - close SCRIPT; - push @{$spec{other_ldflags}}, '"' . $script . '"'; return %spec; diff --git a/lib/ExtUtils/CBuilder/Platform/aix.pm b/lib/ExtUtils/CBuilder/Platform/aix.pm index 6ecf80efe6..560b92c22a 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.22'; +$VERSION = '0.23'; @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 9dcab67fe5..186bf7fde9 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.22'; +$VERSION = '0.23'; @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 bf6e5ecf8f..7d00417efb 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.22'; +$VERSION = '0.23'; @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 bb90ab51a8..8a1b9325ef 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.22'; +$VERSION = '0.23'; sub link_executable { my $self = shift; diff --git a/lib/ExtUtils/CBuilder/Platform/os2.pm b/lib/ExtUtils/CBuilder/Platform/os2.pm index 5f37ebe838..da446b3b1b 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.22'; +$VERSION = '0.23'; @ISA = qw(ExtUtils::CBuilder::Platform::Unix); sub need_prelink { 1 } diff --git a/lib/ExtUtils/CBuilder/t/01-basic.t b/lib/ExtUtils/CBuilder/t/01-basic.t index 869350e9bc..3968a37ed4 100644 --- a/lib/ExtUtils/CBuilder/t/01-basic.t +++ b/lib/ExtUtils/CBuilder/t/01-basic.t @@ -53,13 +53,16 @@ for ($source_file, $object_file, $lib_file) { } my @words = $b->split_like_shell(' foo bar'); -if ($^O eq 'MSWin32') { - ok @words, 1; - ok $words[0], ' foo bar'; - skip 'No splitting in split_like_shell() on Win32'; -} -else { - ok @words, 2; - ok $words[0], 'foo'; - ok $words[1], 'bar'; -} + +skip( + $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0, # whether to skip + @words, 2 + ); +skip( + $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0, # whether to skip + $words[0], 'foo' +); +skip( + $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0, # whether to skip + $words[1], 'bar' +); |