home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / gs403osk.tgz / gs403osk.tar / make.txt < prev    next >
Text File  |  1996-09-24  |  49KB  |  1,129 lines

  1.    Copyright (C) 1989, 1995, 1996 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. ******** Building Ghostscript from source
  28. ********
  29.  
  30. Ghostscript is generally distributed in the form of a compressed tar file
  31. (.tar.gz).  When unpacked, this file puts all the Ghostscript files in a
  32. directory called gsA.BC, where A.BC is the version number.  Ghostscript is
  33. also available in the form of PC-compatible .zip files.
  34.  
  35. Ghostscript uses a library provided by the Independent JPEG Group.  This
  36. library is included in the Ghostscript distribution in a separate file.  If
  37. you already have a copy of a version of this library that is compatible with
  38. Ghostscript, you won't have to FTP or unpack it again.  Please see the file
  39. jpeg.mak for information about which version(s) of the IJG code are
  40. compatible with Ghostscript.  This library does not include the gsA.BC
  41. prefix; you should make the gsA.BC directory current before you unpack the
  42. JPEG archive.  Both the .tar.gz and .zip archives of the library do,
  43. however, include a subdirectory name jpeg-## where ## is the version number,
  44. so the files will end up in a directory named gsA.BC/jpeg-##/.
  45.  
  46. Ghostscript also uses the freely available PNG and ZLIB libraries.  These
  47. libraries are also included in the distribution in separate files.  Please
  48. see libpng.mak and zlib.mak for information about where to get the most
  49. up-to-date versions of these libraries.  Unfortunately, the public archives
  50. of these libraries are inconsistent about subdirectory names, and the
  51. conventions vary from release to release, so you must do different things
  52. depending on whether you are using the .tar.gz archive or the .zip archive
  53. and possibly depending on which release you are using.  If you are using the
  54. .tar.gz archive, then:
  55.  
  56.     - Before unpacking libpng-#.##.tar.gz, make the gsA.BC directory
  57.     current.  Unpacking will create a subdirectory named
  58.     gsA.BC/libpng-#.##.  Rename this subdirectory as gsA.BC/libpng.
  59.  
  60.     - Before unpacking zlib-#.##.tar.gz, make the gsA.BC directory
  61.     current.  Unpacking will create a subdirectory named gsA.BC/zlib or
  62.     gsA.BC/zlib-#.##; if the latter, rename it as gsA.BC/zlib.
  63.  
  64. If you are using the .zip archive, then:
  65.  
  66.     - Before unpacking lbpng###.zip or lp###.zip, create a directory
  67.     called gsA.BC/libpng and make it current.
  68.  
  69.     - Before unpacking zlib###.zip or zlib-###.zip, create a directory
  70.     called gsA.BC/zlib and make it current.
  71.  
  72. Ghostscript is described by a collection of several makefiles:
  73.  
  74.     gs.mak, int.mak, lib.mak, jpeg.mak, libpng.mak, zlib.mak - generic
  75.       makefiles used on all platforms (except VMS).
  76.     devs.mak - a makefile listing all the device drivers.
  77.     *.mak - the makefiles for specific platforms.
  78.  
  79. You may need to edit the platform-specific makefile if you wish to change
  80. any of the following:
  81.  
  82.     - The name of the makefile itself (MAKEFILE macro);
  83.  
  84.     - The default search path(s) for the initialization and font files
  85.       (GS LIB_DEFAULT_macro);
  86.  
  87.     - The debugging options (DEBUG and TDEBUG macros);
  88.  
  89.     - The set of device drivers to be included (DEVICE_DEVS
  90.       and DEVICE_DEVS1..15 macros);
  91.  
  92.     - The set of optional features to be included (FEATURE_DEVS)
  93.  
  94. The platform-specific makefile will include comments describing all of
  95. these items except the DEVICE_DEVS options; the available DEVICE_DEVS
  96. options (device drivers) are described in devs.mak, even though the file
  97. that must be edited is the platform-specific makefile.  (These comments do
  98. not apply to the VMS platform; it has its own procedures, which are
  99. described near the end of this document.)
  100.  
  101. The makefiles distributed with Ghostscript define these options as
  102. follows:
  103.  
  104.     - MAKEFILE: the xxx.mak name of the makefile as distributed
  105.       (platform-specific).
  106.  
  107.     - GS_LIB_DEFAULT: on Unix systems, /usr/local/share/ghostscript/N.NN
  108.     and /usr/local/share/ghostscript/fonts, where N.NN is the
  109.     Ghostscript release number (e.g., 3.33); on MS-DOS systems, . and
  110.     C:\GS.  Note that on Unix systems, GS_LIB_DEFAULT does not include
  111.     . (the current directory).
  112.  
  113.     - DEBUG, TDEBUG: no debugging code included in the build.
  114.  
  115.     - DEVICE_DEVS*: platform-specific, see below.
  116.  
  117.     - FEATURE*: 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, and .def files for MS Windows) included in the distribution, as
  128. well as the makefiles.
  129.  
  130. The command
  131.     make clean
  132. removes all the files created by the build process (relocatables,
  133. executables, and miscellaneous scratch files).  If you want to save the
  134. executable, you should move it to another directory first.
  135.  
  136. Features and devices
  137. --------------------
  138.  
  139. When compiling Ghostscript, you may configure it with any of a variety of
  140. features, and with any subset of the available device drivers.  You will
  141. find the complete list of features in a comment at the beginning of the file
  142. gs.mak, and the complete list of drivers in a comment at the beginning of
  143. devs.mak.
  144.  
  145. To find out what devices a particular makefile selects for inclusion in
  146. the executable, find the line in the makefile of the form
  147.     FEATURE_DEVS=<list of features>
  148. and
  149.     DEVICE_DEVS=<list of devices>
  150.     (similarly DEVICE_DEVS1... up to DEVICE_DEVS15)
  151. For example, if the makefile for Unix platforms defined
  152.     FEATURE_DEVS=level2.dev
  153. indicating that only the PostScript Level 2 facilities should be included,
  154. you might wish to add
  155.     FEATURE_DEVS=level2.dev pdf.dev
  156. to add the ability to interpret PDF files.  (In fact, the current definition
  157. of FEATURE_DEVS in the Unix makefiles does include pdf.dev.)  The Unix
  158. makefile also defines
  159.     DEVICE_DEVS=x11.dev
  160.     DEVICE_DEVS9=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
  161. indicating that the X11 driver and all of the Portable Bit/Gray/PixMap
  162. file drivers should be included.
  163.  
  164. You may edit the FEATURE* lines to select any desired set of features (as
  165. listed near the beginning of gs.mak), and the DEVICE_DEVS* line(s) to select
  166. any desired set of device drivers (as listed near the beginning of
  167. devs.mak).  The first device listed in the definition of DEVICE_DEVS will be
  168. used as the default device (unless overridden from the command line with
  169. -sDEVICE=xxx, of course.)  If you can't fit all the devices on a single
  170. line, you may add lines defining
  171.     DEVICE_DEVS2=<dev21>.dev ... <dev2n>.dev
  172.     DEVICE_DEVS3=<dev31>.dev ... <dev3n>.dev
  173. etc. up to DEVICE_DEVS15.  Don't use continuation lines -- this doesn't
  174. work on some platforms.
  175.  
  176. Cross-compiling
  177. ---------------
  178.  
  179. If you are compiling Ghostscript on machine X with a cross-compiler that
  180. generates code for machine Y, you need to do one extra step.  Rather than
  181. simply giving the command
  182.     make
  183. you must proceed in three steps.  First,
  184.     make arch.h
  185. Then edit arch.h to reflect the architecture of machine Y.  Then,
  186.     make
  187.  
  188. LZW compression
  189. ---------------
  190.  
  191. It is possible to substitute an LZW compressor for the LZW-compatible
  192. encoder provided with the standard fileset, by finding the two lines in
  193. lib.mak that read
  194.  
  195.     lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
  196.     #lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)
  197.  
  198. and changing them to
  199.  
  200.     #lzwe_=slzwce.$(OBJ) slzwc.$(OBJ)
  201.     lzwe_=slzwe.$(OBJ) slzwc.$(OBJ)
  202.  
  203. If you do this, you are responsible for constructing or obtaining a file
  204. slzwe.c that implements LZW compression; such a file is not included in any
  205. current standard Ghostscript distribution, although you may be able to find
  206. one in distributions that predate Unisys' amnesty cutoff of January 1, 1995.
  207. You are also responsible for drawing your own conclusions about the
  208. applicability to LZW compression code of patents held by Unisys and/or IBM,
  209. and for obtaining any licenses you believe to be relevant.
  210.  
  211. ********
  212. ******** How to build Ghostscript from source (PC version) ********
  213. ********
  214.  
  215. The relevant makefiles are:
  216.     Turbo C: tc.mak
  217.     Turbo C++/Borland C++, MS-DOS: bc.mak
  218.     Borland C++, MS Windows: bcwin.mak
  219.     Borland C++ 4.0, MS Windows with Win32s or MS Windows NT: bcwin32.mak
  220.     Microsoft C/C++ 7.0, MS-DOS: msc.mak
  221.     Watcom C/386 or C++, MS-DOS: watc.mak
  222.     Watcom C/386 or C++, MS Windows (NOT DEBUGGED YET): watcwin.mak
  223.     DJGPP, DESQview/X: dvx-gcc.mak
  224. The options were chosen to strike a balance between RAM consumption and
  225. likely usefulness.  (Turbo C is limited to 640K and does not support code
  226. overlaying; Borland C++ is limited to 640K, but supports code overlaying
  227. under MS-DOS; the Watcom and DJGPP compilers are not limited to 640K.)
  228.  
  229. To build Ghostscript, you need MS-DOS version 3.3 or later, and a (Borland)
  230. Turbo C/C++, Borland C/C++, Microsoft C/C++ (version 7), Watcom C/386
  231. (version 8.5 or later) or C++ (any version), or the free djgpp + go32
  232. development system.  Details are given below.
  233.  
  234. As noted above, the default configuration generates an executable that
  235. assumes the directory where 'make' was run should be the final default
  236. directory for looking up the Ghostscript initialization and font files.
  237.  
  238. To build the Ghostscript executable, all you need to do is give the
  239. command
  240.     make
  241. You must have COMMAND.COM in your path to build Ghostscript.
  242.  
  243. There is a special 'make' target that simply attempts to compile all the
  244. .c files in the current directory.  Some of these compilations will fail,
  245. but the ones that succeed will go considerably faster, because they don't
  246. individually pay the overhead of loading the compiler into memory.  So a
  247. good strategy for building the executable for the first time, or after a
  248. change to a very widely used .h file, is:
  249.     make begin
  250. and then
  251.     make
  252. to do the compilations that failed the first time.
  253.  
  254. Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
  255. the file on a MS-DOS machine, the files will all have linefeed instead of
  256. carriage return + linefeed as the line terminator, which may make the C
  257. compiler unhappy.  I don't know the simplest way to fix this: just reading
  258. each file into an editor and writing it back out again may be sufficient.
  259. You will probably have to do this to the .c, .h, and .bat files.
  260.  
  261. Borland environment
  262. -------------------
  263.  
  264. To compile Ghostscript with the Borland environment, you need either Turbo
  265. C (version 2.0 or later) or Turbo C++ or Borland C++ (version 1.0 or
  266. later); specifically, the compiler, 'make' utility, and linker.  You also
  267. need either the Borland assembler (version 1.0 or later) or the Microsoft
  268. assembler (version 4.0 or later).  Before compiling or linking, you should
  269. execute
  270.     echo !include "tc.mak" >makefile
  271. (for Turbo C and MS-DOS), or
  272.     echo !include "bc.mak" >makefile
  273. (for Turbo C++ or Borland C++ and MS-DOS), or
  274.     echo !include "bcwin.mak" >makefile
  275. (for Turbo C++ or Borland C++ and Microsoft Windows), or
  276.     echo !include "bcwin32.mak" >makefile
  277. (for Borland C++ and Microsoft Windows with Win32s or Microsoft Windows NT)
  278.  
  279. Besides the source files and the makefiles, you need:
  280.     turboc.cfg (the flags and switches for Turbo C)
  281.     gs.tr (the linker commands for the interpreter)
  282.     *.bat (a variety of batch files used in the build process)
  283.  
  284. There are extensive comments in the aforementioned .mak files
  285. regarding various configuration parameters.  If your configuration is
  286. different from the following, you should definitely read those
  287. comments and see if you want or need to change any of the parameters:
  288.     - The compiler files are in c:\tc (for Turbo C) or c:\bc (for
  289. Turbo C++ or Borland C++) and its subdirectories.
  290.     - You are using the Borland assembler (tasm).
  291.     - You want an executable that will run on any PC-compatible,
  292. regardless of processor type (8088, 8086, V20, 80186, 80286, V30, 80386,
  293. 80486) and regardless of whether a math coprocessor (80x87) is present.
  294.  
  295. NOTE: Borland C++ 3.0 has two problems that affect Ghostscript (these
  296. problems are fixed in Borland C++ 3.1):
  297.  
  298.     - The assembler, tasm, often crashes when attempting to
  299. assemble gdevegaa.asm.  If this happens, try again, or use another
  300. assembler (e.g., an older version of tasm) if you have one, or set
  301. USE_ASM=0 in the makefile.
  302.  
  303.     - The math library for Microsoft Windows, mathwl.lib, has a
  304. bug that causes floating point numbers to print incorrectly.  Contact
  305. Borland for a corrected version.
  306.  
  307. NOTE: Borland C++ 4.52 has a bug that causes the 32-bit Windows executable
  308. to fail during startup.  Borland has provided a patch for this bug on the
  309. file bc45xp1.zip, accessible as a link from
  310. http://loki.borland.com/cpp/Patchs.htm.
  311.  
  312. NOTE: Borland C++ 5.0 and 5.01 have a code generator bug that generates
  313. incorrect code for the construct !file_is_valid().  Do not attempt to
  314. compile Ghostscript with these compilers.  If you want to report this bug to
  315. Borland, send them the result of compiling ziodev.c and tell them to look at
  316. the code generated for file_is_valid() and !file_is_valid().
  317.  
  318. If you are compiling Ghostscript with Turbo C++ 1.0, remove the
  319. `.swap' directive from bc.mak, and use the -s switch on the `make'
  320. command line.  (All later versions of the Borland environment
  321. recognize this directive.)
  322.  
  323. Note that although the Microsoft Windows version of Ghostscript will
  324. run under Windows 3.0, it uses routines from the Windows 3.1 SDK, so
  325. you need the Windows 3.1 SDK and header files to compile it.  In
  326. practice, this means that you need Borland C++ 3.1; Borland C++ 3.0
  327. doesn't include the necessary headers.
  328.  
  329. If building for the MS Windows Win32s environment, you need bcc32.cfg
  330. instead of turboc.cfg.  The make process will stop after it has created
  331. genarch.exe.  You should then run 'win genarch arch.h', wait until genarch
  332. has finished and then exit MS Windows.  Then type 'make' again to restart
  333. the make process.
  334.  
  335. If building for MS Windows NT, you also need bcc32.cfg instead of
  336. turboc.cfg, but the make process will run to completion automatically.
  337.  
  338. Microsoft environment
  339. ---------------------
  340.  
  341. To compile Ghostscript with the Microsoft environment, you need Microsoft
  342. Visual C++ 1.0 or later with its associated `nmake' utility and linker.
  343. Before compiling or linking, you should execute
  344.     echo !include msc.mak >makefile
  345.  
  346. Besides the source files and the makefiles, you need:
  347.     gs.tr (the linker commands for the interpreter)
  348.     *.bat (a variety of batch files used in the build process)
  349.  
  350. All previous versions of Microsoft C/C++ are of such poor quality that we
  351. strongly advise you not to attempt to compile Ghostscript with them.  In
  352. particular, C/C++ 7.0 is the first version that is even close to being
  353. ANSI-compliant, and its 'nmake' program is very unreliable (it crashes
  354. partway through the build process with a variety of error messages, or no
  355. error message) and cannot write its error messages to a file.
  356.  
  357. Aladdin Enterprises does not currently have a copy of the Microsoft
  358. compiler.  If you encounter problems with it, we will not be able to help
  359. you; please post them to the Usenet gnu.ghostscript.bug newsgroup.
  360.  
  361. Watcom environment
  362. ------------------
  363.  
  364. Before compiling, change the definition of the WCVERSION macro in the
  365. makefile (watc.mak or watcwin.mak) to the version of the Watcom compiler you
  366. are using.  This is necessary to handle some minor incompatibilities between
  367. versions.
  368.  
  369. To avoid annoying messages from the DOS extender, add the line
  370.     set DOS4G=quiet
  371. to your autoexec.bat file. 
  372.  
  373. To compile Ghostscript with the Watcom compiler, create a makefile by
  374. executing
  375.  
  376.     echo !include watc.mak >makefile
  377.  
  378. or
  379.  
  380.     echo !include watcwin.mak >makefile
  381.  
  382. To build Ghostscript, execute
  383.  
  384.     wmakebat
  385.  
  386. This constructs a build script and then executes it.  (This roundabout
  387. procedure is necessary because Watcom chose to implement wmake in a way that
  388. requires reading both the entire makefile and the entire current directory
  389. into the limited 640K MS-DOS address space.)
  390.  
  391. Note that Watcom C/386 version 8.5 does not include wmakel (the 32-bit
  392. version of wmake).  If this is the version that you have, use wmake instead,
  393. i.e., edit wmakebat.bat to change wmakel to wmake.
  394.  
  395. If you get an "Error(F01): Out of memory" with Watcom 8.5, you may wish to
  396. try reducing the total size of the makefiles by editing devs.mak to remove
  397. drivers that you don't ever intend to use.  If you still get this error,
  398. contact Watcom technical support; they will be able to send you the wmakel
  399. program, probably at no charge.
  400.  
  401. DesqView/X and djgcc/djgpp environment
  402. --------------------------------------
  403.  
  404. The name of the makefile for this environment is dvx-gcc.mak.
  405.  
  406. The DesqView/X port of Ghostscript was contributed by Tom Brosnan
  407. (tjb@chalone.stanford.edu), with further contributions by Stephen Turnbull
  408. (turnbull@shako.sk.tsukuba.ac.jp).  It uses djgcc (DJ Delorie's MSDOS port
  409. of gcc) for compiling.  djgcc assumes that go32.exe is in your search path.
  410. You need to set an environment variable to tell go32 where to put any
  411. paging files, e.g.
  412.  
  413.     set GO32TMP=e:/tmp
  414.  
  415. If you don't have go32.exe, you can get it from Internet host
  416. oak.oakland.edu.  The extender and minimum run-time environment are in the
  417. file djeoeXXX.zip, where XXX is the version number (currently 112).
  418. Patched versions of the extender (as well as other components) are found in
  419. the files djXXXmY.zip, XXX is again the compiler version, Y is the
  420. patchlevel.  Y is currently 2.  People who are just running the executable
  421. need only get the file with the highest level of Y that contains GO32.EXE
  422. and do "unzip -j djXXXmY go32.exe" (InfoZIP) or "pkunzip djXXXmY go32.exe"
  423. (PKWare), then move the extender to their PATH.  If you do not have a
  424. hardware FPU, you will also need the floating point emulator EMU387 found
  425. in djeoeXXX.zip (and possibly in the patch releases as well).  You MUST use
  426. an emulator designed to work with GO32; the emulators often found as TSRs
  427. will not work.  See the file README found in djeoeXXX.zip, or the file
  428. README.1ST in pub/msdos/djgpp on Simtel for further information.
  429.  
  430. The DJGPP v1.12 compiler suite is known to have problems with linking
  431. large file sets.  If you run into this problem, you can work around it
  432. by using the v1.11 GO32 as follows:
  433. (1) get dj111m5.zip from turnbull.sk.tsukuba.ac.jp:/pub/djgpp/1.11
  434. (2) unzip GO32.EXE.  Be careful not to overwrite other versions!
  435. (3) rename it, eg, to GO111M5.EXE
  436. (4) move the renamed GO32.EXE to your path
  437. (5) stubedit ld.exe:  (the stubedit utility is part of djeoe112.zip)
  438.     (a) change the extender name to the one you chose in (3).  The
  439.         .EXE extension may be omitted
  440.     (b) change the version required to 1.11
  441.     (c) accept the defaults for the remaining options.
  442.  
  443. Stephen Turnbull observed the following two problems with DJGPP v2.0-beta2.
  444.  
  445. (1) The v1.12 stdio.h defined a number of flags for manipulating the
  446.     various characteristics of the streams being processed, such as
  447.     _IORD, _IOWRT, etc.  These are missing from v2.0-beta2.  I don't
  448.     know enough about the new libc.a to guess whether this is an
  449.     oversight or these functions have a new (Posix?) interface.
  450.     [Caveat: In Ghostscript the compiler error can be silenced by
  451.     adding "#define _IOWRT 00002" to the file gp_dvx.c.  I don't know
  452.     that this is correct in the new libraries.  I suspect there is no
  453.     real loss in Ghostscript to removing the offending flag
  454.     manipulation from gp_open_printer() in gp_dvx.c, as it is a
  455.     performance optimization.]
  456.  
  457. (2) The big problem is linking with third-party libraries not compiled
  458.     with v2.0.  In particular, QuarterDeck's contributed Xlib
  459.     (compiled with DJGPP v1.12 (original release).  Unfortunately,
  460.     v1.12 uses the usual macros for character classification and
  461.     implementation of the stdio streams.  This leads to long lists of
  462.     complaints from the linker about undefined references to '_ctype_'
  463.     (the table of character type flags) and '_iob' (the table indexed
  464.     by file descriptors) when processing Xlib functions.
  465.  
  466. ********
  467. ******** How to build Ghostscript from source (Mac version) ********
  468. ********
  469.  
  470. There are additional Mac-specific source files in a separate distribution
  471. from the rest of Ghostscript.  In addition to the standard Ghostscript
  472. sources, you will need the following files:
  473.  
  474.     macgs-v1.0-src.sit    - the source files, StuffIt archive.
  475.     manual.txt            - the manual as unformatted text
  476.     readme.txt            - this file
  477.  
  478. These should be in the mac directory located in the same place you retrieved
  479. the rest of the Ghostscript distribution.
  480.  
  481. The first file is a StuffIt archive.  If you do not have a program to expand
  482. it, you should get the free StuffIt Expander program from your favorite
  483. Macintosh archive.
  484.  
  485. In the standard method of building Ghostscript, all of these files (except
  486. the jpeg) get unpacked into one big directory.  The jpeg stuff gets unpacked
  487. into a directory called jpeg-6 in the main directory.  The Macintosh stuff
  488. also gets unpacked into its own directory, called 'Mac Specific'.  However,
  489. if you like (and I do) you can divide up all these files into the following
  490. hierarchy:
  491.  
  492.     Ghost Dev
  493.         files -- all *.ps, *.txt, and other non-build files
  494.         fonts -- all the fonts
  495.         src -- *.c, *.h, *.mak
  496.         jpeg-6 -- the jpeg files
  497.         Mac Specific -- the mac files
  498.         MPW Build -- empty directory used for building under MPW
  499.  
  500. Once you get everything laid out, take a look at the file Worksheet in the
  501. mac specific folder for complete steps to build the system with either MPW
  502. or CodeWarrior.
  503.  
  504. ********
  505. ******** How to build Ghostscript from source (Unix version) ********
  506. ********
  507.  
  508. The makefile distributed with Ghostscript selects the following devices
  509. for inclusion in the build:
  510.     Display: X Windows driver.
  511.     File output: pbm, pbmraw, pgm, pgmraw, ppm, and ppmraw drivers.
  512.  
  513. Before compiling or linking, you should execute
  514.  
  515.     ln -s unix-cc.mak makefile
  516. or  ln -s unix-gcc.mak makefile
  517. or  ln -s unixansi.mak makefile
  518.  
  519. (if your Unix system doesn't support symbolic links, omit the -s switch)
  520. depending on whether your C compiler is a traditional Kernighan & Ritchie C
  521. compiler, gcc, or an ANSI C compiler other than gcc respectively.  (If you
  522. want to use gcc in traditional mode, use unix-cc.mak and define the CC macro
  523. to refer to gcc.)
  524.  
  525. The unix-*.mak files are actually generated mechanically from *head.mak,
  526. *tail.mak, unix-end.mak, gs.mak, jpeg.mak, libpng.mak, zlib.mak, and
  527. devs.mak by a script called tar_cat.  If for some reason your copy of
  528. Ghostscript doesn't include the unix-*.mak files, run tar_cat to construct
  529. them.  If you wish to edit any part of the makefile,
  530.  
  531.     DO NOT EDIT THE FILE NAMED makefile OR unix{ansi,cc,gcc}.mak.
  532.     EDIT THE ORIGINAL COMPONENT MAKEFILE (*head.mak, *tail.mak,
  533.     unix-end.mak, gs.mak, jpeg.mak, libpng.mak, zlib.mak, OR devs.mak)
  534.     AND RUN tar_cat AGAIN.
  535.  
  536. Consult tar_cat to find the names of the component files.
  537.  
  538. The *head.mak files explicitly compile and link the libpng and zlib
  539. libraries into the executable.  If your Unix system already includes these
  540. libraries (probably in /usr/lib/libpng.{a,so} and libz.{a,so}) and you would
  541. rather use the system copies, change the definition of SHARE_LIBPNG and/or
  542. SHARE_ZLIB from 0 to 1 in the relevant *head.mak file, run tar_cat, and
  543. recompile.  Note that if you do this, you will get non-DEBUG versions of
  544. these libraries, even if you selected DEBUG in the Ghostscript makefile.
  545.  
  546. If the X11 client header files are located in some directory which your
  547. compiler does not automatically search, you must change the XINCLUDE macro
  548. the makefile to include a specific -I switch.  See the comment preceding
  549. XINCLUDE in the makefile.
  550.  
  551. Currently Ghostscript is set up to compile and link in a generic Unix
  552. environment.  Some Unix environments may require changing the LDFLAGS
  553. macro in the makefile.
  554.  
  555. All you need to do to make an executable is invoke the shell command
  556.     make
  557.  
  558. Ghostscript uses ANSI syntax for function definitions. Because of this,
  559. when compiling with cc, it must preprocess each .c file to convert it to
  560. the older syntax defined in Kernighan and Ritchie, which is what most
  561. current Unix compilers (other than gcc) support.  This step is
  562. automatically performed by a utility called ansi2knr, which is included in
  563. the Ghostscript distribution.  The makefile automatically builds ansi2knr.
  564.  
  565. The ansi2knr preprocessing step is included in the makefile rule for
  566. compiling .c files.  ansi2knr creates a file called _temp_.c to hold the
  567. converted code.  If you want to change this name for some reason, it is
  568. defined in unix-cc.mak.
  569.  
  570. Platform-specific notes
  571. -----------------------
  572.  
  573. 386 Unix:
  574.     gcc versions older than 1.38 on Intel 80386 systems do not
  575. compile Ghostscript correctly using the -O option.  Do not use -O in
  576. these environments.
  577.     gcc 1.39 under 386BSD has a bug that causes float-to-integer
  578. conversions to compile incorrectly.  Do not use this version of gcc.
  579.     X11R5 may need #include <stddef.h> in x_.h.
  580.     Also see below regarding System V platforms.
  581.  
  582. Alpha (AXP) with OSF/1.2:
  583.     The optimizer in cc is broken.  If you are compiling with cc, use
  584. the unixansi.mak makefile, and the command line
  585.         make CC=cc CFLAGS= EXTRALIBS=-lXmu
  586.     If you are compiling with gcc, use version 2.5.0 or later, with
  587. the unix-gcc.mak makefile, and the command line
  588.         make CFLAGS=-O2 EXTRALIBS=-lXmu
  589. (libXmu is needed to resolve reference _XEditResCheck from libXt, which is
  590. peculiar to OSF/1.)
  591.     You will probably need to change the definition of INSTALL in the
  592. makefile from install to installbsd.
  593.  
  594. Alpha (AXP) with OSF/1.3:
  595.     The optimizer is OK, but needs to be told to allocate extra table
  596. space to be able to handle some of the larger files:
  597.         make CC=cc CFLAGS="-Olimit 1000"
  598.     The linker in the c89 compiler is broken, so even if you compile
  599. with c89, you must link with cc.  You do not need to set EXTRALIBS=-lXmu.
  600.     You will probably need to change the definition of INSTALL in the
  601. makefile from install to installbsd.
  602.  
  603. Apollo:
  604.     You must run the compiler in ANSI-compatible mode (i.e., set AK=
  605. <null string> in the makefile); otherwise, it gives incorrect error
  606. messages for any function declared as returning a float value.
  607.     The Apollo compiler may not compile Ghostscript correctly.  If you
  608. get unexpected crashes at run time, use gcc.
  609.  
  610. AT&T 7040 R3:
  611.     If Ghostscript crashes on startup, recompile with -O0 in order to
  612. avoid triggering compiler bugs.
  613.  
  614. Convex:
  615.     Use unixansi.mak.  Do not invoke optimization (-O1): there
  616. are compiler bugs that lead to incorrect code.  Set CFLAGS to
  617.     -no -fn -tm c1
  618.  
  619. DEC:
  620.     See Alpha (above) or VAX (below).  Also, you may get the following
  621. message (or a similar one) when compiling on a DECstation, due to a
  622. compiler bug:
  623.     cfe: Fatal: _temp_19086.c: Segmentation violation
  624. If this happens, try compiling with the -oldc switch.
  625.  
  626. DECStations with Ultrix:
  627.     You may wish to set
  628.   GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts
  629. in the makefile to add the Display PostScript font directory to the font
  630. search path.
  631.     You may need to use
  632.         make CFLAGS="-Olimit 1000"
  633. to tell the optimizer to allocate extra table space.
  634.     The Ultrix 4.4 C compiler has a bug that makes it compile gdevm1.c
  635. incorrectly.  Insert the following line in the makefile rule for
  636. gdevm1.$(OBJ) (the body of the rule is empty in the standard distribution):
  637.     $(CCC) -oldc gdevm1.c
  638.  
  639. Digital Unix:
  640.     A user has suggested compiling with
  641.         CFLAGS=-O -migrate -std1 $(XCFLAGS)
  642. This is said to be the same compiler as is used on VMS. This is very strict,
  643. but it doesn't produce pages of non-suppressible warnings like "Undefined
  644. the ANSI standard library macro stdin".
  645.  
  646. gcc (all platforms):
  647.     There is an optimizer bug in gcc 2.7.0, 2.7.1, and 2.7.2 that causes
  648. these versions of gcc to generate incorrect code.  You can work around this
  649. by adding the switch
  650.         -Dconst=
  651. to the compilation switches (CFLAGS).  Alternatively, you can rebuild gcc
  652. with the following patch:
  653.  
  654. *** clean-ss-951203/expr.c  Sun Nov 26 08:18:07 1995
  655. --- ss-951203/expr.c    Mon Dec  4 11:41:18 1995
  656. *************** expand_expr (exp, target, tmode, modifie
  657. *** 4582,4587 ****
  658.        through a pointer to const does not mean that the value there can
  659.        never change.  Languages where it can never change should
  660.        also set TREE_STATIC.  */
  661. !   RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) | TREE_STATIC (exp);
  662.     return temp;
  663.         }
  664. --- 4582,4588 ----
  665.        through a pointer to const does not mean that the value there can
  666.        never change.  Languages where it can never change should
  667.        also set TREE_STATIC.  */
  668. !   RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) & TREE_STATIC (exp);
  669.     return temp;
  670.         }
  671.  
  672. If possible, compile with gcc 2.5.8 or 2.6.3, which don't have this bug.
  673.  
  674. GNU make (any platform):
  675.     Current versions of GNU `make' have no problems, but GNU make 3.59
  676. can't handle the final linking step in some cases; use the platform's
  677. standard make (e.g., /bin/make) if this happens.
  678.     
  679. H-P RISC workstations:
  680.     If you are using H-P's compiler, use the compiler flags -Ae +O3
  681. (*not* -O) -DNOSYSTIME.  You may also need -D_POSIX_SOURCE.  In addition,
  682. if you get the error message
  683.     Initializing... Unrecoverable error: typecheck in .registerencoding
  684.     Operand stack:
  685.         .notdef  0
  686. when you start Ghostscript, you need to install the following patches to
  687. fix bugs in H-P's C compiler: PHSS_5734, PHSS_5723.
  688.     If you are using gcc 2.5.8, use -O, not -O2; the latter generates
  689. incorrect code for at least one module (gsimage.c).
  690.  
  691. Intergraph Clipper:
  692.     Recommended settings are:
  693.         XCFLAGS=-w -Q -DSYSV -D__SVR3
  694.         EXTRALIBS=-lbsd -lc_s
  695.         CC=acc -knr
  696.         PLATFORM=sysv_
  697. Also, you will probably need to change the X11 driver specification from
  698.     $(SHP)gsaddmod x11 -lib Xt X11 Xext
  699. to
  700.     $(SHP)gsaddmod x11 -lib Xt_s X11_s Xext
  701.  
  702. ISC Unix:
  703.     For ISC Unix with gcc, an appropriate make invocation is:
  704.     make XCFLAGS="-D__SVR3 -posix" LDFLAGS="-shlib -posix" \
  705.          EXTRALIBS="-linet -lnsl_s"
  706. If this doesn't work for you, try removing the -shlib.  ISC Unix may
  707. also need one or more of the following in EXTRALIBS: -lpt, -lc_s.
  708. See also under "386 Unix" above.
  709.  
  710. Linux:
  711.     If you are running gcc version 2.6.3 or later, you may run into
  712. problems because of an incompatibility in object formats ("a.out" vs. ELF)
  713. with the XFree86 library.  The typical symptom is that ld will complain that
  714. some X library is not found or a whole slew of Xlib or Xt functions are not
  715. found in the library, or you will get a message when you start Ghostscript
  716. that the program or the shared library is in unrecognized format.  If this
  717. happens, you might try adding the switches
  718.     -b i486-linuxaout
  719. to both CFLAGS and LDFLAGS in gcc-head.mak, and rebuilding from scratch
  720. ("make clean" and then "make").  If this doesn't help, or if other strange
  721. things happen, contact your Linux supplier or support resource.
  722.  
  723. MIPS:
  724.     There is apparently a bug in the MIPS C compiler which causes
  725. gxdither.c to compile incorrectly if optimization is enabled (-O).  Until
  726. a work-around is found, do not use -O with the MIPS C compiler.
  727.  
  728. NCR 3550:
  729.     If you are using the NCR C Development Toolkit, you must use -O0 to
  730. avoid triggering compiler bugs.
  731.  
  732. NeXTSTEP:
  733.     Use unix-gcc.mak -- i.e., execute
  734.         ln -s unix-gcc.mak Makefile
  735.  
  736. For NeXTSTEP versions before 3.2:
  737.     edit gcc-head.mak ->
  738.         change CC=gcc to CC=cc
  739.         add -D_NEXT_SOURCE to CFLAGS
  740.     change the two occurrences of sys/time.h to ansi/time.h, and
  741.     change <dirent.h> in gp_unifs.c to <sys/dirent.h>
  742.  
  743. For NeXTSTEP 3.2:
  744.     edit gcc-head.mak ->
  745.         change CC=gcc to CC=cc
  746.         add -D_POSIX_SOURCE tand remove -g in CFLAGS
  747.         remove -Wstrict-prototypes in GCFLAGS
  748.  
  749. Add the following line to the end of Fontmap
  750.         /Ohlfs  /Courier    ;
  751.  
  752. If you are running the Pencom co-Xist X server (Development version), the X
  753. headers and libraries are in the default places, so you should change the
  754. definitions of XINCLUDE and XLIBDIRS in the makefile to empty strings.
  755.  
  756. Pyramid MIServer-S:
  757.     See AT&T 7040 R3.
  758.  
  759. RS/6000:
  760.     Many versions of the AIX C compiler have bugs that have prevented
  761. Ghostscript from compiling and linking properly.  We believe that the
  762. current Ghostscript release works around these bugs, and that using the
  763. unix-cc.mak makefile with
  764.     CC=cc
  765. should work.  You must also edit the makefile (unixansi.mak or
  766. unix-cc.mak) to change INSTALL to /usr/ucb/install.  (If -DSYSV produces a
  767. complaint about the functions index and rindex not being defined, try
  768. removing it.)  If the xlc 1.2.1 optimizer runs out of memory, you may need
  769. to add -qmaxmem=4000 to CFLAGS.
  770.     A user has reported that the AIX C compiler shipped with AIX 3.2.5
  771. only compiles Ghostscript if invoked with c89 -D_POSIX_SOURCE and *without*
  772. -O.  On the other hand, another user reported successful compilation using
  773. the unix-ansi.mak makefile and the following command line:
  774.     make CC=c89 XCFLAGS="-DOSY_AIX -D_ALL_SOURCE -qnoro -qmaxmem=3000 -bfl" $*
  775. Apparently some (but not all) releases of the C library declare the hypot
  776. function: if the declaration in math_.h produces an error message, try
  777. removing it.  Also, the IBM X11R3 server is known to be buggy: use the MIT
  778. X server if possible.
  779.     The xlc 1.3.0.x compiler provided in AIX 3.2.5+ definitely will not
  780. compile Ghostscript correctly if -O is used on all files.  A user has
  781. reported that compiling the following files without -O is sufficient to
  782. produce a working executable: z*.c, gsmatrix.c, gxstroke.c.
  783.     Some installations of AIX 3.2.5 have what appears to be an incorrect
  784. or inconsistent version of libXt.a in /usr/lpp/X11/lib.  If you get
  785. XtShellStrings and XtStrings as unresolved externals when linking, set
  786. XLIBDIRS=-L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib rather than just
  787. XLIBDIRS=-L/usr/lpp/X11/lib.
  788.  
  789. SCO Unix/Xenix:
  790.     The SCO Unix C compiler apparently can't handle the Pn macros
  791. in std.h.  If you get strange compilation errors on SCO Unix, see if
  792. you can get a compiler fix from SCO.  Meanwhile, to use gcc with SCO
  793. ODT, see gcc-head.mak for the appropriate switch settings.  See also
  794. under "386 Unix" above.
  795.     gcc 2.3.3 produces code that causes a core dump on machines
  796. that don't have hardware floating point, because of a bug in SCO's
  797. floating point emulator.  Use a different compiler on these machines.
  798.     If you aren't using the X11 driver, you need to add -lsocket
  799. to the linker command (near the end of the unix-*.mak file) in order
  800. to get the date/time functions linked in.
  801.     If you want to use direct frame buffer addressing instead of X
  802. Windows, include the relevant frame buffer device(s) (ega.dev, vga.dev,
  803. etc.) and change gdevevga.c to gdevsco.c as indicated in devs.mak.  Note:
  804. this does not work with SuperVGA displays, except for 800x600x16 mode.
  805. Note also: If the display looks "smeared", try recompiling gdevpcfb.c with
  806. -O0.  Note also: if Ghostscript crashes, use the -q switch and/or redirect
  807. console output to a file.
  808.     If your compiler accepts the -Xt and -Xa switches, use -Xt.
  809. Even though this causes the compiler to use incorrect rules for
  810. computing the result types of << and >>, -Xa enables "optimizations"
  811. that produce incorrect code.
  812.     For SCO ODT 2.0, in addition to -D__SVR3 and -DSYSV, you need to
  813. specify -Dsco, -DUSG, and -DMALLOC_0_RETURNS_NULL.  For SCO ODT, you need
  814. EXTRALIBS=-lX11 -lsocket -lmalloc, or maybe only -lsocket (depending on
  815. the version), and for SCO ODT 2.0, you also need to specify -lc_s.  For
  816. SCO Xenix, you need EXTRALIBS=-lmalloc.
  817.     For all SCO systems, set XINCLUDE= and XLIBDIRS=.
  818.     Please also read the section on "System V Unix platforms" below.
  819.  
  820. SGI:
  821.     The SGI C compiler shipped with Irix 5.2 requires compiler
  822. options -cckr.
  823.     The SGI C compiler may produce warnings about "Undefined the ANSI
  824. standard library defined macro stdin/stdout/stderr".  To suppress these
  825. warnings, add
  826.     -woff 608
  827. to the definition of CFLAGS.
  828.     The SGI C compiler shipped with Irix 6.1 and 6.2 will not compile
  829. deflate.c (part of zlib) properly with optimization.  If you want to use the
  830. zlib decompression filter, compile this file separately without -O.
  831.  
  832. Sun:
  833.     The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
  834. properly if the -fast option is selected: Ghostscript core-dumps in
  835. build_gs_font.  Use -g, or use gcc.
  836.     The Sun version of dbx often gives up with an error message when
  837. trying to load Ghostscript.  If this happens, use gdb instead.  (gdb is
  838. more reliable than dbx in other ways as well.)
  839.     There is a bug in zlib that results in an undefined symbol zmemcmp
  840. when compiling with Sun cc.  Use gcc instead.
  841.  
  842.     SunOS
  843.     -----
  844.         In SunOS 4.1.[23], you may get these undefined symbols when linking:
  845.                 _get_wmShellWidgetClass
  846.                 _get_applicationShellWidgetClass
  847. Compiling "-Bstatic -lXmu -Bdynamic" appears to work for SC1.0.  For gcc,
  848. try adding "-static" to CFLAGS.  To solve the problem if you are using
  849. OpenWindows 3.0 (X11R4-based Xt), please contact your local Sun office and
  850. request the following patches:
  851.     Patch i.d.      Description
  852.     100512-02       4.1.x OpenWindows 3.0 libXt Jumbo patch
  853.     100573-03       4.1.x OpenWindows 3.0 undefined symbols when using
  854.                 shared libXmu
  855.     Solaris
  856.     -------
  857.     Solaris 2.2 may require setting EXTRALIBS=-lsocket.
  858.     Solaris 2.3 and 2.4 seem to require EXTRALIBS=-lnsl -lsocket.
  859.     Solaris 2.n uses /usr/openwin/share/include for the X11 libraries
  860. rather than /usr/local/X/include.
  861.     Solaris 2.n typically makes Type 1 fonts available in
  862. /usr/openwin/lib/X11/fonts/Type1/outline.
  863.     For Solaris 2.n, you will need to change the definition of INSTALL in
  864. the makefile from install -c to installbsd -c, since the Solaris version of
  865. 'install' requires
  866.         install -c <directory> [-m <mode>] <file>
  867. rather than
  868.         install [-c] [-m <mode>] <file> <directory>
  869.     You may need to set XLIBDIR to the directory that holds the X11
  870. libraries, as for other SVR4 systems.  You should also set -DSVR4 in CFLAGS.
  871.  
  872. SVR4 Unix platforms:
  873.     You may need to set EXTRALIBS=-lnsl.
  874.     Do *not* change PLATFORM=unix_ to PLATFORM=sysv_.
  875.     On SVR4 Unix platforms that use dynamic linking, you may need to
  876. define XLIBDIR as the name of the directory that holds the X Windows
  877. libraries.  Do *not* prefix this with -L.
  878.     For SVR4.0 systems, set -DSVR4 -DSVR4_0 in the makefile; do *not*
  879. set -DSYSV.  For SVR4.2 (or later) and Solaris 2.x systems, set -DSVR4 only
  880. (not -DSVR4_0 and not -DSYSV).
  881.  
  882. System V Unix platforms:
  883.     If you are using a stock System V platform that lacks rename
  884. and gettimeofday, change PLATFORM=unix_ in the makefile to
  885. PLATFORM=sysv_.
  886.     You will probably need to change the definition of INSTALL (near
  887. the beginning of the makefile) from install to /usr/ucb/install.
  888.  
  889. VAX with Ultrix:
  890.     The above information about DECStations with Ultrix may be
  891. applicable.
  892.  
  893. ********
  894. ******** How to build Ghostscript from source (OS/2 version) ********
  895. ********
  896.  
  897. The relevant makefile is:
  898.     os2.mak
  899. The EMX/GCC 0.9b compiler and the IBM NMAKE.EXE are required.
  900.  
  901. Before compiling or linking, you should execute
  902.     copy os2.mak makefile
  903. Then to start the make process type
  904.     nmake
  905. One DLL and two EXE's will be produced: gsdll2.dll (Ghostscript DLL),
  906. gsos2.exe (Ghostscript) and gspmdrv.exe (the Presentation Manager 
  907. display driver).  
  908.  
  909. ********
  910. ******** How to build Ghostscript from source (VMS aka OpenVMS version) ****
  911. ********
  912.  
  913. The files VMS-CC.MAK, VMS-GCC.MAK, and VMS-DECC.MAK are OpenVMS DCL command
  914. files which build Ghostscript from scratch using, respectively, the VAX C
  915. compiler, CC, the Free Software Foundation's GNU C compiler, GCC, or the DEC
  916. C compiler, CC.  Accordingly, you must have one of these compilers installed
  917. in order to build Ghostscript.  (Other C compilers may work: CC and GCC are
  918. the only two compilers tested to date.  DEC C V4.0 or later is required: the
  919. DEC C V1.3 run-time library has bugs that prevent Ghostscript from working.)
  920. These command files build and store the Ghostscript library in the object
  921. library GS.OLB.  If you have DECwindows (X11) installed on your system, the
  922. executable image GS.EXE will also be built.
  923.  
  924. Some environments use the DWTLIBSHR library for providing the X Windows
  925. intrinsics, and some use the XTSHR library.  XTSHR is newer, and is part of
  926. the DECwindows/Motif product.  However, DEC is still distributing versions
  927. of VMS with DWTLIBSHR.  If your environment uses XTSHR, replace DWTLIBSHR in
  928. the list of link libraries with XTSHR.
  929.  
  930. Many versions of DEC's X server have bugs that produce broad bands of color
  931. where dither patterns should appear, or characters displayed white on top
  932. of black rectangles or not displayed at all.  If this happens, please
  933. consult the X Windows section of the use.txt file to find out how to work
  934. around these bugs using X resources; also report the problem to DEC, or
  935. whoever supplied your X server.
  936.  
  937. You may also wish to turn off the use of a backing pixmap with Ghostscript,
  938. either to work around X server memory limitations or bugs, or to obtain
  939. faster displaying at the expense of no redrawing when a Ghostscript window
  940. is restored from an icon or exposed after being occluded by another window.
  941. Again, use.txt contains information on how to do this.
  942.  
  943. For OpenVMS VAX platforms with VAX C, issue the DCL command
  944.     $ @VMS-CC.MAK
  945. to build Ghostscript.  For OpenVMS platforms with GNU C (either AXP or
  946. VAX), issue the DCL command
  947.     $ @VMS-GCC.MAK
  948. to build Ghostscript.  For OpenVMS platforms with DEC C (either AXP or
  949. VAX), issue the DCL command
  950.     $ @VMS-DECC.MAK
  951. to build Ghostscript.
  952.  
  953. The option "DEBUG" may be specified with either command file in order to
  954. build a debuggable Ghostscript configuration; e.g.,
  955.     $ @VMS-CC.MAK DEBUG
  956.  
  957. In order to specify switches and file names when invoking the interpreter,
  958. define GS as a foreign command:
  959.     $ GS == "$disk:[directory]GS.EXE"
  960. where "disk" and "directory" specify the disk and directory where Ghostscript
  961. is located.  For instance,
  962.     $ GS == "$DUA1:[GHOSTSCRIPT]GS.EXE"
  963. To allow the interpreter to be run from any directory, define the logical
  964. GS_LIB which points to the Ghostscript directory
  965.     $ DEFINE GS_LIB disk:[directory]
  966. This allows Ghostscript to locate its initialization files stored in the
  967. Ghostscript directory -- see use.txt for further details.  Finally, to
  968. invoke the interpreter, merely type GS.  Although DCL normally converts
  969. unquoted parameters to upper case, C programs receive their parameters in
  970. lower case.  That is, the command
  971.     $ GS -Isys$login:
  972. passes the switch "-isys$login" to the interpreter.  To preserve the
  973. case of switches, enclose them in double quotes; e.g.,
  974.     $ GS "-Isys$login:"
  975.  
  976. If you add compiled fonts to your system as described in the fonts.txt file,
  977. then add the font source file names to MODULES.LIS, add "ccfonts.dev" to the
  978. FEATURE_DEVS symbol in VMS-CC.MAK, VMS-GCC.MAK, or VMS-DECC.MAK,
  979.     $ FEATURE_DEVS = "level2.dev ccfonts.dev"
  980. and then specify the font names with the ccfonts1 symbol
  981.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  982. If the line gets too long, add another line of the same form, e.g.,
  983.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  984.     $ ccfonts2 = "Times_Roman Times_Italic Times_Bold Times_BoldItalic"
  985.  
  986. ********
  987. ******** Other environments ********
  988. ********
  989.  
  990. QNX
  991. ---
  992.  
  993. The following notes are from John "Stosh" Muczynski, <STOSH@bauer.usa.com>.
  994. He is willing to answer questions as his time permits.  He used the Watcom
  995. C16 compiler, version 9.5, with QNX version 4.20B.  He had to modify the
  996. following files:
  997.  
  998. SYS/PARAM.H
  999. Watcom doesn't supply a sys/param.h file.  I defined it as
  1000. --------------------------------clip here 
  1001. ------------------------------
  1002. /* CLK_TCK is used with the times() function and is defined in times.h 
  1003. */
  1004. #define HZ (CLK_TCK)
  1005. --------------------------------clip here 
  1006. ------------------------------
  1007. It seems that HZ should be 1000 for QNX and not 100.  The times() 
  1008. function appears to be POSIX 1003.1
  1009.  
  1010.  
  1011.  
  1012. UNIXHEAD.MAK
  1013. I modified unixhead.mak to support a qnx_ platform.
  1014. --------------------------------clip here 
  1015. ------------------------------
  1016. PLATFORM=qnx_
  1017. --------------------------------clip here 
  1018. ------------------------------
  1019.  
  1020.  
  1021. UNIXTAIL.MAK
  1022. I modified unixtail.mak to support a qnx_ platform.
  1023. --------------------------------clip here 
  1024. ------------------------------
  1025. # QNX 4.X
  1026. qnx__=gp_nofb.$(OBJ) gp_unix.$(OBJ) gp_qnx.$(OBJ) gp_qnxfs.$(OBJ) 
  1027. gp_unifn.$(OBJ)
  1028. qnx_.dev: $(qnx__)
  1029.     $(SETMOD) qnx_ $(qnx__)
  1030.  
  1031. gp_qnx.$(OBJ): gp_qnx.c $(time__h) $(AK)
  1032.  
  1033. gp_qnxfs.$(OBJ): gp_qnxfs.c $(AK) $(memory__h) $(string__h) $(gx_h) 
  1034. $(gp_h) \
  1035.   $(gsstruct_h) $(gsutil_h) $(stat__h) $(dirent__h)
  1036. --------------------------------clip here 
  1037. ------------------------------
  1038. The change here is to copy the "sysv_" make lines into "qnx_" 
  1039. make lines and change (1) gp_sysv.* to gp_qnx.* and (2) gp_unifs.* 
  1040. to gpqnxfs.*
  1041.  
  1042. I copied the gp_sysv.c source to gp_qnx.c and (a) deleted rename() 
  1043. because it is supported by the watcom compiler, (b) kept 
  1044. gettimeofday(), (c) added the gp_open_scratch_file() which doesn't 
  1045. use mktemp().
  1046.  
  1047. I copied gp_unifs.c to gp_qnxfs.c and deleted the 
  1048. gp_open_scratch_file() because it uses mktemp() which watcom 
  1049. does not provide.  Watcom does provide a tmpnam(char *buffer) 
  1050. function and more interestingly a FILE *tmpfile(void) function.  
  1051. If you ask I can fax you the manual pages.
  1052.  
  1053.  
  1054. ANSIHEAD.MAK
  1055.  
  1056. Compiler options:
  1057. -----------------
  1058. I used the Bauer "standard" options for compiling and linking under 
  1059. QNX:
  1060. --------------------------------clip here 
  1061. ------------------------------
  1062. CFLAGS=-O -w4 -3 -mf $(XCFLAGS)
  1063. LDFLAGS=-3 -N 64k -O -g -w3 -mf -fF $(XLDFLAGS)
  1064. --------------------------------clip here 
  1065. ------------------------------
  1066. -N 64k gives a big stack size; I don't know if its necessary.
  1067. The -mf on CFLAGS and LDFLAGS is very necessary (32-bit flat memory 
  1068. model).
  1069. The -3 and -O and -g and -w3 and -w4 are just fluff.
  1070. The -fF option doesn't make sense to me.
  1071.  
  1072. ********
  1073. ******** A guide to the files ********
  1074. ********
  1075.  
  1076. General
  1077. -------
  1078.  
  1079. There are very few machine dependencies in Ghostscript.  A few of the .c
  1080. files are machine-specific.  These have names of the form
  1081.     gp_<platform>.c
  1082. specifically
  1083.     gp_dosfb.c (MS-DOS)
  1084.     gp_dosfs.c (MS-DOS and MS Windows)
  1085.     gp_itbc.c (MS-DOS, Borland compilers)
  1086.     gp_iwatc.c (MS-DOS, Watcom or Microsoft compiler)
  1087.     gp_msdos.c (MS-DOS and MS Windows)
  1088.     gp_ntfs.c (MS-Windows Win32s and Windows NT)
  1089.     gp_os2.c (OS/2)
  1090.     gp_os9.c (OS-9)
  1091.     gp_unifs.c (Unix or OS-9)
  1092.     gp_unix.c (Unix)
  1093.     gp_sysv.c (System V Unix)
  1094.     gp_vms.c (VMS)
  1095.     gp_win32.c (MS-Windows Win32s and Windows NT)
  1096. There are also some machine-specific conditionals in files with names
  1097. <something>_.h.  If you are going to extend Ghostscript to new
  1098. machines or operating systems, you should check the *_.h files for
  1099. ifdef's on things other than DEBUG, and you should probably count on
  1100. making a new makefile and a new gp_ file.
  1101.  
  1102. Library
  1103. -------
  1104.  
  1105. Files beginning with gs, gx, or gz (both .c and .h), other than gs.c
  1106. and gsmain.c, are the Ghostscript library.  Files beginning with gdev
  1107. are device drivers or related code, also part of the library.  Other
  1108. files beginning with g are library files that don't fall neatly into
  1109. either the kernel or the driver category.
  1110.  
  1111. Interpreter
  1112. -----------
  1113.  
  1114. gs.c is the main program for the interactive language interpreter;
  1115. gsmain.c is the top level of initialization code.  If you configure
  1116. Ghostscript as a server rather than an interactive program, you will use
  1117. gsmain.c but not gs.c.
  1118.  
  1119. Files named z*.c are Ghostscript operator files.  The names of the files
  1120. generally follow the section headings of the operator summary in section
  1121. 6.2 of the PostScript manual.
  1122.  
  1123. Files named i*.c, and *.h other than g*.h, are the rest of the
  1124. interpreter.  See the makefile for a little more information on how the
  1125. files are divided functionally.
  1126.  
  1127. Files named s*.c are a flexible stream package, including the Level 2
  1128. PostScript 'filters' supported by Ghostscript.
  1129.