Build or Compile Linphone from Source for iPhone and iPad

Posted: March 30th, 2013 | Author: | Filed under: iphone | 27 Comments »

Updated for Mountain Lion, XCode4.5, and linphone 2.0.2: 03/29/13

To build Linphone for iPhone and iPad

Step 1: Install XCode

Install XCode

Step 2: Install required linux package through MacPort

Install MacPort, then install these ports: automake, autoconf, libtool, intltool, wget, pkgconfig, gtk2

For bash

$ sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng gtk2

$ wget –no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl

$ sudo mv gas-preprocessor.pl /opt/local/bin/.

$ sudo chmod +x /opt/local/bin/gas-preprocessor.pl

Note, on my Mountain Lion OS, I can’t get “sudo” to work, so I enable the root via this link: http://support.apple.com/kb/PH11331

and use the following commands

$ su

$ port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm $ grep doxygen ImageMagick optipng gtk2

$ wget –no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl

$ mv gas-preprocessor.pl /opt/local/bin/.

$ chmod +x /opt/local/bin/gas-preprocessor.pl



Step 3: Install or Update Git

Install git. I followed the instruction on this great github article.

To update an existing git install (if you got an git version error in the later steps)

$ git clone git://github.com/gitster/git.git

 

Step 4: Obtain linphone source code

Download linphone source from this git tree page

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

 

Step 5: Follow the README file in linkphone-iphone directory

Follow the README in linphone-iphone directory

Link important libtoolize to glibtoolize

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

Update SDK_VERSION in submodules/build/iphone-config.site if appropriate

Generate the liblinphone dual arch sdk:

$ cd submodules/build

$ make -f builder-iphone-simulator.mk all && make -f builder-iphone-os.mk all &&make -f builder-iphone-os.mk delivery-sdk

Link host’s 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

Build SDK

$ cd submodules/build

$ make veryclean

$ make all

7. After step 5 is completed, open linphone.xcodeproj in linphone-iphone directory. Just build as normal.

 

Troubleshooting

On Snow Leopard with MacPort 1.9.2, I had to copy /usr/X11/share/aclocal/pkg.m4 to /usr/share/aclocal to get rid of the PKG_CHECK_MODULES error. Thanks to Thomas Covo’s response to a thread. After doing so, run ./autogen.sh in all external plugins (exosip, osip, speedx) and

cd submodules/externals/exosip

./autogen.sh

cd ../osip

./autogen.sh

cd ../speex

./autogen.sh

cd ../../linphone

./autogen.sh


