Core change: MacOS.xcrun as indirection to find things

Core change:  Use the new MacOS.xcrun indirection

Core change: New xctoolchain_path

Core change: New macosx_sdk_path

Core change: New macosxsdk and remove_macosxsdk

In order to build on 10.7.3 with Xcode 4.3 (without the
"Command Line Tools for Xcode"), several paths
have to be set.
ENV.macosxsdk function sets all needed lib and include
dirs to CFLAGS, CPPFLAGS, LDFLAGS.

The function remove_macosxsdk unsets all these settings.

Core change: delete old xcrun function from ENV.rb

it has been moved to MacOS.xcrun.

Core change: Allow builds with Xcode 4.3 w/o CLTs

In build.rb it is checked if Xcode >= 4.3 and
xctoolchain path exists. If yes, the new
ENV.macosxsdk(MacOSX.version) is called
to set up the environment and PATH.

--config.rb shows dev tools path and clang path

typo

Fix IO redirection in ENV.xcrun

Core change: doctor telling Xcode 4.3 w/0 CLT is experimental

Only on Lion, tell the user about the options, which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)

So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs.

For older Macs, the old message that Xcode is needed
and the installer should be run is displayed.

If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.

Core change: MacOS.command_line_tools_installed?

A new function which uses MacOS.dev_tools_path
to find out whether cc and make are installed in /usr/bin.
This way, we avoid duplicate code.

Core change: robust handling of macosx_sdk_path

with @macosx_sdk_path idiom.

Core change: code comment on no xctoolchain_path

Core change: MacOS.dev_tools_path check if xctools_fucked

dev_toos_path now

- first checks /usr/bin/cc or /usr/bin/make
- then try to find make via xcrun
- and then try xcode_prefix/usr/bin/make
- finally fall back to /usr/bin

Core change: Always use Pathname.new instead of string

Core change:  Xcode w/o CLT now in ENV.setup_build_environment

Core change: Don't mess up if CLTs are installed.

avoid spamming CFLAGS and Co. if CLTs are
installed.

brew --config: tell when CLTs are installed.

Core change: Yet another hard coded /usr/bin!

/usr/bin/strip was not on my freshly installed Lion.
(the remaining /usr/bin<insert_tool> were present,
so we do not route them through xcrun.

Core change: Xcode 4.3 fixes (re)moved from build.rb

Fix in utils.command_line_tools_installed?

Needs a Pathname.new for proper "==" compare.
Core change: Make ENV.x11 respect macosx_sdk_path
Core change: xcode_version is "" if no Xcode

Right now, it returns something based on the clang version. However, the CLTs provide clang without Xcode.
Core change: --config showing (Command Line Tools installed)

Even if no Xcode is installed.

Explicit is better than implicit.

forgot "return".

Core change: bug in xcode_version, macosx_sdk_path

xcode_version cannot return nil. --> ''

Core-change: Better support for CLT w/o Xcode

This is the other way around :-)
(Note, for CLTs only, there is no xcode_version and no sdk)

Core change: Reverted xcode_version to nil if no Xcode

Make the code more compatible with the master.

Core-change: If no Xcode => empty string (again)

MacOS.xcode_version <= "x.y" is used all over and returning nil breaks this comparison.
The empty version is "smaller" than any other string when comparing, so we can use
it just as before. Instead of .nil? go for .empty? to find out if no Xcode is installed.

Show Default SDK:  "N/A" if no SDK found.

--config: describe_default_sdk

Added a function to make it cleaner.
Core-change: clang_version and xcode_prefix can be nil

- damn space at the end of the line.
doctor: Warn if xctools_fucked, too.
Core-change: keg_fix_install_names now use MacOS.xcrun

The redirection is built such that on older system it just gives
the path to the tool and on newer systems is uses xcrun -find.

ruby Y U no default args for functions?

do not cache macosx_sdk_path

otherwise you cannot set the ENV.macosxsdk <version>
to an older version because the sdk path always points to
the first set version. Damn this took me an hour.

Also fixed CMAKE_PREFIX_PATH for ENV.X11
macosx_sdk_path defaults to latest
Core-change:  cmake paths

removed CMAKE_PREFIX_PATH and added
CMAKE_OSX_SYSROOT for Xcode 4.3 only installs.
lua: needs LDFLAGS, too.
cmake: Tell ./bootstrap to find the MacOSX<version>.sdk

Giving the CMAKE_FIND_ROOT_PATH via an --init textfile to ./bootstrap so that _additionally_ to the default search places, the sdk located in /Applications/Xcode.app/... is searched.

fix missing "end".

Directly query maxosx sdk path from xcodebuild

No more grep, thanks to ttilley!

made --config less verbose

removed the path to clang executable
Added CMAKE_PREFIX_PATH to ENV.macosxsdk