1. log in as root
2. Download Software
Http://www.boutell.com/gd/http/gd-1.8.1.tar.gz
3. OKWhether FreeType, libjpeg, and Xpm libraries have been installed in the system. These libraries are generally installed in the form of rpm packages,
You can use the following method to detect:
1) FreeType library Detection
Run rpm-qa | grep freetype on Shell. If the output of freetype-... is displayed
Installed FreeType Library
2) libjpeg library Detection
Run rpm-qa | grep libjpeg on the Shell. If you can see the output of libjpeg-..., it indicates installation.
Libjpeg Library
3) detect the Xpm Library
Run rpm-qa | grep xpm on Shell. If the output of xpm-... is displayed, the Xpm library is installed.
4. decompress and unpackage
Tar xzvf gd-1.8.1.tar.gz
5. Switch to the gd-1.8.1 directory
Cd gd-1.8.1
6. Use vi and vimOr open the Makefile file in a text editor such as emacs for proper modification. The following items must be modified:
(Note: The parameter in [] is optional. Do you want to determine the value based on the installed database of the system)
1) CFLAGS
CFLAGS =-O [-DHAVE_XPM] [-DHAVE_JPEG] [-DHAVE_LIBTTF]
If the Xpm library is installed, add-DHAVE_XPM
If the libjpeg library is installed, add-DHAVE_JPEG
If the FreeType library is installed, add-DHAVE_LIBTTF
2) LIBS
LIBS =-lm-lgd-lpng-lz [-ljpeg] [-lttf] [-lXpm-lX11]
If the Xpm library is installed, add-lXpm-lX11
If the libjpeg library is installed, add-ljpeg
If the FreeType library is installed, add-lttf
3) INSTALL_LIB, INSTALL_INCLUDE, INSTALL_BIN
GD library, header file, Executable File Installation destination, generally do not need to change
7. CompileIf a problem occurs during compilation, it is generally a problem with Makefile.
Make
8. Installation
Make install
9. Release a gd-1.8.1 directory
Cd ..
Rm-rf gd-1.8.1