Installing gd-1.8.1 in Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.