|
1 | 1 | package ExtUtils::CBuilder::Base; |
2 | | -$ExtUtils::CBuilder::Base::VERSION = '0.280225'; |
| 2 | +$ExtUtils::CBuilder::Base::VERSION = '0.280226'; |
3 | 3 | use strict; |
4 | 4 | use warnings; |
5 | 5 | use File::Spec; |
@@ -45,16 +45,26 @@ sub new { |
45 | 45 | if defined $ENV{LDFLAGS}; |
46 | 46 |
|
47 | 47 | unless ( exists $self->{config}{cxx} ) { |
48 | | - my ($ccpath, $ccbase, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/); |
| 48 | + |
| 49 | + my ($ccbase, $ccpath, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/); |
| 50 | + |
| 51 | + ## If the path is just "cc", fileparse returns $ccpath as "./" |
| 52 | + $ccpath = "" if $self->{config}{cc} =~ /^$ccbase$ccsfx$/; |
| 53 | + |
49 | 54 | foreach my $cxx (@{$cc2cxx{$ccbase}}) { |
50 | | - if( can_run( File::Spec->catfile( $ccpath, $cxx, $ccsfx ) ) ) { |
51 | | - $self->{config}{cxx} = File::Spec->catfile( $ccpath, $cxx, $ccsfx ); |
| 55 | + my $cxx1 = File::Spec->catfile( $ccpath, $cxx . $ccsfx); |
| 56 | + |
| 57 | + if( can_run( $cxx1 ) ) { |
| 58 | + $self->{config}{cxx} = $cxx1; |
52 | 59 | last; |
53 | 60 | } |
54 | | - if( can_run( File::Spec->catfile( $cxx, $ccsfx ) ) ) { |
55 | | - $self->{config}{cxx} = File::Spec->catfile( $cxx, $ccsfx ); |
| 61 | + my $cxx2 = $cxx . $ccsfx; |
| 62 | + |
| 63 | + if( can_run( $cxx2 ) ) { |
| 64 | + $self->{config}{cxx} = $cxx2; |
56 | 65 | last; |
57 | 66 | } |
| 67 | + |
58 | 68 | if( can_run( $cxx ) ) { |
59 | 69 | $self->{config}{cxx} = $cxx; |
60 | 70 | last; |
|
0 commit comments