diff options
| author | Jack Nagel | 2011-07-26 00:01:22 -0500 |
|---|---|---|
| committer | Jack Nagel | 2011-08-24 17:14:23 -0500 |
| commit | 0fb5012e616d3f08c71509e92d3954eb5672aef1 (patch) | |
| tree | 118b7d904a76c94665c108f0def513b75c0ec7d7 /Library/Homebrew | |
| parent | fff60b5e5ec99882e0ea976de20fb3e72fab2cfe (diff) | |
| download | homebrew-0fb5012e616d3f08c71509e92d3954eb5672aef1.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 931f69271..8ca166ac0 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -8,7 +8,7 @@ module HomebrewEnvExtension delete('CPPFLAGS') delete('LDFLAGS') - self['MAKEFLAGS'] = "-j#{Hardware.processor_count}" + self['MAKEFLAGS'] = "-j#{self.make_jobs}" unless HOMEBREW_PREFIX.to_s == '/usr/local' # /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? self['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm' 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 |
