lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] svn commit: r1137292 - /incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm
Date Sun, 19 Jun 2011 05:42:41 GMT
Author: marvin
Date: Sun Jun 19 05:42:41 2011
New Revision: 1137292

URL: http://svn.apache.org/viewvc?rev=1137292&view=rev
Log:
Refactor "charmony" build target for simplicity.

Modified:
    incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm?rev=1137292&r1=1137291&r2=1137292&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm Sun Jun 19 05:42:41 2011
@@ -159,10 +159,8 @@ sub ACTION_charmonize {
 
 # Run the charmonize executable, creating the charmony.h file.
 sub ACTION_charmony {
-    my $self          = shift;
-
+    my $self = shift;
     $self->dispatch('charmonize');
-
     return if $self->up_to_date( $CHARMONIZE_EXE_PATH, $CHARMONY_PATH );
     print "\nWriting $CHARMONY_PATH...\n\n";
 
@@ -171,20 +169,15 @@ sub ACTION_charmony {
     $self->add_to_cleanup($CHARMONY_PATH);
 
     # Prepare arguments to charmonize.
-    my $cc        = $self->config('cc');
-    my $flags     = $self->config('ccflags') . ' ' . $self->extra_ccflags;
-    my $verbosity = $ENV{DEBUG_CHARM} ? 2 : 1;
+    my $flags = $self->config('ccflags') . ' ' . $self->extra_ccflags;
     $flags =~ s/"/\\"/g;
-
+    my @command = ( $CHARMONIZE_EXE_PATH, $self->config('cc'), $flags );
+    push @command, 2 if $ENV{DEBUG_CHARM};
     if ( $ENV{CHARM_VALGRIND} ) {
-        system(   "valgrind --leak-check=yes ./$CHARMONIZE_EXE_PATH $cc "
-                . "\"$flags\" $verbosity" )
-            and die "Failed to write $CHARMONY_PATH";
-    }
-    else {
-        system("$CHARMONIZE_EXE_PATH \"$cc\" \"$flags\" $verbosity")
-            and die "Failed to write $CHARMONY_PATH: $!";
+        unshift @command, "valgrind", "--leak-check=yes";
     }
+
+    system(@command) and die "Failed to write $CHARMONY_PATH: $!";
 }
 
 # Build the charmonizer tests.



Mime
View raw message