Skip to content
Snippets Groups Projects
Commit ba088bf2 authored by Edric Milaret's avatar Edric Milaret
Browse files

contrib: allow ios build

Change-Id: Ib5deee2d0172f92febe72d4d3a57a7c3334414c4
Tuleap: #313
parent f6ac9c34
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,7 @@ check_ios_sdk() ...@@ -132,7 +132,7 @@ check_ios_sdk()
{ {
if test -z "$SDKROOT" if test -z "$SDKROOT"
then then
SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk SDKROOT=`xcode-select -print-path`/Platforms/${IOS_TARGET_PLATFORM}.platform/Developer/SDKs/${IOS_TARGET_PLATFORM}${SDK_VERSION}.sdk
echo "SDKROOT not specified, assuming $SDKROOT" echo "SDKROOT not specified, assuming $SDKROOT"
else else
SDKROOT="$SDKROOT" SDKROOT="$SDKROOT"
...@@ -144,6 +144,7 @@ check_ios_sdk() ...@@ -144,6 +144,7 @@ check_ios_sdk()
exit 1 exit 1
fi fi
add_make "IOS_SDK=${SDKROOT}" add_make "IOS_SDK=${SDKROOT}"
add_make "IOS_TARGET_PLATFORM=${IOS_TARGET_PLATFORM}"
} }
check_macosx_sdk() check_macosx_sdk()
......
...@@ -19,6 +19,14 @@ case "$HOST" in ...@@ -19,6 +19,14 @@ case "$HOST" in
powerpc64-*|ppc64-*) powerpc64-*|ppc64-*)
ARCH="ppc64" ARCH="ppc64"
;; ;;
aarch64-*)
if $HAVE_IOS
then
ARCH="arm64"
else
ARCH="aarch64"
fi
;;
*-*) *-*)
ARCH="${HOST%%-*}" ARCH="${HOST%%-*}"
;; ;;
......
...@@ -151,20 +151,26 @@ endif ...@@ -151,20 +151,26 @@ endif
CCAS=$(CC) -c CCAS=$(CC) -c
ifdef HAVE_IOS ifdef HAVE_IOS
MIN_IOS_VERSION=8.0
CC=xcrun clang CC=xcrun clang
CXX=xcrun clang++ CXX=xcrun clang++
ifdef HAVE_NEON
AS=perl $(abspath ../../extras/tools/build/bin/gas-preprocessor.pl) $(CC)
CCAS=gas-preprocessor.pl $(CC) -c
else
CCAS=$(CC) -c CCAS=$(CC) -c
endif
AR=xcrun ar AR=xcrun ar
LD=xcrun ld LD=xcrun ld
STRIP=xcrun strip STRIP=xcrun strip
RANLIB=xcrun ranlib RANLIB=xcrun ranlib
EXTRA_CFLAGS += $(CFLAGS)
EXTRA_LDFLAGS += $(LDFLAGS) EXTRA_CFLAGS=-arch $(ARCH) -isysroot $(IOS_SDK)
ifeq ($(IOS_TARGET_PLATFORM),iPhoneOS)
EXTRA_CFLAGS += -miphoneos-version-min=$(MIN_IOS_VERSION) -fembed-bitcode
else
EXTRA_CFLAGS += -mios-simulator-version-min=$(MIN_IOS_VERSION)
endif
EXTRA_CXXFLAGS=$(EXTRA_CFLAGS) -std=c++11 -stdlib=libc++
EXTRA_LDFLAGS=$(EXTRA_CFLAGS)
endif endif
ifdef HAVE_WIN32 ifdef HAVE_WIN32
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment