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