unix-gcc.mak 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. # Copyright (C) 1997, 2000 Aladdin Enterprises. All rights reserved.
  2. #
  3. # This file is part of AFPL Ghostscript.
  4. #
  5. # AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  6. # distributor accepts any responsibility for the consequences of using it, or
  7. # for whether it serves any particular purpose or works at all, unless he or
  8. # she says so in writing. Refer to the Aladdin Free Public License (the
  9. # "License") for full details.
  10. #
  11. # Every copy of AFPL Ghostscript must include a copy of the License, normally
  12. # in a plain ASCII text file named PUBLIC. The License grants you the right
  13. # to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14. # conditions described in the License. Among other things, the License
  15. # requires that the copyright notice and this notice be preserved on all
  16. # copies.
  17. # $Id: unix-gcc.mak,v 1.23.2.3 2002/02/01 06:27:58 raph Exp $
  18. # makefile for Unix/gcc/X11 configuration.
  19. # ------------------------------- Options ------------------------------- #
  20. ####### The following are the only parts of the file you should need to edit.
  21. # Define the directory for the final executable, and the
  22. # source, generated intermediate file, and object directories
  23. # for the graphics library (GL) and the PostScript/PDF interpreter (PS).
  24. BINDIR=./bin
  25. GLSRCDIR=./src
  26. GLGENDIR=./obj
  27. GLOBJDIR=./obj
  28. PSSRCDIR=./src
  29. PSLIBDIR=./lib
  30. PSGENDIR=./obj
  31. PSOBJDIR=./obj
  32. # Do not edit the next group of lines.
  33. #include $(COMMONDIR)/gccdefs.mak
  34. #include $(COMMONDIR)/unixdefs.mak
  35. #include $(COMMONDIR)/generic.mak
  36. include $(GLSRCDIR)/version.mak
  37. DD=$(GLGENDIR)/
  38. GLD=$(GLGENDIR)/
  39. PSD=$(PSGENDIR)/
  40. # ------ Generic options ------ #
  41. # Define the installation commands and target directories for
  42. # executables and files. The commands are only relevant to `make install';
  43. # the directories also define the default search path for the
  44. # initialization files (gs_*.ps) and the fonts.
  45. INSTALL = $(GLSRCDIR)/instcopy -c
  46. INSTALL_PROGRAM = $(INSTALL) -m 755
  47. INSTALL_DATA = $(INSTALL) -m 644
  48. prefix = /usr/local
  49. exec_prefix = $(prefix)
  50. bindir = $(exec_prefix)/bin
  51. scriptdir = $(bindir)
  52. libdir = $(exec_prefix)/lib
  53. mandir = $(prefix)/man
  54. man1ext = 1
  55. datadir = $(prefix)/share
  56. gsdir = $(datadir)/ghostscript
  57. gsdatadir = $(gsdir)/$(GS_DOT_VERSION)
  58. docdir=$(gsdatadir)/doc
  59. exdir=$(gsdatadir)/examples
  60. GS_DOCDIR=$(docdir)
  61. # Define the default directory/ies for the runtime
  62. # initialization and font files. Separate multiple directories with a :.
  63. GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdir)/fonts
  64. # Define whether or not searching for initialization files should always
  65. # look in the current directory first. This leads to well-known security
  66. # and confusion problems, but users insist on it.
  67. # NOTE: this also affects searching for files named on the command line:
  68. # see the "File searching" section of Use.htm for full details.
  69. # Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
  70. SEARCH_HERE_FIRST=1
  71. # Define the name of the interpreter initialization file.
  72. # (There is no reason to change this.)
  73. GS_INIT=gs_init.ps
  74. # Choose generic configuration options.
  75. # -DDEBUG
  76. # includes debugging features (-Z switch) in the code.
  77. # Code runs substantially slower even if no debugging switches
  78. # are set.
  79. # -DNOPRIVATE
  80. # makes private (static) procedures and variables public,
  81. # so they are visible to the debugger and profiler.
  82. # No execution time or space penalty.
  83. GENOPT=
  84. # Choose capability options.
  85. # -DHAVE_MKSTEMP
  86. # uses mkstemp instead of mktemp
  87. # This gets rid of several security warnings that look
  88. # ominous. Enable this if you wish to get rid of them.
  89. CAPOPT= -DHAVE_MKSTEMP
  90. # Define the name of the executable file.
  91. GS=gs
  92. # Define the name of a pre-built executable that can be invoked at build
  93. # time. Currently, this is only needed for compiled fonts. The usual
  94. # alternatives are:
  95. # - the standard name of Ghostscript on your system (typically `gs'):
  96. BUILD_TIME_GS=gs
  97. # - the name of the executable you are building now. If you choose this
  98. # option, then you must build the executable first without compiled fonts,
  99. # and then again with compiled fonts.
  100. #BUILD_TIME_GS=$(BINDIR)/$(GS) -I$(PSLIBDIR)
  101. # Define the directories for debugging and profiling binaries, relative to
  102. # the standard binaries.
  103. DEBUGRELDIR=../debugobj
  104. PGRELDIR=../pgobj
  105. # Define the directory where the IJG JPEG library sources are stored,
  106. # and the major version of the library that is stored there.
  107. # You may need to change this if the IJG library version changes.
  108. # See jpeg.mak for more information.
  109. JSRCDIR=jpeg
  110. JVERSION=6
  111. # Choose whether to use a shared version of the IJG JPEG library (-ljpeg).
  112. # DON'T DO THIS. If you do, the resulting executable will not be able to
  113. # read some PostScript files containing JPEG data, because Adobe chose to
  114. # define PostScript's JPEG capabilities in a way that is slightly
  115. # incompatible with the JPEG standard. Note also that if you set SHARE_JPEG
  116. # to 1, you must still have the library header files available to compile
  117. # Ghostscript. See doc/Make.htm for more information.
  118. # DON'T SET THIS TO 1! See the comment just above.
  119. SHARE_JPEG=0
  120. JPEG_NAME=jpeg
  121. # Define the directory where the PNG library sources are stored,
  122. # and the version of the library that is stored there.
  123. # You may need to change this if the libpng version changes.
  124. # See libpng.mak for more information.
  125. PSRCDIR=libpng
  126. PVERSION=10201
  127. # Choose whether to use a shared version of the PNG library, and if so,
  128. # what its name is.
  129. # See gs.mak and Make.htm for more information.
  130. SHARE_LIBPNG=0
  131. LIBPNG_NAME=png
  132. # Define the directory where the zlib sources are stored.
  133. # See zlib.mak for more information.
  134. ZSRCDIR=zlib
  135. # Choose whether to use a shared version of the zlib library, and if so,
  136. # what its name is (usually libz, but sometimes libgz).
  137. # See gs.mak and Make.htm for more information.
  138. SHARE_ZLIB=0
  139. #ZLIB_NAME=gz
  140. ZLIB_NAME=z
  141. # Define the directory where the icclib source are stored.
  142. # See icclib.mak for more information
  143. ICCSRCDIR=icclib
  144. # Define the directory where the ijs source is stored,
  145. # and the process forking method to use for the server.
  146. # See ijs.mak for more information.
  147. IJSSRCDIR=ijs
  148. IJSEXECTYPE=unix
  149. # Define how to build the library archives. (These are not used in any
  150. # standard configuration.)
  151. AR=ar
  152. ARFLAGS=qc
  153. RANLIB=ranlib
  154. # ------ Platform-specific options ------ #
  155. # Define the name of the C compiler.
  156. CC=gcc
  157. # Define the name of the linker for the final link step.
  158. # Normally this is the same as the C compiler.
  159. CCLD=$(CC)
  160. # Define the default gcc flags.
  161. # Note that depending whether or not we are running a version of gcc with
  162. # the 2.7.0-2.7.2 optimizer bug, either "-Dconst=" or
  163. # "-Wcast-qual -Wwrite-strings" is automatically included.
  164. GCFLAGS=-Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wtraditional -fno-builtin -fno-common
  165. # Define the added flags for standard, debugging, profiling
  166. # and shared object builds.
  167. CFLAGS_STANDARD=-O2
  168. CFLAGS_DEBUG=-g -O
  169. CFLAGS_PROFILE=-pg -O2
  170. CFLAGS_SO=-fPIC
  171. # Define the other compilation flags. Add at most one of the following:
  172. # -DBSD4_2 for 4.2bsd systems.
  173. # -DSYSV for System V or DG/UX.
  174. # -DSYSV -D__SVR3 for SCO ODT, ISC Unix 2.2 or before,
  175. # or any System III Unix, or System V release 3-or-older Unix.
  176. # -DSVR4 -DSVR4_0 (not -DSYSV) for System V release 4.0.
  177. # -DSVR4 (not -DSYSV) for System V release 4.2 (or later) and Solaris 2.
  178. # XCFLAGS can be set from the command line.
  179. # We don't include -ansi, because this gets in the way of the platform-
  180. # specific stuff that <math.h> typically needs; nevertheless, we expect
  181. # gcc to accept ANSI-style function prototypes and function definitions.
  182. XCFLAGS=
  183. CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
  184. # Define platform flags for ld.
  185. # SunOS 4.n may need -Bstatic.
  186. # Solaris 2.6 (and possibly some other versions) with any of the SHARE_
  187. # parameters set to 1 may need
  188. # -R /usr/local/xxx/lib:/usr/local/lib
  189. # giving the full path names of the shared library directories.
  190. # XLDFLAGS can be set from the command line.
  191. XLDFLAGS=
  192. LDFLAGS=$(XLDFLAGS) -fno-common
  193. # Define any extra libraries to link into the executable.
  194. # ISC Unix 2.2 wants -linet.
  195. # SCO Unix needs -lsocket if you aren't including the X11 driver.
  196. # SVR4 may need -lnsl.
  197. # Solaris may need -lnsl -lsocket -lposix4.
  198. # (Libraries required by individual drivers are handled automatically.)
  199. EXTRALIBS=
  200. # Define the standard libraries to search at the end of linking.
  201. # Most platforms require -lpthread for the POSIX threads library;
  202. # on FreeBSD, change -lpthread to -lc_r; BSDI and perhaps some others
  203. # include pthreads in libc and don't require any additional library.
  204. # All reasonable platforms require -lm, but Rhapsody and perhaps one or
  205. # two others fold libm into libc and don't require any additional library.
  206. #STDLIBS=-lpthread -lm
  207. # Since the default build is for nosync, don't include pthread lib
  208. STDLIBS=-lm
  209. # Define the include switch(es) for the X11 header files.
  210. # This can be null if handled in some other way (e.g., the files are
  211. # in /usr/include, or the directory is supplied by an environment variable);
  212. # in particular, SCO Xenix, Unix, and ODT just want
  213. #XINCLUDE=
  214. # Note that x_.h expects to find the header files in $(XINCLUDE)/X11,
  215. # not in $(XINCLUDE).
  216. XINCLUDE=-I/usr/X11R6/include
  217. # Define the directory/ies and library names for the X11 library files.
  218. # XLIBDIRS is for ld and should include -L; XLIBDIR is for LD_RUN_PATH
  219. # (dynamic libraries on SVR4) and should not include -L.
  220. # Newer SVR4 systems can use -R in XLIBDIRS rather than setting XLIBDIR.
  221. # Both can be null if these files are in the default linker search path;
  222. # in particular, SCO Xenix, Unix, and ODT just want
  223. #XLIBDIRS=
  224. # Solaris and other SVR4 systems with dynamic linking probably want
  225. #XLIBDIRS=-L/usr/openwin/lib -R/usr/openwin/lib
  226. # X11R6 (on any platform) may need
  227. #XLIBS=Xt SM ICE Xext X11
  228. #XLIBDIRS=-L/usr/local/X/lib
  229. XLIBDIRS=-L/usr/X11R6/lib
  230. XLIBDIR=
  231. XLIBS=Xt Xext X11
  232. # Define whether this platform has floating point hardware:
  233. # FPU_TYPE=2 means floating point is faster than fixed point.
  234. # (This is the case on some RISCs with multiple instruction dispatch.)
  235. # FPU_TYPE=1 means floating point is at worst only slightly slower
  236. # than fixed point.
  237. # FPU_TYPE=0 means that floating point may be considerably slower.
  238. # FPU_TYPE=-1 means that floating point is always much slower than
  239. # fixed point.
  240. FPU_TYPE=1
  241. # Define the .dev module that implements thread and synchronization
  242. # primitives for this platform.
  243. # If POSIX sync primitives are used, also change the STDLIBS to include
  244. # the pthread library.
  245. #SYNC=posync
  246. # Default is No sync primitives since some platforms don't have it (HP-UX)
  247. SYNC=nosync
  248. # ------ Devices and features ------ #
  249. # Choose the language feature(s) to include. See gs.mak for details.
  250. FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev
  251. #FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev
  252. #FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(GLD)pipe.dev
  253. # The following is strictly for testing.
  254. FEATURE_DEVS_ALL=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(PSD)double.dev $(PSD)trapping.dev $(PSD)stocht.dev $(GLD)pipe.dev
  255. #FEATURE_DEVS=$(FEATURE_DEVS_ALL)
  256. # Choose whether to compile the .ps initialization files into the executable.
  257. # See gs.mak for details.
  258. COMPILE_INITS=0
  259. # Choose whether to store band lists on files or in memory.
  260. # The choices are 'file' or 'memory'.
  261. BAND_LIST_STORAGE=file
  262. # Choose which compression method to use when storing band lists in memory.
  263. # The choices are 'lzw' or 'zlib'. lzw is not recommended, because the
  264. # LZW-compatible code in Ghostscript doesn't actually compress its input.
  265. BAND_LIST_COMPRESSOR=zlib
  266. # Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
  267. # See gs.mak and sfxfd.c for more details.
  268. FILE_IMPLEMENTATION=stdio
  269. # Choose the implementation of stdio: '' for file I/O and 'c' for callouts
  270. # See gs.mak and ziodevs.c/ziodevsc.c for more details.
  271. STDIO_IMPLEMENTATION=c
  272. # Override the default device. This is set to 'display' by
  273. # unix-dll.mak when building a shared object.
  274. DISPLAY_DEV=
  275. # Define the name table capacity size of 2^(16+n).
  276. # Setting this to a non-zero value will slow down the interpreter.
  277. EXTEND_NAMES=0
  278. # Choose the device(s) to include. See devs.mak for details,
  279. # devs.mak and contrib.mak for the list of available devices.
  280. DEVICE_DEVS=$(DISPLAY_DEV) $(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
  281. #DEVICE_DEVS1=
  282. #DEVICE_DEVS2=
  283. #DEVICE_DEVS3=
  284. #DEVICE_DEVS4=
  285. #DEVICE_DEVS5=
  286. #DEVICE_DEVS6=
  287. #DEVICE_DEVS7=
  288. #DEVICE_DEVS8=
  289. #DEVICE_DEVS9=
  290. #DEVICE_DEVS10=
  291. #DEVICE_DEVS11=
  292. #DEVICE_DEVS12=
  293. #DEVICE_DEVS13=
  294. #DEVICE_DEVS14=
  295. #DEVICE_DEVS15=
  296. #DEVICE_DEVS16=
  297. #DEVICE_DEVS17=
  298. #DEVICE_DEVS18=
  299. #DEVICE_DEVS19=
  300. #DEVICE_DEVS20=
  301. DEVICE_DEVS1=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)bmp32b.dev
  302. DEVICE_DEVS2=
  303. DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev
  304. DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
  305. DEVICE_DEVS5=$(DD)uniprint.dev $(DD)ijs.dev
  306. DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev
  307. DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev
  308. DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
  309. DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev
  310. DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
  311. DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev
  312. DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
  313. DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev
  314. DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev
  315. DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
  316. DEVICE_DEVS16=
  317. DEVICE_DEVS17=
  318. DEVICE_DEVS18=
  319. DEVICE_DEVS19=
  320. DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
  321. # ---------------------------- End of options --------------------------- #
  322. # Define the name of the partial makefile that specifies options --
  323. # used in dependencies.
  324. MAKEFILE=$(GLSRCDIR)/unix-gcc.mak
  325. TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)/unixhead.mak
  326. # Define the ANSI-to-K&R dependency. There isn't one, but we do have to
  327. # detect whether we're running a version of gcc with the const optimization
  328. # bug.
  329. AK=$(GLGENDIR)/cc.tr
  330. # Define the compilation rules and flags.
  331. CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS)
  332. CC_=$(CC) `cat $(AK)` $(CCFLAGS)
  333. CCAUX=$(CC) `cat $(AK)`
  334. CC_LEAF=$(CC_) -fomit-frame-pointer
  335. # gcc can't use -fomit-frame-pointer with -pg.
  336. CC_LEAF_PG=$(CC_)
  337. # These are the specific warnings we have to turn off to compile those
  338. # specific few files that need this. We may turn off others in the future.
  339. CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional
  340. # ---------------- End of platform-specific section ---------------- #
  341. include $(GLSRCDIR)/unixhead.mak
  342. include $(GLSRCDIR)/gs.mak
  343. include $(GLSRCDIR)/lib.mak
  344. include $(PSSRCDIR)/int.mak
  345. include $(PSSRCDIR)/cfonts.mak
  346. include $(GLSRCDIR)/jpeg.mak
  347. # zlib.mak must precede libpng.mak
  348. include $(GLSRCDIR)/zlib.mak
  349. include $(GLSRCDIR)/libpng.mak
  350. include $(GLSRCDIR)/icclib.mak
  351. include $(GLSRCDIR)/ijs.mak
  352. include $(GLSRCDIR)/devs.mak
  353. include $(GLSRCDIR)/contrib.mak
  354. include $(GLSRCDIR)/unix-aux.mak
  355. include $(GLSRCDIR)/unixlink.mak
  356. include $(GLSRCDIR)/unix-dll.mak
  357. include $(GLSRCDIR)/unix-end.mak
  358. include $(GLSRCDIR)/unixinst.mak
  359. # This has to come last so it won't be taken as the default target.
  360. $(AK):
  361. if ( $(CC) --version | egrep "^2\.7\.([01]|2(\.[^1-9]|$$))" >/dev/null ); then echo -Dconst= >$(AK); else echo -Wcast-qual -Wwrite-strings >$(AK); fi