Skip to content

Commit be0e4ae

Browse files
committed
Fix finding the correct cplusplus compiler
ExtUtils::CBuilder was using a slightly maverick method for finding the matching cplusplus compiler to the c compiler used to build perl. On a Linux system with a perl built with the Oracle Developer cc cc='/opt/oracle/developerstudio12.6/bin/cc' Errors were observed: "c++: error: unrecognized command line option ‘-KPIC’; did you mean ‘-fPIC’?" The cplusplus command for Oracle Developer suite is CC not c++ and the detection was picking up the system c++ (g++). If there is a ccpath, the code should exhaust all the options and not fail through to using no path.
1 parent 514c4e2 commit be0e4ae

File tree

14 files changed

+34
-27
lines changed

14 files changed

+34
-27
lines changed

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Perl::OSType qw/os_type/;
77

88
use warnings;
99
use strict;
10-
our $VERSION = '0.280240'; # VERSION
10+
our $VERSION = '0.280241'; # VERSION
1111
our @ISA;
1212

1313
# We only use this once - don't waste a symbol table entry on it.

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use Text::ParseWords;
99
use IPC::Cmd qw(can_run);
1010
use File::Temp qw(tempfile);
1111

12-
our $VERSION = '0.280240'; # VERSION
12+
our $VERSION = '0.280241'; # VERSION
1313

1414
# More details about C/C++ compilers:
1515
# http://developers.sun.com/sunstudio/documentation/product/compiler.jsp
@@ -51,24 +51,31 @@ sub new {
5151

5252
## If the path is just "cc", fileparse returns $ccpath as "./"
5353
$ccpath = "" if $self->{config}{cc} =~ /^\Q$ccbase$ccsfx\E$/;
54-
54+
5555
foreach my $cxx (@{$cc2cxx{$ccbase}}) {
56-
my $cxx1 = File::Spec->catfile( $ccpath, $cxx . $ccsfx);
5756

58-
if( can_run( $cxx1 ) ) {
59-
$self->{config}{cxx} = $cxx1;
60-
last;
61-
}
62-
my $cxx2 = $cxx . $ccsfx;
57+
if ( $ccpath ) {
58+
my $cxx1 = File::Spec->catfile( $ccpath, $cxx . $ccsfx);
59+
60+
if( can_run( $cxx1 ) ) {
61+
$self->{config}{cxx} = $cxx1;
62+
last;
63+
}
6364

64-
if( can_run( $cxx2 ) ) {
65-
$self->{config}{cxx} = $cxx2;
66-
last;
6765
}
66+
else {
67+
my $cxx2 = $cxx . $ccsfx;
68+
69+
if( can_run( $cxx2 ) ) {
70+
$self->{config}{cxx} = $cxx2;
71+
last;
72+
}
73+
74+
if( can_run( $cxx ) ) {
75+
$self->{config}{cxx} = $cxx;
76+
last;
77+
}
6878

69-
if( can_run( $cxx ) ) {
70-
$self->{config}{cxx} = $cxx;
71-
last;
7279
}
7380
}
7481
unless ( exists $self->{config}{cxx} ) {

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use warnings;
44
use strict;
55
use ExtUtils::CBuilder::Base;
66

7-
our $VERSION = '0.280240'; # VERSION
7+
our $VERSION = '0.280241'; # VERSION
88
our @ISA = qw(ExtUtils::CBuilder::Base);
99

1010
sub link_executable {

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use warnings;
44
use strict;
55
use ExtUtils::CBuilder::Base;
66

7-
our $VERSION = '0.280240'; # VERSION
7+
our $VERSION = '0.280241'; # VERSION
88
our @ISA = qw(ExtUtils::CBuilder::Base);
99

1010
use File::Spec::Functions qw(catfile catdir);

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use File::Spec;
88
use ExtUtils::CBuilder::Base;
99
use IO::File;
1010

11-
our $VERSION = '0.280240'; # VERSION
11+
our $VERSION = '0.280241'; # VERSION
1212
our @ISA = qw(ExtUtils::CBuilder::Base);
1313

1414
=begin comment

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ExtUtils::CBuilder::Platform::Windows::BCC;
22

3-
our $VERSION = '0.280240'; # VERSION
3+
our $VERSION = '0.280241'; # VERSION
44

55
use strict;
66
use warnings;

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ExtUtils::CBuilder::Platform::Windows::GCC;
22

3-
our $VERSION = '0.280240'; # VERSION
3+
our $VERSION = '0.280241'; # VERSION
44

55
use warnings;
66
use strict;

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ExtUtils::CBuilder::Platform::Windows::MSVC;
22

3-
our $VERSION = '0.280240'; # VERSION
3+
our $VERSION = '0.280241'; # VERSION
44

55
use warnings;
66
use strict;

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use ExtUtils::CBuilder::Platform::Unix;
66
use File::Spec;
77

8-
our $VERSION = '0.280240'; # VERSION
8+
our $VERSION = '0.280241'; # VERSION
99
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
1010

1111
sub need_prelink { 1 }

dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use File::Spec;
66
use ExtUtils::CBuilder::Platform::Unix;
77
use Config;
88

9-
our $VERSION = '0.280240'; # VERSION
9+
our $VERSION = '0.280241'; # VERSION
1010
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
1111

1212
# The Android linker will not recognize symbols from

0 commit comments

Comments
 (0)