From bb24bd5fb4b44b74e4eb98673a3ad7bcdc85c5b4 Mon Sep 17 00:00:00 2001 From: Yuta Date: Fri, 1 Apr 2011 01:28:17 +0900 Subject: [PATCH] enable parallel make --- pythonbrew/commands/install.py | 7 +++++++ pythonbrew/installer.py | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pythonbrew/commands/install.py b/pythonbrew/commands/install.py index fb71d2f..1bf6bc2 100644 --- a/pythonbrew/commands/install.py +++ b/pythonbrew/commands/install.py @@ -36,6 +36,13 @@ class InstallCommand(Command): default=None, help="Install a python under an alias." ) + self.parser.add_option( + '-j', "--jobs", + dest="jobs", + type='int', + default=0, + help="Enable parallel make." + ) def run_command(self, options, args): if args: diff --git a/pythonbrew/installer.py b/pythonbrew/installer.py index eb7715a..112f137 100644 --- a/pythonbrew/installer.py +++ b/pythonbrew/installer.py @@ -249,11 +249,13 @@ class PythonInstaller(object): s.check_call("./configure --prefix=%s %s %s" % (self.install_dir, self.options.configure, configure_option)) def make(self): + jobs = self.options.jobs + make = ((jobs > 0 and 'make -j%s' % jobs) or 'make') s = Subprocess(log=self.logfile, cwd=self.build_dir) if self.options.force: - s.check_call("make") + s.check_call(make) else: - s.check_call("make") + s.check_call(make) s.check_call("make test") def make_install(self):