【介绍】
参考:http://linuxfromscratch.org/blfs/view/svn/general/libxml2.html
参考:https://mail.gnome.org/archives/commits-list/2012-January/msg11021
编译安装spdylay要求:
libxml - version >= 2.7.7.
【安装】
下载:http://xmlsoft.org/sources/
最高版本:libxml2-2.9.4
wget http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz && tar zxvf libxml2-2.9.4.tar.gz && cd libxml2-2.9.4 && export PKG_CONFIG=/usr/bin/pkg-config PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig Z_CFLAGS="-I/usr/include" Z_LIBS="-L/usr/lib -lz" LZMA_CFLAGS="-I/usr/include" LZMA_LIBS="-L/usr/lib -llzma" ICU_CFLAGS="-I/usr/include" ICU_LIBS="-L/usr/lib/icu -licu" && ./configure --prefix=/usr --disable-static --with-history && make && make install
相关文件路径:
/usr/include/libxml2 /usr/lib/libxml2.so.2.9.4 /usr/lib/cmake/libxml2 /usr/lib/pkgconfig/libxml-2.0.pc /usr/lib/python2.7/site-packages/libxml2.py
【排错】
当编译安装libxml2时,报错:
... CC xmlIO.lo xmlIO.c: In function ‘xmlXzfileClose’: xmlIO.c:1450:52: error: ‘LZMA_OK’ undeclared (first use in this function) ret = (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1; ^ xmlIO.c:1450:52: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [xmlIO.lo] Error 1 make[2]: Leaving directory `/root/apache/libxml2-2.9.4' ...
这是因为缺少lzma。
那么安装:
yum install lzma