# tar zxvf libxml2-2.6.32.tar.gz
# cd libxml2-2.6.32
# ./configure --prefix=/usr/local/libxml2/
# make && make install
编译安装zlib
# wget
# tar zxvf zlib-1.2.3.tar.gz
# # cd zlib/1.2.3/
# ./configure --prefix=/usr/local/zlib2/
# make && make install
编译安装jpeg
这个版本jpeg在make install时会出现目录error。手动创建这些目录,然后再重新make install就可以了,我这把缺失的命令都加上了,应该不会出这个error了。
# wget ftp://ftp.aai.ee/pub/unix/jpegsrc.v6b.tar.gz
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/man/man1 -p
# tar zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6
# make
# make install-lib
# make install
编译安装libpng
# wget
# tar zxvf libpng-1.2.18.tar.gz
# cd libpng-1.2.18
# cp scripts/makefile.gcmmx makefile
# ./configure --disable-shared --prefix=/usr/local/libpng2/
# make && make install
编译安装freetype
# wget
# tar zxvf freetype-2.3.5.tar.gz
# cd freetype-2.3.5
# ./configure --disable-shared --prefix=/usr/local/freetype2/
# make && make install
编译安装libart_lgpl
# wget
# tar zxvf libart_lgpl-2.3.17.tar.gz
# cd libart_lgpl-2.3.17
# ./configure --disable-shared --prefix=/usr/local/libart/
# make && make install
编译安装gettext
# wget
# tar zxvf gettext-0.16.1.tar.gz
# cd gettext-0.16.1
# ./configure --prefix=/usr/local/gettext/
# make && make install //这个编译时间好长啊。。。郁闷,可以出去吃个雪糕了haha
上面全部安装完成后,开始编译安装gd,此处注意configure时各个插件的地址是否正确:
# wget
# tar zxvf gd-2.0.35.tar.gz
# cd gd/2.0.35/
# ./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/ --with-libart=/usr/local/libart/ --with-gettext=/usr/local/gettext/ --with-libxml=/usr/local/libxml2
# cp /usr/lib/libattr.* /lib/ //如果没执行这步,make时会出现下面的error信息
# make && make install
安装GD2时出错提示:
cd . && /bin/sh /tmp/cacti/gd/2.0.35/config/missing --run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV' not found in library
cd . && /bin/sh /tmp/cacti/gd/2.0.35/config/missing --run automake-1.9 --foreign
cd . && /bin/sh /tmp/cacti/gd/2.0.35/config/missing --run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] error 1
解决方法:
# cp /usr/lib/libattr.* /lib/ //有两个libattr开头文件,有一个/lib里有,另一个复制过去就行了
编译安装Curl支持
# wget
# tar zxvf curl-7.15.0.tar.gz
# cd curl-7.15.0
# ./configure --prefix=/usr/local/curl
# make && make install