diff options
Diffstat (limited to 'dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm')
-rw-r--r-- | dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm index 60b2f432df..511e5fef0a 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm @@ -1,5 +1,5 @@ package ExtUtils::CBuilder::Base; -$ExtUtils::CBuilder::Base::VERSION = '0.280225'; +$ExtUtils::CBuilder::Base::VERSION = '0.280226'; use strict; use warnings; use File::Spec; @@ -45,16 +45,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; |