You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/12/13 03:27:50 UTC

[lucy-commits] [2/12] git commit: refs/heads/chaz_compiler_flags - Use charmonizer's EXTRA_CFLAGS in Perl bindings.

Use charmonizer's EXTRA_CFLAGS in Perl bindings.

Start feeding the EXTRA_CFLAGS key generated by charmonizer, and migrate
the tests for LUCY_DEBUG and LUCY_VALGRIND to set extra compiler flags
from the Perl bindings to charmonizer.c.

As of this commit, flags which move to Charmonizer are only used when
compiling .c files from the `clownfish_params => source` dirs, and are
no longer supplied when compiling .xs binding files.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/39c58635
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/39c58635
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/39c58635

Branch: refs/heads/chaz_compiler_flags
Commit: 39c5863504994e742e9750739850212ac159651c
Parents: 2dbf927
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Dec 12 13:49:25 2012 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Dec 12 17:12:39 2012 -0800

----------------------------------------------------------------------
 .../compiler/perl/lib/Clownfish/CFC/Perl/Build.pm  |    6 +++---
 clownfish/runtime/perl/buildlib/Clownfish/Build.pm |    8 --------
 perl/buildlib/Lucy/Build.pm                        |    8 --------
 3 files changed, 3 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/39c58635/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index 4bfb0e1..7f21b39 100644
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -391,11 +391,11 @@ sub ACTION_compile_custom_xs {
         push @$c_files, @{ $self->rscan_dir( $source_dir, qr/\.c$/ ) };
     }
     # Compile with -fvisibility=hidden on GCC >= 4.0
-    my $cc_flags = $self->extra_compiler_flags;
+    my $extra_cflags = $self->charmony("EXTRA_CFLAGS");
     if ( $self->config('gccversion') && $Config{dlext} ne 'dll' ) {
         my @version_nums = split( /\./, $self->config('gccversion') );
         if ( $version_nums[0] >= 4 ) {
-            $cc_flags = [ @$cc_flags, '-fvisibility=hidden' ];
+            $extra_cflags .= ' -fvisibility=hidden';
         }
     }
     for my $c_file (@$c_files) {
@@ -409,7 +409,7 @@ sub ACTION_compile_custom_xs {
         $self->add_to_cleanup($ccs_file);
         $cbuilder->compile(
             source               => $c_file,
-            extra_compiler_flags => $cc_flags,
+            extra_compiler_flags => $extra_cflags,
             include_dirs         => $self->include_dirs,
             object_file          => $o_file,
         );

http://git-wip-us.apache.org/repos/asf/lucy/blob/39c58635/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/buildlib/Clownfish/Build.pm b/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
index 454ac05..c5c58f8 100644
--- a/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
@@ -63,14 +63,6 @@ sub new {
         if ( $Config{osname} =~ /openbsd/i && !$Config{usethreads} ) {
             push @$extra_ccflags, '-DLUCY_NOTHREADS';
         }
-        if ( defined $ENV{LUCY_VALGRIND} ) {
-            push @$extra_ccflags, qw( -DLUCY_VALGRIND -fno-inline-functions );
-        }
-        elsif ( defined $ENV{LUCY_DEBUG} ) {
-            push @$extra_ccflags, qw(
-                -DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros
-            );
-        }
     }
     $self->extra_compiler_flags(@$extra_ccflags);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/39c58635/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index 59dac46..550a27e 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -68,14 +68,6 @@ sub new {
         if ( $Config{osname} =~ /openbsd/i && !$Config{usethreads} ) {
             push @$extra_ccflags, '-DLUCY_NOTHREADS';
         }
-        if ( defined $ENV{LUCY_VALGRIND} ) {
-            push @$extra_ccflags, qw( -DLUCY_VALGRIND -fno-inline-functions );
-        }
-        elsif ( defined $ENV{LUCY_DEBUG} ) {
-            push @$extra_ccflags, qw(
-                -DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros
-            );
-        }
     }
     $self->extra_compiler_flags(@$extra_ccflags);