From: Graham Knop Date: Thu, 15 Sep 2016 04:51:23 +0000 (-0400) Subject: update EUHC X-Git-Tag: v0.32~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FClass-C3.git;a=commitdiff_plain;h=9f7312b9a103ec90b6095809786ed0ac0aadd645 update EUHC --- diff --git a/Changes b/Changes index aaf36d7..e5bf80f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Perl extension Class::C3. + - update bundled ExtUtils::HasCompiler to 0.016 + 0.31 - 2016-04-19 - update bundled ExtUtils::HasCompiler to 0.013 to fix possible false negative (RT#113635) diff --git a/inc/ExtUtils/HasCompiler.pm b/inc/ExtUtils/HasCompiler.pm index b767232..7eba9fd 100644 --- a/inc/ExtUtils/HasCompiler.pm +++ b/inc/ExtUtils/HasCompiler.pm @@ -1,5 +1,5 @@ package ExtUtils::HasCompiler; -$ExtUtils::HasCompiler::VERSION = '0.013'; +$ExtUtils::HasCompiler::VERSION = '0.016'; use strict; use warnings; @@ -10,10 +10,10 @@ our %EXPORT_TAGS = (all => \@EXPORT_OK); use Config; use Carp 'carp'; use File::Basename 'basename'; -use File::Spec::Functions qw/catfile catdir/; +use File::Spec::Functions qw/catfile catdir rel2abs/; use File::Temp qw/tempdir tempfile/; -my $tempdir = tempdir(CLEANUP => 1); +my $tempdir = tempdir('HASCOMPILERXXXX', CLEANUP => 1, DIR => '.'); my $loadable_object_format = <<'END'; #define PERL_NO_GET_CONTEXT @@ -68,10 +68,12 @@ my %prelinking = map { $_ => 1 } qw/MSWin32 VMS aix/; sub can_compile_loadable_object { my %args = @_; + my $output = $args{output} || \*STDOUT; + my $config = $args{config} || 'ExtUtils::HasCompiler::Config'; return if not $config->get('usedl'); - my ($source_handle, $source_name) = tempfile(DIR => $tempdir, SUFFIX => '.c', UNLINK => 1); + my ($source_handle, $source_name) = tempfile('TESTXXXX', DIR => $tempdir, SUFFIX => '.c', UNLINK => 1); my $basename = basename($source_name, '.c'); my $shortname = '_Loadable' . $counter++; @@ -122,11 +124,11 @@ sub can_compile_loadable_object { push @extra, qq{"-L$incdir"}, '-lperl', $perllibs; } push @commands, qq{$cc $ccflags $optimize "-I$incdir" $cccdlflags -c $source_name -o $object_file}; - push @commands, qq{$cc $optimize $object_file -o $loadable_object $lddlflags @extra}; + push @commands, qq{$ld $optimize $object_file -o $loadable_object $lddlflags @extra}; } for my $command (@commands) { - print "$command\n" if not $args{quiet}; + print $output "$command\n" if not $args{quiet}; system $command and do { carp "Couldn't execute $command: $!"; return }; } @@ -135,7 +137,7 @@ sub can_compile_loadable_object { require DynaLoader; local @DynaLoader::dl_require_symbols = "boot_$basename"; - my $handle = DynaLoader::dl_load_file(File::Spec->rel2abs($loadable_object), 0); + my $handle = DynaLoader::dl_load_file(rel2abs($loadable_object), 0); if ($handle) { my $symbol = DynaLoader::dl_find_symbol($handle, "boot_$basename") or do { carp "Couldn't find boot symbol for $basename"; return }; my $compilet = DynaLoader::dl_install_xsub('__ANON__::__ANON__', $symbol, $source_name); @@ -171,7 +173,7 @@ ExtUtils::HasCompiler - Check for the presence of a compiler =head1 VERSION -version 0.013 +version 0.016 =head1 DESCRIPTION