This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
For gcc compiler enable compile warnings
authorPali <pali@cpan.org>
Tue, 11 Jun 2019 09:49:22 +0000 (11:49 +0200)
committerNicolas R <atoomic@cpan.org>
Fri, 21 Jun 2019 20:26:59 +0000 (16:26 -0400)
(cherry picked from commit b6d631d5a258ad6b22ec8fe038b1db9d4ef18908)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/Makefile.PL

index fc0ff09..b96af5f 100644 (file)
@@ -17,6 +17,7 @@ require 5.003;
 
 use strict;
 use ExtUtils::MakeMaker;
+use Config;
 
 use vars '%opt';  # needs to be global, and we can't use 'our'
 
@@ -86,6 +87,12 @@ sub configure
   die 'failed to extract $VERSION from PPPort_pm.PL' if not $version;
   close FH;
 
+  if ($Config{gccversion}) {
+    my $define = '-W -Wall';
+    $define .= ' -Wdeclaration-after-statement' if $Config{gccversion} =~ /^(\d+\.\d+)\./ && $1 >= 3.4;
+    push @moreopts, DEFINE => $define;
+  }
+
   return {
     C        => \@C_FILES,
     XS       => { 'RealPPPort.xs' => 'RealPPPort.c' },