[ --disable-worldscore disable worldscore support], ,AC_DEFINE(WORLD_SCORE, 1, [Allow the game to send scores to the score server]))
AC_ARG_ENABLE(chuukei,
[ --enable-chuukei enable internet chuukei support], AC_DEFINE(CHUUKEI, 1, [Chuukei mode]))
+AC_ARG_ENABLE([cocoa],
+[ --enable-cocoa enable a Cocoa user interface (OS X only)],
+AC_DEFINE([MACH_O_COCOA], [1], [Use a Cocoa interface (OS X only)]), [])
+AM_CONDITIONAL([COCOA], [test x$enable_cocoa = xyes])
+if test x"$enable_cocoa" = yes; then
+AC_LANG_OBJC
+fi
dnl Checks for libraries.
dnl Replace `main' with a function in -lncurses:
$(angband_files)
endif
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+appdatadir = $(APPRES)/lib/edit
+appdata_DATA = \
+ $(angband_files)
+endif
$(angband_files)
endif
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+appfiledir = $(APPRES)/lib/file
+appfile_DATA = \
+ $(angband_files)
+endif
\ No newline at end of file
$(angband_files)
endif
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+apphelpdir = $(APPRES)/lib/help
+apphelp_DATA = \
+ $(angband_files)
+endif
$(angband_files)
endif
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+appprefdir = $(APPRES)/lib/pref
+apppref_DATA = \
+ $(angband_files)
+endif
angband_files = \
8x8.bmp
+angband4_conf = list.txt
+angband4_tile_files = \
+ old/8x8.png \
+ adam-bolt/16x16.png
+
EXTRA_DIST = \
- $(angband_files)
+ $(angband_files) $(angband4_conf) $(angband4_tile_files)
if SET_GID
angbanddir = @DEFAULT_PATH@xtra/graf
$(angband_files)
endif
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+appgrafdir = $(APPRES)/lib/xtra/graf
+appgraf_DATA = \
+ $(angband4_conf)
+nobase_appgraf_DATA = \
+ $(angband4_tile_files)
+endif
sound.cfg \
$(sound_files) \
se_maoudamashii_voice_monster01.wav
+
+if COCOA
+# APPNAME to APPRES duplicate what's in src/Makefile.am. It would be nice to
+# avoid that, but until then, they should match.
+APPNAME = $(PACKAGE_NAME)
+APPDIR = $(APPNAME).app
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPRES = $(APPCONT)/Resources
+
+appsounddir = $(APPRES)/lib/xtra/sound
+appsound_DATA = \
+ sound.cfg $(sound_files)
+endif
Download the binary archive for Macintosh.
Unpack it, and click hengband to play.
+For Mac OS X with XCode installed, the Unix instructions can work to build a
+version usable from a terminal. If XQuartz, https://www.xquartz.org , is
+installed, X11 will be used for display.
+For Mac OS X 7 or later with XCode installed, a native version can be built by
+downloading the source archive and running
+
+tar -zxvf hengband-x.x.x.tar.gz
+cd hengband-x.x.x
+./configure --disable-japanese --enable-cocoa --without-x
+make install
+
+from a terminal where you substitute x.x.x with the version number you
+downloaded. That will build hengband.app in the hengband-x.x.x directory;
+you can then move hengband.app to where you want it to be.
----- Basic for Playing ------
makefile.bcc makefile.std makefile.dos makefile.ibm \
readdib.c wall.bmp
+cocoa_icon_files = \
+ cocoa/hengband_Icons.icns \
+ cocoa/Save.icns \
+ cocoa/Edit.icns \
+ cocoa/Data.icns
+cocoa_plist_template = cocoa/Angband-Cocoa.xml
+cocoa_plist_files = \
+ cocoa/CommandMenu.plist
+cocoa_en_nib_files = \
+ cocoa/en.lproj/MainMenu.nib/designable.nib \
+ cocoa/en.lproj/MainMenu.nib/keyedobjects.nib
+
EXTRA_DIST = \
- gcc-wrap
+ gcc-wrap \
+ $(cocoa_icon_files) \
+ $(cocoa_plist_template) \
+ $(cocoa_plist_files) \
+ $(cocoa_en_nib_files)
+
+if COCOA
+hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c
+AM_CFLAGS = -mmacosx-version-min=10.7
+AM_OBJCFLAGS = -mmacosx-version-min=10.7
+hengband_LDFLAGS = -framework cocoa $(AM_LDFLAGS)
+hengband_LINK = MACOSX_DEPLOYMENT_TARGET=10.7 $(OBJCLINK) $(hengband_LDFLAGS) $(LDFLAGS) -o $@
+APPNAME = $(PACKAGE_NAME)
+APPEXE = hengband
+APPDIR = $(APPNAME).app
+BUNDLE_IDENTIFIER = jp.osdn.hengband
+BUNDLE_VERSION = $(PACKAGE_VERSION)
+# Be careful with characters (like '&') in the copyright that have special
+# meanings to sed.
+COPYRIGHT = (c) Mr. Hoge and many others
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPBIN = $(APPCONT)/MacOS
+APPRES = $(APPCONT)/Resources
+appbin_PROGRAMS = $(APPEXE)
+appbindir = $(APPBIN)
+dist_appicon_DATA = $(cocoa_icon_files)
+appicondir = $(APPRES)
+appplist_DATA = $(cocoa_plist_files)
+appplistdir = $(APPRES)
+appennib_DATA = $(cocoa_en_nib_files)
+appennibdir = $(APPRES)/en.lproj/MainMenu.nib
+else
+EXTRA_hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c
+hengband_LINK = $(LINK)
+endif
COMPILE = $(srcdir)/gcc-wrap $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
chgrp "@GAMEGROUP@" "$(DESTDIR)$(bindir)/hengband"
chmod g+s "$(DESTDIR)$(bindir)/hengband"
endif
+
+if COCOA
+# Create lib/info and lib/xtra within the application bundle since not
+# currently installing anything to them. Other relevant lib directories
+# should be created from the Makefiles in the lib directory.
+install-data-local:
+ @mkdir -p $(APPCONT)
+ @mkdir -p $(APPRES)/lib/info
+ @mkdir -p $(APPRES)/lib/xtra
+ sed -e 's/\$$VERSION\$$/$(PACKAGE_VERSION)/' \
+ -e 's/\$$COPYRIGHT\$$/$(COPYRIGHT)/' \
+ -e 's/\$$NAME\$$/$(APPNAME)/' \
+ -e 's/\$$EXECUTABLE\$$/$(APPEXE)/' \
+ -e 's/\$$BUNDLE_VERSION\$$/$(BUNDLE_VERSION)/' \
+ -e 's/\$$BUNDLE_IDENTIFIER\$$/$(BUNDLE_IDENTIFIER)/' \
+ $(srcdir)/$(cocoa_plist_template) > $(APPCONT)/Info.plist
+
+distclean-local:
+ -rm $(APPCONT)/Info.plist
+
+endif