diff options
author | Brian Chu <chub@nextbit.com> | 2015-01-05 23:03:30 -0500 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 18:10:46 -0700 |
commit | 830e74cf51826fa8365f9831ccb935e9157fa20e (patch) | |
tree | c5ff390db73604354cb30a38ad6d87a47894e466 /core/combo | |
parent | 2491f435c7a7a8e4b3a4b25212075b82c5a96003 (diff) | |
download | build-830e74cf51826fa8365f9831ccb935e9157fa20e.zip build-830e74cf51826fa8365f9831ccb935e9157fa20e.tar.gz build-830e74cf51826fa8365f9831ccb935e9157fa20e.tar.bz2 |
Add support for OSX up to 10.10 and CLI Tools
- Support using OSX versions 10.9 and 10.10 as the compilation host.
Please note that the prebuilt darwin-x86 gcc is missing an upstream
patch that properly identifies 10.10 as newer than 10.2, which
restricts mac_sdk_versions_supported to 10.9.
- Support using Xcode Command Line Tools, waiving the requirement for
installing the full Xcode development suite for 600k worth of C++
headers.
These build modifications have been verified by successfully compiling a
cm12-hammerhead image from scratch on a OSX Yosemite 10.10.1 host with
Xcode Command Line Tools 6.1.1 installed.
Change-Id: Id1741ef583d186eb6a42093e5111431ae7b08a2c
Diffstat (limited to 'core/combo')
-rw-r--r-- | core/combo/mac_version.mk | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/core/combo/mac_version.mk b/core/combo/mac_version.mk index 6defba7..d18e4c5 100644 --- a/core/combo/mac_version.mk +++ b/core/combo/mac_version.mk @@ -9,17 +9,19 @@ ifndef build_mac_version build_mac_version := $(shell sw_vers -productVersion) -mac_sdk_versions_supported := 10.6 10.7 10.8 10.9 +# Caution: Do not add 10.10 to this list until the prebuilts/darwin-x86 toolchains are updated. +# In the meantime, setting mac_sdk_version to 10.9 works on Yosemite (verified on 10.10.1). +mac_sdk_versions_supported := 10.6 10.7 10.8 10.9 ifneq ($(strip $(MAC_SDK_VERSION)),) mac_sdk_version := $(MAC_SDK_VERSION) ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),) $(warning ****************************************************************) -$(warning * MAC_SDK_VERSION $(MAC_SDK_VERSION) isn't one of the supported $(mac_sdk_versions_supported)) +$(warning * MAC_SDK_VERSION $(MAC_SDK_VERSION) isn\'t one of the supported $(mac_sdk_versions_supported)) $(warning ****************************************************************) $(error Stop.) endif else -mac_sdk_versions_installed := $(shell xcodebuild -showsdks | grep macosx | sort | sed -e "s/.*macosx//g") +mac_sdk_versions_installed := $(shell xcodebuild -showsdks 2> /dev/null | grep macosx | sort | sed -e "s/.*macosx//g") mac_sdk_version := $(firstword $(filter $(mac_sdk_versions_installed), $(mac_sdk_versions_supported))) ifeq ($(mac_sdk_version),) mac_sdk_version := $(firstword $(mac_sdk_versions_supported)) @@ -27,6 +29,18 @@ endif endif mac_sdk_path := $(shell xcode-select -print-path) + +ifeq ($(strip "$(mac_sdk_path)"), "/Library/Developer/CommandLineTools") +# Accept any modern version of Apple Command Line Tools +mac_sdk_root := / + +# Override mac_sdk_version with build_mac_version (aka the version of the OSX host), but assume the latest +# supported mac_sdk_version if the build_mac_version is not recognized. +mac_sdk_version := $(shell echo $(build_mac_version) | cut -d '.' -f 1,2) +ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),) +mac_sdk_version := $(lastword $(mac_sdk_versions_supported)) +endif +else # try /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk # or /Volume/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk mac_sdk_root := $(mac_sdk_path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(mac_sdk_version).sdk @@ -40,6 +54,7 @@ $(warning * Can not find SDK $(mac_sdk_version) at $(mac_sdk_root)) $(warning *****************************************************) $(error Stop.) endif +endif # $(mac_sdk_path) ifeq ($(mac_sdk_version),10.6) gcc_darwin_version := 10 |