Now we should get an sdk_path, but tools like xcodebuild, xcode-select and xcrun will still error out. But at least more of Homebrew will work.
Also putting the Xcode 3 path finder last. We get bug reports because newer Xcodes are installed in parallel to older Xcodes. We want to find and use the newer Xcode's first. Xcode.prefix is pretty smart about that.
Refs Homebrew/homebrew#14558.
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.
This will allow us to do comparisons like
if MacOS.version >= :lion
and hopefully deprecate the MacOS.<name>? family of methods, which are
counterinitutive.
A user on IRC was getting strange results from MacOS.dev_tools_path.
It turns out that xcrun's exit status is not always reliable - if
xcrun is a shim and not able to locate the real xcrun, it will exit
0 despite not actually doing what it was asked. Instead check to see
if the stout is empty.
In order to better support Xcode-only systems, where X11 libs and
executables live under /usr/X11 but headers live in the SDK, move the
x11_* helper methods into a new module.
This allows us to keep some of the CLT/Xcode-only and Apple X11/XQuartz
logic hidden from outside code, like ENV.x11.
Since Apple's X11 is actually XQuartz, name the module "MacOS::XQuartz".
MacOS.sdk_path is meant to return the SDK path that matches the version
argument, so store the result in a hash.
FixesHomebrew/homebrew#13623.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Checking "not clt_version.empty?" is unnecessary if we are also checking
that dev_tools_path is /usr/bin.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>