home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / clipart / gs22.zip / MAKE.DOC < prev    next >
Text File  |  1991-05-11  |  16KB  |  379 lines

  1.    Copyright (C) 1989, 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.
  19.  
  20. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22. This file, make.doc, describes how to install Ghostscript, and how to
  23. build Ghostscript executables from source.
  24.  
  25. For an overview of Ghostscript and a list of the documentation files, see
  26. README.
  27.  
  28. ********
  29. ******** Installing Ghostscript
  30. ********
  31.  
  32. To install the interpreter, you need:
  33.     - The interpreter executable:
  34.         - On MS-DOS and VMS systems, gs.exe.
  35.         - On Unix systems, gs.
  36.     - The interpreter initialization files, gs_init.ps, gs_statd.ps,
  37.       gs_fonts.ps, and symbol_e.ps.
  38.     - The font map, Fontmap.
  39.     - The default font, uglyr.gsf.
  40.  
  41. See use.doc for a description of the search algorithm used to find these
  42. files.
  43.  
  44. You do not need any of these files when using the library; however, the
  45. library currently provides no way to install fonts.  This is obviously
  46. ridiculous and will be fixed sometime in the future.
  47.  
  48. ********
  49. ******** Building Ghostscript from source
  50. ********
  51.  
  52. Ghostscript is generally distributed in the form of a compressed tar file.
  53. When unpacked, this file puts all the Ghostscript files in a directory
  54. called gs.  Ghostscript is also available in the form of a PC-compatible
  55. ZIP file.
  56.  
  57. Ghostscript is described by a collection of several makefiles:
  58.  
  59.     ghost.mak - a generic makefile used on all platforms (except VMS).
  60.     gdevs.mak - a makefile listing all the device drivers.
  61.     *.mak - the makefiles for specific platforms.
  62.  
  63. You may need to edit the platform-specific makefile if you wish to change
  64. any of the following options:
  65.  
  66.     - The default search path(s) for the initialization and font files
  67. (macro GS_LIB_DEFAULT);
  68.  
  69.     - The debugging options (macro GENOPT);
  70.  
  71.     - The set of device drivers to be included (macros DEVICES,
  72. DEVICE_DEVS, and DEVICE_OBJS);
  73.  
  74.     - The set of optional features to be included (macro FEATURES).
  75. Currently no such features are defined; this is a place-holder.
  76.  
  77. The platform-specific makefile will include comments describing all of
  78. these items except the DEVICE* options.  The DEVICE* options are described
  79. in gdevs.mak, even though the file that must be edited is the
  80. platform-specific makefile.
  81.  
  82. The makefiles distributed with Ghostscript define these options as
  83. follows:
  84.  
  85.     - GS_LIB_DEFAULT: on Unix systems, the current directory at build
  86. time; on MS-DOS systems, C:\GS.
  87.  
  88.     - GENOPT: no debugging code included in the build.
  89.  
  90.     - DEVICES/DEVICE_DEVS/DEVICE_OBJS: platform-specific, see below.
  91.  
  92.     - FEATURES: none.
  93.  
  94. There are also platform-specific options described below under the
  95. individual platforms.  See the "Options" section near the beginning of the
  96. relevant makefile for more information.
  97.  
  98. If you are including a dot-matrix printer driver, you may wish to
  99. customize the density parameters in gdevs.mak.
  100.  
  101. To build the interpreter, you need all the .h and .c files (and .asm files
  102. for MS-DOS) included in the distribution, as well as the makefiles.
  103.  
  104. The command
  105.     make clean
  106. removes all the files created by the build process (relocatables,
  107. executables, and miscellaneous scratch files).  If you want to save the
  108. executable, you should move it to another directory first.
  109.  
  110. ********
  111. ******** How to build Ghostscript from source (MS-DOS version) ********
  112. ********
  113.  
  114. The makefile distributed with Ghostscript selects the following devices
  115. for inclusion in the build:
  116.  
  117.     VGA and EGA display drivers;
  118.     Epson dot matrix printer at 120 x 60 DPI;
  119.     H-P DeskJet and LaserJet.
  120.  
  121. To build Ghostscript, you need one of the Borland C/C++ development
  122. systems, either Turbo C (version 2.0 or later) or Turbo C++ or Borland C++
  123. (version 1.0 or later); specifically, the compiler, 'make' utility, and
  124. linker.  You also need either the Borland assembler (version 1.0 or later)
  125. or the Microsoft assembler (version 4.0 or later).  Before compiling or
  126. linking, you should execute
  127.  
  128.     echo !include "turboc.mak" >makefile
  129. (for Turbo C), or
  130.     echo !include "tbcplus.mak" >makefile
  131. (for Turbo C++ or Borland C++).
  132.  
  133. Besides the source files and the makefiles, you need:
  134.     turboc.cfg (the flags and switches for Turbo C)
  135.     gt.tr (the linker commands for the library test program - optional)
  136.     gs.tr (the linker commands for the interpreter)
  137.  
  138. There are extensive comments in the file msdos.mak regarding various
  139. configuration parameters.  If your configuration is different from the
  140. following, you should definitely read those comments and see if you want
  141. or need to change any of the parameters:
  142.     - The compiler files are in c:\tc (for Turbo C) or c:\bc (for
  143. Turbo C++ or Borland C++) and its subdirectories.
  144.     - You are using the Borland assembler (tasm).
  145.     - You want an executable that will run on any PC-compatible,
  146. regardless of processor type (8088, 8086, V20, 80186, 80286, V30, 80386,
  147. 80486) and regardless of whether a math coprocessor (80x87) is present.
  148.  
  149. As noted above, the default configuration also generates an executable
  150. that assumes the directory where 'make' was run should be the final
  151. default directory for looking up the Ghostscript initialization and font
  152. files.
  153.  
  154. To build the Ghostscript executable, all you need to do is give the
  155. command
  156.     make
  157.  
  158. There is a special 'make' target that simply attempts to compile all the
  159. .c files in the current directory.  Some of these compilations will fail,
  160. but the ones that succeed will go considerably faster, because they don't
  161. individually pay the overhead of loading the compiler into memory.  So a
  162. good strategy for building the executable for the first time, or after a
  163. change to a very widely used .h file, is:
  164.     make begin
  165. and then
  166.     make
  167. to do the compilations that failed the first time.
  168.  
  169. Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
  170. the file on a MS-DOS machine, the files will all have linefeed instead of
  171. carriage return + linefeed as the line terminator, which will make the C
  172. compiler unhappy.  I don't know the simplest way to fix this: just reading
  173. each file into an editor and writing it back out again may be sufficient.
  174.  
  175. ********
  176. ******** How to build Ghostscript from source (Unix version) ********
  177. ********
  178.  
  179. The makefile distributed with Ghostscript selects the following devices
  180. for inclusion in the build:
  181.     X Windows driver only.
  182.  
  183. Before compiling or linking, you should execute
  184.  
  185.     cp unix-cc.mak makefile
  186. or    cp unix-gcc.mak makefile
  187.  
  188. If the X11 client header files are located in some directory which your
  189. compiler does not automatically search, you must change the X11 entry in
  190. the makefile to include a specific -I switch.  See the comment just before
  191. the entry for gdevx.$(OBJ) in your chosen makefile.
  192.  
  193. The only important customization of the X11 driver is the choice of
  194. whether or not to use a backing pixmap.  If you use a backing pixmap,
  195. Ghostscript windows will redisplay properly when they are covered and
  196. exposed, but drawing operations will go slower.  This choice is controlled
  197. by a line in the file gdevx.c that says
  198.     private int use_backing = 1;
  199. Changing this line to read
  200.     private int use_backing = 0;
  201. will disable the use of a backing pixmap.  However, portions of the
  202. Ghostscript window may not be properly redrawn after the window is
  203. restored from an icon or exposed after being occluded by another window.
  204.  
  205. Some versions of the X server do not implement tiling properly.  This will
  206. show up as broad bands of color where dither patterns should appear.  If
  207. this happens, change
  208.     #define use_XSetTile 1
  209. to
  210.     #define use_XSetTile 0
  211. and recompile.  The result will run a lot slower, but the output will be
  212. correct.  (Report the problem to whoever made your X server.)
  213.  
  214. Currently Ghostscript is set up to compile and link in a generic Unix
  215. environment.  Some Unix environments may require changing the LDPLAT macro
  216. in the makefile.
  217.  
  218. All you need to do to make an executable is invoke the shell command
  219.     make
  220.  
  221. Ghostscript uses ANSI syntax for function definitions. Because of this,
  222. when compiling with cc, it must preprocess each .c file to convert it to
  223. the older syntax defined in Kernighan and Ritchie, which is what almost
  224. all current Unix compilers (other than gcc) support.  This step is
  225. automatically performed by a utility called ansi2knr, which is included in
  226. the Ghostscript distribution.  The makefile automatically builds ansi2knr.
  227.  
  228. The ansi2knr preprocessing step is included in the makefile rule for
  229. compiling .c files.  ansi2knr creates a file called _temp_.c to hold the
  230. converted code.  If you want to change this name for some reason, it is
  231. defined in unix-cc.mak.
  232.  
  233. Platform-specific notes
  234. -----------------------
  235.  
  236. There is apparently a bug in the MIPS C compiler which causes gxdither.c
  237. to compile incorrectly if optimization is enabled (-O).  Until a
  238. work-around is found, do not use -O with the MIPS C compiler.
  239.  
  240. On the Apollo, you must run the compiler in ANSI-compatible mode (i.e.,
  241. set AK= <null string> in the makefile); otherwise, it gives incorrect
  242. error messages for any function declared as returning a float value.
  243.  
  244. Due to a compiler bug, if you are building Ghostscript on an Intel 80386
  245. system using a version of gcc older than version 1.38, you must not use
  246. the -O option.
  247.  
  248. GNU make 3.59 can't handle the final linking step in some cases; use the
  249. platform's standard make (e.g., /bin/make) if this happens.
  250.  
  251. ********
  252. ******** How to build Ghostscript from source (VAX/VMS version) ********
  253. ********
  254.  
  255. The files VMS-CC.MAK and VMS-GCC.MAK are VMS DCL command files which
  256. build Ghostscript from scratch using either the DEC C compiler, CC, or
  257. the Free Software Foundation's GNU C compiler, GCC.  Accordingly, you
  258. must have one of these two compilers installed in order to build
  259. Ghostscript.  (Other C compilers may work: CC and GCC are the only two
  260. compilers tested to date.)  These two command files build and store
  261. the Ghostscript library in the object library GS.OLB.  If you have
  262. DECwindows (X11) installed on your system, the executable images GS.EXE,
  263. GT.EXE, and XLIB.EXE will also be built.
  264.  
  265. The only important customization of the X11 driver is the choice of
  266. whether or not to use a backing pixmap.  If you use a backing pixmap,
  267. Ghostscript windows will redisplay properly when they are covered and
  268. exposed, but drawing operations will go slower.  This choice is controlled
  269. by the line in the file gdevx.c that reads
  270.     private int use_backing = 1;
  271. Changing this line to read
  272.     private int use_backing = 0;
  273. will disable the use of a backing pixmap.  However, portions of the
  274. Ghostscript window may not be properly redrawn after the window is
  275. restored from an icon or exposed after being occluded by another window.
  276.  
  277. Some versions of the X server do not implement tiling properly.  This will
  278. show up as broad bands of color where dither patterns should appear.  If
  279. this happens, change
  280.     #define use_XSetTile 1
  281. to
  282.     #define use_XSetTile 0
  283. and recompile.  The result will run a lot slower, but the output will be
  284. correct.  Report the problem to DEC, or whoever made your X server.
  285.  
  286. Ghostscript uses ANSI syntax for function definitions. Thus, when using
  287. the DEC C compiler, each .C file is converted to the older C syntax defined
  288. in the first edition of Kernighan and Ritchie and stored in a .CC file.
  289. This step is performed by VMS-CC.MAK using the ansi2knr utility included
  290. in the Ghostscript distribution.  If you are building a debuggable
  291. configuration, the .CC files will be left behind by VMS-CC.MAK for use by
  292. the VMS Debugger; otherwise, they will be deleted.
  293.  
  294. If you have DEC's C compiler, issue the DCL command
  295.         $ @VMS-CC.MAK
  296. to build Ghostscript.  If you have GNU C, issue the DCL command
  297.         $ @VMS-GCC.MAK
  298. to build Ghostscript.
  299.  
  300. The option "DEBUG" may be specified with either command file in order to
  301. build a debuggable Ghostscript configuration:
  302.         $ @VMS-CC.MAK DEBUG    -or-   $ @VMS-GCC.MAK DEBUG
  303.  
  304. In order to specify switches and file names when invoking the interpreter,
  305. define GS as a foreign command:
  306.         $ GS == "$disk:[directory]GS.EXE"
  307. where "disk" and "directory" specify the disk and directory where Ghostscript
  308. is located.  For instance,
  309.         $ GS == "$DUA1:[GHOSTSCRIPT]GS.EXE"
  310. To allow the interpreter to be run from any directory, define the logical
  311. GS_LIB which points to the Ghostscript directory
  312.         $ DEFINE GS_LIB disk:[directory]
  313. This allows Ghostscript to locate its initialization files stored in the
  314. Ghostscript directory -- see use.doc for further details.  Finally, to
  315. invoke the interpreter, merely type GS.  Although DCL normally converts
  316. unquoted parameters to upper case, C programs receive their parameters in
  317. lower case.  That is, the command
  318.         $ GS -Isys$login:
  319. passes the switch "-isys$login" to the interpreter.  To preserve the
  320. case of switches, enclose them in double quotes; e.g.,
  321.         $ GS "-Isys$login:"
  322.  
  323. ********
  324. ******** A guide to the files ********
  325. ********
  326.  
  327. General
  328. -------
  329.  
  330. There are very few machine dependencies in Ghostscript.  A few of the .c
  331. files are machine-specific.  These have names of the form
  332.     gp_<platform>.c
  333. specifically
  334.     gp_dos.c
  335.     gp_unix.c
  336.     gp_vms.c
  337. There are also some machine-specific conditionals in files with names
  338. <something>_.h, and in gdevmem.c.  If you are going to extend Ghostscript
  339. to new machines or operating systems, you should check all the source
  340. files (both .c and .h) for ifdef's on things other than DEBUG, and you
  341. should probably count on making a new makefile and a new gp_ file.
  342.  
  343. Library
  344. -------
  345.  
  346. gt.c is a test driver for the library.
  347.  
  348. Files beginning with gs, gx, or gz (both .c and .h), other than gs.c, are
  349. the Ghostscript library.  Files beginning with gdev are device drivers or
  350. related code, also part of the library.  Other files beginning with g are
  351. library files that don't fall neatly into either the kernel or the driver
  352. category.
  353.  
  354. Interpreter
  355. -----------
  356.  
  357. gs.c is the main program for the language interpreter.
  358.  
  359. Files beginning with z are Ghostscript operator files.  The names of the
  360. files generally follow the section headings of the operator summary in
  361. section 6.2 of the PostScript manual.  Files beginning with z2 implement
  362. Level 2 operators, which are not automatically included in the
  363. interpreter.
  364.  
  365. .c files beginning with i, and .h files not beginning with g, are the
  366. rest of the interpreter.  Those beginning with i2 provide Level 2
  367. functions.  See the makefile for a little more information on how the
  368. files are divided functionally.
  369.  
  370. There are a few files that are logically part of the interpreter, but that
  371. are potentially useful outside Ghostscript, whose names don't begin with
  372. either g, z, or i:
  373.  
  374.     stream.c (a stream package that is only necessary because neither
  375. Unix C nor Turbo C provides source code for their file system library);
  376.  
  377.     trace.c (a procedure tracing package for debugging) and utrace.c
  378. (the Unix stub for trace.c).
  379.