写于2018-09-09,以便参考是哪个版本的libnice;
libnice的linux编译,也有各种坑,记录下以便大家采坑;
1、git clone https://gitlab.freedesktop.org/libnice/libnice.git
2、cd libnice,查看readme,里面有提示依赖的其他库
Requirements
------------
glib >= 2.44
pkg-config
gnutls >= 2.12.0
gupnp-igd >= 0.1.2 (optional)
gstreamer-0.10 >= 0.10.0 (optional)
gstreamer-1.0 (optional)
Build instructions
3、wget http://ftp.gnome.org/pub/gnome/sources/glib/2.48/glib-2.48.1.tar.xz
tar -xvf glib-2.48.1.tar.xz
cd glib2.48.1.tar.xz
./autogen.sh提示:没安装gtk-doc
4、运行apt-get install gtk-doc-tools
5、下载https://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
提示:configure: error: Package requirements (libpcre >= 8.13) were not met:
好吧,接着下pcre:https://sourceforge.net/projects/pcre/files/pcre/8.42/pcre-8.42.zip
./configure --enable-utf8 --enable-unicode-properties(一定加上两个选项)
6、接着回来到glib目录
./autogen.sh
make && make install
7、回到libnice目录
接着要安装gnutls >= 2.12.0
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.0.tar.xz下载
./configure
又提示:Libnettle 3.1 was not found.没有
8、wget http://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz
./configure
9、回到gnutls
./configure
Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
好吧,网上查,是因为nettle安装不正确,可是找半天没找到hogweed,而且需要gmp support;
看了下gnutls的README,偶然发现这句话:
cd nettle-
./configure --prefix=/usr --disable-openssl --enable-shared --enable-mini-gmp
make
sudo make install
好吧,看来要指定安装目录,而且要是shared的,重新编译nettle吧
10、重新回到gnutls
./configure
提示:gmp was not found
11、运行:sudo apt-get install libgmp-dev
12、在到gnutls:
./configure
又提示: Libtasn1 4.3 was not found.
wget ftp://ftp.gnu.org/gnu/libtasn1/libtasn1-4.4.tar.gz
./configure && make && make install
12、回到gnutls
./configure
还提示:p11-kit >= 0.23.1
13、wget https://github.com/p11-glue/p11-kit/archive/0.23.10.tar.gz
configure && make && make install
14、回到gnutls
总算通过了
15、回到libnice目录
./autogen.sh
make -j8
ok总算编译成功了