diff options
Diffstat (limited to 'gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm')
-rw-r--r-- | gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm b/gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm index 60b2f432dfb..9f8427f6de2 100644 --- a/gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm +++ b/gnu/usr.bin/perl/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm @@ -1,5 +1,4 @@ package ExtUtils::CBuilder::Base; -$ExtUtils::CBuilder::Base::VERSION = '0.280225'; use strict; use warnings; use File::Spec; @@ -10,6 +9,8 @@ use Text::ParseWords; use IPC::Cmd qw(can_run); use File::Temp qw(tempfile); +our $VERSION = '0.280230'; # VERSION + # More details about C/C++ compilers: # http://developers.sun.com/sunstudio/documentation/product/compiler.jsp # http://gcc.gnu.org/ @@ -45,16 +46,26 @@ sub new { if defined $ENV{LDFLAGS}; unless ( exists $self->{config}{cxx} ) { - my ($ccpath, $ccbase, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/); + + my ($ccbase, $ccpath, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/); + + ## If the path is just "cc", fileparse returns $ccpath as "./" + $ccpath = "" if $self->{config}{cc} =~ /^$ccbase$ccsfx$/; + foreach my $cxx (@{$cc2cxx{$ccbase}}) { - if( can_run( File::Spec->catfile( $ccpath, $cxx, $ccsfx ) ) ) { - $self->{config}{cxx} = File::Spec->catfile( $ccpath, $cxx, $ccsfx ); + my $cxx1 = File::Spec->catfile( $ccpath, $cxx . $ccsfx); + + if( can_run( $cxx1 ) ) { + $self->{config}{cxx} = $cxx1; last; } - if( can_run( File::Spec->catfile( $cxx, $ccsfx ) ) ) { - $self->{config}{cxx} = File::Spec->catfile( $cxx, $ccsfx ); + my $cxx2 = $cxx . $ccsfx; + + if( can_run( $cxx2 ) ) { + $self->{config}{cxx} = $cxx2; last; } + if( can_run( $cxx ) ) { $self->{config}{cxx} = $cxx; last; |