ENV: allow a user-configurable number of make jobs
Let an environment variable, HOMEBREW_MAKE_JOBS, override the default '-j<cores>' make flag. Now we can more easily debug formula that normally build in parallel, or (potentially) speed up lengthy builds.
This commit is contained in:
parent
94abb42567
commit
d5f7594748
@ -316,6 +316,12 @@ Some sample commands ship with Homebrew and are enabled by default.
|
|||||||
If set, Homebrew will not remove files from `share/info`, allowing them
|
If set, Homebrew will not remove files from `share/info`, allowing them
|
||||||
to be linked from the Cellar.
|
to be linked from the Cellar.
|
||||||
|
|
||||||
|
* HOMEBREW\_MAKE\_JOBS:
|
||||||
|
If set, instructs Homebrew to use the value of `HOMEBREW_MAKE_JOBS` as
|
||||||
|
the number of parallel jobs to run when building with `make`(1).
|
||||||
|
|
||||||
|
*Default:* the number of available CPU cores.
|
||||||
|
|
||||||
* HOMEBREW\_SVN:
|
* HOMEBREW\_SVN:
|
||||||
When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set,
|
When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set,
|
||||||
a Homebrew-built Subversion if installed, or the system-provided binary.
|
a Homebrew-built Subversion if installed, or the system-provided binary.
|
||||||
|
|||||||
@ -8,7 +8,7 @@ module HomebrewEnvExtension
|
|||||||
delete('CPPFLAGS')
|
delete('CPPFLAGS')
|
||||||
delete('LDFLAGS')
|
delete('LDFLAGS')
|
||||||
|
|
||||||
self['MAKEFLAGS'] = "-j#{Hardware.processor_count}"
|
self['MAKEFLAGS'] = "-j#{self.make_jobs}"
|
||||||
|
|
||||||
unless HOMEBREW_PREFIX.to_s == '/usr/local'
|
unless HOMEBREW_PREFIX.to_s == '/usr/local'
|
||||||
# /usr/local is already an -isystem and -L directory so we skip it
|
# /usr/local is already an -isystem and -L directory so we skip it
|
||||||
@ -309,4 +309,13 @@ Please take one of the following actions:
|
|||||||
def use_llvm?
|
def use_llvm?
|
||||||
self['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm'
|
self['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def make_jobs
|
||||||
|
# '-j' requires a positive integral argument
|
||||||
|
if self['HOMEBREW_MAKE_JOBS'].to_i > 0
|
||||||
|
self['HOMEBREW_MAKE_JOBS']
|
||||||
|
else
|
||||||
|
Hardware.processor_count
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.\" generated with Ronn/v0.7.3
|
.\" generated with Ronn/v0.7.3
|
||||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||||
.
|
.
|
||||||
.TH "BREW" "1" "June 2011" "Homebrew" "brew"
|
.TH "BREW" "1" "July 2011" "Homebrew" "brew"
|
||||||
.
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBbrew\fR \- The missing package manager for OS X
|
\fBbrew\fR \- The missing package manager for OS X
|
||||||
@ -351,6 +351,13 @@ HOMEBREW_KEEP_INFO
|
|||||||
If set, Homebrew will not remove files from \fBshare/info\fR, allowing them to be linked from the Cellar\.
|
If set, Homebrew will not remove files from \fBshare/info\fR, allowing them to be linked from the Cellar\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
HOMEBREW_MAKE_JOBS
|
||||||
|
If set, instructs Homebrew to use the value of \fBHOMEBREW_MAKE_JOBS\fR as the number of parallel jobs to run when building with \fBmake\fR(1)\.
|
||||||
|
.
|
||||||
|
.IP
|
||||||
|
\fIDefault:\fR the number of available CPU cores\.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
HOMEBREW_SVN
|
HOMEBREW_SVN
|
||||||
When exporting from Subversion, Homebrew will use \fBHOMEBREW_SVN\fR if set, a Homebrew\-built Subversion if installed, or the system\-provided binary\.
|
When exporting from Subversion, Homebrew will use \fBHOMEBREW_SVN\fR if set, a Homebrew\-built Subversion if installed, or the system\-provided binary\.
|
||||||
.
|
.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user