1

I want to merge two projects.

First project

  1. Written in objective C and swift 2.3
  2. Pod dependencies
  3. Have different Targets
  4. Submodules dependencies

Second project

https://github.com/BelledonneCommunications/linphone

  1. Written in Objective C
  2. dependency on linphone SDK written in C
  3. Submodules dependencies

How can I convert Second project(linphone) as a framework?

EDIT 1

I have integrated linphone project(second project) including the C written linphone SDK and Rectified all compile time errors. and now i am able to run the project. But what I will do for Submodules dependencies?

EDIT 2

As per now, succeed login with our own SIP server account. Right now my issue is

LinphoneManager
 - (void)createLinphoneCore
 - theLinphoneCore = linphone_core_new_with_config(&linphonec_vtable, _configDb, (__bridge void *)(self)); 

theLinphoneCore is NULL, why?

NOTE: Still i didnt integrate submodules, but i can do audio & video call everything works fine.

Shebin Koshy
  • 1,182
  • 8
  • 22

1 Answers1

3

The only sane way to build a complete liblinphone SDK is through the appropriate client repository, e.g. linphone-iphone or linphone-android. As you have discovered, it is possible to build as a framework or static library using:

./prepare.py -c && ./prepare.py -DENABLE_STATIC_ONLY=ON && make && make zipsdk

Set DENABLE_STATIC_ONLY=ON for libs, and =OFF for a framework:

Be aware: as of June 2017, the framework configuration is still under development. It builds and runs in the simulator and on actual hardware, but the resulting app binary can't be submitted to Apple because the sub-frameworks aren't configured correctly. If you don't need to submit (not even TestFlight!) for 2-6 months maybe they will finish up soon.

If you need a functional product sooner, use the static lib configuration. The only tricky part is getting everything set up in your project/workspace.

  1. Do a full clean and build using prepare.py as above
  2. Extract the sdk zip file into your own project directory as liblinphone-sdk
  3. Add the libraries in liblinphone-sdk/apple-darwin/lib to XCode's Linked Frameworks and Libraries section under General. Click +, select "Add Other", navigate to the libs directory. Don't forget to include any in liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins
  4. You may need to add a Build Setting for Header Search Path $(SRCROOT)/liblinphone-sdk/apple-darwin/include
  5. You may need to add a Build Setting for Library Search Path $(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib
  6. The XCode project for linphone-iPhone is a good place to discover other tweaks you may need to make.

Setting up your workspace will probably require trial and error. Xcode is not great with the errors but you should be able to use the Report Navigator view to see complete build logs and error messages. If you have an undefined symbol for example, you can try grep -ri SYMBOLNAME liblinphone-sdk to figure out what library might be missing.

Regarding your EDIT 2 question, you need all the submodules or it won't work. ortp, belle-sip, mediastreamer, srtp, mbedtls, they are all essential. Only the mediastreamer plugin codecs are (somewhat) optional.

Eli Burke
  • 2,729
  • 27
  • 25
  • Thanks a lot for your reply. Regarding EDIT 2, I have Submodules for my existing project. if i copy paste the entire files into that, does it work? i mean the all files from submodules folder from linphone project to submodules folder of my existing project. – Shebin Koshy Jun 07 '17 at 06:10
  • For linphone, Xcode not listing any submodules. For other projects i can see content of submodules in Xcode, under "Development Pods" group. In my case, can I drag linphone submodules into Xcode of my current project? – Shebin Koshy Jun 07 '17 at 14:30
  • 1
    After you _make zipsdk_ and add the static libraries per step 3 of my answer, you will have all of the Linphone submodules linked in to your app. You do not need to directly integrate Linphone's submodules into your source or integrate them with cocoapods-- everything is pre-built and included via the _liblinphone-sdk_ subdirectory. If you need to debug into the linphone code, you can compile it with debugging as well. prepare.py has a lot of options. – Eli Burke Jun 08 '17 at 12:40
  • https://drive.google.com/drive/folders/0BzQsvz8QW1xUTi0tbW9MUDFrRFE this is linphone project without submodules. both video call and audio call working fine. can you tell me what is the reason for working it without submodules? and we are using our own SIP server(UDP) – Shebin Koshy Jun 09 '17 at 05:41
  • Or if you have the linphone project, just delete the submodules folder(using finder) and run the project, you can see video call and audio call are working. – Shebin Koshy Jun 09 '17 at 05:46
  • 1
    Please try to understand. Linphone core and its submodules are used to build the SDK. Once you build the SDK you can in fact delete the submodule source. Linphone-iPhone includes submodules in the project for easier debugging but only the binary SDK matters for compiling your app. – Eli Burke Jun 10 '17 at 11:31