home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / MAKE.DOC < prev    next >
Text File  |  1994-08-01  |  31KB  |  724 lines

  1.    Copyright (C) 1989, 1990, 1991, 1993, 1994 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.doc, describes how to install Ghostscript, and how to
  21. build Ghostscript executables from source.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.
  25.  
  26. ********
  27. ******** Installing Ghostscript
  28. ********
  29.  
  30. To install the interpreter, you need:
  31.     - The interpreter executable:
  32.         - On MS-DOS systems:
  33.             - With 80286 CPUs, gs.exe.
  34.             - With 32-bit CPUs and using the Watcom compiler,
  35.               gs386.exe and the DOS extender dos4gw.exe.
  36.             - With 32-bit CPUs and using the DJGPP compiler,
  37.               gs.exe and the DOS extender go32.exe.
  38.         - On MS Windows:
  39.             - Ordinarily, gswin.exe.
  40.             - With Win32s, gswin32.exe.
  41.         - On OS/2, gsos2.exe and gspmdrv.exe.
  42.         - On VMS systems, gs.exe.
  43.         - On Unix systems, gs.
  44.     - The interpreter initialization files:    gs_*.ps.
  45.     - The font map: Fontmap.
  46.  
  47. See use.doc for a description of the search algorithm used to find these
  48. files.
  49.  
  50. You do not need any of these files when using the library; however, the
  51. library currently provides no way to install fonts.  This is obviously
  52. ridiculous and will be fixed sometime in the future.
  53.  
  54. ********
  55. ******** Building Ghostscript from source
  56. ********
  57.  
  58. Ghostscript is generally distributed in the form of a compressed tar file.
  59. When unpacked, this file puts all the Ghostscript files in a directory
  60. called gs.  Ghostscript is also available in the form of PC-compatible ZIP
  61. files.
  62.  
  63. Ghostscript uses a library provided by the Independent JPEG Group.  This
  64. library is included in the Ghostscript distribution in a separate file.  If
  65. you already have a copy of a version of this library that is compatible
  66. with Ghostscript, you won't have to FTP or unpack it again.  Please see the
  67. file jpeg.mak for information about which version(s) of the IJG code are
  68. compatible with Ghostscript.
  69.  
  70. Ghostscript is described by a collection of several makefiles:
  71.  
  72.     gs.mak - a generic makefile used on all platforms (except VMS).
  73.     devs.mak - a makefile listing all the device drivers.
  74.     *.mak - the makefiles for specific platforms.
  75.  
  76. You may need to edit the platform-specific makefile if you wish to change
  77. any of the following options:
  78.  
  79.     - The default search path(s) for the initialization and font files
  80. (macro GS_LIB_DEFAULT);
  81.  
  82.     - The debugging options (macros DEBUG and TDEBUG);
  83.  
  84.     - The set of device drivers to be included (DEVICE_DEVS
  85.     and DEVICE_DEVS1..9 macros);
  86.  
  87.     - The set of optional features to be included (FEATURE_DEVS macro).
  88.  
  89. The platform-specific makefile will include comments describing all of
  90. these items except the DEVICE_DEVS options; the available DEVICE_DEVS
  91. options (device drivers) are described in devs.mak, even though the file
  92. that must be edited is the platform-specific makefile.  (These comments do
  93. not apply to the VMS platform; it has its own procedures, which are
  94. described near the end of this document.)
  95.  
  96. The makefiles distributed with Ghostscript define these options as
  97. follows:
  98.  
  99.     - GS_LIB_DEFAULT: on Unix systems, /usr/local/lib/ghostscript and
  100. /usr/local/lib/ghostscript/fonts; on MS-DOS systems, . and C:\GS.  Note
  101. that on Unix systems, GS_LIB_DEFAULT does not include . (the current
  102. directory).
  103.  
  104.     - DEBUG, TDEBUG: no debugging code included in the build.
  105.  
  106.     - DEVICE_DEVS*: platform-specific, see below.
  107.  
  108.     - FEATURE_DEVS: platform-specific.
  109.  
  110. There are also platform-specific options described below under the
  111. individual platforms.  See the "Options" section near the beginning of the
  112. relevant makefile for more information.
  113.  
  114. If you are including a dot-matrix printer driver, you may wish to
  115. customize the default resolution parameters in devs.mak.
  116.  
  117. To build the interpreter, you need all the .h and .c files (and .asm files
  118. for MS-DOS) included in the distribution, as well as the makefiles.
  119.  
  120. The command
  121.     make clean
  122. removes all the files created by the build process (relocatables,
  123. executables, and miscellaneous scratch files).  If you want to save the
  124. executable, you should move it to another directory first.
  125.  
  126. Features and devices
  127. --------------------
  128.  
  129. To find out what devices a particular makefile selects for inclusion in
  130. the executable, find the lines in the makefile of the form
  131.     FEATURE_DEVS=<list of features>
  132. and
  133.     DEVICE_DEVS=<list of devices>
  134.     (similarly DEVICE_DEVS1... up to DEVICE_DEVS9)
  135. For example, the makefile for Unix platforms defines
  136.     FEATURE_DEVS=level2.dev
  137. indicating that the PostScript Level 2 facilities should be included, and
  138.     DEVICE_DEVS=x11.dev
  139.     DEVICE_DEVS9=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
  140. indicating that the X11 driver and all of the Portable Bit/Gray/PixMap
  141. file drivers should be included.
  142.  
  143. You may edit the FEATURE_DEVS line to select any desired set of features
  144. (listed near the beginning of gs.mak), and the DEVICE_DEVS* line(s) to
  145. select any desired set of device drivers (listed near the beginning of
  146. devs.mak).  The first device listed in the definition of DEVICE_DEVS will
  147. be used as the default device (unless overridden from the command line
  148. with -sDEVICE=xxx, of course.)  If you can't fit all the devices on a
  149. single line, you may add lines defining
  150.     DEVICE_DEVS2=<dev21>.dev ... <dev2n>.dev
  151.     DEVICE_DEVS3=<dev31>.dev ... <dev3n>.dev
  152. etc. up to DEVICE_DEVS9.  Don't use continuation lines -- this doesn't
  153. work on some platforms.
  154.  
  155. ********
  156. ******** How to build Ghostscript from source (PC version) ********
  157. ********
  158.  
  159. The relevant makefiles are:
  160.     Turbo C: tc.mak
  161.     Turbo C++/Borland C++, MS-DOS: bc.mak
  162.     Borland C++, MS Windows: bcwin.mak
  163.     Borland C++ 4.0, MS Windows with Win32s: bcwin32.mak
  164.     Microsoft C/C++ 7.0, MS-DOS: msc.mak
  165.     Watcom C/386 or C++, MS-DOS: watc.mak
  166.     Watcom C/386 or C++, MS Windows (NOT DEBUGGED YET): watcwin.mak
  167.     DJGPP, DESQview/X: dvx-djg.mak
  168. The options were chosen to strike a balance between RAM consumption and
  169. likely usefulness.  (Turbo C is limited to 640K and does not support code
  170. overlaying; Borland C++ is limited to 640K, but supports code overlaying
  171. under MS-DOS; the Watcom and DJGPP compilers are not limited to 640K.)
  172.  
  173. To build Ghostscript, you need MS-DOS version 3.3 or later, and a (Borland)
  174. Turbo C/C++, Borland C/C++, Microsoft C/C++ (version 7), Watcom C/386
  175. (version 8.5 or later) or C++ (any version), or the free djgpp + go32
  176. development system.  Details are given below.
  177.  
  178. As noted above, the default configuration generates an executable that
  179. assumes the directory where 'make' was run should be the final default
  180. directory for looking up the Ghostscript initialization and font files.
  181.  
  182. To build the Ghostscript executable, all you need to do is give the
  183. command
  184.     make
  185. You must have COMMAND.COM in your path to build Ghostscript.
  186.  
  187. There is a special 'make' target that simply attempts to compile all the
  188. .c files in the current directory.  Some of these compilations will fail,
  189. but the ones that succeed will go considerably faster, because they don't
  190. individually pay the overhead of loading the compiler into memory.  So a
  191. good strategy for building the executable for the first time, or after a
  192. change to a very widely used .h file, is:
  193.     make begin
  194. and then
  195.     make
  196. to do the compilations that failed the first time.
  197.  
  198. Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
  199. the file on a MS-DOS machine, the files will all have linefeed instead of
  200. carriage return + linefeed as the line terminator, which may make the C
  201. compiler unhappy.  I don't know the simplest way to fix this: just reading
  202. each file into an editor and writing it back out again may be sufficient.
  203. You will probably have to do this to the .c, .h, and .bat files.
  204.  
  205. Borland environment
  206. -------------------
  207.  
  208. To compile Ghostscript with the Borland environment, you need either Turbo
  209. C (version 2.0 or later) or Turbo C++ or Borland C++ (version 1.0 or
  210. later); specifically, the compiler, 'make' utility, and linker.  You also
  211. need either the Borland assembler (version 1.0 or later) or the Microsoft
  212. assembler (version 4.0 or later).  Before compiling or linking, you should
  213. execute
  214.     echo !include "tc.mak" >makefile
  215. (for Turbo C and MS-DOS), or
  216.     echo !include "bc.mak" >makefile
  217. (for Turbo C++ or Borland C++ and MS-DOS), or
  218.     echo !include "bcwin.mak" >makefile
  219. (for Turbo C++ or Borland C++ and Microsoft Windows), or
  220.     echo !include "bcwin32.mak" >makefile
  221. (for Borland C++ and Microsoft Windows with Win32s)
  222.  
  223. Besides the source files and the makefiles, you need:
  224.     turboc.cfg (the flags and switches for Turbo C)
  225.     gs.tr (the linker commands for the interpreter)
  226.     *.bat (a variety of batch files used in the build process)
  227.  
  228. There are extensive comments in the aforementioned .mak files
  229. regarding various configuration parameters.  If your configuration is
  230. different from the following, you should definitely read those
  231. comments and see if you want or need to change any of the parameters:
  232.     - The compiler files are in c:\tc (for Turbo C) or c:\bc (for
  233. Turbo C++ or Borland C++) and its subdirectories.
  234.     - You are using the Borland assembler (tasm).
  235.     - You want an executable that will run on any PC-compatible,
  236. regardless of processor type (8088, 8086, V20, 80186, 80286, V30, 80386,
  237. 80486) and regardless of whether a math coprocessor (80x87) is present.
  238.  
  239. NOTE: Borland C++ 3.0 has two problems that affect Ghostscript (these
  240. problems are fixed in Borland C++ 3.1):
  241.  
  242.     - The assembler, tasm, often crashes when attempting to
  243. assemble gdevegaa.asm.  If this happens, try again, or use another
  244. assembler (e.g., an older version of tasm) if you have one, or set
  245. USE_ASM=0 in the makefile.
  246.  
  247.     - The math library for Microsoft Windows, mathwl.lib, has a
  248. bug that causes floating point numbers to print incorrectly.  Contact
  249. Borland for a corrected version.
  250.  
  251. If you are compiling Ghostscript with Turbo C++ 1.0, remove the
  252. `.swap' directive from bc.mak, and use the -s switch on the `make'
  253. command line.  (All later versions of the Borland environment
  254. recognize this directive.)
  255.  
  256. Note that although the Microsoft Windows version of Ghostscript will
  257. run under Windows 3.0, it uses routines from the Windows 3.1 SDK, so
  258. you need the Windows 3.1 SDK and header files to compile it.  In
  259. practice, this means that you need Borland C++ 3.1; Borland C++ 3.0
  260. doesn't include the necessary headers.
  261.  
  262. If building for the MS Windows Win32s environment, you need bcc32.cfg 
  263. instead of turboc.cfg.  The make process will stop after it has created
  264. genarch.exe.  You should then run 'win genarch arch.h', wait until genarch
  265. has finished and then exit MS Windows.  Then type 'make' again to restart 
  266. the make process. 
  267.  
  268. Microsoft environment
  269. ---------------------
  270.  
  271. To compile Ghostscript with the Microsoft environment, you need Microsoft
  272. Visual C++ 1.0 or later with its associated `nmake' utility and linker.
  273. Before compiling or linking, you should execute
  274.     echo !include msc.mak >makefile
  275.  
  276. Besides the source files and the makefiles, you need:
  277.     gs.tr (the linker commands for the interpreter)
  278.     *.bat (a variety of batch files used in the build process)
  279.  
  280. All previous versions of Microsoft C/C++ are of such poor quality that we
  281. strongly advise you not to attempt to compile Ghostscript with them.  In
  282. particular, C/C++ 7.0 is the first version that is even close to being
  283. ANSI-compliant, and its 'nmake' program is very unreliable (it crashes
  284. partway through the build process with a variety of error messages, or no
  285. error message) and cannot write its error messages to a file.
  286.  
  287. Aladdin Enterprises does not currently have a copy of the Microsoft
  288. compiler.  If you encounter problems with it, we will not be able to help
  289. you; please post them to the Usenet gnu.ghostscript.bug newsgroup.
  290.  
  291. Watcom environment
  292. ------------------
  293.  
  294. To avoid annoying messages from the DOS extender, add the line
  295.     set DOS4G=quiet
  296. to your autoexec.bat file. 
  297.  
  298. To compile Ghostscript with the Watcom compiler, you need to create a
  299. makefile by executing
  300.  
  301.     echo !include watc.mak >makefile
  302.  
  303. To build Ghostscript, execute
  304.  
  305.     wmakel -u
  306.  
  307. Note that Watcom C/386 version 8.5 does not include wmakel (the 32-bit
  308. version of wmake).  If this is the version that you have, try using wmake
  309. instead, i.e.,
  310.  
  311.     wmake -u
  312.  
  313. If you get an "Error(F01): Out of memory", you may wish to try reducing
  314. the total size of the makefiles by editing devs.mak to remove drivers that
  315. you don't ever intend to use.  If you still get this error, contact Watcom
  316. technical support; they will be able to send you the wmakel program,
  317. probably at no charge.
  318.  
  319. If you are using Watcom C/C++ version 9.5 or later, find the definition of
  320. the CCL macro in wccommon.mak and remove the -p switch.  (Watcom made a
  321. poorly motivated, non-backward-compatible change that we couldn't figure
  322. out a way to detect automatically.)
  323.  
  324. If you are using Watcom C/C++ version 10.0 or later, you may need to change
  325. the definition of the COMP macro in watc.mak or watcwin.mak, to change the
  326. directory from bin to binb.
  327.  
  328. DesqView/X and djgcc environment
  329. --------------------------------
  330.  
  331. The DesqView/X port of Ghostscript was contributed by Tom Brosnan
  332. (tjb@chalone.stanford.edu).  It uses djgcc (DJ Delorie's MSDOS port
  333. of gcc) for compiling.  djgcc assumes that go32.exe is in your search
  334. path.  You need to set an environment variable to tell go32 where to
  335. put any paging files, e.g.
  336.  
  337.     set GO32TMP=e:/tmp
  338.  
  339. If you don't have go32.exe, you can get it from Internet host
  340. oak.oakland.edu.  go32.exe is part of djdev109.zip, which is in
  341. /pub/msdos/djgpp.
  342.  
  343. The name of the makefile for this environment is dvx-djg.mak.
  344.  
  345. ********
  346. ******** How to build Ghostscript from source (OS/2 version) ********
  347. ********
  348.  
  349. The relevant makefile is:
  350.     os2.mak
  351. The EMX/GCC 0.8h compiler and the IBM NMAKE.EXE are required.
  352.  
  353. Before compiling or linking, you should execute
  354.     copy os2.mak makefile
  355. Then to start the make process type
  356.     nmake
  357. Two EXE's will be produced: gsos2.exe (Ghostscript) and gspmdrv.exe (the
  358. Presentation Manager display driver).  gsos2.exe will also run under MS-DOS
  359. if a device other than os2pm is selected.
  360.  
  361. ********
  362. ******** How to build Ghostscript from source (Unix version) ********
  363. ********
  364.  
  365. The makefile distributed with Ghostscript selects the following devices
  366. for inclusion in the build:
  367.     Display: X Windows driver.
  368.     File output: pbm, pbmraw, pgm, pgmraw, ppm, and ppmraw drivers.
  369.  
  370. Before compiling or linking, you should execute
  371.  
  372.     ln -s unix-cc.mak makefile
  373. or    ln -s unix-gcc.mak makefile
  374. or    ln -s unixansi.mak makefile
  375.  
  376. (if your Unix system doesn't support symbolic links, omit the -s switch)
  377. depending on whether your C compiler is a standard Kernighan & Ritchie C
  378. compiler, gcc being used in ANSI mode, or an ANSI C compiler other than
  379. gcc respectively.  (If you want to use gcc in non-ANSI mode, use
  380. unix-cc.mak and define the CC macro to refer to gcc.)
  381.  
  382. The unix-*.mak files are actually generated mechanically from *head.mak,
  383. *tail.mak, gs.mak, and devs.mak.  If for some reason your copy of
  384. Ghostscript doesn't include the unix-*.mak files, invoke the
  385.     tar_cat
  386. shell script to construct them.
  387.  
  388. If the X11 client header files are located in some directory which your
  389. compiler does not automatically search, you must change the XINCLUDE macro
  390. the makefile to include a specific -I switch.  See the comment preceding
  391. XINCLUDE in the makefile.
  392.  
  393. Currently Ghostscript is set up to compile and link in a generic Unix
  394. environment.  Some Unix environments may require changing the LDFLAGS
  395. macro in the makefile.
  396.  
  397. All you need to do to make an executable is invoke the shell command
  398.     make
  399.  
  400. Ghostscript uses ANSI syntax for function definitions. Because of this,
  401. when compiling with cc, it must preprocess each .c file to convert it to
  402. the older syntax defined in Kernighan and Ritchie, which is what most
  403. current Unix compilers (other than gcc) support.  This step is
  404. automatically performed by a utility called ansi2knr, which is included in
  405. the Ghostscript distribution.  The makefile automatically builds ansi2knr.
  406.  
  407. The ansi2knr preprocessing step is included in the makefile rule for
  408. compiling .c files.  ansi2knr creates a file called _temp_.c to hold the
  409. converted code.  If you want to change this name for some reason, it is
  410. defined in unix-cc.mak.
  411.  
  412. Platform-specific notes
  413. -----------------------
  414.  
  415. 386 Unix:
  416.     gcc versions older than 1.38 on Intel 80386 systems do not
  417. compile Ghostscript correctly using the -O option.  Do not use -O in
  418. these environments.
  419.     gcc 1.39 under 386BSD has a bug that causes float-to-integer
  420. conversions to compile incorrectly.  Do not use this version of gcc.
  421.     X11R5 may need #include <stddef.h> in x_.h.
  422.     Also see below regarding System V platforms.
  423.  
  424. Alpha (AXP) with OSF/1.2:
  425.     The optimizer in cc is broken.  If you are compiling with cc, use
  426. the unixansi.mak makefile, and the command line
  427.         make CC=cc CFLAGS= EXTRALIBS=-lXmu
  428.     If you are compiling with gcc, use version 2.5.0 or later, with
  429. the unix-gcc.mak makefile, and the command line
  430.         make CFLAGS=-O2 EXTRALIBS=-lXmu
  431. (libXmu is needed to resolve reference _XEditResCheck from libXt, which is
  432. peculiar to OSF/1.)
  433.  
  434. Alpha (AXP) with OSF/1.3:
  435.     The optimizer is OK, but needs to be told to allocate extra table
  436. space to be able to handle some of the larger files:
  437.         make CC=cc CFLAGS="-Olimit 1000"
  438.     The linker in the c89 compiler is broken, so even if you compile
  439. with c89, you must link with cc.  You do not need to set EXTRALIBS=-lXmu.
  440.  
  441. Alpha (AXP) with OpenVMS:
  442.     DEC C V4.0 or later is required.  The DEC C V1.3 run-time library
  443. has bugs that prevent Ghostscript from working.
  444.  
  445. Apollo:
  446.     You must run the compiler in ANSI-compatible mode (i.e., set AK=
  447. <null string> in the makefile); otherwise, it gives incorrect error
  448. messages for any function declared as returning a float value.
  449.     The Apollo compiler may not compile Ghostscript correctly.  If you
  450. get unexpected crashes at run time, use gcc.
  451.  
  452. Convex:
  453.     Use unixansi.mak.  Do not invoke optimization (-O1): there
  454. are compiler bugs that lead to incorrect code.  Set CFLAGS to
  455.     -fn -tm -no c1
  456.  
  457. DEC (Ultrix):
  458.     Many versions of DEC's X server (DECwindows) have bugs that
  459. require setting use_XPutImage or use_XSetTile to 0, as described above.
  460.     You may wish to set
  461.   GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts
  462. in the makefile to add the Display PostScript font directory to the font
  463. search path.
  464.     You may need to use
  465.         make CFLAGS="-Olimit 1000"
  466. to tell the optimizer to allocate extra table space.
  467.  
  468. DEC (OSF/1):
  469.     You may need to use
  470.         make CFLAGS="-Olimit 600"
  471. to tell the optimizer to allocate extra table space.
  472.     You may need to change the definition of INSTALL in the makefile
  473. from install -c to installbsd -c.
  474.  
  475. GNU make (any platform):
  476.     GNU make 3.59 can't handle the final linking step in some cases;
  477. use the platform's standard make (e.g., /bin/make) if this happens.
  478.     
  479. H-P RISC workstations:
  480.     If you are using H-P's compiler, use the compiler flags -Ae +O3
  481. (*not* -O) -DNOSYSTIME.  You may also need -D_POSIX_SOURCE.  In addition,
  482. if you get the error message
  483.     Initializing... Unrecoverable error: typecheck in .registerencoding
  484.     Operand stack:
  485.         .notdef  0
  486. when you start Ghostscript, you need to install the following patches to
  487. fix bugs in H-P's C compiler: PHSS_2199, PHSS_3015, PHSS_3537.
  488.     If you are using gcc 2.5.8, use -O, not -O2; the latter generates
  489. incorrect code for at least one module (gsimage.c).
  490.  
  491. Intergraph Clipper:
  492.     Recommended settings are:
  493.         XCFLAGS=-w -Q -DSYSV -D__SVR3
  494.         EXTRALIBS=-lbsd -lc_s
  495.         CC=acc -knr
  496.         PLATFORM=sysv_
  497. Also, you will probably need to change the X11 driver specification from
  498.     $(SHP)gsaddmod x11 -lib Xt X11 Xext
  499. to
  500.     $(SHP)gsaddmod x11 -lib Xt_s X11_s Xext
  501.  
  502. ISC Unix:
  503.     For ISC Unix with gcc, an appropriate make invocation is:
  504.     make XCFLAGS="-D__SVR3 -posix" LDFLAGS="-shlib -posix" \
  505.          EXTRALIBS="-linet -lnsl_s"
  506. If this doesn't work for you, try removing the -shlib.  ISC Unix may
  507. also need one or more of the following in EXTRALIBS: -lpt, -lc_s.
  508. See also under "386 Unix" above.
  509.  
  510. MIPS:
  511.     There is apparently a bug in the MIPS C compiler which causes
  512. gxdither.c to compile incorrectly if optimization is enabled (-O).  Until
  513. a work-around is found, do not use -O with the MIPS C compiler.
  514.  
  515. NeXT:
  516.     Use unix-gcc.mak, but change the name of the compiler (CC=) from
  517. gcc to cc.  Also, include -D_NEXT_SOURCE in CFLAGS, change the two
  518. occurrences of sys/time.h to ansi/time.h, and change <dirent.h> in
  519. gp_unifs.c to <sys/dirent.h>.  You may also find it useful to add the
  520. following line to Fontmap:
  521.         /Ohlfs    /Courier    ;
  522.  
  523. RS/6000:
  524.     Many versions of the AIX C compiler have bugs that have prevented
  525. Ghostscript from compiling and linking properly.  We believe that the
  526. current Ghostscript release works around these bugs, and that using the
  527. unix-cc.mak makefile with
  528.     CC=cc
  529. should work.  You must also edit the makefile (unixansi.mak or
  530. unix-cc.mak) to change INSTALL to /usr/ucb/install.  (If -DSYSV produces a
  531. complaint about the functions index and rindex not being defined, try
  532. removing it.)  If the xlc 1.2.1 optimizer runs out of memory, you may need
  533. to add -qmaxmem=4000 to CFLAGS.
  534.  
  535. Apparently some (but not all) releases of the C library declare the hypot
  536. function: if the declaration in math_.h produces an error message, try
  537. removing it.  Also, the IBM X11R3 server is known to be buggy: use the MIT
  538. X server if possible.
  539.  
  540. SCO Unix/Xenix:
  541.     The SCO Unix C compiler apparently can't handle the Pn macros
  542. in std.h.  If you get strange compilation errors on SCO Unix, see if
  543. you can get a compiler fix from SCO.  Meanwhile, to use gcc with SCO
  544. ODT, see gcc-head.mak for the appropriate switch settings.  See also
  545. under "386 Unix" above.
  546.     gcc 2.3.3 produces code that causes a core dump on machines
  547. that don't have hardware floating point, because of a bug in SCO's
  548. floating point emulator.  Use a different compiler on these machines.
  549.     If you aren't using the X11 driver, you need to add -lsocket
  550. to the linker command (near the end of the unix-*.mak file) in order
  551. to get the date/time functions linked in.
  552.     If you want to use direct frame buffer addressing instead of
  553. X Windows, include the relevant frame buffer device(s) (ega.dev,
  554. vga.dev, etc.) and change gdevevga.c to gdevsco.c as indicated in
  555. devs.mak.  Note: this does not work with SuperVGA displays, except
  556. for 800x600x16 mode.
  557.     If your compiler accepts the -Xt and -Xa switches, use -Xt.
  558. Even though this causes the compiler to use incorrect rules for
  559. computing the result types of << and >>, -Xa enables "optimizations"
  560. that produce incorrect code.
  561.     For SCO ODT 2.0, in addition to -D__SVR3 and -DSYSV, you need to
  562. specify -Dsco, -DUSG, and -DMALLOC_0_RETURNS_NULL.  For SCO ODT, you need
  563. EXTRALIBS=-lX11 -lsocket -lmalloc, or maybe only -lsocket (depending on
  564. the version), and for SCO ODT 2.0, you also need to specify -lc_s.  For
  565. SCO Xenix, you need EXTRALIBS=-lmalloc.
  566.     For all SCO systems, set XINCLUDE= and XLIBDIRS=.
  567.     Please also read the section on "System V Unix platforms" below.
  568.  
  569. Sun:
  570.     The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
  571. properly if the -fast option is selected: Ghostscript core-dumps in
  572. build_gs_font.  Use -g, or use gcc.
  573.     The Sun version of dbx often gives up with an error message when
  574. trying to load Ghostscript.  If this happens, use gdb instead.  (gdb is
  575. more reliable than dbx in other ways as well.)
  576.     Solaris 2.2 may require setting EXTRALIBS=-lsocket.
  577.     Solaris 2.n uses /usr/openwin/share/include for the X11 libraries
  578. rather than /usr/local/X/include.
  579.  
  580. SVR4 Unix platforms:
  581.     You may need to set EXTRALIBS=-lnsl.
  582.  
  583. System V Unix platforms:
  584.     If you are using a stock System V platform that lacks rename
  585. and gettimeofday, change PLATFORM=unix_ in the makefile to
  586. PLATFORM=sysv_.
  587.     You will probably need to change the definition of INSTALL (near
  588. the beginning of the makefile) from install to /usr/ucb/install.
  589.  
  590. ********
  591. ******** How to build Ghostscript from source (VMS aka OpenVMS version) ****
  592. ********
  593.  
  594. The files VMS-CC.MAK, VMS-GCC.MAK, and VMS-AXP.MAK are OpenVMS DCL command
  595. files which build Ghostscript from scratch using, respectively, the VAX C
  596. compiler, CC, the Free Software Foundation's GNU C compiler, GCC, or the
  597. DEC C compiler on AXP platforms, CC.  Accordingly, you must have one of
  598. these compilers installed in order to build Ghostscript.  (Other C compilers
  599. may work: CC and GCC are the only two compilers tested to date.)  These
  600. command files build and store the Ghostscript library in the object library
  601. GS.OLB.  If you have DECwindows (X11) installed on your system, the
  602. executable image GS.EXE will also be built.
  603.  
  604. Some environments use the DWTLIBSHR library for providing the X
  605. Windows intrinsics, and some use the XTSHR library.  XTSHR is newer,
  606. and is part of the DECwindows/Motif product.  However, DEC is still
  607. distributing versions of VMS with DWTLIBSHR.  If your environment
  608. uses XTSHR, replace DWTLIBSHR in the list of link libraries with
  609. XTSHR.
  610.  
  611. Many versions of DEC's X server have bugs that produce broad bands of color
  612. where dither patterns should appear, or characters displayed white on top
  613. of black rectangles or not displayed at all.  If this happens, please
  614. consult the X Windows section of the use.doc file to find out how to work
  615. around these bugs using X resources; also report the problem to DEC, or
  616. whoever supplied your X server.
  617.  
  618. You may also wish to turn off the use of a backing pixmap with Ghostscript,
  619. either to work around X server memory limitations or bugs, or to obtain
  620. faster displaying at the expense of no redrawing when a Ghostscript window
  621. is restored from an icon or exposed after being occluded by another window.
  622. Again, use.doc contains information on how to do this.
  623.  
  624. For OpenVMS VAX platforms with VAX C, issue the DCL command
  625.     $ @VMS-CC.MAK
  626. to build Ghostscript.  If you have GNU C, issue the DCL command
  627.     $ @VMS-GCC.MAK
  628. to build Ghostscript.  For OpenVMS AXP platforms with DEC C, issue the
  629. DCL command
  630.     $ @VMS-AXP.MAK
  631. to build Ghostscript.
  632.  
  633. The option "DEBUG" may be specified with either command file in order to
  634. build a debuggable Ghostscript configuration; e.g.,
  635.     $ @VMS-CC.MAK DEBUG
  636.  
  637. In order to specify switches and file names when invoking the interpreter,
  638. define GS as a foreign command:
  639.     $ GS == "$disk:[directory]GS.EXE"
  640. where "disk" and "directory" specify the disk and directory where Ghostscript
  641. is located.  For instance,
  642.     $ GS == "$DUA1:[GHOSTSCRIPT]GS.EXE"
  643. To allow the interpreter to be run from any directory, define the logical
  644. GS_LIB which points to the Ghostscript directory
  645.     $ DEFINE GS_LIB disk:[directory]
  646. This allows Ghostscript to locate its initialization files stored in the
  647. Ghostscript directory -- see use.doc for further details.  Finally, to
  648. invoke the interpreter, merely type GS.  Although DCL normally converts
  649. unquoted parameters to upper case, C programs receive their parameters in
  650. lower case.  That is, the command
  651.     $ GS -Isys$login:
  652. passes the switch "-isys$login" to the interpreter.  To preserve the
  653. case of switches, enclose them in double quotes; e.g.,
  654.     $ GS "-Isys$login:"
  655.  
  656. If you add compiled fonts to your system as described in the fonts.doc file,
  657. then add the font source file names to MODULES.LIS, add "ccfonts.dev" to the
  658. FEATURE_DEVS symbol in VMS-CC.MAK, VMS-GCC.MAK, or VMS-AXP.MAK,
  659.     $ FEATURE_DEVS = "level2.dev ccfonts.dev"
  660. and then specify the font names with the ccfonts1 symbol
  661.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  662. If the line gets too long, add another line of the same form, e.g.,
  663.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  664.     $ ccfonts2 = "Times_Roman Times_Italic Times_Bold Times_BoldItalic"
  665.  
  666. ********
  667. ******** A guide to the files ********
  668. ********
  669.  
  670. General
  671. -------
  672.  
  673. There are very few machine dependencies in Ghostscript.  A few of the .c
  674. files are machine-specific.  These have names of the form
  675.     gp_<platform>.c
  676. specifically
  677.     gp_dosfb.c (MS-DOS)
  678.     gp_dosfs.c (MS-DOS and MS Windows)
  679.     gp_itbc.c (MS-DOS, Borland compilers)
  680.     gp_iwatc.c (MS-DOS, Watcom or Microsoft compiler)
  681.     gp_msdos.c (MS-DOS and MS Windows)
  682.     gp_ntfs.c (MS-Windows Win32s and Windows NT)
  683.     gp_os2.c (OS/2)
  684.     gp_os9.c (OS-9)
  685.     gp_unifs.c (Unix or OS-9)
  686.     gp_unix.c (Unix)
  687.     gp_sysv.c (System V Unix)
  688.     gp_vms.c (VMS)
  689.     gp_win32.c (MS-Windows Win32s and Windows NT)
  690. There are also some machine-specific conditionals in files with names
  691. <something>_.h.  If you are going to extend Ghostscript to new
  692. machines or operating systems, you should check the *_.h files for
  693. ifdef's on things other than DEBUG, and you should probably count on
  694. making a new makefile and a new gp_ file.
  695.  
  696. Library
  697. -------
  698.  
  699. Files beginning with gs, gx, or gz (both .c and .h), other than gs.c
  700. and gsmain.c, are the Ghostscript library.  Files beginning with gdev
  701. are device drivers or related code, also part of the library.  Other
  702. files beginning with g are library files that don't fall neatly into
  703. either the kernel or the driver category.
  704.  
  705. Interpreter
  706. -----------
  707.  
  708. gs.c is the main program for the language interpreter.
  709.  
  710. Files beginning with z are Ghostscript operator files.  The names of the
  711. files generally follow the section headings of the operator summary in
  712. section 6.2 of the PostScript manual.
  713.  
  714. .c files beginning with i, and .h files not beginning with g, are the
  715. rest of the interpreter.  See the makefile for a little more information
  716. on how the files are divided functionally.
  717.  
  718. There are a few files that are logically part of the interpreter, but that
  719. are potentially useful outside Ghostscript, whose names don't begin with
  720. either g, z, or i:
  721.  
  722.     s*.c (a flexible stream package, including the Level 2 PostScript
  723. 'filters' supported by Ghostscript);
  724.