diff options
| author | Max Howell | 2011-08-23 23:27:49 +0100 |
|---|---|---|
| committer | Max Howell | 2011-08-24 22:30:43 +0100 |
| commit | 3a0cf31ed0ffb33e5ae2c0d996902a983752589d (patch) | |
| tree | 3a300b05e64770c0f689f2fcbfd838ebb6ef8e8b /Library/Homebrew | |
| parent | 4dc8318dc38f6dc5e6a9cad85f94dd1096d43313 (diff) | |
| download | brew-3a0cf31ed0ffb33e5ae2c0d996902a983752589d.tar.bz2 | |
Tidy ENV.rb
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 230b21b0c..e1898a569 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#{Hardware.processor_count}" unless HOMEBREW_PREFIX.to_s == '/usr/local' # /usr/local is already an -isystem and -L directory so we skip it @@ -18,25 +18,26 @@ module HomebrewEnvExtension self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}" end - if MACOS_VERSION >= 10.6 and self.use_clang? - self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang" - self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++" - cflags = ['-O3'] # -O4 makes the linker fail on some formulae - elsif MACOS_VERSION >= 10.6 and self.use_llvm? - self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc" - self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++" - cflags = ['-O4'] # link time optimisation baby! - elsif MACOS_VERSION >= 10.6 and self.use_gcc? - # Xcode 4 makes gcc and g++ #{MacOS.xcode_prefix}/usr/bin/ links to llvm versions - # so we need to use gcc-4.2 and g++-4.2 for real non-llvm compilers - self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc-4.2" - self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++-4.2" - cflags = ['-O3'] - else - # If these aren't set, many formulae fail to build - self['CC'] = '/usr/bin/cc' - self['CXX'] = '/usr/bin/c++' - cflags = ['-O3'] + # llvm allows -O4 however it often fails to link and is very slow + cflags = ['-O3'] + + # If these aren't set, many formulae fail to build + self['CC'] = '/usr/bin/cc' + self['CXX'] = '/usr/bin/c++' + + if MACOS_VERSION >= 10.6 + if self.use_clang? + self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang" + self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++" + elsif self.use_llvm? and MacOS.xcode_version < '4.1' + # With Xcode 4 cc is llvm + self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc" + self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++" + elsif self.use_gcc? and MacOS.xcode_version < '4' + # With Xcode4 cc, c++, gcc and g++ are actually symlinks to llvm-gcc + self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc-4.2" + self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++-4.2" + end end # In rare cases this may break your builds, as the tool for some reason wants |
