Commit 5d0c33b8 authored by Johann's avatar Johann

Build iOS targets with XCode 5

Thanks to armando.dicianno for the patch

Fixes issue #603

Change-Id: I91ec030e5674b82c05115ed4dfbdb8ccbff22b66
parent ffb17e2c
...@@ -925,41 +925,26 @@ EOF ...@@ -925,41 +925,26 @@ EOF
;; ;;
darwin*) darwin*)
if [ -z "${sdk_path}" ]; then
SDK_PATH=`xcode-select -print-path 2> /dev/null` XCRUN_FIND="xcrun --sdk iphoneos -find"
SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer CXX="$(${XCRUN_FIND} clang++)"
else CC="$(${XCRUN_FIND} clang)"
SDK_PATH=${sdk_path} AR="$(${XCRUN_FIND} ar)"
fi LD="$(${XCRUN_FIND} ld)"
TOOLCHAIN_PATH=${SDK_PATH}/usr/bin AS="$(${XCRUN_FIND} as)"
CXX=${TOOLCHAIN_PATH}/g++ STRIP="$(${XCRUN_FIND} strip)"
CC=${TOOLCHAIN_PATH}/gcc NM="$(${XCRUN_FIND} nm)"
AR=${TOOLCHAIN_PATH}/ar RANLIB="$(${XCRUN_FIND} ranlib)"
LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
AS=${TOOLCHAIN_PATH}/as
STRIP=${TOOLCHAIN_PATH}/strip
NM=${TOOLCHAIN_PATH}/nm
AS_SFX=.s AS_SFX=.s
# ASFLAGS is written here instead of using check_add_asflags # ASFLAGS is written here instead of using check_add_asflags
# because we need to overwrite all of ASFLAGS and purge the # because we need to overwrite all of ASFLAGS and purge the
# options that were put in above # options that were put in above
ASFLAGS="-version -arch ${tgt_isa} -g" ASFLAGS="-arch ${tgt_isa} -g"
add_cflags -arch ${tgt_isa}
add_ldflags -arch_only ${tgt_isa}
if [ -z "${alt_libc}" ]; then
alt_libc=${SDK_PATH}/SDKs/iPhoneOS6.0.sdk
fi
add_cflags "-isysroot ${alt_libc}"
# Add the paths for the alternate libc alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)"
for d in usr/include; do add_cflags -arch ${tgt_isa} -isysroot ${alt_libc}
try_dir="${alt_libc}/${d}" add_ldflags -arch ${tgt_isa} -ios_version_min 7.0
[ -d "${try_dir}" ] && add_cflags -I"${try_dir}"
done
for d in lib usr/lib usr/lib/system; do for d in lib usr/lib usr/lib/system; do
try_dir="${alt_libc}/${d}" try_dir="${alt_libc}/${d}"
......
...@@ -26,7 +26,7 @@ Advanced options: ...@@ -26,7 +26,7 @@ Advanced options:
${toggle_unit_tests} unit tests ${toggle_unit_tests} unit tests
--libc=PATH path to alternate libc --libc=PATH path to alternate libc
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred] --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
--sdk-path=PATH path to root of sdk (iOS, android builds only) --sdk-path=PATH path to root of sdk (android builds only)
${toggle_fast_unaligned} don't use unaligned accesses, even when ${toggle_fast_unaligned} don't use unaligned accesses, even when
supported by hardware [auto] supported by hardware [auto]
${toggle_codec_srcs} in/exclude codec library source code ${toggle_codec_srcs} in/exclude codec library source code
......
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