develooper Front page | perl.ponie.changes | Postings from March 2006

[svn:ponie] r393 - branches/5.9.3merge

From:
nnunley
Date:
March 12, 2006 07:21
Subject:
[svn:ponie] r393 - branches/5.9.3merge
Message ID:
20060312152044.CDA68CBA2B@x12.develooper.com
Author: nnunley
Date: Sun Mar 12 07:20:44 2006
New Revision: 393

Modified:
   branches/5.9.3merge/   (props changed)
   branches/5.9.3merge/Configure.pl

Log:
 r391@norman (orig r390):  nicholas | 2006-03-11 12:16:02 +0000
 A more general solution to linking with the correct libraries for parrot.
 Diagnose the problem of make depend being interrupted.
 


Modified: branches/5.9.3merge/Configure.pl
==============================================================================
--- branches/5.9.3merge/Configure.pl	(original)
+++ branches/5.9.3merge/Configure.pl	Sun Mar 12 07:20:44 2006
@@ -113,41 +113,45 @@
 
     open (FH, "config.sh") or die $!;
     local $/;
-    $_ = <FH>;
+    my $config_sh = <FH>;
     close FH or die $!;
 
     my %munge;
     my $bonus_libs = '';
     if ($^O eq 'solaris') {
-	$bonus_libs = '-lrt ';
+	$bonus_libs = ' -lrt';
     }
     # Avoid the dynamic libparrot for now, as using it uninstalled requires
     # messing with the dynamic library load path.
     $bonus_libs
 	.= "-lponie -lparrot -lponie";
-    if (" $Parrot::Config::PConfig{libs} " =~ / -lgmp /) {
-	$bonus_libs .= " -lgmp";
+    my ($perllibs) = $config_sh =~ /^perllibs='([^']*)'$/m;
+    my %seen_libs;
+    @seen_libs{$perllibs =~ /-l(\S+)/g} = ();
+    foreach ($Parrot::Config::PConfig{libs} =~ /-l(\S+)/g) {
+	next if exists $seen_libs{$_};
+	$bonus_libs .= " -l$_";
     }
     $munge{cppflags} = $munge{ccflags} = join '', map {" -I$_" } @inc_path;
     $munge{ldflags} = $munge{lddlflags} = join '', map " -L$_", @lib_path;
-    $munge{libs} = $munge{perllibs} = "$bonus_libs ";
+    $munge{libs} = $munge{perllibs} = $bonus_libs;
     $munge{libpth} = join " ", @lib_path;
 
     # Put new text that the front. This gives our things priority. For example,
     # it ensures that our copy of ICU is found ahead of the system's.
     while (my ($key, $value) = each %munge) {
-	s/(^$key=')([^']*)'$/$1$value $2'/m
+	$config_sh =~ s/(^$key=')([^']*)'$/$1$value $2'/m
 	    or die "Can't find config.sh line for $key";
     }
 
     # Maximal match, but within the same line
-    s!(startperl=.*/p)erl!$1onie!;
-    s!(perlpath=.*/p)erl!$1onie!;
+    $config_sh =~ s!(startperl=.*/p)erl!$1onie!;
+    $config_sh =~ s!(perlpath=.*/p)erl!$1onie!;
 
     rename "config.sh", "config.sh.before";
 
     open (FH, ">config.sh") or die $!;
-    print FH or die $!;
+    print FH $config_sh or die $!;
     close FH or die $!;
 
     system ('sh','Configure','-S') && die "error";
@@ -157,7 +161,14 @@
 unless (-e $firstmakefile) {
     system ("make depend") && die "error";
 
-    open (FH, $firstmakefile) or die $!;
+    unless (open (FH, $firstmakefile)) {
+      warn <<"EOM"
+make depend still seems to be running, or has left the directory .depending
+You may need to delete perl/.depending by hand
+EOM
+	if -d ".depending";
+      die "Can't open '$firstmakefile': $!";
+    }
     # 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.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About