aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMax Howell2012-08-11 12:30:51 -0400
committerMax Howell2012-08-29 12:41:34 -0400
commit65d195dcaaa4304e127e0a264cf97ad7b6a7fd83 (patch)
tree7b8a04d1bdb8676e5e8b978da9824365edac9bae /Library/Homebrew/cmd
parent57df15afd009d11e8d683353a74287e0a22ba57b (diff)
downloadbrew-65d195dcaaa4304e127e0a264cf97ad7b6a7fd83.tar.bz2
superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds. 2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools. Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't. The previous ENV-system is still available when --env=std is specified. superenv applies to Xcode >= 4.3 only currently.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/--env.rb6
-rw-r--r--Library/Homebrew/cmd/audit.rb3
2 files changed, 4 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb
index 79323c300..b5d1253fe 100644
--- a/Library/Homebrew/cmd/--env.rb
+++ b/Library/Homebrew/cmd/--env.rb
@@ -1,9 +1,8 @@
-require 'extend/ENV'
+require 'superenv'
require 'hardware'
module Homebrew extend self
def __env
- ENV.extend(HomebrewEnvExtension)
ENV.setup_build_environment
ENV.universal_binary if ARGV.build_universal?
if $stdout.tty?
@@ -17,10 +16,11 @@ module Homebrew extend self
def build_env_keys env
%w[ CC CXX LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS SDKROOT
- CMAKE_PREFIX_PATH CMAKE_INBLUDE_PATH CMAKE_FRAMEWORK_PATH MAKEFLAGS
+ CMAKE_PREFIX_PATH CMAKE_INCLUDE_PATH CMAKE_FRAMEWORK_PATH MAKEFLAGS
MACOSX_DEPLOYMENT_TARGET PKG_CONFIG_PATH HOMEBREW_BUILD_FROM_SOURCE
HOMEBREW_DEBUG HOMEBREW_MAKE_JOBS HOMEBREW_VERBOSE HOMEBREW_USE_CLANG
HOMEBREW_USE_GCC HOMEBREW_USE_LLVM HOMEBREW_SVN
+ MAKE GIT CPP
ACLOCAL_PATH OBJC PATH ].select{ |key| env[key] }
end
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 18382de59..8244d40aa 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -1,6 +1,6 @@
require 'formula'
require 'utils'
-require 'extend/ENV'
+require 'superenv'
module Homebrew extend self
def audit
@@ -245,7 +245,6 @@ class FormulaAuditor
def audit_patches
# Some formulae use ENV in patches, so set up an environment
- ENV.extend(HomebrewEnvExtension)
ENV.setup_build_environment
Patches.new(f.patches).select { |p| p.external? }.each do |p|