NHDT->ANH, in most cases
[aNetHack.git] / sys / unix / hints / macosx
blob479884d1550265cea1a4b5172d8626a0767e6eb2
2 # NetHack 3.6  macosx $ANH-Date: 1447844580 2015/11/18 11:03:00 $  $ANH-Branch: master $:$ANH-Revision: 1.18 $
3 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
4 # NetHack may be freely redistributed.  See license for details.
6 #-PRE
7 # Mac OS X (Darwin) hints file
8 # This is for Mac OS X 10.4.10 (Darwin 8.10).  If this doesn't work for some
9 # other version of either Darwin or Mac OS X, make a new file for that OS,
10 # don't change this one.  And let us know about it.
11 # Useful info: http://www.opensource.apple.com/darwinsource/index.html
13 # This hints file can build several different types of installations.
14 # Edit the next section to match the type of build you need.
16 # 1. Which window system(s) should be included in this binary?
17 WANT_WIN_TTY=1
18 #WANT_WIN_X11=1
19 #WANT_WIN_QT=1
21 # 1a. What is the default window system?
22 WANT_DEFAULT=tty
23 #WANT_DEFAULT=x11
24 #WANT_DEFAULT=qt
26 # 1b. If you set WANT_WIN_QT, you need to
27 #  A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
28 #     library installation root.  (Qt4 will not work; Qt3 does not presently
29 #     compile under Leopard (MacOSX 10.5) out-of-the-box.)
30 #  B) set XPMLIB to point to the Xpm library
31 ifdef WANT_WIN_QT
32 QTDIR=/Developer/Qt
33 LIBXPM= -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib -lXpm
34 endif
36 # 2. Is this a build for a binary that will be shared among different users
37 #    or will it be private to you?
38 #    If it is shared:
39 #       - it will be owned by the user and group listed
40 #       - you MUST create the user using System Preferences (this will also
41 #         create the group if it is the same as the user)
42 #       - 'make install' must be run as "sudo make install"    
43 #WANT_SHARE_INSTALL=1
44 GAMEUID  = games
45 GAMEGRP  = $(GAMEUID)
48 #CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
49 CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN
52 # You shouldn't need to change anything below here.
55 # XXX -g vs -O should go here, -I../include goes in the makefile
56 CFLAGS=-g -I../include
57 CFLAGS+=-DNOCLIPPING -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
58 CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
60 ifdef WANT_WIN_TTY
61 WINSRC = $(WINTTYSRC)
62 WINOBJ = $(WINTTYOBJ)
63 WINLIB = $(WINTTYLIB)
64 WINTTYLIB=-lncurses
65 else
66 CFLAGS += -DNOTTYGRAPHICS
67 endif
69 ifdef WANT_WIN_X11
70 WINSRC += $(WINX11SRC)
71 WINOBJ += $(WINX11OBJ)
72 WINLIB += $(WINX11LIB)
73 LFLAGS=-L/usr/X11R6/lib
74 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
75 POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir)
76 CFLAGS += -DX11_GRAPHICS
77 endif
79 ifdef WANT_WIN_QT
80 CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
81 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
82 LINK=g++
83 WINSRC += $(WINQTSRC)
84 WINLIB += $(WINQTLIB) $(LIBXPM)
85 WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
86 WINLIB += -framework AGL
87 ifdef WANT_WIN_X11
88         # prevent duplicate tile.o in WINOBJ
89 WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
90 ifdef WANT_WIN_TTY
91 WINOBJ += $(WINTTYOBJ)
92 endif
93 else
94 WINOBJ += $(WINQTOBJ)
95 endif
96 # XXX if /Developer/qt exists and QTDIR not set, use that
97 ifndef QTDIR
98 $(error QTDIR not defined in the environment or Makefile)
99 endif
100 # XXX make sure QTDIR points to something reasonable
101 else
102 LINK=$(CC)
103 endif
105 ifdef WANT_SHARE_INSTALL
106 # NB: do NOT use $(wildcard ~$(GAMEUID)) since the user may not exist yet.
107 PREFIX:=/Users/$(GAMEUID)
108 SHELLDIR=$(PREFIX)/bin
109 HACKDIR=$(PREFIX)/nethackdir
110 INSTDIR=$(HACKDIR)
111 VARDIR=$(HACKDIR)
112 CHOWN=chown
113 CHGRP=chgrp
114 # We run sgid so the game has access to both HACKDIR and user preferences.
115 GAMEPERM = 02755
116 VARFILEPERM = 0664
117 VARDIRPERM = 0775
118 ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
119 # make sure we have group GAMEUID and group GAMEGRP
120 PREINSTALL= . sys/unix/hints/macosx.sh user $(GAMEUID); . sys/unix/hints/macosx.sh group $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
121 POSTINSTALL= touch $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf
122 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
123 else
124 PREFIX:=$(wildcard ~)
125 SHELLDIR=$(PREFIX)/bin
126 HACKDIR=$(PREFIX)/nethackdir
127 INSTDIR=$(HACKDIR)
128 VARDIR=$(HACKDIR)
129 CHOWN=true
130 CHGRP=true
131 GAMEPERM = 0700
132 VARFILEPERM = 0600
133 VARDIRPERM = 0700
134 ifdef WANT_WIN_X11
135 # XXX install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
136 endif
137 endif
140 # ~/Library/Preferences/NetHack Defaults
141 # OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
142 # OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
144 # Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
145 # package under the docs directory).