2012-09-24 08:54:06 -04:00
|
|
|
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
|
|
|
|
|
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
|
|
|
# This wrapper because 4.3 xcrun doesn't work with CLT-only configurations
|
|
|
|
# But many build-systems expect it to work. This fixes that.
|
2012-09-24 08:54:06 -04:00
|
|
|
# NOTE only works if the build-tool calls xcrun without a path prefixed!
|
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
|
|
|
|
2012-09-24 08:54:06 -04:00
|
|
|
require "#{File.dirname __FILE__}/../libsuperenv"
|
2012-09-25 10:36:27 -04:00
|
|
|
SUPERBIN = __FILE__.dirname.cleanpath.freeze
|
2012-08-31 10:21:06 -04:00
|
|
|
|
2012-09-24 08:54:06 -04:00
|
|
|
exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-'
|
|
|
|
exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
|
2012-09-01 21:43:46 -04:00
|
|
|
|
2012-09-24 08:54:06 -04:00
|
|
|
def try path
|
|
|
|
exec path, *ARGV if File.executable?(path) and path.cleanpath.dirname != SUPERBIN
|
|
|
|
end
|
2012-08-31 10:21:06 -04:00
|
|
|
|
2012-09-24 08:54:06 -04:00
|
|
|
arg0 = ARGV.shift
|
|
|
|
try `/usr/bin/xcrun --find #{arg0}`
|
|
|
|
# Nuts, Xcode is not setup properly or something. Try to find the tools anyway!
|
|
|
|
try "/Applications/Xcode.app/Contents/Developer/usr/bin/#{arg0}"
|
|
|
|
try "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{arg0}"
|
|
|
|
try "/usr/bin/#{arg0}"
|
2012-08-31 10:21:06 -04:00
|
|
|
|
2012-09-24 08:54:06 -04:00
|
|
|
abort <<-EOS
|
|
|
|
Your Xcode and or CLT are mis-configured. Try some or all of the following:
|
|
|
|
xcrun --kill-cache
|
|
|
|
xcodebuild -license
|
|
|
|
sudo xcode-select -switch /path/to/Xcode.app
|
|
|
|
EOS
|