iOS build configuration updates.
Commit message longer than commit edition.
Simulator and devices:
Add a common minimum iOS version that can be shared by iOS and iOS
simulator targets.
Fix --enable-debug (for device targets; sim was fine):
Allow for successful configuration and build with --enable-debug when
CXX is available by:
- Using CXX as LD (when CXX is available).
- Passing the correct form of the iOS minimum version parameter based on
whether LD is CXX or really is ld.
Note: ld -g still won't work on macosx with this patch, so if CXX is not
available, configuration will still fail reporting that the toolchain
cannot link executables when attempting to pass --enable-debug (because
ld returns an error code since the one included with xcode doesn't
support the -g argument).
Change-Id: Ia488aed167cc2ca82ee9e980589fb76dddce634f
diff --git a/build/make/configure.sh b/build/make/configure.sh
index d07f877..f73d05c 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -754,6 +754,7 @@
fi
done
fi
+ IOS_VERSION_MIN="6.0"
;;
esac
@@ -788,8 +789,8 @@
add_ldflags "-mmacosx-version-min=10.9"
;;
*-iphonesimulator-*)
- add_cflags "-miphoneos-version-min=6.0"
- add_ldflags "-miphoneos-version-min=6.0"
+ add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
+ add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
osx_sdk_dir="$(xcrun --sdk iphonesimulator --show-sdk-path)"
add_cflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-isysroot ${osx_sdk_dir}"
@@ -970,12 +971,11 @@
;;
darwin*)
-
XCRUN_FIND="xcrun --sdk iphoneos -find"
CXX="$(${XCRUN_FIND} clang++)"
CC="$(${XCRUN_FIND} clang)"
AR="$(${XCRUN_FIND} ar)"
- LD="$(${XCRUN_FIND} ld)"
+ LD="${CXX:-$(${XCRUN_FIND} ld)}"
AS="$(${XCRUN_FIND} as)"
STRIP="$(${XCRUN_FIND} strip)"
NM="$(${XCRUN_FIND} nm)"
@@ -989,7 +989,13 @@
alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)"
add_cflags -arch ${tgt_isa} -isysroot ${alt_libc}
- add_ldflags -arch ${tgt_isa} -ios_version_min 7.0
+ add_ldflags -arch ${tgt_isa}
+
+ if [ "${LD}" = "${CXX}" ]; then
+ add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
+ else
+ add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
+ fi
for d in lib usr/lib usr/lib/system; do
try_dir="${alt_libc}/${d}"