Building ghostscript Under MkLinux

This document describes how to build ghostscript under MkLinux.

Obtaining the Distribution

I obtained the ghostscript 4.0 distribution from ftp.cs.wisc.edu, in the ghost/aladdin directory. I also obtained the standard fonts distribution (from the same directory), and the JPEG source distribution (from the ghost directory).

Running gunzip and un-tar-ing the ghostscript distribution yields a gs4.0 directory. The ghostscript makefiles expect to find the JPEG source in a jpeg-6a subdirectory inside the ghostscript directory. Thus, gunzip the JPEG distribution and un-tar it into the ghostscript directory, or un-tar the JPEG distribution into some other location and change JPEGSRC to reflect that location later on when you configure the makefile for ghostscript.

Setting Up the makefile

I compiled ghostscript using gcc 2.7.2 in ANSI mode; the correct makefile for this is unix-gcc.mak. I made a backup of this file and then created makefile as a symlink to it:

    % cp unix-gcc.mak unix-gcc.mak.bak
    % ln -s unix-gcc.mak makefile        (Note: makefile, not Makefile)

This allows you to make changes to the makefile but still recover (from the backup) if you make a mistake.

The changes I made to the makefile are available as a diff listing, and are described below:

Build and Install the Distribution

After you've configured the makefile, type make and wait for the build to finish. When it's done, assuming the build succeeds, type make install. At this point you can test the gs interpreter, e.g., with gs tiger.ps to draw the tiger picture in an X window. Anything that requires fonts will still fail, so you need to install the font files from the font distribution. The Fontmap file is installed in the /usr/local/share/ghostscript/4.0 directory, and the fonts can be put there, too.


Go to main MkLinux page
Document written by: Paul DuBois, paul@snake.net
Last updated: Tuesday, 02 July 1996 18:39