Make.htm 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title>How to build Ghostscript from source code</title>
  5. <!-- $Id: Make.htm,v 1.90 2005/10/20 19:46:23 ray Exp $ -->
  6. <!-- Originally: make.txt -->
  7. <link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
  8. </head>
  9. <body>
  10. <!-- [1.0 begin visible header] ============================================ -->
  11. <!-- [1.1 begin headline] ================================================== -->
  12. <h1>How to build Ghostscript from source code</h1>
  13. <!-- [1.1 end headline] ==================================================== -->
  14. <!-- [1.2 begin table of contents] ========================================= -->
  15. <h2>Table of contents</h2>
  16. <blockquote><ul>
  17. <li><a href="#General_overview">General overview</a>
  18. <li><a href="#Acquiring">How to acquire the source code</a>
  19. <ul>
  20. <li><a href="#Ghostscript_source">Ghostscript source code</a>
  21. <li><a href="#Third-party_libraries">Third-party library source code</a>
  22. </ul>
  23. <li><a href="#Unpack">How to unpack the source code</a>
  24. <ul>
  25. <li><a href="#Tarfiles">How to unpack compressed tar files generally</a>
  26. <li><a href="#Zipfiles">How to unpack zip files generally</a>
  27. <li><a href="#Unpack_Ghostscript">How to unpack Ghostscript itself</a>
  28. <li><a href="#Unpack_libraries">How to unpack the third-party libraries</a>
  29. </ul>
  30. <li><a href="#Bug_check">How to check for post-release bug fixes</a>
  31. <li><a href="#Makefile_overview">How to prepare the makefiles</a>
  32. <ul>
  33. <li><a href="#Preparing_makefiles">Changes for your environment</a>
  34. <li><a href="#Features_and_devices">Selecting features and devices</a>
  35. <ul>
  36. <li><a href="#Precompiled_data">Precompiled run-time data</a>
  37. <li><a href="#GNU_readline">GNU readline</a>
  38. </ul>
  39. <li><a href="#Makefile_setup">Setting up "makefile"</a>
  40. <li><a href="#Invoke_make">Invoking "make"</a>
  41. <li><a href="#Cross-compiling">Cross-compiling</a>
  42. </ul>
  43. <li><a href="#PC_build">How to build Ghostscript from source (PC version)</a>
  44. <ul>
  45. <li><a href="#Borland_build">Borland/Inprise environment</a>
  46. <li><a href="#Microsoft_build">Microsoft environment</a>
  47. <li><a href="#Microsoft_build_64">Microsoft environment 64-bit</a>
  48. <li><a href="#Self-extracting_executables">Making self-extracting executables</a>
  49. <li><a href="#Watcom_build">Watcom environment</a>
  50. <li><a href="#Cygwin32_build">Cygwin32 gcc</a>
  51. <li><a href="#IntelWin32_build">Intel C/C++ compiler</a>
  52. </ul>
  53. <li><a href="#Mac_build">How to build Ghostscript from source (MacOS version)</a>
  54. <ul>
  55. <li><a href="#MacOS">Traditional MacOS</a>
  56. <li><a href="#MacOSX">MacOS X</a>
  57. </ul>
  58. <li><a href="#Unix_build">How to build Ghostscript from source (Unix version)</a>
  59. <ul>
  60. <li><a href="#Multi_architecture_makefile">The multi-architecture makefile</a>
  61. <li><a href="#UNIX_makefile">Setting up "makefile"</a>
  62. <li><a href="#Shared_object">Shared object</a>
  63. <li><a href="#Tool_specific_issues">Tool-specific issues</a>
  64. <ul>
  65. <li><a href="#gcc_27x">gcc 2.7.*</a>
  66. <li><a href="#GNU_make">GNU make</a>
  67. </ul>
  68. <li><a href="#OS_specific_issues">OS-specific issues</a>
  69. <ul>
  70. <li><a href="#386_Unix">386 Unix</a>
  71. <li><a href="#BSDI">BSDI</a>
  72. <li><a href="#Digital_Unix">Digital Unix (Alpha)</a>
  73. <li><a href="#Linux">Linux</a>
  74. <li><a href="#NeXTSTEP">NeXTSTEP / OpenSTEP</a>
  75. <li><a href="#SCO">SCO Unix/Xenix</a>
  76. <li><a href="#SVR4">SVR4 Unix</a>
  77. <li><a href="#System_V">System V Unix platforms</a>
  78. <li><a href="#Unixware">Unixware</a>
  79. </ul>
  80. <li><a href="#Hardware_specific_issues">Hardware-specific issues</a>
  81. <ul>
  82. <li><a href="#Alpha_with_gcc">Alpha with gcc</a>
  83. <li><a href="#Apollo">H-P Apollo</a>
  84. <li><a href="#ATT_7040">AT&amp;T 7040 R3</a>
  85. <li><a href="#Convex">Convex</a>
  86. <li><a href="#DECStations">DECStations with Ultrix</a>
  87. <li><a href="#HP_RISC">H-P RISC workstations</a>
  88. <li><a href="#Intergraph">Intergraph Clipper</a>
  89. <li><a href="#MIPS">MIPS</a>
  90. <li><a href="#NCR_3550">NCR 3550</a>
  91. <li><a href="#Pyramid">Pyramid MIServer-S</a>
  92. <li><a href="#RS6000">IBM RS/6000 with AIX</a>
  93. <li><a href="#Silicon_Graphics">Silicon Graphics</a>
  94. <li><a href="#Sun">Sun</a>
  95. <li><a href="#SunOS">SunOS</a>
  96. <li><a href="#Solaris">Solaris</a>
  97. <li><a href="#VAX_Ultrix">VAX with Ultrix</a>
  98. </ul>
  99. </ul>
  100. <li><a href="#OS2_build">How to build Ghostscript from source (OS/2 version)</a>
  101. <li><a href="#VMS_build">How to build Ghostscript from source (OpenVMS version)</a>
  102. <ul>
  103. <li><a href="#GNU_make_VMS">Building with GNU make on OpenVMS</a>
  104. <li><a href="#MMK_MMS_VMS">Building with MMK or MMS on OpenVMS</a>
  105. </ul>
  106. <li><a href="#Other_environments">Other environments</a>
  107. <ul>
  108. <li><a href="#No_multi_thread">Environments lacking multi-threading</a>
  109. <li><a href="#Plan_9">Plan 9</a>
  110. <li><a href="#QNX">QNX</a>
  111. </ul>
  112. <li><a href="#UFST_build">How to build Ghostscript with UFST</a>
  113. <li><a href="#FT_build">How to build Ghostscript with Free Type</a>
  114. </ul></blockquote>
  115. <!-- [1.2 end table of contents] =========================================== -->
  116. <!-- [1.3 begin hint] ====================================================== -->
  117. <p>For other information, see the <a href="Readme.htm">Ghostscript
  118. overview</a> and the instructions on how to <a href="Install.htm">install
  119. Ghostscript</a>.
  120. <!-- [1.3 end hint] ======================================================== -->
  121. <hr>
  122. <!-- [1.0 end visible header] ============================================== -->
  123. <!-- [2.0 begin contents] ================================================== -->
  124. <h2><a name="General_overview"></a>General overview</h2>
  125. <p>
  126. This document describes how to build a Ghostscript executable from source
  127. code. There are four major steps to building Ghostscript:
  128. <ol>
  129. <li>Acquire the compressed archive files of source code for Ghostscript and
  130. the required third-party libraries.
  131. <li>Unpack the archive files into the Ghostscript directory and correctly
  132. named subdirectories.
  133. <li>Configure the build to match your system and desired configuration options.
  134. <li>Invoke "<b><tt>make</tt></b>" to build the software.
  135. </ol>
  136. <p>
  137. The remainder of this document describes each of these steps in detail.
  138. Note that some of this process is platform-dependent. After building
  139. Ghostscript you must then install it; for that, see the
  140. <a href="Install.htm">installation instructions</a>.
  141. <hr>
  142. <h2><a name="Acquiring"></a>How to acquire the source code</h2>
  143. <p>
  144. Building Ghostscript requires the Ghostscript source code itself, and also
  145. the source code for some third-party libraries that Ghostscript uses.
  146. <h3><a name="Ghostscript_source"></a>Ghostscript source code</h3>
  147. <p><a name="Authoritative_distribution_site"></a>
  148. There are two kinds of Ghostscript distributions available, called "AFPL
  149. Ghostscript" and "GPL Ghostscript"; the distinction between them is
  150. explained in the <a href="Commprod.htm">conditions for distributing
  151. Ghostscript</a>. The authoritative distribution site for AFPL
  152. Ghostscript is
  153. <blockquote>
  154. <a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/"
  155. class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/</a>gs###
  156. </blockquote>
  157. <p>
  158. where "###" is the unpunctuated version number. GPL Ghostscript is
  159. available from the same site at
  160. <blockquote>
  161. <a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/"
  162. class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/</a>
  163. </blockquote>
  164. <p>
  165. Ghostscript source code is packaged in two different formats:
  166. gzip-compressed tar files (*<b><tt>.tar.gz</tt></b>) and zip files
  167. (*<b><tt>.zip</tt></b>). For all versions there are gzip-compressed tar
  168. files:
  169. <blockquote>
  170. <b><tt>ghostscript-</tt></b>#.##<b><tt>.tar.gz</tt></b><br>
  171. <b><tt>ghostscript-fonts-std-</tt></b>#.##<b><tt>.tar.gz</tt></b><br>
  172. <b><tt>ghostscript-fonts-other-</tt></b>#.##<b><tt>.tar.gz</tt></b>
  173. </blockquote>
  174. <p>For recent versions of Ghostscript there are also zip files
  175. <blockquote>
  176. <b><tt>gs</tt></b>###<b><tt>src.zip</tt></b><br>
  177. <b><tt>gs</tt></b>###<b><tt>w32.exe</tt></b>
  178. </blockquote>
  179. <p>
  180. ("#.##" and "###" are version numbers in punctuated and unpunctuated form.)
  181. Software to decompress and extract both formats is available for almost
  182. every platform for which Ghostscript is available -- including Unix, DOS,
  183. MS Windows, and VMS -- so you can choose the format most convenient for
  184. you; but it's up to you to locate that software. See the section on <a
  185. href="#Unpack">unpacking the source code</a>.
  186. <h3><a name="Third-party_libraries"></a>Third-party library source code</h3>
  187. <p>
  188. To build Ghostscript you need the source code for the <a
  189. href="http://www.ijg.org/">Independent JPEG Group</a> (IJG) library, the
  190. <a href="http://www.libpng.org/pub/png/">Portable Network Graphics</a>
  191. (PNG)
  192. library, and the <a
  193. href="http://www.gzip.org/zlib/">zlib</a>
  194. compression and decompression library. The default build also expects source
  195. for the <a href="http://jbig2dec.sourceforge.net">jbig2dec</a> JBIG2 decompression
  196. library.
  197. <p>
  198. On Windows and MacOS, the .zip and .sit source archives include the appropriate
  199. source versions of these libraries, so no additional downloads are necessary.
  200. Unix tarballs may also contain appropriate library source; the configure script
  201. will tell you if it cannot find the appropriate libraries.
  202. <p>
  203. Here are authoritative distribution points for these libraries, should you need
  204. to obtain the source yourself. As elsewhere, "#" is used for version
  205. numbers. The JPEG source code is quite stable, so the reference
  206. here includes the latest version number. Versions of the zlib source are
  207. not compatible between the 1.1.x and 1.2.x series; if you wish to
  208. compile in zlib (as opposed to linking to a separately build dynamic
  209. library) you must use a 1.2.x version.
  210. <blockquote><table cellpadding=0 cellspacing=0>
  211. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Third-party libraries: authoritative sources</font><hr>
  212. <tr> <td valign=top>JPEG
  213. <td>&nbsp;&nbsp;&nbsp;
  214. <td><a href="ftp://ftp.uu.net/graphics/jpeg/"
  215. class="offsite">ftp://ftp.uu.net/graphics/jpeg/</a><a
  216. href="ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz"
  217. class="offsite">jpegsrc.v6b.tar.gz</a><br>
  218. <a href="ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/"
  219. class="offsite">ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/</a><a
  220. href="ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6b.zip">jpegsr6b.zip</a>
  221. <tr> <td valign=top>PNG
  222. <td>&nbsp;
  223. <td><a href="http://www.libpng.org/pub/png/src/"
  224. class="offsite">http://www.libpng.org/pub/png/src/</a>libpng-#.#.#.tar.gz<br>
  225. <a href="http://www.libpng.org/pub/png/src/"
  226. class="offsite">http://www.libpng.org/pub/png/src/</a>lpng###.zip<br>
  227. <a href="ftp://swrinde.nde.swri.edu/pub/png/src/"
  228. class="offsite">ftp://swrinde.nde.swri.edu/pub/png/src/</a>libpng-#.#.#.tar.gz<br>
  229. <a href="ftp://swrinde.nde.swri.edu/pub/png/src/"
  230. class="offsite">ftp://swrinde.nde.swri.edu/pub/png/src/</a>lpng###.zip
  231. <tr> <td valign=top>zlib (latest)
  232. <td>&nbsp;
  233. <td> <a href="http://www.gzip.org/zlib/zlib-1.2.1.tar.gz"
  234. class="offsite">http://www.gzip.org/zlib/zlib-1.2.1.tar.gz</a><br>
  235. <a href="http://www.gzip.org/zlib/zlib121.zip"
  236. class="offsite">http://www.gzip.org/zlib/zlib121.zip</a><br>
  237. See the <a href="http://www.gzip.org/zlib/">official website</a>
  238. for a list of mirrors.
  239. <tr> <td valign=top>jbig2dec
  240. <td>&nbsp;
  241. <td> <a href="http://sourceforge.net/project/showfiles.php?group_id=28301"
  242. class="offsite">http://sourceforge.net/project/showfiles.php?group_id=28301</a><br>
  243. </table></blockquote>
  244. <p>
  245. On DOS or MS Windows one ordinarily uses the zip file kits, in other
  246. environments the compressed tar files, but this is simply a matter of
  247. convenience, since for the same version of the software the compressed tar
  248. file has the same contents as the zip file. Note that each of these
  249. libraries has <b><em>its own version number</em></b> that has
  250. <b><em>nothing to do with Ghostscript's version number</em></b>; you should
  251. get the highest numbered version. (If you encounter difficulties in the
  252. build process you might have to use a lower-numbered version, but don't
  253. worry about this yet.) If you're running Linux, you might check whether
  254. these libraries are already available in source form on your system, since
  255. many Linux distributors include them; but we advise you to get the highest
  256. version from the Net if you can.
  257. <hr>
  258. <h2><a name="Unpack"></a>How to unpack the source code</h2>
  259. <p>
  260. Unfortunately there are no generally accepted standards for how to package
  261. source code into archives, so the instructions for unpacking Ghostscript are
  262. longer than they should be. We begin with a brief explanation of how to
  263. extract the two kinds of archive files.
  264. <h3><a name="Tarfiles"></a>How to unpack compressed tar files generally</h3>
  265. <p>
  266. Tar (<b><tt>.tar</tt></b>) files are the <em>de facto</em> standard for
  267. archiving files on Unix (every Unix system has the <b><tt>tar</tt></b>
  268. program), and programs to extract their contents are also widely available
  269. for DOS, MS Windows, and VMS. To economize on space and downloading time,
  270. Ghostscript's tar files are compressed with GNU <b><tt>gzip</tt></b>, which
  271. adds the suffix "<b><tt>.gz</tt></b>" to the file name, giving
  272. "<b><tt>.tar.gz</tt></b>".
  273. <p>
  274. To unpack a compressed tar file <b><tt>MyArchive.tar.gz</tt></b> you
  275. must both decompress it and extract the contents. You can do this in two
  276. steps, one to decompress the file and another to unpack it:
  277. <blockquote>
  278. <b><tt>gzip -d MyArchive.tar.gz</tt></b>
  279. <br><b><tt>tar -xf MyArchive.tar</tt></b>
  280. </blockquote>
  281. <p>
  282. or in a pipeline:
  283. <blockquote>
  284. <b><tt>gzip -d -c MyArchive.tar.gz | tar -xf -</tt></b>
  285. </blockquote>
  286. <p>
  287. or, if you have a program like GNU <b><tt>tar</tt></b> that can handle
  288. compressed tar files, with a single command:
  289. <blockquote>
  290. <b><tt>tar -zxf MyArchive.tar.gz</tt></b>
  291. </blockquote>
  292. <p>
  293. The <b><tt>tar</tt></b> program automatically preserves directory structure
  294. in extracting files. The Ghostscript source archive puts all files under a
  295. directory <b><tt>gs</tt></b>#.##, so using <b><tt>tar</tt></b> to unpack a
  296. compressed archive should always properly create that directory, which we
  297. will call the "gs directory". Make sure you're positioned in the
  298. <b><em>parent</em></b> of the gs directory <b><em>before</em></b> unpacking
  299. the files. If a subdirectory doesn't already exist, <b><tt>tar</tt></b>
  300. creates it.
  301. <p>
  302. Some other programs -- under MS Windows, for instance -- can also unpack
  303. compressed tar files, but they may not automatically preserve directory
  304. structure nor even extract files into the current directory. If you use
  305. one of these, you must
  306. <ul>
  307. <li>set the program's options to "Use folder names" or the equivalent, and
  308. <li>check that it is extracting files into the right place.
  309. </ul>
  310. <h3><a name="Zipfiles"></a>How to unpack zip files generally</h3>
  311. <p>
  312. Zip files are the <em>de facto</em> standard for archiving files on DOS and
  313. MS Windows, and programs to extract their contents are widely available for
  314. DOS, MS Windows, Unix, VMS, and other platforms. Zip files are at once an
  315. archive format and a compressed format, so an unzipping program
  316. decompresses and extracts archived files as a single step.
  317. <p>
  318. One common 16-bit DOS program is <b><tt>pkunzip</tt></b>, which comes in
  319. the <b><tt>pkzip</tt></b> package. If you use this, you should ensure that
  320. you have at least version 2.04g, because with its <b><tt>-d</tt></b>
  321. switch, that version of <b><tt>pkunzip</tt></b> preserves the directory
  322. structure of archived files when extracting them; see below. Another
  323. popular free program to unpack zip archives, available for DOS and MS
  324. Windows (16-bit and 32-bit), Unix, VMS, and other platforms, is InfoZIP
  325. <b><tt>unzip</tt></b>:
  326. <blockquote>
  327. <a href="http://www.info-zip.org/pub/infozip/UnZip.html"
  328. class="offsite">http://www.info-zip.org/pub/infozip/UnZip.html</a>
  329. </blockquote>
  330. <p>
  331. Unlike <b><tt>pkunzip</tt></b>, InfoZIP <b><tt>unzip</tt></b> automatically
  332. preserves the directory structure of extracted files. So if you have a zip
  333. archive <b><tt>MyArchive.zip</tt></b>:
  334. <blockquote><table cellpadding=0 cellspacing=0>
  335. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Extracting zipped files</font><hr>
  336. <tr valign=bottom>
  337. <th align=left>Command
  338. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  339. <th align=left>Preserves directory structure
  340. <tr> <td colspan=3><hr>
  341. <tr valign=top> <td><b><tt>pkunzip MyArchive.zip</tt></b>
  342. <td>&nbsp;
  343. <td>Does <b><em>NOT</em></b>
  344. <tr valign=top> <td><b><tt>pkunzip -d MyArchive.zip</tt></b>
  345. <td>&nbsp;
  346. <td><b><em>DOES</em></b> (note the <b><tt>-d</tt></b> switch)
  347. <tr valign=top> <td><b><tt>unzip MyArchive.zip</tt></b>
  348. <td>&nbsp;
  349. <td><b><em>DOES</em></b>
  350. </table></blockquote>
  351. <p>
  352. As with the compressed tar files, make sure you're positioned in the
  353. <b><em>parent</em></b> of the gs directory <b><em>before</em></b> unpacking
  354. the files. If a subdirectory doesn't already exist, <b><tt>zip</tt></b> or
  355. <b><tt>pkunzip&nbsp;-d</tt></b> creates it.
  356. <h3><a name="Unpack_Ghostscript"></a>How to unpack Ghostscript itself</h3>
  357. <p>
  358. At this point you have <a href="#Acquiring">acquired all the source code</a>
  359. and are ready to unpack it according to the preceding guidelines for <a
  360. href="#Tarfiles">tar files</a> or <a href="#Zipfiles">zip files</a>. To
  361. unpack the Ghostscript source, make the <b><em>parent</em></b> of the (new)
  362. gs directory the current directory.
  363. <blockquote><table cellpadding=0 cellspacing=0>
  364. <tr> <th align=left valign=top>2-step:
  365. <td>&nbsp;&nbsp;&nbsp;
  366. <td><b><tt>gzip -d ghostscript-</tt></b>#.##<b><tt>.tar.gz</tt></b><br><b><tt>tar -xf ghostscript-</tt></b>#.##<b><tt>.tar</tt></b>
  367. <tr><td>
  368. <tr> <th align=left valign=top>Pipe:
  369. <td>&nbsp;
  370. <td><b><tt>gzip -d -c ghostscript-</tt></b>#.##<b><tt>.tar.gz | tar -xf -</tt></b>
  371. <tr><td>
  372. <tr> <th align=left valign=top>GNU <b><tt>tar</tt></b>:
  373. <td>&nbsp;
  374. <td><b><tt>tar -zxf ghostscript-</tt></b>#.##<b><tt>.tar.gz</tt></b>
  375. <tr><td>
  376. <tr> <th align=left valign=top><b><tt>pkunzip</tt></b>:
  377. <td>&nbsp;
  378. <td><b><tt>pkunzip -d gs</tt></b>###<b><tt>sr1.zip</tt></b><br><b><tt>pkunzip -d gs</tt></b>###<b><tt>sr2.zip</tt></b><br>...
  379. <tr><td>
  380. <tr> <th align=left valign=top><tt>unzip</tt>:
  381. <td>&nbsp;
  382. <td><b><tt>unzip gs</tt></b>###<b><tt>src.zip</tt></b>
  383. </table></blockquote>
  384. <p>
  385. All the Ghostscript source files are now in subdirectories of the gs
  386. directory.
  387. <blockquote><table cellpadding=0 cellspacing=0>
  388. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Source subdirectories</font><hr>
  389. <tr> <th valign=bottom align=left>Subdirectory
  390. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  391. <th valign=bottom align=left>Contents
  392. <tr> <td colspan=5><hr>
  393. <tr> <td><b><tt>src/</tt></b>
  394. <td>&nbsp;
  395. <td>C source code and makefiles
  396. <tr> <td><b><tt>lib/</tt></b>
  397. <td>&nbsp;
  398. <td>PostScript files and scripts used when running Ghostscript
  399. <tr> <td><b><tt>doc/</tt></b>
  400. <td>&nbsp;
  401. <td>Documentation
  402. <tr> <td><b><tt>man/</tt></b>
  403. <td>&nbsp;
  404. <td>Unix <b><tt>man</tt></b> pages
  405. <tr> <td><b><tt>examples/</tt></b>
  406. <td>&nbsp;
  407. <td>Sample PostScript files
  408. </table></blockquote>
  409. <h3><a name="Unpack_libraries"></a>How to unpack the third-party libraries</h3>
  410. <p>
  411. The Ghostscript makefiles expect to find the JPEG, PNG, and zlib source code
  412. in specific subdirectories of the <b><tt>gs</tt></b> directory, and this
  413. means you must pay careful attention to unpacking the source code for these
  414. packages. Use the same method for all of them, no matter how they're
  415. packaged:
  416. <ol>
  417. <li>Make the gs directory current.
  418. <li>Unpack the archive file, creating a subdirectory (which will include a
  419. version number).
  420. <li>Whatever the subdirectory's original name, rename it to the versionless
  421. name shown just below.
  422. </ol>
  423. <p>
  424. If you're uncertain how to unpack an archive, review the sections on <a
  425. href="#Tarfiles">compressed tar files</a> and <a href="#Zipfiles">zip
  426. files</a>.
  427. <blockquote><table cellpadding=0 cellspacing=0>
  428. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">3d-party software subdirectories</font><hr>
  429. <tr> <th valign=bottom align=left>Package
  430. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  431. <th valign=bottom align=left>Possible<br>original name
  432. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  433. <th valign=bottom align=left>Rename to
  434. <tr> <td colspan=5><hr>
  435. <tr> <td>JPEG
  436. <td>&nbsp;
  437. <td><b><tt>./jpeg-6b</tt></b>
  438. <td>&nbsp;
  439. <td><b><tt>./jpeg</tt></b>
  440. <tr> <td>PNG
  441. <td>&nbsp;
  442. <td><b><tt>./libpng-</tt></b>#.##
  443. <td>&nbsp;
  444. <td><b><tt>./libpng</tt></b>
  445. <tr> <td>zlib
  446. <td>&nbsp;
  447. <td><b><tt>./zlib-</tt></b>#.#.#
  448. <td>&nbsp;
  449. <td><b><tt>./zlib</tt></b>
  450. </table></blockquote>
  451. <hr>
  452. <h2><a name="Bug_check"></a>How to check for post-release bug fixes</h2>
  453. <p>
  454. Bug information and fixes are tracked on Ghostscript Bugzilla.
  455. For more information, please visit
  456. <blockquote>
  457. <a href="http://bugs.ghostscript.com">
  458. http://bugs.ghostscript.com</a>
  459. </blockquote>
  460. <hr>
  461. <h2><a name="Makefile_overview"></a>How to prepare the makefiles</h2>
  462. <p>
  463. The Ghostscript makefiles are very large and complex in order to deal with
  464. the diverse requirements of all the different systems where they may be
  465. used.
  466. <p>
  467. Ghostscript has an automatic configuration script. If you're on unix or
  468. a system that supports unix shell scripts, this is the easiest option to use.
  469. Simply type:
  470. <blockquote><pre>
  471. ./configure
  472. </blockquote>
  473. from the top level of the ghostscript source directory. It should configure
  474. itself based on what's available on your system, warn you of any missing
  475. dependencies, and generate a Makefile. At this point you can skip to the
  476. section <a href="#Invoke_make">invoking make</a> below. Also, many common
  477. configuration options (like install location) can be set through options
  478. to the configure script. Type '<tt>./configure --help</tt>' for a complete
  479. listing. Note that the configuration option is only available with the
  480. unix .tar distributions of the source.
  481. <p>
  482. Note that if you're building Ghostscript from development source out of
  483. a repository instead of from a released source package, you should run
  484. '<tt>./autogen.sh</tt>' instead of <tt>./configure.</tt> This script
  485. takes all the same options that configure does.
  486. <p>
  487. If your system doesn't support the configure script or you don't wish to
  488. use it, you can use the traditional ghostscript makefile system, editing
  489. the options by hand to match your system as described below.
  490. Fortunately, the only makefiles you're likely to want to change are
  491. relatively small ones containing platform-specific information.
  492. <blockquote><a name="Platform-specific_makefiles"></a><table cellpadding=0 cellspacing=0>
  493. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Platform-specific makefiles</font><hr>
  494. <tr> <th align=left>Makefile
  495. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  496. <th align=left>Used for
  497. <tr> <td colspan=3><hr>
  498. <tr> <td><b><tt>Makefile.in</tt></b>
  499. <td>&nbsp;
  500. <td>Template makefile for the autoconf build
  501. <tr> <td><b><tt>bcwin32.mak</tt></b>
  502. <td>&nbsp;
  503. <td>MS Windows with Borland/Inprise compilers
  504. <tr> <td><b><tt>msvc32.mak</tt></b>
  505. <td>&nbsp;
  506. <td>MS Windows with Microsoft Visual C++ version 4 to 7.
  507. <tr> <td><b><tt>openvms.mak</tt></b>
  508. <td>&nbsp;
  509. <td>OpenVMS
  510. <tr> <td><b><tt>os2.mak</tt></b>
  511. <td>&nbsp;
  512. <td>OS/2 with the gcc/emx compiler
  513. <tr> <td><b><tt>unix-gcc.mak</tt></b>
  514. <td>&nbsp;
  515. <td>Unix with gcc
  516. <tr> <td><b><tt>unixansi.mak</tt></b>
  517. <td>&nbsp;
  518. <td>Unix with ANSI C compilers other than gcc
  519. <tr> <td><b><tt>watcw32.mak</tt></b>
  520. <td>&nbsp;
  521. <td>MS Windows with Watcom compilers
  522. <tr> <td>&nbsp;
  523. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Platform-independent makefiles</font><hr>
  524. <tr> <td><b><tt>contrib.mak</tt></b>
  525. <td>&nbsp;
  526. <td>Contributed device drivers
  527. <tr> <td><b><tt>devs.mak</tt></b>
  528. <td>&nbsp;
  529. <td>Maintained device drivers
  530. <tr> <td><b><tt>gs.mak</tt></b>
  531. <td>&nbsp;
  532. <td>Documentation and miscellany
  533. <tr> <td><b><tt>icclib.mak</tt></b>
  534. <td>&nbsp;
  535. <td>ICC color correction library
  536. <tr> <td><b><tt>ijs.mak</tt></b>
  537. <td>&nbsp;
  538. <td>IJS raster driver library
  539. <tr> <td><b><tt>int.mak</tt></b>
  540. <td>&nbsp;
  541. <td>Main makefile for the PostScript &amp; PDF interpreter
  542. <tr> <td><b><tt>jpeg.mak</tt></b>
  543. <td>&nbsp;
  544. <td>JPEG library
  545. <tr> <td><b><tt>lib.mak</tt></b>
  546. <td>&nbsp;
  547. <td>Graphics engine
  548. <tr> <td><b><tt>libpng.mak</tt></b>
  549. <td>&nbsp;
  550. <td>PNG library
  551. <tr> <td><b><tt>version.mak</tt></b>
  552. <td>&nbsp;
  553. <td>Version and release date
  554. <tr> <td><b><tt>zlib.mak</tt></b>
  555. <td>&nbsp;
  556. <td>zlib library
  557. </table></blockquote>
  558. <p>
  559. Since these files change from one Ghostscript version to another, sometimes
  560. substantially, and since they all include documentation for the various
  561. options, here we don't duplicate most of that documentation: we recommend
  562. strongly that you review the entire makefile specific for your operating
  563. system and compiler before building Ghostscript.
  564. <h3><a name="Preparing_makefiles"></a>Changes for your environment</h3>
  565. <p>
  566. You must edit the platform-specific makefile to change any of these:
  567. <ul>
  568. <li>The name of the makefile itself (<b><tt>MAKEFILE</tt></b> macro)
  569. <li>The locations to install Ghostscript files (<b><tt>prefix</tt></b> etc.)
  570. <li>The default search paths for the initialization and font files
  571. (<b><tt>GS_LIB_DEFAULT</tt></b> macro)
  572. <li>The debugging options (<b><tt>DEBUG</tt></b> and <b><tt>TDEBUG</tt></b>
  573. macros)
  574. <li>Which optional features to include (<b><tt>FEATURE_DEVS</tt></b>)
  575. <li>Which device drivers to include (<b><tt>DEVICE_DEVS</tt></b> and
  576. <b><tt>DEVICE_DEVS</tt></b>{<em>1--20</em>} macros)
  577. <li>Default resolution parameters for some printer drivers
  578. (<b><tt>devs.mak</tt></b> or <b><tt>contrib.mak</tt></b>, whichever defines
  579. the driver)
  580. </ul>
  581. <p>
  582. The <a href="#Platform-specific_makefiles">platform-specific makefiles</a>
  583. include comments describing all these except the
  584. <b><tt>DEVICE_DEVS</tt></b> options. These are described in
  585. <b><tt>devs.mak</tt></b> and <b><tt>contrib.mak</tt></b>, even though the
  586. file that must be edited to select them is the <a
  587. href="#Platform-specific_makefiles">platform-specific makefile</a>. Check
  588. also the <b><tt>JVERSION</tt></b> and <b><tt>PVERSION</tt></b> macros in
  589. the platform-specific makefile, and adjust them if they don't match the
  590. JPEG and PNG library versions you're using: see <b><tt>jpeg.mak</tt></b>
  591. and <b><tt>libpng.mak</tt></b> for more information.
  592. <p>
  593. Some platform-specific options are described in the sections for individual
  594. platforms. See the "Options" section near the beginning of the relevant
  595. makefile for more information.
  596. <h3><a name="Features_and_devices"></a>Selecting features and devices</h3>
  597. <p>
  598. You may build Ghostscript with any of a variety of features and with any
  599. subset of the available device drivers. The complete list of features is
  600. in a comment at the beginning of <b><tt>gs.mak</tt></b>, and the complete
  601. list of drivers in comments at the beginning of <b><tt>devs.mak</tt></b>
  602. and <b><tt>contrib.mak</tt></b>. To find what devices a platform-specific
  603. makefile selects to include in the executable, look in it for all lines of
  604. the form
  605. <blockquote>
  606. <b><tt>FEATURE_DEVS=</tt></b><em>{list of features}</em><br>
  607. <b><tt>DEVICE_DEVS</tt></b>*<b><tt>=</tt></b><em>{list of devices}</em>
  608. </blockquote>
  609. <p>
  610. For example, if the makefile has
  611. <blockquote><b><tt>
  612. FEATURE_DEVS=$(PSD)level2.dev
  613. </tt></b></blockquote>
  614. <p>
  615. indicating that only the PostScript Level 2 facilities should be included,
  616. you might make it
  617. <blockquote><b><tt>
  618. FEATURE_DEVS=$(PSD)level2.dev $(PSD)pdf.dev
  619. </tt></b></blockquote>
  620. <p>
  621. to add the ability to interpret PDF files. (In fact,
  622. <b><tt>FEATURE_DEVS</tt></b> in the current Unix makefiles already includes
  623. <b><tt>$(PSD)pdf.dev</tt></b>.) The Unix makefile also defines
  624. <blockquote><b><tt>
  625. DEVICE_DEVS=$(DD)x11.dev
  626. </tt></b></blockquote>
  627. <p>
  628. indicating that the X Windows driver should be included, but since
  629. platform-specific makefiles as distributed normally include many of the
  630. possible features and drivers, you will probably rather remove from the
  631. makefile the features and drivers you don't want. It does no harm to
  632. include unneeded features and devices, but the resulting executable will be
  633. larger than needed.
  634. <p>
  635. You may edit the <b><tt>FEATURE_DEVS</tt></b> line to select or omit any of
  636. the features listed near the beginning of <b><tt>gs.mak</tt></b>, and the
  637. <b><tt>DEVICE_DEVS</tt></b>* lines to select or omit any of the device
  638. drivers listed near the beginning of <b><tt>devs.mak</tt></b> and
  639. <b><tt>contrib.mak</tt></b>. The first device listed in the definition of
  640. <b><tt>DEVICE_DEVS</tt></b> becomes the default device for this executable;
  641. see the usage documentation for <a href="Use.htm#Output_device">how to
  642. select an output device</a> at run time using the
  643. <a href="Use.htm#DEVICE_switch"><b><tt>-sDEVICE=</tt></b></a> switch. If
  644. you can't fit all the devices on a single line, you may add lines defining
  645. <blockquote>
  646. <b><tt>DEVICE_DEVS1=$(DD)</tt></b><em>{dev11}</em><b><tt>.dev</tt></b> ... <b><tt>$(DD)</tt></b><em>{dev1n}</em><b><tt>.dev</tt></b>
  647. <br><b><tt>DEVICE_DEVS2=$(DD)</tt></b><em>{dev21}</em><b><tt>.dev</tt></b> ... <b><tt>$(DD)</tt></b><em>{dev2n}</em><b><tt>.dev</tt></b>
  648. </blockquote>
  649. <p>
  650. etc., up to <b><tt>DEVICE_DEVS15</tt></b>. Don't use continuation lines --
  651. on some platforms they don't work.
  652. <p>
  653. Note that if you want to include a driver named <em>xxx</em>, you must put
  654. <b><tt>$(DD)</tt></b><em>xxx</em><b><tt>.dev</tt></b> in
  655. <b><tt>DEVICE_DEVS</tt></b>*. Similarly, if you want to include a feature
  656. related to the PostScript or PDF language interpreters (PostScript level
  657. 1 .. 3, or other language features such as the ability to read EPSF files or
  658. TrueType font files), you must represent it as
  659. <b><tt>$(PSD)</tt></b><em>xxx</em><b><tt>.dev</tt></b>. If you are linking
  660. only the graphics library -- not the language interpreter(s) -- with an
  661. application and want to include optional graphics library features such as
  662. CIE color, you represent them as
  663. <b><tt>$(GLD)</tt></b><em>xxx</em><b><tt>.dev</tt></b>.
  664. <h4><a name="Precompiled_data"></a>Precompiled run-time data</h4>
  665. <p>
  666. Ghostscript normally reads a number of external data files at run time:
  667. initialization files containing PostScript code, fonts, and other resources
  668. such as halftones. By changing options in the top-level makefile for the
  669. platform, you can cause some of these files to be compiled into the
  670. executable: this simplifies installation, improves security, may reduce
  671. memory requirements, and may be essential if you are planning on putting
  672. Ghostscript into ROM.
  673. <p>
  674. To compile the initialization files (<b><tt>lib/gs_init.ps</tt></b>, etc.)
  675. into the executable, change the <b><tt>0</tt></b> to a <b><tt>1</tt></b> in
  676. the line
  677. <blockquote><b><tt>
  678. COMPILE_INITS=0
  679. </tt></b></blockquote>
  680. <p>
  681. Compiled initialization includes the default font map.
  682. It is used only if Ghostscript cannot find or open the default font
  683. map file at run time.
  684. <p>
  685. To compile fonts into the executable, see <a
  686. href="Fonts.htm#Precompiling">Precompiling fonts</a>.
  687. <p>
  688. To compile threshold-array halftones into the executable, see the "Compiled
  689. halftone" section of <b><tt>int.mak</tt></b> for a sample makefile fragment,
  690. <b><tt>genht.c</tt></b> for the syntax of halftone data files, and
  691. <b><tt>lib/ht_ccsto.ps</tt></b> for a sample data file. Note that even
  692. though the data files use PostScript syntax, compiled halftones do not
  693. require the PostScript interpreter and may be used with the graphics library
  694. alone.
  695. <h4><a name="GNU_readline"></a>GNU readline</h4>
  696. <p>
  697. AFPL Ghostscript does not include an interface to GNU readline. A user
  698. contributed code for this purpose, which we spent significant time debugging
  699. and then updating to track internal architectural changes in Ghostscript.
  700. The contributor was willing to assign the copyright to Aladdin Enterprises
  701. (the copyright holder of Ghostscript at the time), and to allow the code to
  702. be distributed with the Aladdin Free Public License (AFPL) as well as the
  703. GNU License (GPL). However, even though the GPL allows linking GPLed code
  704. (such as the GNU readline library package) with non-GPLed code (such as all
  705. the rest of AFPL Ghostscript) if one doesn't distribute the result, the Free
  706. Software Foundation, creators of the GPL, have told us that in their
  707. opinion, the GPL forbids distributing non-GPLed code that is merely
  708. <em>intended</em> to be linked with GPLed code. We understand that FSF
  709. takes this position in order to prevent the construction of software that is
  710. partly GPLed and partly not GPLed, even though the text of the GPL does not
  711. actually forbid this (it only forbids <em>distribution</em> of such
  712. software). We think that FSF's position is legally questionable and not in
  713. the best interest of users, but we do not have the resources to challenge
  714. it, especially since FSF's attorney apparently supports it. Therefore, even
  715. though we added the user-contributed interface to GNU readline in internal
  716. Aladdin Ghostscript version 5.71 and had it working in version 5.93 (one of
  717. the last beta versions before the 6.0 release), we removed it from the
  718. Aladdin Ghostscript 6.0 distribution.
  719. <p>
  720. GPL Ghostscript distributions will include support for GNU readline. As
  721. with other GPL Ghostscript components that are not included in AFPL
  722. Ghostscript, the maintainers of Ghostscript will not attempt to run, link,
  723. or even compile this code, or keep it current across changes in the rest of
  724. Ghostscript. We will, however, welcome bug fixes or updates, and distribute
  725. them with subsequent releases of GPL Ghostscript.
  726. <p>
  727. The first Ghostscript distribution to include GPL readline
  728. support was GNU Ghostscript 6.0. Support has unfortunately
  729. been spotty since then.
  730. <p>
  731. We put considerable work into making it possible for Ghostscript to use GNU
  732. readline, including the creation and adjustment of internal software
  733. interfaces specifically to serve this purpose. In principle, we should have
  734. undone this work in AFPL Ghostscript, lest FSF object to it too as
  735. intended to facilitate linking AFPL Ghostscript with GNU readline (as the
  736. U.S. government has been said to do for code that merely provides APIs where
  737. encryption may be added). However, we are willing to take this risk rather
  738. than spend the time to undo the interface changes.
  739. <p>
  740. If you have comments or questions about this situation, please feel free to
  741. contact the Free Software Foundation, authors of the GPL and copyright
  742. holders of GNU readline, at <a href="mailto:gnu@gnu.org">gnu@gnu.org</a>,
  743. and/or artofcode LLC, copyright holder of Ghostscript, at <a
  744. href="mailto:raph@artofcode.com">raph@artofcode.com</a>.
  745. <h3><a name="Makefile_setup"></a>Setting up "makefile"</h3>
  746. <p>
  747. After going through the steps just described to <a href="#Unpack">unpack
  748. the
  749. sources</a>, configure the build and make any desired
  750. <a href="#Preparing_makefiles">changes to the
  751. makefiles</a>, and unpack or create links to the <a
  752. href="#Unpack_libraries">third party libraries</a>, as the final step in
  753. preparing to build Ghostscript you must usually associate the name
  754. "<b><tt>makefile</tt></b>" with the correct makefile for your environment so
  755. the <b><tt>make</tt></b> command can find it. See the section on your
  756. particular platform for how to do that if necessary.
  757. <h3><a name="Invoke_make"></a>Invoking "make"</h3>
  758. <dl>
  759. <dt><b><tt>make</tt></b>
  760. <dd>Builds Ghostscript without debugging options.
  761. </dl>
  762. <dl>
  763. <dt><a name="Debugging"></a><b><tt>make debug</tt></b>
  764. <dd>Builds Ghostscript with debugging options and additional internal error
  765. checks. The program will be somewhat larger and slower, but it will behave
  766. no differently unless you actually turn on debugging options at execution
  767. time with the <b><tt>-DDEBUG</tt></b> or
  768. <a href="Use.htm#Debugging"><b><tt>-Z</tt></b> command line switches</a>
  769. described in the usage documentation.
  770. </dl>
  771. <dl>
  772. <dt><b><tt>make pg</tt></b>
  773. <dd>On Unix platforms, builds with the <b><tt>-pg</tt></b> compiler
  774. switch, creating an executable for time profiling.
  775. </dl>
  776. <dl>
  777. <dt><b><tt>make begin</tt></b>
  778. <dd>On PC platforms, attempts a quick and dirty compilation of all the
  779. <b><tt>.c</tt></b> files in the current directory. See the
  780. <a href="#Make_begin">more detailed explanation</a>.
  781. </dl>
  782. <dl>
  783. <dt><b><tt>make install</tt></b>
  784. <dd>After building, installs the Ghostscript executables, support files,
  785. and documentation, but does <b><em>not</em></b> install fonts. See the
  786. <a href="Install.htm">installation documentation</a>.
  787. </dl>
  788. <dl>
  789. <dt><b><tt>make clean</tt></b>
  790. <dd>Deletes all the files created by the build process (relocatables,
  791. executables, and miscellaneous temporary files). If you've built an
  792. executable and want to save it, move it first to another place, because
  793. "<b><tt>make clean</tt></b>" deletes it.
  794. </dl>
  795. <p>
  796. <b><em>Note:</em></b> on most platforms some of these simple instructions don't
  797. quite work in one way or another. Read the section on your specific
  798. platform.
  799. <h3><a name="Cross-compiling"></a>Cross-compiling</h3>
  800. <p>
  801. If you are compiling Ghostscript on machines <b>X1</b> ... <b>X</b><em>n</em> with
  802. cross-compilers that generate code for machine <b>Y</b>, you must first
  803. perform several extra steps on some machine <b>Z</b> (not necessarily of the
  804. same type as either <b>X</b><em>i</em> or <b>Y</b>). First of all, choose a makefile
  805. appropriate for <b>Z</b> and edit it to reflect the run-time options you
  806. wish to include (<b><tt>FEATURE_DEVS</tt></b>, <b><tt>DEVICE_DEVS*</tt></b>,
  807. and any other relevant options), just as for non-cross-compilation.
  808. <p>
  809. If <b>Z</b> runs Unix, perform the following steps:
  810. <ol>
  811. <li>On <b>Z</b>,
  812. <blockquote>
  813. <b><tt>make clean</tt></b><br>
  814. <b><tt>make obj/arch.h obj/genconf obj/echogs</tt></b>
  815. </blockquote>
  816. <li>Edit <b><tt>obj/arch.h</tt></b> to reflect the architecture of <b>Y</b>.
  817. <li>On <b>Z</b>,
  818. <blockquote>
  819. <b><tt>make CC=: CCLD=:</tt></b>
  820. </blockquote>
  821. <li>Copy the files <b><tt>obj/*.h</tt></b> from <b>Z</B> to the directory on
  822. each <b>X</b><em>i</em> that will be used for compilation.
  823. <li>Extract from the file <b><tt>obj/ldt.tr</tt></b> (on <b>Z</b>) the list
  824. of <b><tt>.o</tt></b> files that will be linked: this gives the list of
  825. source files that must be compiled.
  826. <li>Do the compilations on <b>X</b><em>i</em>.
  827. </ol>
  828. <p>
  829. If <b>Z</b> runs some version of Microsoft Windows with Microsoft Visual
  830. C++, use the following steps. <em>NOTE: We have not actually tested
  831. this.</em>
  832. <ol>
  833. <li>On <b>Z</b>,
  834. <blockquote>
  835. <b><tt>nmake clean</tt></b><br>
  836. <b><tt>nmake obj\arch.h obj\genconf.exe obj\echogs.exe</tt></b>
  837. </blockquote>
  838. <li>Edit <b><tt>obj\arch.h</tt></b> to reflect the architecture of <b>Y</b>.
  839. <li>On <b>Z</b>,
  840. <blockquote>
  841. <b><tt>nmake CC=rem LINK=rem</tt></b>
  842. </blockquote>
  843. <li>Copy the files <b><tt>obj\*.h</tt></b> from <b>Z</B> to the directory on
  844. each <b>X</b><em>i</em> that will be used for compilation.
  845. <li>Extract from the file <b><tt>obj\ldt.tr</tt></b> (on <b>Z</b>) the list
  846. of <b><tt>.obj</tt></b> files that will be linked: this gives the list of
  847. source files that must be compiled.
  848. <li>Do the compilations on <b>X</b><em>i</em>.
  849. </ol>
  850. <hr>
  851. <h2><a name="PC_build"></a>How to build Ghostscript from source (PC version)</h2>
  852. <p>
  853. All Ghostscript builds in PC (DOS and MS Windows) environments are 32- or
  854. 64-bit: 16-bit builds are not supported. The relevant makefiles are
  855. <blockquote><table cellpadding=0 cellspacing=0>
  856. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">PC makefiles</font><hr>
  857. <tr> <th align=left>Makefile
  858. <td>&nbsp;&nbsp;
  859. <th align=left>Construction tools
  860. <td>&nbsp;&nbsp;
  861. <th align=left>For environment
  862. <tr> <td colspan=5><hr>
  863. <tr> <td valign=top><b><tt>bcwin32.mak</tt></b>
  864. <td>&nbsp;
  865. <td valign=top><a href="#Borland_build">Borland/Inprise C++ 4.x</a>
  866. <td>&nbsp;
  867. <td valign=top>32-bit MS Windows 3.1 + Win32s, 95, 98, NT
  868. <tr> <td valign=top><b><tt>msvc32.mak</tt></b>
  869. <td>&nbsp;
  870. <td valign=top><a href="#Microsoft_build">Microsoft Visual C++ 4 to 8</a>
  871. <td>&nbsp;
  872. <td valign=top>MS Windows 32-bit
  873. <tr> <td valign=top><b><tt>watcw32.mak</tt></b>
  874. <td>&nbsp;
  875. <td valign=top><a href="#Watcom_build">Watcom C/386 or C++</a>
  876. <td>&nbsp;
  877. <td valign=top>MS Windows 32-bit
  878. <tr> <td valign=top><b><tt>unix-gcc.mak</tt></b>
  879. <td>&nbsp;
  880. <td valign=top><a href="#Cygwin32_build">Cygnus gcc</a>
  881. <td>&nbsp;
  882. <td valign=top><a href="http://sourceware.cygnus.com/cygwin/">Cygnus gnu-win32</a>
  883. </table></blockquote>
  884. <p>
  885. To build Ghostscript you need MS-DOS version 3.3 or later and
  886. Borland/Inprise C/C++ (4.0 or later); Microsoft Visual C++ (version 4.0 or
  887. later); Watcom C/386 (version 8.5 or later) or C++ (any version); or the
  888. free djgpp + go32 development system. The options in the makefiles are
  889. chosen to strike a balance between RAM consumption and likely usefulness.
  890. If you run <b><tt>make</tt></b> in directory <em>{dir}</em>, the default
  891. configuration generates an executable that assumes the Ghostscript
  892. initialization and font files are in directory
  893. <em>{dir}</em><b><tt>\lib</tt></b>.
  894. <p>
  895. Note that the <b><tt>make</tt></b> program supplied with each PC compiler
  896. has a different name. We refer to this program generically as
  897. <b><tt>make</tt></b> everywhere else in this document, but you will find the
  898. correct name for each compiler in the relevant section below that discusses
  899. that compiler.
  900. <p>
  901. You must have <b><tt>COMMAND.COM</tt></b> in your path to build Ghostscript.
  902. After making the changes needed to choose features and devices to build into
  903. the executable, you must create the directory where the compiler will do its
  904. work (normally the <b><tt>obj</tt></b> subdirectory of the current
  905. directory) and the directory where the compiled code will be placed
  906. (normally the <b><tt>bin</tt></b> subdirectory). Then to build the
  907. Ghostscript executable all you need do is give the <b><tt>make</tt></b>
  908. command.
  909. <p><a name="Make_begin"></a>
  910. A special make target "<b><tt>begin</tt></b>" attempts to compile all the
  911. <b><tt>.c</tt></b> files in the current directory. Some of these
  912. compilations will fail, but the ones that succeed will go considerably
  913. faster because they don't individually pay the overhead of starting up the
  914. compiler. So a good strategy for building the executable for the first
  915. time, or after changing a widely used <b><tt>.h</tt></b> file, is to do the
  916. fast compilation of everything possible, then the controlled compilation of
  917. everything that failed in the first step:
  918. <blockquote><b><tt>
  919. make begin<br>
  920. make
  921. </tt></b></blockquote>
  922. <p>
  923. <b><em>Note:</em></b> if you unpack the Ghostscript sources on a DOS or MS Windows
  924. system from a Unix tar file, the unpacked files have linefeed alone as the
  925. line terminator (the Unix convention) instead of carriage return + linefeed
  926. (the Microsoft convention), which may make the C compiler unhappy. One
  927. simple way to fix this, if you have the InfoZIP <b><tt>zip</tt></b> and
  928. <b><tt>unzip</tt></b> programs, is
  929. <blockquote><table cellpadding=0 cellspacing=0>
  930. <tr> <td><b><tt>zip -l CVTEMP.zip *.bat *.c *.h *.def *.rc</tt></b>
  931. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  932. <td>(Letter "l", not the digit "1")
  933. <tr> <td><b><tt>unzip -o CVTEMP.zip</tt></b>
  934. <td>&nbsp;
  935. <td>(Rewrite all the same files correctly)
  936. <tr> <td><b><tt>del CVTEMP.zip</tt></b>
  937. <td>&nbsp;
  938. <td>(Delete the temporary zip file)
  939. </table></blockquote>
  940. <h3><a name="Borland_build"></a>Borland/Inprise environment</h3>
  941. <p>
  942. To compile Ghostscript with the Borland/Inprise environment (hereafter
  943. referred to as just "Borland"), you need Borland C++ (version 4.0 or later);
  944. specifically the compiler, <b><tt>make</tt></b> utility, and linker. You
  945. also need either the Borland assembler (version 1.0 or later) or the
  946. Microsoft assembler (version 4.0 or later).
  947. <p>
  948. To create "<b><tt>makefile</tt></b>", give the command
  949. <blockquote><b><tt>
  950. echo !include "src\bcwin32.mak" &gt;makefile
  951. </tt></b></blockquote>
  952. <p>
  953. To run the <b><tt>make</tt></b> program, give the commmand
  954. <blockquote><b><tt>
  955. make
  956. </tt></b></blockquote>
  957. <p>
  958. Besides the source files and the makefiles, you need:
  959. <blockquote><table cellpadding=0 cellspacing=0>
  960. <tr valign=top> <td>*<b><tt>.bat</tt></b>
  961. <td>&nbsp;
  962. <td>(a variety of batch files used in the build process)
  963. </table></blockquote>
  964. <p>
  965. Comments in the makefiles describe the configuration parameters. If your
  966. configuration is different from the following, you should definitely read
  967. those comments and see if you want or need to change any of this:
  968. <ul>
  969. <li>The compiler files are in <b><tt>C:\BC</tt></b> and its subdirectories.
  970. <li>You are using the Borland assembler <b><tt>tasm</tt></b>.
  971. <li>You want an executable that will run on any 32-bit PC-compatible,
  972. regardless of processor type (80386, 80486, Pentium, or compatible) and
  973. regardless of whether a math coprocessor (80x87) is present -- an issue only
  974. with 80386 processors.
  975. </ul>
  976. <p>
  977. <b>Notes</b>
  978. <ul>
  979. <li>A user reports that the Borland C++ 4.00 with patch 1-6 doesn't
  980. produce a working executable of Ghostscript 5.03. We can't test this,
  981. since we no longer have this compiler.
  982. <li>Borland C++ 4.5 has a bug or bugs that cause(s) the 32-bit Windows
  983. executable to crash if you give any @-files on the command line. Among
  984. other things, this makes the uniprint driver unusable, because it references
  985. the .upp configuration files this way. This problem may possibly be fixed
  986. by one or more of the patch files on
  987. <blockquote>
  988. <a href="ftp://ftp.borland.com/pub/borlandcpp/devsupport/patches/bc4_5/"
  989. class="offsite">ftp://ftp.borland.com/pub/borlandcpp/devsupport/patches/bc4_5/</a>
  990. </blockquote>
  991. <li>Borland C++ 4.52 has a bug that causes the 32-bit Windows executable to
  992. fail during startup. Borland provides a patch for this bug in
  993. <blockquote>
  994. <a
  995. href="ftp://ftp.borland.com/pub/borlandcpp/devsupport/patches/bc4_5/bc45xp1.zip"
  996. class="offsite">ftp://ftp.borland.com/pub/borlandcpp/devsupport/patches/bc4_5/bc45xp1.zip</a>
  997. </blockquote>
  998. <li>Borland C++ 5.0 and 5.01 have a code generator bug that generates
  999. incorrect code for the construct <b><tt>!file_is_valid()</tt></b>. Do not
  1000. attempt to compile Ghostscript with these compilers. If you want to report
  1001. this bug to Borland, send them the result of compiling
  1002. <b><tt>ziodev.c</tt></b> and tell them to look at the code generated for
  1003. <b><tt>file_is_valid()</tt></b> and <b><tt>!file_is_valid()</tt></b>. We
  1004. don't know whether Borland C++ 5.02 still has this problem. The problem
  1005. does not appear to exist in Borland C++Builder 4 or 5.</li>
  1006. <li>When building for the MS Windows Win32s environment, the make
  1007. process will stop after it has created <b><tt>genarch.exe</tt></b>.
  1008. You should then run "<b><tt>_genarch.bat</tt></b>", wait until
  1009. <b><tt>genarch</tt></b> has finished and then exit MS Windows. Then type
  1010. "<b><tt>make</tt></b>" again to restart the make process.
  1011. <li>Borland C++Builder 5 and above require <strong><tt>BUILDER_VERSION</tt></strong>
  1012. to be set explicitly&nbsp; to 5 in the make file because the version of MAKE which ships
  1013. with this product (Version 5.2) is the same as that shipped with Version 4.5. Therefore,
  1014. there is no way to automatically establish the compiler version that is in use. Note that
  1015. because a 16 bit compile does not ship with Version 5.5, conditionals have been added to
  1016. prevent attempts to compile 16 bit code when <tt><strong>BUILDER_VERSION = 5</strong></tt></li>
  1017. <li>Note that under Borland C++Builder 5,&nbsp; MAKE
  1018. does not stop when <tt><strong>_genarch.bat</strong></tt> should be run as described
  1019. above. It is necessary for the user to Abort the make by pressing Control-C. You should
  1020. then run &quot;<b><tt>_genarch.bat</tt></b>&quot;, wait until <b><tt>genarch</tt></b> has
  1021. finished and then exit MS Windows. Then type &quot;<b><tt>make</tt></b>&quot; again to
  1022. restart the make process. All targets are built succesfully if this step is ignored. <tt><strong>I
  1023. don't know if the targets are correct although they seem to run OK.</strong></tt></li>
  1024. <li>To prevent the compiler terminating because too
  1025. many warning messages have been generated, copy the file&nbsp; file <tt><strong>bcc32.cfg </strong></tt>to
  1026. the top level directory using the following command:</li>
  1027. </ul>
  1028. <h3><a name="Microsoft_build"></a>Microsoft Environment</h3>
  1029. <p> NOTE: We have received reports that the Microsoft Visual C++ 5.0 and 6.0 compilers
  1030. produce incorrect code for Ghostscript version 6.0 and later, from the same
  1031. source code that compiles and runs correctly with other compilers. In spite
  1032. of these reports, several members of the Artifex staff use version 6.0 of the
  1033. MSVC compiler on a regular basis and we have not found any problems. You may
  1034. also want to try out the <a href="#IntelWin32_build">Intel&nbsp;C/C++ compiler</a>,
  1035. which can be integrated into the Microsoft Visual C++ environment.
  1036. <p>To compile Ghostscript using the Microsoft environment, you need Microsoft
  1037. Visual C++ 4.0 or later with its associated "<b><tt>nmake</tt></b>" utility
  1038. and linker.
  1039. <h4><a name="Using_the_MS_Development_Environment"> </a>Using Microsoft Developer
  1040. Studio</h4>
  1041. <p>Microsoft Developer Studio is the Microsoft Visual C++ integrated development
  1042. environment. To use it to build Ghostscript: it is first necessary to create
  1043. a new workspace/project. To create the workspace/project, open Microsoft Developer
  1044. Studio and select <b><tt>File/New</tt></b>. In the dialog window that is opened,
  1045. select 'Makefile' as the type of project. Specify a name for the project. (Microsoft
  1046. does not allow special characters such as ., *, ?, /, or \ as part of project
  1047. names.) Also specify the location of the master directory for your Ghostscript
  1048. files. Then select OK.
  1049. <p> In the next dialog window, specify the build command line as <b><tt>nmake
  1050. /f src/msvc32.mak DEVSTUDIO= </tt></b> Note the value for <b><tt>DEVSTUDIO</tt></b>
  1051. is empty. Then select <b><tt>Finish</tt></b>.
  1052. <p>At this point, it is now possible to build Ghostscript using Developer Studio.
  1053. To build, press F7 or select the build icon. Note: multiple warnings will also
  1054. given about things like double to float data conversions. Ignore them. We have
  1055. not found a way to create a single set of sources that does not create warnings
  1056. with the different compilers and operating systems supported by Ghostscript.
  1057. We are working to reduce the number of the warning messages.
  1058. <p>To run Ghostscript inside of Developer Studio, it is necessary to specify the
  1059. name of the executable program . Select <b><tt>Project/Settings</tt></b>. Select
  1060. the <b><tt>Debug</tt></b> tab. Then for <b><tt>Executable for debug session:</tt></b>
  1061. specify <b><tt>bin/gswin32.exe</tt></b>
  1062. <p>To use all of the features of Microsoft Developer Studio for debugging, and
  1063. modifying Ghostscriptt, you need to finish the remaining steps.
  1064. <p>To add the Ghostscript DLL to the project, select <b><tt>Project/Settings</tt></b>.
  1065. Select the <b><tt>Debug</tt></b> tab. Change the <b><tt>Category</tt></b> to
  1066. <b><tt>Additional DLLs</tt></b>. Then specify <b><tt>bin/gsdll32.dll</tt></b>.
  1067. <p> To specify the Ghostscript program arguments, select <b><tt>Project/Settings</tt></b>.
  1068. Select the <b><tt>Debug</tt></b> tab. Change the <b><tt>Category</tt></b> to
  1069. <b><tt>General</tt></b>. Then specify the desired program arguments. For example,
  1070. specifying: <b><tt>examples/tiger.eps</tt></b> will result in the tiger example
  1071. file being displayed when Ghostscript is executed. .
  1072. <p> A final note: it is possible to create a command file (build.bat) to be used
  1073. for the build command line. If many different workspaces/projects are created,
  1074. it is simpler to use a build batch command file rather than retyping the build
  1075. command line for each new project. Here is an example used by one of Artifex's
  1076. staff members. This file is one line:
  1077. <blockquote><b><tt> nmake -f src/msvc32.mak DEVSTUDIO= DEBUG=1 TDEBUG=1 GS_LIB_DEFAULT="./lib/;./font;$(GSROOTDIR)/lib;$(AROOTDIR)/fonts"
  1078. </tt></b></blockquote>
  1079. <p>Please note the double quotes around the value for <b><tt>GS_LIB_DEFAULT</tt></b>
  1080. and the addition of <b><tt>./lib;./fonts;</tt></b> to its definition. This uses
  1081. the local (within the project) copy of the <b><tt>lib</tt></b> and <b><tt>fonts</tt></b>
  1082. directories. This is convenient if any changes need to be made in these directories.
  1083. <p> Setting <b><tt>DEBUG=1</tt></b> includes debugging features in the build:
  1084. <ul>
  1085. <li> It defines the C preprocessor symbol <b><tt>DEBUG</tt></b>. The latter includes
  1086. tracing and self-validation code fragments into compilation.
  1087. Particularly it enables the <b><tt>-Z</tt></b> and <b><tt>-T</tt></b>
  1088. switches in Ghostscript.
  1089. <li> It compiles code fragments for the C stack overflow checks.
  1090. </ul>
  1091. Code produced with this option is somewhat larger and runs
  1092. somewhat slower.
  1093. <p>Setting <b><tt>TDEBUG=1</tt></b> disables code optimization in the C compiler and
  1094. includes symbol table information for the debugger.
  1095. Code becomes substantially slower and larger.
  1096. <p> An optional setting <b><tt>DEBUGSYM=1</tt></b> is only useful with <b><tt>TDEBUG=0</tt></b>
  1097. for advanced developers. It includes symbol table information for the debugger
  1098. in an optimized (release) build.
  1099. <em>
  1100. NOTE: The debug information generated for the optimized code may be
  1101. significantly misleading. For general MSVC users we recommend TDEBUG=1.
  1102. </em>
  1103. <h4><a name="Using_the_command_line"></a>Using the command line</h4>
  1104. <p>Ghostscript can be made using either the DOS shell or one one of the various
  1105. command line shells made for Windows.
  1106. <p>In order for the makefiles to work properly, two items may have to be changed.
  1107. An attempt is made to select the correct version of Microsoft Visual C++
  1108. based on the version of nmake. If this doesn't work it will default
  1109. to version 6.x.
  1110. If you are not using version 6.x then before building, in <b><tt>src\msvc32.mak</tt></b>
  1111. find the line "<b><tt>#MSVC_VERSION=6</tt></b>" and change it to "<b><tt>MSVC_VERSION=4</tt></b>",
  1112. "<b><tt>MSVC_VERSION=5</tt></b>", "<b><tt>MSVC_VERSION=7</tt></b>"
  1113. or "<b><tt>MSVC_VERSION=8</tt></b>". .
  1114. <p>In some cases the location of the Microsoft Developer Studio, needs to be changed.
  1115. The location of Microsoft Developer Studio is defined by the value of <b><tt>DEVSTUDIO</tt></b>.
  1116. There are several different definitions of <b><tt>DEVSTUDIO</tt></b> in src\msvc32.mak.
  1117. There is one for each of the currently supported versions of Microsoft Visual
  1118. C++ (4, 5, 6, 7, 7.1 and 8).
  1119. <p>The normal installation process for Microsoft Visual C++ includes setting the
  1120. location of the Microsoft Visual C++ executables (cl.exe, link.exe, nmake.exe,
  1121. rc.exe) in your PATH definition and the LIB and INCLUDE environment variables
  1122. are set to point to the Microsoft Visual C++ directories. If this is true then
  1123. the value for <b><tt>DEVSTUDIO</tt></b> can be changed to empty. I.e. <b><tt>DEVSTUDIO=</tt></b>
  1124. <p> If PATH, LIB, and INCLUDE are not correctly set then the value for <b><tt>DEVSTUDIO</tt></b>
  1125. needs to be defined. For example, for version 6.0, the default definition for
  1126. the location for the Microsoft Developer Studio is: <b><tt>DEVSTUDIO=C:\Program
  1127. Files\Microsoft Visual Studio </tt></b> If the path to Microsoft Developer Studio
  1128. on your system differs from the default then change the appropriate definition
  1129. of <b><tt>DEVSTUDIO</tt></b>. (Remember that there is a separate definition
  1130. of <b><tt>DEVSTUDIO</tt></b> for each version of MSVC, so be sure to change
  1131. the correct definition.)
  1132. <p>To run the <b><tt>make</tt></b> program, give the command
  1133. <blockquote><b><tt>
  1134. nmake -f src\msvc32.mak
  1135. </tt></b></blockquote>
  1136. <p>
  1137. Rather than changing src/msvc32.mak, these values can be specified on the make
  1138. command line, I.e.
  1139. <blockquote><b><tt> nmake -f src\msvc32.mak MSVC_VERSION=6 DEVSTUDIO="C:\Program Files\Microsoft Visual Studio" <br>
  1140. nmake -f src\msvc32.mak MSVC_VERSION=7 DEVSTUDIO="C:\Program Files\Microsoft Visual Studio .NET"
  1141. </tt></b></blockquote>
  1142. <p> Note that double quotes have been added around the path for <b><tt>DEVSTUDIO</tt></b>
  1143. due to the spaces in the path value.
  1144. <p>
  1145. This command line can also be put into a batch file.
  1146. <p> You may get warning messages during compilation about <b><tt>/QI0f</tt></b>
  1147. being an undefined switch, or the message "dwmain32.def: EXETYPE not supported
  1148. for platform; ignored" during linking. Multiple warnings will also given about
  1149. things like double to float data conversions. Ignore them. We have not found
  1150. a way to create a single set of sources that does not create warnings with the
  1151. different compilers and operating systems supported by Ghostscript.
  1152. <p>
  1153. The Microsoft VC++ 5.0 compiler locks up when compiling
  1154. <b><tt>gxi12bit.c</tt></b> with <b><tt>/O2</tt></b>. Compile this file
  1155. without <b><tt>/O2</tt></b>.
  1156. <p> The Microsoft VC++ 5.0 compiler produces a non-working executable if compiling
  1157. without stack checking. Don't change the setting <b><tt>TDEBUG=1</tt></b> in
  1158. <b><tt>msvc32.mak</tt></b>.
  1159. <h3><a name="Microsoft_build_64"></a>Microsoft Environment for 64-bit</h3>
  1160. Building Ghostscript for 64-bit Windows (AMD64 processor) requires
  1161. Microsoft Visual Studio .NET 2005 beta on 64-bit Windows,
  1162. or Microsoft Visual Studio .NET 2003 and Windows Server 2003 DDK
  1163. on 32-bit Windows (cross-compile).
  1164. <p>
  1165. Compiling for 64-bit is similar to the
  1166. <a href="#Microsoft_build">Microsoft Environment</a> instructions above,
  1167. but with the addition of a WIN64 define.
  1168. <h4><a name="Microsoft_64on32"></a>Cross compile on 32-bit Windows XP</h4>
  1169. Microsoft Visual Studio .NET 2003 is used for 32-bit compilation
  1170. of auxiliary programs used by the compile process,
  1171. while Windows Server 2003 Device Driver Kit (DDK)
  1172. is used for 64-bit compilation.
  1173. The DDK cross compilers for the IA64 and AMD64 processors,
  1174. however only AMD64 is supported by the makefile.
  1175. The DDK is not installed correctly by the setup program.
  1176. You need to copy <b><tt>msobj10.dll</tt></b> to the compiler
  1177. directory from a nearby directory.
  1178. <p>
  1179. To make ghostscript use
  1180. <blockquote><b><tt>
  1181. nmake -f src/msvc32.mak WIN64=
  1182. </tt></b></blockquote>
  1183. This will fail when it tries to run genconf.exe.
  1184. Move <b><tt>./obj/genconf.exe</tt></b> to 64-bit Windows, then run it
  1185. <blockquote><b><tt>
  1186. genconf arch.h
  1187. </tt></b></blockquote>
  1188. Move <b><tt>arch.h</tt></b> back to <b><tt>./obj/arch.h</tt></b>.
  1189. (Alternatively, use arch.h created by a 32-bit build and change
  1190. ARCH_ALIGN_PTR_MOD to 8,
  1191. ARCH_ALIGN_STRUCT_MOD to 16,
  1192. ARCH_SIZEOF_PTR to 8,
  1193. and ARCH_CACHE1_SIZE to 4194304).
  1194. Then restart the build
  1195. <blockquote><b><tt>
  1196. nmake -f src/msvc32.mak WIN64=
  1197. </tt></b></blockquote>
  1198. <p>
  1199. You can also use Microsoft Visual Studio .NET 2005 beta
  1200. to do a similar cross compile, but you will need to
  1201. change the DEVSTUDIO path.
  1202. <h4><a name="Microsoft_64on64"></a>Compile on 64-bit Windows XP</h4>
  1203. To make ghostscript use
  1204. <blockquote><b><tt>
  1205. nmake -f src/msvc32.mak WIN64=
  1206. </tt></b></blockquote>
  1207. The Microsoft Visual Studio .NET 2005 beta does not have
  1208. a "go live" licence. You are not permitted to distribute
  1209. executables created by this compiler.
  1210. <p>
  1211. The makefile currently uses the cross compiler (x86_amd64)
  1212. rather than the native compiler (amd64).
  1213. <p>
  1214. You can install Microsoft Visual Studio .NET 2003 on
  1215. 64-bit Windows, but you can't install Windows Server 2003 DDK.
  1216. You may be able to copy the DDK directory <b><tt>c:\winddk</tt></b>
  1217. from a 32-bit system to a 64-bit system and compile GS.
  1218. <h4><a name="Self-extracting_executables"></a>Making self-extracting executables</h4>
  1219. <p>
  1220. You can build self-extracting Windows executables of Ghostscript. (This is
  1221. not needed to use Ghostscript.) Currently this requires both the
  1222. Borland/Inprise and the Microsoft compilers, and also two pieces of
  1223. third-party software:
  1224. <ul>
  1225. <li><b><tt>WinZipSE</tt></b>, available from <a
  1226. href="http://www.winzip.com/winzipse.html"
  1227. class="offsite">http://www.winzip.com/winzipse.html</a>.
  1228. This is not free.
  1229. <li><b><tt>zip</tt></b>, available from <a
  1230. href="http://www.info-zip.org/pub/infozip/Zip.html" class="offsite">
  1231. http://www.info-zip.org/pub/infozip/Zip.html</a>. This is free.
  1232. </ul>
  1233. <p>
  1234. You will have to edit <b><tt>src/winint.mak</tt></b> to define
  1235. <b><tt>WINZIPSE_XE</tt></b> and <b><tt>ZIP_XE</tt></b> respectively as the
  1236. path names of these programs. See <a href="Release.htm">Release.htm</a> for
  1237. the detailed procedure.
  1238. <h3><a name="Watcom_build"></a>Watcom environment</h3>
  1239. <p>
  1240. To use the Watcom compiler, add to <b><tt>AUTOEXEC.BAT</tt></b> the line
  1241. "<b><tt>set&nbsp;DOS4G=quiet</tt></b>". Check that
  1242. <b><tt>AUTOEXEC.BAT</tt></b> also contains a line of the form
  1243. "<b><tt>set&nbsp;WATCOM=</tt></b><em>{wcdir}</em>" where <em>{wcdir}</em> is
  1244. the directory where you installed the Watcom tools, and that the setting of
  1245. <b><tt>PATH</tt></b> includes <em>{wcdir}</em><b><tt>\binnt</tt></b> (or
  1246. <b><tt>%WATCOM%\binnt</tt></b>) before <em>{wcdir}</em><b><tt>\binw</tt></b>
  1247. (or <b><tt>%WATCOM%\binw</tt></b>). Then to create
  1248. "<b><tt>makefile</tt></b>":
  1249. <blockquote><table cellpadding=0 cellspacing=0>
  1250. <tr> <th align=left>For
  1251. <td>&nbsp;&nbsp;&nbsp;
  1252. <th align=left>Give the command
  1253. <tr> <td colspan=3><hr>
  1254. <tr> <td>MS Windows
  1255. <td>&nbsp;
  1256. <td nowrap><b><tt>echo&nbsp;!include&nbsp;src\watcw32.mak&nbsp;&gt;makefile</tt></b>
  1257. </table></blockquote>
  1258. <p>
  1259. Before compiling, change the definition of the <b><tt>WCVERSION</tt></b>
  1260. macro in the makefile (<b><tt>watcw32.mak</tt></b>) to the version of the Watcom compiler you are
  1261. using. This is necessary to handle some minor incompatibilities between
  1262. versions.
  1263. <p>
  1264. To run the <b><tt>make</tt></b> program, give the commmand
  1265. <blockquote>
  1266. <b><tt>wmake -u</tt></b>
  1267. </blockquote>
  1268. <h3><a name="Cygwin32_build"></a>Cygwin32 gcc</h3>
  1269. <p>
  1270. A user reports that it is possible to compile Ghostscript for MS Windows NT
  1271. using the Cygwin32 gcc compiler, GNU <b><tt>make</tt></b>, and the
  1272. <b><tt>unix-gcc.mak</tt></b> makefile, with only two small source code
  1273. changes:
  1274. <ul>
  1275. <li>Add "<b><tt>b</tt></b>" to the call to <b><tt>fopen</tt></b> in <b><tt>gp_open_scratch</tt></b>
  1276. <li>Mirror the <b><tt>gp_ntfs</tt></b> logic for <b><tt>gp_pathstring_not_bare</tt></b>
  1277. </ul>
  1278. <p>
  1279. Information about this compiler and environment is at the Cygnus site:
  1280. <blockquote>
  1281. <a href="http://sources.redhat.com/cygwin/">http://sources.redhat.com/cygwin/</a>
  1282. </blockquote>
  1283. <p>
  1284. Please note that Cygnus's licensing terms aren't quite as liberal about
  1285. redistribution as either the GNU
  1286. <a href="http://www.gnu.org/copyleft/gpl.html">General Public License</a>
  1287. or the Aladdin <a href="Public.htm">Free Public License</a>, so read their
  1288. license carefully if you want to redistribute the results of using their
  1289. compiler.
  1290. <h3><a name="IntelWin32_build"></a>Intel C/C++ environment</h3>
  1291. <p>
  1292. Intel provides a C/C++ compiler that is compatible with the <a
  1293. href="#Microsoft_build">Microsoft Visual&nbsp;C++ environment</a>. The main
  1294. advantage of this compiler over MSVC&nbsp;5.0 and 6.0 is that it produces
  1295. working code even when all optimizations are enabled and when stack checking
  1296. is disabled.
  1297. <p>
  1298. To build Ghostscript using the Intel C/C++ compiler, you have to make the
  1299. following small changes in the makefiles:
  1300. <ul>
  1301. <li>Find and change the second occurrence of
  1302. "<b><tt>COMPILE_FULL_OPTIMIZED</tt></b>" to "<b><tt>/O2</tt></b>" in file
  1303. <b><tt>msvccmd.mak</tt></b>. <li>Override "<b><tt>TDEBUG</tt></b>",
  1304. "<b><tt>COMP</tt></b>", and "<b><tt>COMPAUX</tt></b>" when invoking
  1305. <b><tt>nmake</tt></b>.
  1306. </ul>
  1307. <p>
  1308. More specifically, use "<b><tt>TDEBUG=0</tt></b>" and set both
  1309. "<b><tt>COMP</tt></b>" and "<b><tt>COMPAUX</tt></b>" to the full path of
  1310. <b><tt>icl</tt></b> (for example
  1311. "<b><tt>COMP=C:\intel\compiler45\bin\icl</tt></b>" if the Intel&nbsp;C/C++
  1312. compiler V4.5 was installed to <b><tt>C:\intel</tt></b>). It is suggested
  1313. that you use a batch file to launch <b><tt>nmake</tt></b>, since the command
  1314. line processes the "<b><tt>=</tt></b>" on its own. Also, you may need to
  1315. execute <b><tt>vcvars32.bat</tt></b> and <b><tt>iccvars.bat</tt></b> to
  1316. register the proper paths for the compiler, its include files and its
  1317. libraries.
  1318. <p>
  1319. You can buy or download a 30-day evaluation version of the Intel&nbsp;C/C++
  1320. compiler from Intel's Software Performance Tools web site:
  1321. <blockquote>
  1322. <a href="http://www.intel.com/vtune/">http://www.intel.com/vtune/</a>
  1323. </blockquote>
  1324. <hr>
  1325. <h2><a name="Mac_build"></a>How to build Ghostscript from source (MacOS version)</h2>
  1326. <h3><a name="MacOS"></a>Traditional MacOS</h3>
  1327. <p>
  1328. The Macintosh version of Ghostscript requires the <a href="http://www.metrowerks.com/"
  1329. class="offsite">Metrowerks Codewarrior</a> development suite. Download the
  1330. <tt>macgs-7xx-src.sit</tt> source archive from the location listed
  1331. below. This includes a Codewarrior .mcp project file than can be used to build both
  1332. Carbon and CFM versions of the ghostscript shared library component.
  1333. <blockquote>
  1334. <a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/currenti/"
  1335. class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/current/</a>
  1336. </blockquote>
  1337. <p>
  1338. If your system doesn't automatically unpack the source archive, you can
  1339. download the free <a href="http://stuffit.com/download.html"
  1340. class="offsite">Stuffit Expander</a> to open it.
  1341. <p>
  1342. This archive includes appropriate versions of the jpeg, zlib and libpng 3rd party
  1343. library source for convenience. You must still download the fonts and place them in an
  1344. appropriate location, along with the contents of the <tt>lib</tt> directory from the source
  1345. archive.
  1346. <p>
  1347. Note that since this is just a library component, you will need a front-end application, such as
  1348. MacGSView, to actually view or convert postscript and pdf documents.
  1349. <h3><a name="MacOSX"></a>MacOS X</h3>
  1350. <p>
  1351. The unix source distribution (.tar.gz) builds fine on Darwin/MacOS X,
  1352. albeit without a display device. You can generally just use the <tt>Makefile</tt>
  1353. generated by ./configure or <tt>macosx.mak</tt>
  1354. as your top-level makefile and get a reasonable default build. This will
  1355. allow you to use Ghostscript from the command line as a BSD-layer tool
  1356. to rasterize postscript and pdf to image files, and convert between the
  1357. high-level formats supported by Ghostscript. See the instructions for the
  1358. unix build below for details of how to customize this build.
  1359. <p>
  1360. There is also a support for building Ghostscript as a framework. This is
  1361. a special encapsulated shared library format specific to MacOS X. To build
  1362. the framework, copy <tt>macosx.mak</tt> to the top-level directory, rename it to
  1363. <tt>makefile</tt> and issue 'make framework' from Terminal.app. This will result
  1364. in a <tt>Ghostscript.framework</tt> in the <tt>sobin</tt> directory. It must be
  1365. manually copied to /Library/Frameworks/ before applications
  1366. can use it. You may need to create the Frameworks/ directory on some systems.
  1367. <p>
  1368. Finally, there is a <tt>macos-mcp.mak</tt> makefile that can be
  1369. used to set up the Codewarrior shared library component build described
  1370. in the section on <a href="#MacOS">Classic MacOS</a> above. Currently
  1371. this makefile is distributed only with the MacOS-specific <tt>.sit</tt>
  1372. source archive, but with be included generally in future releases.
  1373. <p>
  1374. To set up the shlib build, download and uncompress the Ghostscript source.
  1375. If the archive doesn't contain the 3rd party jpeg, png, and zlib source,
  1376. you must download them as described at the beginning of this document and
  1377. unpack them under the macgs-###-src directory under the specific names
  1378. <tt>jpeg</tt>, <tt>zlib</tt> and <tt>libpng</tt>. You cannot use symlinks as
  1379. Codewarrior will not be able to follow them for some of the needed header
  1380. files.
  1381. <p>
  1382. Copy <tt>src/macos-mcp.mak</tt> to the top-level directory and rename
  1383. it <tt>makefile</tt>. Then run 'make' in that directory, either from
  1384. within Terminal.app or through Project Builder. This will set up the
  1385. generated code required for the build and run a shell script to generate
  1386. <tt>ghostscript.mcp.xml</tt>. Launch Metrowerks Codewarrior, and select
  1387. 'Import Project...' from the File menu, and open the xml project file.
  1388. When asked, save the results as <tt>ghostscript.mcp</tt> in the same
  1389. directory and you should be ready to build the shared library component.
  1390. </p>
  1391. Tradtional ('PPC') applications based on the Code Fragment Manager
  1392. will not be able to open the shlib linked with CarbonLib, so two
  1393. targets are provided, one with carbon and one without.
  1394. <hr>
  1395. <h2><a name="Unix_build"></a>How to build Ghostscript from source (Unix version)</h2>
  1396. <p>
  1397. Ghostscript now ships with a build system for unix-like operating systems
  1398. based on GNU Autoconf. In general the following should work to configure
  1399. and build Ghostscript:
  1400. <blockquote><pre>
  1401. ./configure
  1402. make
  1403. </pre></blockquote>
  1404. Please report any problems with this method on your system as a bug.
  1405. <p>
  1406. For the convenience of those already familiar with Ghostscript, the old method
  1407. based on hand-edited makefiles is still supported. It may also be helpful in
  1408. getting Ghostscript to build on very old platforms. This section deals exclusively
  1409. with that older method and includes numerous pointers regarding legacy systems.
  1410. <p>
  1411. Before issuing the <b><tt>make</tt></b> command to build Ghostscript, you
  1412. have to make some choices, for instance
  1413. <ul>
  1414. <li>which compiler to use;
  1415. <li>what features and devices to include;
  1416. <li>whether to use system libraries for PNG and zlib;
  1417. <li>and how to handle issues for your particular platform.
  1418. </ul>
  1419. <p>
  1420. Be sure to check the sections on <a
  1421. href="#Tool_specific_issues">tool-</a>, <a
  1422. href="#OS_specific_issues">OS-</a>, and <a
  1423. href="#Hardware_specific_issues">hardware-</a>specific issues for notes
  1424. on your particular platform and compiler. In fact, that is the
  1425. <b><em>first</em></b> place to check if you build Ghostscript and it crashes
  1426. or produces obviously incorrect results.
  1427. <h3><a name="Multi_architecture_makefile"></a>The multi-architecture makefile</h3>
  1428. <p>
  1429. Especially if you are working in a Unix environment with multiple CPU types,
  1430. operating systems, and/or C compilers, you may find the file
  1431. <b><tt>all-arch.mak</tt></b> useful. This user-contributed file includes
  1432. "wrappers" for the Unix makefiles for many different common environments.
  1433. The author of this file notes:
  1434. <blockquote>
  1435. <p>
  1436. This makefile allows you to execute
  1437. <pre>
  1438. make `hostname`
  1439. </pre>
  1440. <p>
  1441. on any machine on a network, without having to examine the Makefile for a
  1442. specific target name. Also, some of the targets in the Makefile incorporate
  1443. special changes in compiler options for certain files, to work around
  1444. compiler bugs that Ghostscript has been so good at exposing. Having that
  1445. special handling written down in a Makefile proves very convenient.
  1446. <p>
  1447. I don't do "make install" until I've done
  1448. <pre>
  1449. cd ...build-directory.../gs-x.yz
  1450. cd lib
  1451. ../bin/gs ../examples/tiger.eps
  1452. </pre>
  1453. <p>
  1454. and verified that the famous tiger can be correctly displayed. Also, the
  1455. "make install" step is careful to first remove any existing
  1456. <b><tt>$(BINDIR)/gs</tt></b>, then install a new gs there with a hard link
  1457. to gs-x.yz.
  1458. <p>
  1459. That way, each installation makes gs a synonym for the latest release,
  1460. but earlier ones remain in place in case backtracking is needed, which
  1461. I've fairly often wanted to do when investigating changed behavior, or
  1462. a suspected bug.
  1463. <p>
  1464. When I've been experimenting with a new feature, such as GNU readline
  1465. support, I change the setting of GS from gs to ngs (new gs), so as not
  1466. to break any existing programs by the installation of an experimental
  1467. version.
  1468. </blockquote>
  1469. <h3><a name="UNIX_makefile"></a>Setting up "makefile"</h3>
  1470. <p>
  1471. The files <b><tt>src/unix</tt></b>*<b><tt>.mak</tt></b> are the makefiles for
  1472. Unix platforms, and you choose one based on what compiler you use. To
  1473. build Ghostscript, however, you must use the simple command
  1474. "<b><tt>make</tt></b>", which must find the file "<b><tt>makefile</tt></b>"
  1475. (or "<b><tt>Makefile</tt></b>"). If your system supports symbolic links,
  1476. set up "<b><tt>makefile</tt></b>" like this.
  1477. <blockquote><table cellpadding=0 cellspacing=0>
  1478. <tr> <td>GNU gcc:
  1479. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  1480. <td nowrap><b><tt>ln -s src/unix-gcc.mak makefile</tt></b>
  1481. <tr> <td>Non-gcc ANSI C compiler:
  1482. <td>&nbsp;
  1483. <td nowrap><b><tt>ln -s src/unixansi.mak makefile</tt></b>
  1484. </table></blockquote>
  1485. <p>
  1486. If your system doesn't support symbolic links, first finish all changes to
  1487. the compiler-specific makefile, then make a hard link, omitting the
  1488. <b><tt>-s</tt></b> switch.
  1489. <p>
  1490. The makefile distributed with Ghostscript selects the following devices
  1491. to include in the build:
  1492. <blockquote><table cellpadding=0 cellspacing=0>
  1493. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Devices included as distributed</font><hr>
  1494. <tr valign=bottom>
  1495. <th align=left>Type
  1496. <td>&nbsp;&nbsp;
  1497. <th align=left>Devices
  1498. <tr> <td colspan=3><hr>
  1499. <tr valign=top> <td>Display
  1500. <td>&nbsp;
  1501. <td>X Windows
  1502. <tr valign=top> <td>Printers
  1503. <td>&nbsp;
  1504. <td>H-P DeskJets, LaserJets, and color DeskJets and PaintJets; Canon BubbleJets
  1505. <tr valign=top> <td>File formats
  1506. <td>&nbsp;
  1507. <td>Group 3 &amp; Group 4 fax; JPEG; PCX; PBM, PGM, PKM, &amp; PPM; TIFF; PostScript images; PNG; distilled PDF, PostScript, and EPS; PCL XL ("PCL 6")
  1508. </table></blockquote>
  1509. <p>
  1510. The <b><tt>unix</tt></b>*<b><tt>.mak</tt></b> files explicitly compile and
  1511. link the JPEG, PNG, and zlib libraries into the executable. If your Unix
  1512. system already includes the PNG and zlib libraries -- probably in
  1513. <b><tt>/usr/lib/libpng.</tt></b>{<b><tt>a</tt></b>,<b><tt>so</tt></b>} and
  1514. <b><tt>/usr/lib/libz.</tt></b>{<b><tt>a</tt></b>,<b><tt>so</tt></b>} -- and
  1515. you would rather use those copies, change the definition of
  1516. <b><tt>SHARE_LIBPNG</tt></b> and <b><tt>SHARE_ZLIB</tt></b> from 0 to 1 in
  1517. the relevant <b><tt>unix</tt></b>*<b><tt>.mak</tt></b> file before
  1518. compiling. Note that if you do this, you will get non-debug versions of
  1519. these libraries even if you selected <b><tt>DEBUG</tt></b> in the makefile.
  1520. At the insistence of some users, we have also provided the ability to do
  1521. this with the JPEG library (<b><tt>SHARE_JPEG</tt></b>), but should not use
  1522. it: in order to be compatible with Adobe interpreters (which do not follow
  1523. the JPEG standard exactly), Ghostscript has to compile the IJG code with
  1524. the non-standard definition
  1525. <blockquote><b><tt>
  1526. #define D_MAX_BLOCKS_IN_MCU 64
  1527. </tt></b></blockquote>
  1528. <p>
  1529. and since shared versions of this library will not have been compiled this
  1530. way, you will get errors on some valid PostScript and PDF input files. Note
  1531. also that because not all the JPEG library header files that Ghostscript
  1532. uses are normally installed in <b><tt>/usr/include</tt></b>, you must have
  1533. the source code for this library available even if you set
  1534. <b><tt>SHARE_JPEG</tt></b> to 1.
  1535. <p>
  1536. If the X11 client header files are located in some directory which your
  1537. compiler does not automatically search, you must change the
  1538. <b><tt>XINCLUDE</tt></b> macro in the makefile to include a specific
  1539. <b><tt>-I</tt></b> switch. See the comment preceding
  1540. <b><tt>XINCLUDE</tt></b> in the makefile.
  1541. <p>
  1542. Currently Ghostscript is set up to compile and link in a generic Unix
  1543. environment. Some Unix environments may require changing the
  1544. <b><tt>LDFLAGS</tt></b> macro in the makefile; be sure to check the <a
  1545. href="#Unix_build">Unix section</a> for your specific tools, operating
  1546. system, and hardware.
  1547. <h3><a name="Shared_object"></a>Shared object</h3>
  1548. To build Ghostscript as a shared object with gcc
  1549. (instead of as a single large executable) use:
  1550. <pre>
  1551. ln -s src/unix-gcc.mak makefile
  1552. make so
  1553. </pre>
  1554. <p>
  1555. This will build <b><tt>libgs.so</tt></b> and two programs which use the
  1556. shared object, <b><tt>gsx</tt></b> which uses Gtk+ and <b><tt>gsc</tt></b>
  1557. which does not.
  1558. <p>
  1559. Do not use <tt>make -f src/unix-gcc.mak</tt> because this will
  1560. break the recursive make used in building the shared object.
  1561. <p>
  1562. To install the shared object and these two programs:
  1563. <pre>
  1564. make soinstall
  1565. </pre>
  1566. To delete files created by the build process:
  1567. <pre>
  1568. make soclean
  1569. </pre>
  1570. <p>
  1571. For more details see <a href="../src/unix-dll.mak">unix-dll.mak</a>.
  1572. <h3><a name="Tool_specific_issues"></a>Tool-specific issues</h3>
  1573. <h4><a name="gcc_27x"></a>gcc 2.7.*</h4>
  1574. <p>
  1575. Some of the issues in using gcc are very specific to the particular
  1576. computer, the particular version of the operating system, and the
  1577. particular version of gcc available to you. You can check the version of
  1578. gcc with the <b><tt>gcc&nbsp;--version</tt></b> command.
  1579. <p>
  1580. An optimizer bug in gcc versions 2.7.0, 2.7.1, and 2.7.2 causes the
  1581. compiler to generate incorrect code. The makefile works around this, but
  1582. we recommend that if possible you use either an earlier or a later version
  1583. of gcc; for instance, gcc 2.5.8, gcc 2.6.3, 2.7.2.1 or later which don't
  1584. have this bug. Note, however, that gcc has other problems on some
  1585. platforms, so please read the section for your specific platform.
  1586. <h4><a name="GNU_make"></a>GNU make</h4>
  1587. <p>
  1588. Current versions of GNU <b><tt>make</tt></b> have no problems, but GNU
  1589. <b><tt>make</tt></b> 3.59 can't handle the final linking step in some
  1590. cases; if this happens, use the platform's standard <b><tt>make</tt></b>,
  1591. typically <b><tt>/bin/make</tt></b>.
  1592. <h3><a name="OS_specific_issues"></a>OS-specific issues</h3>
  1593. <h4><a name="386_Unix"></a>386 Unix</h4>
  1594. <ul>
  1595. <li>gcc versions older than 1.38 on Intel 80386 systems do not compile
  1596. Ghostscript correctly with the <b><tt>-O</tt></b> option.
  1597. <li>gcc 1.39 under <b><tt>386BSD</tt></b> has a bug that causes
  1598. float-to-integer conversions to compile incorrectly, rendering the
  1599. executable unusable.
  1600. <li>X11R5 may need "<b><tt>#include &lt;stddef.h&gt;</tt></b>" in <b><tt>x_.h</tt></b>.
  1601. <li>Also see regarding <a href="#System_V">System V</a> platforms.
  1602. </ul>
  1603. <h4><a name="BSDI"></a>BSDI</h4>
  1604. <ul>
  1605. <li>Use <b><tt>unix-gcc.mak</tt></b> and set<blockquote><b><tt>
  1606. STDLIBS=-lm<br>
  1607. XINCLUDE=-I/usr/X11R6/include<br>
  1608. XLIBDIRS=-L/usr/X11R6/lib<br>
  1609. XLIBS=Xt SM ICE Xext X11<br></tt></b></blockquote>
  1610. <li>If you want to use the shared versions of the PNG and zlib libraries, set
  1611. <b><tt>SHARE_LIBPNG=1</tt></b> and <b><tt>SHARE_ZLIB=1</tt></b>
  1612. as discussed <a href="#UNIX_makefile">previously</a>.
  1613. <li>BSD <b><tt>make</tt></b> uses a different syntax for its
  1614. <b><tt>include</tt></b> directive than Ghostscript;
  1615. use <b><tt>gmake</tt></b> instead.
  1616. </ul>
  1617. <h4><a name="Digital_Unix"></a>Digital Unix (Alpha)</h4>
  1618. <ul>
  1619. <li>Use <b><tt>unixansi.mak</tt></b> for all Digital Unix compilers.
  1620. <li>For versions of Digital Unix before 4.0, set
  1621. <p>
  1622. <b><tt>CFLAGS=-std -migrate -Olimit 1000 -g3 -O2 $(XCFLAGS)<br>
  1623. LDFLAGS=-lots $(XLDFLAGS)</tt></b>
  1624. <p>
  1625. You may be able to omit <b><tt>-g3</tt></b>. For later versions of Digital
  1626. Unix, users have reported that the proper flags are
  1627. <p>
  1628. <b><tt>CFLAGS=-std1 -Olimit 1000 -g3 -O2 $(XCFLAGS)</tt></b>
  1629. <p>
  1630. again, optionally omitting the <b><tt>-g3</tt></b>.
  1631. <li>If you get compiler error messages about "ANSI aliasing rules", please
  1632. see the section about <a href="#VMS_build">building under OpenVMS</a> below.
  1633. </ul>
  1634. <h4><a name="Linux"></a>Linux</h4>
  1635. <ul>
  1636. <li>If you build on Linux with X11 R6 or later, you may get link-time error
  1637. messages about undefined references to various functions beginning with
  1638. "SMC" and "ICE". If this happens, make sure that <b><tt>XLIBS</tt></b> in
  1639. the makefile is set to
  1640. "<b><tt>Xt&nbsp;SM&nbsp;ICE&nbsp;Xext&nbsp;X11</tt></b>" rather than
  1641. "<b><tt>Xt&nbsp;Xext&nbsp;X11</tt></b>".
  1642. <li>On very old systems (circa gcc version 2.6.3), you may encounter an incompatibility
  1643. in object formats (a.out vs. ELF) with the XFree86 library.
  1644. Typically, <b><tt>ld</tt></b> complains that some X library is not found,
  1645. or that many <b><tt>Xlib</tt></b> or <b><tt>Xt</tt></b> functions are not
  1646. found in the library (similar to the messages for omitting
  1647. <b><tt>SM</tt></b> and <b><tt>ICE</tt></b> from <b><tt>XLIBS</tt></b>). Or
  1648. you get a message when you start Ghostscript that the program or the shared
  1649. library is an unrecognized format.
  1650. If this happens, edit your top-level makefile to add the switches
  1651. "<b><tt>-b i486-linuxaout</tt></b>" to both <b><tt>CFLAGS</tt></b> and
  1652. <b><tt>LDFLAGS</tt></b>, then "<b><tt>make clean</tt></b>" followed by
  1653. "<b><tt>make</tt></b>"). If this doesn't help, or if other strange things
  1654. happen, contact your Linux supplier or support resource.
  1655. <li>A few of Ghostscript's drivers are multi-threaded. None of them are
  1656. in the default build. Currently the only ones are the "bmpa" series.
  1657. These drivers require <b><tt>libc</tt></b>
  1658. version 6 or higher. Most distributions include this, but it may be
  1659. an issue on very old systems.
  1660. </ul>
  1661. <h4><a name="NeXTSTEP"></a>NeXTSTEP / OpenSTEP</h4>
  1662. <ul>
  1663. <li>If you are using a NeXTSTEP version before 3.3, please get a no-cost
  1664. upgrade (along with Y2K patches) from Apple.
  1665. <li>If '<tt>./configure && make</tt>' fails, then for all NeXTSTEP systems, use
  1666. <b><tt>unix-gcc.mak</tt></b> and make the following changes:
  1667. <ul>
  1668. <li>In <b><tt>unix-aux.mak</tt></b> (and <b><tt>ugcclib.mak</tt></b>, if you
  1669. are using only the library) change the definition of <b><tt>INCLUDE</tt></b>
  1670. to "<b><tt>INCLUDE=/usr/include/bsd</tt></b>";
  1671. <li>in <b><tt>unix-gcc.mak</tt></b>:
  1672. <ul>
  1673. <li>change <b><tt>CC=gcc</tt></b> to <b><tt>CC=cc</tt></b>;
  1674. <li>change the definition of <b><tt>STDLIBS</tt></b> to only
  1675. <b><tt>-lm</tt></b>;
  1676. <li>change <b><tt>SYNC=posync</tt></b> to <b><tt>SYNC=nosync</tt></b>;
  1677. <li>add <b><tt>-D_POSIX_SOURCE</tt></b> to <b><tt>CFLAGS</tt></b> and remove
  1678. <b><tt>-g</tt></b>;
  1679. <li>remove <b><tt>-Wstrict-prototypes</tt></b> from <b><tt>GCFLAGS</tt></b>,
  1680. and if you are using NeXTSTEP 3.3 (with gcc 2.5.8), also remove
  1681. <b><tt>-Wmissing-declarations</tt></b>;
  1682. </ul>
  1683. <li>to the end of <b><tt>Fontmap.GS</tt></b> add the line
  1684. "<b><tt>/Ohlfs&nbsp;/Courier&nbsp;;</tt></b>".
  1685. </ul>
  1686. <li>If you are running the Pencom co-Xist X server (development version),
  1687. the X headers and libraries are in the default places, so change the
  1688. makefile definitions of <b><tt>XINCLUDE</tt></b> and
  1689. <b><tt>XLIBDIRS</tt></b> to empty strings.
  1690. </ul>
  1691. <h4><a name="SCO"></a>SCO Unix/Xenix</h4>
  1692. <ul>
  1693. <li>See also "<a href="#386_Unix">386 Unix</a>" and
  1694. "<a href="#System_V">System V Unix platforms</a>".
  1695. <li>The standard cc compiler on SCO OpenServer v5 has optimizer bugs.
  1696. Compile without -O.
  1697. <li>The SCO Unix C compiler apparently can't handle the
  1698. <b><tt>P</tt></b><em>n</em> macros in <b><tt>std.h</tt></b>. If you get
  1699. strange compilation errors on SCO Unix, ask SCO for a compiler fix.
  1700. <li>Meanwhile, to use gcc with SCO ODT, see <b><tt>unix-gcc.mak</tt></b>
  1701. for the appropriate switch settings.
  1702. <li>Because of a bug in SCO's floating point emulator, gcc 2.3.3 produces
  1703. code that causes crashes on machines without hardware floating point. Use
  1704. a different compiler on these machines.
  1705. <li>If you aren't using the X11 driver, you must add
  1706. <b><tt>-lsocket</tt></b> to the value of <b><tt>EXTRALIBS</tt></b> to link
  1707. the date and time functions.
  1708. <li>If you want to use direct frame buffer addressing instead of X Windows,
  1709. include the relevant frame buffer devices (<b><tt>$(DD)ega.dev</tt></b>,
  1710. <b><tt>$(DD)vga.dev</tt></b>, etc.) and change the definition of
  1711. <b><tt>EGAVGA</tt></b> to <b><tt>$(EGAVGA_SCO)</tt></b> as indicated in
  1712. <b><tt>devs.mak</tt></b>. <b>Note</b>: this works with SuperVGA displays
  1713. only for 800x600x16 mode.
  1714. <li>If the display looks "smeared", try recompiling
  1715. <b><tt>gdevpcfb.c</tt></b> with <b><tt>-O0</tt></b>.
  1716. <li>If Ghostscript crashes, use the <b><tt>-q</tt></b> switch or redirect
  1717. console output to a file.
  1718. <li>If your compiler accepts both the <b><tt>-Xt</tt></b> and
  1719. <b><tt>-Xa</tt></b> switches, use <b><tt>-Xt</tt></b>. Even though this
  1720. causes the compiler to use incorrect rules for computing the result types
  1721. of "<b><tt>&lt;&lt;</tt></b>" and "<b><tt>&gt;&gt;</tt></b>",
  1722. <b><tt>-Xa</tt></b> enables optimizations that produce incorrect code.
  1723. <li>For SCO ODT 2.0, in addition to <b><tt>-D__SVR3</tt></b> and
  1724. <b><tt>-DSYSV</tt></b>, you need to specify <b><tt>-Dsco</tt></b>,
  1725. <b><tt>-DUSG</tt></b>, and <b><tt>-DMALLOC_0_RETURNS_NULL</tt></b>. For
  1726. SCO ODT, you need
  1727. "<b><tt>EXTRALIBS=-lX11&nbsp;-lsocket&nbsp;-lmalloc</tt></b>", or maybe
  1728. only <b><tt>-lsocket</tt></b> depending on the version), and for SCO ODT
  1729. 2.0, you must also specify <b><tt>-lc_s</tt></b>. For SCO Xenix, you need
  1730. "<b><tt>EXTRALIBS=-lmalloc</tt></b>".
  1731. <li>For SCO OpenServer 5.0.5, add <b><tt>-L/usr/local/lib</tt></b> to
  1732. <b><tt>LDFLAGS</tt></b>.
  1733. <li>For all SCO systems, set "<b><tt>XINCLUDE=</tt></b>" and
  1734. "<b><tt>XLIBDIRS=</tt></b>".
  1735. </ul>
  1736. <h4><a name="SVR4"></a>SVR4 Unix</h4>
  1737. <ul>
  1738. <li>You may need to set <b><tt>EXTRALIBS=-lnsl</tt></b>.
  1739. <li>Do <b><em>not</em></b> change <b><tt>PLATFORM=unix_</tt></b> to <b><tt>PLATFORM=sysv_</tt></b>.
  1740. <li>On SVR4 Unix platforms with dynamic linking, you may need to define
  1741. <b><tt>XLIBDIR</tt></b> as the name of the directory that holds the X
  1742. Windows libraries. Do <b><em>not</em></b> prefix the name with
  1743. "<b><tt>-L</tt></b>".
  1744. <li>For SVR4.0 systems, set <b><tt>-DSVR4</tt></b> and
  1745. <b><tt>-DSVR4_0</tt></b> in the makefile; do <b><em>not</em></b> set
  1746. <b><tt>-DSYSV</tt></b>. For SVR4.2 (or later) and Solaris 2.<em>n</em>
  1747. systems, set only <b><tt>-DSVR4</tt></b> (<b><em>not</em></b>
  1748. <b><tt>-DSVR4_0</tt></b> nor <b><tt>-DSYSV</tt></b>).
  1749. </ul>
  1750. <h4><a name="System_V"></a>System V Unix platforms</h4>
  1751. <ul>
  1752. <li>If you are using a stock System V platform that lacks
  1753. <b><tt>rename</tt></b> and <b><tt>gettimeofday</tt></b>, in the makefile
  1754. change "<b><tt>PLATFORM=unix_</tt></b>" to
  1755. "<b><tt>PLATFORM=sysv_</tt></b>".
  1756. <li>You will probably need to change the definition of
  1757. <b><tt>INSTALL</tt></b> from "<b><tt>install</tt></b>" to
  1758. "<b><tt>/usr/ucb/install</tt></b>".
  1759. </ul>
  1760. <h4><a name="Unixware"></a>Unixware</h4>
  1761. <ul>
  1762. <li>The standard cc compiler has optimizer bugs. Compile without
  1763. <b><tt>-O</tt></b>.
  1764. </ul>
  1765. <h3><a name="Hardware_specific_issues"></a>Hardware-specific issues</h3>
  1766. <h4><a name="Alpha_with_gcc"></a>Alpha with gcc</h4>
  1767. <ul>
  1768. <li>You don't have to use gcc on Alpha systems, because the bundled
  1769. compiler works.
  1770. <li>The Alpha code generator in gcc 2.7.2.1 is broken. gcc 2.5.8 and 2.6.3
  1771. are probably usable. Versions before 2.5.0 are believed not to work. We
  1772. suggest you use a recent version.
  1773. </ul>
  1774. <h4><a name="Apollo"></a>H-P Apollo</h4>
  1775. <ul>
  1776. <li>You must run the compiler in ANSI-compatible mode (that is, set <b><tt>AK=</tt></b>{null string} in the makefile); otherwise it gives incorrect error
  1777. messages for any function declared as returning a float value.
  1778. <li>The H-P Apollo compiler may not compile Ghostscript correctly. If you
  1779. get unexpected crashes at run time, use gcc.
  1780. </ul>
  1781. <h4><a name="ATT_7040"></a>AT&amp;T 7040 R3</h4>
  1782. <ul>
  1783. <li>If Ghostscript crashes on startup, recompile with <b><tt>-O0</tt></b>
  1784. to work around compiler bugs.
  1785. </ul>
  1786. <h4><a name="Convex"></a>Convex</h4>
  1787. <ul>
  1788. <li>Use <b><tt>unixansi.mak</tt></b>. Do not invoke optimization
  1789. (<b><tt>-O1</tt></b>) because the compiler will produce incorrect code.
  1790. <li>Set <b><tt>CFLAGS</tt></b> to
  1791. "<b><tt>-no&nbsp;-fn&nbsp;-tm&nbsp;c1</tt></b>".
  1792. </ul>
  1793. <h4><a name="DECStations"></a>DECStations with Ultrix</h4>
  1794. <ul>
  1795. <li>If you get the compiler message "cfe: Fatal: _temp_19086.c:
  1796. Segmentation violation" or a similar one, try compiling with the
  1797. <b><tt>-oldc</tt></b> switch.
  1798. <li>You may wish to set
  1799. <p>
  1800. <b><tt>GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts</tt></b>
  1801. <p>
  1802. in the makefile to add the Display PostScript font directory to the font
  1803. search path.
  1804. <li>Set
  1805. <p>
  1806. <b><tt>CFLAGS="-Olimit&nbsp;2500"</tt></b>
  1807. <p>
  1808. to make the optimizer allocate enough table space.
  1809. <li>The Ultrix 4.4 C compiler compiles <b><tt>gdevm1.c</tt></b>
  1810. incorrectly. Insert the following line in the makefile rule for
  1811. "<b><tt>gdevm1.$(OBJ)</tt></b>" (the body of the rule is empty in the
  1812. standard distribution):
  1813. <p>
  1814. <b><tt>$(CCC) -oldc gdevm1.c</tt></b>
  1815. </ul>
  1816. <h4><a name="HP_RISC"></a>H-P RISC workstations</h4>
  1817. <ul>
  1818. <li>HP-UX versions before 11.0 do not support POSIX threads. Set
  1819. <b><tt>SYNC=nosync</tt></b> in the makefile before building.
  1820. <li>Ghostscript builds on H-P machines with either GNU gcc or H-P's
  1821. ANSI-capable <b><tt>cc</tt></b>. The minimal, non-ANSI-capable
  1822. <b><tt>cc</tt></b> that shiped with some basic HPUX system does <em>not</em>
  1823. work. If <b><tt>cc</tt></b> on your system doesn't accept the
  1824. <b><tt>-Aa</tt></b> switch, then you need to get the full
  1825. <b><tt>cc</tt></b> or gcc.
  1826. <li>If you use H-P's compiler, be sure you have upgraded to a recent
  1827. release. Many bizarre symptoms have been reported trying to build
  1828. Ghostscript with older, buggier compilers, for example:
  1829. <ul>
  1830. <li>The link step fails with a message about "<b><tt>max</tt></b>" not being defined.
  1831. <li>The build succeeds, but the resulting executable fails to start up,
  1832. with an error message like "Initializing... Unrecoverable error: typecheck
  1833. in .registerencoding".
  1834. <li>The build succeeds, but the resulting executable produces a black
  1835. background on the first page of output.
  1836. </ul>
  1837. <li>It is reported that On HPUX 9.* you need at least compiler patch
  1838. PHSS_5723 and dld.sl patch PHSS_5734 to build Ghostscript. (As of late
  1839. 1997, those patches are long obsolete; the current patches are compiler
  1840. PHSS_10357 and dld.sl PHSS_11246. It is unknown whether current
  1841. Ghostscript releases work with compiler/dld.sl versions older than these.)
  1842. <li>On HPUX 10.*, we don't know what combinations of compiler version and
  1843. switches work. It is reported that On HPUX 10.20, setting
  1844. "<b><tt>CC=c89</tt></b>" and "<b><tt>CFLAGS=+O3&nbsp;$(XCFLAGS)</tt></b>"
  1845. works, contradicting the information in the next paragraph, but this may be
  1846. dependent on the specific compiler version.
  1847. <li>In either HPUX version, you need to set
  1848. "<b><tt>CC=cc&nbsp;-Aa</tt></b>" (or use <b><tt>-Ae</tt></b> if you
  1849. prefer), and set
  1850. "<b><tt>CFLAGS=-D_HPUX_SOURCE&nbsp;-O&nbsp;$(XCFLAGS)</tt></b>". Higher
  1851. levels of optimization than <b><tt>-O</tt></b> may work depending on your
  1852. compiler revision; some users have reported success with
  1853. <b><tt>+O3</tt></b>, some have not.
  1854. <li>Some users have reported needing <b><tt>-DNOSYSTIME</tt></b> and
  1855. <b><tt>-D_POSIX_SOURCE</tt></b> in <b><tt>CFLAGS</tt></b>, but recent tests
  1856. do not show these to be necessary.
  1857. <li>If you use gcc, it's a good idea to have a recent release -- at the
  1858. very least 2.7.2.1 or later.You may be able to get a working
  1859. executable with an older gcc by removing <b><tt>-O</tt></b> from
  1860. <b><tt>CFLAGS</tt></b>.
  1861. </ul>
  1862. <h4><a name="Intergraph"></a>Intergraph Clipper</h4>
  1863. <ul>
  1864. <li>Recommended settings are:
  1865. <p>
  1866. <b><tt>XCFLAGS=-w -Q -DSYSV -D__SVR3<br>
  1867. EXTRALIBS=-lbsd -lc_s<br>
  1868. CC=acc -knr<br>
  1869. PLATFORM=sysv_</tt></b><br>&nbsp;
  1870. <li>You will probably need to change the value of <b><tt>XLIBS</tt></b> from
  1871. "<b><tt>XLIBS=Xt X11 Xext</tt></b>" to "<b><tt>XLIBS=Xt_s X11_s Xext</tt></b>".
  1872. </ul>
  1873. <h4><a name="MIPS"></a>MIPS</h4>
  1874. <ul>
  1875. <li>There is apparently a bug in older versions of the MIPS C compiler
  1876. which causes <b><tt>gxdither.c</tt></b> to compile incorrectly if
  1877. optimization is enabled (<b><tt>-O</tt></b>). However, this bug is
  1878. definitely fixed in MipsPRO C version 6.00; with this version, compiling
  1879. with "<b><tt>-O2 -mips2</tt></b>" produces good output.
  1880. </ul>
  1881. <h4><a name="NCR_3550"></a>NCR 3550</h4>
  1882. <ul>
  1883. <li>With the NCR C Development Toolkit you must use <b><tt>-O0</tt></b>.
  1884. </ul>
  1885. <h4><a name="Pyramid"></a>Pyramid MIServer-S</h4>
  1886. <p>
  1887. See "<a href="#ATT_7040">AT&amp;T 7040 R3</a>".
  1888. <h4><a name="RS6000"></a>IBM RS/6000 with AIX</h4>
  1889. <ul>
  1890. <li>Many versions of the AIX C compiler have bugs that have prevented
  1891. Ghostscript from compiling and linking properly. We believe that the
  1892. current Ghostscript release works around these bugs, and that
  1893. <b><tt>unixansi.mak</tt></b> with <b><tt>CC=cc</tt></b> should work.
  1894. <li>You must also edit the makefile (<b><tt>unixansi.mak</tt></b>) to change
  1895. <b><tt>INSTALL</tt></b> to <b><tt>/usr/ucb/install</tt></b>.
  1896. <li>AIX doesn't use a separate library for multi-thread support: set
  1897. <b><tt>STDLIBS=-lm</tt></b> in the makefile.
  1898. <li>If <b><tt>-DSYSV</tt></b> produces a complaint about the functions
  1899. <b><tt>index</tt></b> and <b><tt>rindex</tt></b> not being defined, try
  1900. removing it.
  1901. <li>If the xlc 1.2.1 optimizer runs out of memory, you may need to add
  1902. <b><tt>-qmaxmem=4000</tt></b> to <b><tt>CFLAGS</tt></b>.
  1903. <li>A user reports that the AIX C compiler shipped with AIX 3.2.5 compiles
  1904. Ghostscript only if invoked with "<b><tt>c89&nbsp;-D_POSIX_SOURCE</tt></b>"
  1905. and <b><em>without</em></b> <b><tt>-O</tt></b>. On the other hand, another
  1906. user reports successful compilation using <b><tt>unix-ansi.mak</tt></b> and
  1907. the command line
  1908. <p>
  1909. <b><tt>make&nbsp;CC=c89&nbsp;XCFLAGS="-DOSY_AIX&nbsp;-D_ALL_SOURCE&nbsp;-qnoro&nbsp;-qmaxmem=3000&nbsp;-bfl"&nbsp;$*</tt></b><br>&nbsp;
  1910. <li>Apparently some (but not all) releases of the C library declare the
  1911. <b><tt>hypot</tt></b> function: if the declaration in
  1912. <b><tt>math_.h</tt></b> produces an error message, try removing it.
  1913. <li>The IBM X11R3 server is known to be buggy: use the MIT X server if
  1914. possible.
  1915. <li>The xlc 1.3.0.x compiler provided in AIX 3.2.5+ definitely will not
  1916. compile Ghostscript correctly if <b><tt>-O</tt></b> is used on all files.
  1917. A user reports that compiling <b><tt>z</tt></b>*<b><tt>.c</tt></b>,
  1918. <b><tt>gsmatrix.c</tt></b>, <b><tt>gxstroke.c</tt></b> without
  1919. <b><tt>-O</tt></b> is sufficient to produce a working executable:.
  1920. <li>Some installations of AIX 3.2.5 have what appears to be an incorrect or
  1921. inconsistent version of <b><tt>libXt.a</tt></b> in
  1922. <b><tt>/usr/lpp/X11/lib</tt></b>. If linking shows
  1923. <b><tt>XtShellStrings</tt></b> and <b><tt>XtStrings</tt></b> as unresolved
  1924. externals, set
  1925. "<b><tt>XLIBDIRS=-L/usr/lpp/X11/lib/R5&nbsp;-L/usr/lpp/X11/lib</tt></b>"
  1926. rather than just "<b><tt>XLIBDIRS=-L/usr/lpp/X11/lib</tt></b>".
  1927. <li>Ghostscript has been successfully compiled and runs under AIX 4.3.3 and
  1928. the IBM C compiler version 5. The following changes were required in
  1929. unixansi.mak:
  1930. <p>
  1931. <b><tt>CC=xlc</tt></b>
  1932. <br>
  1933. <b><tt>XCFLAGS=-qalign=natural</tt></b>
  1934. </ul>
  1935. <h4>
  1936. <a NAME="Silicon_Graphics"></a>Silicon Graphics</h4>
  1937. <p>
  1938. Users have had a lot of problems with the MIPSpro compilers on SGI systems.
  1939. We recommend using gcc. If you do choose to use the MIPSpro compiler,
  1940. please read the following carefully.
  1941. <ul>
  1942. <li>
  1943. To make the optimizer allocate enough table space, set
  1944. <p><b><tt>CFLAGS="-Olimit 2500"</tt></b> (for older compilers)
  1945. <br><b><tt>CFLAGS="-OPT:Olimit=2500"</tt></b> (for newer compilers)
  1946. <p>
  1947. MIPSpro compiler version 3.19 is "older", and 7.1 is "newer"; we aren't
  1948. sure at what point in between the latter syntax was introduced.
  1949. <li>
  1950. With the compiler shipped with Irix 5.2, use the <b><tt>-ansi</tt></b>
  1951. option.
  1952. <li>
  1953. The SGI C compiler may produce warnings about "Undefined the ANSI standard
  1954. library defined macro stdin/stdout/stderr". To suppress these warnings, add
  1955. "<b><tt>-woff 608</tt></b>" to the definition of <b><tt>CFLAGS</tt></b>.
  1956. <li>
  1957. The SGI C compiler shipped with Irix 6.1 and 6.2 will not compile
  1958. <b><tt>zlib/deflate.c</tt></b> properly with optimization. Compile this file
  1959. separately without <b><tt>-O</tt></b>.
  1960. <li>
  1961. With IRIX 6.5.x and the MIPSpro 7.x compilers there have been reports about
  1962. incorrect output and binaries that cause segmentation faults.&nbsp; Various
  1963. solutions have been suggested and you may want to try them in this order,
  1964. until you get a working binary:
  1965. <ul>
  1966. <li>
  1967. Compile <b><tt>idict.c</tt></b> and <b><tt>isave.c</tt></b> separately
  1968. without optimization after doing a normal compile; then relink.e.g.:
  1969. <p>
  1970. <b><tt>cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/idict.o -c ./idict.c</tt></b><br>
  1971. <b><tt>cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/isave.o -c ./isave.c</tt></b>
  1972. <li>
  1973. Set <b><tt>CFLAGS=</tt></b> (no optimization).
  1974. <li>
  1975. Use only <b><tt>-O2</tt></b>.&nbsp;&nbsp; Compiler produces incorrect output
  1976. with <b><tt>-O3</tt></b> or "<b><tt>-Ofast=ip32 -show</tt></b>".
  1977. <li>
  1978. Irix 6.5.1m with MIPSpro compiler 7.2.1.1m, Irix 6.5.3m with MIPSpro
  1979. compiler 7.2.1, and probably other 6.5x / 7.2x combinations require
  1980. compiling with the <b><tt>-o32</tt></b> option. Compiling with the (default)
  1981. <b><tt>-n32</tt></b> option produces non-working executables.
  1982. <b><tt>-O2</tt></b> is OK (possibly except for <b><tt>idict.c</tt></b>), but
  1983. not <b><tt>-O3</tt></b>.
  1984. </ul>
  1985. </ul>
  1986. <h4><a name="Sun"></a>Sun</h4>
  1987. <ul>
  1988. <li>The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
  1989. properly with the <b><tt>-fast</tt></b> option: Ghostscript core-dumps in
  1990. <b><tt>build_gs_font</tt></b>. With that compiler use <b><tt>-g</tt></b>,
  1991. or use gcc instead.
  1992. <li>The Sun version of <b><tt>dbx</tt></b> often gives up with an error
  1993. message when trying to load Ghostscript. If this happens, use GNU
  1994. <b><tt>gdb</tt></b> instead. (<b><tt>gdb</tt></b> is more reliable than
  1995. <b><tt>dbx</tt></b> in other ways as well.)
  1996. <li>A bug in some versions of <b><tt>zlib</tt></b> results in an undefined
  1997. symbol <b><tt>zmemcmp</tt></b> when compiling with Sun cc. Use gcc
  1998. instead.
  1999. </ul>
  2000. <h4><a name="SunOS"></a>SunOS</h4>
  2001. <ul>
  2002. <li>The <tt><b>tar</b></tt> program provided with SunOS 4.1.3 may not be
  2003. able to unpack the archives in the standard Ghostscript distribution.
  2004. Get a more recent version of <tt><b>tar</b></tt>, such as GNU
  2005. <tt><b>tar</b></tt>.
  2006. <li>In SunOS 4.1.[23], you may get undefined symbols
  2007. <b><tt>_get_wmShellWidgetClass</tt></b> and
  2008. <b><tt>_get_applicationShellWidgetClass</tt></b> when linking. Compiling
  2009. "<b><tt>-Bstatic&nbsp;-lXmu&nbsp;-Bdynamic</tt></b>" appears to work for
  2010. SC1.0. For gcc, try adding <b><tt>-static</tt></b> to
  2011. <b><tt>CFLAGS</tt></b>. To solve the problem if you are using OpenWindows
  2012. 3.0 (X11R4-based Xt), ask Sun for patches 100512-02 and 100573-03.
  2013. </ul>
  2014. <h4><a name="Solaris"></a>Solaris</h4>
  2015. <ul>
  2016. <li>Solaris 2.2 may require setting "<b><tt>EXTRALIBS=-lsocket</tt></b>".
  2017. Solaris 2.3 and later seem to require "<b><tt>EXTRALIBS=-lnsl&nbsp;-lsocket&nbsp;-lposix4</tt></b>".
  2018. <li>For Solaris 2.6 (and possibly some other versions), if you set
  2019. <b><tt>SHARE_LIBPNG=1</tt></b>, <b><tt>SHARE_ZLIB=1</tt></b>, or
  2020. <b><tt>SHARE_JPEG=1</tt></b>, you may need to set
  2021. <p>
  2022. <b><tt>XLDFLAGS=-R /usr/local/</tt></b>xxx<b><tt>/lib:/usr/local/lib</tt></b>
  2023. <p>
  2024. using the full path names of the relevant directories.
  2025. <li>Solaris 2.<em>n</em> uses <b><tt>/usr/openwin/share/include</tt></b>
  2026. for the X11 libraries rather than <b><tt>/usr/local/X/include</tt></b>.
  2027. <li>Solaris 2.<em>n</em> typically has Type 1 fonts in
  2028. <b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>.
  2029. <li>For Solaris 2.<b><tt>n</tt></b> in the makefile you must change
  2030. the definition of <b><tt>INSTALL</tt></b> from "<b><tt>install&nbsp;-c</tt></b>" to
  2031. "<b><tt>/usr/ucb/install&nbsp;-c</tt></b>".
  2032. <li>You may need to set <b><tt>XLIBDIR</tt></b> to the directory that holds
  2033. the X11 libraries, as for other SVR4 systems. Set <b><tt>-DSVR4</tt></b>
  2034. in <b><tt>CFLAGS</tt></b>.
  2035. <li>If you are using the SunPRO C compiler, don't use optimization level
  2036. <b><tt>-xO3</tt></b>. On SPARC platforms the compiler hangs; on Intel
  2037. platforms the generated code is incorrect. With this compiler on Intel, do
  2038. not use the <b><tt>-native</tt></b> flag: floating point computations
  2039. become unacceptably inaccurate. You can use <b><tt>-xcg92</tt></b> (SPARC
  2040. V8) and <b><tt>-dalign</tt></b> for better performance.
  2041. </ul>
  2042. <h4><a name="VAX_Ultrix"></a>VAX with Ultrix</h4>
  2043. <ul>
  2044. <li>You may wish to set
  2045. <p>
  2046. <b><tt>GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts</tt></b>
  2047. <p>
  2048. in the makefile to add the Display PostScript font directory to the font
  2049. search path.
  2050. </ul>
  2051. <hr>
  2052. <h2><a name="OS2_build"></a>How to build Ghostscript from source (OS/2 version)</h2>
  2053. <p>
  2054. <em>Note: This section was contributed by a user: please e-mail Hermann
  2055. Ulrichskötter &lt;<a
  2056. href="mailto:ulrichsk@t-online.de">ulrichsk@t-online.de</a>&gt; if you have
  2057. questions or problems.</em>
  2058. <p>
  2059. The following instructions are for building with emx 0.9d/Fix2. Be warned
  2060. that with this version of gcc/emx, compiler optimization flags '-O' or '-O1'
  2061. will produce non-working output.
  2062. <ul>
  2063. <li>The relevant makefile is <b><tt>os2.mak</tt></b> The gcc/emx 0.9b (or
  2064. later) compiler and IBM <b><tt>NMAKE.EXE</tt></b> are required.
  2065. <li>For gcc/emx versions 0.9c and later, the <b><tt>LINK386</tt></b>
  2066. command must <b><em>include</em></b>
  2067. "<b><tt>$(COMPBASE)\lib\end.lib</tt></b>"; version 0.9b requires
  2068. <b><em>omitting</em></b> it. The current <b><tt>os2.mak</tt></b> file does
  2069. include this file in the <b><tt>LINK386</tt></b> command, so if you are
  2070. using 0.9b, delete this file reference before building.
  2071. <li>Be sure you are using the standard OS/2 shell, <b><tt>CMD.EXE</tt></b>.
  2072. Some other shells have bugs or differences that cause the makefile not to
  2073. work.
  2074. <li>Make sure you followed the instructions in "How to unpack the source
  2075. code" and "How to unpack the third-party libraries".
  2076. <li>Use jpegsrc_v6b.tar.gz, zlib-1.2.x.tar.gz and libpng-1.2.x.tar.gz.
  2077. Earlier versions may not work.
  2078. <li>If you wish to include support for XFree86, edit the makefile
  2079. to change <b>BUILD_X11=0</b> to <b>BUILD_X11=1</b>.
  2080. XFree86 for OS/2 can be obtained from
  2081. <a href="http://borneo.gmd.de/~veit/os2/xf86os2.html">
  2082. http://borneo.gmd.de/~veit/os2/xf86os2.html</a>
  2083. You must use emx 0.9d.
  2084. </ul>
  2085. <p>
  2086. Before compiling or linking, execute <b><tt>md bin</tt></b> and <b><tt>md
  2087. obj</tt></b> in the <b><tt>gs</tt></b> directory to create the directories
  2088. for the binaries.
  2089. <p>
  2090. First, build the standard configuration:
  2091. <ul>
  2092. <li>Edit gs/src/os2.mak: find line with 'CO=-O' (Optimizer flag) and edit
  2093. this line to 'CO=-O2' (-O or -O1 do not work!).
  2094. <li>To start the make process, type <b><tt>nmake -f .\src\os2.mak</tt></b>,
  2095. from the gs-directory.
  2096. <li>One DLL and two EXEs will be produced in <b><tt>gs/bin</tt></b>:
  2097. <b><tt>gsdll2.dll</tt></b> (the Ghostscript DLL), <b><tt>gsos2.exe</tt></b>
  2098. (the Ghostscript executable) and <b><tt>gspmdrv.exe</tt></b> (the
  2099. Presentation Manager display driver). All other newly generated files will
  2100. be produced in <b><tt>gs/obj</tt></b>.
  2101. </ul>
  2102. <p>
  2103. Now, if you wish, you can edit OS2.MAK to suit your needs, and then perform
  2104. <b><tt>nmake -f .\src\os2.mak clean</tt></b> and then <b><tt>nmake -f
  2105. .\src\os2.mak</tt></b>.
  2106. <hr>
  2107. <h2><a name="VMS_build"></a>How to build Ghostscript from source (OpenVMS version)</h2>
  2108. <p>The DECC6.2-003 compiler has an optimization problem that may lead to
  2109. warnings about the "ANSI aliasing rules". DEC (Compaq) can provide a fix
  2110. for this problem. The DECC6.2-006 compiler apparently does not have the
  2111. problem.
  2112. <p>
  2113. DEC C runtime library versions 5.5 and newer have an <b><tt>exit</tt></b>
  2114. function that is compatible with all other C systems, but some older ones
  2115. don't. If you get error messages from VMS when auxiliary programs such as
  2116. <b><tt>genarch</tt></b> or <b><tt>echogs</tt></b> finish executing, find the
  2117. line in stdpre.h that reads
  2118. <blockquote><b><tt>
  2119. /*#define&nbsp;OLD_VMS_C*/
  2120. </tt></b></blockquote>
  2121. and remove the <b><tt>/*</tt></b> and <b><tt>*/</tt></b>, changing it to
  2122. <blockquote><b><tt>
  2123. #define&nbsp;OLD_VMS_C
  2124. </tt></b></blockquote>
  2125. <p>
  2126. Some versions of DEC's X server have bugs that produce broad bands of color
  2127. where dither patterns should appear, or characters displayed white on top
  2128. of black rectangles or not displayed at all. If this happens, consult the
  2129. usage documentation for how to <a href="Use.htm#X_server_bugs">work around
  2130. X server bugs</a> using X resources; also report the problem to DEC, or
  2131. whomever supplied your X server.
  2132. <p>
  2133. You may also wish to turn off the use of a backing pixmap with Ghostscript,
  2134. either to work around X server memory limitations or bugs, or to obtain
  2135. faster displaying at the expense of no redrawing when a Ghostscript window
  2136. is restored from an icon or exposed after being occluded by another window.
  2137. Again, the <a href="Use.htm">usage documentation</a> tells how to do this.
  2138. <p>
  2139. You can <a href="Fonts.htm#Precompiling">precompile any Type 1 font</a>
  2140. into C, then compile and build it into Ghostscript, as described in the
  2141. <a href="Fonts.htm">fonts documentation</a>. If you do this, then add
  2142. "<b><tt>$(PSD)ccfonts.dev</tt></b>" to <b><tt>FEATURE_DEVS</tt></b> in
  2143. <b><tt>OPENVMS.MAK</tt></b>:
  2144. <blockquote><b><tt>
  2145. $&nbsp;FEATURE_DEVS&nbsp;=&nbsp;"$(PSD)psl3.dev&nbsp;$(PSD)pdf.dev&nbsp;$(PSD)dpsnext.dev&nbsp;$(PSD)ttfont.dev&nbsp;$(PSD)ccfonts.dev"
  2146. </tt></b></blockquote>
  2147. <p>
  2148. Specify the font names with <b><tt>ccfonts1</tt></b>:
  2149. <blockquote><b><tt>
  2150. $&nbsp;ccfonts1&nbsp;=&nbsp;"Courier&nbsp;Courier_Oblique&nbsp;Courier_Bold&nbsp;Courier_BoldOblique"
  2151. </tt></b></blockquote>
  2152. <p>
  2153. If this makes the line too long, add another line of the same form, such as
  2154. <blockquote><b><tt>
  2155. $&nbsp;ccfonts1&nbsp;=&nbsp;"Courier&nbsp;Courier_Oblique&nbsp;Courier_Bold&nbsp;Courier_BoldOblique"
  2156. $&nbsp;ccfonts2&nbsp;=&nbsp;"Times_Roman&nbsp;Times_Italic&nbsp;Times_Bold&nbsp;Times_BoldItalic"
  2157. </tt></b></blockquote>
  2158. <h3><a name="GNU_make_VMS"></a>Building with GNU make on OpenVMS</h3>
  2159. <p>
  2160. <em>Note: GNU make on OpenVMS apparently has bugs that make it stop with an
  2161. error when building Ghostscript version 5.80 or later. Until further
  2162. notice, use MMS or MMK for building Ghostscript on OpenVMS. See <a
  2163. href="#MMK_MMS_VMS">below</a> for details.</em>
  2164. <p>
  2165. As of Ghostscript version 5.0 you can use GNU make -- with the file
  2166. <b><tt>OPENVMS.MAK</tt></b> and some auxiliary <b><tt>.COM</tt></b> files
  2167. -- to build Ghostscript on OpenVMS. Use the command:
  2168. <blockquote>
  2169. <b><tt>make&nbsp;-fopenvms.mak&nbsp;"DECWINDOWS=</tt></b><em>[</em><b><tt>1.2</tt></b><em>]</em><b><tt>"</tt></b>
  2170. </blockquote>
  2171. <p>
  2172. That is, specify either "<b><tt>1.2</tt></b>" or nothing (blank) as the
  2173. value of <b><tt>DECWINDOWS</tt></b>. In Europe and other parts of the world
  2174. where ISO standard paper sizes are used, append "<b><tt>A4_PAPER=1</tt></b>"
  2175. to that line to make A4 the default paper size at run time.
  2176. <p>
  2177. If you haven't a prebuilt copy of GNU make, you'll have to build it
  2178. yourself; as of Version 3.76 (but not earlier) it is said to build properly
  2179. under OpenVMS on both VAX and Alpha. The kit is available at the
  2180. <a href="http://www.gnu.org/">Free Software Foundation's</a> ftp site and
  2181. its mirrors. See
  2182. <blockquote>
  2183. <a href="ftp://ftp.gnu.org/pub/gnu/"
  2184. class="offsite">ftp://ftp.gnu.org/pub/gnu/</a>
  2185. </blockquote>
  2186. <h3><a name="MMK_MMS_VMS"></a>Building with MMK or MMS on OpenVMS</h3>
  2187. <p>
  2188. As of Ghostscript version 5.68 you can use MMK or MMS to build Ghostscript on
  2189. OpenVMS. MMS is a utility available from Compaq (Digital);
  2190. MMK is a free program largely compatible with MMS.
  2191. <p>
  2192. Building Ghostscript with MMK or MMS uses the file
  2193. <b><tt>OPENVMS.MMK</tt></b> and some auxiliary <b><tt>.COM</tt></b> files.
  2194. To build Ghostscript with MMK or MMS, use the command:
  2195. <blockquote>
  2196. <b><tt>###/descrip=[.src]openvms.mmk/macro=("DECWINDOWS1_2=</tt></b><em>{</em><b><tt>0</tt></b>,<b><tt>1</tt></b><em>}</em><b><tt>")</tt></b>
  2197. </blockquote>
  2198. where <b><tt>###</tt></b> is either <b><tt>mmk</tt></b> or <b><tt>mms</tt></b>.
  2199. <p>
  2200. Specify <b><tt>DECWINDOWS1_2=1</tt></b> for DECWINDOWS 1.2,
  2201. <b><tt>DECWINDOWS1_2=0</tt></b> for other DECWINDOWS versions. In Europe
  2202. and other parts of the world where ISO standard paper sizes are used, add
  2203. <b><tt>,"A4_PAPER=1"</tt></b> just before the final closing parenthesis to
  2204. make A4 the default paper size at run time.
  2205. <p>
  2206. To download MMK (source code, and VAX and Alpha executables), visit
  2207. <blockquote>
  2208. <a href="http://www.madgoat.com/mmk.html">http://www.madgoat.com/mmk.html</a>
  2209. </blockquote>
  2210. <hr>
  2211. <h2><a name="Other_environments"></a>Other environments</h2>
  2212. <h3><a name="No_multi_thread"></a>Environments lacking multi-threading</h3>
  2213. <p>
  2214. All environments mentioned here by name have multi-threading capability.
  2215. However, if your environment doesn't, you can remove all need for
  2216. multi-threading by setting <b><tt>SYNC=nosync</tt></b> in the top-level
  2217. makefile. Note that you will not be able to use any so-called "async"
  2218. drivers (drivers that overlap interpretation and rasterization) if you do
  2219. this. No such drivers are in the <b><tt>DEVICE_DEVS*</tt></b> lists of any
  2220. makefile that we distribute.
  2221. <h3><a name="Plan_9"></a>Plan 9</h3>
  2222. <p>
  2223. Use <b><tt>unix-gcc.mak</tt></b>, editing it to define
  2224. <blockquote><b><tt>
  2225. CC=cc
  2226. GCFLAGS=-D_BSD_EXTENSION -DPlan9
  2227. </tt></b></blockquote>
  2228. <p>
  2229. You will also probably have to edit many path names.
  2230. <h3><a name="QNX"></a>QNX</h3>
  2231. <p>
  2232. David J. Hawkey Jr. writes that he built Ghostscript 4.03 and 5.0 under QNX
  2233. 4.22, 4.23, and 4.24 using Watcom C 10.6 and that "it works quite well,
  2234. after figuring out the <b><tt>/etc/config/lpsrvr</tt></b> directives,
  2235. except for color printing to my HP DeskJet some-number-or-another". Here
  2236. is a concise presentation of changes based on the ones he made for
  2237. Ghostscript 4.03.
  2238. <dl>
  2239. <dt><b><tt>unixansi.mak</tt></b>
  2240. <dd><table cellpadding=0 cellspacing=0>
  2241. <tr valign=bottom>
  2242. <th align=left>Original lines
  2243. <td>&nbsp;&nbsp;
  2244. <th align=left>Change to
  2245. <tr> <td colspan=3><hr>
  2246. <tr valign=top> <td><b><tt>INSTALL = install -c<br>INSTALL_PROGRAM = $(INSTALL) -m 755<br>INSTALL_DATA = $(INSTALL) -m 644</tt></b>
  2247. <td>&nbsp;
  2248. <td><b><tt>INSTALL = cp<br>INSTALL_PROGRAM = $(INSTALL)<br>INSTALL_DATA = $(INSTALL)</tt></b>
  2249. <tr> <td colspan=3><hr>
  2250. <tr valign=top> <td><b><tt>datadir = $(prefix)/share</tt></b>
  2251. <td>&nbsp;
  2252. <td><b><tt>datadir = $(prefix)/lib</tt></b>
  2253. <tr> <td colspan=3><hr>
  2254. <tr valign=top> <td><b><tt>CFLAGS_STANDARD=-O</tt></b>
  2255. <td>&nbsp;
  2256. <td><b><tt>CFLAGS_STANDARD=-Otx -zp1 -mf</tt></b>
  2257. <tr> <td colspan=3><hr>
  2258. <tr valign=top> <td><b><tt>LDFLAGS=$(XLDFLAGS)</tt></b>
  2259. <td>&nbsp;
  2260. <td><b><tt>LDFLAGS=-mf -N32k $(XLDFLAGS)</tt></b>
  2261. <tr> <td colspan=3><hr>
  2262. <tr valign=top> <td><b><tt>EXTRALIBS=</tt></b>
  2263. <td>&nbsp;
  2264. <td><b><tt>EXTRALIBS=-lXqnx_s -lsocket</tt></b>
  2265. <tr> <td colspan=3><hr>
  2266. <tr valign=top> <td><b><tt>XINCLUDE=-I/usr/local/X/include</tt></b>
  2267. <td>&nbsp;
  2268. <td><b><tt>#XINCLUDE=-I/usr/local/X/include</tt></b>
  2269. <tr> <td colspan=3><hr>
  2270. <tr valign=top> <td><b><tt>XLIBDIRS=-L/usr/local/X/lib<br>XLIBDIR=<br>XLIBS=Xt Xext X11</tt></b>
  2271. <td>&nbsp;
  2272. <td><b><tt>#XLIBDIRS=-L/usr/local/X/lib<br>#XLIBDIR=<br>XLIBS=Xt_s Xext X11_s</tt></b>
  2273. <tr> <td colspan=3><hr>
  2274. </table>
  2275. </dl>
  2276. <dl>
  2277. <dt><b><tt>gp_unifs.c</tt></b>
  2278. <dd>After the line
  2279. <blockquote>
  2280. <b><tt>#include&nbsp;&lt;sys/param.h&gt;</tt></b>
  2281. </blockquote>
  2282. <p>
  2283. add these lines:
  2284. <blockquote>
  2285. <b><tt>#if&nbsp;defined(__QNX__)<br>
  2286. #include&nbsp;&lt;unix.h&gt;<br>
  2287. #endif</tt></b><br>
  2288. </blockquote>
  2289. </dl>
  2290. <dl>
  2291. <dt><b><tt>gp_unix.c</tt></b>
  2292. <dd>After the line
  2293. <blockquote>
  2294. <b><tt>#include&nbsp;"time.h"</tt></b>
  2295. </blockquote>
  2296. <p>
  2297. add these lines:
  2298. <blockquote>
  2299. <b><tt>#if&nbsp;defined(__QNX__)<br>
  2300. #include&nbsp;&lt;sys/time.h&gt;<br>
  2301. #endif</tt></b><br>
  2302. </blockquote>
  2303. </dl>
  2304. <dl>
  2305. <dt><b><tt>time_.h</tt></b>
  2306. <dd>Modify the line beginning
  2307. <blockquote>
  2308. <b><tt>#&nbsp;&nbsp;if&nbsp;defined(Plan9)&nbsp;||</tt></b>
  2309. </blockquote>
  2310. <p>
  2311. to begin
  2312. <blockquote>
  2313. <b><tt>#&nbsp;&nbsp;if&nbsp;defined(__QNX__)&nbsp;||&nbsp;defined(Plan9)&nbsp;||</tt></b>
  2314. </blockquote>
  2315. </dl>
  2316. <dl>
  2317. <dt><b><tt>/etc/config/lpsrvr</tt></b>
  2318. <dd>Here is Hawkey's <b><tt>lpsrvr</tt></b> as an example.
  2319. <blockquote>
  2320. <pre># lpsrvr
  2321. #
  2322. # Defines the print queues and their devices
  2323. #
  2324. # Queues
  2325. # ink-jet: Ghostscript interpreter for mono DeskJet - LaserJet works
  2326. # better than DeskJet!
  2327. [ij-monops]
  2328. ta=lpt1
  2329. co=/usr/local/bin/gs -q -sDEVICE=laserjet -sOutputFile=- -dNOPAUSE $(spfile) quit.ps | cat &gt; $(device)
  2330. # Devices
  2331. [-lpt1]
  2332. dv=/dev/par1
  2333. [-lpt2]
  2334. dv=/dev/par2
  2335. </pre></blockquote>
  2336. </dl>
  2337. <h2><a name="UFST_build"></a>How to build Ghostscript with UFST</h2>
  2338. <p>
  2339. <em>Note: This section is only for customers who have licensed Agfa's UFST.
  2340. Other users please skip this section.
  2341. </em>
  2342. <p>
  2343. Ghostscript sources do not include UFST sources. You need to obtain them from Agfa.
  2344. Ghostscript includes only some source modules that provide a bridge to UFST.
  2345. <p>
  2346. Ghostscript makefiles do not include any script for building UFST libraries.
  2347. Refer to Agfa's manual how to build them. UFST object libraries must be built
  2348. before building Ghostscript with the UFST bridge.
  2349. <p>
  2350. To build Ghostscript with UFST, specify additional options for "make":
  2351. <dl>
  2352. <dt><b><tt>UFST_BRIDGE=1</tt></b>
  2353. <dd>forces the UFST bridge to build.
  2354. <dt><b><tt>UFST_ROOT=path</tt></b>
  2355. <dd>specifies the path to UFST root directory or folder.
  2356. <dt><b><tt>UFST_CFLAGS=options</tt></b>
  2357. <dd>specifies C compiler options for UFST library. Refer to Agfa's manual for information about them.
  2358. <dt><b><tt>UFST_LIB_EXT=extension</tt></b>
  2359. <dd>sets the file name extension for object libraries. You must use the appropriate one for your platform and linker.
  2360. </dl>
  2361. <p>An example for Unix/GCC :
  2362. <blockquote>
  2363. <tt>UFST_BRIDGE=1 UFST_ROOT=../Agfa UFST_CFLAGS=-DGCCx86 UFST_LIB_EXT=.a</tt>
  2364. </blockquote>
  2365. <p>For Windows/MSVC you need only specify UFST_ROOT.
  2366. msvc32.mak sets the other options automatically.
  2367. <p>
  2368. <h2><a name="FT_build"></a>How to build Ghostscript with Free Type</h2>
  2369. <p>
  2370. <em>Note: This section is only for users who wish to use Ghostscript with Free Type font renderer.
  2371. Other users please skip this section.
  2372. </em>
  2373. <p>
  2374. Ghostscript sources do not include Free Type sources. You need to obtain them from Free Type group.
  2375. Ghostscript includes only some source modules that provide a bridge to Free Type.
  2376. <p>
  2377. Ghostscript makefiles do not include any script for building Free Type libraries.
  2378. Refer to Free Type manual how to build them. Free Type object libraries must be built
  2379. before building Ghostscript with the Free Type bridge.
  2380. <p>
  2381. To build Ghostscript with Free Type, specify additional options for "make":
  2382. <dl>
  2383. <dt><b><tt>FT_BRIDGE=1</tt></b>
  2384. <dd>forces the Free Type bridge to build.
  2385. <dt><b><tt>FT_ROOT=path</tt></b>
  2386. <dd>specifies the path to Free Type root directory or folder.
  2387. <dt><b><tt>FT_CFLAGS=options</tt></b>
  2388. <dd>specifies C compiler options for Free Type library. Refer to Free Type manual for information about them.
  2389. <dt><b><tt>FT_LIB_EXT=extension</tt></b>
  2390. <dd>sets the file name extension for object libraries. You must use the appropriate one for your platform and linker.
  2391. </dl>
  2392. <p>An example for Unix/GCC :
  2393. <blockquote>
  2394. <tt>FT_BRIDGE=1 FT_ROOT=../FreeType FT_CFLAGS=-DGCCx86 FT_LIB_EXT=.a</tt>
  2395. </blockquote>
  2396. <p>For Windows/MSVC you need only specify FT_ROOT.
  2397. msvc32.mak sets the other options automatically.
  2398. <p>
  2399. <!-- [2.0 end contents] ==================================================== -->
  2400. <!-- [3.0 begin visible trailer] =========================================== -->
  2401. <hr>
  2402. <p>
  2403. <small>Copyright &copy; 1996, 2000 Aladdin Enterprises.
  2404. All rights reserved.</small>
  2405. <p>
  2406. This software is provided AS-IS with no warranty, either express or
  2407. implied.
  2408. This software is distributed under license and may not be copied,
  2409. modified or distributed except as expressly authorized under the terms
  2410. of the license contained in the file LICENSE in this distribution.
  2411. For more information about licensing, please refer to
  2412. http://www.ghostscript.com/licensing/. For information on
  2413. commercial licensing, go to http://www.artifex.com/licensing/ or
  2414. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  2415. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  2416. <p>
  2417. <small>Ghostscript version 8.53, 20 October 2005
  2418. <!-- [3.0 end visible trailer] ============================================= -->
  2419. </body>
  2420. </html>