Skip to content

Commit

Permalink
Overcome deficiency in EU::CG where clang++ should be compiler for Fr…
Browse files Browse the repository at this point in the history
…eeBSD v10+
  • Loading branch information
daoswald committed Aug 14, 2014
1 parent 9e9f2b0 commit 20f3182
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions inc/ILCPPConfig/CompilerGuess.pm
Expand Up @@ -13,23 +13,32 @@ our $VERSION = '0.01';
# to Inline::CPP's Makefile.PL.

sub guess_compiler {

my( $cc_guess, $libs_guess, $guesser, %configuration );

$guesser = ExtUtils::CppGuess->new;
%configuration = $guesser->module_build_options;
if( $guesser->is_gcc ) {
$cc_guess = 'g++';
if( $Config::Config{osname} eq 'freebsd'
&& $Config::Config{osvers} =~ /^(\d+)/
&& $1 >= 10
){
$cc_guess = 'clang++';
$libs_guess = '-lc++';
}
elsif ( $guesser->is_msvc ) {
$cc_guess = 'cl';
else {
$guesser = ExtUtils::CppGuess->new;
%configuration = $guesser->module_build_options;
if( $guesser->is_gcc ) {
$cc_guess = 'g++';
}
elsif ( $guesser->is_msvc ) {
$cc_guess = 'cl';
}

$cc_guess .= $configuration{extra_compiler_flags};
$libs_guess = $configuration{extra_linker_flags};

( $cc_guess, $libs_guess )
= map { _trim_whitespace($_) } ( $cc_guess, $libs_guess );
}

$cc_guess .= $configuration{extra_compiler_flags};
$libs_guess = $configuration{extra_linker_flags};

( $cc_guess, $libs_guess )
= map { _trim_whitespace($_) } ( $cc_guess, $libs_guess );

return ( $cc_guess, $libs_guess );
}

Expand Down

0 comments on commit 20f3182

Please sign in to comment.