安裝 GD 前需要安裝 jpeg-6b, libpng, zlib, freetype。
1.安裝zlib
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
2.安裝libpng
tar zxvf libpng-1.2.29.tar.gz
cd libpng-1.2.29
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,這里的makefile不是用./configure生成,而是直接從scripts/里拷一個(gè)
3.安裝freetype
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure
make
make install
4.安裝Jpeg
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
注意,這里configure一定要帶--enable-shared參數(shù),不然,不會(huì)生成共享庫(kù)
5.安裝GD
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --with-png --with-freetype --with-jpeg
make install
如果GD報(bào)錯(cuò):configure.ac:64: warning: macro `AM_ICONV' not found in library
你就make clean一下,然后再make
如果你安裝別的出現(xiàn)libtool沒(méi)有找到,你就從/usr/bin/libtool cp 一個(gè)過(guò)來(lái)用就好了!
在64位下編譯GD 如果/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
這說(shuō)明zlib沒(méi)用用-fPIC進(jìn)行編譯修改zlib的Makefile CFLAGS=-O3 -DUSE_MMAP -fPIC
make
make install然后再編譯gd 就過(guò)去了!
發(fā)表評(píng)論