27 Comments on “Build or Compile Linphone from Source for iPhone and iPad”

  1. 1 Ремонт Соболь said at 2:27 am on February 25th, 2011:

    Thank you very much for that superb article

  2. 2 Ricky said at 1:43 pm on March 19th, 2011:

    Hi,

    I tried your suggestion but im getting the error

    make[5]: *** [mediastream] Error 1
    make[4]: *** [all-recursive] Error 1
    make[3]: *** [all] Error 2
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all] Error 2
    make: *** [build-linphone] Error 2

    Any suggestion how I can fix it?
    Ricky

  3. 3 admin said at 2:45 am on March 21st, 2011:

    Hi Rick, could you give more details on the errors you’ve got? The trace you’ve posted does not provide enough info for me to help…

  4. 4 jasi said at 8:18 pm on April 16th, 2011:

    Hi,
    Thank you very much.

    I got 2 Error if I build for simulator:
    warning: directory ‘/Users/mac/linphone-iphone/submodules/build/Debug-iphonesimulator’ following -L not found

    ld: library not found for -llinphone
    collect2: ld returned 1 exit status

    Command/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

    and 2. error at make:

    libmsilbc.a (no such file or directory)

    What I done wrong?

    Thank you,
    Jasi

  5. 5 jasi said at 10:21 pm on April 16th, 2011:

    Hi,

    I can’t run on simulator?
    only with device?get error
    the debug-iphonesimulator not found.

    how to rid of this error?

    Jasi

  6. 6 Jessica said at 3:51 am on April 21st, 2011:

    Hey Jasi,
    It seems that you are missing msilbc (the msiIBC plugin developed by linphone.org) , hence the libmsilbc.a missing error. I would suggest downloading linphone-iphone project again.

  7. 7 HiPhone 4 said at 5:53 am on May 19th, 2011:

    Thanks for sharing this nice post.I will keep your article in my idea.usbonlinegroup

  8. 8 Naveed said at 5:38 am on June 29th, 2011:

    Hi ,I am getting issue of
    syntax error: unexpected end of file in iphone-config.site file,

    plz help me , i run make all command in build directory .

    Regards
    Naveed

  9. 9 Naveed said at 7:19 am on June 29th, 2011:

    hi! iphone-config.site issue is now fixed but now i am getting issue of md4_dgst.c file,

    error : expected ) instead of ;

    this kind of message i m facing now

    plz guide me

  10. 10 Jim Lu said at 6:10 am on July 27th, 2011:

    Hi Jessica,

    Thanks for your kindness to share these information on internet.

    I am also building linphone recently. And I get a issue as I execute “make”…the system response me that

    : command not foundetktop/linephone-iphone/submodules/build..//build/iphone-config.site: line2:

    : command not foundetktop/linephone-iphone/submodules/build..//build/iphone-config.site: line6:

    : command not foundetktop/linephone-iphone/submodules/build..//build/iphone-config.site: line34: syntax error: unexcepted end of file

    make[1]: *** [build-openssl] Error 1
    make: *** [all] Error 2

    and my iphone-config.site goes like this
    //————————————
    # -*- shell-script -*-

    GCC_VERSION=4.2
    SDK_VERSION_MAJOR=4
    SDK_VERSION=3.2

    if test “${host_alias}” = “i386-apple-darwin” ; then
    PLATFORM=Simulator
    ARCH=i386
    elif test “${host_alias}” = “armv6-apple-darwin” ; then
    ARCH=armv6
    PLATFORM=OS
    elif test “${host_alias}” = “armv7-apple-darwin” ; then
    ARCH=armv7
    PLATFORM=OS
    else
    echo “bad host ${host_alias} must be either i386-apple-darwin or armv6-apple-darwin”
    exit
    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}4*`
    SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin
    for SYSROOT_PATH in $SDK_PATH_LIST ; do echo $SYSROOT_PATH ; done ;
    echo “Selecting SDK path = ${SYSROOT_PATH}”
    CC=”${SDK_BIN_PATH}/gcc-${GCC_VERSION} -std=c99 -arch ${ARCH} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE”
    CXX=”${SDK_BIN_PATH}/g++-${GCC_VERSION} -arch ${ARCH} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE”
    LD=”${SDK_BIN_PATH}/ld-${GCC_VERSION} -arch ${ARCH}”
    AR=${SDK_BIN_PATH}/ar
    RANLIB=${SDK_BIN_PATH}/ranlib

    CPPFLAGS=”-Dasm=__asm”
    LDFLAGS=”-Wl,-syslibroot,${SYSROOT_PATH} -framework CFNetwork”
    //————————————

    Could you please guide me to figure out what’s the problem ?
    Thank you very much.

    Best Regards,
    Jim Lu

  11. 11 Jim Lu said at 8:12 am on August 2nd, 2011:

    I had already resolve my issues.
    Now I can build and modify the linphone-iphone on my Lion with XCode 4.1.

    Thanks guys.

  12. 12 puthuks said at 11:17 am on September 19th, 2011:

    Hi,
    I am getting below error : I am using macport 2.0.1

    externals/exosip/configure: line 12616: syntax error near unexpected token `OSIP,’

    externals/exosip/configure: line 12616: `PKG_CHECK_MODULES(OSIP, libosip2 >= 3.4, ,’

    /build-i386-apple-darwin/externals/exosip/Makefile] Error 2

    Please help

  13. 13 Liam said at 7:23 am on December 21st, 2011:

    Hi.I get the latest linphone-iphone version,follow the Readme,when “make all”,get two error,it seems that “GNU assembler not found, install gas-preprocessor”.
    Did you use the latest version? And are you successful?

  14. 14 Thanuj said at 11:27 am on January 4th, 2012:

    Hi,

    I have compiled the linphone libraries and successfully compiled the project for iPhone simulator 5.0 also.

    But when I try to compile for iPad simulator 5.0 its not working. Its compiling successfully but getting paused in between with blank screen. Says “Program received signal “EXC_ARITHMETIC”.

    And when I try to put on iPad 2 device it gives some compilation error..
    …………………………
    “Undefined symbols for architecture armv7:
    “___aeabi_idiv”, referenced from:
    _SKP_Silk_schur64 in libSKP_SILK_SDK.a(SKP_Silk_schur64_arm.o)
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    …………………………………………………

    Any ideas on this?

  15. 15 Vikas said at 12:08 am on January 12th, 2012:

    Hi;

    I have compiled the liblinphone-iphone successfully. While I am trying to run the mediastream application, I am getting errors such as

    Redefinition of VideoStream symbol as different kind of symbol

    in mediastream.h file.

    Any insight to this issue?

  16. 16 Alfredo Okumoto said at 4:42 am on February 6th, 2012:

    I greatly appreciate this blog! Please post more tutorials…

  17. 17 MiChael said at 11:08 am on February 24th, 2012:

    hi! I get linphone-iphone source from git://git.linphone.org/linphone-iphone.git today.
    But after port install all things following this article and in readme file, I compile using “make -f builder-iphone-simulator.mk all && make -f builder-iphone-os.mk all &&make -f builder-iphone-os.mk delivery-sdk”, it say that:

    command not foundr/Desktop/linphone-iphone/submodules/build/..//build/iphone-config.site: line 2:
    /Users/administrator/Desktop/linphone-iphone/submodules/build/..//build/iphone-config.site: line 42: syntax error: unexpected end of file

    Plz help me…

  18. 18 MiChael said at 11:13 am on February 24th, 2012:

    Addional information:
    I’m using Lion 10.7.2 and I have tried to build for sdk 4.3 and 5.0 (I also edit SDK in iphone-config.site)

  19. 19 zmp said at 9:59 am on April 23rd, 2012:

    regarding to make command, please download command line tools from apple developer

  20. 20 zmp said at 8:41 am on April 25th, 2012:

    Hi all,
    I have the following error :

    ld: library not found for -llinphone

    I’m running on Lion with xcode 4.3.2
    please help.
    thank you

  21. 21 JasonSoong said at 10:36 am on April 27th, 2012:

    compile and run perfectly on April 03 2012 fresh download linphone and macport. using Lion.
    today (April 27) fail to compile a fresh copy from linphone git.

  22. 22 Leonard said at 7:14 am on May 27th, 2012:

    I keep getting the following error:
    Libtool : Version mismatch error. This is libtool 2.4.2 but the definition of this LT_INT comes from an older release. You should recreate aclocal.m4 with macros from libtool 2.4.2 and run autoconf again.

  23. 23 Ranveer said at 8:24 am on June 25th, 2012:

    Hi,
    Its a very helpful tutorial you gave through it.

    When i try to build xproj file using xcode i was getting those error :

    1) /Users/harshsavani/linphone-iphone/liblinphone-sdk/apple-darwin/share/sounds/linphone/ringback.wav: No such file or directory

    and

    2) /Users/harshsavani/linphone-iphone/liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/oldphone-mono.wav: No such file or directory

  24. 24 Umaid said at 12:31 pm on December 11th, 2012:

    I have followed couple of solutions, blog and tutorial to make it run successfully with xcode 4.5

    I have followed your tutorial and download linphone from all valide resource but having some errors related to library on OSX Lion

    ld: library not found for -lavcodec

    in some copy this.
    ld: library not found for -llinphone

    I allow Macport and followed everything from terminal but failure to run app on device nor on Simulator. I am totally exhausted in rectifying solution for 3 days but failure to do so, please help me as your help will be highly appreciated.

  25. 25 admin said at 12:57 am on January 20th, 2013:

    Hi Umaid,

    Sorry about your frustration. Unfortunately i can’t reproduce your error easily since I have updated my Mac to Mountain Lion OS. This tutorial was written a while back and i have not verified that the tutorial still works with the current linphone code and the its libraries

    jessica

  26. 26 Teji said at 11:13 am on March 22nd, 2013:

    Hi i’m trying to compile linphone-iphone module on Mac LION and getting following errors :

    /Users/mac_11/linphone-iphone/submodules/build/..//build/iphone-config.site: line 2:: command not found
    /Users/mac_11/linphone-iphone/submodules/build/..//build/iphone-config.site: line 52: syntax error: unexpected end of file
    make: * [build-openssl] Error 1

    Please help me out.

  27. 27 admin said at 11:10 pm on March 30th, 2013:

    The previous instruction is for an older version of linphone. Have since update the instruction. Please take a look


Leave a Reply