lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [2/6] git commit: Remove dependency of Clownfish::CFC::Perl::Build on Charmonizer
Date Sun, 16 Feb 2014 23:20:03 GMT
Remove dependency of Clownfish::CFC::Perl::Build on Charmonizer

Add a new field 'cflags' to the 'clownfish_params' Module::Build
property to pass additional compiler flags.


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

Branch: refs/heads/cflags
Commit: b989a80a13534d26b40a60e110db3e76e61c77a8
Parents: 8e4c8f1
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Feb 16 22:13:42 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Feb 17 00:18:42 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b989a80a/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 224a5bd..8191cee 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -17,7 +17,7 @@ use strict;
 use warnings;
 
 package Clownfish::CFC::Perl::Build;
-use base qw( Clownfish::CFC::Perl::Build::Charmonic );
+use base qw( Module::Build );
 our $VERSION = '0.01';
 
 use File::Spec::Functions qw( catdir catfile curdir updir abs2rel rel2abs );
@@ -67,7 +67,7 @@ sub new {
 
     my $include_dirs = $self->include_dirs;
     push( @$include_dirs,
-        curdir(), # for ppport.h and charmony.h
+        curdir(), # for ppport.h
         catdir( $AUTOGEN_DIR, 'include' ),
     );
     $self->include_dirs($include_dirs);
@@ -371,7 +371,7 @@ sub ACTION_compile_custom_xs {
         push @$c_files, @{ $self->rscan_dir( $source_dir, qr/\.c$/ ) };
     }
     # Compile with -fvisibility=hidden on GCC >= 4.0
-    my $extra_cflags = $self->charmony("EXTRA_CFLAGS");
+    my $extra_cflags = $self->clownfish_params('cflags') || '';
     if ( $self->config('gccversion') && $Config{dlext} ne 'dll' ) {
         my @version_nums = split( /\./, $self->config('gccversion') );
         if ( $version_nums[0] >= 4 ) {
@@ -625,6 +625,11 @@ system include directories if needed.
 A string that will be prepended to the files generated by the Clownfish
 compiler.
 
+=head3 cflags
+
+A string with additional compiler flags used to compile the Clownfish .c
+files.
+
 =head1 METHODS
 
 =head2 my @path = Clownfish::CFC::Perl::Build->cf_base_path();

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b989a80a/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 6925a73..119bb36 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -26,6 +26,7 @@ package Clownfish::Build;
 # afterwards.
 use lib '../../compiler/perl/lib';
 use base qw( Clownfish::CFC::Perl::Build );
+use base qw( Clownfish::CFC::Perl::Build::Charmonic );
 no lib '../../compiler/perl/lib';
 
 our $VERSION = '0.003000';
@@ -132,6 +133,25 @@ sub ACTION_clownfish {
     $self->SUPER::ACTION_clownfish;
 }
 
+sub ACTION_compile_custom_xs {
+    my $self = shift;
+
+    # Add extra compiler flags from Charmonizer.
+    my $cf_cflags    = $self->clownfish_params('cflags');
+    my $charm_cflags = $self->charmony('EXTRA_CFLAGS');
+    if ($charm_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 ACTION_suppressions {
     my $self       = shift;
     my $LOCAL_SUPP = 'local.supp';


Mime
View raw message