Commit 7350f9de authored by Ghislain MARY's avatar Ghislain MARY

Add iOS toolchain.

parent 71286124
......@@ -22,7 +22,7 @@
NUMCPUS?=$(shell grep -c '^processor' /proc/cpuinfo || echo "1" )
.PHONY: build-desktop build-bb10-i486 build-bb10-arm build-bb10
.PHONY: build-desktop build-bb10-i486 build-bb10-arm build-bb10 build-ios-i386 build-ios-armv7 build-ios-armv7s
all: build-desktop
......@@ -70,10 +70,57 @@ help-bb10:
cd WORK/cmake-bb10-i486 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=bb10-i486 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/i486 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/i486 $(filter -D%,$(MAKEFLAGS)) -LH
generate-bb10-sdk: build-bb10
cd OUTPUT && \
zip -r liblinphone-bb10-sdk.zip liblinphone-bb10-sdk
build-ios-i386:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-i386 && \
cd WORK/cmake-ios-i386 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-i386 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios-armv7:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-armv7 && \
cd WORK/cmake-ios-armv7 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-armv7 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7 $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios-armv7s:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-armv7s && \
cd WORK/cmake-ios-armv7s && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-armv7s -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7s -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7s $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios: build-ios-i386 build-ios-armv7 build-ios-armv7s
clean-ios-i386:
rm -rf WORK/Build-ios-i386 && \
rm -rf WORK/tmp-ios-i386 && \
rm -rf OUTPUT/liblinphone-ios-sdk/i386
clean-ios-armv7:
rm -rf WORK/Build-ios-armv7 && \
rm -rf WORK/tmp-ios-armv7 && \
rm -rf OUTPUT/liblinphone-ios-sdk/armv7
clean-ios-armv7s:
rm -rf WORK/Build-ios-armv7s && \
rm -rf WORK/tmp-ios-armv7s && \
rm -rf OUTPUT/liblinphone-ios-sdk/armv7s
clean-ios: clean-ios-i386 clean-ios-armv7 clean-ios-armv7s
help-ios:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-i386 && \
cd WORK/cmake-ios-i386 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-i386 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) -LH
veryclean:
rm -rf WORK && \
rm -rf OUTPUT
generate-bb10-sdk: build-bb10
cd OUTPUT && \
zip -r liblinphone-bb10-sdk.zip liblinphone-bb10-sdk
############################################################################
# config-ios-armv7.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
include(configs/config-ios.cmake)
# speex
list(APPEND EP_speex_CMAKE_OPTIONS
"-DENABLE_FLOAT_API=0"
"-DENABLE_FIXED_POINT=1"
"-DENABLE_ARMV7_NEON_ASM=1"
)
# opus
list(APPEND EP_opus_CONFIGURE_OPTIONS "--enable-fixed-point")
############################################################################
# config-ios-armv7s.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
include(configs/config-ios.cmake)
# speex
list(APPEND EP_speex_CMAKE_OPTIONS
"-DENABLE_FLOAT_API=0"
"-DENABLE_FIXED_POINT=1"
"-DENABLE_ARMV7_NEON_ASM=1"
)
# opus
list(APPEND EP_opus_CONFIGURE_OPTIONS "--enable-fixed-point")
############################################################################
# config-ios-i386.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
include(configs/config-ios.cmake)
############################################################################
# config-ios.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# Define default values for the linphone builder options
set(DEFAULT_VALUE_ENABLE_VIDEO OFF)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG OFF)
set(DEFAULT_VALUE_ENABLE_ZRTP OFF)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_AMR OFF)
set(DEFAULT_VALUE_ENABLE_G729 OFF)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC OFF)
set(DEFAULT_VALUE_ENABLE_ISAC OFF)
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SILK OFF)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_VPX OFF)
set(DEFAULT_VALUE_ENABLE_X264 OFF)
set(DEFAULT_VALUE_ENABLE_TUNNEL OFF)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
# Include builders
include(builders/CMakeLists.txt)
# belle-sip
set(EP_bellesip_LINKING_TYPE "-DENABLE_STATIC=1")
# mediastreamer2
list(APPEND EP_ms2_CONFIGURE_OPTIONS
"--disable-nls"
"--disable-theora"
"--disable-sdl"
"--disable-x11"
"--disable-video"
"--disable-alsa"
"--enable-relativeprefix=yes"
)
# linphone
list(APPEND EP_linphone_CONFIGURE_OPTIONS
"--disable-nls"
"--with-readline=none"
"--enable-gtk_ui=no"
"--enable-console_ui=yes"
"--disable-x11"
"--disable-tutorials"
"--disable-tools"
"--disable-msg-storage"
"--disable-video"
"--disable-alsa"
"--enable-relativeprefix=yes"
)
#!/bin/bash
xcrun @TOOLNAME@ $*
############################################################################
# toolchan-ios.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# Building for iOS is only available under APPLE systems
if(NOT APPLE)
message(FATAL_ERROR "You need to build using a Mac OS X system")
endif(NOT APPLE)
set(SDK_VERSION 4.0)
execute_process(COMMAND xcode-select -print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${XCODE_SELECT_RESULT} EQUAL 0)
message(FATAL_ERROR "xcode-select failed: ${XCODE_SELECT_RESULT}. You may need to install Xcode.")
endif(NOT ${XCODE_SELECT_RESULT} EQUAL 0)
if(EXISTS "${XCODE_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/")
# New path with Xcode 4.3
file(GLOB SDK_PATH_LIST "${XCODE_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*.sdk")
set(SDK_BIN_PATH "${XCODE_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin")
else(EXISTS "${XCODE_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/")
file(GLOB SDK_PATH_LIST "/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*.sdk")
set(SDK_BIN_PATH "/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin")
endif(EXISTS "${XCODE_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/")
list(SORT SDK_PATH_LIST)
list(REVERSE SDK_PATH_LIST)
list(GET SDK_PATH_LIST 0 SYSROOT_PATH)
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(LINPHONE_BUILDER_TOOLCHAIN_HOST ${COMPILER_PREFIX})
foreach(TOOLNAME clang clang++ ld ar ranlib strip nm)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/toolchains/ios/tool_wrapper.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/${TOOLNAME}.sh)
endforeach(TOOLNAME)
set(LINPHONE_BUILDER_TOOLCHAIN_CC "${CMAKE_CURRENT_BINARY_DIR}/clang.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_CXX "${CMAKE_CURRENT_BINARY_DIR}/clang++.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_OBJC "${CMAKE_CURRENT_BINARY_DIR}/clang.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_LD "${CMAKE_CURRENT_BINARY_DIR}/ld.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_AR "${CMAKE_CURRENT_BINARY_DIR}/ar.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_RANLIB "${CMAKE_CURRENT_BINARY_DIR}/ranlib.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_STRIP "${CMAKE_CURRENT_BINARY_DIR}/strip.sh")
set(LINPHONE_BUILDER_TOOLCHAIN_NM "${CMAKE_CURRENT_BINARY_DIR}/nm.sh")
set(COMMON_FLAGS "-arch ${SYSTEM_PROCESSOR} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions")
set(LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS "${COMMON_FLAGS} -Dasm=__asm")
set(LINPHONE_BUILDER_TOOLCHAIN_CFLAGS "-std=c99")
set(LINPHONE_BUILDER_TOOLCHAIN_OBJCFLAGS "-std=c99 ${COMMON_FLAGS} -x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch")
set(LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS "-arch ${SYSTEM_PROCESSOR}")
include(CMakeForceCompiler)
set(CMAKE_CROSSCOMPILING TRUE)
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Darwin")
set(CMAKE_SYSTEM_PROCESSOR ${SYSTEM_PROCESSOR})
# Define the compiler
CMAKE_FORCE_C_COMPILER(${LINPHONE_BUILDER_TOOLCHAIN_CC} Clang)
CMAKE_FORCE_CXX_COMPILER(${LINPHONE_BUILDER_TOOLCHAIN_CXX} Clang)
set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH} ${CMAKE_INSTALL_PREFIX})
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Restrict pkg-config to search in the install directory
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
############################################################################
# toolchain-ios-armv7.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(SYSTEM_PROCESSOR armv7)
set(COMPILER_PREFIX "armv7-apple-darwin")
set(PLATFORM "OS")
include(toolchains/ios/toolchain-ios.cmake)
set(LINPHONE_BUILDER_TOOLCHAIN_CFLAGS "${LINPHONE_BUILDER_TOOLCHAIN_CFLAGS} -mcpu=cortex-a8")
############################################################################
# toolchain-ios-armv7s.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(SYSTEM_PROCESSOR armv7s)
set(COMPILER_PREFIX "armv7s-apple-darwin")
set(PLATFORM "OS")
include(toolchains/ios/toolchain-ios.cmake)
############################################################################
# toolchan-ios-i386.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(SYSTEM_PROCESSOR i386)
set(COMPILER_PREFIX "i386-apple-darwin")
set(PLATFORM "Simulator")
include(toolchains/ios/toolchain-ios.cmake)
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