diff options
author | nonaka <nonaka@pkgsrc.org> | 2016-08-04 14:18:15 +0000 |
---|---|---|
committer | nonaka <nonaka@pkgsrc.org> | 2016-08-04 14:18:15 +0000 |
commit | f1fdb6e4b0888ae02ceb19c7ff5a29b534bb82a4 (patch) | |
tree | 3f0c1dec8f76f06af5eb343b5cb336be1dc103d2 /www/ap2-perl | |
parent | 1903d71d96494d1474ef1b3fbce07c3662774534 (diff) | |
download | pkgsrc-f1fdb6e4b0888ae02ceb19c7ff5a29b534bb82a4.tar.gz |
PR/51359: Automatic compiler flags for gcc 5 and clang.
Diffstat (limited to 'www/ap2-perl')
-rw-r--r-- | www/ap2-perl/distinfo | 3 | ||||
-rw-r--r-- | www/ap2-perl/patches/patch-lib_Apache2_Build.pm | 48 |
2 files changed, 50 insertions, 1 deletions
diff --git a/www/ap2-perl/distinfo b/www/ap2-perl/distinfo index 9128e71c2cf..b1c8e96cd67 100644 --- a/www/ap2-perl/distinfo +++ b/www/ap2-perl/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.20 2015/11/04 02:46:48 agc Exp $ +$NetBSD: distinfo,v 1.21 2016/08/04 14:18:15 nonaka Exp $ SHA1 (mod_perl-2.0.9.tar.gz) = 5de3018214da21de186d758a429d5c78f827caa5 RMD160 (mod_perl-2.0.9.tar.gz) = f4be60f1b4f4b5645aa7e97ad09d6b1871611bd4 SHA512 (mod_perl-2.0.9.tar.gz) = 421d385f0d5d04cbe8c1e9559960eea86a017fa1bed88e614009143550baf852e2345001faff1fb849d9b3e6383786e0011f45ebc3e7d26ad57651fbad4e2f2c Size (mod_perl-2.0.9.tar.gz) = 3846584 bytes +SHA1 (patch-lib_Apache2_Build.pm) = b2dd179612272ff6facb0280c00d9589aa93dad6 SHA1 (patch-src_modules_perl_modperl_common_util.h) = a5fd094351fef2994b67c6c70abc18c772aec532 diff --git a/www/ap2-perl/patches/patch-lib_Apache2_Build.pm b/www/ap2-perl/patches/patch-lib_Apache2_Build.pm new file mode 100644 index 00000000000..f1de4b75ee8 --- /dev/null +++ b/www/ap2-perl/patches/patch-lib_Apache2_Build.pm @@ -0,0 +1,48 @@ +$NetBSD: patch-lib_Apache2_Build.pm,v 1.1 2016/08/04 14:18:15 nonaka Exp $ + +from mod_perl r1733566. + +----- +Automatic compiler flags for gcc 5 and clang + +To make compilation easier on gcc5/clang hosts, this patch automatically selects the appropriate c89 option, when modperl is being built with either gcc 5 or clang. + +Tested by the author on Ubuntu 15.10 (with gcc 5.2.1), Fedora 23 (with gcc 5.3.1) and FreeBSD 10.2 (with clang). + +Thanks to Klaus S. Madsen <ksm@jobindex.dk> for the patch. +----- + +--- lib/Apache2/Build.pm.orig 2015-06-19 05:13:53.000000000 +0900 ++++ lib/Apache2/Build.pm 2016-07-26 17:27:03.000000000 +0900 +@@ -611,6 +611,14 @@ sub ap_ccopts { + $ccopts .= " -DMP_TRACE"; + } + ++ if ($self->has_gcc_version('5.0.0') && $ccopts !~ /-fgnu89-inline/) { ++ $ccopts .= " -fgnu89-inline"; ++ } ++ ++ if ($self->has_clang && $ccopts !~ /-std=gnu89/) { ++ $ccopts .= " -std=gnu89"; ++ } ++ + # make sure apr.h can be safely included + # for example Perl's included -D_GNU_SOURCE implies + # -D_LARGEFILE64_SOURCE on linux, but this won't happen on +@@ -641,6 +649,16 @@ sub has_gcc_version { + return cmp_tuples(\@tuples, \@r_tuples) == 1; + } + ++sub has_clang { ++ my $self = shift; ++ ++ my $has_version = $self->perl_config('gccversion'); ++ ++ return 0 unless $has_version; ++ ++ return $has_version =~ m/Clang/; ++} ++ + sub cmp_tuples { + my ($num_a, $num_b) = @_; + |