aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/superenv.rb
diff options
context:
space:
mode:
authorMax Howell2012-08-30 10:03:26 -0400
committerMax Howell2012-08-30 20:02:29 -0400
commit7aa496efed02bb7cd59866c1d7954799128832a5 (patch)
tree2ccde1b7c0153f063f63f22809f36c0f8ab1efc0 /Library/Homebrew/superenv.rb
parentb41ba217b112b6962efa21edef80ce3ccab6d79c (diff)
downloadhomebrew-7aa496efed02bb7cd59866c1d7954799128832a5.tar.bz2
Fixes #14542; ocaml superenv issues
This patch removes most of the settings for CC, CXX etc. because we are trying to be minimal. Then we force the compiler to Homebrew's choice underneath in superenv. We however leave LD because we prefer that build-systems use the c-compiler for linking, it generally works better (copiously tested), however when the build-system explicitly calls ld, we respect that. This gets around the ocaml bug in question, since somehow clang was crashing during link, but the ld tool itself (which is kind of clang, kind of llvm-gcc) is okay with this. Also moved the setting of O (so that cc-args are refurbished) into a make wrapper. Not sure if this matter much, but seems more consistent.
Diffstat (limited to 'Library/Homebrew/superenv.rb')
-rw-r--r--Library/Homebrew/superenv.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 46e6bafa0..f059283ce 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -28,7 +28,7 @@ class << ENV
alias_method :x11?, :x11
def reset
- %w{CC CXX LD CPP OBJC MAKE
+ %w{CC CXX CPP OBJC MAKE
CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS
MACOS_DEPLOYMENT_TARGET SDKROOT
CMAKE_PREFIX_PATH CMAKE_INCLUDE_PATH CMAKE_FRAMEWORK_PATH}.
@@ -40,11 +40,7 @@ class << ENV
def setup_build_environment
reset
- ENV['CC'] = 'cc'
- ENV['CXX'] = 'c++'
- ENV['LD'] = 'ld'
- ENV['CPP'] = 'cpp'
- ENV['MAKE'] = 'make'
+ ENV['LD'] = 'cc'
ENV['MAKEFLAGS'] ||= "-j#{determine_make_jobs}"
ENV['PATH'] = determine_path
ENV['PKG_CONFIG_PATH'] = determine_pkg_config_path
@@ -184,16 +180,13 @@ class << ENV
end
alias_method :j1, :deparallelize
def gcc
- ENV['CC'] = "gcc"
- ENV['CXX'] = "g++"
+ ENV['HOMEBREW_CC'] = "gcc"
end
def llvm
- ENV['CC'] = "llvm-gcc"
- ENV['CXX'] = "llvm-g++"
+ ENV['HOMEBREW_CC'] = "llvm-gcc"
end
def clang
- ENV['CC'] = "clang"
- ENV['CXX'] = "clang++"
+ ENV['HOMEBREW_CC'] = "clang"
end
def make_jobs
ENV['MAKEFLAGS'] =~ /-\w*j(\d)+/