forked from mirrors/linphone-iphone
55 lines
2 KiB
Bash
55 lines
2 KiB
Bash
# -*- shell-script -*-
|
|
|
|
SDK_VERSION_MAJOR=4
|
|
SDK_VERSION=4.0
|
|
MCPU=""
|
|
if test "${host_alias}" = "i386-apple-darwin" ; then
|
|
PLATFORM=Simulator
|
|
ARCH=i386
|
|
CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=i386"
|
|
MCPU=""
|
|
elif test "${host_alias}" = "armv6-apple-darwin" ; then
|
|
ARCH=armv6
|
|
PLATFORM=OS
|
|
CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm"
|
|
MCPU="-mcpu=arm1176jzf-s"
|
|
elif test "${host_alias}" = "armv7-apple-darwin" ; then
|
|
ARCH=armv7
|
|
PLATFORM=OS
|
|
CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm"
|
|
MCPU="-mcpu=cortex-a8"
|
|
elif test "${host_alias}" = "armv7s-apple-darwin" ; then
|
|
ARCH=armv7s
|
|
PLATFORM=OS
|
|
CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm"
|
|
else
|
|
echo "bad host ${host_alias} must be either i386-apple-darwin or armv6-apple-darwin"
|
|
exit
|
|
fi
|
|
echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}"
|
|
XCODE_DEV_PATH=`xcode-select -print-path`
|
|
#new path with Xcode 4.3:
|
|
if test -d ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then
|
|
SDK_PATH_LIST=`ls -drt ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*`
|
|
SDK_BIN_PATH=${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin
|
|
else
|
|
SDK_PATH_LIST=`ls -drt /Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*`
|
|
SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin
|
|
fi
|
|
|
|
for SYSROOT_PATH in $SDK_PATH_LIST ; do echo $SYSROOT_PATH ; done ;
|
|
echo "Selecting SDK path = ${SYSROOT_PATH}"
|
|
COMMON_FLAGS=" -arch ${ARCH} ${MCPU} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions"
|
|
CC="xcrun clang -std=c99 $COMMON_FLAGS"
|
|
OBJC="xcrun clang -std=c99 $COMMON_FLAGS"
|
|
CXX="xcrun clang++ $COMMON_FLAGS"
|
|
LD="xcrun ld -arch ${ARCH}"
|
|
AR="xcrun ar"
|
|
RANLIB="xcrun ranlib"
|
|
|
|
CPPFLAGS="-Dasm=__asm"
|
|
OBJCFLAGS="-x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch"
|
|
#Force install script to use -C so that header files don't get re-written if not changed.
|
|
INSTALL_DATA="ginstall -C"
|
|
|
|
|