diff --git a/.gitmodules b/.gitmodules index 91ccd4cab..3cbcd38e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "submodules/tunnel"] path = submodules/tunnel url = gitosis@git.linphone.org:tunnel +[submodule "submodules/bcg729"] + path = submodules/bcg729 + url = git://git.linphone.org/bcg729.git diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h index 0de437353..cf01f937c 100644 --- a/Classes/LinphoneAppDelegate.h +++ b/Classes/LinphoneAppDelegate.h @@ -20,6 +20,7 @@ #import #import +#import "CoreTelephony/CTCallCenter.h" #define DIALER_TAB_INDEX 1 #define CONTACTS_TAB_INDEX 2 @@ -39,7 +40,8 @@ IBOutlet PhoneViewController* myPhoneViewController; CallHistoryTableViewController* myCallHistoryTableViewController; ContactPickerDelegate* myContactPickerDelegate; - + + CTCallCenter* callCenter; } @property (nonatomic, retain) IBOutlet UIWindow *window; diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 52d29b56b..8cbd45e2c 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -22,6 +22,9 @@ #import "ContactPickerDelegate.h" #import "AddressBook/ABPerson.h" +#import "CoreTelephony/CTCallCenter.h" +#import "CoreTelephony/CTCall.h" + #import "ConsoleViewController.h" #import "MoreViewController.h" #include "CallHistoryTableViewController.h" @@ -29,6 +32,13 @@ #include "LinphoneManager.h" #include "linphonecore.h" +#if __clang__ && __arm__ +extern int __divsi3(int a, int b); +int __aeabi_idiv(int a, int b) { + return __divsi3(a,b); +} +#endif + @implementation linphoneAppDelegate @synthesize window; @@ -36,6 +46,24 @@ @synthesize myPeoplePickerController; @synthesize myPhoneViewController; +-(void) handleGSMCallInteration: (id) cCenter { + CTCallCenter* ct = (CTCallCenter*) cCenter; + + int callCount = [ct.currentCalls count]; + if (!callCount) { + NSLog(@"No GSM call -> enabling SIP calls"); + linphone_core_set_max_calls([LinphoneManager getLc], 3); + } else { + NSLog(@"%d GSM call(s) -> disabling SIP calls", callCount); + /* pause current call, if any */ + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + if (call) { + NSLog(@"Pausing SIP call"); + linphone_core_pause_call([LinphoneManager getLc], call); + } + linphone_core_set_max_calls([LinphoneManager getLc], 0); + } +} -(void)applicationWillResignActive:(UIApplication *)application { LinphoneCore* lc = [LinphoneManager getLc]; @@ -55,11 +83,31 @@ } - (void)applicationDidEnterBackground:(UIApplication *)application { - [[LinphoneManager instance] enterBackgroundMode]; + if (![[LinphoneManager instance] enterBackgroundMode]) { + // destroying eventHandler if app cannot go in background. + // Otherwise if a GSM call happen and Linphone is resumed, + // the handler will be called before LinphoneCore is built. + // Then handler will be restored in appDidBecomeActive cb + callCenter.callEventHandler = nil; + [callCenter release]; + callCenter = nil; + } } - (void)applicationDidBecomeActive:(UIApplication *)application { [[LinphoneManager instance] becomeActive]; + if (callCenter == nil) { + callCenter = [[CTCallCenter alloc] init]; + callCenter.callEventHandler = ^(CTCall* call) { + // post on main thread + [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) + withObject:callCenter + waitUntilDone:YES]; + }; + } + // check call state at startup + [self handleGSMCallInteration:callCenter]; + LinphoneCore* lc = [LinphoneManager getLc]; LinphoneCall* call = linphone_core_get_current_call(lc); if (call == NULL) @@ -107,6 +155,9 @@ #ifdef HAVE_AMR @"YES",@"amr_8k_preference", // enable amr by default if compiled with #endif +#ifdef HAVE_G729 + @"YES",@"g729_preference", // enable amr by default if compiled with +#endif @"NO",@"debugenable_preference", //@"+33",@"countrycode_preference", nil]; @@ -117,6 +168,7 @@ [[NSUserDefaults standardUserDefaults] synchronize]; } + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ /* @@ -166,9 +218,16 @@ [[LinphoneManager instance] setCallDelegate:myPhoneViewController]; [[LinphoneManager instance] startLibLinphone]; - + [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound]; - + + callCenter = [[CTCallCenter alloc] init]; + callCenter.callEventHandler = ^(CTCall* call) { + // post on main thread + [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) + withObject:callCenter + waitUntilDone:YES]; + }; return YES; } diff --git a/Classes/LinphoneUI/FastAddressBook.m b/Classes/LinphoneUI/FastAddressBook.m index 1f88a0077..e1e3334c6 100644 --- a/Classes/LinphoneUI/FastAddressBook.m +++ b/Classes/LinphoneUI/FastAddressBook.m @@ -89,13 +89,13 @@ void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void -(id) initWithRecord:(ABRecordRef) aRecord ofType:(NSString*) type { if ((self = [super init])) { record=CFRetain(aRecord); - numberType= type?[type retain]:@"unkown"; + numberType= [type?type:@"unknown" retain]; } return self; } - (void)dealloc { - [super dealloc]; CFRelease(record); [numberType release]; + [super dealloc]; } @end diff --git a/Classes/LinphoneUI/LinphoneManager.h b/Classes/LinphoneUI/LinphoneManager.h index b7a8414cd..046835fe2 100644 --- a/Classes/LinphoneUI/LinphoneManager.h +++ b/Classes/LinphoneUI/LinphoneManager.h @@ -75,7 +75,7 @@ typedef struct _CallContext { -(BOOL) isNotIphone3G; -(void) destroyLibLinphone; --(void) enterBackgroundMode; +-(BOOL) enterBackgroundMode; -(void) becomeActive; -(void) kickOffNetworkConnection; -(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log; diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 563b961b0..75a643344 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -50,6 +50,9 @@ extern void libmsx264_init(); extern void libmssilk_init(); #endif +#if HAVE_G729 +extern void libmsbcg729_init(); +#endif @implementation LinphoneManager @synthesize callDelegate; @synthesize registrationDelegate; @@ -365,6 +368,7 @@ static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, Lin cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil ,nil]; [error show]; + [error release]; } } @@ -676,6 +680,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach [self configurePayloadType:"PCMU" fromPrefKey:@"pcmu_preference" withRate:8000]; [self configurePayloadType:"PCMA" fromPrefKey:@"pcma_preference" withRate:8000]; [self configurePayloadType:"G722" fromPrefKey:@"g722_preference" withRate:8000]; + [self configurePayloadType:"G729" fromPrefKey:@"g729_preference" withRate:8000]; //get video codecs from linphonerc const MSList *videoCodecs=linphone_core_get_video_codecs(theLinphoneCore); @@ -741,6 +746,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setDelegate:nil]; if (theLinphoneCore != nil) { //just in case application terminate before linphone core initialization + NSLog(@"Destroy linphonecore"); linphone_core_destroy(theLinphoneCore); theLinphoneCore = nil; SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); @@ -750,7 +756,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } //**********************BG mode management*************************/////////// --(void) enterBackgroundMode { +-(BOOL) enterBackgroundMode { LinphoneProxyConfig* proxyCfg; linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg); linphone_core_stop_dtmf_stream(theLinphoneCore); @@ -790,11 +796,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach if (linphone_core_get_sip_transports(theLinphoneCore, &transportValue)) { ms_error("cannot get current transport"); } - + return YES; } else { ms_warning("Entering lite bg mode"); [self destroyLibLinphone]; + return NO; } } @@ -840,6 +847,10 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach #ifdef HAVE_X264 libmsx264_init(); //load x264 plugin if present from the liblinphone sdk #endif + +#if HAVE_G729 + libmsbcg729_init(); // load g729 plugin +#endif /* Initialize linphone core*/ linphonec_vtable.show =NULL; @@ -855,6 +866,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach linphonec_vtable.text_received=NULL; linphonec_vtable.dtmf_received=NULL; + theLinphoneCore = linphone_core_new (&linphonec_vtable , [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]] , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] @@ -946,13 +958,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } -(void) becomeActive { - if (theLinphoneCore == nil) { //back from standby and background mode is disabled [self startLibLinphone]; } else { if (![self reconfigureLinphoneIfNeeded:currentSettings]) { - ms_message("becomming active with no config modification, make sure we are registered"); + ms_message("becoming active with no config modification, make sure we are registered"); linphone_core_refresh_registers(theLinphoneCore);//just to make sure REGISTRATION is up to date } diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 58ddac124..9b1fbf68d 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -19,6 +19,7 @@ #import "UICallButton.h" #import "LinphoneManager.h" +#import "CoreTelephony/CTCallCenter.h" @implementation UICallButton @@ -33,6 +34,22 @@ [error release]; return; } + + CTCallCenter* ct = [[CTCallCenter alloc] init]; + if ([ct.currentCalls count] > 0) { + ms_error("GSM call in progress, cancelling outgoing SIP call request"); + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) + message:NSLocalizedString(@"Please terminate GSM call",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil]; + [error show]; + [error release]; + [ct release]; + return; + } + [ct release]; + if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) { LinphoneProxyConfig* proxyCfg; //get default proxy diff --git a/Classes/StatusSubViewController.m b/Classes/StatusSubViewController.m index e0d1cadcb..f1eaa2423 100644 --- a/Classes/StatusSubViewController.m +++ b/Classes/StatusSubViewController.m @@ -60,7 +60,7 @@ } -(BOOL) updateWithRegistrationState:(LinphoneRegistrationState)state message:(NSString*) message { - + label.hidden = NO; switch(state) { case LinphoneRegistrationCleared: image.hidden = NO; diff --git a/Classes/StatusSubViewController.xib b/Classes/StatusSubViewController.xib index d93f8f7f6..9ce474c3b 100644 --- a/Classes/StatusSubViewController.xib +++ b/Classes/StatusSubViewController.xib @@ -39,7 +39,7 @@ - 292 + -2147483356 {{0, -1}, {25, 23}} @@ -66,7 +66,7 @@ - 292 + -2147483356 {{28, 0}, {280, 21}} @@ -76,7 +76,7 @@ 7 NO IBCocoaTouchFramework - No SIP account defined + CARAMBA 3 MC42NjY2NjY2NjY3AA diff --git a/Classes/VideoViewController-ipad.xib b/Classes/VideoViewController-ipad.xib index 6aee67bb2..01b0daa4c 100644 --- a/Classes/VideoViewController-ipad.xib +++ b/Classes/VideoViewController-ipad.xib @@ -35,9 +35,10 @@ 274 - {768, 1004} + {768, 1024} + 4 MAA @@ -51,10 +52,10 @@ 292 - {{-9, 0}, {777, 1004}} + {768, 1024} - + _NS:569 NO IBIPadFramework @@ -62,7 +63,7 @@ 292 - {{329, 942}, {108, 62}} + {{329, 962}, {108, 62}} @@ -105,7 +106,7 @@ 292 - {{223, 942}, {108, 62}} + {{223, 962}, {108, 62}} @@ -126,9 +127,10 @@ 292 - {{598, 779}, {170, 225}} + {{598, 799}, {170, 225}} + 3 MQA @@ -141,7 +143,7 @@ 292 - {{436, 942}, {108, 62}} + {{436, 962}, {108, 62}} @@ -164,15 +166,16 @@ 292 - {{20, 956}, {28, 28}} + {{20, 976}, {28, 28}} + _NS:567 NO IBIPadFramework - {768, 1004} + {768, 1024} @@ -190,7 +193,7 @@ 292 - {1004, 768} + {1024, 768} @@ -201,7 +204,7 @@ 292 - {{779, 598}, {225, 170}} + {{799, 598}, {225, 170}} @@ -214,7 +217,7 @@ 292 - {{341, 706}, {108, 62}} + {{351, 706}, {108, 62}} @@ -235,7 +238,7 @@ 292 - {{448, 706}, {108, 62}} + {{458, 706}, {108, 62}} @@ -257,7 +260,7 @@ 292 - {{555, 706}, {108, 62}} + {{565, 706}, {108, 62}} @@ -288,7 +291,7 @@ IBIPadFramework - {1004, 768} + {1024, 768} @@ -310,7 +313,7 @@ 292 - {1004, 768} + {1024, 768} @@ -321,7 +324,7 @@ 292 - {{779, 598}, {225, 170}} + {{799, 598}, {225, 170}} @@ -334,7 +337,7 @@ 292 - {{341, 706}, {108, 62}} + {{351, 706}, {108, 62}} @@ -355,7 +358,7 @@ 292 - {{448, 706}, {108, 62}} + {{458, 706}, {108, 62}} @@ -377,7 +380,7 @@ 292 - {{555, 706}, {108, 62}} + {{565, 706}, {108, 62}} @@ -408,7 +411,7 @@ IBIPadFramework - {1004, 768} + {1024, 768} diff --git a/PhoneMainView.xib b/PhoneMainView.xib index 3953ea8da..b4c3174c1 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -47,6 +47,7 @@ {320, 480} + 1 MSAxIDEAA @@ -140,6 +141,7 @@ 266 {{0, 431}, {320, 49}} + 3 MCAwAA @@ -366,10 +368,6 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 diff --git a/README b/README index 69c6e6e7e..4f0900f9d 100644 --- a/README +++ b/README @@ -25,8 +25,10 @@ Link macport libtoolize to glibtoolize Link host's strings to simulator SDK - $ ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings - + For Xcode prior to 4.3: + $ sudo ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings + For newer XCode: + $ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings BUILDING THE SDK @@ -63,9 +65,9 @@ After the SDK is built, just open the linphone xcode project with Xcode, and pre * Note regarding third party components subject to license -The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK and X264 codecs. -Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_X264 positioned in xcode project. -Before embeding these 3 codecs in the final application, make sure to have the right to do so. +The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and X264 codecs. +Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_X264 positioned in xcode project. +Before embeding these 4 codecs in the final application, make sure to have the right to do so. LIMITATIONS, KNOWN BUGS diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 796704773..ef6478f8b 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -133,6 +133,7 @@ 34CA8530148F646700503C01 /* MainScreenWithVideoPreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CA852E148F646700503C01 /* MainScreenWithVideoPreview.xib */; }; 34CA8536148F669900503C01 /* VideoViewController-ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CA8534148F669900503C01 /* VideoViewController-ipad.xib */; }; 34CA853A148F692A00503C01 /* MainScreenWithVideoPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */; }; + 57D8FE5F15137F69006BB25F /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57D8FE5E15137F69006BB25F /* CoreTelephony.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -490,6 +491,7 @@ 34CA8534148F669900503C01 /* VideoViewController-ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "VideoViewController-ipad.xib"; sourceTree = ""; }; 34CA8537148F692A00503C01 /* MainScreenWithVideoPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainScreenWithVideoPreview.h; sourceTree = ""; }; 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScreenWithVideoPreview.m; sourceTree = ""; }; + 57D8FE5E15137F69006BB25F /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; 70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = Resources/rootca.pem; sourceTree = ""; }; 7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = ""; }; 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; @@ -503,6 +505,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 57D8FE5F15137F69006BB25F /* CoreTelephony.framework in Frameworks */, 22D8F15B147548E2008C97DB /* libvpx.a in Frameworks */, 22D8F15C147548E2008C97DB /* QuartzCore.framework in Frameworks */, 22D8F15D147548E2008C97DB /* OpenGLES.framework in Frameworks */, @@ -917,6 +920,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 57D8FE5E15137F69006BB25F /* CoreTelephony.framework */, F07EBD1C149F40A5006F61D2 /* libtunnel.a */, 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */, 2211DB9614764F6B00DEE054 /* nogpl-thirdparties */, diff --git a/linphonerc b/linphonerc index f0dff0146..ef80ec31e 100644 --- a/linphonerc +++ b/linphonerc @@ -2,7 +2,7 @@ download_bw=380 upload_bw=380 firewall_policy=0 -mtu=0 +mtu=1300 [sip] sip_random_port=1 diff --git a/linphonerc-ipad b/linphonerc-ipad index 59853ab38..402f17b15 100644 --- a/linphonerc-ipad +++ b/linphonerc-ipad @@ -2,7 +2,7 @@ download_bw=512 upload_bw=512 firewall_policy=0 -mtu=0 +mtu=1300 [sip] sip_random_port=1 diff --git a/submodules/bcg729 b/submodules/bcg729 new file mode 160000 index 000000000..1ad5aa5ab --- /dev/null +++ b/submodules/bcg729 @@ -0,0 +1 @@ +Subproject commit 1ad5aa5abdf23bb260595b07f0705c9ede1a37d2 diff --git a/submodules/build/Makefile b/submodules/build/Makefile index 830974c99..67f2bd100 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -48,10 +48,17 @@ build: && make -f builder-iphone-os.mk host=armv7-apple-darwin all enable_gpl_third_parties=$(enable_gpl_third_parties)\ && make -f builder-iphone-os.mk delivery-sdk +ipa: build + make -f builder-iphone-simulator.mk ipa \ + && make -f builder-iphone-os.mk ipa \ + && make -f builder-iphone-os.mk host=armv7-apple-darwin ipa + + clean: make -f builder-iphone-simulator.mk clean\ && make -f builder-iphone-os.mk clean\ && make -f builder-iphone-os.mk host=armv7-apple-darwin clean + clean-makefile: make -f builder-iphone-simulator.mk clean-makefile \ && make -f builder-iphone-os.mk clean-makefile \ diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index da6484b83..b34ee547c 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -46,7 +46,7 @@ BUILDER_BUILD_DIR?=$(shell pwd)/../build-$(host) LINPHONE_SRC_DIR=$(BUILDER_SRC_DIR)/linphone LINPHONE_BUILD_DIR=$(BUILDER_BUILD_DIR)/linphone -all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk +all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk build-msbcg729 $(LINPHONE_BUILD_DIR)/enable_gpl_third_parties: mkdir -p $(LINPHONE_BUILD_DIR) @@ -94,18 +94,20 @@ endif prefix?=$(BUILDER_SRC_DIR)/../liblinphone-sdk/$(host) -clean-makefile: clean-makefile-linphone -clean: clean-linphone +clean-makefile: clean-makefile-linphone clean-makefile-msbcg729 +clean: clean-linphone clean-msbcg729 init: mkdir -p $(prefix)/include mkdir -p $(prefix)/lib/pkgconfig -veryclean: veryclean-linphone +veryclean: veryclean-linphone veryclean-msbcg729 rm -rf $(BUILDER_BUILD_DIR) + .NOTPARALLEL build-linphone: init build-openssl build-tunnel 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 + cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_LIBDIR=$(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-tunnel clean-openssl clean-msamr clean-mssilk clean-ffmpeg clean-libvpx clean-msx264 cd $(LINPHONE_BUILD_DIR) && make clean @@ -123,18 +125,18 @@ $(LINPHONE_SRC_DIR)/configure: $(LINPHONE_BUILD_DIR)/Makefile: $(LINPHONE_SRC_DIR)/configure mkdir -p $(LINPHONE_BUILD_DIR) - echo -e "\033[1mPKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + echo -e "\033[1mPKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(LINPHONE_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ ${linphone_configure_controls}\033[0m" cd $(LINPHONE_BUILD_DIR) && \ - PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ CFLAGS="$(CFLAGS) -DMS2_MINIMAL_SIZE" $(LINPHONE_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ ${linphone_configure_controls} #libphone only (asume dependencies are met) build-liblinphone: $(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 + cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig export CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make newdate && make && make install clean-makefile-liblinphone: cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile @@ -153,7 +155,7 @@ $(BUILDER_BUILD_DIR)/$(osip_dir)/Makefile: $(BUILDER_SRC_DIR)/$(osip_dir)/config $(BUILDER_SRC_DIR)/$(osip_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} build-osip2: $(BUILDER_BUILD_DIR)/$(osip_dir)/Makefile - cd $(BUILDER_BUILD_DIR)/$(osip_dir) && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install + cd $(BUILDER_BUILD_DIR)/$(osip_dir) && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install clean-osip2: cd $(BUILDER_BUILD_DIR)/$(osip_dir) && make clean @@ -172,12 +174,12 @@ $(BUILDER_SRC_DIR)/$(eXosip_dir)/configure: $(BUILDER_BUILD_DIR)/$(eXosip_dir)/Makefile: $(BUILDER_SRC_DIR)/$(eXosip_dir)/configure 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" --disable-openssl --disable-tools + && PKG_CONFIG_LIBDIR=$(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 build-eXosip2: $(BUILDER_BUILD_DIR)/$(eXosip_dir)/Makefile cd $(BUILDER_BUILD_DIR)/$(eXosip_dir) \ - && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ make DEFS="-DHAVE_CONFIG_H -include $(BUILDER_SRC_DIR)/$(eXosip_dir)/include/eXosip2/eXosip_transport_hook.h" && make install clean-eXosip2: @@ -244,7 +246,7 @@ $(MSILBC_SRC_DIR)/configure: $(MSILBC_BUILD_DIR)/Makefile: $(MSILBC_SRC_DIR)/configure mkdir -p $(MSILBC_BUILD_DIR) cd $(MSILBC_BUILD_DIR) && \ - PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(MSILBC_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) $(library_mode) build-msilbc: build-libilbc $(MSILBC_BUILD_DIR)/Makefile @@ -268,7 +270,7 @@ $(LIBILBC_SRC_DIR)/configure: $(LIBILBC_BUILD_DIR)/Makefile: $(LIBILBC_SRC_DIR)/configure mkdir -p $(LIBILBC_BUILD_DIR) cd $(LIBILBC_BUILD_DIR) && \ - PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(LIBILBC_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) $(library_mode) build-libilbc: $(LIBILBC_BUILD_DIR)/Makefile @@ -327,4 +329,8 @@ delivery: -x linphone-iphone/build\* \ -x \*.git\* +ipa: + cd $(BUILDER_SRC_DIR)/../ \ + && xcodebuild -configuration DistributionAdhoc \ + && xcrun -sdk iphoneos PackageApplication -v build/DistributionAdhoc-iphoneos/linphone.app -o $(BUILDER_SRC_DIR)/../linphone-iphone.ipa diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index f1acb950c..13e0aa62b 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -13,11 +13,16 @@ else endif libvpx_dir?=externals/libvpx -$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: +$(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp: + cd $(BUILDER_SRC_DIR)/$(libvpx_dir) \ + && git apply $(BUILDER_SRC_DIR)/build/builders.d/libvpx.patch \ + && touch $@ + +$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: $(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp mkdir -p $(BUILDER_BUILD_DIR)/$(libvpx_dir) cd $(BUILDER_BUILD_DIR)/$(libvpx_dir)/ \ && host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \ - && $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) $(libvpx_configure_options) + && SYSROOT_PATH=$$SYSROOT_PATH SDK_BIN_PATH=$$SDK_BIN_PATH $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) $(libvpx_configure_options) build-libvpx: $(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk cd $(BUILDER_BUILD_DIR)/$(libvpx_dir) && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch new file mode 100644 index 000000000..390ec4ecf --- /dev/null +++ b/submodules/build/builders.d/libvpx.patch @@ -0,0 +1,42 @@ +diff --git a/build/make/configure.sh b/build/make/configure.sh +index 0426f92..24fa04e 100755 +--- a/build/make/configure.sh ++++ b/build/make/configure.sh +@@ -624,6 +624,9 @@ process_common_toolchain() { + if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then + osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk" + fi ++ if test -n "$SYSROOT_PATH" ; then ++ osx_sdk_dir=$SYSROOT_PATH ++ fi + + case ${toolchain} in + *-darwin8-*) +@@ -743,6 +746,14 @@ process_common_toolchain() { + darwin*) + SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer + TOOLCHAIN_PATH=${SDK_PATH}/usr/bin ++ if test -n "$SYSROOT_PATH" ; then ++ SDK_FULL_PATH=$SYSROOT_PATH ++ else ++ SDK_FULL_PATH="${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" ++ fi ++ if test -n "$SDK_BIN_PATH" ; then ++ TOOLCHAIN_PATH=$SDK_BIN_PATH ++ fi + CC=${TOOLCHAIN_PATH}/gcc + AR=${TOOLCHAIN_PATH}/ar + LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 +@@ -759,10 +770,10 @@ process_common_toolchain() { + add_cflags -arch ${tgt_isa} + add_ldflags -arch_only ${tgt_isa} + +- add_cflags "-isysroot ${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" ++ add_cflags "-isysroot $SDK_FULL_PATH" + + # This should be overridable +- alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.0.sdk ++ alt_libc=$SDK_FULL_PATH + + # Add the paths for the alternate libc + for d in usr/include; do diff --git a/submodules/build/builders.d/msbcg729.mk b/submodules/build/builders.d/msbcg729.mk new file mode 100644 index 000000000..727be6148 --- /dev/null +++ b/submodules/build/builders.d/msbcg729.mk @@ -0,0 +1,61 @@ +############################################################################ +# msbcg729.mk +# Copyright (C) 2011 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. +# +############################################################################ +msbcg729_dir?=bcg729 +enable_bcg729?=yes + +$(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure: + @echo -e "\033[01;32m Running autogen for msbcg729 in $(BUILDER_SRC_DIR)/$(msbcg729_dir) \033[0m" + cd $(BUILDER_SRC_DIR)/$(msbcg729_dir) && ./autogen.sh + +$(BUILDER_BUILD_DIR)/$(msbcg729_dir)/Makefile: $(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure + @echo -e "\033[01;32m Running configure in $(BUILDER_BUILD_DIR)/$(msbcg729_dir) \033[0m" + mkdir -p $(BUILDER_BUILD_DIR)/$(msbcg729_dir) + cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir)/ \ + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + $(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ + --enable-static + +ifeq ($(enable_bcg729),yes) + +build-msbcg729: $(BUILDER_BUILD_DIR)/$(msbcg729_dir)/Makefile + @echo -e "\033[01;32m building bcg729 \033[0m" + cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir) \ + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig \ + CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + make -j1 && make install + + +else +build-msbcg729: + @echo "G729 is disabled" + +endif + +clean-msbcg729: + -cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir) && make clean + +veryclean-msbcg729: + -cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir) && make distclean + rm -f $(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure + +clean-makefile-msbcg729: + -cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir) && rm -f Makefile diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index c4c7840a8..4256d17ed 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -24,8 +24,15 @@ else fi echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}" -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 +#new path with Xcode 4.3: +if test -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then + SDK_PATH_LIST=`ls -drt /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=/Applications/Xcode.app/Contents/Developer/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"