home *** CD-ROM | disk | FTP | other *** search
/ swCHIP 1991 January / swCHIP_95-1.bin / utility / gs333ini / gs3.33 / make.doc < prev    next >
Text File  |  1995-12-09  |  36KB  |  823 lines

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