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 2011/07/01 08:11:18 UTC

[lucy-commits] svn commit: r1141823 - in /incubator/lucy/branches/0.1: ./ perl/buildlib/Lucy/Build.pm

Author: marvin
Date: Fri Jul  1 06:11:18 2011
New Revision: 1141823

URL: http://svn.apache.org/viewvc?rev=1141823&view=rev
Log:
LUCY-169 Clean up better after MSVC.

ExtUtils::CBuilder tends to leave a lot of extra files around when working
with MSVC.  When working with CBuilder directly (as opposed to relying on
Module::Build to manage CBuilder), you have to clean up these files manually.

Modified:
    incubator/lucy/branches/0.1/   (props changed)
    incubator/lucy/branches/0.1/perl/buildlib/Lucy/Build.pm

Propchange: incubator/lucy/branches/0.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul  1 06:11:18 2011
@@ -1 +1 @@
-/incubator/lucy/trunk:1126586,1134011,1134355,1134472,1134843-1134848,1134953,1134956,1139709,1139711,1139714,1140001,1140287,1140296,1140387,1140393,1140400,1140418,1140420,1140422,1140437,1140440,1140964
+/incubator/lucy/trunk:1126586,1134011,1134355,1134472,1134843-1134848,1134953,1134956,1139709,1139711,1139714,1140001,1140287,1140296,1140387,1140393,1140400,1140418,1140420,1140422,1140437,1140440,1140894,1140964

Modified: incubator/lucy/branches/0.1/perl/buildlib/Lucy/Build.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/0.1/perl/buildlib/Lucy/Build.pm?rev=1141823&r1=1141822&r2=1141823&view=diff
==============================================================================
--- incubator/lucy/branches/0.1/perl/buildlib/Lucy/Build.pm (original)
+++ incubator/lucy/branches/0.1/perl/buildlib/Lucy/Build.pm Fri Jul  1 06:11:18 2011
@@ -525,11 +525,14 @@ sub ACTION_compile_custom_xs {
     push @$c_files, @{ $self->rscan_dir( $SNOWSTEM_SRC_DIR,    qr/\.c$/ ) };
     push @$c_files, @{ $self->rscan_dir( $SNOWSTOP_SRC_DIR,    qr/\.c$/ ) };
     for my $c_file (@$c_files) {
-        my $o_file = $c_file;
-        $o_file =~ s/\.c/$Config{_o}/;
+        my $o_file   = $c_file;
+        my $ccs_file = $c_file;
+        $o_file   =~ s/\.c/$Config{_o}/;
+        $ccs_file =~ s/\.c/.ccs/;
         push @objects, $o_file;
         next if $self->up_to_date( $c_file, $o_file );
         $self->add_to_cleanup($o_file);
+        $self->add_to_cleanup($ccs_file);
         $cbuilder->compile(
             source               => $c_file,
             extra_compiler_flags => $self->extra_ccflags,
@@ -588,6 +591,16 @@ sub ACTION_compile_custom_xs {
         utime( (time) x 2, $bs_file );    # touch
     }
 
+    # Clean up after CBuilder under MSVC.
+    $self->add_to_cleanup('compilet*');
+    $self->add_to_cleanup('*.ccs');
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy.ccs' ) );
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy.def' ) );
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy_def.old' ) );
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy.exp' ) );
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy.lib' ) );
+    $self->add_to_cleanup( catfile( 'lib', 'Lucy.lds' ) );
+
     # .o => .(a|bundle)
     my $lib_file = catfile( $archdir, "Lucy.$Config{dlext}" );
     if ( !$self->up_to_date( [ @objects, $AUTOGEN_DIR ], $lib_file ) ) {