r65736 - in /trunk/libextutils-cbuilder-perl: ./ debian/ debian/source/ lib/ExtUtils/ lib/ExtUtils/CBuilder/ lib/ExtUtils/CBuilder/Platform/ lib/ExtUtils/CBuilder/Platform/Windows/ t/
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Sat Dec 11 13:14:59 UTC 2010
Author: angelabad-guest
Date: Sat Dec 11 13:14:45 2010
New Revision: 65736
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65736
Log:
* New upstream release
* debian/copyright: Update license information
* Bump Standards-Version to 3.9.1 (no changes)
* Switch to dpkg-source format 3.0 (quilt)
Added:
trunk/libextutils-cbuilder-perl/debian/source/
trunk/libextutils-cbuilder-perl/debian/source/format
trunk/libextutils-cbuilder-perl/t/04-base.t
- copied unchanged from r65734, branches/upstream/libextutils-cbuilder-perl/current/t/04-base.t
Modified:
trunk/libextutils-cbuilder-perl/Changes
trunk/libextutils-cbuilder-perl/MANIFEST
trunk/libextutils-cbuilder-perl/META.yml
trunk/libextutils-cbuilder-perl/Makefile.PL
trunk/libextutils-cbuilder-perl/debian/changelog
trunk/libextutils-cbuilder-perl/debian/control
trunk/libextutils-cbuilder-perl/debian/copyright
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm
trunk/libextutils-cbuilder-perl/t/00-have-compiler.t
trunk/libextutils-cbuilder-perl/t/01-basic.t
trunk/libextutils-cbuilder-perl/t/02-link.t
trunk/libextutils-cbuilder-perl/t/03-cplusplus.t
Modified: trunk/libextutils-cbuilder-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/Changes?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/Changes (original)
+++ trunk/libextutils-cbuilder-perl/Changes Sat Dec 11 13:14:45 2010
@@ -1,4 +1,49 @@
Revision history for Perl extension ExtUtils::CBuilder.
+
+0.2801 - Wed Dec 8 21:36:56 EST 2010
+
+ Fixed:
+
+ - Fixed spurious t/04-base.t failure when run from Perl core
+ [David Golden]
+
+0.2800 - Mon Dec 6 16:05:46 EST 2010
+
+ - No changes from 0.27_07
+
+0.27_07 - Wed Sep 29 21:48:55 EDT 2010
+
+ Fixed:
+
+ - Fixed t/02-link.t on perl < 5.8
+
+0.27_06 - Mon Sep 27 15:29:54 EDT 2010
+
+ Fixed:
+
+ - Preserves exit status on VMS [Craig Berry]
+
+ - Fix Win32 split_like_shell escaping [Christian Walde]
+
+0.27_05 - Wed Jul 28 15:29:59 EDT 2010
+
+ Fixed:
+
+ - Tests no longer fail if user has set the CC environment variable
+
+0.27_04 - Mon Jul 26 22:41:43 EDT 2010
+
+ Added:
+ - handle c compiler and c++ compiler separately
+ (adds requirement for IPC::Cmd) [Jens Rehsack]
+
+ Others:
+ - rely on File::Temp::tempfile and File::Spec::tmpdir to
+ get unique file name for checking for compiler
+ [Jens Rehsack]
+
+ - Code base modernization and substantial code coverage improvments
+ [Jim Keenan]
0.2703 - Tue Mar 16 17:10:55 EDT 2010
@@ -239,7 +284,7 @@
- Various parts of the code were looking for the CORE/ directory in
$Config{archlib}, $Config{installarchlib}, and $Config{archlibexp}.
- Only the latter is correct, so we use that everywhere now.
+ Only the latter is correct, so we use that everywhere now.
[Curt Tilmes]
- For Unix-ish platforms, link_executable() will now prefer
Modified: trunk/libextutils-cbuilder-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/MANIFEST?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/MANIFEST (original)
+++ trunk/libextutils-cbuilder-perl/MANIFEST Sat Dec 11 13:14:45 2010
@@ -21,3 +21,4 @@
t/01-basic.t
t/02-link.t
t/03-cplusplus.t
+t/04-base.t
Modified: trunk/libextutils-cbuilder-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/META.yml?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/META.yml (original)
+++ trunk/libextutils-cbuilder-perl/META.yml Sat Dec 11 13:14:45 2010
@@ -4,7 +4,7 @@
- 'Ken Williams, kwilliams at cpan.org'
build_requires:
Test::More: 0.47
-generated_by: 'Module::Build version 0.3603'
+generated_by: 'Module::Build version 0.3618'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -13,50 +13,52 @@
provides:
ExtUtils::CBuilder:
file: lib/ExtUtils/CBuilder.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Base:
file: lib/ExtUtils/CBuilder/Base.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::Unix:
file: lib/ExtUtils/CBuilder/Platform/Unix.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::VMS:
file: lib/ExtUtils/CBuilder/Platform/VMS.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::Windows:
file: lib/ExtUtils/CBuilder/Platform/Windows.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::Windows::BCC:
file: lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::Windows::GCC:
file: lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::Windows::MSVC:
file: lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::aix:
file: lib/ExtUtils/CBuilder/Platform/aix.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::cygwin:
file: lib/ExtUtils/CBuilder/Platform/cygwin.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::darwin:
file: lib/ExtUtils/CBuilder/Platform/darwin.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::dec_osf:
file: lib/ExtUtils/CBuilder/Platform/dec_osf.pm
- version: 0.2703
+ version: 0.2801
ExtUtils::CBuilder::Platform::os2:
file: lib/ExtUtils/CBuilder/Platform/os2.pm
- version: 0.2703
+ version: 0.2801
requires:
Cwd: 0
File::Basename: 0
- File::Spec: 0
+ File::Spec: 3.13
+ File::Temp: 0
IO::File: 0
+ IPC::Cmd: 0
Text::ParseWords: 0
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/dagolden/extutils-cbuilder.git
-version: 0.2703
+version: 0.2801
Modified: trunk/libextutils-cbuilder-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/Makefile.PL?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/Makefile.PL (original)
+++ trunk/libextutils-cbuilder-perl/Makefile.PL Sat Dec 11 13:14:45 2010
@@ -1,19 +1,21 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3603
+# Note: this file was auto-generated by Module::Build::Compat version 0.36_18
use ExtUtils::MakeMaker;
WriteMakefile
(
- 'NAME' => 'ExtUtils::CBuilder',
- 'VERSION_FROM' => 'lib/ExtUtils/CBuilder.pm',
- 'PREREQ_PM' => {
- 'Cwd' => 0,
- 'File::Basename' => 0,
- 'File::Spec' => 0,
- 'IO::File' => 0,
- 'Test::More' => '0.47',
- 'Text::ParseWords' => 0
- },
- 'INSTALLDIRS' => ($] >= 5.009003 ? 'perl' : 'site'),
- 'EXE_FILES' => [],
- 'PL_FILES' => {}
- )
+ 'NAME' => 'ExtUtils::CBuilder',
+ 'VERSION_FROM' => 'lib/ExtUtils/CBuilder.pm',
+ 'PREREQ_PM' => {
+ 'Cwd' => 0,
+ 'File::Basename' => 0,
+ 'File::Spec' => '3.13',
+ 'File::Temp' => 0,
+ 'IO::File' => 0,
+ 'IPC::Cmd' => 0,
+ 'Test::More' => '0.47',
+ 'Text::ParseWords' => 0
+ },
+ 'INSTALLDIRS' => ($] >= 5.009003 ? 'perl' : 'site'),
+ 'EXE_FILES' => [],
+ 'PL_FILES' => {}
+)
;
Modified: trunk/libextutils-cbuilder-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/changelog?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/changelog (original)
+++ trunk/libextutils-cbuilder-perl/debian/changelog Sat Dec 11 13:14:45 2010
@@ -1,3 +1,12 @@
+libextutils-cbuilder-perl (0.2801-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/copyright: Update license information
+ * Bump Standards-Version to 3.9.1 (no changes)
+ * Switch to dpkg-source format 3.0 (quilt)
+
+ -- Angel Abad <angelabad at gmail.com> Sat, 11 Dec 2010 14:14:30 +0100
+
libextutils-cbuilder-perl (0.2703-1) UNRELEASED; urgency=low
IGNORE-VERSION: 0.2703-1
Modified: trunk/libextutils-cbuilder-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/control?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/control (original)
+++ trunk/libextutils-cbuilder-perl/debian/control Sat Dec 11 13:14:45 2010
@@ -7,7 +7,7 @@
Uploaders: Damyan Ivanov <dmn at debian.org>, gregor herrmann <gregoa at debian.org>,
Nathan Handler <nhandler at ubuntu.com>, Jonathan Yu <jawnsy at cpan.org>,
Angel Abad <angelabad at gmail.com>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
Homepage: http://search.cpan.org/dist/ExtUtils-CBuilder/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libextutils-cbuilder-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libextutils-cbuilder-perl/
Modified: trunk/libextutils-cbuilder-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/copyright?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/copyright (original)
+++ trunk/libextutils-cbuilder-perl/debian/copyright Sat Dec 11 13:14:45 2010
@@ -10,9 +10,9 @@
Files: debian/*
Copyright: 2005, Chip Salzenberg <chip at debian.org>
2006, Florian Ragwitz <rafl at debian.org>
- 2008, 2009, Damyan Ivanov <dmn at debian.org>
+ 2008-2009, Damyan Ivanov <dmn at debian.org>
2008, gregor herrmann <gregoa at debian.org>
- 2009, 2010, Jonathan Yu <jawnsy at cpan.org>
+ 2009-2010, Jonathan Yu <jawnsy at cpan.org>
2009, Nathan Handler <nhandler at ubuntu.com>
2010, Angel Abad <angelabad at gmail.com>
License: Artistic or GPL-1+
@@ -21,8 +21,8 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -30,5 +30,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ On Debian systems, the complete text of version 1 of the General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.
Added: trunk/libextutils-cbuilder-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/source/format?rev=65736&op=file
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/source/format (added)
+++ trunk/libextutils-cbuilder-perl/debian/source/format Sat Dec 11 13:14:45 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm Sat Dec 11 13:14:45 2010
@@ -5,7 +5,7 @@
use File::Basename ();
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
$VERSION = eval $VERSION;
# Okay, this is the brute-force method of finding out what kind of
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm Sat Dec 11 13:14:45 2010
@@ -7,9 +7,27 @@
use Config;
use Text::ParseWords;
use IO::File;
+use Data::Dumper;$Data::Dumper::Indent=1;
+use IPC::Cmd qw(can_run);
+use File::Temp qw(tempfile);
use vars qw($VERSION);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
+
+# More details about C/C++ compilers:
+# http://developers.sun.com/sunstudio/documentation/product/compiler.jsp
+# http://gcc.gnu.org/
+# http://publib.boulder.ibm.com/infocenter/comphelp/v101v121/index.jsp
+# http://msdn.microsoft.com/en-us/vstudio/default.aspx
+
+my %cc2cxx = (
+ # first line order is important to support wrappers like in pkgsrc
+ cc => [ 'c++', 'CC', 'aCC', 'cxx', ], # Sun Studio, HP ANSI C/C++ Compilers
+ gcc => [ 'g++' ], # GNU Compiler Collection
+ xlc => [ 'xlC' ], # IBM C/C++ Set, xlc without thread-safety
+ xlc_r => [ 'xlC_r' ], # IBM C/C++ Set, xlc with thread-safety
+ cl => [ 'cl' ], # Microsoft Visual Studio
+);
sub new {
my $class = shift;
@@ -21,7 +39,37 @@
while (my ($k,$v) = each %Config) {
$self->{config}{$k} = $v unless exists $self->{config}{$k};
}
- $self->{config}{cc} = $ENV{CC} if exists $ENV{CC};
+ $self->{config}{cc} = $ENV{CC} if defined $ENV{CC};
+ $self->{config}{ccflags} = $ENV{CFLAGS} if defined $ENV{CFLAGS};
+ $self->{config}{cxx} = $ENV{CXX} if defined $ENV{CXX};
+ $self->{config}{cxxflags} = $ENV{CXXFLAGS} if defined $ENV{CXXFLAGS};
+ $self->{config}{ld} = $ENV{LD} if defined $ENV{LD};
+ $self->{config}{ldflags} = $ENV{LDFLAGS} if defined $ENV{LDFLAGS};
+
+ unless ( exists $self->{config}{cxx} ) {
+ my ($ccpath, $ccbase, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/);
+ foreach my $cxx (@{$cc2cxx{$ccbase}}) {
+ if( can_run( File::Spec->catfile( $ccpath, $cxx, $ccsfx ) ) ) {
+ $self->{config}{cxx} = File::Spec->catfile( $ccpath, $cxx, $ccsfx );
+ last;
+ }
+ if( can_run( File::Spec->catfile( $cxx, $ccsfx ) ) ) {
+ $self->{config}{cxx} = File::Spec->catfile( $cxx, $ccsfx );
+ last;
+ }
+ if( can_run( $cxx ) ) {
+ $self->{config}{cxx} = $cxx;
+ last;
+ }
+ }
+ unless ( exists $self->{config}{cxx} ) {
+ $self->{config}{cxx} = $self->{config}{cc};
+ my $cflags = $self->{config}{cflags};
+ $self->{config}{cxxflags} = '-x c++';
+ $self->{config}{cxxflags} .= " $cflags" if defined $cflags;
+ }
+ }
+
return $self;
}
@@ -29,7 +77,7 @@
my $perl;
File::Spec->file_name_is_absolute($perl = $^X)
or -f ($perl = $Config::Config{perlpath})
- or ($perl = $^X);
+ or ($perl = $^X); # XXX how about using IPC::Cmd::can_run here?
return $perl;
}
@@ -45,6 +93,10 @@
foreach my $file (keys %{$self->{files_to_clean}}) {
unlink $file;
}
+}
+
+sub get_config {
+ return %{ $_[0]->{config} };
}
sub object_file {
@@ -87,81 +139,80 @@
die "Missing 'source' argument to compile()" unless defined $args{source};
my $cf = $self->{config}; # For convenience
-
- $args{object_file} ||= $self->object_file($args{source});
-
- $args{include_dirs} = [ $args{include_dirs} ]
- if exists($args{include_dirs}) && ref($args{include_dirs}) ne "ARRAY";
-
- my @include_dirs = $self->arg_include_dirs
- (@{$args{include_dirs} || []},
- $self->perl_inc());
+
+ my $object_file = $args{object_file}
+ ? $args{object_file}
+ : $self->object_file($args{source});
+
+ my $include_dirs_ref =
+ (exists($args{include_dirs}) && ref($args{include_dirs}) ne "ARRAY")
+ ? [ $args{include_dirs} ]
+ : $args{include_dirs};
+ my @include_dirs = $self->arg_include_dirs(
+ @{ $include_dirs_ref || [] },
+ $self->perl_inc(),
+ );
my @defines = $self->arg_defines( %{$args{defines} || {}} );
- my @extra_compiler_flags = $self->split_like_shell($args{extra_compiler_flags});
+ my @extra_compiler_flags =
+ $self->split_like_shell($args{extra_compiler_flags});
my @cccdlflags = $self->split_like_shell($cf->{cccdlflags});
- my @ccflags = $self->split_like_shell($cf->{ccflags});
- push @ccflags, qw/-x c++/ if $args{'C++'};
+ my @ccflags = $self->split_like_shell($args{'C++'} ? $cf->{cxxflags} : $cf->{ccflags});
my @optimize = $self->split_like_shell($cf->{optimize});
- my @flags = (@include_dirs, @defines, @cccdlflags, @extra_compiler_flags,
- $self->arg_nolink,
- @ccflags, @optimize,
- $self->arg_object_file($args{object_file}),
- );
-
- my @cc = $self->split_like_shell($cf->{cc});
+ my @flags = (
+ @include_dirs,
+ @defines,
+ @cccdlflags,
+ @extra_compiler_flags,
+ $self->arg_nolink,
+ @ccflags,
+ @optimize,
+ $self->arg_object_file($object_file),
+ );
+ my @cc = $self->split_like_shell($args{'C++'} ? $cf->{cxx} : $cf->{cc});
$self->do_system(@cc, @flags, $args{source})
- or die "error building $args{object_file} from '$args{source}'";
-
- return $args{object_file};
+ or die "error building $object_file from '$args{source}'";
+
+ return $object_file;
}
sub have_compiler {
my ($self, $is_cplusplus) = @_;
- return $self->{have_compiler} if defined $self->{have_compiler};
+ my $have_compiler_flag = $is_cplusplus ? "have_cxx" : "have_cc";
+ my $suffix = $is_cplusplus ? ".cc" : ".c";
+ return $self->{$have_compiler_flag} if defined $self->{$have_compiler_flag};
my $result;
my $attempts = 3;
# tmpdir has issues for some people so fall back to current dir
- DIR: for my $dir ( File::Spec->tmpdir, '.' ) {
-
- # don't clobber existing files (rare, but possible)
- my $rand = int(rand(2**31));
- my $tmpfile = File::Spec->catfile($dir, "compilet-$rand.c");
- $tmpfile .= "c" if $is_cplusplus;
- if ( -e $tmpfile ) {
- redo DIR if $attempts--;
- next DIR;
- }
-
- {
- my $FH = IO::File->new("> $tmpfile") or die "Can't create $tmpfile: $!";
- if ( $is_cplusplus ) {
- print $FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
- }
- else {
- print $FH "int boot_compilet() { return 1; }\n";
- }
- }
-
- my ($obj_file, @lib_files);
- eval {
- local $^W = 0;
- local $self->{quiet} = 1;
- $obj_file = $self->compile('C++' => $is_cplusplus, source => $tmpfile);
- @lib_files = $self->link(objects => $obj_file, module_name => 'compilet');
- };
- $result = $@ ? 0 : 1;
-
- foreach (grep defined, $tmpfile, $obj_file, @lib_files) {
- 1 while unlink;
- }
- last DIR if $result;
- }
-
- return $self->{have_compiler} = $result;
+
+ # don't clobber existing files (rare, but possible)
+ my ( $FH, $tmpfile ) = tempfile( "compilet-XXXXX", SUFFIX => $suffix );
+ binmode $FH;
+
+ if ( $is_cplusplus ) {
+ print $FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
+ }
+ else {
+ print $FH "int boot_compilet() { return 1; }\n";
+ }
+
+ my ($obj_file, @lib_files);
+ eval {
+ local $^W = 0;
+ local $self->{quiet} = 1;
+ $obj_file = $self->compile('C++' => $is_cplusplus, source => $tmpfile);
+ @lib_files = $self->link(objects => $obj_file, module_name => 'compilet');
+ };
+ $result = $@ ? 0 : 1;
+
+ foreach (grep defined, $tmpfile, $obj_file, @lib_files) {
+ 1 while unlink;
+ }
+
+ return $self->{$have_compiler_flag} = $result;
}
sub have_cplusplus {
@@ -190,23 +241,32 @@
sub prelink {
my ($self, %args) = @_;
-
- ($args{dl_file} = $args{dl_name}) =~ s/.*::// unless $args{dl_file};
-
+
+ my ($dl_file_out, $mksymlists_args) = _prepare_mksymlists_args(\%args);
+
require ExtUtils::Mksymlists;
- ExtUtils::Mksymlists::Mksymlists( # dl. abbrev for dynamic library
- DL_VARS => $args{dl_vars} || [],
- DL_FUNCS => $args{dl_funcs} || {},
- FUNCLIST => $args{dl_func_list} || [],
- IMPORTS => $args{dl_imports} || {},
- NAME => $args{dl_name}, # Name of the Perl module
- DLBASE => $args{dl_base}, # Basename of DLL file
- FILE => $args{dl_file}, # Dir + Basename of symlist file
- VERSION => (defined $args{dl_version} ? $args{dl_version} : '0.0'),
+ # dl. abbrev for dynamic library
+ ExtUtils::Mksymlists::Mksymlists( %{ $mksymlists_args } );
+
+ # Mksymlists will create one of these files
+ return grep -e, map "$dl_file_out.$_", qw(ext def opt);
+}
+
+sub _prepare_mksymlists_args {
+ my $args = shift;
+ ($args->{dl_file} = $args->{dl_name}) =~ s/.*::// unless $args->{dl_file};
+
+ my %mksymlists_args = (
+ DL_VARS => $args->{dl_vars} || [],
+ DL_FUNCS => $args->{dl_funcs} || {},
+ FUNCLIST => $args->{dl_func_list} || [],
+ IMPORTS => $args->{dl_imports} || {},
+ NAME => $args->{dl_name}, # Name of the Perl module
+ DLBASE => $args->{dl_base}, # Basename of DLL file
+ FILE => $args->{dl_file}, # Dir + Basename of symlist file
+ VERSION => (defined $args->{dl_version} ? $args->{dl_version} : '0.0'),
);
-
- # Mksymlists will create one of these files
- return grep -e, map "$args{dl_file}.$_", qw(ext def opt);
+ return ($args->{dl_file}, \%mksymlists_args);
}
sub link {
@@ -230,14 +290,19 @@
my @temp_files;
@temp_files =
- $self->prelink(%args,
- dl_name => $args{module_name}) if $args{lddl} && $self->need_prelink;
-
- my @linker_flags = ($self->split_like_shell($args{extra_linker_flags}),
- $self->extra_link_args_after_prelink(%args, dl_name => $args{module_name},
- prelink_res => \@temp_files));
-
- my @output = $args{lddl} ? $self->arg_share_object_file($out) : $self->arg_exec_file($out);
+ $self->prelink(%args, dl_name => $args{module_name})
+ if $args{lddl} && $self->need_prelink;
+
+ my @linker_flags = (
+ $self->split_like_shell($args{extra_linker_flags}),
+ $self->extra_link_args_after_prelink(
+ %args, dl_name => $args{module_name}, prelink_res => \@temp_files
+ )
+ );
+
+ my @output = $args{lddl}
+ ? $self->arg_share_object_file($out)
+ : $self->arg_exec_file($out);
my @shrp = $self->split_like_shell($cf->{shrpenv});
my @ld = $self->split_like_shell($cf->{ld});
@@ -262,6 +327,11 @@
$string =~ s/^\s+|\s+$//g;
return () unless length($string);
+ # Text::ParseWords replaces all 'escaped' characters with themselves, which completely
+ # breaks paths under windows. As such, we forcibly replace backwards slashes with forward
+ # slashes on windows.
+ $string =~ s@\\@/@g if $^O eq 'MSWin32';
+
return Text::ParseWords::shellwords($string);
}
@@ -278,12 +348,12 @@
# Try up to 5 levels upwards
for (0..10) {
if (
- -f File::Spec->catfile($dir,"config_h.SH")
- &&
- -f File::Spec->catfile($dir,"perl.h")
- &&
- -f File::Spec->catfile($dir,"lib","Exporter.pm")
- ) {
+ -f File::Spec->catfile($dir,"config_h.SH")
+ &&
+ -f File::Spec->catfile($dir,"perl.h")
+ &&
+ -f File::Spec->catfile($dir,"lib","Exporter.pm")
+ ) {
return Cwd::realpath( $dir );
}
@@ -308,3 +378,5 @@
}
1;
+
+# vim: ts=2 sw=2 et:
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm Sat Dec 11 13:14:45 2010
@@ -4,7 +4,7 @@
use ExtUtils::CBuilder::Base;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Base);
sub link_executable {
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm Sat Dec 11 13:14:45 2010
@@ -4,7 +4,7 @@
use ExtUtils::CBuilder::Base;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Base);
use File::Spec::Functions qw(catfile catdir);
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm Sat Dec 11 13:14:45 2010
@@ -10,7 +10,7 @@
use IO::File;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Base);
=begin comment
@@ -101,7 +101,7 @@
builddir => $srcdir,
basename => $basename,
source => $args{source},
- output => File::Spec->catfile($srcdir, $basename) . $cf->{obj_ext},
+ output => $args{object_file} || File::Spec->catfile($srcdir, $basename) . $cf->{obj_ext},
cc => $cf->{cc},
cflags => [
$self->split_like_shell($cf->{ccflags}),
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm Sat Dec 11 13:14:45 2010
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::BCC;
use vars qw($VERSION);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
sub format_compiler_cmd {
my ($self, %spec) = @_;
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm Sat Dec 11 13:14:45 2010
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::GCC;
use vars qw($VERSION);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
sub format_compiler_cmd {
my ($self, %spec) = @_;
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm Sat Dec 11 13:14:45 2010
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::MSVC;
use vars qw($VERSION);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
sub arg_exec_file {
my ($self, $file) = @_;
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm Sat Dec 11 13:14:45 2010
@@ -5,7 +5,7 @@
use File::Spec;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm Sat Dec 11 13:14:45 2010
@@ -5,7 +5,7 @@
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
# TODO: If a specific exe_file name is requested, if the exe created
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm Sat Dec 11 13:14:45 2010
@@ -4,7 +4,7 @@
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub compile {
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm Sat Dec 11 13:14:45 2010
@@ -6,7 +6,7 @@
use vars qw($VERSION @ISA);
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
sub link_executable {
my $self = shift;
Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm Sat Dec 11 13:14:45 2010
@@ -4,7 +4,7 @@
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.2703';
+$VERSION = '0.2801';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }
Modified: trunk/libextutils-cbuilder-perl/t/00-have-compiler.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/00-have-compiler.t?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/00-have-compiler.t (original)
+++ trunk/libextutils-cbuilder-perl/t/00-have-compiler.t Sat Dec 11 13:14:45 2010
@@ -16,7 +16,7 @@
}
}
-plan tests => 6;
+plan tests => 7;
require_ok "ExtUtils::CBuilder";
@@ -29,17 +29,29 @@
$b->{config}{cc} = $bogus_path;
$b->{config}{ld} = $bogus_path;
-$b->{have_compiler} = undef;
+$b->{have_cc} = undef;
is( $b->have_compiler, 0, "have_compiler: fake missing cc" );
-$b->{have_compiler} = undef;
+$b->{have_cxx} = undef;
is( $b->have_cplusplus, 0, "have_cplusplus: fake missing c++" );
# test found compiler
$b->{config}{cc} = $run_perl;
$b->{config}{ld} = $run_perl;
-$b->{have_compiler} = undef;
+$b->{config}{cxx} = $run_perl;
+$b->{have_cc} = undef;
is( $b->have_compiler, 1, "have_compiler: fake present cc" );
-$b->{have_compiler} = undef;
+$b->{have_cxx} = undef;
is( $b->have_cplusplus, 1, "have_cpp_compiler: fake present c++" );
# test missing cpp compiler
+
+# test one non-exported subroutine
+{
+ my $type = ExtUtils::CBuilder::os_type();
+ if ($type) {
+ pass( "OS type $type located for $^O" );
+ }
+ else {
+ pass( "OS type not yet listed for $^O" );
+ }
+}
Modified: trunk/libextutils-cbuilder-perl/t/01-basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/01-basic.t?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/01-basic.t (original)
+++ trunk/libextutils-cbuilder-perl/t/01-basic.t Sat Dec 11 13:14:45 2010
@@ -12,7 +12,7 @@
use ExtUtils::CBuilder;
use File::Spec;
-# TEST doesn't like extraneous output
+# TEST does not like extraneous output
my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
my ($source_file, $object_file, $lib_file);
Modified: trunk/libextutils-cbuilder-perl/t/02-link.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/02-link.t?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/02-link.t (original)
+++ trunk/libextutils-cbuilder-perl/t/02-link.t Sat Dec 11 13:14:45 2010
@@ -12,7 +12,7 @@
use ExtUtils::CBuilder;
use File::Spec;
-# TEST doesn't like extraneous output
+# TEST does not like extraneous output
my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
my ($source_file, $object_file, $exe_file);
@@ -33,10 +33,9 @@
$source_file = File::Spec->catfile('t', 'compilet.c');
{
- local *FH;
- open FH, "> $source_file" or die "Can't create $source_file: $!";
- print FH "int main(void) { return 11; }\n";
- close FH;
+ open my $FH, "> $source_file" or die "Can't create $source_file: $!";
+ print $FH "int main(void) { return 11; }\n";
+ close $FH;
}
ok -e $source_file, "generated '$source_file'";
@@ -86,8 +85,13 @@
my $cmd = shift;
my $ec;
if ($^O eq 'VMS') {
+ # Preserve non-posixified status and don't bit shift the result
+ # because we're running under "use vmsish";
$ec = system("mcr $cmd");
+ return $ec;
}
- $ec = system($cmd);
- return $ec == -1 ? -1 : $ec >> 8;
+ else {
+ $ec = system($cmd);
+ return $ec == -1 ? -1 : $ec >> 8;
+ }
}
Modified: trunk/libextutils-cbuilder-perl/t/03-cplusplus.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/03-cplusplus.t?rev=65736&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/03-cplusplus.t (original)
+++ trunk/libextutils-cbuilder-perl/t/03-cplusplus.t Sat Dec 11 13:14:45 2010
@@ -12,7 +12,7 @@
use ExtUtils::CBuilder;
use File::Spec;
-# TEST doesn't like extraneous output
+# TEST does not like extraneous output
my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
my ($source_file, $object_file, $lib_file);
@@ -32,10 +32,9 @@
$source_file = File::Spec->catfile('t', 'compilet.cc');
{
- local *FH;
- open FH, "> $source_file" or die "Can't create $source_file: $!";
- print FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
- close FH;
+ open my $FH, "> $source_file" or die "Can't create $source_file: $!";
+ print $FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
+ close $FH;
}
ok -e $source_file, "source file '$source_file' created";
More information about the Pkg-perl-cvs-commits
mailing list