⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 make.txt

📁 实现并行算法
💻 TXT
📖 第 1 页 / 共 4 页
字号:
   Copyright (C) 1989, 1995, 1996 Aladdin Enterprises.  All rights reserved.
  
  This file is part of Aladdin Ghostscript.
  
  Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  or distributor accepts any responsibility for the consequences of using it,
  or for whether it serves any particular purpose or works at all, unless he
  or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  License (the "License") for full details.
  
  Every copy of Aladdin Ghostscript must include a copy of the License,
  normally in a plain ASCII text file named PUBLIC.  The License grants you
  the right to copy, modify and redistribute Aladdin Ghostscript, but only
  under certain conditions described in the License.  Among other things, the
  License requires that the copyright notice and this notice be preserved on
  all copies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This file, make.txt, describes how to build Ghostscript executables from
source.

For an overview of Ghostscript and a list of the documentation files, see
README.

********
******** Building Ghostscript from source
********

Ghostscript is generally distributed in the form of a compressed tar file
(.tar.gz).  When unpacked, this file puts all the Ghostscript files in a
directory called gsA.BC, where A.BC is the version number.  Ghostscript is
also available in the form of PC-compatible .zip files.

Ghostscript uses a library provided by the Independent JPEG Group.  This
library is included in the Ghostscript distribution in a separate file.  If
you already have a copy of a version of this library that is compatible with
Ghostscript, you won't have to FTP or unpack it again.  Please see the file
jpeg.mak for information about which version(s) of the IJG code are
compatible with Ghostscript.  This library does not include the gsA.BC
prefix; you should make the gsA.BC directory current before you unpack the
JPEG archive.  Both the .tar.gz and .zip archives of the library do,
however, include a subdirectory name jpeg-## where ## is the version number,
so the files will end up in a directory named gsA.BC/jpeg-##/.

Ghostscript also uses the freely available PNG and ZLIB libraries.  These
libraries are also included in the distribution in separate files.  Please
see libpng.mak and zlib.mak for information about where to get the most
up-to-date versions of these libraries.  Unfortunately, the public archives
of these libraries are inconsistent about subdirectory names, and the
conventions vary from release to release, so you must do different things
depending on whether you are using the .tar.gz archive or the .zip archive
and possibly depending on which release you are using.  If you are using the
.tar.gz archive, then:

	- Before unpacking libpng-#.##.tar.gz, make the gsA.BC directory
	current.  Unpacking will create a subdirectory named
	gsA.BC/libpng-#.##.  Rename this subdirectory as gsA.BC/libpng.

	- Before unpacking zlib-#.##.tar.gz, make the gsA.BC directory
	current.  Unpacking will create a subdirectory named gsA.BC/zlib or
	gsA.BC/zlib-#.##; if the latter, rename it as gsA.BC/zlib.

If you are using the .zip archive, then:

	- Before unpacking lbpng###.zip or lp###.zip, create a directory
	called gsA.BC/libpng and make it current.

	- Before unpacking zlib###.zip or zlib-###.zip, create a directory
	called gsA.BC/zlib and make it current.

Ghostscript is described by a collection of several makefiles:

	gs.mak, int.mak, lib.mak, jpeg.mak, libpng.mak, zlib.mak - generic
	  makefiles used on all platforms (except VMS).
	devs.mak - a makefile listing all the device drivers.
	*.mak - the makefiles for specific platforms.

You may need to edit the platform-specific makefile if you wish to change
any of the following:

	- The name of the makefile itself (MAKEFILE macro);

	- The default search path(s) for the initialization and font files
	  (GS LIB_DEFAULT_macro);

	- The debugging options (DEBUG and TDEBUG macros);

	- The set of device drivers to be included (DEVICE_DEVS
	  and DEVICE_DEVS1..15 macros);

	- The set of optional features to be included (FEATURE_DEVS)

The platform-specific makefile will include comments describing all of
these items except the DEVICE_DEVS options; the available DEVICE_DEVS
options (device drivers) are described in devs.mak, even though the file
that must be edited is the platform-specific makefile.  (These comments do
not apply to the VMS platform; it has its own procedures, which are
described near the end of this document.)

The makefiles distributed with Ghostscript define these options as
follows:

	- MAKEFILE: the xxx.mak name of the makefile as distributed
	  (platform-specific).

	- GS_LIB_DEFAULT: on Unix systems, /usr/local/share/ghostscript/N.NN
	and /usr/local/share/ghostscript/fonts, where N.NN is the
	Ghostscript release number (e.g., 3.33); on MS-DOS systems, . and
	C:\GS.  Note that on Unix systems, GS_LIB_DEFAULT does not include
	. (the current directory).

	- DEBUG, TDEBUG: no debugging code included in the build.

	- DEVICE_DEVS*: platform-specific, see below.

	- FEATURE*: platform-specific.

There are also platform-specific options described below under the
individual platforms.  See the "Options" section near the beginning of the
relevant makefile for more information.

If you are including a dot-matrix printer driver, you may wish to
customize the default resolution parameters in devs.mak.

To build the interpreter, you need all the .h and .c files (and .asm files
for MS-DOS, and .def files for MS Windows) included in the distribution, as
well as the makefiles.

The command
	make clean
removes all the files created by the build process (relocatables,
executables, and miscellaneous scratch files).  If you want to save the
executable, you should move it to another directory first.

Features and devices
--------------------

When compiling Ghostscript, you may configure it with any of a variety of
features, and with any subset of the available device drivers.  You will
find the complete list of features in a comment at the beginning of the file
gs.mak, and the complete list of drivers in a comment at the beginning of
devs.mak.

