Commit ba088bf2 authored by Edric Milaret's avatar Edric Milaret

contrib: allow ios build

Change-Id: Ib5deee2d0172f92febe72d4d3a57a7c3334414c4
Tuleap: #313
parent f6ac9c34
......@@ -132,11 +132,11 @@ check_ios_sdk()
{
if test -z "$SDKROOT"
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"
else
SDKROOT="$SDKROOT"
fi
fi
if [ ! -d "${SDKROOT}" ]
then
......@@ -144,6 +144,7 @@ check_ios_sdk()
exit 1
fi
add_make "IOS_SDK=${SDKROOT}"
add_make "IOS_TARGET_PLATFORM=${IOS_TARGET_PLATFORM}"
}
check_macosx_sdk()
......
......@@ -19,6 +19,14 @@ case "$HOST" in
powerpc64-*|ppc64-*)
ARCH="ppc64"
;;
aarch64-*)
if $HAVE_IOS
then
ARCH="arm64"
else
ARCH="aarch64"
fi
;;
*-*)
ARCH="${HOST%%-*}"
;;
......
......@@ -151,20 +151,26 @@ endif
CCAS=$(CC) -c
ifdef HAVE_IOS
MIN_IOS_VERSION=8.0
CC=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
endif
AR=xcrun ar
LD=xcrun ld
STRIP=xcrun strip
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
ifdef HAVE_WIN32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment