Commit 8a1c3000 authored by jehan's avatar jehan

merge vios IOS with master

parent 7c98f213
......@@ -39,7 +39,7 @@
url = http://git.chromium.org/webm/libvpx.git
[submodule "submodules/externals/zrtpcpp"]
path = submodules/externals/zrtpcpp
url = git://github.com/wernerd/ZRTPCPP.git
url = git://git.linphone.org/zrtpcpp.git
[submodule "submodules/mssilk"]
path = submodules/mssilk
url = git://git.linphone.org/mssilk.git
......
......@@ -33,7 +33,6 @@ typedef enum _Connectivity {
@private
SCNetworkReachabilityContext proxyReachabilityContext;
SCNetworkReachabilityRef proxyReachability;
CFReadStreamRef mReadStream;
NSTimer* mIterateTimer;
id<LogView> mLogView;
bool isbackgroundModeEnabled;
......
......@@ -547,7 +547,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
[self configurePayloadType:"MP4V-ES" fromPrefKey:@"mp4v-es_preference" withRate:90000];
[self configurePayloadType:"H264" fromPrefKey:@"h264_preference" withRate:90000];
[self configurePayloadType:"VP8-DRAFT-0-3-2" fromPrefKey:@"vp8_preference" withRate:90000];
[self configurePayloadType:"VP8" fromPrefKey:@"vp8_preference" withRate:90000];
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
linphone_core_enable_video(theLinphoneCore, enableVideo, enableVideo);
......@@ -564,7 +564,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
} else {
isbackgroundModeEnabled=false;
}
}
- (BOOL)isNotIphone3G
{
......@@ -645,42 +645,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
ms_error("cannot get current transport");
}
if (mReadStream == nil && transportValue.udp_port>0) { //only for udp
int sipsock = linphone_core_get_sip_socket(theLinphoneCore);
//disable keepalive handler
linphone_core_enable_keep_alive(theLinphoneCore, false);
const char *port;
addr=linphone_address_new(linphone_proxy_config_get_addr(proxyCfg));
memset(&hints,0,sizeof(hints));
hints.ai_family=linphone_core_ipv6_enabled(theLinphoneCore) ? AF_INET6 : AF_INET;
port=linphone_address_get_port(addr);
if (port==NULL) port="5060";
err=getaddrinfo(linphone_address_get_domain(addr),port,&hints,&res);
if (err!=0){
ms_error("getaddrinfo() failed for %s: %s",linphone_address_get_domain(addr),gai_strerror(err));
linphone_address_destroy(addr);
return;
}
err=connect(sipsock,res->ai_addr,res->ai_addrlen);
if (err==-1){
ms_error("Connect failed: %s",strerror(errno));
}
freeaddrinfo(res);
CFStreamCreatePairWithSocket(NULL, (CFSocketNativeHandle)sipsock, &mReadStream,nil);
if (!CFReadStreamSetProperty(mReadStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP)) {
ms_error("cannot set service type to voip for read stream");
}
if (!CFReadStreamOpen(mReadStream)) {
ms_error("cannot open read stream");
}
}
}
else {
ms_warning("Entering lite bg mode");
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setDelegate:nil];
[self destroyLibLinphone];
}
......@@ -821,17 +790,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
//enable sip keepalive
linphone_core_enable_keep_alive(theLinphoneCore, true);
}
if (mReadStream !=nil) {
//unconnect
int socket = linphone_core_get_sip_socket(theLinphoneCore);
struct sockaddr hints;
memset(&hints,0,sizeof(hints));
hints.sa_family=AF_UNSPEC;
connect(socket,&hints,sizeof(hints));
CFReadStreamClose(mReadStream);
CFRelease(mReadStream);
mReadStream=nil;
}
}
-(void) registerLogView:(id<LogView>) view {
mLogView = view;
......
......@@ -265,9 +265,9 @@
-(void) displayIncomingCallNotigicationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];
if (notif)
......
......@@ -22,28 +22,35 @@ $ sudo mv gas-preprocessor.pl /opt/local/bin/.
Link macport libtoolize to glibtoolize (sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize)
Link host's strings to simulator SDK (ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings)
You may update variable SDK_VERSION from file submodules/build/iphone-config.site according to your iPhone SDK version. Current is 4.0
To generate the liblinphone dual arch sdk, once the above commands have been executed:
*******************************************
*******GPL versus non GPL******************
*******************************************
This sdk can be generated in 2 flavors. Firt is GPL, it means liblinphone include GPL third parties like FFMPEG or x264.
If you choose this flavor, your final application must comply with GPL. This is the default mode.
To generate the liblinphone multi arch sdkin GPL mode, once the above commands have been executed:
cd submodules/build
make all
In case you upgrade your IOS SDK, you may force configure by using make targets <clean> and <clean-makefile>
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip.
If you choose this flavor, your final application is still subject to GPL except if you have an alternative license for liblinphone, mediastremer2, ortp, exosip, osip.
To generate the liblinphone multi arch sdkin non GPL mode, once the above commands have been executed:
cd submodules/build
make all enable_gpl=no
******************************************
****Third party, subject to lincense*i****
******************************************
The liblinphone-sdk is compiled with third parties code that are subject to license, specially: AMR, SILK and X264.
Linphone activates/de-activates these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_X264 positioned in xcode.
Before embeding these 3 codecs in the final application, make sure to have the right to do so.
******************************************
In case you upgrade your IOS SDK, you may force configure by using make targets <veryclean>
Libraries are available from liblinphone-sdk/
AMR plugin
liblinphone-sdk contains Linphone ARM plugin. As AMR may require to pay for patents, it is not enabled unless Linphone for iphone is compiled with gcc flag HAVE_AMR.
SILK plugin
liblinphone-sdk contains Linphone SILK plugin.
As Skype requires that you accept its license, the plugin is not compiled and enabled unless:
- you compile the SDK with enable_silk=yes flag (make);
- you compile the UI with HAVE_SILK preprocessor macro (xcode).
- you compile add libmssilk.so to the list a library (xcode).
ZRTP
liblinphone-sdk depends on the GNU LIBZRTPCPP extension for ZRTP support.
As the license of this library is GPLv3+ it is not enabled unless the enable_zrtp=yes option is passed to the make command.
Add liblinphone-sdk/lib/libzrtpcpp.a to XCode. Define sip property media_encryption to "zrtp" in linphonerc.
Note that activiting ZRTP makes the license of the whole application GPLv3+.
liblinphone xcode subproject: This subproject is just for debuggingi purpose, do not compile it until you know exactly what you are doing.
......@@ -192,7 +192,7 @@
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<true/>
<key>Key</key>
<string>backgroundmode_preference</string>
<key>Title</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>Linphone</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icone-linphone-57.png</string>
<key>CFBundleIdentifier</key>
<string>org.linphone.phone</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.4.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.7.3</string>
<key>NSMainNibFile</key>
<string>PhoneMainView</string>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
<string>audio</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>wifi</string>
<string>microphone</string>
</array>
<key>UIRequiresPersistentWiFi</key>
<true/>
</dict>
</plist>
This diff is collapsed.
......@@ -19,11 +19,33 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
all:
make -f builder-iphone-os.mk all \
&& make -f builder-iphone-simulator.mk all \
&& make -f builder-iphone-os.mk host=armv7-apple-darwin all \
&& make -f builder-iphone-os.mk delivery-sdk
enable_gpl=yes
.NOTPARALLEL all: build warning
ifeq ($(enable_gpl),yes)
warning:
@echo
@echo "*****************************************************************"
@echo "*****************************************************************"
@echo "*****CAUTION, this liblinphone SDK is built using GPL code ******"
@echo "*****To disable gpl code, use make enable_gpl=no *************"
@echo "*****************************************************************"
@echo "*****************************************************************"
else
warning:
@echo
@echo "*****************************************************************"
@echo "*****************************************************************"
@echo "*****linphone SDK without GPL code ******"
@echo "*****************************************************************"
@echo "*****************************************************************"
endif
build:
make -f builder-iphone-os.mk all enable_gpl=$(enable_gpl) \
&& make -f builder-iphone-simulator.mk all enable_gpl=$(enable_gpl)\
&& make -f builder-iphone-os.mk host=armv7-apple-darwin all enable_gpl=$(enable_gpl)\
&& make -f builder-iphone-os.mk delivery-sdk
clean:
make -f builder-iphone-simulator.mk clean \
&& make -f builder-iphone-os.mk clean \
......
......@@ -21,8 +21,6 @@
############################################################################
host?=armv6-apple-darwin
enable_zrtp?=no
enable_silk?=no
config_site:=iphone-config.site
library_mode:= --disable-shared --enable-static
linphone_configure_controls= \
......@@ -38,21 +36,11 @@ linphone_configure_controls= \
--disable-x11 \
--with-gsm=$(prefix) \
--disable-tests \
LIBZRTPCPP_CFLAGS="-I$(prefix)/include" \
LIBZRTPCPP_LIBS="-L$(prefix)/lib -lzrtpcpp -lcrypto" \
SRTP_LIBS="-L$(prefix)/lib -lsrtp -lcrypto" \
SRTP_CFLAGS="-I$(prefix)/include" \
--enable-vp8 \
--with-srtp=$(prefix) \
SPEEX_CFLAGS="-I$(prefix)/include" \
SPEEXDSP_CFLAGS="-I$(prefix)/include" \
SPEEXDSP_LIBS="-L$(prefix)/lib -lspeexdsp" \
SPEEX_LIBS="-L$(prefix)/lib -lspeexdsp -lspeex " \
OPENSSL_CFLAGS="-I$(prefix)/include" \
OPENSSL_LIBS="-L$(prefix)/lib -lssl -lcrypto"
ifeq ($(enable_zrtp),yes)
linphone_configure_controls+= --with-srtp=$(prefix) --enable-zrtp=yes --disable-tests
endif
SPEEX_LIBS="-L$(prefix)/lib -lspeexdsp -lspeex "
#path
BUILDER_SRC_DIR?=$(shell pwd)/../
......@@ -61,15 +49,34 @@ BUILDER_BUILD_DIR?=$(shell pwd)/../build-$(host)
LINPHONE_SRC_DIR=$(BUILDER_SRC_DIR)/linphone
LINPHONE_BUILD_DIR=$(BUILDER_BUILD_DIR)/linphone
osip_dir?=externals/osip
all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk
eXosip_dir?=externals/exosip
$(LINPHONE_BUILD_DIR)/enable_gpl:
mkdir -p $(LINPHONE_BUILD_DIR)
touch $(LINPHONE_BUILD_DIR)/enable_gpl
rm -f $(LINPHONE_BUILD_DIR)/disable_gpl
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
speex_dir?=externals/speex
$(LINPHONE_BUILD_DIR)/disable_gpl:
mkdir -p $(LINPHONE_BUILD_DIR)
touch $(LINPHONE_BUILD_DIR)/disable_gpl
rm -f $(LINPHONE_BUILD_DIR)/enable_gpl
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
gsm_dir?=externals/gsm
ifeq ($(enable_gpl),yes)
linphone_configure_controls+= --enable-ffmpeg --enable-zrtp
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/enable_gpl
else
linphone_configure_controls+= --disable-ffmpeg --disable-zrtp
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/disable_gpl
endif
zrtpcpp_dir?=externals/zrtpcpp
osip_dir=externals/osip
eXosip_dir=externals/exosip
speex_dir=externals/speex
gsm_dir=externals/gsm
MSILBC_SRC_DIR:=$(BUILDER_SRC_DIR)/msilbc
MSILBC_BUILD_DIR:=$(BUILDER_BUILD_DIR)/msilbc
......@@ -85,7 +92,6 @@ endif
prefix?=$(BUILDER_SRC_DIR)/../liblinphone-sdk/$(host)
all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk
clean-makefile: clean-makefile-linphone
clean: clean-linphone
......@@ -97,7 +103,7 @@ veryclean: veryclean-linphone
rm -rf $(BUILDER_BUILD_DIR)
.NOTPARALLEL build-linphone: init build-openssl build-srtp build-zrtpcpp build-osip2 build-eXosip2 build-speex build-libgsm build-ffmpeg build-libvpx $(LINPHONE_BUILD_DIR)/Makefile
.NOTPARALLEL build-linphone: init build-openssl build-srtp build-zrtpcpp build-osip2 build-eXosip2 build-speex build-libgsm build-ffmpeg build-libvpx detect_gpl_mode_switch $(LINPHONE_BUILD_DIR)/Makefile
cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig export CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make newdate && make && make install
clean-linphone: clean-osip2 clean-eXosip2 clean-speex clean-libgsm clean-srtp clean-zrtpcpp clean-msilbc clean-libilbc clean-openssl clean-msamr clean-mssilk clean-ffmpeg clean-libvpx clean-msx264
......@@ -166,7 +172,7 @@ $(BUILDER_BUILD_DIR)/$(eXosip_dir)/Makefile: $(BUILDER_SRC_DIR)/$(eXosip_dir)/co
mkdir -p $(BUILDER_BUILD_DIR)/$(eXosip_dir)
cd $(BUILDER_BUILD_DIR)/$(eXosip_dir)/\
&& PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \
$(BUILDER_SRC_DIR)/$(eXosip_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} CFLAGS="-I$(prefix)/include -L$(prefix)/lib -lcrypto" --enable-openssl --disable-tools
$(BUILDER_SRC_DIR)/$(eXosip_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} CFLAGS="-I$(prefix)/include -L$(prefix)/lib -lcrypto -DMULTITASKING_ENABLED" --enable-openssl --disable-tools
build-eXosip2: $(BUILDER_BUILD_DIR)/$(eXosip_dir)/Makefile
cd $(BUILDER_BUILD_DIR)/$(eXosip_dir) \
......
......@@ -20,6 +20,7 @@
#
############################################################################
mssilk_dir?=mssilk
enable_silk?=yes
$(BUILDER_SRC_DIR)/$(mssilk_dir)/configure:
echo -e "\033[01;32m Running autogen for mssilk in $(BUILDER_SRC_DIR)/$(mssilk_dir) \033[0m"
......
......@@ -19,13 +19,15 @@ $(OPENSSL_BUILD_DIR)/Configure:
$(OPENSSL_BUILD_DIR)/Makefile: $(OPENSSL_BUILD_DIR)/Configure
cd $(OPENSSL_BUILD_DIR) \
&& host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \
&& ./Configure -openssldir=$(prefix) --cross-compile-prefix=$$SDK_BIN_PATH/ BSD-generic32 no-asm
&& ./Configure --prefix=$(prefix) --cross-compile-prefix=$$SDK_BIN_PATH/ BSD-generic32 no-asm
build-openssl: $(OPENSSL_BUILD_DIR)/Makefile
cd $(OPENSSL_BUILD_DIR) && host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \
&& make CC="$$CC" build_crypto build_ssl \
&& make CC="$$CC" build_crypto build_ssl libcrypto.pc libssl.pc\
&& cp -r include $(prefix)/ \
&& cp lib*.a $(prefix)/lib
&& cp lib*.a $(prefix)/lib \
&& cp libcrypto.pc $(prefix)/lib/pkgconfig/. \
&& cp libssl.pc $(prefix)/lib/pkgconfig/. \
clean-openssl:
cd $(OPENSSL_BUILD_DIR) && make clean
......
$(BUILDER_SRC_DIR)/$(zrtpcpp_dir)/CMakeLists.txt.tracker: $(BUILDER_SRC_DIR)/build/builders.d/zrtpcpp.CMakeLists.txt
cp $(BUILDER_SRC_DIR)/build/builders.d/zrtpcpp.CMakeLists.txt $(BUILDER_SRC_DIR)/$(zrtpcpp_dir)/CMakeLists.txt
#I coudn't manage to crosscompile using only -D arguments to cmake
#Thus the use of a toolchain file.
$(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/Makefile: $(BUILDER_SRC_DIR)/$(zrtpcpp_dir)/CMakeLists.txt.tracker
zrtpcpp_dir=externals/zrtpcpp
$(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/Makefile:
mkdir -p $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)
cd $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/\
&& host_alias=$(host) . $(BUILDER_SRC_DIR)/build/$(config_site) \
&& cmake $(BUILDER_SRC_DIR)/$(zrtpcpp_dir) -Denable-ccrtp=false -DCMAKE_TOOLCHAIN_FILE=$(BUILDER_SRC_DIR)build/iphone-toolchain.cmake \
-LH -Wdev -DCMAKE_C_COMPILER=$$SDK_BIN_PATH/gcc -DCMAKE_CXX_COMPILER=$$SDK_BIN_PATH/g++ \
-DCMAKE_SYSTEM_PROCESSOR=$$ARCH -DCMAKE_C_FLAGS="$$COMMON_FLAGS" -DCMAKE_CXX_FLAGS="$$COMMON_FLAGS" \
-DCMAKE_INSTALL_PREFIX=$(prefix) -DCMAKE_FIND_ROOT_PATH="$(prefix)"
-DCMAKE_INSTALL_PREFIX=$(prefix) -DCMAKE_FIND_ROOT_PATH="$(prefix) -DBUILD_STATIC=ON "
# Used toolchain: $(TC)
ifeq ($(enable_zrtp),yes)
build-zrtpcpp: $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/Makefile
echo "Build ZRTP - prefix $(prefix)"
@echo "Build ZRTP - prefix $(prefix)"
cd $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir) && make VERBOSE=1 && make install
else
build-zrtpcpp:
echo "Build of zrtpcpp disabled"
endif
clean-zrtpcpp:
-cd $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir) && make clean
clean-makefile-zrtpcpp: clean-zrtpcpp
-rm -f $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/Makefile
-rm -f $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)/CMakeCache.txt
veryclean-zrtpcpp:
-rm -rf $(BUILDER_BUILD_DIR)/$(zrtpcpp_dir)
......
# Copyright (C) 2009 Werner Dittman
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
cmake_minimum_required(VERSION 2.6)
PROJECT(libzrtpcpp)
SET(CPACK_PACKAGE_VERSION_MAJOR 2)
SET(CPACK_PACKAGE_VERSION_MINOR 0)
SET(CPACK_PACKAGE_VERSION_PATCH 0)
set (VERSION 2.0.0)
set (SOVERSION 2)
set (PACKAGE libzrtpcpp)
if(MSVC60)
set(BUILD_STATIC ON CACHE BOOL "static linking only" FORCE)
MARK_AS_ADVANCED(BUILD_STATIC)
else()
option(BUILD_STATIC "Set to OFF to build shared libraries" ON)
endif()
# set to true for debug and trace during CMakeLists development
set(CMAKE_VERBOSE_MAKEFILE FALSE)
MESSAGE( STATUS "Configuring GNU ${PROJECT_NAME} ${VERSION}...")
# include most of the fine stuff we need
include(cmake/Modules/FindGcryptConfig.cmake)
include(FindPkgConfig)
include(CheckLibraryExists)
include(CheckIncludeFiles)
include(cmake/Modules/AutoArgs.cmake)
if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
include(cmake/Modules/GeneratePackage.cmake)
GENERATE_PACKAGING(${PACKAGE} ${VERSION})
endif()
# check the -Denable-ccrtp setting, defaults to true
enable_arg(ccrtp true "Enable GNU ccRTP support for GNU ZRTP")
args_help()
# this caused problems in debian where it has to always be lib....
set(LIBDIRNAME "lib")
if (NOT EXISTS /etc/debian_version)
if ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" )
set(LIBDIRNAME "lib64")
endif()
endif()
# setup the Thread include and lib
find_package(Threads)
if(CMAKE_HAVE_PTHREAD_H)
set(HAVE_PTHREAD_H TRUE)
endif()
set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
if(enable_ccrtp)
if (USES_CCRTP_INCLUDE_DIRS)
message(STATUS " Using local commoncpp dependency")
else()
find_package(PkgConfig)
pkg_check_modules(USES_CCRTP libccrtp>=2.0.0)
endif()
include_directories(${USES_CCRTP_INCLUDE_DIRS})
link_directories(${USES_CRTP_LIBRARY_DIRS})
add_definitions(${USES_CCRTP_CFLAGS})
set (LIBS ${LIBS} ${USES_CCRTP_LDFLAGS} ${USES_CCRTP_LIBRARIES})
endif()
if (CMAKE_CROSSCOMPILING)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include")
## set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/*")
endif()
# now get info about crypto libraries
gcr_check(GCRYPT gcrypt)
#if(GCRYPT_FOUND)
# check_include_files(gcrypt.h HAVE_GCRYPT_H)
# set(LIBS ${LIBS} ${GCRYPT_LIBRARIES})
# set(BUILD_REQ "libgcrypt-devel")
# set(CRYPTOBACKEND="")
# set(PACKAGE_REQ "libgcrypt")
#else()
pkg_check_modules(OPENSSL libcrypto>=0.9.8)
if (OPENSSL_FOUND)
check_include_files(openssl/bn.h HAVE_OPENSSL_BN_H)
check_include_files(openssl/aes.h HAVE_OPENSSL_AES_H)
check_include_files(openssl/sha.h HAVE_OPENSSL_SHA_H)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -lcrypto")
check_library_exists(crypto EVP_CipherInit_ex "${CMAKE_INSTALL_PREFIX}/lib" HAVE_SSL_CRYPT)
# don't test HAVE_SSL_CRYPT_FOUND as it doesn't work
if (HAVE_OPENSSL_BN_H_FOUND)
# AND HAVE_OPENSSL_AES_H_FOUND AND HAVE_OPENSSL_SHA_H_FOUND))
message(FATAL_ERROR "Openssl crypto library not found")
endif()
set(LIBS ${LIBS} -lcrypto)
set(CRYPTOBACKEND "libcrypto >= 0.9.8")
set(BUILD_REQ "libopenssl-devel >= 0.9.8")
set(PACKAGE_REQ "libopenssl >= 0.9.8")
else()
message(FATAL_ERROR "No crypto library found")
endif()
#endif()
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(string.h HAVE_STRING_H)
# necessary and required modules checked, ready to generate config.h
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# the following set(...) commands are only to have backward
# compatibility with autoconf stuff to generate the pc file
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${prefix}/bin)
set(libdir ${prefix}/lib)
set(includedir ${prefix}/include)
set(PACKAGE pkgconfig)
configure_file(libzrtpcpp.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp.pc @ONLY)
configure_file(libzrtpcpp.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp.spec @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_definitions(-g -O2 -fno-strict-aliasing)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wno-long-long -Wno-char-subscripts)
add_definitions(-Wall -ansi -pedantic)
add_definitions(-DNEW_STDCPP)
# add_definitions(-D__EXPORT=)
endif()
add_subdirectory(src)
if (enable_ccrtp)
add_subdirectory(demo)
endif()
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/package/)
MESSAGE(STATUS "package dir not found")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/package/)
endif()
########### install files ###############
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp.pc DESTINATION ${LIBDIRNAME}/pkgconfig)
if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
########### Add uninstall target ###############
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
endif()
......@@ -38,3 +38,4 @@ RANLIB=${SDK_BIN_PATH}/ranlib
CPPFLAGS="-Dasm=__asm"
LDFLAGS="-Wl,-syslibroot,${SYSROOT_PATH} -framework CFNetwork"
OBJCFLAGS="-x objective-c -fexceptions -fasm-blocks -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch"
SET (CMAKE_SYSTEM_NAME "Generic")
SET (CMAKE_SYSTEM_PROCESSOR "i386")
SET (SDKVER "4.3")
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
SET (CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX}" "${SDKROOT}" "${DEVROOT}")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
zrtpcpp @ 9cac07ec
Subproject commit 93dbdb3159f55bb35f69c13df1f60ac4901c88fb
Subproject commit 9cac07ec1a1f57bfd0198c0895fae42a79a62a9f
......@@ -22,6 +22,9 @@
220ED1A913A9041800AC21E0 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 220ED1A813A9041800AC21E0 /* AVFoundation.framework */; };
220ED1AC13A9062600AC21E0 /* nowebcam.h in Headers */ = {isa = PBXBuildFile; fileRef = 220ED1AA13A9062500AC21E0 /* nowebcam.h */; };
220ED1AD13A9062600AC21E0 /* nowebcam.c in Sources */ = {isa = PBXBuildFile; fileRef = 220ED1AB13A9062500AC21E0 /* nowebcam.c */; };
2211DB9C1476539600DEE054 /* l16.c in Sources */ = {isa = PBXBuildFile; fileRef = 2211DB9B1476539600DEE054 /* l16.c */; };
2211DB9F14765CED00DEE054 /* libmssilk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB9E14765CEC00DEE054 /* libmssilk.a */; };
2211DBA1147660BB00DEE054 /* libSKP_SILK_SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DBA0147660BB00DEE054 /* libSKP_SILK_SDK.a */; };
221F589C13AB4FC500D603C9 /* msvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F589B13AB4FC500D603C9 /* msvideo.c */; };
221F58A013AB50F800D603C9 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 221F589F13AB50F800D603C9 /* CoreMedia.framework */; };
221F58A213AB6F8100D603C9 /* pixconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F58A113AB6F8000D603C9 /* pixconv.c */; };
......@@ -256,6 +259,9 @@
220ED1A813A9041800AC21E0 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
220ED1AA13A9062500AC21E0 /* nowebcam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nowebcam.h; sourceTree = "<group>"; };
220ED1AB13A9062500AC21E0 /* nowebcam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nowebcam.c; sourceTree = "<group>"; };
2211DB9B1476539600DEE054 /* l16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = l16.c; sourceTree = "<group>"; };
2211DB9E14765CEC00DEE054 /* libmssilk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmssilk.a; path = "../liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmssilk.a"; sourceTree = "<group>"; };
2211DBA0147660BB00DEE054 /* libSKP_SILK_SDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSKP_SILK_SDK.a; path = "../liblinphone-sdk/apple-darwin/lib/libSKP_SILK_SDK.a"; sourceTree = "<group>"; };
221F589913AB4EEE00D603C9 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
221F589B13AB4FC500D603C9 /* msvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msvideo.c; sourceTree = "<group>"; };
221F589D13AB503F00D603C9 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
......@@ -508,6 +514,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2211DB9F14765CED00DEE054 /* libmssilk.a in Frameworks */,
7066FC0A13E830B800EFC6DC /* libvpx.a in Frameworks */,
70E542F113E147CE002BA2C0 /* QuartzCore.framework in Frameworks */,
70E542EE13E147C7002BA2C0 /* OpenGLES.framework in Frameworks */,
......@@ -537,6 +544,7 @@
buildActionMask = 2147483647;
files = (
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
2211DBA1147660BB00DEE054 /* libSKP_SILK_SDK.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -554,6 +562,8 @@
0867D691FE84028FC02AAC07 /* liblinphone */ = {
isa = PBXGroup;
children = (
2211DBA0147660BB00DEE054 /* libSKP_SILK_SDK.a */,
2211DB9E14765CEC00DEE054 /* libmssilk.a */,
7066FC0913E830B800EFC6DC /* libvpx.a */,
70E542F013E147CE002BA2C0 /* QuartzCore.framework */,
70E542ED13E147C7002BA2C0 /* OpenGLES.framework */,
......@@ -687,6 +697,7 @@
222CA5DC11F6CF7600621220 /* src */ = {
isa = PBXGroup;
children = (
2211DB9B1476539600DEE054 /* l16.c */,
22512698145F13CE0041FBF2 /* aqsnd.c */,
F4D9F25E14583B580035B0D0 /* bitratedriver.c */,
F4D9F25F14583B580035B0D0 /* qosanalyzer.c */,
......@@ -1269,6 +1280,7 @@
F4D9F26014583B580035B0D0 /* bitratedriver.c in Sources */,
F4D9F26114583B580035B0D0 /* qosanalyzer.c in Sources */,
22512699145F13CE0041FBF2 /* aqsnd.c in Sources */,
2211DB9C1476539600DEE054 /* l16.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1346,6 +1358,7 @@
TARGET_OS_IPHONE,
);
GCC_UNROLL_LOOPS = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
HEADER_SEARCH_PATHS = (
linphone/mediastreamer2/build/iphone,
linphone/mediastreamer2/include,
......@@ -1359,6 +1372,10 @@
"../liblinphone-sdk/apple-darwin/include",
);
INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../liblinphone-sdk/apple-darwin/lib\"",
);
PRODUCT_NAME = linphone;
SKIP_INSTALL = YES;
};
......@@ -1396,6 +1413,7 @@
TARGET_OS_IPHONE,
);
GCC_UNROLL_LOOPS = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
HEADER_SEARCH_PATHS = (
linphone/mediastreamer2/build/iphone,
linphone/mediastreamer2/include,
......@@ -1409,6 +1427,10 @@
"../liblinphone-sdk/apple-darwin/include",
);
INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../liblinphone-sdk/apple-darwin/lib\"",
);
PRODUCT_NAME = linphone;
SKIP_INSTALL = YES;
};
......@@ -1572,6 +1594,7 @@
TARGET_OS_IPHONE,
);
GCC_UNROLL_LOOPS = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
HEADER_SEARCH_PATHS = (
linphone/mediastreamer2/build/iphone,
linphone/mediastreamer2/include,
......@@ -1585,6 +1608,10 @@
"../liblinphone-sdk/apple-darwin/include",
);