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.
2012-08-11 12:30:51 -04:00
|
|
|
# Yes, a good deal of this could be imported from Homebrew-proper
|
|
|
|
# But Homebrew-proper is dog-slow currently, and I didn't want every cc
|
2012-09-24 09:46:42 -04:00
|
|
|
# instantiation to be slower by a tangible amount.
|
|
|
|
|
|
|
|
# https://github.com/Homebrew/homebrew-versions/issues/47
|
|
|
|
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
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.
2012-08-11 12:30:51 -04:00
|
|
|
|
|
|
|
class String
|
|
|
|
def directory?; File.directory? self end
|
|
|
|
def basename; File.basename self end
|
|
|
|
def cleanpath; require 'pathname'; Pathname.new(self).realpath.to_s rescue self end
|
|
|
|
def chuzzle; s = chomp; s unless s.empty? end
|
|
|
|
def dirname; File.dirname(self) end
|
|
|
|
end
|
|
|
|
|
|
|
|
class NilClass
|
|
|
|
def chuzzle; end
|
|
|
|
def directory?; false end
|
|
|
|
def split(x); [] end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Array
|
|
|
|
def to_flags prefix
|
|
|
|
select{|path| path.directory? }.uniq.map{|path| prefix+path }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
$brewfix = "#{__FILE__}/../../../".cleanpath.freeze
|
|
|
|
$sdkroot = ENV['HOMEBREW_SDKROOT'].freeze
|