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 <[email protected]> Authored: Wed Oct 29 22:58:51 2014 +0100 Committer: Nick Wellnhofer <[email protected]> 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 "
