[svn:ponie] rev 321 - trunk

[email protected] 9 Jul 2005 17:58:25 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
Author: nicholas
Date: Sat Jul  9 10:58:24 2005
New Revision: 321

Modified:
   trunk/Configure.pl
Log:
Need to filter out wrong dependencies from the perl makefile, caused by some
versions of gcc assuming that #line directives mean real files to depend on.


Modified: trunk/Configure.pl
==============================================================================
--- trunk/Configure.pl	(original)
+++ trunk/Configure.pl	Sat Jul  9 10:58:24 2005
@@ -109,7 +109,8 @@ unless (-e 'config.sh' && -e 'config.h' 
     my @lib_path = ("$dir/parrot/blib/lib", "$dir/src/pmc");
 
     open (FH, "config.sh") or die $!;
-    undef $/; $_ = <FH>;
+    local $/;
+    $_ = <FH>;
     close FH or die $!;
 
     my %munge;
@@ -143,3 +144,20 @@ unless (-e 'config.sh' && -e 'config.h' 
     system ('sh','Configure','-S') && die "error";
 }
 
+my $firstmakefile = $Config{firstmakefile};
+unless (-e $firstmakefile) {
+    system ("make depend") && die "error";
+
+    open (FH, $firstmakefile) or die $!;
+    # When building dependencies some gccs manage to notice all the #line
+    # directives in parrot/platform.h and think that they are real files to
+    # depend on.
+    my @lines = grep {!m#: config/gen/platform/generic#} <FH>;
+    close FH or die $!;
+    
+    rename $firstmakefile, "$firstmakefile.before";
+
+    open (FH, ">$firstmakefile") or die $!;
+    print FH @lines or die $!;
+    close FH or die $!;
+}