Root/nethack/patches/001-nethack-3.4.3-nanonote.patch

1diff --git a/include/config.h b/include/config.h
2index 3efbfa2..4c69b32 100644
3--- a/include/config.h
4+++ b/include/config.h
5@@ -169,11 +169,11 @@
6 
7 #ifdef UNIX
8 /* path and file name extension for compression program */
9-#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
10-#define COMPRESS_EXTENSION ".Z" /* compress's extension */
11+// #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
12+// #define COMPRESS_EXTENSION ".Z" /* compress's extension */
13 /* An example of one alternative you might want to use: */
14-/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
15-/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
16+#define COMPRESS "/bin/gzip"
17+#define COMPRESS_EXTENSION ".gz"
18 #endif
19 
20 #ifndef COMPRESS
21diff --git a/include/unixconf.h b/include/unixconf.h
22index fe1b006..6038e6c 100644
23--- a/include/unixconf.h
24+++ b/include/unixconf.h
25@@ -37,7 +37,7 @@
26 #define NETWORK /* if running on a networked system */
27             /* e.g. Suns sharing a playground through NFS */
28 /* #define SUNOS4 */ /* SunOS 4.x */
29-/* #define LINUX */ /* Another Unix clone */
30+#define LINUX /* Another Unix clone */
31 /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
32 /* #define GENIX */ /* Yet Another Unix Clone */
33 /* #define HISX */ /* Bull Unix for XPS Machines */
34@@ -132,7 +132,7 @@
35  * "extra output" method is used, but not all systems provide access to
36  * a fine-grained timer.
37  */
38-/* #define TIMED_DELAY */ /* usleep() */
39+#define TIMED_DELAY /* usleep() */
40 #endif
41 
42 /*
43diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c
44index 05b76b4..37484fa 100644
45--- a/sys/share/unixtty.c
46+++ b/sys/share/unixtty.c
47@@ -38,7 +38,7 @@
48 # ifdef LINUX
49 # include <sys/ioctl.h>
50 # undef delay_output /* curses redefines this */
51-# include <curses.h>
52+# include <ncurses.h>
53 # endif
54 # define kill_sym c_cc[VKILL]
55 # define erase_sym c_cc[VERASE]
56diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src
57index 29ad99a..3f640a3 100644
58--- a/sys/unix/Makefile.src
59+++ b/sys/unix/Makefile.src
60@@ -76,6 +76,8 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o
61 #
62 # For cross-compiling, eg. with gcc on Linux (see also CXX further down):
63 # CC = arm-linux-gcc
64+CC = mipsel-openwrt-linux-uclibc-gcc
65+LD = mipsel-openwrt-linux-uclibc-ld
66 #
67 #
68 # if you're debugging and want gcc to check as much as possible, use:
69@@ -151,18 +153,18 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
70 # flags for debugging:
71 # CFLAGS = -g -I../include
72 
73-CFLAGS = -O -I../include
74-LFLAGS =
75+CFLAGS += -O2 -I../include
76+LFLAGS += ${LDFLAGS}
77 
78 # The Qt and Be window systems are written in C++, while the rest of
79 # NetHack is standard C. If using Qt, uncomment the LINK line here to get
80 # the C++ libraries linked in.
81 CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
82-CXX=g++
83+CXX=mipsel-openwrt-linux-uclibc-g++
84 #LINK=g++
85 # For cross-compiling, eg. with gcc on Linux (see also CC further up):
86 #CXX=arm-linux-g++
87-#LINK=arm-linux-gcc
88+LINK=mipsel-openwrt-linux-uclibc-g++
89 
90 # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired
91 # combination of windowing systems. Also set windowing systems in config.h.
92@@ -230,8 +232,8 @@ WINOBJ = $(WINTTYOBJ)
93 # WINTTYLIB = -ltermcap
94 # WINTTYLIB = -lcurses
95 # WINTTYLIB = -lcurses16
96-# WINTTYLIB = -lncurses
97-WINTTYLIB = -ltermlib
98+WINTTYLIB = -lncurses
99+# WINTTYLIB = -ltermlib
100 #
101 # libraries for X11
102 # If USE_XPM is defined in config.h, you will also need -lXpm here.
103diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top
104index 2f11c35..c6b7af0 100644
105--- a/sys/unix/Makefile.top
106+++ b/sys/unix/Makefile.top
107@@ -14,7 +14,6 @@
108 # MAKE = make
109 
110 # make NetHack
111-PREFIX = /usr
112 GAME = nethack
113 # GAME = nethack.prg
114 GAMEUID = games
115@@ -35,9 +34,9 @@ DIRPERM = 0755
116 # therefore there should not be anything in GAMEDIR that you want to keep
117 # (if there is, you'll have to do the installation by hand or modify the
118 # instructions)
119-GAMEDIR = $(PREFIX)/games/lib/$(GAME)dir
120+GAMEDIR = $(PREFIX)/lib/$(GAME)dir
121 VARDIR = $(GAMEDIR)
122-SHELLDIR = $(PREFIX)/games
123+SHELLDIR = $(PREFIX)
124 
125 # per discussion in Install.X11 and Install.Qt
126 VARDATND =
127@@ -238,7 +237,7 @@ install: $(GAME) recover $(VARDAT) dungeon spec_levs
128     -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
129     -rmdir ./-p
130     -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
131- $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
132+ -$(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
133     chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
134 # set up the game files
135     ( $(MAKE) dofiles )
136diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl
137index e2936a8..69369cf 100644
138--- a/sys/unix/Makefile.utl
139+++ b/sys/unix/Makefile.utl
140@@ -27,6 +27,8 @@
141 #
142 # For HP/UX 10.20 with GCC:
143 # CC = gcc -D_POSIX_SOURCE
144+CC = mipsel-openwrt-linux-uclibc-gcc
145+CXX = mipsel-openwrt-linux-uclibc-g++
146 #
147 # if your make doesn't define a default SHELL properly, you may need
148 # the line below (Atari users will need a bourne work-alike)
149@@ -95,7 +97,7 @@ LFLAGS =
150 LIBS =
151  
152 # If you are cross-compiling, you must use this:
153-#OBJDIR = .
154+OBJDIR = .
155 # otherwise, you can save a little bit of disk space with this:
156 OBJDIR = ../src
157 
158@@ -175,7 +177,7 @@ YACCDIST =
159 # dependencies for makedefs
160 #
161 makedefs: $(MAKEOBJS)
162- $(CC) $(LFLAGS) -o makedefs $(MAKEOBJS)
163+ gcc $(LFLAGS) -o makedefs -I../include makedefs.c ../src/monst.c ../src/objects.c
164 
165 makedefs.o: makedefs.c $(CONFIG_H) ../include/permonst.h \
166         ../include/objclass.h ../include/monsym.h \
167@@ -210,7 +212,7 @@ panic.o: panic.c $(CONFIG_H)
168 # dependencies for lev_comp
169 #
170 lev_comp: $(SPLEVOBJS)
171- $(CC) $(LFLAGS) -o lev_comp $(SPLEVOBJS) $(LIBS)
172+ gcc -o lev_comp lev_yacc.c lev_lex.c lev_main.c $(CALLOC) $(CNAMING) -I../include
173 
174 lev_yacc.o: lev_yacc.c $(HACK_H) ../include/sp_lev.h
175 lev_main.o: lev_main.c $(HACK_H) ../include/sp_lev.h ../include/tcap.h \
176@@ -243,7 +245,7 @@ lintlev:
177 # dependencies for dgn_comp
178 #
179 dgn_comp: $(DGNCOMPOBJS)
180- $(CC) $(LFLAGS) -o dgn_comp $(DGNCOMPOBJS) $(LIBS)
181+ gcc $(LFLAGS) -o dgn_comp dgn_yacc.c dgn_lex.c dgn_main.c $(CALLOC) -I../include $(LIBS)
182 
183 dgn_yacc.o: dgn_yacc.c $(CONFIG_H) ../include/dgn_file.h ../include/date.h
184 dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h
185diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh
186index 600e1da..ca7e7f4 100644
187--- a/sys/unix/nethack.sh
188+++ b/sys/unix/nethack.sh
189@@ -1,7 +1,7 @@
190 #!/bin/sh
191 # SCCS Id: @(#)nethack.sh 3.4 1990/02/26
192 
193-HACKDIR=/usr/games/lib/nethackdir
194+HACKDIR=`pwd`/lib/nethackdir
195 export HACKDIR
196 HACK=$HACKDIR/nethack
197 MAXNROFPLAYERS=4
198

Archive Download this file



interactive