Open eserte opened 9 years ago
thanks, I try to change g++ to c++
Windows MinGW have only g++. What is best way?
I see that you try to pick the right c++ compiler depending on the ccname
config value: https://github.com/yuki-kimoto/Rstats/blob/master/Makefile.PL#L10
Unfortunately, ccname is gcc even on FreeBSD 10. Looking at perl's Configure
script it seems that it's just checked whether __GNUC__
is defined (and __INTEL_COMPILER
is undefined) to set ccname=gcc
. But the __GNUC__
macro is also defined in clang, so ccname
is here also set to gcc
!
A possible approach is to define specific operating system rules. So you could do something like
$cc = $^O eq 'MSWin32' ? $cpp_compilers->{$Config{ccname}} : 'c++';
Or the other way around:
$cc = $^O eq 'freebsd' ? 'c++' : $cpp_compilers->{$Config{ccname}};
thanks, I try this.
Compilation now works on FreeBSD 10.1 with clang++. But for some reason tests are failing here, and just with clang, see http://analysis.cpantesters.org/solved?distv=Rstats-0.0148#conf%3Agccversion This is somewhat surprising, usually clang-compiled stuff works as well as gcc-compiled things...
Compiling fails on FreeBSD 10:
Problem is that FreeBSD 10 does not ship anymore gcc, but clang instead. Best solution probably is to not use "g++" here, but "c++" which works for both, gcc and clang systems.