Update of /cvsroot/fink/fink/perlmod/Fink
In directory 
sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23691/perlmod/Fink

Modified Files:
      Tag: branch_0_29
        ChangeLog Configure.pm PkgVersion.pm 
Log Message:
New MaxBuildJobs fink.conf entry and UseMaxBuildJobs package description field.
Minor fink.conf cleanup, too.


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.622.2.7
retrieving revision 1.622.2.8
diff -u -d -r1.622.2.7 -r1.622.2.8
--- PkgVersion.pm       23 Nov 2009 05:52:46 -0000      1.622.2.7
+++ PkgVersion.pm       24 Nov 2009 21:11:34 -0000      1.622.2.8
@@ -4971,6 +4971,21 @@
                }
        }
 
+    # UseMaxBuildJobs: true overrides SetNoMAKEFLAGS
+    if ($self->param_boolean('UseMaxBuildJobs') && 
$config->has_param('MaxBuildJobs')) {
+        my $mbj = $config->param('MaxBuildJobs');
+        if ($mbj =~ /^\d+$/  && $mbj > 0) {
+            if (defined $script_env{'MAKEFLAGS'}) {
+                $script_env{'MAKEFLAGS'} .= " -j$mbj";
+            } else {
+                $script_env{'MAKEFLAGS'} = "-j$mbj";
+            }
+        } else {
+            warn "Ignoring invalid MaxBuildJobs value in fink.conf: " .
+                "$mbj is not a positive integer\n";
+        }
+    }
+
        # Enforce g++-3.3 or g++-4.0 even for uncooperative packages, by making 
        # it the first g++ in the path
        unless ($self->has_param('NoSetPATH')) {

Index: Configure.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Configure.pm,v
retrieving revision 1.58.2.2
retrieving revision 1.58.2.3
diff -u -d -r1.58.2.2 -r1.58.2.3
--- Configure.pm        28 Aug 2009 05:08:08 -0000      1.58.2.2
+++ Configure.pm        24 Nov 2009 21:11:34 -0000      1.58.2.3
@@ -317,9 +317,35 @@
                        $config->set_param("NoAutoIndex", $n_a_i ? "true" : 
"false");
                }
        }
+
+    print "\n";
+    my $maxbuildjobs_prompt = "Enter the maximum number of simultaneous " .
+        "build jobs. In general, Fink will build packages faster on systems " .
+        "with multiple CPUs/cores if you allow it to spawn jobs in parallel.";
+
+    my $activecpus = `sysctl -n hw.activecpu 2> /dev/null`;
+    if (defined $activecpus) {
+        chomp $activecpus;
+        if ($activecpus =~ /^\d+$/) {
+            $maxbuildjobs_prompt .= " You have $activecpus active CPUs/cores " 
.
+            "on your system.";
+        }
+    }
+    $maxbuildjobs_prompt .= "\nMaximum number of simultaneous build jobs:";
+    my $maxbuildjobs = $config->param_default("MaxBuildJobs", $activecpus);
+    my $maxbuildjobs_default = $maxbuildjobs;
+    $maxbuildjobs = &prompt($maxbuildjobs_prompt,
+        default => $maxbuildjobs_default);
+
+    while (!($maxbuildjobs =~ /^\d+$/ && $maxbuildjobs > 0)) {
+        $maxbuildjobs = &prompt("Invalid choice. Please try again",
+            default => $maxbuildjobs_default);
+    }
+
+    $config->set_param("MaxBuildJobs", $maxbuildjobs);
 }
 
-=item spotlight_warning
+=iitem spotlight_warning
 
 Warn the user if they are choosing a build path which will be indexed by
 Spotlight. Returns true if changes have been made to the Fink configuration,

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1592.2.36
retrieving revision 1.1592.2.37
diff -u -d -r1.1592.2.36 -r1.1592.2.37
--- ChangeLog   23 Nov 2009 05:52:45 -0000      1.1592.2.36
+++ ChangeLog   24 Nov 2009 21:11:34 -0000      1.1592.2.37
@@ -1,3 +1,9 @@
+2009-11-24  Augusto Devegili  <moni...@users.sourceforge.net>
+
+       * Configure.pm, PkgVersion.pm: New MaxBuildJobs fink.conf entry and
+       UseMaxBuildJobs package description field as an opt-in for
+       MAKEFLAGS += -j
+
 2009-11-21  Augusto Devegili  <moni...@users.sourceforge.net>
 
        * PkgVersion.pm: Handle the Commercial licence


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to