首页 > 代码库 > linphone 编译过程
linphone 编译过程
编译过程如下:
用到的安装包
下面的过程最好按照顺序进行!有一些库也是依赖关系。
export PREFIX=/usr/
export HOSTTPL=arm-none-linux-gnueabi
export INSTALLDIR=/home/linux/linphone/install
tslib
$ sudo apt-get install libtool automake autoconf
$ ./autogen.sh
$ echo "ac_cv_func_malloc_0_nonnull=yes" > arm-linux.cache
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --cache-file=arm-linux.cache
$ make
$ make install DESTDIR=$INSTALLDIR
libiconv
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld
$ make
$ make install DESTDIR=$INSTALLDIR
SDL
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --build=i386 --with-gnu-ld --disable-video-nanox --disable-video-qtopia --disable-pulseaudio --disable-video-photon --disable-video-ggi --disable-video-svga --disable-video-aalib --disable-video-dummy --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-video-x11 --disable-nasm --enable-joystick --enable-input-tslib --enable-video-fbcon CPPFLAGS="-I$INSTALLDIR/usr/local/include" LDFLAGS="-L$INSTALLDIR/usr/local/lib -lts -liconv"
$ make
$ make install DESTDIR=$INSTALLDIR
$ sudo apt-get install intltool
ncurses
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-shared --with-gnu-ld
$ make
$ make install DESTDIR=$INSTALLDIR
readline
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --disable-static
$ make
$ make install DESTDIR=$INSTALLDIR
libosip2
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld --disable-static
$ make
$ make install DESTDIR=$INSTALLDIR
libogg
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld
$ make
$ make install DESTDIR=$INSTALLDIR
rm $INSTALLDIR$PREFIX/lib/*.la
对于la文件和intltool的关系请自行查阅相关资料。
libeXosip2
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld --disable-static OSIP_CFLAGS="-I$INSTALLDIR/usr/local/include" OSIP_LIBS="-L$INSTALLDIR/usr/local/lib -losip2 -losipparser2"
$ make
$ make install DESTDIR=$INSTALLDIR
此处编译若出现找不到关于openssl相关链接符号信息,请将交叉编译工具链中openssl的相关文件删除即可,否则请移植完整的openssl并确保正确。(update 2013.1.2)
speex
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld --disable-static --enable-fixed-point --enable-arm-asm --with-ogg="$INSTALLDIR/usr/local"
$ make
$ make install DESTDIR=$INSTALLDIR
libav
$ ./configure --prefix=$PREFIX --enable-cross-compile --cross-prefix=arm-none-linux-gnueabi- --arch=armv4 --target-os=linux
$ make
$ make install DESTDIR=$INSTALLDIR
其中--arch=armv4请修改为所开发平台对应的信息
libvorbis
$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld --with-ogg="$INSTALLDIR/usr/local"
$ make
$ make install DESTDIR=$INSTALLDIR
zlib
$ ./configure --prefix=$PREFIX
修改Makefile
CC=gcc =〉
CC=arm-none-linux-gnueabi-gcc
LDSHARED=gcc -shared -Wl,-soname,libz.so.1,--version- script,zlib.map =〉
LDSHARED=arm-none-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
CPP=gcc -E =〉
CPP=arm-none-linux-gnueabi-gcc -E
AR=ar rc =〉
AR=arm-none-linux-gnueabi-ar rc
$ make
$ make install DESTDIR=$INSTALLDIR
libv4l
修改Makefile,
$ vi libv4l1/Makefile
$ vi libv4l2/Makefile
$ vi libv4lconvert/Makefile
在文件起始处增加以下两行:
CC=arm-none-linux-gnueabi-gcc
AR=arm-none-linux-gnueabi-ar
$ make
$ make install DESTDIR=$INSTALLDIR
有些交叉工具链可能没有videodev.h文件,修改Makefile以去除对libv4l1的变异,同时在linphone编译时不加入libv4l1。
rm $INSTALLDIR$PREFIX/lib/*.la
linphone
$ cd mediastreamer2/src
$ patch < mediastreamer-2.7.3-ms_sws_fix.patch //右击另存为
linphone-3.5.2使用mediastreamer2-2.8.2版本已修复此错误(update 2013.1.2)
$ ./configure --prefix=$PREFIX --host=$HOSTTPL \
--disable-static --disable-glib --enable-gtk_ui=no --disable-xv --disable-x11 --disable-pulseaudio \
--enable-video --enable-ffmpeg --enable-sdl --enable-libv4l --enable-oss --enable-ipv6 \
--with-gnu-ld \
--with-ffmpeg=$INSTALLDIR/usr/local \
--with-libiconv-prefix=$INSTALLDIR/usr/local \
--with-osip=$INSTALLDIR/usr/local \
--with-readline=$INSTALLDIR/usr/local \
SPEEX_CFLAGS="-I$INSTALLDIR/usr/local/include" \
SPEEX_LIBS="-L$INSTALLDIR/usr/local/lib -lspeex" \
FFMPEG_CFLAGS="-I$INSTALLDIR/usr/local/include" \
FFMPEG_LIBS="-L$INSTALLDIR/usr/local/lib -lavcodec" \
SWSCALE_CFLAGS="-I$INSTALLDIR/usr/local/include" \
SWSCALE_LIBS="-L$INSTALLDIR/usr/local/lib -lswscale" \
SDL_CFLAGS="-I$INSTALLDIR/usr/local/include" \
SDL_LIBS="-L$INSTALLDIR/usr/local/lib -lSDL" \
OSIP_CFLAGS="-I$INSTALLDIR/usr/local/include" \
OSIP_LIBS="-L$INSTALLDIR/usr/local/lib -losip2 -losipparser2 -leXosip2" \
SPEEX_CFLAGS="-I$INSTALLDIR/usr/local/include" \
SPEEX_LIBS="-L$INSTALLDIR/usr/local/lib -lspeex -lspeexdsp" \
SPEEXDSP_CFLAGS="-I$INSTALLDIR/usr/local/include" \
SPEEXDSP_LIBS="-L$INSTALLDIR/usr/local/lib -lspeex -lspeexdsp" \
LIBV4L2_CFLAGS="-I$INSTALLDIR/usr/local/include" \
LIBV4L2_LIBS="-L$INSTALLDIR/usr/local/lib -lv4l2" \
LIBV4L1_CFLAGS="-I$INSTALLDIR/usr/local/include" \
LIBV4L1_LIBS="-L$INSTALLDIR/usr/local/lib -lv4l1"
配置完configure后修改Makefile如下:
mediastreamer2/tests/Makefile
LIBS = -pthread -lpthread -lrt -lvorbisenc -lv4l1 -lv4l2 -lv4lconvert -liconv -lvorbis -logg -lz
coreapi/Makefile
LIBS = -lspeex -lspeexdsp -lSDL -lvorbisenc -lv4l1 -lv4l2 -lv4lconvert - liconv -lvorbis -logg -lz -lavutil
coreapi/help/Makefile
LIBS = -losip2 -losipparser2 -leXosip2 -lspeex -lspeexdsp -lSDL -lvorbisenc - lv4l1 -lv4l2 -lv4lconvert -liconv -lvorbis -logg -lz -lavutil
helloworld_LDADD = $(top_builddir)/coreapi/liblinphone.la \
$(EXOSIP_LIBS) \
$(MEDIASTREAMER_LIBS) \
$(ORTP_LIBS)
console/Makefile
LIBS = -lSDL -lvorbisenc -lv4l1 -lv4l2 -lv4lconvert -liconv -lvorbis -logg - lz -lavutil
linphonecsh_LDADD = $(ORTP_LIBS) -L/home/linux/linphone/install/usr/local/lib
#此处路径为交叉编译库安装的位置
$ make
$ make install DESTDIR=$INSTALLDIR