You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/11/08 19:55:27 UTC

[10/11] lucy-clownfish git commit: Add Charmonizer cflags when compiling custom XS

Add Charmonizer cflags when compiling custom XS

Move the code that adds the Charmonizer cflags to
Clownfish::CFC::Perl::Build now that we have to check there for a
Charmonizer build.


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

Branch: refs/heads/perl_build_with_make
Commit: f1937bac74dd72cef0880aee550f9822502135a1
Parents: 2106b93
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Oct 29 22:58:51 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Nov 8 19:44:08 2014 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm | 11 +++++++++++
 runtime/perl/buildlib/Clownfish/Build.pm      | 21 ---------------------
 2 files changed, 11 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f1937bac/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index 705f20a..a5e824a 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -408,6 +408,17 @@ sub ACTION_compile_custom_xs {
             push @$c_files, @{ $self->rscan_dir( $source_dir, qr/\.c$/ ) };
         }
         my $extra_cflags = $self->clownfish_params('cflags');
+        if ($is_charmonic) {
+            my $charm_cflags = $self->charmony('EXTRA_CFLAGS');
+            if ($charm_cflags) {
+                if ($extra_cflags) {
+                    $extra_cflags .= " $charm_cflags";
+                }
+                else {
+                    $extra_cflags = $charm_cflags;
+                }
+            }
+        }
         for my $c_file (@$c_files) {
             my $o_file   = $c_file;
             my $ccs_file = $c_file;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f1937bac/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 5955b10..6d90d03 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -144,27 +144,6 @@ sub ACTION_clownfish {
     $self->SUPER::ACTION_clownfish;
 }
 
-sub ACTION_compile_custom_xs {
-    my $self = shift;
-
-    $self->depends_on('charmony');
-
-    # Add extra compiler flags from Charmonizer.
-    my $charm_cflags = $self->charmony('EXTRA_CFLAGS');
-    if ($charm_cflags) {
-        my $cf_cflags = $self->clownfish_params('cflags');
-        if ($cf_cflags) {
-            $cf_cflags .= " $charm_cflags";
-        }
-        else {
-            $cf_cflags = $charm_cflags;
-        }
-        $self->clownfish_params( cflags => $cf_cflags );
-    }
-
-    $self->SUPER::ACTION_compile_custom_xs;
-}
-
 sub _valgrind_base_command {
     return
           "PERL_DESTRUCT_LEVEL=2 LUCY_VALGRIND=1 valgrind "