Merging JakobR's OS X build changes.