xref: /plan9/sys/src/cmd/gs/src/unix-gcc.mak (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1#    Copyright (C) 1997, 2000 Aladdin Enterprises.  All rights reserved.
2#
3# This software is provided AS-IS with no warranty, either express or
4# implied.
5#
6# This software is distributed under license and may not be copied,
7# modified or distributed except as expressly authorized under the terms
8# of the license contained in the file LICENSE in this distribution.
9#
10# For more information about licensing, please refer to
11# http://www.ghostscript.com/licensing/. For information on
12# commercial licensing, go to http://www.artifex.com/licensing/ or
13# contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14# San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15
16# $Id: unix-gcc.mak,v 1.50 2005/08/31 05:52:32 ray Exp $
17# makefile for Unix/gcc/X11 configuration.
18
19# ------------------------------- Options ------------------------------- #
20
21####### The following are the only parts of the file you should need to edit.
22
23# Define the directory for the final executable, and the
24# source, generated intermediate file, and object directories
25# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
26
27BINDIR=./bin
28GLSRCDIR=./src
29GLGENDIR=./obj
30GLOBJDIR=./obj
31PSSRCDIR=./src
32PSLIBDIR=./lib
33PSGENDIR=./obj
34PSOBJDIR=./obj
35
36# Do not edit the next group of lines.
37
38#include $(COMMONDIR)/gccdefs.mak
39#include $(COMMONDIR)/unixdefs.mak
40#include $(COMMONDIR)/generic.mak
41include $(GLSRCDIR)/version.mak
42DD=$(GLGENDIR)/
43GLD=$(GLGENDIR)/
44PSD=$(PSGENDIR)/
45
46# ------ Generic options ------ #
47
48# Define the installation commands and target directories for
49# executables and files.  The commands are only relevant to `make install';
50# the directories also define the default search path for the
51# initialization files (gs_*.ps) and the fonts.
52
53INSTALL = $(GLSRCDIR)/instcopy -c
54INSTALL_PROGRAM = $(INSTALL) -m 755
55INSTALL_DATA = $(INSTALL) -m 644
56
57prefix = /usr/local
58exec_prefix = $(prefix)
59bindir = $(exec_prefix)/bin
60scriptdir = $(bindir)
61libdir = $(exec_prefix)/lib
62mandir = $(prefix)/man
63man1ext = 1
64datadir = $(prefix)/share
65gsdir = $(datadir)/ghostscript
66gsdatadir = $(gsdir)/$(GS_DOT_VERSION)
67
68docdir=$(gsdatadir)/doc
69exdir=$(gsdatadir)/examples
70GS_DOCDIR=$(docdir)
71
72# Define the default directory/ies for the runtime
73# initialization, resource and font files.  Separate multiple directories with a :.
74
75GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(gsdir)/fonts
76
77# Define whether or not searching for initialization files should always
78# look in the current directory first.  This leads to well-known security
79# and confusion problems, but users insist on it.
80# NOTE: this also affects searching for files named on the command line:
81# see the "File searching" section of Use.htm for full details.
82# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
83
84SEARCH_HERE_FIRST=1
85
86# Define the name of the interpreter initialization file.
87# (There is no reason to change this.)
88
89GS_INIT=gs_init.ps
90
91# Choose generic configuration options.
92
93# -DDEBUG
94#	includes debugging features (-Z switch) in the code.
95#	  Code runs substantially slower even if no debugging switches
96#	  are set.
97# -DNOPRIVATE
98#	makes private (static) procedures and variables public,
99#	  so they are visible to the debugger and profiler.
100#	  No execution time or space penalty.
101
102GENOPT=
103
104# Choose capability options.
105
106# -DHAVE_MKSTEMP
107#	uses mkstemp instead of mktemp
108#		This gets rid of several security warnings that look
109#		ominous.  Enable this if you wish to get rid of them.
110
111CAPOPT= -DHAVE_MKSTEMP
112
113# Define the name of the executable file.
114
115GS=gs
116
117# Define the name of a pre-built executable that can be invoked at build
118# time.  Currently, this is only needed for compiled fonts.  The usual
119# alternatives are:
120#   - the standard name of Ghostscript on your system (typically `gs'):
121BUILD_TIME_GS=gs
122#   - the name of the executable you are building now.  If you choose this
123# option, then you must build the executable first without compiled fonts,
124# and then again with compiled fonts.
125#BUILD_TIME_GS=$(BINDIR)/$(GS) -I$(PSLIBDIR)
126
127# Define the directories for debugging and profiling binaries, relative to
128# the standard binaries.
129
130DEBUGRELDIR=../debugobj
131PGRELDIR=../pgobj
132
133# Define the directory where the IJG JPEG library sources are stored,
134# and the major version of the library that is stored there.
135# You may need to change this if the IJG library version changes.
136# See jpeg.mak for more information.
137
138JSRCDIR=jpeg
139JVERSION=6
140
141# Note: if a shared library is used, it may not contain the
142# D_MAX_BLOCKS_IN_MCU patch, and thus may not be able to read
143# some older JPEG streams that violate the standard. If the JPEG
144# library built from local sources, the patch will be applied.
145
146SHARE_JPEG=0
147JPEG_NAME=jpeg
148
149# Define the directory where the PNG library sources are stored,
150# and the version of the library that is stored there.
151# You may need to change this if the libpng version changes.
152# See libpng.mak for more information.
153
154PSRCDIR=libpng
155PVERSION=10208
156
157# Choose whether to use a shared version of the PNG library, and if so,
158# what its name is.
159# See gs.mak and Make.htm for more information.
160
161SHARE_LIBPNG=0
162LIBPNG_NAME=png
163
164# Define the directory where the zlib sources are stored.
165# See zlib.mak for more information.
166
167ZSRCDIR=zlib
168
169# Choose whether to use a shared version of the zlib library, and if so,
170# what its name is (usually libz, but sometimes libgz).
171# See gs.mak and Make.htm for more information.
172
173SHARE_ZLIB=0
174#ZLIB_NAME=gz
175ZLIB_NAME=z
176
177# Choose shared or compiled in libjbig2dec and source location
178SHARE_JBIG2=0
179JBIG2SRCDIR=jbig2dec
180
181# Define the directory where the icclib source are stored.
182# See icclib.mak for more information
183
184ICCSRCDIR=icclib
185
186# Define the directory where the ijs source is stored,
187# and the process forking method to use for the server.
188# See ijs.mak for more information.
189
190IJSSRCDIR=ijs
191IJSEXECTYPE=unix
192
193# Define how to build the library archives.  (These are not used in any
194# standard configuration.)
195
196AR=ar
197ARFLAGS=qc
198RANLIB=ranlib
199
200# ------ Platform-specific options ------ #
201
202# Define the name of the C compiler.
203
204CC=gcc
205
206# Define the name of the linker for the final link step.
207# Normally this is the same as the C compiler.
208
209CCLD=$(CC)
210
211# Define the default gcc flags.
212# Note that depending whether or not we are running a version of gcc with
213# the 2.7.0-2.7.2 optimizer bug, either "-Dconst=" or
214# "-Wcast-qual -Wwrite-strings" is automatically included.
215
216GCFLAGS=-Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -fno-builtin -fno-common
217
218# Define the added flags for standard, debugging, profiling
219# and shared object builds.
220
221CFLAGS_STANDARD=-O2
222CFLAGS_DEBUG=-g -O0
223CFLAGS_PROFILE=-pg -O2
224CFLAGS_SO=-fPIC
225
226# Define the other compilation flags.  Add at most one of the following:
227#	-DBSD4_2 for 4.2bsd systems.
228#	-DSYSV for System V or DG/UX.
229# 	-DSYSV -D__SVR3 for SCO ODT, ISC Unix 2.2 or before,
230#	   or any System III Unix, or System V release 3-or-older Unix.
231#	-DSVR4 -DSVR4_0 (not -DSYSV) for System V release 4.0.
232#	-DSVR4 (not -DSYSV) for System V release 4.2 (or later) and Solaris 2.
233# XCFLAGS can be set from the command line.
234# We don't include -ansi, because this gets in the way of the platform-
235#   specific stuff that <math.h> typically needs; nevertheless, we expect
236#   gcc to accept ANSI-style function prototypes and function definitions.
237XCFLAGS=
238
239CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
240
241# Define platform flags for ld.
242# SunOS 4.n may need -Bstatic.
243# Solaris 2.6 (and possibly some other versions) with any of the SHARE_
244# parameters set to 1 may need
245#	-R /usr/local/xxx/lib:/usr/local/lib
246# giving the full path names of the shared library directories.
247# XLDFLAGS can be set from the command line.
248XLDFLAGS=
249
250LDFLAGS=$(XLDFLAGS)
251
252# Define any extra libraries to link into the executable.
253# ISC Unix 2.2 wants -linet.
254# SCO Unix needs -lsocket if you aren't including the X11 driver.
255# SVR4 may need -lnsl.
256# Solaris may need -lnsl -lsocket -lposix4.
257# (Libraries required by individual drivers are handled automatically.)
258
259EXTRALIBS=
260
261# Define the standard libraries to search at the end of linking.
262# Most platforms require -lpthread for the POSIX threads library;
263# on FreeBSD, change -lpthread to -lc_r; BSDI and perhaps some others
264# include pthreads in libc and don't require any additional library.
265# All reasonable platforms require -lm, but Rhapsody and perhaps one or
266# two others fold libm into libc and don't require any additional library.
267
268#STDLIBS=-lpthread -lm
269
270# Since the default build is for nosync, don't include pthread lib
271STDLIBS=-lm
272
273# Define the include switch(es) for the X11 header files.
274# This can be null if handled in some other way (e.g., the files are
275# in /usr/include, or the directory is supplied by an environment variable);
276# in particular, SCO Xenix, Unix, and ODT just want
277#XINCLUDE=
278# Note that x_.h expects to find the header files in $(XINCLUDE)/X11,
279# not in $(XINCLUDE).
280
281XINCLUDE=-I/usr/X11R6/include
282
283# Define the directory/ies and library names for the X11 library files.
284# XLIBDIRS is for ld and should include -L; XLIBDIR is for LD_RUN_PATH
285# (dynamic libraries on SVR4) and should not include -L.
286# Newer SVR4 systems can use -R in XLIBDIRS rather than setting XLIBDIR.
287# Both can be null if these files are in the default linker search path;
288# in particular, SCO Xenix, Unix, and ODT just want
289#XLIBDIRS=
290# Solaris and other SVR4 systems with dynamic linking probably want
291#XLIBDIRS=-L/usr/openwin/lib -R/usr/openwin/lib
292# X11R6 (on any platform) may need
293#XLIBS=Xt SM ICE Xext X11
294
295#XLIBDIRS=-L/usr/local/X/lib
296XLIBDIRS=-L/usr/X11R6/lib
297XLIBDIR=
298XLIBS=Xt Xext X11
299
300# Define whether this platform has floating point hardware:
301#	FPU_TYPE=2 means floating point is faster than fixed point.
302# (This is the case on some RISCs with multiple instruction dispatch.)
303#	FPU_TYPE=1 means floating point is at worst only slightly slower
304# than fixed point.
305#	FPU_TYPE=0 means that floating point may be considerably slower.
306#	FPU_TYPE=-1 means that floating point is always much slower than
307# fixed point.
308
309FPU_TYPE=1
310
311# Define the .dev module that implements thread and synchronization
312# primitives for this platform.
313
314# If POSIX sync primitives are used, also change the STDLIBS to include
315# the pthread library.
316#SYNC=posync
317
318# Default is No sync primitives since some platforms don't have it (HP-UX)
319SYNC=nosync
320
321# ------ Devices and features ------ #
322
323# Choose the language feature(s) to include.  See gs.mak for details.
324
325FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)fapi.dev
326#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev
327#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(GLD)pipe.dev
328# The following is strictly for testing.
329FEATURE_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
330#FEATURE_DEVS=$(FEATURE_DEVS_ALL)
331
332# Choose whether to compile the .ps initialization files into the executable.
333# See gs.mak for details.
334
335COMPILE_INITS=0
336
337# Choose whether to store band lists on files or in memory.
338# The choices are 'file' or 'memory'.
339
340BAND_LIST_STORAGE=file
341
342# Choose which compression method to use when storing band lists in memory.
343# The choices are 'lzw' or 'zlib'.
344
345BAND_LIST_COMPRESSOR=zlib
346
347# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
348# See gs.mak and sfxfd.c for more details.
349
350FILE_IMPLEMENTATION=stdio
351
352# Choose the implementation of stdio: '' for file I/O and 'c' for callouts
353# See gs.mak and ziodevs.c/ziodevsc.c for more details.
354
355STDIO_IMPLEMENTATION=c
356
357# Override the default device.  This is set to 'display' by
358# unix-dll.mak when building a shared object.
359DISPLAY_DEV=
360
361# Define the name table capacity size of 2^(16+n).
362# Setting this to a non-zero value will slow down the interpreter.
363
364EXTEND_NAMES=0
365
366# Choose the device(s) to include.  See devs.mak for details,
367# devs.mak and contrib.mak for the list of available devices.
368
369DEVICE_DEVS=$(DISPLAY_DEV) $(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
370
371#DEVICE_DEVS1=
372#DEVICE_DEVS2=
373#DEVICE_DEVS3=
374#DEVICE_DEVS4=
375#DEVICE_DEVS5=
376#DEVICE_DEVS6=
377#DEVICE_DEVS7=
378#DEVICE_DEVS8=
379#DEVICE_DEVS9=
380#DEVICE_DEVS10=
381#DEVICE_DEVS11=
382#DEVICE_DEVS12=
383#DEVICE_DEVS13=
384#DEVICE_DEVS14=
385#DEVICE_DEVS15=
386#DEVICE_DEVS16=
387#DEVICE_DEVS17=
388#DEVICE_DEVS18=
389#DEVICE_DEVS19=
390#DEVICE_DEVS20=
391
392DEVICE_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 $(DD)stcolor.dev
393DEVICE_DEVS2=$(DD)epson.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epsonc.dev $(DD)ibmpro.dev
394DEVICE_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
395DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
396DEVICE_DEVS5=$(DD)uniprint.dev $(DD)ijs.dev
397DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev
398DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev
399DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
400DEVICE_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
401DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
402DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev
403DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
404DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
405DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
406DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
407DEVICE_DEVS16=$(DD)bbox.dev
408
409DEVICE_DEVS17=
410DEVICE_DEVS18=
411DEVICE_DEVS19=
412DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
413DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
414
415# ---------------------------- End of options --------------------------- #
416
417# Define the name of the partial makefile that specifies options --
418# used in dependencies.
419
420MAKEFILE=$(GLSRCDIR)/unix-gcc.mak
421TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)/unixhead.mak
422
423# Define the auxiliary programs dependency. There aren't any, but we use
424# this as a hook to detect whether we're running a version of gcc with
425# the const optimization bug.
426
427AK=$(GLGENDIR)/cc.tr
428
429# Define the compilation rules and flags.
430
431CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS) -DGX_COLOR_INDEX_TYPE='unsigned long long'
432CC_=$(CC) `cat $(AK)` $(CCFLAGS)
433CCAUX=$(CC) `cat $(AK)`
434# These are the specific warnings we have to turn off to compile those
435# specific few files that need this.  We may turn off others in the future.
436CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional
437
438# ---------------- End of platform-specific section ---------------- #
439
440include $(GLSRCDIR)/unixhead.mak
441include $(GLSRCDIR)/gs.mak
442include $(GLSRCDIR)/lib.mak
443include $(PSSRCDIR)/int.mak
444include $(PSSRCDIR)/cfonts.mak
445include $(GLSRCDIR)/jpeg.mak
446# zlib.mak must precede libpng.mak
447include $(GLSRCDIR)/zlib.mak
448include $(GLSRCDIR)/libpng.mak
449include $(GLSRCDIR)/jbig2.mak
450include $(GLSRCDIR)/icclib.mak
451include $(GLSRCDIR)/ijs.mak
452include $(GLSRCDIR)/devs.mak
453include $(GLSRCDIR)/contrib.mak
454include $(GLSRCDIR)/unix-aux.mak
455include $(GLSRCDIR)/unixlink.mak
456include $(GLSRCDIR)/unix-dll.mak
457include $(GLSRCDIR)/unix-end.mak
458include $(GLSRCDIR)/unixinst.mak
459
460# This has to come last so it won't be taken as the default target.
461$(AK):
462	if ( $(CC) --version | egrep "^2\.7\.([01]|2(\.[^1-9]|$$))" >/dev/null ); then echo -Dconst= >$(AK); else echo -Wcast-qual -Wwrite-strings >$(AK); fi
463
464# platform-specific clean-up
465# this makefile is intended to be hand edited so we don't distribute
466# the (presumedly modified) version in the top level directory
467distclean : clean config-clean
468	-$(RM) Makefile
469
470maintainer-clean : distclean
471	# nothing special to do
472
473
474