[置顶] 基于Linux开源VOIP系统LinPhone[六]

***************************************************************************************************************************
作者:EasyWave                                                                                 时间:2013.03.31

类别:Linux 应用LinPhone                                                              声明:转载,请保留链接

注意:如有错误,欢迎指正。这些是我学习的日志文章......

***************************************************************************************************************************

在《 基于Linux开源VOIP系统LinPhone[五] 》中,详细的介绍了speex库如果不需要libogg库的详细地修改方法,现在说说,linphone如何编译,前面已经说了。如果只编译不带ui和只有audio版本的linphone,只需要speex、readline、osip、eXosip以及ncurses库即可。如下图所示:

[置顶] 基于Linux开源VOIP系统LinPhone[六]_第1张图片

如果只编译不带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 as
VAR=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 specify
an 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 names

System 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 tests

Optional 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=/usr

Some 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-config

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <[email protected]>.


看到了。需要很多的配置选项,不过,对于没有用到,我们可以将其disable掉,所示最终的编译选项如下所示:

#!/bin/bash

INSTALL_PATH=`pwd`/_install

mkdir -p $INSTALL_PATH

#autoreconf -ivf
if [ -f config.h ]; then
	make distclean
fi

make 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
        fi
fi
exit 1


需要注意的是,需要先将speex、readline、osip、eXosip以及ncurses编译之后的库,拷贝到linphone3.5.2文件夹中的_install文件夹中。最后执行./build.sh即可。

你可能感兴趣的:(linux)