1 /* SCCS Id: @(#)unixconf.h 3.4 1999/07/02 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
10 * Some include files are in a different place under SYSV
12 * <sys/time.h> <time.h>
13 * <sgtty.h> <termio.h>
15 * Some routines are called differently
21 /* define exactly one of the following four choices */
22 /* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
23 /* also for relatives like SunOS 4.x, DG/UX, and */
24 /* older versions of Linux */
25 /* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
26 /* Use BSD for < v3.0 */
27 /* "ULTRIX" not to be confused with "ultrix" */
28 #define SYSV /* define for System V, Solaris 2.x, newer versions */
30 /* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
31 /* use SYSV for < v6.5 */
34 /* define any of the following that are appropriate */
35 #define SVR4 /* use in addition to SYSV for System V Release 4 */
36 /* including Solaris 2+ */
37 #define NETWORK /* if running on a networked system */
38 /* e.g. Suns sharing a playground through NFS */
39 /* #define SUNOS4 */ /* SunOS 4.x */
40 /* #define LINUX */ /* Another Unix clone */
41 /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
42 /* #define GENIX */ /* Yet Another Unix Clone */
43 /* #define HISX */ /* Bull Unix for XPS Machines */
44 /* #define BOS */ /* Bull Open Software - Unix for DPX/2 Machines */
45 /* #define UNIXPC */ /* use in addition to SYSV for AT&T 7300/3B1 */
46 /* #define AIX_31 */ /* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
47 * job control (note that AIX is SYSV otherwise)
48 * Also define this for AIX 3.2 */
50 #define TERMINFO /* uses terminfo rather than termcap */
51 /* Should be defined for most SYSV, SVR4 (including
52 * Solaris 2+), HPUX, and Linux systems. In
53 * particular, it should NOT be defined for the UNIXPC
54 * unless you remove the use of the shared library in
56 #define TEXTCOLOR /* Use System V r3.2 terminfo color support */
57 /* and/or ANSI color support on termcap systems */
58 /* and/or X11 color */
59 #define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */
61 #define POSIX_TYPES /* use POSIX types for system calls and termios */
62 /* Define for many recent OS releases, including
63 * those with specific defines (since types are
64 * changing toward the standard from earlier chaos).
65 * For example, platforms using the GNU libraries,
69 /* #define OPENWINBUG */ /* avoid a problem using OpenWindows 3.0 for
70 X11 on SunOS 4.1.x, x>= 2. Do not define
71 for other X11 implementations. */
72 /* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */
73 /* #define BSD_43_BUG */ /* for real 4.3BSD cc's without schain botch fix */
74 /* #define MICROPORT_BUG */ /* problems with large arrays in structs */
75 /* #define MICROPORT_286_BUG */ /* changes needed in termcap.c to get it to
76 run with Microport Sys V/AT version 2.4.
78 /* #define AIXPS_2BUG */ /* avoid a problem with little_to_big() optimization */
80 /* #define RANDOM */ /* if neither random/srandom nor lrand48/srand48
81 is available from your system */
83 /* see sys/unix/snd86unx.shr for more information on these */
84 /* #define UNIX386MUSIC */ /* play real music through speaker on systems
85 with music driver installed */
86 /* #define VPIX_MUSIC */ /* play real music through speaker on systems
87 with built-in VPIX support */
91 * The next two defines are intended mainly for the Andrew File System,
92 * which does not allow hard links. If NO_FILE_LINKS is defined, lock files
93 * will be created in LOCKDIR using open() instead of in the playground using
95 * Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
98 /* #define NO_FILE_LINKS */ /* if no hard links */
99 /* #define LOCKDIR "/usr/games/lib/nethackdir" */ /* where to put locks */
102 * If you want the static parts of your playground on a read-only file
103 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
105 /* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
109 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
110 * If defined, it can be overridden by the environment variable PAGER.
111 * Hack will use its internal pager if DEF_PAGER is not defined.
112 * (This might be preferable for security reasons.)
113 * #define DEF_PAGER ".../mydir/mypager"
119 * Define PORT_HELP to be the name of the port-specfic help file.
120 * This file is found in HACKDIR.
121 * Normally, you shouldn't need to change this.
122 * There is currently no port-specific help for Unix systems.
124 /* #define PORT_HELP "Unixhelp" */
128 * To enable the `timed_delay' option for using a timer rather than extra
129 * screen output when pausing for display effect. Requires that `msleep'
130 * function be available (with time argument specified in milliseconds).
131 * Various output devices can produce wildly varying delays when the
132 * "extra output" method is used, but not all systems provide access to
133 * a fine-grained timer.
135 /* #define TIMED_DELAY */ /* usleep() */
139 * If you define MAIL, then the player will be notified of new mail
140 * when it arrives. If you also define DEF_MAILREADER then this will
141 * be the default mail reader, and can be overridden by the environment
142 * variable MAILREADER; otherwise an internal pager will be used.
143 * A stat system call is done on the mailbox every MAILCKFREQ moves.
146 #define MAIL /* Deliver mail during the game */
148 /* The Andrew Message System does mail a little differently from normal
149 * UNIX. Mail is deposited in the user's own directory in ~/Mailbox
150 * (another directory). MAILBOX is the element that will be added on to
151 * the user's home directory path to generate the Mailbox path - just in
152 * case other Andrew sites do it differently from CMU.
155 * dl2n+@andrew.cmu.edu (dec 19 1989)
158 /* #define AMS */ /* use Andrew message system for mail */
160 /* NO_MAILREADER is for kerberos authenticating filesystems where it is
161 * essentially impossible to securely exec child processes, like mail
162 * readers, when the game is running under a special token.
167 /* #define NO_MAILREADER */ /* have mail daemon just tell player of mail */
170 # if defined(BSD) || defined(ULTRIX)
172 #define AMS_MAILBOX "/Mailbox"
174 # if defined(__FreeBSD__) || defined(__OpenBSD__)
175 #define DEF_MAILREADER "/usr/bin/mail"
177 #define DEF_MAILREADER "/usr/ucb/Mail"
181 # if (defined(SYSV) || defined(DGUX) || defined(HPUX)) && !defined(LINUX)
182 # if defined(M_XENIX)
183 #define DEF_MAILREADER "/usr/bin/mail"
186 #define DEF_MAILREADER "/usr/sbin/Mail"
188 #define DEF_MAILREADER "/usr/bin/mailx"
192 #define DEF_MAILREADER "/bin/mail"
196 #define MAILCKFREQ 50
202 /* Some implementations of compress need a 'quiet' option.
203 * If you've got one of these versions, put -q here.
204 * You can also include any other strange options your compress needs.
205 * If you have a normal compress, just leave it commented out.
207 /* #define COMPRESS_OPTIONS "-q" */
210 #define FCMASK 0660 /* file creation mask */
214 * The remainder of the file should not need to be changed.
218 # ifdef AUX /* gcc ? */
219 # define _SYSV_SOURCE
224 #endif /* _AUX_SOURCE */
226 #if defined(LINUX) || defined(bsdi)
230 # ifndef POSIX_JOB_CONTROL
231 # define POSIX_JOB_CONTROL
236 * BSD/ULTRIX systems are normally the only ones that can suspend processes.
237 * Suspending NetHack processes cleanly should be easy to add to other systems
238 * that have SIGTSTP in the Berkeley sense. Currently the only such systems
239 * known to work are HPUX and AIX 3.1; other systems will probably require
240 * tweaks to unixtty.c and ioctl.c.
242 * POSIX defines a slightly different type of job control, which should be
243 * equivalent for NetHack's purposes. POSIX_JOB_CONTROL should work on
244 * various recent SYSV versions (with possibly tweaks to unixtty.c again).
246 #ifndef POSIX_JOB_CONTROL
247 # if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
248 # define BSD_JOB_CONTROL
251 # define POSIX_JOB_CONTROL
255 #if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
256 #define SUSPEND /* let ^Z suspend the game */
260 #if defined(BSD) || defined(ULTRIX)
261 #include <sys/time.h>
266 #define HLOCK "perm" /* an empty file used for locking purposes */
269 #define Getchar nhgetch
271 #define tgetch getchar
273 #define SHELL /* do not delete the '!' command */
277 #if defined(POSIX_TYPES) || defined(__GNUC__)
282 #if defined(POSIX_TYPES) || defined(__GNUC__) || defined(BSD) || defined(ULTRIX)
283 #include <sys/wait.h>
286 #if defined(BSD) || defined(ULTRIX)
287 # if !defined(DGUX) && !defined(SUNOS4)
288 #define memcpy(d, s, n) bcopy(s, d, n)
289 #define memcmp(s1, s2, n) bcmp(s2, s1, n)
294 #else /* therefore SYSV */
295 # ifndef index /* some systems seem to do this for you */
299 #define rindex strrchr
303 /* Use the high quality random number routines. */
304 #if defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) || defined(RANDOM) || defined(__APPLE__)
305 #define Rand() random()
307 #define Rand() lrand48()
311 # if defined(SUNOS4) || defined(LINUX) || (defined(BSD) && !defined(ULTRIX))
312 # define msleep(k) usleep((k)*1000)
315 # define msleep(k) napms(k)
319 #ifdef hc /* older versions of the MetaWare High-C compiler define this */
327 #if defined(GNOME_GRAPHICS)
329 # include <linux/unistd.h>
330 # if defined(__NR_getresuid) && defined(__NR_getresgid) /* ie., >= v2.1.44 */
331 # define GETRES_SUPPORT
334 # if defined(BSD) || defined(SVR4)
336 * [ALI] We assume that SVR4 means we can safely include syscall.h
337 * (although it's really a BSDism). This is certainly true for Solaris 2.5,
338 * Solaris 7, Solaris 8 and Compaq Tru64 5.1
339 * Later BSD systems will have the getresid system calls.
341 # include <sys/syscall.h>
342 # if (defined (SYS_getuid) || defined(SYS_getresuid)) && \
343 (defined(SYS_getgid) || defined(SYS_getresgid))
344 # define GETRES_SUPPORT
346 # endif /* BSD || SVR4 */
348 #endif /* GNOME_GRAPHICS */
350 #endif /* UNIXCONF_H */