From 94671df75309d1c2b2c40258b3d40bcf291f41df Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Mon, 24 Aug 2015 14:27:17 -0700 Subject: [PATCH] [JSCLegacyProfiler] Use generic iOS SDK instead of pinning to 8.3 Summary: The path to the iOS 8.3 SDK does not exist when only Xcode 6.4 is installed. This uses a more general folder name, which (at least) the 8.4 SDK symlinks to. I haven't verified this on Xcode 6.3, so I'd appreciate it if someone could confirm that this path exists there too! :) --- JSCLegacyProfiler/Makefile | 24 +++++++++++++++--------- JSCLegacyProfiler/parseSDKVersion.awk | 10 ++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 JSCLegacyProfiler/parseSDKVersion.awk diff --git a/JSCLegacyProfiler/Makefile b/JSCLegacyProfiler/Makefile index b825f77647..0cf8f6afe6 100644 --- a/JSCLegacyProfiler/Makefile +++ b/JSCLegacyProfiler/Makefile @@ -1,6 +1,12 @@ HEADER_PATHS := `find ./tmp/JavaScriptCore -name '*.h' | xargs -I{} dirname {} | uniq | xargs -I{} echo "-I {}"` +SDK_VERSION=$(shell plutil -convert json -o - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist | awk -f parseSDKVersion.awk) CERT ?= "iPhone Developer" +ifneq ($(SDK_VERSION), 8) +all: + $(error "Expected to be compiled with iOS SDK version 8, found $(SDK_VERSION)") +endif + ios8: prepare build generate prepare: clean create download @@ -45,8 +51,8 @@ yajl: echo `find . -name '*.c'` cd ./tmp/yajl-2.1.0/src && \ clang -arch arm64 -arch armv7 -std=c99 \ - -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/ \ - -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/machine \ + -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/ \ + -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/machine \ -I ../build/yajl-2.1.0/include \ -c `find . -name '*.c'` libtool -static -o ./tmp/yajl.a `find ./tmp/yajl-2.1.0/src/ -name '*.o'` @@ -77,12 +83,12 @@ arm64: -I ./tmp/WebCore-7600.1.25/icu \ -I ./tmp/WTF-7600.1.24 \ -I ./tmp/yajl-2.1.0/build/yajl-2.1.0/include \ - -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include \ - -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/machine \ + -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include \ + -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/machine \ -DNDEBUG=1\ -miphoneos-version-min=8.0 \ - -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib \ - -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib/system \ + -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib \ + -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system \ ${HEADER_PATHS} \ -undefined dynamic_lookup \ ./JSCLegacyProfiler.mm ./tmp/yajl.a @@ -96,11 +102,11 @@ armv7: -I ./tmp/WebCore-7600.1.25/icu \ -I ./tmp/WTF-7600.1.24 \ -I ./tmp/yajl-2.1.0/build/yajl-2.1.0/include \ - -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include \ + -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include \ -DNDEBUG=1\ -miphoneos-version-min=8.0 \ - -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib \ - -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib/system \ + -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib \ + -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system \ ${HEADER_PATHS} \ -undefined dynamic_lookup \ ./JSCLegacyProfiler.mm ./tmp/yajl.a diff --git a/JSCLegacyProfiler/parseSDKVersion.awk b/JSCLegacyProfiler/parseSDKVersion.awk new file mode 100644 index 0000000000..73ff20237a --- /dev/null +++ b/JSCLegacyProfiler/parseSDKVersion.awk @@ -0,0 +1,10 @@ +BEGIN { + FS = ":" + RS = "," +} + +/"Version"/ { + version = substr($2, 2, length($2) - 2) + print int(version) + exit 0 +}