Compiling iOS Linphone SDK with homebrew

Source: Internet
Author: User

Please click here for the original text


Write in front of the crap:

After many years of suffering from the compilation of torture, or decided to translate it, for their own later compiled convenient, but also for the future compilation of Linphone students to provide a point of convenience.

VoIP common implementation methods have Pjsip and Linphone, Pjsip compilation is simpler, and the package is much smaller. But I compile Pjsip add TLS, according to the official way failed, mail contact Pjsip Official also did not get reply, I was more dull, search a lot of information also did not succeed, finally can only give up, start compiling linphone. Linphone compilation is relatively difficult, relying on the library is much more than PJSIP, the package is much larger. But Linphone compiled source to you directly provide the TLS option and SRTP (here are small points, explained below) and so on. So, if you're going to do VoIP, it's best to weigh the options first.

PS. My English comparative cuisine, if there is an incorrect translation of the place also please leave a message, in order to amend. Thx!


Start the chase.

Pre-need

Xcode command line tools, Git


first, let's first Install dependent Libraries

If you read the official Readme you will find that the official use of macports, but here we use homebrew instead. At first glance the command seemed to have all the libraries except Gmake and ANTLR. (Although the C file in the package LIBANTLR can be used with ANTLR (PS.) This is not the way to translate the words ==! ) In addition, we also need to gettext.

Let's start by installing some dependent libraries:

Brew Install coreutils automake autoconf libtool intltool wget pkgconfig cmake yasm nasm doxygen ImageMagick optipng Liban TLR3C GetText

PS. Did you see it? Need so many libraries ~

There may be a warning when installing caveat:

All commands has been installed with the prefix ' G '. If you really need to use these commands with their normal names, youcan add a ' gnubin ' directory to your PATH from your B ASHRC like:    path= "/usr/local/opt/coreutils/libexec/gnubin: $PATH"

All right, let's just change the instructions:

# temporarily add Homebrews coreutils to the path$ export path= "/usr/local/opt/coreutils/libexec/gnubin: $PATH"

In addition, we would like to know the version of GetText just installed, it is not connected by default, perhaps you want to disconnect the link after the installation is complete:

# Temporarily link gettext$ brew link gettext--force



Installing ANTLR3

I opened the pull request for Home-brew's 3.4 version of ANTLR. Here, you just need to cover/usr/local/library/formula/antlr.rb with this 3.4 version of ANTLR.

Then execute:

$ brew Install antlr# symlink into/usr/local/share/java/so Configure can find it$ mkdir-p/usr/local/share/java$ ln-s /usr/local/cellar/antlr/3.4/antlr-3.4-complete.jar/usr/local/share/java/antlr3.jar


Installing gas-preprosessor.pl

$ wget--no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl$ sudo mv gas-preprocessor.pl/usr/local/bin/$ chmod +x/usr/local/bin/gas-preprocessor.pl

links libtoolize to glibtoolize

$ sudo ln-s/usr/local/bin/glibtoolize/usr/local/bin/libtoolize

link host strings to emulator SDK

$ sudo ln-s/usr/bin/strings/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/ Developer/usr/bin/strings

Link/opt/local/bin to/usr/local/bin

MacPorts put everything in the/opt/local/bin, and the autogen.sh script under Submodules/linphone needed some hard-coded paths to intltoolize. If it is not found, it will be a failure of the birds, and then will cause such a humble error:

Config.status:error:cannot Find input file: ' po/makefile.in.in '
So we link the entire directory (if you already have a/opt/local/bin directory, you might just want to replace the symbolic link intltoolize):

$ sudo mkdir/opt/local$ cd/opt/local && sudo ln-s/usr/local/bin


compiling the SDK

First get the source code

First grab the project code, as well as sub-modules. So it may take some time (PS.) I hope your company's network is good, I downloaded the source code, downloaded not less than 5 times, and finally in the middle of the night after all the work of the download success:

git clone git://git.linphone.org/linphone-iphone.git--recursive


Setting the SDK version

Find out which version of the SDK you can use:

$ ls/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos7.1.sdk
For me, 7.1 is available. Then edit Inphone-iphone/submodules/build/iphone-config.site to make the following settings:

sdk_version_major=7sdk_version=7.1
(PS. LZ8.1 settings are also 8 and 8.1, here is not quite clear what is meant.) Have clear also please leave a message to explain under, THX)


Compile

$ cd linphone-iphone/submodules/build$ make all

then a long wait ...


If you compile successfully, you will end up with this stuff:

*************************************************************************************************************** CAUTION, this liblinphone SDK are built using 3rd party GPL code ***********ev En if you acquired a proprietary license from Belledonne      ***********communications, the This SDK is the GPL and GPL only.                   To disable 3rd party GPL code, please use:                      ***********make enable_gpl_third_parties=no                              ************ *************************************************************************************************************** *********************************


Open the project and try to run it!


Troubleshooting:

If you encounter any problems, double-check each step above.
Run the recommended run again

$ make very clean
before you execute make all, you must first make sure that you have made some changes.

Resources

Some very good blog, there are people encountered problems and solve the problem of discussion

http://shallwelearn.com/blog/build-linphone-for-iphone-and-ipad/

Mailing list for Linphone developers

http://lists.nongnu.org/archive/html/linphone-developers/
StackOverflow (This does not explain, if you do not know that you can exit the It circle, enter the entertainment circle)

Http://stackoverflow.com/questions/tagged/linphone+ios


Write it in the back.

Finally with the broken English translation, if you can always see this line, then congratulations, your patience is very good, I believe you can use your so good patience in the IT industry.

Because our project requires TLS and SRTP to be encrypted. So here's the question I'm having:

1. The compiled code should not be validated by the certificate, which means that TLS is problematic. You need to add a sentence to the Startliblinphone function of the Linphonemanager class to verify that:

Linphone_core_verify_server_certificates (Thelinphonecore, NO);


2. During the project test, I was found to be able to use the official account for the call (between iOS and iOS), but not to speak to Android. Nor can we use our own servers for calls between iOS and iOS. Depressed n long after, backstage told me, his SRTP is wrong, need to recompile. Then the Android SRTP package is imported for recompilation. (PS. Sorry, this modified SRTP package is not available here because it adds some of our own encryption algorithms when it is modified.) Hope understanding)


3. After replacing the SRTP package, the Veay clean is executed. And then compile the time to start the error, the error is about SRTP, is still struggling. Here to spit Groove is, I finished clean, do the backstage of the Linux Daniel just said, you can directly make without clean, then make the time will not be compiled again to compile again, you can save a lot of time. Alas, do not say anything, let me cry for a while to???????????
┴─┴︵╰ (‵-′╰)


Reprint please indicate the source


Finally, good luck to everyone!


Compiling iOS Linphone SDK with homebrew

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.