Update of /cvsroot/leaf/src/bering-uclibc/buildtool
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20047

Modified Files:
        buildpacket.pl 
Log Message:
added workaround for "include" issue on some systems


Index: buildpacket.pl
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc/buildtool/buildpacket.pl,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** buildpacket.pl      30 Nov 2005 23:09:08 -0000      1.34
--- buildpacket.pl      7 May 2006 16:23:46 -0000       1.35
***************
*** 867,871 ****
        }
  }
! 
  sub readFile($) {
        my ($filename) = @_;
--- 867,871 ----
        }
  }
! sub readFile($) ;
  sub readFile($) {
        my ($filename) = @_;
***************
*** 879,885 ****
--- 879,897 ----
        my $hInputFile     = Symbol::gensym();
        open($hInputFile,$filename) or die "Could not open file $filename\n";
+       my ($volume,$destination_path,$file) = File::Spec->splitpath( $filename 
);      
  
        $line = '';
        while($line = <$hInputFile>){
+       
+               # Replace #include <filename> with the contents of "filename"
+               if ($line=~ /#\s*include\s*\<([^\>]*)\>/ig) {
+                       # avoid endless loops 
+                       if ($filename ne $1) {
+                               my $includedFile = 
readFile(File::Spec->catfile($destination_path,$1));
+                               $line =~ 
s/#\s*include\s*\<[^\>]*\>/$includedFile/igs;
+                       }
+               }
+ 
+       
                push(@{$lines},$line);
        }
***************
*** 893,900 ****
        
        my $config = readFile($filename);
- 
-       my ($volume,$destination_path,$file) = File::Spec->splitpath( $filename 
);
-       # Replace #include <filename> with <<inlcude filename>>
-       $config =~ s/#\s*include\s*\<([^\>]*)\>/\<\<include 
$destination_path\/$1\>\>/igs;
        my $p_h_pkgcfg = new Config::General(
                        "-String" => $config,
--- 905,908 ----



_______________________________________________
leaf-cvs-commits mailing list
leaf-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to