1 2 Compiling Amiga NetHack 3.2 3 Last Revision: 5 November 1996 for NetHack 3.2.2 4 5 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 8 up the good work!) 9 10I. Introduction 11 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. 15 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@linc.cis.upenn.edu, where it will 19 be routed to the appropriate person. Include your configuration, the 20 version of 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. 24 25 If you want to find out about distributing NetHack, read the license 26 (in NetHack:license or type ?i during the game). 27 28II. Compiling Amiga NetHack 3.2 29 30II.A. Compilation Overview 31 Compiling NetHack is not very hard - basically you do a little 32 configuration and start make. It does, however, require a good amount 33 of disk space - almost 7 meg (and subject to change; more if you are 34 not doing the simple compile - more on that later). It also needs a 35 good bit of memory, especially for linking. 36 37II.B. Basic Compilation 38 39 NetHack can be built with SAS/C version 6.55 or the commercial version 40 of DICE. The "official" compiler for NetHack 3.2 is SAS/C 6.55 - we 41 have dropped support for SAS/C 5.x. 42 43 The Manx/Aztec port has not been tested recently and is certainly 44 broken. Anyone managing to compile NetHack with this compiler is 45 encouraged to submit context diffs of the required changes. When last 46 tested, NetHack required version 5.0B of that compiler. 47 48II.B.1. Introduction to Compiling NetHack 49 Before doing any compilation, read the README files distributed with 50 the source. These should familiarize you with the source tree layout 51 and what files are shared with what computers; everything in the 52 sys/amiga directory is used exclusively by the Amiga. 53 54 The makefile (sys/amiga/Makefile.ami) depends on certain assignments, 55 providing the developer with a fairly flexible environment. See 56 sys/amiga/Makefile.ami for assignment assumptions. DICE users should 57 see section II.B.3 for information on creating a DMakefile usable with 58 DMake. 59 60 Edit config.h to your liking and system configuration. The defaults 61 should be satisfactory for most systems. 62 63 Read VERY CAREFULLY through the Makefile to familiarize yourself 64 with which assignments are assumed. Otherwise, you're going to get 65 something like "Insert NH: in any drive." You will need uudecode, 66 and, if you need to modify dgn_comp or lev_comp, flex, and bison. 67 The first thing Makefile.ami does is build makedefs, which handles 68 a variety of data file generation, and then lev_comp and dgn_comp 69 which compile the special levels. Makedefs will then be run to create 70 a few files, followed by a roughly alphabetically sorted compilation 71 of the entire source tree. This process will compile selected files 72 from the sys/amiga, sys/share, win/tty, and src directories, eventually 73 creating sbin/nethack. After building the main binary, a make install 74 will build the auxiliary files including help files, special levels, 75 icons, and the font files and will put these files into their final 76 positions - most will be in dlb archives (if DLB was defined in config.h). 77 The first make run should be done in NH:obj and the make install should be 78 done in NetHack:; for both runs, the makefile is NH:sys/amiga/Makefile.ami 79 (or NH:sys/amiga/DMakefile for DMake). 80 81 Note that not all the source is simple C code. If you are modifying 82 lev_comp or dgn_comp you may need bison and/or flex (depending on what 83 modifications you are making). If you wish to modify the Intuition 84 windows in HackWB, the (uuencoded) PowerWindows files are provided. You 85 do not need any of these tools to simply build NetHack - all the C output 86 files are provided in the source distribution. Also, the ifchange 87 script requires a version of diff that produces standard Unix format 88 context diffs for proper operation - the version shipped with SAS/C 89 is not sufficient. 90 91 If you do not have bison and flex, copy the files from sys/share. The 92 include files go in include/ and the C files go in util/. If the compile 93 fails due to prototype errors for malloc and realloc, try deleting 94 the first line of lev_comp.c and dgn_comp.c. 95 96II.B.2. Compiling NetHack with SAS/C version 6.55 97 98 NOTE WELL - Amiga NetHack has dropped support for SAS/C version 5. 99 This version of NetHack was developed with SAS/C 6.55. Earlier versions 100 of the compiler are known to cause problems - don't use them. 101 102 A couple of notes and warnings from the SAS/C users on the team: 103 104 * Included in the SAS/C port is code for generating a SnapShot.tb 105 file upon catching various internal disasters. That is why the 106 debug=l flag is in the makefile. This adds about 270K to the disk 107 image, but it does not increase the run time memory requirements. 108 (But note that this is not useful for split binaries - see below.) 109 110 * The 5.10b optimizer did not produce correct code for NetHack. The 111 current optimizer has not been tested. 112 113II.B.3. Compiling NetHack with the commercial version of DICE 114 115 IMPORTANT NOTE: If you are using DMake, you need to create DMakefile 116 from Makefile.ami. Do the following: 117 118 cd NH:sys/amiga 119 edit from Makefile.ami to DMakefile with mkdmake opt w255 120 121 Some versions of DMake have been known to crash horribly on the 122 makefile - if this happens, you'll need to download another make 123 utility, such as AMake (ftp://ftp.dragonfire.net/amiga/utils/amake), 124 which will run in DMake-compatibility mode if invoked with the -C switch 125 (e.g. "amake -C -f NH:sys/amiga/DMakefile", or just 126 "alias dmake amake -C"). 127 128 SECOND IMPORTANT NOTE: The score list is currently disabled when 129 compiling under DICE, due to an as-yet-unknown problem which causes 130 system crashes when displaying the score list. 131 132 NetHack can be compiled using the commercial version of DICE only. The 133 registered shareware version had a bug in it which resulted in odd- 134 aligned procedures. (It is possible to patch DC1 to fix this problem; 135 however, this is not recommended, and you should upgrade to the 136 commercial version.) 137 138 DICE 3.0 (the first commercial release) has a couple of bugs in it which 139 turn up in several of the NetHack sources; the DCC30_BUG define fixes 140 them. If you have a more recent version of the compiler, you may be 141 able to compile without this (and get slightly more efficient code) by 142 commenting out the define in amiconf.h. 143 144 During compilation, DICE will output a lot of warnings; they can be 145 safely ignored. 146 147II.C. Advanced Compilation 148 As mentioned above, NetHack is very large. There are several 149 techniques under development by the Amiga NetHack Team for dealing 150 with the situation. As they are completed, they will be documented 151 here. Before attempting any of them, you MUST do a "normal" build 152 as documented above; the techniques described below require the 153 auxiliary files from a normal build to form a complete NetHack 154 installation. 155 156II.C.1. Splitter 157 Splitter addresses two problems with NetHack: first, the long startup 158 time of the game, and second, the size of the binary (which will not fit 159 on a single floppy disk). See the file sys/amiga/splitter/split.doc for 160 information on splitter. The normal install target in Makefile.ami will 161 build the split version of NetHack as part of the normal install process; 162 the front ends will run from either the normal version (HackExe:NetHack) 163 or, preferably, from the split version (NetHack.c#? NetHack.d#?) - the 164 decision is based on the presence (or absence) of HackExe:NetHack.dir. 165 Note that the contents of NetHack.dir after a build will generally not 166 be the correct contents for a floppy based system. 167 168