2 Compiling Amiga NetHack 3.4
3 Last Revision: 21 February 2002 for NetHack 3.4.2
6 We would like to thank each and every one of the people who took
7 the time and effort to report bugs to us. THANK YOU! (And keep
12 The Amiga-specific documentation has been split since the 3.1.3 release
13 - please read the file Install.ami for information specific to the
14 Amiga port before continuing.
16 If you have problems with compilation, installation, or think you have
17 found a bug in the game, please report it by electronic mail to the
18 development group at nethack-bugs@nethack.org, where it will be routed
19 to the appropriate person. Include your configuration, the version of
20 NetHack you are playing (use the 'v' command or see
21 include/patchlevel.h), and as much specific information as possible.
22 As NetHack runs on many different machines, be sure to mention that you
23 are playing the Amiga version and also mention if you are using the
24 version for mc68k or ppc.
26 If you want to find out about distributing NetHack, read the license
27 (in NetHack:license or type ?i during the game).
29 II. Compiling Amiga NetHack 3.4
31 II.A. Compilation Overview
32 Compiling NetHack is not very hard - basically you do a little
33 configuration and start make. It does, however, require a good amount
34 of disk space and time. It also needs a good bit of memory, especially
37 II.B. Basic Compilation
39 NetHack can be built with SAS/C version 6.5x. The commercial version
40 of DICE might work, but NetHack version 3.2.2 or later haven't been
41 compiled with it. The "official" compiler for NetHack 3.4 is SAS/C 6.58
42 - we have dropped support for SAS/C 5.x.
44 The Manx/Aztec port has not been tested recently and is certainly
45 broken. Anyone managing to compile NetHack with this compiler is
46 encouraged to submit context diffs of the required changes. When last
47 tested, NetHack required version 5.0B of that compiler.
49 Compiling with gcc should also work.
51 II.B.1. Introduction to Compiling NetHack
52 Before doing any compilation, read the README files distributed with
53 the source. These should familiarize you with the source tree layout
54 and what files are shared with what computers; everything in the
55 sys/amiga directory is used exclusively by the Amiga.
57 The makefile (sys/amiga/Makefile.ami) depends on certain assignments,
58 providing the developer with a fairly flexible environment. See
59 sys/amiga/Makefile.ami for assignment assumptions. DICE users should
60 see section II.B.3 for information on creating a DMakefile usable with
63 Edit config.h to your liking and system configuration. The defaults
64 should be satisfactory for most systems.
66 Read VERY CAREFULLY through the Makefile to familiarize yourself
67 with which assignments are assumed. Otherwise, you're going to get
68 something like "Insert NH: in any drive." You will need uudecode,
69 and, if you need to modify dgn_comp or lev_comp, flex, and bison.
70 The first thing Makefile.ami does is build makedefs, which handles
71 a variety of data file generation, and then lev_comp and dgn_comp
72 which compile the special levels. Makedefs will then be run to create
73 a few files, followed by a roughly alphabetically sorted compilation
74 of the entire source tree. This process will compile selected files
75 from the sys/amiga, sys/share, win/tty, and src directories, eventually
76 creating sbin/nethack. After building the main binary, a make install
77 will build the auxiliary files including help files, special levels,
78 icons, and the font files and will put these files into their final
79 positions - most will be in dlb archives (if DLB was defined in config.h).
80 The first make run should be done in NH:obj and the make install should be
81 done in NetHack:; for both runs, the makefile is NH:sys/amiga/Makefile.ami
82 (or NH:sys/amiga/DMakefile for DMake and NH:sys/amiga/Makefile.agc for
85 Note that not all the source is simple C code. If you are modifying
86 lev_comp or dgn_comp you may need bison and/or flex (depending on what
87 modifications you are making). You do not need any of these tools to
88 simply build NetHack - all the C output files are provided in the source
89 distribution. Also, the ifchange script requires a version of diff that
90 produces standard Unix format context diffs for proper operation - the
91 version shipped with SAS/C is not sufficient.
93 If you do not have bison and flex, copy the files from sys/share. The
94 include files go in include/ and the C files go in util/. If the compile
95 fails due to prototype errors for malloc and realloc, try deleting
96 the first line of lev_comp.c and dgn_comp.c.
98 II.B.2. Compiling NetHack with SAS/C version 6.58
100 NOTE WELL - Amiga NetHack has dropped support for SAS/C version 5.
101 This version of NetHack was developed with SAS/C 6.58. Earlier versions
102 than version of the compiler are known to cause problems - don't use them.
104 A couple of notes and warnings from the SAS/C users on the team:
106 * Included in the SAS/C port is code for generating a SnapShot.tb
107 file upon catching various internal disasters. That is why the
108 debug=l flag is in the makefile. This adds about 270K to the disk
109 image, but it does not increase the run time memory requirements.
111 * The 5.10b optimizer did not produce correct code for NetHack. The
112 current optimizer has not been tested.
114 II.B.3. Compiling NetHack with the commercial version of DICE
116 IMPORTANT NOTE: If you are using DMake, you need to create DMakefile
117 from Makefile.ami. Do the following:
120 edit from Makefile.ami to DMakefile with mkdmake opt w255
122 Some versions of DMake have been known to crash horribly on the
123 makefile - if this happens, you'll need to download another make
124 utility, such as AMake (ftp://ftp.dragonfire.net/amiga/utils/amake),
125 which will run in DMake-compatibility mode if invoked with the -C switch
126 (e.g. "amake -C -f NH:sys/amiga/DMakefile", or just
127 "alias dmake amake -C").
129 SECOND IMPORTANT NOTE: The score list is currently disabled when
130 compiling under DICE, due to an as-yet-unknown problem which causes
131 system crashes when displaying the score list.
133 NetHack can be compiled using the commercial version of DICE only. The
134 registered shareware version had a bug in it which resulted in odd-
135 aligned procedures. (It is possible to patch DC1 to fix this problem;
136 however, this is not recommended, and you should upgrade to the
139 DICE 3.0 (the first commercial release) has a couple of bugs in it which
140 turn up in several of the NetHack sources; the DCC30_BUG define fixes
141 them. If you have a more recent version of the compiler, you may be
142 able to compile without this (and get slightly more efficient code) by
143 commenting out the define in amiconf.h.
145 During compilation, DICE will output a lot of warnings; they can be