OSDN Git Service

shrink mine
[nethackexpress/trunk.git] / sys / msdos / Install.dos
1         SCCS Id: @(#)Install.dos         3.4
2
3            Copyright (c) NetHack PC Development Team 1990-2002.
4        NetHack may be freely redistributed.  See license for details.
5        ==============================================================
6               Instructions for compiling and installing
7                      NetHack 3.4 on a DOS system
8          ======================================================
9                    (or, How to make PC NetHack 3.4)
10                  Last revision: $Date: 2003/06/13 19:57:52 $
11
12 Credit for a runnable full PC NetHack 3.4 goes to the PC Development team
13 of Paul Winner, Kevin Smolkowski, Michael Allison, Yitzhak Sapir, Bill Dyer, 
14 Timo Hakulinen, Yamamoto Keizo, Mike Threepoint, Mike Stephenson, 
15 Stephen White, Ken Washikita and Janet Walz.  The present port is based
16 on the previous effort of Pierre Martineau, Stephen Spackman, Steve Creps, Mike
17 Threepoint, Mike Stephenson, Norm Meluch and Don Kneller.
18
19 There has been very little port-specific maintenance for NetHack on DOS since 
20 NetHack 3.3.0.
21
22 CONTENTS:
23
24         I.  Dispelling the Myths
25         II. Compiling on a DOS machine
26         Appendix A - Building the "official binary"
27         Appendix B - DJGPP Compiler (gcc ported to msdos) notes
28         Appendix C - Additional Notes
29         Appendix D - Contacting Us
30
31 I.  Dispelling the Myths:
32
33     Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
34     however it will behoove you to read this entire file through before
35     beginning the task.
36
37     We have provided a proper Makefile for building NetHack using the
38     following compilers:
39         djgpp V2.03 or later
40
41     For specific details concerning the djgpp compiler, please see the
42     appendix B.
43
44     The makefile named Makefile.GCC is for use with GNU Make that
45     accompanies djgpp.
46
47     If you want to build a copy of NetHack that is identical to the
48     "official binary", please see appendix A.
49
50     The unsupported sys/msdos/Makefile.MSC was for the old 16 bit
51     Microsoft Visual C 1.52c compiler and has not been made compliant
52     with 3.4.x.
53
54     You may find it useful to obtain copies of lex (flex) and yacc (bison
55     or byacc).  While not strictly necessary to compile nethack, they are 
56     required should you desire to make any changes to the level and dungeon 
57     compilers.  Flex and Bison are included with the DJGPP distribution and 
58     are also available on many archive sites. 
59
60     Also be sure to pick up djgpp v2gnu/fil41b.zip to get ls.exe and 
61     touch.exe, since the Makefile uses them by default.
62
63 II. To compile your copy of NetHack on a DOS machine:
64     (or "just follow these few 'simple' steps outlined below.")
65
66 1.  It almost goes without saying that you should make sure that your tools
67     are set up and running correctly.
68
69 2.  Make sure all the NetHack files are in the appropriate directory
70     structure.  You should have a main directory with subdirectories
71     dat, doc, include, src, sys\share, sys\msdos, util, win\tty and
72     win\share.  Other subdirectories may also be included in your
73     distribution, but they are not necessary for use with DOS.  You can
74     delete them to save space.
75
76     Required Source Directories for DOS NetHack:
77
78                            (top)
79                              |
80         ------------------------------------------------- 
81         |       |     |        |       |     |          | 
82        util    dat   doc    include   src   sys        win
83                                              |          |
84                                           ------      ----- 
85                                           |    |      |   |  
86                                        share msdos   tty share
87
88     Check the file "Files" in your top level directory for an exact
89     listing of what files are in which directory.  In order for the
90     Makefiles to work, all the source files must be in the proper
91     locations.
92
93     If you downloaded or ftp'd the sources from a UNIX system, the lines
94     will probably end in UNIX-style newlines, instead of the carriage
95     return and line feed pairs used by DOS.  Some programs have trouble
96     with them, so you may need to convert them (with a utility like
97     Rahul Dhesi's "flip").
98
99 3.  Go to the sys/msdos directory and ensure that the file setup.bat
100     has MSDOS style end-of-line characters rather than UNIX style
101     end-of-line characters.  You can do that using a utility like
102     Rahul Dhesi's "flip", or by invoking the MSDOS edit utility on
103     setup.bat and saving the file without making any changes. Failure to
104     do this will prevent the bat file from executing completely, yet no
105     warning message will be given.
106
107     Run the setup.bat batch file with the following as the argument:
108
109        GCC        For djgpp and GNU MAKE.
110
111     The appropriate and necessary Makefile movement will be accomplished
112     for you, as well as verifying a few files and fixing a few file names
113     on FAT systems with long file name support.
114
115 4.  Now go to the include subdirectory to check a couple of the header
116     files there.  Things *should* work as they are, but since you have
117     probably set up your system in some sort of custom configuration
118     it doesn't hurt to check out the following:
119
120     First check config.h according to the comments to match your system and
121     desired set of features.  Mostly you need to check the WIZARD option,
122     and check TERMLIB and COMPRESS.  Also be sure to leave DLB support 
123     commented out in config.h.  MSDOS has support for DLB, but it must be 
124     done through the Makefile, rather than config.h, to ensure that the 
125     necessary packaging steps are done.
126
127     We've managed to enable all the special features.  You may include all
128     or as few of them as you wish.  To conserve disk space, you may wish
129     to disable LOGFILE and NEWS.
130
131     Also check pcconf.h, which should not need much editing (if you are
132     including random.c, and if you do not require termcap for screen
133     management).  If you are not including random.c you will need to
134     comment out RANDOM.
135
136     If using DJGPP, you can choose between SCREEN_BIOS
137     and SCREEN_DJGPPFAST.  Never, never, ever choose both.  Bad things
138     will happen.  We are not kidding.
139
140 5.  If you want to change the high score list behavior, examine the top of
141     topten.c, in the src directory.  You may want to change the definitions of
142     PERSMAX, POINTSMIN, and ENTRYMAX.  We set POINTSMIN to 51 and ENTRYMAX to
143     50 to keep the size of the score list down.
144
145 6.  Go to the src directory and edit the top of your Makefile.  Be sure the
146     directory you want the game installed in (GAMEDIR) actually exists.
147
148 7.  Now that everything is set up,
149
150        Go to the src directory, and using the GNU Make utility,
151        "make install".
152
153     Depending on your particular machine and compiler, you can either
154     grab a cup of coffee or go home for the day.  Your computer will be
155     occupied for quite some time.  If all goes well, you will get an
156     NetHack executable.
157
158 9.  If you chose DLB support (recommended), make sure that the file nhdat 
159     got copied into the game directory.
160
161     If you didn't choose DLB support, make sure the support files --
162     data, rumors, cmdhelp, opthelp, help, hh,history, guidebook.txt
163     license, and all the *.lev files -- were copied to the game directory.  
164     If not, move them there from the dat directory yourself.  rumors can 
165     be created manually be entering "makedefs -r", data by entering 
166     "makedefs -d".
167
168     Make sure the files NetHack1.tib and NetHacko.tib made it to your game
169     directory.  Copy them from src to the game directory yourself if
170     necessary.
171
172     Make sure the files defaults.nh and termcap made it to your game
173     directory.  If not, go to sys\share and copy NetHack.cnf to
174     your game directory as defaults.nh.  The name in previous versions was
175     nethack.cnf, but the CNF extension conflicted with the MS Windows
176     speed-dialer, making the file hidden on many machines.
177
178     If you changed your build settings to include TERMCAP support, copy
179     termcap to your game directory.  
180
181     Also, make sure the file msdoshlp.txt made it to your game directory.
182     If it didn't, move it from sys\msdos to your game directory
183     yourself.
184
185 10. In your game directory, review the settings in defaults.nh and adjust
186     them according to your style of play.
187
188 11. Play NetHack.  If it works, you're done!
189
190 Appendix A - Building the "official binary"
191
192     If you wish to build a copy of NetHack identical to the one that
193     the pc team distributes, simply do the following:
194
195     The 32-bit Protected Mode DPMI version built with 32-bit djgpp 
196     compiler V2.03 or greater, make no changes to any of the defines and use 
197     the Makefile.GCC as distributed, and as moved in step 3.
198
199     Paths below are relative to the top of your unpacked
200     NetHack source distribution:
201
202        md \nethack\binary   (must match Makefile)
203        cd sys\msdos
204        setup GCC
205        cd ..\..\src
206        make install
207
208
209     Make sure the following files have been converted from the
210     unix style "^J" end of line, to the msdos style "^M^J":
211       license, defaults.nh.
212
213     Place all the files in a clean directory and test.
214
215 Appendix B - DJGPP Compiler (gcc ported to msdos)
216
217     If you have a 386 or better machine, you are in luck.  You can compile
218     NetHack without spending money on a compiler.  DJGPP is available free
219     from many archive sites.
220     At the time of this release in April 2002, the URL
221         http://www.delorie.com/djgpp/zip-picker.html/
222     had information on how to obtain djgpp and what pieces to get.
223     Be sure to pick up djgpp v2gnu/fil41b.zip to get ls.exe and 
224     touch.exe, since the Makefile uses them by default (or change
225     the Makefile to use alternatives).
226
227     Special note for Windows 2000 / Windows XP users: You must have a 
228     recent djgpp distribution for the build process, and the generated
229     executables to work properly on those platforms.
230
231     Setting up DJGPP is more than adequately explained in the documentation
232     that comes with it.  Be sure to pick up the yacc and flex built with
233     DJGPP if you intend to do any modification of the special levels or
234     dungeon compilers.  They should be available at the same place you got
235     djgpp.
236
237     The latest version of djgpp, V2.03 with the most recent refresh
238     will produce a binary that will run under Microsoft Windows, or any 
239     other DPMI provider.  djgpp also comes with a DPMI provider called CWSDPMI.  
240     Place CWSDPMI.EXE in your path and it will be used in the absence of any 
241     other DPMI provider.
242
243     If you want to use the built-in DJGPP screen routines, uncomment
244     SCREEN_DJGPPFAST in pcconf.h (the default for djgpp).
245
246 Appendix C - Additional Notes
247
248 1)  Save files and bones files from versions of NetHack prior to 3.4.0 will not
249     work with this NetHack.  Don't bother trying to keep them.
250
251 2)  To install an update of NetHack after changing something, type 'make' 
252     for DJGPP from the src directory.  If you add, delete, or reorder monsters or
253     objects, or you change the format of saved level files, delete any save
254     and bones files.  (Trying to use such files sometimes produces amusing
255     confusions on the game's part, but usually crashes.)
256
257
258 Appendix D - Contacting the Development Team
259
260     If you discover a bug and wish to report it, or if you have comments
261     or suggestions we recommend using
262     our "Contact Us" web page at:
263         http://www.nethack.org/common/contact.html
264
265     If you don't have access to the web, or you want to send us a patch
266     to the NetHack source code feel free to drop us a line c/o:
267         DevTeam (at) nethack.org
268