To find out what devices a particular makefile selects for inclusion in
the executable, find the line in the makefile of the form
	FEATURE_DEVS=<list of features>
and
	DEVICE_DEVS=<list of devices>
	(similarly DEVICE_DEVS1... up to DEVICE_DEVS15)
For example, if the makefile for Unix platforms defined
	FEATURE_DEVS=level2.dev
indicating that only the PostScript Level 2 facilities should be included,
you might wish to add
	FEATURE_DEVS=level2.dev pdf.dev
to add the ability to interpret PDF files.  (In fact, the current definition
of FEATURE_DEVS in the Unix makefiles does include pdf.dev.)  The Unix
makefile also defines
	DEVICE_DEVS=x11.dev
	DEVICE_DEVS9=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
indicating that the X11 driver and all of the Portable Bit/Gray/PixMap
file drivers should be included.

You may edit the FEATURE* lines to select any desired set of features (as
listed near the beginning of gs.mak), and the DEVICE_DEVS* line(s) to select
any desired set of device drivers (as listed near the beginning of
devs.mak).  The first device listed in the definition of DEVICE_DEVS will be
used as the default device (unless overridden from the command line with
-sDEVICE=xxx, of course.)  If you can't fit all the devices on a single
line, you may add lines defining
	DEVICE_DEVS2=<dev21>.dev ... <dev2n>.dev
	DEVICE_DEVS3=<dev31>.dev ... <dev3n>.dev
etc. up to DEVICE_DEVS15.  Don't use continuation lines -- this doesn't
work on some platforms.

Cross-compiling
---------------

If you are compiling Ghostscript on machine X with a cross-compiler that
generates code for machine Y, you need to do one extra step.  Rather than
simply giving the command
	make
you must proceed in three steps.  First,
	make arch.h
Then edit arch.h to reflect the architecture of machine Y.  Then,
	make

LZW compression
---------------

It is possible to substitute an LZW compressor for the LZW-compatible
encoder provided with the standard fileset, by finding the two lines in
lib.mak that read

	lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
	#lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)

and changing them to

	#lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
	lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)

If you do this, you are responsible for constructing or obtaining a file
slzwe.c that implements LZW compression; such a file is not included in any
current standard Ghostscript distribution, although you may be able to find
one in distributions that predate Unisys' amnesty cutoff of January 1, 1995.
You are also responsible for drawing your own conclusions about the
applicability to LZW compression code of patents held by Unisys and/or IBM,
and for obtaining any licenses you believe to be relevant.

********
******** How to build Ghostscript from source (PC version) ********
********

The relevant makefiles are:
	Turbo C: tc.mak
	Turbo C++/Borland C++, MS-DOS: bc.mak
	Borland C++, MS Windows: bcwin.mak
	Borland C++ 4.0, MS Windows with Win32s or MS Windows NT: bcwin32.mak
	Microsoft C/C++ 7.0, MS-DOS: msc.mak
	Watcom C/386 or C++, MS-DOS: watc.mak
	Watcom C/386 or C++, MS Windows (NOT DEBUGGED YET): watcwin.mak
	DJGPP, DESQview/X: dvx-gcc.mak
The options were chosen to strike a balance between RAM consumption and
likely usefulness.  (Turbo C is limited to 640K and does not support code
overlaying; Borland C++ is limited to 640K, but supports code overlaying
under MS-DOS; the Watcom and DJGPP compilers are not limited to 640K.)

To build Ghostscript, you need MS-DOS version 3.3 or later, and a (Borland)
Turbo C/C++, Borland C/C++, Microsoft C/C++ (version 7), Watcom C/386
(version 8.5 or later) or C++ (any version), or the free djgpp + go32
development system.  Details are given below.

As noted above, the default configuration generates an executable that
assumes the directory where 'make' was run should be the final default
directory for looking up the Ghostscript initialization and font files.

To build the Ghostscript executable, all you need to do is give the
command
	make
You must have COMMAND.COM in your path to build Ghostscript.

There is a special 'make' target that simply attempts to compile all the
.c files in the current directory.  Some of these compilations will fail,
but the ones that succeed will go considerably faster, because they don't
individually pay the overhead of loading the compiler into memory.  So a
good strategy for building the executable for the first time, or after a
change to a very widely used .h file, is:
	make begin
and then
	make
to do the compilations that failed the first time.

Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
the file on a MS-DOS machine, the files will all have linefeed instead of
carriage return + linefeed as the line terminator, which may make the C
compiler unhappy.  I don't know the simplest way to fix this: just reading
each file into an editor and writing it back out again may be sufficient.
You will probably have to do this to the .c, .h, and .bat files.

Borland environment
-------------------

To compile Ghostscript with the Borland environment, you need either Turbo
C (version 2.0 or later) or Turbo C++ or Borland C++ (version 1.0 or
later); specifically, the compiler, 'make' utility, and linker.  You also
need either the Borland assembler (version 1.0 or later) or the Microsoft
assembler (version 4.0 or later).  Before compiling or linking, you should
execute
	echo !include "tc.mak" >makefile
(for Turbo C and MS-DOS), or
	echo !include "bc.mak" >makefile
(for Turbo C++ or Borland C++ and MS-DOS), or
	echo !include "bcwin.mak" >makefile
(for Turbo C++ or Borland C++ and Microsoft Windows), or
	echo !include "bcwin32.mak" >makefile
(for Borland C++ and Microsoft Windows with Win32s or Microsoft Windows NT)

Besides the source files and the makefiles, you need:
	turboc.cfg (the flags and switches for Turbo C)
	gs.tr (the linker commands for the interpreter)
	*.bat (a variety of batch files used in the build process)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -