Skip to content

Commit

Permalink
MakeMaker.pm: Try and be smarter about compiler options
Browse files Browse the repository at this point in the history
* (Try) to support ActivePerl builds
  • Loading branch information
jacquesg committed Jul 5, 2014
1 parent ec0500e commit bca58c7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions inc/MakeMaker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,25 @@ if ($is_solaris) {
if ($is_gcc) {
# gcc-like compiler
$ccflags .= ' -Wall -Wno-unused-variable -Wdeclaration-after-statement';
$ccflags .= ' -Wall -Wno-unused-variable';
# clang compiler is pedantic!
if ($is_osx) {
$ccflags .= ' -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-function';
# clang masquerading as gcc
if ($Config{gccversion} =~ /LLVM/) {
$ccflags .= ' -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-function';
}
}
if ($is_solaris) {
$ccflags .= ' -std=c99';
}
# building with a 32-bit perl on a 64-bit OS may require this (supported by cc and gcc-like compilers,
# excluding some ARM toolchains)
if ($Config{ptrsize} == 4 && $Config{archname} !~ /^armv/) {
$ccflags .= ' -m32';
}
} elsif ($is_sunpro) {
# probably the SunPro compiler
$def .= ' -D_STDC_C99';
Expand All @@ -169,14 +178,6 @@ if ($is_gcc) {
$ccflags .= ' -erroff=E_EMPTY_DECLARATION -erroff=E_STATEMENT_NOT_REACHED';
}
# building with a 32-bit perl on a 64-bit OS may require this (supported by cc and gcc-like compilers,
# excluding some ARM toolchains)
if ($Config{gccversion} || $Config{gccversion}) {
if ($Config{ptrsize} == 4 && $Config{archname} !~ /^armv/) {
$ccflags .= ' -m32';
}
}
# there are no atomic primitives for the Sun Pro compiler in libgit2, so even if pthreads is available
# and perl has been built with threads support, libgit2 cannot use threads under said compiler
if ($Config{usethreads} && !$is_sunpro) {
Expand Down

0 comments on commit bca58c7

Please sign in to comment.