***************************************************************************************************************************
作者:EasyWave 時間:2013.03.31
類別:Linux 應用LinPhone 聲明:轉載,請保留連結
注意:如有錯誤,歡迎指正。這些是我學習的日誌文章......
***************************************************************************************************************************
在《 基於Linux開源VOIP系統LinPhone[五] 》中,詳細的介紹了speex庫如果不需要libogg庫的詳細地修改方法,現在說說,linphone如何編譯,前面已經說了。如果只編譯不帶ui和只有audio版本的linphone,只需要speex、readline、osip、eXosip以及ncurses庫即可。如所示:
如果只編譯不帶ui和只有audio版本的linphone,是的,只需要以上幾個庫就可以了。
還是先在linphone3.5.2的目錄下建立一個build.sh的檔案,同時用命令:./configure -h來看看需要進行那些配置,如下所示:
/work/prj/packages/PRJ/trunk$ ./configure -h`configure' configures linphone 3.5.2 to adapt to many kinds of systems.Usage: ./configure [OPTION]... [VAR=VALUE]...To assign environment variables (e.g., CC, CFLAGS...), specify them asVAR=VALUE. See below for descriptions of some of the useful variables.Defaults for the options are specified in brackets.Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..']Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX]By default, `make install' will install all the files in`/usr/local/bin', `/usr/local/lib' etc. You can specifyan installation prefix other than `/usr/local' using `--prefix',for instance `--prefix=$HOME'.For better control, use the options below.Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/linphone] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR]Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program namesSystem types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST]Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-nls do not use Native Language Support --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=no] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath do not hardcode runtime library paths --disable-x11 Disable X11 support --enable-console_ui=yes/no Turn on or off compilation of console interface default=yes --enable-gtk_ui=yes/no Turn on or off compilation of gtk interface default=yes --enable-notify=yes/no Enable libnotify support default=yes --enable-relativeprefix Build a linphone that finds its resources relatively to the directory where it is installed --enable-date Use build date in internal version number --enable-ipv6 Turn on ipv6 support --enable-truespeech Turn on TrueSpeech support (x86 only) --enable-nonstandard-gsm Enable GSM codec at nonstandard rates (11025hz, 16000hz) --enable-rsvp enable support for QoS reservations. --enable-ssl Turn on ssl support compiling. Required for sip tls. default = false --enable-video Turn on video support compiling --enable-alsa Turn on alsa native support compiling --enable-zrtp Turn on zrtp support --enable-portaudio Turn on portaudio native support compiling --enable-strict Build with stricter options (gcc only) [yes] --enable-external-mediastreamer Use external mediastreamer library --enable-tunnel=yes/no Turn on compilation of tunnel support default=no --enable-external-ortp Use external oRTP library --disable-tests Disable compilation of testsOptional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-configdir Set a APPDATA subdir where linphone is supposed to find its config (windows only) --with-osip Set prefix where osip can be found (ex:/usr or /usr/local)default=/usr --with-readline Set prefix where gnu readline headers and libs can be found (ex:/usr, /usr/local, none) default=/usr --with-ffmpeg Sets the installation prefix of ffmpeg, needed for video support. default=/usrSome influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBGTK_CFLAGS C compiler flags for LIBGTK, overriding pkg-config LIBGTK_LIBS linker flags for LIBGTK, overriding pkg-config LIBGTKMAC_CFLAGS C compiler flags for LIBGTKMAC, overriding pkg-config LIBGTKMAC_LIBS linker flags for LIBGTKMAC, overriding pkg-config NOTIFY4_CFLAGS C compiler flags for NOTIFY4, overriding pkg-config NOTIFY4_LIBS linker flags for NOTIFY4, overriding pkg-config NOTIFY1_CFLAGS C compiler flags for NOTIFY1, overriding pkg-config NOTIFY1_LIBS linker flags for NOTIFY1, overriding pkg-config OSIP_CFLAGS C compiler flags for OSIP, overriding pkg-config OSIP_LIBS linker flags for OSIP, overriding pkg-config OPENSSL_CFLAGS C compiler flags for OPENSSL, overriding pkg-config OPENSSL_LIBS linker flags for OPENSSL, overriding pkg-config SPEEX_CFLAGS C compiler flags for SPEEX, overriding pkg-config SPEEX_LIBS linker flags for SPEEX, overriding pkg-config LIBSOUP_CFLAGS C compiler flags for LIBSOUP, overriding pkg-config LIBSOUP_LIBS linker flags for LIBSOUP, overriding pkg-config MEDIASTREAMER_CFLAGS C compiler flags for MEDIASTREAMER, overriding pkg-config MEDIASTREAMER_LIBS linker flags for MEDIASTREAMER, overriding pkg-config TUNNEL_CFLAGS C compiler flags for TUNNEL, overriding pkg-config TUNNEL_LIBS linker flags for TUNNEL, overriding pkg-config ORTP_CFLAGS C compiler flags for ORTP, overriding pkg-config ORTP_LIBS linker flags for ORTP, overriding pkg-configUse these variables to override the choices made by `configure' or to helpit to find libraries and programs with nonstandard names/locations.Report bugs to <linphone-developers@nongnu.org>.
看到了。需要很多的配置選項,不過,對於沒有用到,我們可以將其disable掉,所示最終的編譯選項如下所示:
#!/bin/bashINSTALL_PATH=`pwd`/_installmkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.h ]; thenmake distcleanfimake distclean./configure --prefix=$INSTALL_PATH \ --host=arm-none-linux-gnueabi \ --build=i486-linux-gnu \ --disable-silent-rules \ --disable-dependency-tracking \ --enable-nls \ --enable-shared=yes \ --enable-static=no \ --enable-fast-install=yes \ --disable-libtool-lock \ --disable-rpath \ --disable-x11 \ --enable-console_ui \ --enable-gtk_ui=no \ --enable-notify=no \ --disable-relativeprefix \ --enable-date \ --enable-ipv6 \ --disable-truespeech \ --disable-nonstandard-gsm \ --disable-rsvp \ --disable-ssl \ --disable-video \ --disable-alsa \ --disable-zrtp \ --disable-portaudio \ --disable-strict \ --enable-tunnel=no \ --disable-external-ortp \ --enable-tests \ --enable-oss \ --disable-artsc \ --disable-macsnd \ --disable-macaqsnd \ --disable-pulseaudio \ --enable-speex \ --disable-gsm \ --disable-spandsp \ --disable-ffmpeg \ --disable-sdl \ --disable-x11 \ --disable-xv \ --disable-theora \ --disable-vp8 \ --disable-libv4l1 \ --disable-libv4l2 \ --with-gnu-ld \ --with-readline=$INSTALL_PATH \ OSIP_LIBS="-L$INSTALL_PATH/lib" \ SPEEXDSP_CFLAGS="-I$INSTALL_PATH/include" \ SPEEXDSP_LIBS="-L$INSTALL_PATH/lib" \ SPEEX_CFLAGS="-I$INSTALL_PATH/include" \ SPEEX_LIBS="-L$INSTALL_PATH/lib" \ OSIP_CFLAGS="-I$INSTALL_PATH/include" \ ORTP_LIBS="-L$INSTALL_PATH/lib" \ ORTP_CFLAGS="-I$INSTALL_PATH/include"if [ $? -eq 0 ]; then make if [ $? -eq 0 ]; then make install exit 0 fifiexit 1
需要注意的是,需要先將speex、readline、osip、eXosip以及ncurses編譯之後的庫,拷貝到linphone3.5.2檔案夾中的_install檔案夾中。最後執行./build.sh即可。