Build or Compile Linphone from Source for iPhone and iPad
Posted: March 30th, 2013 | Author: admin | 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

Thank you very much for that superb article
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
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…
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
Hi,
I can’t run on simulator?
only with device?get error
the debug-iphonesimulator not found.
how to rid of this error?
Jasi
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.
Thanks for sharing this nice post.I will keep your article in my idea.usbonlinegroup
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
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
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
I had already resolve my issues.
Now I can build and modify the linphone-iphone on my Lion with XCode 4.1.
Thanks guys.
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
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?
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?
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?
I greatly appreciate this blog! Please post more tutorials…
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…
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)
regarding to make command, please download command line tools from apple developer
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
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.
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.
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
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.
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
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.
The previous instruction is for an older version of linphone. Have since update the instruction. Please take a look