Hey

This attach is a simple patch to support an anonymous array of
directories where to search for C code. It got handy.

Hope it can be applied, as I am already using it... O:-)

Cheers
ambs
-- 
Alberto Simões
Only in Module-Build-mine/: Build
Only in Module-Build-mine/: MYMETA.yml
Only in Module-Build-mine/: Makefile
Only in Module-Build-mine/: _build
Only in Module-Build-mine/: blib
diff -rc Module-Build-0.3603/lib/Module/Build/API.pod 
Module-Build-mine/lib/Module/Build/API.pod
*** Module-Build-0.3603/lib/Module/Build/API.pod        2010-01-19 
03:30:59.000000000 +0000
--- Module-Build-mine/lib/Module/Build/API.pod  2010-02-13 14:56:14.000000000 
+0000
***************
*** 181,186 ****
--- 181,191 ----
  directory will be added to the search path during the compilation and
  linking phases of any C or XS files.
  
+ [version ...]
+ 
+ A list of directories can be supplied using an anonymous array
+ reference of strings.
+ 
  =item conflicts
  
  [version 0.07]
diff -rc Module-Build-0.3603/lib/Module/Build/Base.pm 
Module-Build-mine/lib/Module/Build/Base.pm
*** Module-Build-0.3603/lib/Module/Build/Base.pm        2010-01-19 
03:30:59.000000000 +0000
--- Module-Build-mine/lib/Module/Build/Base.pm  2010-02-13 15:03:52.000000000 
+0000
***************
*** 2728,2738 ****
    my $p = $self->{properties};
    return unless $p->{c_source};
  
!   push @{$p->{include_dirs}}, $p->{c_source};
  
-   my $files = $self->rscan_dir($p->{c_source}, 
file_qr('\.c(c|p|pp|xx|\+\+)?$'));
    foreach my $file (@$files) {
!     push @{$p->{objects}}, $self->compile_c($file);
    }
  }
  
--- 2728,2746 ----
    my $p = $self->{properties};
    return unless $p->{c_source};
  
!   my $files;
!   if (ref($p->{c_source}) eq "ARRAY") {
!       push @{$p->{include_dirs}}, @{$p->{c_source}};
!       for my $path (@{$p->{c_source}}) {
!           push @$files, @{ $self->rscan_dir($path, 
file_qr('\.c(c|p|pp|xx|\+\+)?$')) };
!       }
!   } else {
!       push @{$p->{include_dirs}}, $p->{c_source};
!       $files = $self->rscan_dir($p->{c_source}, 
file_qr('\.c(c|p|pp|xx|\+\+)?$'));
!   }
  
    foreach my $file (@$files) {
!       push @{$p->{objects}}, $self->compile_c($file);
    }
  }
  

Reply via email to