1 /* NetHack 3.6 unixconf.h $NHDT-Date: 1520099325 2018/03/03 17:48:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Pasi Kallinen, 2018. */
4 /* NetHack may be freely redistributed. See license for details. */
11 * Some include files are in a different place under SYSV
13 * <sys/time.h> <time.h>
14 * <sgtty.h> <termio.h>
16 * Some routines are called differently
22 /* define exactly one of the following four choices */
23 /* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
24 /* also for relatives like SunOS 4.x, DG/UX, and */
25 /* older versions of Linux */
26 /* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
27 /* Use BSD for < v3.0 */
28 /* "ULTRIX" not to be confused with "ultrix" */
29 #define SYSV /* define for System V, Solaris 2.x, newer versions */
31 /* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
32 /* 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 */
41 #define LINUX /* Another Unix clone */
43 /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
44 /* #define GENIX */ /* Yet Another Unix Clone */
45 /* #define HISX */ /* Bull Unix for XPS Machines */
46 /* #define BOS */ /* Bull Open Software - Unix for DPX/2 Machines */
47 /* #define UNIXPC */ /* use in addition to SYSV for AT&T 7300/3B1 */
48 /* #define AIX_31 */ /* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
49 * job control (note that AIX is SYSV otherwise)
50 * Also define this for AIX 3.2 */
52 #define TERMINFO /* uses terminfo rather than termcap */
53 /* Should be defined for most SYSV, SVR4 (including
54 * Solaris 2+), HPUX, and Linux systems. In
55 * particular, it should NOT be defined for the UNIXPC
56 * unless you remove the use of the shared library in
58 #define TEXTCOLOR /* Use System V r3.2 terminfo color support
59 * and/or ANSI color support on termcap systems
61 #define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control
63 #define POSIX_TYPES /* use POSIX types for system calls and termios */
64 /* Define for many recent OS releases, including
65 * those with specific defines (since types are
66 * changing toward the standard from earlier chaos).
67 * For example, platforms using the GNU libraries,
70 #define POSIX_ICONV /* use POSIX iconv functions */
72 /* #define OPENWINBUG */ /* avoid a problem using OpenWindows 3.0 for
73 X11 on SunOS 4.1.x, x>= 2. Do not define
74 for other X11 implementations. */
75 /* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */
76 /* #define BSD_43_BUG */ /* for real 4.3BSD cc's without schain botch fix */
77 /* #define MICROPORT_BUG */ /* problems with large arrays in structs */
78 /* #define MICROPORT_286_BUG */ /* changes needed in termcap.c to get it to
79 run with Microport Sys V/AT version 2.4.
81 /* #define AIXPS_2BUG */ /* avoid a problem with little_to_big() optimization
84 /* #define RANDOM */ /* if neither random/srandom nor lrand48/srand48
85 is available from your system */
87 /* see sys/unix/snd86unx.shr for more information on these */
88 /* #define UNIX386MUSIC */ /* play real music through speaker on systems
89 with music driver installed */
90 /* #define VPIX_MUSIC */ /* play real music through speaker on systems
91 with built-in VPIX support */
94 * The next two defines are intended mainly for the Andrew File System,
95 * which does not allow hard links. If NO_FILE_LINKS is defined, lock files
96 * will be created in LOCKDIR using open() instead of in the playground using
98 * Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
101 /* #define NO_FILE_LINKS */ /* if no hard links */
102 /* #define LOCKDIR "/usr/games/lib/nethackdir" */ /* where to put locks */
105 * If you want the static parts of your playground on a read-only file
106 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
108 /* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
111 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
112 * If defined, it can be overridden by the environment variable PAGER.
113 * Hack will use its internal pager if DEF_PAGER is not defined.
114 * (This might be preferable for security reasons.)
116 /* #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() */
137 #if defined(MACOSX) && !defined(TIMED_DELAY)
141 /* #define AVOID_WIN_IOCTL */ /* ensure USE_WIN_IOCTL remains undefined */
144 * If you define MAIL, then the player will be notified of new mail
145 * when it arrives. If you also define DEF_MAILREADER then this will
146 * be the default mail reader, and can be overridden by the environment
147 * variable MAILREADER; otherwise an internal pager will be used.
148 * A stat system call is done on the mailbox every MAILCKFREQ moves.
151 #define MAIL /* Deliver mail during the game */
154 /* The Andrew Message System does mail a little differently from normal
155 * UNIX. Mail is deposited in the user's own directory in ~/Mailbox
156 * (another directory). MAILBOX is the element that will be added on to
157 * the user's home directory path to generate the Mailbox path - just in
158 * case other Andrew sites do it differently from CMU.
160 * dl2n+@andrew.cmu.edu (dec 19 1989)
163 /* #define AMS */ /* use Andrew message system for mail */
165 /* NO_MAILREADER is for kerberos authenticating filesystems where it is
166 * essentially impossible to securely exec child processes, like mail
167 * readers, when the game is running under a special token.
171 /* #define NO_MAILREADER */ /* have mail daemon just tell player of mail */
174 #if defined(BSD) || defined(ULTRIX)
176 #define AMS_MAILBOX "/Mailbox"
178 #if defined(__FreeBSD__) || defined(__OpenBSD__)
179 #define DEF_MAILREADER "/usr/bin/mail"
181 #define DEF_MAILREADER "/usr/ucb/Mail"
185 #if (defined(SYSV) || defined(DGUX) || defined(HPUX)) && !defined(LINUX)
187 #define DEF_MAILREADER "/usr/bin/mail"
190 #define DEF_MAILREADER "/usr/sbin/Mail"
192 #define DEF_MAILREADER "/usr/bin/mailx"
196 #define DEF_MAILREADER "/bin/mail"
200 /* If SIMPLE_MAIL is defined, the mail spool file format is
201 "sender:message", one mail per line, and mails are
202 read within game, from demon-delivered mail scrolls.
203 The mail spool file will be deleted once the player
204 has read the message. */
205 /* #define SIMPLE_MAIL */
208 /* How often mail spool file is checked for new messages, in turns */
209 #define MAILCKFREQ 50
214 /* If SERVER_ADMIN_MSG is defined and the file exists, players get
215 a message from the user defined in the file. The file format
216 is "sender:message" all in one line. */
217 /* #define SERVER_ADMIN_MSG "adminmsg" */
218 #ifndef SERVER_ADMIN_MSG_CKFREQ
219 /* How often admin message file is checked for new messages, in turns */
220 #define SERVER_ADMIN_MSG_CKFREQ 25
225 * Some terminals or terminal emulators send two character sequence "ESC c"
226 * when Alt+c is pressed. The altmeta run-time option allows the user to
227 * request that "ESC c" be treated as M-c.
229 #define ALTMETA /* support altmeta run-time option */
232 /* Some implementations of compress need a 'quiet' option.
233 * If you've got one of these versions, put -q here.
234 * You can also include any other strange options your compress needs.
235 * If you have a normal compress, just leave it commented out.
237 /* #define COMPRESS_OPTIONS "-q" */
241 #define FCMASK 0660 /* file creation mask */
244 /* fcntl(2) is a POSIX-portable call for manipulating file descriptors.
245 * Comment out the USE_FCNTL if for some reason you have a strange
246 * OS/filesystem combination for which fcntl(2) does not work. */
252 * The remainder of the file should not need to be changed.
256 #ifdef AUX /* gcc ? */
262 #endif /* _AUX_SOURCE */
264 #if defined(LINUX) || defined(bsdi)
268 #ifndef POSIX_JOB_CONTROL
269 #define POSIX_JOB_CONTROL
274 * BSD/ULTRIX systems are normally the only ones that can suspend processes.
275 * Suspending NetHack processes cleanly should be easy to add to other systems
276 * that have SIGTSTP in the Berkeley sense. Currently the only such systems
277 * known to work are HPUX and AIX 3.1; other systems will probably require
278 * tweaks to unixtty.c and ioctl.c.
280 * POSIX defines a slightly different type of job control, which should be
281 * equivalent for NetHack's purposes. POSIX_JOB_CONTROL should work on
282 * various recent SYSV versions (with possibly tweaks to unixtty.c again).
284 #ifndef POSIX_JOB_CONTROL
285 #if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
286 #define BSD_JOB_CONTROL
289 #define POSIX_JOB_CONTROL
293 #if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
294 #define SUSPEND /* let ^Z suspend the game */
298 * Define SAFERHANGUP to delay hangup processing until the main command
299 * loop. 'safer' because it avoids certain cheats and also avoids losing
300 * objects being thrown when the hangup occurs. All unix windowports
301 * support SAFERHANGUP (couldn't define it here otherwise).
305 #if defined(BSD) || defined(ULTRIX)
306 #include <sys/time.h>
311 #define HLOCK "perm" /* an empty file used for locking purposes */
313 #define tgetch getchar
316 #define SHELL /* do not delete the '!' command */
321 #if defined(POSIX_TYPES) || defined(__GNUC__)
326 #if defined(POSIX_TYPES) || defined(__GNUC__) || defined(BSD) \
328 #include <sys/wait.h>
331 #if defined(BSD) || defined(ULTRIX)
332 #if !defined(DGUX) && !defined(SUNOS4)
333 #define memcpy(d, s, n) bcopy(s, d, n)
334 #define memcmp(s1, s2, n) bcmp(s2, s1, n)
339 #else /* therefore SYSV */
340 #ifndef index /* some systems seem to do this for you */
344 #define rindex strrchr
348 /* Use the high quality random number routines. */
349 #if defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) \
350 || defined(RANDOM) || defined(__APPLE__)
351 #define Rand() random()
353 #define Rand() lrand48()
357 #if defined(SUNOS4) || defined(LINUX) || (defined(BSD) && !defined(ULTRIX))
358 #define msleep(k) usleep((k) *1000)
361 #define msleep(k) napms(k)
365 #ifdef hc /* older versions of the MetaWare High-C compiler define this */
373 #if defined(GNOME_GRAPHICS)
375 #include <linux/unistd.h>
376 #if defined(__NR_getresuid) && defined(__NR_getresgid) /* ie., >= v2.1.44 */
377 #define GETRES_SUPPORT
380 #if defined(BSD) || defined(SVR4)
382 * [ALI] We assume that SVR4 means we can safely include syscall.h
383 * (although it's really a BSDism). This is certainly true for Solaris 2.5,
384 * Solaris 7, Solaris 8 and Compaq Tru64 5.1
385 * Later BSD systems will have the getresid system calls.
387 #include <sys/syscall.h>
388 #if (defined(SYS_getuid) || defined(SYS_getresuid)) \
389 && (defined(SYS_getgid) || defined(SYS_getresgid))
390 #define GETRES_SUPPORT
392 #endif /* BSD || SVR4 */
394 #endif /* GNOME_GRAPHICS */
397 # define RUNTIME_PASTEBUF_SUPPORT
400 #endif /* UNIXCONF_H */