- fixed building for iOS 9

- handle sim flag to better distinguish between ios simulator / ios
- added ios_deployment_target to set ios min version
- default to 64 bit build for iOS
This commit is contained in:
Benjamin Stadin 2015-11-01 20:36:47 +01:00
parent 7cc9f160f2
commit dc010f9a92

View File

@ -763,13 +763,14 @@ ifeq ($(kernel),darwin)
rpath = rpath =
ifeq ($(platform),ios) ifeq ($(platform),ios)
ifeq (,$(filter arm arm64,$(arch))) ifeq ($(sim),true)
target = iPhoneSimulator target = iPhoneSimulator
sdk = iphonesimulator$(ios-version) sdk = iphonesimulator$(ios-version)
ifeq ($(arch),i386) ifeq ($(arch),i386)
arch-flag = -arch i386 arch-flag = -arch i386
else else
arch-flag = -arch x86_64 arch-flag = -arch x86_64
arch = x86_64
endif endif
release = Release-iphonesimulator release = Release-iphonesimulator
else else
@ -779,6 +780,7 @@ ifeq ($(kernel),darwin)
arch-flag = -arch armv7 arch-flag = -arch armv7
else else
arch-flag = -arch arm64 arch-flag = -arch arm64
arch = arm64
endif endif
release = Release-iphoneos release = Release-iphoneos
endif endif
@ -787,7 +789,9 @@ ifeq ($(kernel),darwin)
sdk-dir = $(platform-dir)/Developer/SDKs sdk-dir = $(platform-dir)/Developer/SDKs
ios-version := $(shell \ ios-version := $(shell \
if test -d $(sdk-dir)/$(target)8.3.sdk; then echo 8.3; \ if test -L $(sdk-dir)/$(target)9.1.sdk; then echo 9.1; \
elif test -L $(sdk-dir)/$(target)9.0.sdk; then echo 9.0; \
elif test -d $(sdk-dir)/$(target)8.3.sdk; then echo 8.3; \
elif test -d $(sdk-dir)/$(target)8.2.sdk; then echo 8.2; \ elif test -d $(sdk-dir)/$(target)8.2.sdk; then echo 8.2; \
elif test -d $(sdk-dir)/$(target)8.1.sdk; then echo 8.1; \ elif test -d $(sdk-dir)/$(target)8.1.sdk; then echo 8.1; \
elif test -d $(sdk-dir)/$(target)8.0.sdk; then echo 8.0; \ elif test -d $(sdk-dir)/$(target)8.0.sdk; then echo 8.0; \
@ -828,39 +832,57 @@ ifeq ($(kernel),darwin)
cflags += $(flags) cflags += $(flags)
asmflags += $(flags) asmflags += $(flags)
lflags += $(flags) lflags += $(flags)
endif
ios-version-min=$(ios-version)
ifeq ($(arch),i386) ifdef ios_deployment_target
ifeq ($(platform),ios) ios-version-min=ios_deployment_target
classpath-extra-cflags += \ endif
-arch i386 -miphoneos-version-min=$(ios-version)
cflags += -arch i386 -miphoneos-version-min=$(ios-version) ifeq ($(sim),true)
asmflags += -arch i386 -miphoneos-version-min=$(ios-version) ifeq ($(arch),x86_64)
lflags += -arch i386 -miphoneos-version-min=$(ios-version) classpath-extra-cflags += \
-arch x86_64 -miphoneos-version-min=$(ios-version-min)
cflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
asmflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
lflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
else
classpath-extra-cflags += \
-arch i386 -miphoneos-version-min=$(ios-version-min)
cflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
asmflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
lflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
endif
else else
classpath-extra-cflags += \ ifeq ($(arch),arm64)
-arch i386 -mmacosx-version-min=${OSX_SDK_VERSION} classpath-extra-cflags += \
cflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION} -arch arm64 -miphoneos-version-min=$(ios-version-min)
asmflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION} cflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
lflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION} asmflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
lflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
else
classpath-extra-cflags += \
-arch armv7 -miphoneos-version-min=$(ios-version-min)
cflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
asmflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
lflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
endif
endif
else # not ios
ifeq ($(arch),i386)
classpath-extra-cflags += \
-arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
cflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
asmflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
lflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
endif
ifeq ($(arch),x86_64)
classpath-extra-cflags += -arch x86_64
cflags += -arch x86_64
asmflags += -arch x86_64
lflags += -arch x86_64
endif endif
endif endif
ifeq ($(arch),x86_64)
ifeq ($(platform),ios)
classpath-extra-cflags += \
-arch x86_64 -miphoneos-version-min=$(ios-version)
cflags += -arch x86_64 -miphoneos-version-min=$(ios-version)
asmflags += -arch x86_64 -miphoneos-version-min=$(ios-version)
lflags += -arch x86_64 -miphoneos-version-min=$(ios-version)
else
classpath-extra-cflags += -arch x86_64
cflags += -arch x86_64
asmflags += -arch x86_64
lflags += -arch x86_64
endif
endif
cflags += -I$(JAVA_HOME)/include/darwin cflags += -I$(JAVA_HOME)/include/darwin
endif endif