home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / UsingPDF / GhostScript / docs / make.txt < prev    next >
Encoding:
Text File  |  1997-11-04  |  61.3 KB  |  1,541 lines

  1.    Copyright (C) 1989, 1995, 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17.  
  18. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  19.  
  20. This file, make.txt, describes how to build Ghostscript executables from
  21. source.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.
  25.  
  26. ********
  27. ******** Overview ********
  28. ********
  29.  
  30. This document describes how to build a Ghostscript executable from source
  31. code.  There are 4 major steps to building Ghostscript:
  32.  
  33.     1) Acquire the source code.
  34.  
  35.     2) Unpack the source code.
  36.  
  37.     3) Prepare the makefiles, including making edits for your
  38.     operating environment and configuration choices.
  39.  
  40.     4) Invoke 'make'.
  41.  
  42. The remaining sections of this document describes each of these steps in
  43. detail.  Note that parts of these steps are platform-dependent.
  44.  
  45. After you have built Ghostscript, please refer to install.txt for
  46. instructions on installing it.
  47.  
  48. ********
  49. ******** Acquiring the source code ********
  50. ********
  51.  
  52. To build Ghostscript, you need the Ghostscript source code itself, and the
  53. source code for some third-party libraries that Ghostscript uses.
  54.  
  55. Ghostscript itself
  56. ------------------
  57.  
  58. The authoritative distribution directory for Aladdin Ghostscript is
  59.     ftp://ftp.cs.wisc.edu/ghost/aladdin/gs###
  60. where ### is the Ghostscript version number.  GNU Ghostscript should be
  61. available on all GNU sites.
  62.  
  63. There are 3 different cases for retrieving the source files.
  64.  
  65. (1) If neither (2) nor (3) below applies to you, you need:
  66.     ghostscript-#.##.tar.gz
  67.     ghostscript-fonts-std-#.##.tar.gz
  68.     ghostscript-fonts-other-#.##.tar.gz
  69. where #.## is the version number.  (The second part of the version number
  70. may have either 1 or 2 digits.)
  71.  
  72. (2) If you are building Aladdin Ghostscript (not GNU Ghostscript) on MS-DOS
  73. or MS Windows, and you don't have (and don't want to acquire) the tar and
  74. gzip programs, you can get:
  75.     gs###fn*.zip
  76.     gs###sr*.zip
  77. instead of the .tar.gz files, if the .zip files are available for the
  78. version you want.
  79.  
  80. (3) If you are building Ghostscript on MS-DOS or MS Windows and using
  81. .tar.gz files, rename the files as
  82.     gs###sr.taz
  83.     gs###fn1.taz
  84.     gs###fn2.taz
  85. respectively when you retrieve them.  You will need compatible PC executable
  86. versions of the tar and gzip programs in this case.
  87.  
  88. Third-party libraries
  89. ---------------------
  90.  
  91. You need the source code for the Independent JPEG Group (IJG) library, the
  92. PNG library, and the zlib library in order to build Ghostscript.  The
  93. authoritative distribution points for these libraries are, respectively:
  94.  
  95.     IJG library:
  96.     ftp.uu.net:/graphics/jpeg/jpegsrc.v##.tar.gz
  97.     ftp.simtel.net:/pub/simtelnet/msdos/graphics/jpegsr##.zip
  98.     PNG library:
  99.     ftp://swrinde.nde.swri.edu/pub/png/src/
  100.         libpng-#.##.tar.gz
  101.         lpng###.zip (or possibly lbpng###.zip or lp###.zip)
  102.     zlib library:
  103.     ftp://ftp.uu.net/pub/archiving/zip/zlib/
  104.         zlib-#.#.#.tar.gz
  105.         zlib###.zip
  106.  
  107. Get the .zip files if you are building on MS-DOS or MS Windows, the .tar.gz
  108. files for all other environments.  Note that each of these libraries has its
  109. own version numbers that have nothing to do with Ghostscript version
  110. numbers; you should get the highest numbered version.  (You may have to go
  111. back and get a lower-numbered version if you encounter difficulties in the
  112. build process, but don't worry about this yet.)  If you're running Linux,
  113. you might check whether these libraries are already available in source form
  114. on your system, since many Linux distributors include them; but we advise
  115. you to get the highest version from the Net if you can.
  116.  
  117. Even though the .zip archive of some old versions of the PNG library may be
  118. named something other than lpng###.zip, we'll refer to this archive as
  119. lpng###.zip below, so you might want to rename it after getting it to avoid
  120. confusion.
  121.  
  122. ********
  123. ******** Unpacking the source code ********
  124. ********
  125.  
  126. Unfortunately, there are no generally accepted standards for how to package
  127. source code into archives, so the instructions for unpacking Ghostscript are
  128. longer than they should be.
  129.  
  130. The Ghostscript sources normally go into a directory named gs#.##, where
  131. again #.## is the Ghostscript version number.  For the remainder of this
  132. document, we will refer to the gs#.## directory as the "gs directory".
  133.  
  134. To unpack a .tar.gz archive, you need the gzip and tar programs.  Executable
  135. versions of these programs are normally available on all Unix systems, and
  136. are available from GNU sites (including source code) for other environments.
  137. The way to unpack a .tar.gz archive is
  138.     gzip -d -c somefile.tar.gz | tar -xf -
  139. If your version of tar supports the -z switch for automatic decompression,
  140. you can use
  141.     tar -zxf somefile.tar.gz
  142.  
  143. To unpack a .zip archive in a Microsoft environment, you need the PKUNZIP
  144. program, which is normally delivered with the OS.  To unpack a .zip archive,
  145.     PKUNZIP somefile.zip
  146.  
  147. We won't say anything more here about unpacking the fonts, since that is not
  148. part of the build process per se, but of installation.
  149.  
  150. Ghostscript itself
  151. ------------------
  152.  
  153. The ghostscript-#.##.tar.gz archive unpacks all of the Ghostscript files
  154. into the directory ./gs#.##.
  155.  
  156. The gs###sr*.zip archives also include the subdirectory name gs#.##, but
  157. some versions of PKUNZIP discard the directory name and always unpack into
  158. the current directory.  If your version of PKUNZIP does this, you must
  159.     MKDIR gs#.##
  160.     CD gs#.##
  161. before unpacking the archive.
  162.  
  163. Third-party libraries
  164. ---------------------
  165.  
  166. The file names in the IJG archives (jpegsrc.v##.tar.gz or jpegsr##.zip)
  167. include a subdirectory name jpeg-##/, so you should unpack them in the same
  168. way as just described for the Ghostscript sources, except that you should
  169. make the gs directory current first, and the subdirectory name will be
  170. jpeg-##.  (This will be a subdirectory of the gs directory, of course.)
  171.  
  172. Unfortunately, the situation for the PNG and zlib libraries varies from
  173. release to release.  If you are using the .tar.gz archives, then:
  174.  
  175.     - Before unpacking libpng-#.##.tar.gz, make the gs directory
  176.     current.  Unpacking will create a subdirectory named
  177.     libpng-#.##.  Rename this subdirectory as libpng.
  178.  
  179.     - Before unpacking zlib-#.#.#.tar.gz, make the gs directory
  180.     current.  Unpacking will create a subdirectory named zlib or
  181.     zlib-#.#.#; if the latter, rename it as zlib.
  182.  
  183. If you are using the .zip archives, and your version of PKUNZIP preserves
  184. directory information, follow the same steps as for the .tar.gz archives.
  185. If your version of PKUNZIP discards directory names:
  186.  
  187.     - Before unpacking lpng###.zip, make the gs directory current, and
  188.     then
  189.         MKDIR libpng
  190.         CD libpng
  191.  
  192.     - Before unpacking zlib###.zip or zlib-###.zip, make the gs
  193.     directory current, and then
  194.         MKDIR zlib
  195.         CD zlib
  196.  
  197. ********
  198. ******** Makefile overview ********
  199. ********
  200.  
  201. The Ghostscript makefiles are very large and complex.  Fortunately, the only
  202. makefiles you are likely to need to deal with are relatively small ones
  203. containing platform-specific information, as follows:
  204.  
  205.     ansihead.mak - Unix with ANSI C compilers other than gcc
  206.     cc-head.mak - Unix with "traditional C" compilers
  207.     gcc-head.mak - Unix with gcc
  208.     watc.mak - MS-DOS with Watcom compilers
  209.     bcwin32.mak - MS Windows with Borland compilers
  210.     msvc32.mak - MS Windows with Microsoft Visual C++ version 4.n or 5.n
  211.     watcw32.mak - MS Windows with Watcom compilers
  212.     openvms.mak - OpenVMS
  213.     dgc-head.mak - DesqView/X with gcc
  214.     os2.mak - OS/2 with the gcc/emx compiler
  215.  
  216. Since the contents of these files change from one Ghostscript version to
  217. another, sometimes substantially, and since they all include documentation
  218. for the various options, we won't duplicate most of that documentation here:
  219. after reading the information below, we strongly recommend that you read the
  220. entire makefile for your OS and compiler before building Ghostscript.
  221.  
  222. In Ghostscript versions 5.0*, watcw32.mak doesn't work, so we won't describe
  223. it further.
  224.  
  225. For completeness, the platform-independent makefiles are:
  226.  
  227.     version.mak - identifies the version and release date
  228.     gs.mak - documentation and miscellany
  229.     lib.mak - the main makefile for the graphics engine
  230.     int.mak - the main makefile for the PostScript/PDF interpreter
  231.     jpeg.mak - the makefile for the IJG library
  232.     libpng.mak - the makefile for the PNG library
  233.     zlib.mak - the makefile for the zlib library
  234.     devs.mak - the makefile for the device drivers
  235.  
  236. ********
  237. ******** Preparing the makefiles for your environment ********
  238. ********
  239.  
  240. You may need to edit the platform-specific makefile if you wish to change
  241. any of the following:
  242.  
  243.     - The name of the makefile itself (MAKEFILE macro);
  244.  
  245.     - The default search path(s) for the initialization and font files
  246.       (GS LIB_DEFAULT macro);
  247.  
  248.     - The debugging options (DEBUG and TDEBUG macros);
  249.  
  250.     - The set of device drivers to be included (DEVICE_DEVS
  251.       and DEVICE_DEVS1..15 macros);
  252.  
  253.     - The set of optional features to be included (FEATURE_DEVS).
  254.  
  255. The platform-specific makefile will include comments describing all of these
  256. items except the DEVICE_DEVS options; the available DEVICE_DEVS options
  257. (device drivers) are described in devs.mak, even though the file that must
  258. be edited is the platform-specific makefile.  You should also check the
  259. JVERSION and PVERSION macros in the platform-specific makefile, and adjust
  260. them if they do not match the JPEG and PNG library versions you are using:
  261. see jpeg.mak and libpng.mak for more info.
  262.  
  263. There are also platform-specific options described below under the
  264. individual platforms.  See the "Options" section near the beginning of the
  265. relevant makefile for more information.
  266.  
  267. If you are including a dot-matrix printer driver, you may wish to
  268. customize the default resolution parameters in devs.mak.
  269.  
  270. Features and devices
  271. --------------------
  272.  
  273. When compiling Ghostscript, you may configure it with any of a variety of
  274. features, and with any subset of the available device drivers.  You will
  275. find the complete list of features in a comment at the beginning of the file
  276. gs.mak, and the complete list of drivers in a comment at the beginning of
  277. devs.mak.
  278.  
  279. To find out what devices a particular makefile selects for inclusion in
  280. the executable, find the line in the makefile of the form
  281.     FEATURE_DEVS=<list of features>
  282. and
  283.     DEVICE_DEVS=<list of devices>
  284.     (similarly DEVICE_DEVS1... up to DEVICE_DEVS15)
  285. For example, if the makefile for Unix platforms defined
  286.     FEATURE_DEVS=level2.dev
  287. indicating that only the PostScript Level 2 facilities should be included,
  288. you might wish to add
  289.     FEATURE_DEVS=level2.dev pdf.dev
  290. to add the ability to interpret PDF files.  (In fact, the current definition
  291. of FEATURE_DEVS in the Unix makefiles does include pdf.dev.)  The Unix
  292. makefile also defines
  293.     DEVICE_DEVS=x11.dev
  294.     DEVICE_DEVS9=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
  295. indicating that the X11 driver and all of the Portable Bit/Gray/PixMap
  296. file drivers should be included.  (In fact, it includes many more drivers
  297. than this: see the Unix makefiles for the full list.)
  298.  
  299. You may edit the FEATURE* lines to select any desired set of features (as
  300. listed near the beginning of gs.mak), and the DEVICE_DEVS* line(s) to select
  301. any desired set of device drivers (as listed near the beginning of
  302. devs.mak).  The first device listed in the definition of DEVICE_DEVS will be
  303. used as the default device (unless overridden from the command line with
  304. -sDEVICE=xxx, of course.)  If you can't fit all the devices on a single
  305. line, you may add lines defining
  306.     DEVICE_DEVS2=<dev21>.dev ... <dev2n>.dev
  307.     DEVICE_DEVS3=<dev31>.dev ... <dev3n>.dev
  308. etc. up to DEVICE_DEVS15.  Don't use continuation lines -- this doesn't
  309. work on some platforms.
  310.  
  311. LZW compression
  312. ---------------
  313.  
  314. It is possible to substitute an LZW compressor for the LZW-compatible
  315. encoder provided with the standard fileset, by finding the two lines in
  316. lib.mak that read
  317.  
  318.     lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
  319.     #lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)
  320.  
  321. and changing them to
  322.  
  323.     #lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
  324.     lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)
  325.  
  326. If you do this, you are responsible for constructing or obtaining a file
  327. slzwe.c that implements LZW compression; such a file is not included in any
  328. current standard Ghostscript distribution, although you may be able to find
  329. one in distributions that predate Unisys' amnesty cutoff of January 1, 1995.
  330. You are also responsible for drawing your own conclusions about the
  331. applicability to LZW compression code of patents held by Unisys and/or IBM,
  332. and for obtaining any licenses you believe to be relevant.
  333.  
  334. Creating 'makefile'
  335. -------------------
  336.  
  337. As the final step in preparing the makefile, you need to associate the name
  338. 'makefile' with the correct makefile for your environment as follows.
  339.  
  340. On Unix systems, execute:
  341.     ln -s unix-gcc.mak makefile
  342. if you are using gcc, or
  343.     ln -s unixansi.mak makefile
  344. if you are using another ANSI C compiler, or
  345.     ln -s unix-cc.mak makefile
  346. if you are using a "traditional C" compiler.  If your Unix system doesn't
  347. support symbolic links, omit the -s switch.  Then, if you have edited any
  348. of the makefile components listed above, execute
  349.     tar_cat
  350.  
  351. On MS Windows with the Borland compiler, execute:
  352.     echo !include "bcwin32.mak" >makefile
  353.  
  354. On MS Windows with the Microsoft compiler, execute:
  355.     echo !include msvc32.mak >makefile
  356.  
  357. On MS-DOS or MS Windows with the Watcom compiler, add the line
  358.     set DOS4G=quiet
  359. to your autoexec.bat file, and also execute:
  360.     set DOS4G=quiet
  361. Then execute:
  362.     echo !include watc.mak >makefile
  363. (for MS-DOS) or
  364.     echo !include watcw32.mak >makefile
  365. (for MS Windows).
  366.  
  367. ********
  368. ******** Invoking 'make' ********
  369. ********
  370.  
  371. The command
  372.     make clean
  373. removes all the files created by the build process (relocatables,
  374. executables, and miscellaneous scratch files).  If you want to save the
  375. executable, you should move it to another directory first.
  376.  
  377. The command
  378.     make
  379. builds Ghostscript without debugging options.
  380.  
  381. The command
  382.     make debug
  383. builds Ghostscript with debugging options and additional internal error
  384. checks.  Ghostscript will be somewhat larger and slower, but it won't behave
  385. any differently unless you actually turn debugging options at execution time
  386. with the -DDEBUG or -Z command line switches (described in use.txt).
  387.  
  388. On most platforms, these simple instructions don't quite work in one way or
  389. another: read the section on your platform below.
  390.  
  391. Cross-compiling
  392. ---------------
  393.  
  394. If you are compiling Ghostscript on machine X with a cross-compiler that
  395. generates code for machine Y, you need to do one extra step.  Rather than
  396. simply giving the command
  397.     make
  398. you must proceed in three steps.  First,
  399.     make arch.h
  400. Then edit arch.h to reflect the architecture of machine Y.  Then,
  401.     make
  402.  
  403. ********
  404. ******** How to build Ghostscript from source (PC version) ********
  405. ********
  406.  
  407. The relevant makefiles are:
  408.     Borland C++ 4.x, 32-bit MS Windows (3.1 + Win32s, 95, NT): bcwin32.mak
  409.     Microsoft Visual C++ 4.x or 5.x, 32-bit MS Windows: msvc32.mak
  410.     Watcom C/386 or C++, 32-bit (extended) MS-DOS: watc.mak
  411.     Watcom C/386 or C++, 32-bit MS Windows (DOESN'T WORK YET): watcw32.mak
  412.     DJGPP, DESQview/X: dvx-gcc.mak
  413.     cygwin32 gcc: unix-gcc.mak (see below)
  414. The options were chosen to strike a balance between RAM consumption and
  415. likely usefulness.
  416.  
  417. To build Ghostscript, you need MS-DOS version 3.3 or later, and Borland
  418. C/C++ (4.0 or later), Microsoft Visual C++ (version 4.0 or later), Watcom
  419. C/386 (version 8.5 or later) or C++ (any version), or the free djgpp + go32
  420. development system.  Details are given below.
  421.  
  422. As noted above, the default configuration generates an executable that
  423. assumes the directory where 'make' was run should be the final default
  424. directory for looking up the Ghostscript initialization and font files.
  425.  
  426. To build the Ghostscript executable, all you need to do is give the
  427. command
  428.     make
  429. You must have COMMAND.COM in your path to build Ghostscript.
  430.  
  431. There is a special 'make' target that simply attempts to compile all the
  432. .c files in the current directory.  Some of these compilations will fail,
  433. but the ones that succeed will go considerably faster, because they don't
  434. individually pay the overhead of loading the compiler into memory.  So a
  435. good strategy for building the executable for the first time, or after a
  436. change to a very widely used .h file, is:
  437.     make begin
  438. and then
  439.     make
  440. to do the compilations that failed the first time.
  441.  
  442. Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
  443. the file on a MS-DOS machine, the files will all have linefeed instead of
  444. carriage return + linefeed as the line terminator, which may make the C
  445. compiler unhappy.  I don't know the simplest way to fix this: just reading
  446. each file into an editor and writing it back out again may be sufficient.
  447. You will probably have to do this to the .c, .h, and .bat files.
  448.  
  449. Borland environment
  450. -------------------
  451.  
  452. To compile Ghostscript with the Borland environment, you need Borland C++
  453. (version 4.0 or later); specifically, the compiler, 'make' utility, and
  454. linker.  You also need either the Borland assembler (version 1.0 or later)
  455. or the Microsoft assembler (version 4.0 or later).
  456.  
  457. Besides the source files and the makefiles, you need:
  458.     turboc.cfg (the flags and switches for Turbo C)
  459.     gs.tr (the linker commands for the interpreter)
  460.     *.bat (a variety of batch files used in the build process)
  461.  
  462. There are extensive comments in the aforementioned .mak files
  463. regarding various configuration parameters.  If your configuration is
  464. different from the following, you should definitely read those
  465. comments and see if you want or need to change any of the parameters:
  466.     - The compiler files are in c:\bc and its subdirectories.
  467.     - You are using the Borland assembler (tasm).
  468.     - You want an executable that will run on any 32-bit PC-compatible,
  469. regardless of processor type (80386, 80486, Pentium, or compatible) and
  470. regardless of whether a math coprocessor (80x87) is present (only an issue
  471. with 80386 processors).
  472.  
  473. NOTE: A user has reported the Borland C++ 4.00 + patch 1-6 doesn't produce a
  474. working executable of the current Ghostscript (5.03).  We can't test this,
  475. since we no longer have this compiler.
  476.  
  477. NOTE: Borland C++ 4.52 has a bug that causes the 32-bit Windows executable
  478. to fail during startup.  Borland has provided a patch for this bug on the
  479. file bc45xp1.zip, accessible as a link from
  480. http://loki.borland.com/cpp/Patchs.htm.
  481.  
  482. NOTE: Borland C++ 5.0 and 5.01 have a code generator bug that generates
  483. incorrect code for the construct !file_is_valid().  Do not attempt to
  484. compile Ghostscript with these compilers.  If you want to report this bug to
  485. Borland, send them the result of compiling ziodev.c and tell them to look at
  486. the code generated for file_is_valid() and !file_is_valid().  We don't know
  487. whether Borland C++ 5.02 still has this problem.
  488.  
  489. If building for the MS Windows Win32s environment, you need bcc32.cfg
  490. instead of turboc.cfg.  The make process will stop after it has created
  491. genarch.exe.  You should then run 'win genarch arch.h', wait until genarch
  492. has finished and then exit MS Windows.  Then type 'make' again to restart
  493. the make process.
  494.  
  495. If building for MS Windows NT, you also need bcc32.cfg instead of
  496. turboc.cfg, but the make process will run to completion automatically.
  497.  
  498. Microsoft environment
  499. ---------------------
  500.  
  501. To compile Ghostscript with the Microsoft environment, you need Microsoft
  502. Visual C++ 4.0 or later with its associated `nmake' utility and linker.  If
  503. you are using version 4.x, change the line in msvc32.mak that reads
  504.     MSVC_VERSION = 5
  505. to
  506.     MSVC_VERSION = 4
  507. before building.
  508.  
  509. You may get error messages during compilation about /QI0f being an undefined
  510. switch, or the message
  511.     dwmain32.def: EXETYPE not supported for platform; ignored
  512. during linking.  Ignore them.
  513.  
  514. Watcom environment
  515. ------------------
  516.  
  517. Before compiling, change the definition of the WCVERSION macro in the
  518. makefile (watc.mak or watcw32.mak) to the version of the Watcom compiler you
  519. are using.  This is necessary to handle some minor incompatibilities between
  520. versions.
  521.  
  522. To build Ghostscript, execute
  523.  
  524.     wmakebat
  525.  
  526. This constructs a build script and then executes it.  (This roundabout
  527. procedure is necessary because Watcom chose to implement wmake in a way that
  528. requires reading both the entire makefile and the entire current directory
  529. into the limited 640K MS-DOS address space.)
  530.  
  531. Note that Watcom C/386 version 8.5 does not include wmakel (the 32-bit
  532. version of wmake).  If this is the version that you have, use wmake instead,
  533. i.e., edit wmakebat.bat to change wmakel to wmake.
  534.  
  535. If you get an "Error(F01): Out of memory" with Watcom 8.5, you may wish to
  536. try reducing the total size of the makefiles by editing devs.mak to remove
  537. drivers that you don't ever intend to use.  If you still get this error,
  538. contact Watcom technical support; they will be able to send you the wmakel
  539. program, probably at no charge.
  540.  
  541. DesqView/X and djgcc/djgpp environment
  542. --------------------------------------
  543.  
  544. The name of the makefile for this environment is dvx-gcc.mak.
  545.  
  546. The DesqView/X port of Ghostscript was contributed by Tom Brosnan
  547. (tjb@chalone.stanford.edu), with further contributions by Stephen Turnbull
  548. (turnbull@shako.sk.tsukuba.ac.jp).  It uses djgcc (DJ Delorie's MSDOS port
  549. of gcc) for compiling.  djgcc assumes that go32.exe is in your search path.
  550. You need to set an environment variable to tell go32 where to put any
  551. paging files, e.g.
  552.  
  553.     set GO32TMP=e:/tmp
  554.  
  555. If you don't have go32.exe, you can get it from Internet host
  556. oak.oakland.edu.  The extender and minimum run-time environment are in the
  557. file djeoeXXX.zip, where XXX is the version number (currently 112).
  558. Patched versions of the extender (as well as other components) are found in
  559. the files djXXXmY.zip, XXX is again the compiler version, Y is the
  560. patchlevel.  Y is currently 2.  People who are just running the executable
  561. need only get the file with the highest level of Y that contains GO32.EXE
  562. and do "unzip -j djXXXmY go32.exe" (InfoZIP) or "pkunzip djXXXmY go32.exe"
  563. (PKWare), then move the extender to their PATH.  If you do not have a
  564. hardware FPU, you will also need the floating point emulator EMU387 found
  565. in djeoeXXX.zip (and possibly in the patch releases as well).  You MUST use
  566. an emulator designed to work with GO32; the emulators often found as TSRs
  567. will not work.  See the file README found in djeoeXXX.zip, or the file
  568. README.1ST in pub/msdos/djgpp on Simtel for further information.
  569.  
  570. The DJGPP v1.12 compiler suite is known to have problems with linking
  571. large file sets.  If you run into this problem, you can work around it
  572. by using the v1.11 GO32 as follows:
  573. (1) get dj111m5.zip from turnbull.sk.tsukuba.ac.jp:/pub/djgpp/1.11
  574. (2) unzip GO32.EXE.  Be careful not to overwrite other versions!
  575. (3) rename it, eg, to GO111M5.EXE
  576. (4) move the renamed GO32.EXE to your path
  577. (5) stubedit ld.exe:  (the stubedit utility is part of djeoe112.zip)
  578.     (a) change the extender name to the one you chose in (3).  The
  579.         .EXE extension may be omitted
  580.     (b) change the version required to 1.11
  581.     (c) accept the defaults for the remaining options.
  582.  
  583. Stephen Turnbull observed the following two problems with DJGPP v2.0-beta2.
  584.  
  585. (1) The v1.12 stdio.h defined a number of flags for manipulating the
  586.     various characteristics of the streams being processed, such as
  587.     _IORD, _IOWRT, etc.  These are missing from v2.0-beta2.  I don't
  588.     know enough about the new libc.a to guess whether this is an
  589.     oversight or these functions have a new (Posix?) interface.
  590.     [Caveat: In Ghostscript the compiler error can be silenced by
  591.     adding "#define _IOWRT 00002" to the file gp_dvx.c.  I don't know
  592.     that this is correct in the new libraries.  I suspect there is no
  593.     real loss in Ghostscript to removing the offending flag
  594.     manipulation from gp_open_printer() in gp_dvx.c, as it is a
  595.     performance optimization.]
  596.  
  597. (2) The big problem is linking with third-party libraries not compiled
  598.     with v2.0.  In particular, QuarterDeck's contributed Xlib
  599.     (compiled with DJGPP v1.12 (original release).  Unfortunately,
  600.     v1.12 uses the usual macros for character classification and
  601.     implementation of the stdio streams.  This leads to long lists of
  602.     complaints from the linker about undefined references to '_ctype_'
  603.     (the table of character type flags) and '_iob' (the table indexed
  604.     by file descriptors) when processing Xlib functions.
  605.  
  606. cygwin32 gcc
  607. ------------
  608.  
  609. A user has reported that it is possible to compile Ghostscript for MS
  610. Windows NT using the cygwin32 gcc compiler, GNU make, and the unix-gcc.mak
  611. makefile, with only two small source code changes:
  612.  
  613.     - Add a "b" to the call to fopen in "gp_open_scratch";
  614.     - Mirror the gp_ntfs logic for "gp_file_name_is_absolute".
  615.  
  616. You can find more information about this compiler and environment on the Web
  617. at http://www.cygnus.com/misc/gnu-win32.  Please note that Cygnus' licensing
  618. terms aren't quite as liberal about redistribution as either the GNU License
  619. or the Aladdin license, so you should read their license carefully if you
  620. want to redistribute the results of using their compiler.
  621.  
  622. ********
  623. ******** How to build Ghostscript from source (Mac version) ********
  624. ********
  625.  
  626. There are additional Mac-specific source files in a separate distribution
  627. from the rest of Ghostscript.  In addition to the standard Ghostscript
  628. sources, you will need the following files:
  629.  
  630.     macgs-v1.0-src.sit    - the source files, StuffIt archive.
  631.     manual.txt            - the manual as unformatted text
  632.     readme.txt            - this file
  633.  
  634. These should be in the mac directory located in the same place you retrieved
  635. the rest of the Ghostscript distribution.
  636.  
  637. The first file is a StuffIt archive.  If you do not have a program to expand
  638. it, you should get the free StuffIt Expander program from your favorite
  639. Macintosh archive.
  640.  
  641. In the standard method of building Ghostscript, all of these files (except
  642. the jpeg) get unpacked into one big directory.  The jpeg stuff gets unpacked
  643. into a directory called jpeg-6 in the main directory.  The Macintosh stuff
  644. also gets unpacked into its own directory, called 'Mac Specific'.  However,
  645. if you like (and I do) you can divide up all these files into the following
  646. hierarchy:
  647.  
  648.     Ghost Dev
  649.         files -- all *.ps, *.txt, and other non-build files
  650.         fonts -- all the fonts
  651.         src -- *.c, *.h, *.mak
  652.         jpeg-6 -- the jpeg files
  653.         Mac Specific -- the mac files
  654.         MPW Build -- empty directory used for building under MPW
  655.  
  656. Once you get everything laid out, take a look at the file Worksheet in the
  657. mac specific folder for complete steps to build the system with either MPW
  658. or CodeWarrior.
  659.  
  660. ********
  661. ******** How to build Ghostscript from source (Unix version) ********
  662. ********
  663.  
  664. The makefile distributed with Ghostscript selects the following devices
  665. for inclusion in the build:
  666.     Display: X Windows.
  667.     Printers: H-P DeskJets, LaserJets, and color DeskJets and PaintJets;
  668.       Canon BubbleJets.
  669.     File formats: Group 3 & Group 4 fax, JPEG, PCX, P*M (PBM/PGM/PPM),
  670.       TIFF, PostScript images, PNG, distilled PDF, PostScript, and EPS,
  671.       PCL XL ("PCL 6").
  672.  
  673. The unix-*.mak files are actually generated mechanically from *head.mak,
  674. *tail.mak, unix-end.mak, and the platform-independent makefiles by a script
  675. called tar_cat.  If for some reason your copy of Ghostscript doesn't include
  676. the unix-*.mak files, run tar_cat to construct them.  If you wish to edit
  677. any part of the makefile,
  678.  
  679.     DO NOT EDIT THE FILE NAMED makefile OR unix{ansi,-cc,-gcc}.mak.
  680.     EDIT THE ORIGINAL COMPONENT MAKEFILE (*head.mak, *tail.mak,
  681.     OR A PLATFORM-INDEPENDENT FILE) AND RUN tar_cat AGAIN.
  682.  
  683. Consult tar_cat to find the names of the component files.
  684.  
  685. The *head.mak files explicitly compile and link the libpng and zlib
  686. libraries into the executable.  If your Unix system already includes these
  687. libraries (probably in /usr/lib/libpng.{a,so} and libz.{a,so}) and you would
  688. rather use the system copies, change the definition of SHARE_LIBPNG and/or
  689. SHARE_ZLIB from 0 to 1 in the relevant *head.mak file, run tar_cat, and
  690. recompile.  Note that if you do this, you will get non-DEBUG versions of
  691. these libraries, even if you selected DEBUG in the Ghostscript makefile.
  692.  
  693. The *head.mak files also compile and link the jpeg library into the
  694. executable.  Ghostscript doesn't offer a SHARE option for this library,
  695. because in order to be compatible with Adobe interpreters, Ghostscript has
  696. to compile the code with the non-standard definition
  697.     #define D_MAX_BLOCKS_IN_MCU 64
  698. This is in contradiction to the JPEG standard, but at least some real
  699. PostScript files require this.  A shared system library would not be
  700. compiled this way.
  701.  
  702. If the X11 client header files are located in some directory which your
  703. compiler does not automatically search, you must change the XINCLUDE macro
  704. the makefile to include a specific -I switch.  See the comment preceding
  705. XINCLUDE in the makefile.
  706.  
  707. Currently Ghostscript is set up to compile and link in a generic Unix
  708. environment.  Some Unix environments may require changing the LDFLAGS
  709. macro in the makefile.
  710.  
  711. All you need to do to make an executable is invoke the shell command
  712.     make
  713.  
  714. Ghostscript uses ANSI syntax for function definitions. Because of this,
  715. when compiling with cc, it must preprocess each .c file to convert it to
  716. the older syntax defined in Kernighan and Ritchie, which is what most
  717. current Unix compilers (other than gcc) support.  This step is
  718. automatically performed by a utility called ansi2knr, which is included in
  719. the Ghostscript distribution.  The makefile automatically builds ansi2knr.
  720.  
  721. The ansi2knr preprocessing step is included in the makefile rule for
  722. compiling .c files.  ansi2knr creates a file called _temp_$$.c to hold the
  723. converted code, where $$ is the process ID.  If you want to change this name
  724. for some reason, it is defined in a small script file called ccgs.
  725.  
  726. gcc and GNU make problems
  727. =========================
  728.  
  729. There is an optimizer bug in gcc 2.7.0, 2.7.1, and 2.7.2 that causes these
  730. versions of gcc to generate incorrect code.  You can work around this by
  731. adding the switch
  732.         -Dconst=
  733. to the compilation switches (CFLAGS).  Alternatively, you can rebuild gcc
  734. with the following patch:
  735.  
  736. *** clean-ss-951203/expr.c    Sun Nov 26 08:18:07 1995
  737. --- ss-951203/expr.c    Mon Dec  4 11:41:18 1995
  738. *************** expand_expr (exp, target, tmode, modifie
  739. *** 4582,4587 ****
  740.          through a pointer to const does not mean that the value there can
  741.          never change.  Languages where it can never change should
  742.          also set TREE_STATIC.  */
  743. !     RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) | TREE_STATIC (exp);
  744.       return temp;
  745.         }
  746. --- 4582,4588 ----
  747.          through a pointer to const does not mean that the value there can
  748.          never change.  Languages where it can never change should
  749.          also set TREE_STATIC.  */
  750. !     RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) & TREE_STATIC (exp);
  751.       return temp;
  752.         }
  753.  
  754. If possible, compile with gcc 2.5.8, gcc 2.6.3, or gcc 2.7.2.1 or later,
  755. which don't have this bug.  Note, however, that gcc has other problems on
  756. some platforms: please read the section below for your specific platform as
  757. well.
  758.  
  759. Current versions of GNU `make' have no problems, but GNU make 3.59 can't
  760. handle the final linking step in some cases; use the platform's standard
  761. make (e.g., /bin/make) if this happens.
  762.  
  763. Platform-specific notes
  764. =======================
  765.  
  766. 386 Unix
  767. --------
  768.     gcc versions older than 1.38 on Intel 80386 systems do not
  769. compile Ghostscript correctly using the -O option.  Do not use -O in
  770. these environments.
  771.     gcc 1.39 under 386BSD has a bug that causes float-to-integer
  772. conversions to compile incorrectly.  Do not use this version of gcc.
  773.     X11R5 may need #include <stddef.h> in x_.h.
  774.     Also see below regarding System V platforms.
  775.  
  776. Alpha (AXP) with gcc
  777. --------------------
  778.     You don't have to use gcc on AXP systems: the following notes are
  779. relevant only if you do use it.
  780.     The code generator in gcc 2.7.2.1 is broken, so you cannot use this
  781. version on the Alpha.  gcc 2.5.8 and 2.6.3 are probably OK.  Versions of gcc
  782. before 2.5.0 are believed not to work.
  783.     If you really want to use gcc 2.7.x, here is a patch from a gcc
  784. maintainer:
  785.  
  786. Tue Sep 24 19:37:00 1996  Jim Wilson  <wilson@cygnus.com>
  787.  
  788.     * reload.c (push_secondary_reload): Change reload_mode to mode in
  789.     SECONDARY_MEMORY_NEEDED and get_secondary_mem calls.
  790.  
  791. *** reload.c.orig    Sun Mar  9 14:05:23 1997
  792. --- reload.c    Sun Mar  9 14:06:54 1997
  793. *************** push_secondary_reload (in_p, x, opnum, o
  794. *** 589,600 ****
  795.        set it up now.  */
  796.   
  797.         if (in_p && icode == CODE_FOR_nothing
  798. !       && SECONDARY_MEMORY_NEEDED (class, reload_class, reload_mode))
  799. !     get_secondary_mem (x, reload_mode, opnum, type);
  800.   
  801.         if (! in_p && icode == CODE_FOR_nothing
  802. !       && SECONDARY_MEMORY_NEEDED (reload_class, class, reload_mode))
  803. !     get_secondary_mem (x, reload_mode, opnum, type);
  804.   #endif
  805.       }
  806.   
  807. --- 589,600 ----
  808.        set it up now.  */
  809.   
  810.         if (in_p && icode == CODE_FOR_nothing
  811. !       && SECONDARY_MEMORY_NEEDED (class, reload_class, mode))
  812. !     get_secondary_mem (x, mode, opnum, type);
  813.   
  814.         if (! in_p && icode == CODE_FOR_nothing
  815. !       && SECONDARY_MEMORY_NEEDED (reload_class, class, mode))
  816. !     get_secondary_mem (x, mode, opnum, type);
  817.   #endif
  818.       }
  819.   
  820.  
  821. Apollo
  822. ------
  823.     You must run the compiler in ANSI-compatible mode (i.e., set AK=
  824. <null string> in the makefile); otherwise, it gives incorrect error
  825. messages for any function declared as returning a float value.
  826.     The Apollo compiler may not compile Ghostscript correctly.  If you
  827. get unexpected crashes at run time, use gcc.
  828.  
  829. AT&T 7040 R3
  830. ------------
  831.     If Ghostscript crashes on startup, recompile with -O0 in order to
  832. avoid triggering compiler bugs.
  833.  
  834. Convex
  835. ------
  836.     Use unixansi.mak.  Do not invoke optimization (-O1): there
  837. are compiler bugs that lead to incorrect code.  Set CFLAGS to
  838.     -no -fn -tm c1
  839.  
  840. DECStations
  841. -----------
  842.     You may get the following message (or a similar one) when compiling,
  843. due to a compiler bug:
  844.     cfe: Fatal: _temp_19086.c: Segmentation violation
  845. If this happens, try compiling with the -oldc switch.
  846.  
  847. DECStations with Ultrix
  848. -----------------------
  849.     You may wish to set
  850.   GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts
  851. in the makefile to add the Display PostScript font directory to the font
  852. search path.
  853.     You may need to use
  854.         make CFLAGS="-Olimit 2500"
  855. to tell the optimizer to allocate extra table space.
  856.     The Ultrix 4.4 C compiler has a bug that makes it compile gdevm1.c
  857. incorrectly.  Insert the following line in the makefile rule for
  858. gdevm1.$(OBJ) (the body of the rule is empty in the standard distribution):
  859.     $(CCC) -oldc gdevm1.c
  860.  
  861. Digital Unix
  862. ------------
  863.     Use the unixansi.mak file for all Digital Unix compilers.
  864. For versions of Digital Unix before 4.0, set
  865.         CFLAGS=-std -Olimit 1000 -g3 -O2 $(XCFLAGS)
  866.         LDFLAGS=-lots $(XLDFLAGS)
  867. You may be able to omit the -g3.
  868.     
  869. H-P RISC workstations
  870. ---------------------
  871.     You can build Ghostscript on H-P machines with either GNU gcc or
  872. H-P's ANSI-capable cc.  The minimal, non-ANSI-capable cc that ships with a
  873. "bare" HPUX system is *not* good enough.  If your cc doesn't accept the -Aa
  874. switch then you need to get the full cc or gcc.
  875.     If you use H-P's compiler, be sure you have upgraded to a recent
  876. compiler release.  Many bizarre symptoms have been reported from trying to
  877. build Ghostscript with older, buggier compilers, for example:
  878.     * Link step fails with a message about "max" not being defined.
  879.     * Build succeeds, but resulting executable fails to start up,
  880. with an error message like
  881.     Initializing... Unrecoverable error: typecheck in .registerencoding
  882.     Operand stack:
  883.         .notdef  0
  884.     * Build succeeds, but resulting executable produces a black
  885. background on the first page of output.
  886.     On HPUX 9.*, it is reported that you need at least compiler patch
  887. PHSS_5723 and dld.sl patch PHSS_5734 to build gs successfully.  (As of late
  888. 1997, those patches are long obsolete; the current patches are compiler
  889. PHSS_10357 and dld.sl PHSS_11246.  It is unknown whether current gs releases
  890. will work with compiler/dld.sl versions older than these.)
  891.     On HPUX 10.*, we don't know what combinations of compiler version
  892. and switches work.  On HPUX 10.20, it is reported that setting CC=c89 and
  893. "CFLAGS=+O3 $(XCFLAGS)" will work, contradicting the information in the next
  894. paragraph, but this may be dependent on the specific compiler version.
  895.     In either HPUX version, you need to set "CC=cc -Aa" (or use -Ae if
  896. you prefer), and set "CFLAGS=-D_HPUX_SOURCE -O $(XCFLAGS)".  Higher levels
  897. of optimization than -O may work depending on your compiler revision; some
  898. users have reported success with +O3, some have not.  Some users have
  899. reported needing -DNOSYSTIME and/or -D_POSIX_SOURCE in CFLAGS, but recent
  900. tests do not show these to be necessary.
  901.     If you use gcc, it is also a good idea to have a recent release.
  902. gcc 2.7.2.1 or later is recommended, but gcc 2.6.3 has been known to work
  903. with past gs releases.  gcc versions earlier than 2.6.3 are known *not* to
  904. work, and you will also have trouble with gcc 2.7.* releases earlier than
  905. 2.7.2.1.  (You may be able to get a working executable with an older gcc by
  906. removing -O from CFLAGS.  If you do have an up-to-spec gcc, you should be
  907. able to use -O2 without problems.)
  908.  
  909. Intergraph Clipper
  910. ------------------
  911.     Recommended settings are:
  912.         XCFLAGS=-w -Q -DSYSV -D__SVR3
  913.         EXTRALIBS=-lbsd -lc_s
  914.         CC=acc -knr
  915.         PLATFORM=sysv_
  916. Also, you will probably need to change the value of XLIBS from
  917.     XLIBS=Xt X11 Xext
  918. to
  919.     XLIBS=Xt_s X11_s Xext
  920.  
  921. ISC Unix
  922. --------
  923.     For ISC Unix with gcc, an appropriate make invocation is:
  924.     make XCFLAGS="-D__SVR3 -posix" LDFLAGS="-shlib -posix" \
  925.          EXTRALIBS="-linet -lnsl_s"
  926. If this doesn't work for you, try removing the -shlib.  ISC Unix may
  927. also need one or more of the following in EXTRALIBS: -lpt, -lc_s.
  928. See also under "386 Unix" above.
  929.  
  930. Linux
  931. -----
  932.     If you are building on Linux with X11 R6 or later, you may get a
  933. list of error messages at link time about undefined references to various
  934. functions beginning with Smc and Ice.  If this happens, make sure that XLIBS
  935. is set in the makefile to the list Xt SM ICE Xext X11 rather than just Xt
  936. Xext X11.
  937.     If you are running gcc version 2.6.3 or later, you may run into
  938. problems because of an incompatibility in object formats ("a.out" vs. ELF)
  939. with the XFree86 library.  The typical symptom is that ld will complain that
  940. some X library is not found or a whole slew of Xlib or Xt functions are not
  941. found in the library (similar to the messages for omitting SM and ICE from
  942. XLIBS), or you will get a message when you start Ghostscript that the
  943. program or the shared library is in unrecognized format.  If this happens,
  944. you might try adding the switches
  945.     -b i486-linuxaout
  946. to both CFLAGS and LDFLAGS in gcc-head.mak, and rebuilding from scratch
  947. ("make clean" and then "make").  If this doesn't help, or if other strange
  948. things happen, contact your Linux supplier or support resource.
  949.  
  950. MIPS
  951. ----
  952.     There is apparently a bug in older versions of the MIPS C compiler
  953. which causes gxdither.c to compile incorrectly if optimization is enabled
  954. (-O).  However, this bug is definitely fixed in MipsPRO C version 6.00; with
  955. this version, compiling with -O2 -mips2 produces good output.
  956.  
  957. NCR 3550
  958. --------
  959.     If you are using the NCR C Development Toolkit, you must use -O0 to
  960. avoid triggering compiler bugs.
  961.  
  962. NeXTSTEP
  963. --------
  964.     Current NeXTSTEP versions require changing the definition of INCLUDE
  965. in unixtail.mak (and ugcclib.mak, if you are using only the library) to
  966.         INCLUDE=/usr/include/bsd
  967. Don't forget to run tar_cat after you do this.
  968.  
  969. For all NeXTSTEP systems, use unix-gcc.mak -- i.e., execute
  970.         ln -s unix-gcc.mak Makefile
  971.  
  972. For NeXTSTEP versions before 3.2:
  973.     edit gcc-head.mak ->
  974.         change CC=gcc to CC=cc
  975.         add -D_NEXT_SOURCE to CFLAGS
  976.     change the two occurrences of sys/time.h to ansi/time.h, and
  977.     change <dirent.h> in gp_unifs.c to <sys/dirent.h>
  978.  
  979. For NeXTSTEP 3.2 and later
  980.     edit gcc-head.mak ->
  981.         change CC=gcc to CC=cc
  982.         add -D_POSIX_SOURCE and remove -g in CFLAGS
  983.         remove -Wstrict-prototypes in GCFLAGS
  984.  
  985. Add the following line to the end of Fontmap
  986.         /Ohlfs    /Courier    ;
  987.  
  988. If you are running the Pencom co-Xist X server (Development version), the X
  989. headers and libraries are in the default places, so you should change the
  990. definitions of XINCLUDE and XLIBDIRS in the makefile to empty strings.
  991.  
  992. Pyramid MIServer-S
  993. ------------------
  994.     See AT&T 7040 R3.
  995.  
  996. RS/6000
  997. -------
  998.     Many versions of the AIX C compiler have bugs that have prevented
  999. Ghostscript from compiling and linking properly.  We believe that the
  1000. current Ghostscript release works around these bugs, and that using the
  1001. unix-cc.mak makefile with
  1002.     CC=cc
  1003. should work.  You must also edit the makefile (unixansi.mak or
  1004. unix-cc.mak) to change INSTALL to /usr/ucb/install.  (If -DSYSV produces a
  1005. complaint about the functions index and rindex not being defined, try
  1006. removing it.)  If the xlc 1.2.1 optimizer runs out of memory, you may need
  1007. to add -qmaxmem=4000 to CFLAGS.
  1008.     A user has reported that the AIX C compiler shipped with AIX 3.2.5
  1009. only compiles Ghostscript if invoked with c89 -D_POSIX_SOURCE and *without*
  1010. -O.  On the other hand, another user reported successful compilation using
  1011. the unix-ansi.mak makefile and the following command line:
  1012.     make CC=c89 XCFLAGS="-DOSY_AIX -D_ALL_SOURCE -qnoro -qmaxmem=3000 -bfl" $*
  1013. Apparently some (but not all) releases of the C library declare the hypot
  1014. function: if the declaration in math_.h produces an error message, try
  1015. removing it.  Also, the IBM X11R3 server is known to be buggy: use the MIT
  1016. X server if possible.
  1017.     The xlc 1.3.0.x compiler provided in AIX 3.2.5+ definitely will not
  1018. compile Ghostscript correctly if -O is used on all files.  A user has
  1019. reported that compiling the following files without -O is sufficient to
  1020. produce a working executable: z*.c, gsmatrix.c, gxstroke.c.
  1021.     Some installations of AIX 3.2.5 have what appears to be an incorrect
  1022. or inconsistent version of libXt.a in /usr/lpp/X11/lib.  If you get
  1023. XtShellStrings and XtStrings as unresolved externals when linking, set
  1024. XLIBDIRS=-L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib rather than just
  1025. XLIBDIRS=-L/usr/lpp/X11/lib.
  1026.  
  1027. SCO Unix/Xenix
  1028. --------------
  1029.     The SCO Unix C compiler apparently can't handle the Pn macros
  1030. in std.h.  If you get strange compilation errors on SCO Unix, see if
  1031. you can get a compiler fix from SCO.  Meanwhile, to use gcc with SCO
  1032. ODT, see gcc-head.mak for the appropriate switch settings.  See also
  1033. under "386 Unix" above.
  1034.     gcc 2.3.3 produces code that causes a core dump on machines
  1035. that don't have hardware floating point, because of a bug in SCO's
  1036. floating point emulator.  Use a different compiler on these machines.
  1037.     If you aren't using the X11 driver, you need to add -lsocket
  1038. to the linker command (near the end of the unix-*.mak file) in order
  1039. to get the date/time functions linked in.
  1040.     If you want to use direct frame buffer addressing instead of X
  1041. Windows, include the relevant frame buffer device(s) (ega.dev, vga.dev,
  1042. etc.) and change gdevevga.c to gdevsco.c as indicated in devs.mak.  Note:
  1043. this does not work with SuperVGA displays, except for 800x600x16 mode.
  1044. Note also: If the display looks "smeared", try recompiling gdevpcfb.c with
  1045. -O0.  Note also: if Ghostscript crashes, use the -q switch and/or redirect
  1046. console output to a file.
  1047.     If your compiler accepts the -Xt and -Xa switches, use -Xt.
  1048. Even though this causes the compiler to use incorrect rules for
  1049. computing the result types of << and >>, -Xa enables "optimizations"
  1050. that produce incorrect code.
  1051.     For SCO ODT 2.0, in addition to -D__SVR3 and -DSYSV, you need to
  1052. specify -Dsco, -DUSG, and -DMALLOC_0_RETURNS_NULL.  For SCO ODT, you need
  1053. EXTRALIBS=-lX11 -lsocket -lmalloc, or maybe only -lsocket (depending on
  1054. the version), and for SCO ODT 2.0, you also need to specify -lc_s.  For
  1055. SCO Xenix, you need EXTRALIBS=-lmalloc.
  1056.     For all SCO systems, set XINCLUDE= and XLIBDIRS=.
  1057.     Please also read the section on "System V Unix platforms" below.
  1058.  
  1059. Silicon Graphics
  1060. ----------------
  1061.     Compiler option -Olimit 2500 is required to be able to compile all
  1062. the code with optimization.
  1063.     Use compiler option -ansi with the SGI C compiler shipped with Irix
  1064. 5.2.
  1065.     The SGI C compiler may produce warnings about "Undefined the ANSI
  1066. standard library defined macro stdin/stdout/stderr".  To suppress these
  1067. warnings, add
  1068.     -woff 608
  1069. to the definition of CFLAGS.
  1070.     The SGI C compiler shipped with Irix 6.1 and 6.2 will not compile
  1071. deflate.c (part of zlib) properly with optimization.  If you want to use the
  1072. zlib decompression filter (which is required for interpreting PDF 1.2
  1073. files), compile this file separately without -O.
  1074.     The MIPSpro 7.1 compiler produces incorrect output if you use -O3 or
  1075. -Ofast=ip32 -show.  Use only -O2.
  1076.     To install gcc 2.7.x on IRIX 6.x, please consult the Web page at
  1077. http://reality.sgi.com/knobi/gcc-2.7.2.x-on-irix-6.2-6.3.
  1078.  
  1079. Sun
  1080. ---
  1081.     The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
  1082. properly if the -fast option is selected: Ghostscript core-dumps in
  1083. build_gs_font.  Use -g, or use gcc.
  1084.     The Sun version of dbx often gives up with an error message when
  1085. trying to load Ghostscript.  If this happens, use gdb instead.  (gdb is
  1086. more reliable than dbx in other ways as well.)
  1087.     There is a bug in some versions of zlib that results in an undefined
  1088. symbol zmemcmp when compiling with Sun cc.  Use gcc instead.
  1089.  
  1090.     SunOS
  1091.     -----
  1092.         In SunOS 4.1.[23], you may get these undefined symbols when linking:
  1093.                 _get_wmShellWidgetClass
  1094.                 _get_applicationShellWidgetClass
  1095. Compiling "-Bstatic -lXmu -Bdynamic" appears to work for SC1.0.  For gcc,
  1096. try adding "-static" to CFLAGS.  To solve the problem if you are using
  1097. OpenWindows 3.0 (X11R4-based Xt), please contact your local Sun office and
  1098. request the following patches:
  1099.     Patch i.d.      Description
  1100.     100512-02       4.1.x OpenWindows 3.0 libXt Jumbo patch
  1101.     100573-03       4.1.x OpenWindows 3.0 undefined symbols when using
  1102.                 shared libXmu
  1103.     Solaris
  1104.     -------
  1105.     Solaris 2.2 may require setting EXTRALIBS=-lsocket.
  1106.     Solaris 2.3 and 2.4 seem to require EXTRALIBS=-lnsl -lsocket.
  1107.     Solaris 2.n uses /usr/openwin/share/include for the X11 libraries
  1108. rather than /usr/local/X/include.
  1109.     Solaris 2.n typically makes Type 1 fonts available in
  1110. /usr/openwin/lib/X11/fonts/Type1/outline.
  1111.     For Solaris 2.n, you will need to change the definition of INSTALL
  1112. in the makefile from install -c to /usr/ucb/install -c, since the Solaris
  1113. version of 'install' requires
  1114.         install -c <directory> [-m <mode>] <file>
  1115. rather than
  1116.         install [-c] [-m <mode>] <file> <directory>
  1117.     You may need to set XLIBDIR to the directory that holds the X11
  1118. libraries, as for other SVR4 systems.  You should also set -DSVR4 in CFLAGS.
  1119.     If you are using the SunPRO C compiler, do not use optimization
  1120. level -xO3.  On SPARC platforms, the compiler hangs; on Intel platforms, the
  1121. generated code is incorrect.  Also, do not use the -native flag on Intel
  1122. platforms: this makes floating point computations unacceptably inaccurate.
  1123. You may use -xcg92 (SPARC V8) and/or -dalign to get better performance.
  1124.  
  1125. SVR4 Unix platforms
  1126. -------------------
  1127.     You may need to set EXTRALIBS=-lnsl.
  1128.     Do *not* change PLATFORM=unix_ to PLATFORM=sysv_.
  1129.     On SVR4 Unix platforms that use dynamic linking, you may need to
  1130. define XLIBDIR as the name of the directory that holds the X Windows
  1131. libraries.  Do *not* prefix this with -L.
  1132.     For SVR4.0 systems, set -DSVR4 -DSVR4_0 in the makefile; do *not*
  1133. set -DSYSV.  For SVR4.2 (or later) and Solaris 2.x systems, set -DSVR4 only
  1134. (not -DSVR4_0 and not -DSYSV).
  1135.  
  1136. System V Unix platforms
  1137. -----------------------
  1138.     If you are using a stock System V platform that lacks rename
  1139. and gettimeofday, change PLATFORM=unix_ in the makefile to
  1140. PLATFORM=sysv_.
  1141.     You will probably need to change the definition of INSTALL (near
  1142. the beginning of the makefile) from install to /usr/ucb/install.
  1143.  
  1144. VAX with Ultrix
  1145. ---------------
  1146.     The above information about DECStations with Ultrix may be
  1147. applicable.
  1148.  
  1149. ********
  1150. ******** How to build Ghostscript from source (OS/2 version) ********
  1151. ********
  1152.  
  1153. The relevant makefile is:
  1154.     os2.mak
  1155. The gcc/emx 0.9b (or later) compiler and the IBM NMAKE.EXE are required.
  1156.  
  1157. For gcc/emx versions 0.9c and later, the LINK386 command must include
  1158. $(COMPBASE)\lib\end.lib; version 0.9b requires omitting this.  The current
  1159. os2.mak file does include this file in the LINK386 command, so if you are
  1160. using 0.9b, delete this file reference before building.
  1161.  
  1162. Be sure you are using the standard OS/2 shell, CMD.EXE.  Some other shells
  1163. have bugs or differences that cause the makefile not to work.
  1164.  
  1165. Before compiling or linking, you should execute
  1166.     copy os2.mak makefile
  1167. Then to start the make process type
  1168.     nmake
  1169. One DLL and two EXE's will be produced: gsdll2.dll (Ghostscript DLL),
  1170. gsos2.exe (Ghostscript) and gspmdrv.exe (the Presentation Manager 
  1171. display driver).
  1172.  
  1173. ********
  1174. ******** How to build Ghostscript from source (VMS aka OpenVMS version) ****
  1175. ********
  1176.  
  1177. Many versions of DEC's X server have bugs that produce broad bands of color
  1178. where dither patterns should appear, or characters displayed white on top
  1179. of black rectangles or not displayed at all.  If this happens, please
  1180. consult the X Windows section of the use.txt file to find out how to work
  1181. around these bugs using X resources; also report the problem to DEC, or
  1182. whoever supplied your X server.
  1183.  
  1184. You may also wish to turn off the use of a backing pixmap with Ghostscript,
  1185. either to work around X server memory limitations or bugs, or to obtain
  1186. faster displaying at the expense of no redrawing when a Ghostscript window
  1187. is restored from an icon or exposed after being occluded by another window.
  1188. Again, use.txt contains information on how to do this.
  1189.  
  1190. If you add compiled fonts to your system as described in the fonts.txt file,
  1191. then add "ccfonts.dev" to the FEATURE_DEVS symbol in VMS-CC.MAK,
  1192. VMS-GCC.MAK, VMS-DECC.MAK, or OPENVMS.MAK,
  1193.     $ FEATURE_DEVS = "level2.dev ccfonts.dev"
  1194. and then specify the font names with the ccfonts1 symbol
  1195.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  1196. If the line gets too long, add another line of the same form, e.g.,
  1197.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  1198.     $ ccfonts2 = "Times_Roman Times_Italic Times_Bold Times_BoldItalic"
  1199.  
  1200. Using DCL command files
  1201. -----------------------
  1202.  
  1203. Up through Ghostscript version 5.0x, we have provided DCL command files for
  1204. building Ghostscript.  We will no longer support this method in future
  1205. versions, since we have found it almost impossible to keep the DCL scripts
  1206. consistent with the makefiles that are used on all other platforms, and
  1207. since using a 'make' program has other benefits such as recompiling only
  1208. files that have changed.
  1209.  
  1210. The files VMS-CC.MAK, VMS-GCC.MAK, and VMS-DECC.MAK are OpenVMS DCL command
  1211. files which build Ghostscript from scratch using, respectively, the VAX C
  1212. compiler, CC, the Free Software Foundation's GNU C compiler, GCC, or the DEC
  1213. C compiler, CC.  Accordingly, you must have one of these compilers installed
  1214. in order to build Ghostscript.  (Other C compilers may work: CC and GCC are
  1215. the only two compilers tested to date.  DEC C V4.0 or later is required: the
  1216. DEC C V1.3 run-time library has bugs that prevent Ghostscript from working.)
  1217. These command files build and store the Ghostscript library in the object
  1218. library GS.OLB.  If you have DECwindows (X11) installed on your system, the
  1219. executable image GS.EXE will also be built.
  1220.  
  1221. Some environments use the DWTLIBSHR library for providing the X Windows
  1222. intrinsics, and some use the XTSHR library.  XTSHR is newer, and is part of
  1223. the DECwindows/Motif product.  However, DEC is still distributing versions
  1224. of VMS with DWTLIBSHR.  If your environment uses XTSHR, replace DWTLIBSHR in
  1225. the list of link libraries with XTSHR.
  1226.  
  1227. For OpenVMS VAX platforms with VAX C, issue the DCL command
  1228.     $ @VMS-CC.MAK
  1229. to build Ghostscript.  For OpenVMS platforms with GNU C (either AXP or
  1230. VAX), issue the DCL command
  1231.     $ @VMS-GCC.MAK
  1232. to build Ghostscript.  For OpenVMS platforms with DEC C (either AXP or
  1233. VAX), issue the DCL command
  1234.     $ @VMS-DECC.MAK
  1235. to build Ghostscript.
  1236.  
  1237. The option "DEBUG" may be specified with either command file in order to
  1238. build a debuggable Ghostscript configuration; e.g.,
  1239.     $ @VMS-CC.MAK DEBUG
  1240.  
  1241. Using GNU make
  1242. --------------
  1243.  
  1244. As of Ghostscript version 5.0, the file OPENVMS.MAK, together with some
  1245. auxiliary .COM files, allows using GNU make for building Ghostscript on
  1246. OpenVMS.  To do this, use the command:
  1247.  
  1248.     make -fopenvms.mak "OPENVMS={VAX,ALPHA}" "DECWINDOWS={1.2,<blank>}"
  1249.  
  1250. i.e. specify either VAX or ALPHA as the value of the OPENVMS parameter, and
  1251. either 1.2 or nothing (blank) as the value of DECWINDOWS.  (Note that here
  1252. the value VAX just means that you want to use the VAX C compiler: it doesn't
  1253. imply that you are running on VAX hardware.)  In Europe and other parts of
  1254. the world where A4 paper size is used, you should also append "A4_PAPER=1"
  1255. to the make line, to make A4 paper the default.
  1256.  
  1257. Unfortunately, because of bugs in the DEC C compilers, GNU make doesn't
  1258. compile properly on all versions of VMS.  GNU make requires:
  1259.     - On VAXen, VMS 7.1 or later (VMS 7.0 may work).
  1260.     - On Alphas, VMS 6.2 or later.
  1261.  
  1262. Also, GNU make, at least through version 3.75, requires some patches to run
  1263. properly on VMS at all.  We hope to be able to make available a precompiled
  1264. executable with the patches in the near future.  Meanwhile, however, here is
  1265. a description of the necessary changes.
  1266.  
  1267. The VAX and ALPHA edits have basically the same changes; the VAX C version
  1268. has two edits in the [.GLOB] directory, to address a 'C' preprocessor
  1269. limitation with VAX C.  The remaining changes attempt to address the lack of
  1270. consistency with "C" compilers and POSIX functionality, or the lack of it.
  1271.  
  1272. Of course depending on what version of OpenVMS you have, and what versions
  1273. of compilers (VAX C, DEC C on VAX or DEC on Alpha), these changes may be
  1274. slightly different.
  1275.  
  1276. =========================================================
  1277.  
  1278. Steps to do GNU MAKE edits for VAX C version:
  1279.  
  1280. 1). Unpack the GNU make sources, version 3.75, from your favorite FTP
  1281. site.
  1282. 2). Create an OpenVMS DCL command procedure containing the following
  1283. lines
  1284.      between the two markers "==========================" below.
  1285. 3). If you've never used EDIT/SUM before, you may want to read the
  1286. following:
  1287.     $ HELP DIFFERENCES / SLP, and
  1288.     $ HELP EDIT / SUM
  1289. 4). Edits are done. Invoke the GNU make supplied command file
  1290. MAKEFILE.COM,
  1291. or if your have a prior version of GNU make, there is a makefile
  1292. included with make.
  1293.  
  1294. ============================
  1295. $ SUMSLP="EDIT/SUM"
  1296. $ SUMSLP [.GLOB]FNMATCH.H/OUTPUT=[.GLOB]FNMATCH.H/UPDATE=SYS$INPUT:
  1297. -   26,   27
  1298. #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) || defined (WIN32))
  1299. /
  1300. $ SUMSLP [.GLOB]GLOB.H/OUTPUT=[.GLOB]GLOB.H/UPDATE=SYS$INPUT:
  1301. -   28,   29
  1302. #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) || defined (WIN32))
  1303. /
  1304. $ SUMSLP JOB.C/UPDATE=SYS$INPUT:
  1305. -  641,  641
  1306. #if (__VMS_VER >= 70000000) && defined POSIX
  1307. -  648,  648
  1308. #if (__VMS_VER >= 70000000) && defined POSIX
  1309. -  657,  657
  1310. #if (__VMS_VER >= 70000000) && defined POSIX
  1311. - 1316, 1316
  1312. #ifdef  HAVE_SIGSETMASK
  1313.     (void) sigblock (fatal_signal_mask);
  1314. #endif
  1315. - 1392, 1392
  1316. #ifdef  HAVE_SIGSETMASK
  1317.     (void) sigsetmask (sigblock (0) & ~(fatal_signal_mask));
  1318. #endif
  1319. /
  1320. $ SUMSLP JOB.H/UPDATE=SYS$INPUT:
  1321. -   70,   70
  1322. #if (__VMS_VER >= 70000000) && defined POSIX
  1323. /
  1324. $ SUMSLP MAIN.C/UPDATE=SYS$INPUT:
  1325. -  398,  398
  1326. #if (__VMS_VER >= 70000000) && defined POSIX
  1327. -  482,  482
  1328. #if (__VMS_VER >= 70000000) && defined POSIX
  1329. /
  1330. $ SUMSLP VMSDIR.H/UPDATE=SYS$INPUT:
  1331. -    7,    8
  1332. #ifndef __SOCKET_TYPEDEFS
  1333.         typedef unsigned long u_long;
  1334.         typedef unsigned short u_short;
  1335. #endif
  1336. /
  1337. ============================
  1338.  
  1339. Steps to do GNU MAKE edits for DEC C version:
  1340.  
  1341. 1). Unpack the GNU make sources, version 3.75. (in an empty directory)
  1342. 2). Create an OpenVMS DCL command procedure containing the following
  1343. lines
  1344.      between the two markers "==========================".
  1345. 3). If you've never used EDIT/SUM before, you may want to read the
  1346. following:
  1347.     $ HELP DIFFERENCES / SLP, and
  1348.     $ HELP EDIT / SUM
  1349. 4). Edits are done. Invoke the GNU make supplied command file
  1350. MAKEFILE.COM,
  1351. or if your have a prior version of GNU make, there is a makefile
  1352. included with make.
  1353.  
  1354. ============================
  1355. $ SUMSLP="EDIT/SUM"
  1356. $ SUMSLP CONFIG.H-VMS/UPDATE=SYS$INPUT:
  1357. -  114,  114
  1358. </* #define pid_t int */
  1359. -  153,  153
  1360. </* #define uid_t int */
  1361. -  217,  217
  1362. </* #define HAVE_SIGSETMASK 1 */
  1363. /
  1364. $ SUMSLP JOB.C/UPDATE=SYS$INPUT:
  1365. -  641,  641
  1366. #if (__VMS_VER >= 70000000) && defined POSIX
  1367. -  648,  648
  1368. #if (__VMS_VER >= 70000000) && defined POSIX
  1369. -  657,  657
  1370. #if (__VMS_VER >= 70000000) && defined POSIX
  1371. - 1316, 1316
  1372. #ifdef  HAVE_SIGSETMASK
  1373.     (void) sigblock (fatal_signal_mask);
  1374. #endif
  1375. - 1392, 1392
  1376. #ifdef  HAVE_SIGSETMASK
  1377.     (void) sigsetmask (sigblock (0) & ~(fatal_signal_mask));
  1378. #endif
  1379. /
  1380. $ SUMSLP JOB.H/UPDATE=SYS$INPUT:
  1381. -   70,   70
  1382. #if (__VMS_VER >= 70000000) && defined POSIX
  1383. /
  1384. $ SUMSLP MAIN.C/UPDATE=SYS$INPUT:
  1385. -  398,  398
  1386. #if (__VMS_VER >= 70000000) && defined POSIX
  1387. -  482,  482
  1388. #if (__VMS_VER >= 70000000) && defined POSIX
  1389. /
  1390. $ SUMSLP VMSDIR.H/UPDATE=SYS$INPUT:
  1391. -    7,    8
  1392. #ifndef __SOCKET_TYPEDEFS
  1393.         typedef unsigned long u_long;
  1394.         typedef unsigned short u_short;
  1395. #endif
  1396. ============================
  1397.  
  1398. ********
  1399. ******** Other environments ********
  1400. ********
  1401.  
  1402. QNX
  1403. ---
  1404.  
  1405. The following notes are from John "Stosh" Muczynski, <STOSH@bauer.usa.com>.
  1406. He is willing to answer questions as his time permits.  He used the Watcom
  1407. C16 compiler, version 9.5, with QNX version 4.20B.  He had to modify the
  1408. following files:
  1409.  
  1410. SYS/PARAM.H
  1411. Watcom doesn't supply a sys/param.h file.  I defined it as
  1412. --------------------------------clip here 
  1413. ------------------------------
  1414. /* CLK_TCK is used with the times() function and is defined in times.h 
  1415. */
  1416. #define HZ (CLK_TCK)
  1417. --------------------------------clip here 
  1418. ------------------------------
  1419. It seems that HZ should be 1000 for QNX and not 100.  The times() 
  1420. function appears to be POSIX 1003.1
  1421.  
  1422.  
  1423.  
  1424. UNIXHEAD.MAK
  1425. I modified unixhead.mak to support a qnx_ platform.
  1426. --------------------------------clip here 
  1427. ------------------------------
  1428. PLATFORM=qnx_
  1429. --------------------------------clip here 
  1430. ------------------------------
  1431.  
  1432.  
  1433. UNIXTAIL.MAK
  1434. I modified unixtail.mak to support a qnx_ platform.
  1435. --------------------------------clip here 
  1436. ------------------------------
  1437. # QNX 4.X
  1438. qnx__=gp_nofb.$(OBJ) gp_unix.$(OBJ) gp_qnx.$(OBJ) gp_qnxfs.$(OBJ) 
  1439. gp_unifn.$(OBJ)
  1440. qnx_.dev: $(qnx__)
  1441.     $(SETMOD) qnx_ $(qnx__)
  1442.  
  1443. gp_qnx.$(OBJ): gp_qnx.c $(time__h) $(AK)
  1444.  
  1445. gp_qnxfs.$(OBJ): gp_qnxfs.c $(AK) $(memory__h) $(string__h) $(gx_h) 
  1446. $(gp_h) \
  1447.   $(gsstruct_h) $(gsutil_h) $(stat__h) $(dirent__h)
  1448. --------------------------------clip here 
  1449. ------------------------------
  1450. The change here is to copy the "sysv_" make lines into "qnx_" 
  1451. make lines and change (1) gp_sysv.* to gp_qnx.* and (2) gp_unifs.* 
  1452. to gpqnxfs.*
  1453.  
  1454. I copied the gp_sysv.c source to gp_qnx.c and (a) deleted rename() 
  1455. because it is supported by the watcom compiler, (b) kept 
  1456. gettimeofday(), (c) added the gp_open_scratch_file() which doesn't 
  1457. use mktemp().
  1458.  
  1459. I copied gp_unifs.c to gp_qnxfs.c and deleted the 
  1460. gp_open_scratch_file() because it uses mktemp() which watcom 
  1461. does not provide.  Watcom does provide a tmpnam(char *buffer) 
  1462. function and more interestingly a FILE *tmpfile(void) function.  
  1463. If you ask I can fax you the manual pages.
  1464.  
  1465.  
  1466. ANSIHEAD.MAK
  1467.  
  1468. Compiler options:
  1469. -----------------
  1470. I used the Bauer "standard" options for compiling and linking under 
  1471. QNX:
  1472. --------------------------------clip here 
  1473. ------------------------------
  1474. CFLAGS=-O -w4 -3 -mf $(XCFLAGS)
  1475. LDFLAGS=-3 -N 64k -O -g -w3 -mf -fF $(XLDFLAGS)
  1476. --------------------------------clip here 
  1477. ------------------------------
  1478. -N 64k gives a big stack size; I don't know if its necessary.
  1479. The -mf on CFLAGS and LDFLAGS is very necessary (32-bit flat memory 
  1480. model).
  1481. The -3 and -O and -g and -w3 and -w4 are just fluff.
  1482. The -fF option doesn't make sense to me.
  1483.  
  1484. ********
  1485. ******** A guide to the source code ********
  1486. ********
  1487.  
  1488. General
  1489. -------
  1490.  
  1491. There are very few machine dependencies in Ghostscript.  A few of the .c
  1492. files are machine-specific.  These have names of the form
  1493.     gp_<platform>.c
  1494. specifically
  1495.     gp_dosfb.c (MS-DOS)
  1496.     gp_dosfs.c (MS-DOS and MS Windows)
  1497.     gp_itbc.c (MS-DOS, Borland compilers)
  1498.     gp_iwatc.c (MS-DOS, Watcom or Microsoft compiler)
  1499.     gp_msdos.c (MS-DOS and MS Windows)
  1500.     gp_ntfs.c (MS-Windows Win32s and Windows NT)
  1501.     gp_os2.c (OS/2)
  1502.     gp_os9.c (OS-9)
  1503.     gp_unifs.c (Unix or OS-9)
  1504.     gp_unix.c (Unix)
  1505.     gp_sysv.c (System V Unix)
  1506.     gp_vms.c (VMS)
  1507.     gp_win32.c (MS-Windows Win32s and Windows NT)
  1508. There are also some machine-specific conditionals in files with names
  1509. <something>_.h.  If you are going to extend Ghostscript to new
  1510. machines or operating systems, you should check the *_.h files for
  1511. ifdef's on things other than DEBUG, and you should probably count on
  1512. making a new makefile and a new gp_ file.
  1513.  
  1514. Library
  1515. -------
  1516.  
  1517. Files beginning with gs, gx, or gz (both .c and .h), other than gs.c and
  1518. gserver.c, are the Ghostscript library.  Files beginning with gdev are
  1519. device drivers or related code, also part of the library.  Other files
  1520. beginning with g are library files that don't fall neatly into either the
  1521. kernel or the driver category.
  1522.  
  1523. Interpreter
  1524. -----------
  1525.  
  1526. gs.c is the main program for the interactive language interpreter; gserver.c
  1527. is an alternative main program that is a rudimentary server.  If you
  1528. configure Ghostscript as a server rather than an interactive program, you
  1529. will use gserver.c instead of gs.c.
  1530.  
  1531. Files named z*.c are Ghostscript operator files.  The names of the files
  1532. generally follow the section headings of the operator summary in section
  1533. 6.2 of the PostScript manual.
  1534.  
  1535. Files named i*.c, and *.h other than g*.h, are the rest of the
  1536. interpreter.  See the makefile for a little more information on how the
  1537. files are divided functionally.
  1538.  
  1539. Files named s*.c are a flexible stream package, including the Level 2
  1540. PostScript 'filters' supported by Ghostscript.
  1541.