Introduction to Ghostscript
Ghostscript is a versatile
processor for PostScript data with the ability to render PostScript
to different targets.
This package is known to build and work properly using an LFS-7.3
expat-2.1.0, FreeType-2.4.12, libjpeg-turbo-1.2.1, libpng-1.6.2, LibTIFF-4.0.3,
and Little CMS-2.4
Cairo-1.12.14, Fontconfig-2.10.2, GTK+-2.24.17, Cups-1.6.2,
JasPer-1.900.1, Little CMS-1.19,
libidn-1.26, X Window
System and libpaper
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gs
Installation of Ghostscript
The Ghostscript build system is
not user-friendly. In order to use system copies of various
graphics libraries, you must do it using unconventional methods.
GPL Ghostscript includes (old)
copies of several libraries. Some of these seem to have been
patched to fix known vulnerabilities, but others of these copies
are less-well maintained. To ensure that any future fixes are
applied throughout the whole system, it is recommended that you
first install the released versions of these libraries and then
configure GPL Ghostscript to link
If you have installed these dependencies on your system, remove the
copies of expat, freetype, lcms2, libjpeg, libpng, and libtiff:
rm -rf expat freetype jpeg lcms2 libpng tiff
If you have a multicore computer and try to run make with
multiple jobs (eg, make -j4) then the build may fail due to race
conditions in the Ghostscript
build system. You can work around that problem by simply running
make again (eg, make -j4 || make
If you have installed Cups and your printer is not a postscript printer you will need
--with-install-cups to the
configure options below. (This option makes Ghostscript compile
and install the gstoraster filter and the gstoraster.convs
configuration file that allow Cups to convert a PostScript file
rm -rf jasper lcms zlib &&
./configure --prefix=/usr --enable-dynamic --with-system-libtiff LIBS=-lz &&
To compile the shared library
libgs.so, run the following additional command as
an unprivileged user:
This package does not come with a test suite. However, you may test
the operation of the newly built gs program by issuing the
following command (issue from an X Windows terminal):
bin/gs -Ilib -dBATCH examples/tiger.eps
Now, as the
If you want the shared library too:
make soinstall &&
install -v -m644 base/*.h /usr/include/ghostscript &&
ln -v -s ghostscript /usr/include/ps
Now install the documentation:
ln -sfv ../ghostscript/9.06/doc /usr/share/doc/ghostscript-9.06
To finish the installation, unpack all fonts you've downloaded to
/usr/share/ghostscript and ensure the
ownerships of the files are
in the command below for the fonts you wish to install:
tar -xvf ../
<font-tarball> -C /usr/share/ghostscript --no-same-owner
rm -rf jasper lcms
zlib: The Ghostscript build system defaults to using its
own version of OpenJpeg for JPEG 2000 files so
jasper source can be removed. The default color management system
is now lcms2 so the lcms source is not needed. Zlib was installed as part of LFS.
--with-system-libtiff: Remove this
option if you've not installed LibTIFF-4.0.3.
LIBS=-lz: Use the
LIBS variable to tell the linker (ld) to
link against the system installed zlib.
install -v -m644
base/*.h...: Some packages (ImageMagick is one) need the Ghostscript interface headers in place to link
to the shared library. These commands install the headers.
ln -v -s ghostscript
/usr/include/ps: Some packages expect to find the
interface headers in an alternate location.
ln -sfv ../ghostscript-9.06/doc
...: This puts a symbolic link to the documentation
where it is expected to be found.
bdftops, dumphint, dvipdf, eps2eps,
fixmswrd.pl, font2c, gs, gsbj, gsc (from soinstall), gsdj,
gsdj500, gslj, gslp, gsnd, gsx (from soinstall), lprsetup.sh,
pdf2dsc, pdf2ps, pdfopt, pf2afm, pfbtopfa, printafm, ps2ascii,
ps2epsi, ps2pdf, ps2pdf12, ps2pdf13, ps2pdf14, ps2pdfwr, ps2ps,
ps2ps2, pv.sh, unix-lpr.sh, and wftopfa
/usr/lib/ghostscript, /usr/share/ghostscript and
is an interpreter for Adobe Systems' PostScript(tm) and
Portable Document Format (PDF).
functionality to other programs, such as GSView, ImageMagick, and libspectre.
GPL Ghostscript provides many
different scripts used to convert PostScript, PDF, and other
formats. Please refer to the HTML documentation or the man pages
for information about the capabilities provided.