1# Copyright (C) 1997, 2001 artofcode LLC. 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: macosx.mak,v 1.28 2005/08/31 05:52:32 ray Exp $ 17# makefile for MacOS X/darwin/gcc/framework 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 57FRAMEWORK_NAME=Ghostscript 58FRAMEWORK_EXT=.framework 59prefix = /Library/Frameworks/$(FRAMEWORK_NAME)$(FRAMEWORK_EXT) 60exec_prefix = $(prefix) 61bindir = $(exec_prefix)/bin 62scriptdir = $(bindir) 63libdir = $(exec_prefix)/lib 64mandir = $(prefix)/man 65man1ext = 1 66datadir = $(prefix)/Resources 67gsdatadir = $(prefix)/Versions/$(GS_DOT_VERSION)/Resources 68 69docdir=$(gsdatadir)/doc 70exdir=$(gsdatadir)/examples 71GS_DOCDIR=$(docdir) 72 73# Define the default directory/ies for the runtime 74# initialization, resource and font files. Separate multiple directories with a :. 75 76GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(datadir)/fonts:/Library/Fonts:/System/Library/Fonts 77 78# Define whether or not searching for initialization files should always 79# look in the current directory first. This leads to well-known security 80# and confusion problems, but users insist on it. 81# NOTE: this also affects searching for files named on the command line: 82# see the "File searching" section of Use.htm for full details. 83# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. 84 85SEARCH_HERE_FIRST=1 86 87# Define the name of the interpreter initialization file. 88# (There is no reason to change this.) 89 90GS_INIT=gs_init.ps 91 92# Choose generic configuration options. 93 94# -DDEBUG 95# includes debugging features (-Z switch) in the code. 96# Code runs substantially slower even if no debugging switches 97# are set. 98# -DNOPRIVATE 99# makes private (static) procedures and variables public, 100# so they are visible to the debugger and profiler. 101# No execution time or space penalty. 102 103GENOPT= 104 105# Choose capability options. 106 107# -DHAVE_MKSTEMP 108# uses mkstemp instead of mktemp 109# This gets rid of several security warnings that look 110# ominous. Enable this if you wish to get rid of them. 111 112CAPOPT= -DHAVE_MKSTEMP 113 114# Define the name of the executable file. 115 116GS=gs 117 118# Define the name of a pre-built executable that can be invoked at build 119# time. Currently, this is only needed for compiled fonts. The usual 120# alternatives are: 121# - the standard name of Ghostscript on your system (typically `gs'): 122BUILD_TIME_GS=gs 123# - the name of the executable you are building now. If you choose this 124# option, then you must build the executable first without compiled fonts, 125# and then again with compiled fonts. 126#BUILD_TIME_GS=$(BINDIR)/$(GS) -I$(PSLIBDIR) 127 128# Define the directories for debugging and profiling binaries, relative to 129# the standard binaries. 130 131DEBUGRELDIR=../debugobj 132PGRELDIR=../pgobj 133SORELDIR=../soobj 134 135# Define the directory where the IJG JPEG library sources are stored, 136# and the major version of the library that is stored there. 137# You may need to change this if the IJG library version changes. 138# See jpeg.mak for more information. 139 140JSRCDIR=jpeg 141JVERSION=6 142 143# Note: if a shared library is used, it may not contain the 144# D_MAX_BLOCKS_IN_MCU patch, and thus may not be able to read 145# some older JPEG streams that violate the standard. If the JPEG 146# library built from local sources, the patch will be applied. 147 148SHARE_JPEG=0 149JPEG_NAME=jpeg 150 151# Define the directory where the PNG library sources are stored, 152# and the version of the library that is stored there. 153# You may need to change this if the libpng version changes. 154# See libpng.mak for more information. 155 156PSRCDIR=libpng 157PVERSION=10208 158 159# Choose whether to use a shared version of the PNG library, and if so, 160# what its name is. 161# See gs.mak and Make.htm for more information. 162 163SHARE_LIBPNG=0 164LIBPNG_NAME=png 165 166# Define the directory where the zlib sources are stored. 167# See zlib.mak for more information. 168 169ZSRCDIR=zlib 170 171# Choose whether to use a shared version of the zlib library, and if so, 172# what its name is (usually libz, but sometimes libgz). 173# See gs.mak and Make.htm for more information. 174 175SHARE_ZLIB=1 176#ZLIB_NAME=gz 177ZLIB_NAME=z 178 179# Choose shared or compiled in libjbig2dec and source location 180 181SHARE_JBIG2=0 182JBIG2SRCDIR=jbig2dec 183 184# Define the directory where the icclib source are stored. 185# See icclib.mak for more information 186 187ICCSRCDIR=icclib 188 189# Define the directory where the ijs source is stored, 190# and the process forking method to use for the server. 191# See ijs.mak for more information. 192 193IJSSRCDIR=ijs 194IJSEXECTYPE=unix 195 196# Define how to build the library archives. (These are not used in any 197# standard configuration.) 198 199AR=ar 200ARFLAGS=qc 201RANLIB=ranlib 202 203# ------ Platform-specific options ------ # 204 205# Define the name of the C compiler. 206 207CC=cc 208 209# Define the name of the linker for the final link step. 210# Normally this is the same as the C compiler. 211 212CCLD=$(CC) 213 214# Define the default gcc flags. 215# Note that depending whether or not we are running a version of gcc with 216# the 2.7.0-2.7.2 optimizer bug, either "-Dconst=" or 217# "-Wcast-qual -Wwrite-strings" is automatically included. 218 219GCFLAGS=-Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes \ 220 -fno-builtin -fno-common -DHAVE_STDINT_H 221 222# Define the added flags for standard, debugging, profiling 223# and shared object builds. 224 225CFLAGS_STANDARD= 226CFLAGS_DEBUG=-g -O 227CFLAGS_PROFILE=-pg -O2 228CFLAGS_SO=-dynamic 229 230# Define the other compilation flags. Add at most one of the following: 231# -DBSD4_2 for 4.2bsd systems. 232# -DSYSV for System V or DG/UX. 233# -DSYSV -D__SVR3 for SCO ODT, ISC Unix 2.2 or before, 234# or any System III Unix, or System V release 3-or-older Unix. 235# -DSVR4 -DSVR4_0 (not -DSYSV) for System V release 4.0. 236# -DSVR4 (not -DSYSV) for System V release 4.2 (or later) and Solaris 2. 237# XCFLAGS can be set from the command line. 238# We don't include -ansi, because this gets in the way of the platform- 239# specific stuff that <math.h> typically needs; nevertheless, we expect 240# gcc to accept ANSI-style function prototypes and function definitions. 241XCFLAGS= 242 243CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS) 244 245# Define platform flags for ld. 246# SunOS 4.n may need -Bstatic. 247# Solaris 2.6 (and possibly some other versions) with any of the SHARE_ 248# parameters set to 1 may need 249# -R /usr/local/xxx/lib:/usr/local/lib 250# giving the full path names of the shared library directories. 251# XLDFLAGS can be set from the command line. 252XLDFLAGS= 253 254LDFLAGS=$(XLDFLAGS) 255 256# Define any extra libraries to link into the executable. 257# ISC Unix 2.2 wants -linet. 258# SCO Unix needs -lsocket if you aren't including the X11 driver. 259# SVR4 may need -lnsl. 260# Solaris may need -lnsl -lsocket -lposix4. 261# (Libraries required by individual drivers are handled automatically.) 262 263EXTRALIBS= 264 265# Define the standard libraries to search at the end of linking. 266# Most platforms require -lpthread for the POSIX threads library; 267# on FreeBSD, change -lpthread to -lc_r; BSDI and perhaps some others 268# include pthreads in libc and don't require any additional library. 269# All reasonable platforms require -lm, but Rhapsody and perhaps one or 270# two others fold libm into libc and don't require any additional library. 271 272# both of these are included in the stdlib on darwin/osx 273#STDLIBS=-lpthread -lm 274 275# Define the include switch(es) for the X11 header files. 276# This can be null if handled in some other way (e.g., the files are 277# in /usr/include, or the directory is supplied by an environment variable); 278# in particular, SCO Xenix, Unix, and ODT just want 279XINCLUDE= 280# Note that x_.h expects to find the header files in $(XINCLUDE)/X11, 281# not in $(XINCLUDE). 282 283#XINCLUDE=-I/usr/X11R6/include 284 285# Define the directory/ies and library names for the X11 library files. 286# XLIBDIRS is for ld and should include -L; XLIBDIR is for LD_RUN_PATH 287# (dynamic libraries on SVR4) and should not include -L. 288# Newer SVR4 systems can use -R in XLIBDIRS rather than setting XLIBDIR. 289# Both can be null if these files are in the default linker search path; 290# in particular, SCO Xenix, Unix, and ODT just want 291XLIBDIRS= 292# Solaris and other SVR4 systems with dynamic linking probably want 293#XLIBDIRS=-L/usr/openwin/lib -R/usr/openwin/lib 294# X11R6 (on any platform) may need 295#XLIBS=Xt SM ICE Xext X11 296 297#XLIBDIRS=-L/usr/local/X/lib 298#XLIBDIRS=-L/usr/X11R6/lib 299XLIBDIR= 300#XLIBS=Xt Xext X11 301XLIBS= 302 303# Define whether this platform has floating point hardware: 304# FPU_TYPE=2 means floating point is faster than fixed point. 305# (This is the case on some RISCs with multiple instruction dispatch.) 306# FPU_TYPE=1 means floating point is at worst only slightly slower 307# than fixed point. 308# FPU_TYPE=0 means that floating point may be considerably slower. 309# FPU_TYPE=-1 means that floating point is always much slower than 310# fixed point. 311 312# might as well be true on ppc 313FPU_TYPE=2 314 315# Define the .dev module that implements thread and synchronization 316# primitives for this platform. 317 318# If POSIX sync primitives are used, also change the STDLIBS to include 319# the pthread library. 320#SYNC=posync 321 322# Default is No sync primitives since some platforms don't have it (HP-UX) 323SYNC=nosync 324 325# ------ Devices and features ------ # 326 327# Choose the language feature(s) to include. See gs.mak for details. 328 329FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev 330#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev 331#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(GLD)pipe.dev 332# The following is strictly for testing. 333FEATURE_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 334#FEATURE_DEVS=$(FEATURE_DEVS_ALL) 335 336# Choose whether to compile the .ps initialization files into the executable. 337# See gs.mak for details. 338 339COMPILE_INITS=0 340 341# Choose whether to store band lists on files or in memory. 342# The choices are 'file' or 'memory'. 343 344BAND_LIST_STORAGE=file 345 346# Choose which compression method to use when storing band lists in memory. 347# The choices are 'lzw' or 'zlib'. 348 349BAND_LIST_COMPRESSOR=zlib 350 351# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'. 352# See gs.mak and sfxfd.c for more details. 353 354FILE_IMPLEMENTATION=stdio 355 356# Choose the implementation of stdio: '' for file I/O and 'c' for callouts 357# See gs.mak and ziodevs.c/ziodevsc.c for more details. 358 359STDIO_IMPLEMENTATION=c 360 361# Override the default device. This is set to 'display' by 362# unix-dll.mak when building a shared object. 363DISPLAY_DEV= 364 365# Define the name table capacity size of 2^(16+n). 366# Setting this to a non-zero value will slow down the interpreter. 367 368EXTEND_NAMES=0 369 370# Choose the device(s) to include. See devs.mak for details, 371# devs.mak and contrib.mak for the list of available devices. 372 373# use png output by default 374DEVICE_DEVS=$(DD)png16m.dev $(DD)pnggray.dev $(DD)pngmono.dev 375#DEVICE_DEVS=$(DISPLAY_DEV) 376 377# most devices are disabled by default since file conversion is the 378# the major demand on macos 379DEVICE_DEVS1= 380DEVICE_DEVS2= 381DEVICE_DEVS3= 382DEVICE_DEVS4= 383DEVICE_DEVS5= 384DEVICE_DEVS6= 385DEVICE_DEVS7= 386DEVICE_DEVS8= 387DEVICE_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 388DEVICE_DEVS10= 389DEVICE_DEVS11= 390DEVICE_DEVS12= 391#DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev 392DEVICE_DEVS13=$(DD)png16.dev $(DD)png256.dev $(DD)pngalpha.dev 393DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev 394DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev 395DEVICE_DEVS16=$(DD)bbox.dev 396DEVICE_DEVS17= 397DEVICE_DEVS18= 398DEVICE_DEVS19= 399DEVICE_DEVS20= 400 401# ---------------------------- End of options --------------------------- # 402 403# Define the name of the partial makefile that specifies options -- 404# used in dependencies. 405 406MAKEFILE=$(GLSRCDIR)/macosx.mak 407TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)/unixhead.mak 408 409# Define the auxiliary programs dependency. We don't use this. 410 411AK= 412 413# Define the compilation rules and flags. 414 415CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS) 416CC_=$(CC) $(CCFLAGS) 417CCAUX=$(CC) 418# These are the specific warnings we have to turn off to compile those 419# specific few files that need this. We may turn off others in the future. 420CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional 421 422# ---------------- End of platform-specific section ---------------- # 423 424include $(GLSRCDIR)/unixhead.mak 425include $(GLSRCDIR)/gs.mak 426include $(GLSRCDIR)/lib.mak 427include $(PSSRCDIR)/int.mak 428include $(PSSRCDIR)/cfonts.mak 429include $(GLSRCDIR)/jpeg.mak 430# zlib.mak must precede libpng.mak 431include $(GLSRCDIR)/zlib.mak 432include $(GLSRCDIR)/libpng.mak 433include $(GLSRCDIR)/jbig2.mak 434include $(GLSRCDIR)/icclib.mak 435include $(GLSRCDIR)/ijs.mak 436include $(GLSRCDIR)/devs.mak 437include $(GLSRCDIR)/contrib.mak 438include $(GLSRCDIR)/unix-aux.mak 439include $(GLSRCDIR)/unixlink.mak 440#include $(GLSRCDIR)/unix-dll.mak 441include $(GLSRCDIR)/macos-fw.mak 442include $(GLSRCDIR)/unix-end.mak 443include $(GLSRCDIR)/unixinst.mak 444 445