Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# NetHack Makefile (VMS) - for building nethack itself.
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1549835645 2019/02/10 21:54:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.33 $
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1550360058 2019/02/16 23:34:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $
|
||||
# Copyright (c) 2011 by Robert Patrick Rankin
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
|
||||
@@ -23,6 +23,7 @@ INC = [-.include]
|
||||
SYSSHR = [-.sys.share]
|
||||
SRC = [-.src]
|
||||
TTY = [-.win.tty]
|
||||
CURSES = [-.win.curses]
|
||||
UTL = [-.util]
|
||||
VMS = [-.sys.vms]
|
||||
WINSHR = [-.win.share]
|
||||
@@ -74,6 +75,13 @@ WINTTYSRC = $(TTY)getline.c $(TTY)termcap.c $(TTY)topl.c $(TTY)wintty.c \
|
||||
$(TERMCAPSRC)
|
||||
WINTTYOBJ = getline.obj,termcap.obj,topl.obj,wintty.obj $(TERMCAPOBJ)
|
||||
#
|
||||
# curses; doesn't use termcap; may or may not support TERMTABLE for non-DEC tty
|
||||
WINCURSESSRC = $(CURSES)cursdial.c $(CURSES)cursmesg.c $(CURSES)cursinit.c \
|
||||
$(CURSES)cursmisc.c $(CURSES)cursinvt.c $(CURSES)cursstat.c \
|
||||
$(CURSES)cursmain.c $(CURSES)curswins.c
|
||||
WINCURSESOBJ = cursdial.obj,cursmesg.obj,cursinit.obj,cursmisc.obj, \
|
||||
cursinvt.obj,cursstat.obj,cursmain.obj,curswins.obj
|
||||
#
|
||||
# an X11 port (not supported under DECwindows)
|
||||
WINX11SRC = $(X11)Window.c $(X11)dialogs.c $(X11)winX.c $(X11)winmap.c \
|
||||
$(X11)winmenu.c $(X11)winmesg.c $(X11)winmisc.c $(X11)winstat.c \
|
||||
@@ -82,8 +90,33 @@ WINX11OBJ = Window.obj,dialogs.obj,winX.obj,winmap.obj,winmenu.obj,\
|
||||
winmesg.obj,winmisc.obj,winstat.obj,wintext.obj,winval.obj,tile.obj
|
||||
#
|
||||
#
|
||||
# make sure both WANT_WIN_TTY and WANT_WIN_CURSES have a value
|
||||
.ifndef WANT_WIN_CURSES
|
||||
WANT_WIN_CURSES=0
|
||||
.endif
|
||||
.ifndef WANT_WIN_TTY
|
||||
.if WANT_WIN_CURSES
|
||||
WANT_WIN_TTY=0
|
||||
.else
|
||||
WANT_WIN_TTY=1
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if WANT_WIN_TTY
|
||||
WINSRC = $(WINTTYSRC)
|
||||
WINOBJ = $(WINTTYOBJ)
|
||||
.if WANT_WIN_CURSES
|
||||
WINSRC +=,$(WINCURSESSRC)
|
||||
WINOBJ += $(WINCURSESOBJ)
|
||||
.endif
|
||||
.else
|
||||
.if WANT_WIN_CURSES
|
||||
WINSRC = $(WINCURSESSRC)
|
||||
WINOBJ = $(WINCURSESOBJ)
|
||||
.else
|
||||
# Neither WANT_WIN_TTY nor WANT_WIN_CURSES?
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# make NetHack for VMS
|
||||
SYSTEM = SysVMS.timestamp;
|
||||
@@ -344,7 +377,7 @@ vmsfiles.obj : $(VMS)vmsfiles.c $(CONFIG_H)
|
||||
vmsmail.obj : $(VMS)vmsmail.c $(CONFIG_H) $(INC)mail.h \
|
||||
$(INC)wintype.h $(INC)winprocs.h
|
||||
# conditionally used code -- VMS always wants these
|
||||
isaac64.obj : isaac64.c
|
||||
isaac64.obj : isaac64.c $(CONFIG_H) $(INC)isaac64.h
|
||||
random.obj : random.c $(HACK_H)
|
||||
random.c : $(SYSSHR)random.c
|
||||
copy $(SYSSHR)random.c random.c
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
$ ! vms/vmsbuild.com -- compile and link NetHack 3.6.* [pr]
|
||||
$ version_number = "3.6.2"
|
||||
$ ! $NHDT-Date: 1549835647 2019/02/10 21:54:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.21 $
|
||||
$ ! $NHDT-Date: 1550360057 2019/02/16 23:34:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.22 $
|
||||
$ ! Copyright (c) 2018 by Robert Patrick Rankin
|
||||
$ ! NetHack may be freely redistributed. See license for details.
|
||||
$ !
|
||||
$ ! usage:
|
||||
$ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms]
|
||||
$ ! $ @[-.sys.vms]vmsbuild [compiler-option] [link-option] [cc-switches]
|
||||
$ ! $ @[-.sys.vms]vmsbuild [compiler-option] [link-option] [cc-switches] -
|
||||
$ ! [linker-switches] [interface]
|
||||
$ ! options:
|
||||
$ ! compiler-option : either "VAXC", "DECC" or "GNUC" or "" !default VAXC
|
||||
$ ! link-option : either "SHARE[able]" or "LIB[rary]" !default SHARE
|
||||
$ ! cc-switches : optional qualifiers for CC (such as "/noOpt/Debug")
|
||||
$ ! linker-switches : optional qualifers for LINK (/Debug or /noTraceback)
|
||||
$ ! interface : "TTY" or "CURSES" or "TTY+CURSES" or "CURSES+TTY"
|
||||
$ ! notes:
|
||||
$ ! If the symbol "CC" is defined, compiler-option is not used.
|
||||
$ ! If the symbol "CC" is defined, compiler-option is not used (unless it
|
||||
$ ! is "LINK").
|
||||
$ ! The link-option refers to VAXCRTL (C Run-Time Library) handling;
|
||||
$ ! to specify it while letting compiler-option default, use "" as
|
||||
$ ! the compiler-option.
|
||||
$ ! To re-link without compiling, use "LINK" as special 'compiler-option';
|
||||
$ ! to re-link with GNUC library, 'CC' must begin with "G" (or "g").
|
||||
$ ! Default wizard definition moved to include/vmsconf.h.
|
||||
$ ! All options are positional; to specify a later one without an earlier
|
||||
$ ! one, use "" in the earlier one's position, such as
|
||||
$ ! $ @[-.sys.vms]vmsbuild "" "" "" "" "TTY+CURSES"
|
||||
$
|
||||
$ decc_dflt = f$trnlnm("DECC$CC_DEFAULT")
|
||||
$ j = (decc_dflt.nes."") .and. 1
|
||||
@@ -233,6 +239,18 @@ $ if f$search("random.c").eqs."" then copy [-.sys.share]random.c []*.*
|
||||
$ if f$search("tclib.c") .eqs."" then copy [-.sys.share]tclib.c []*.*
|
||||
$ if f$search("[-.util]lev_yacc.c").eqs."" then @[-.sys.vms]spec_lev.com
|
||||
$!
|
||||
$ p5 := 'p5'
|
||||
$ ttysrc = "[-.win.tty]getline,[-.win.tty]termcap" -
|
||||
+ ",[-.win.tty]topl,[-.win.tty]wintty"
|
||||
$ cursessrc = "[-.win.curses]cursdial,[-.win/curses]cursmesg" -
|
||||
+ ",[-.win.curses]cursinit,[-.win.curses]cursmisc" -
|
||||
+ ",[-.win.curses]cursinvt,[-.win.curses]cursstat" -
|
||||
+ ",[-.win.curses]cursmain,[-.win.curses]curswins"
|
||||
$ interface = ttysrc !default
|
||||
$ if p5.eqs."CURSES" then interface = cursessrc
|
||||
$ if p5.eqs."TTY+CURSES" then interface = ttysrc + "," + cursessrc
|
||||
$ if p5.eqs."CURSES+TTY" then interface = cursessrc + "," + ttysrc
|
||||
$!
|
||||
$! create object library
|
||||
$!
|
||||
$ if c_opt.ne.o_SPCL .or. f$search(nethacklib).eqs."" then -
|
||||
@@ -265,8 +283,7 @@ $ c_list = "decl,version,[-.sys.vms]vmsmain,[-.sys.vms]vmsunix" -
|
||||
+ ",[]isaac64" - !already in [.src]
|
||||
+ ",[]random,[]tclib,[]pmatchregex" !copied from [-.sys.share]
|
||||
$ gosub compile_list
|
||||
$ c_list = "[-.win.tty]getline,[-.win.tty]termcap" -
|
||||
+ ",[-.win.tty]topl,[-.win.tty]wintty"
|
||||
$ c_list = interface !ttysrc or cursessrc or both
|
||||
$ gosub compile_list
|
||||
$ c_list = "allmain,apply,artifact,attrib,ball,bones,botl,cmd,dbridge,detect" -
|
||||
+ ",dig,display,do,do_name,do_wear,dog,dogmove,dokick,dothrow,drawing" -
|
||||
|
||||
118
util/makedefs.c
118
util/makedefs.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1539804926 2018/10/17 19:35:26 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.126 $ */
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1550444428 2019/02/17 23:00:28 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.141 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
||||
/* Copyright (c) M. Stephenson, 1990, 1991. */
|
||||
@@ -186,6 +186,7 @@ static boolean FDECL(d_filter, (char *));
|
||||
static boolean FDECL(h_filter, (char *));
|
||||
static void NDECL(build_savebones_compat_string);
|
||||
static void NDECL(windowing_sanity);
|
||||
static void FDECL(opt_out_words, (char *, int *));
|
||||
|
||||
static boolean FDECL(qt_comment, (char *));
|
||||
static boolean FDECL(qt_control, (char *));
|
||||
@@ -1665,10 +1666,23 @@ struct win_info {
|
||||
};
|
||||
static struct win_info window_opts[] = {
|
||||
#ifdef TTY_GRAPHICS
|
||||
{ "tty", "traditional tty-based graphics" },
|
||||
{ "tty",
|
||||
/* testing 'USE_TILES' here would bring confusion because it could
|
||||
apply to another interface such as X11, so check MSDOS explicitly
|
||||
instead; even checking TTY_TILES_ESCCODES would probably be
|
||||
confusing to most users (and it will already be listed separately
|
||||
in the compiled options section so users aware of it can find it) */
|
||||
#ifdef MSDOS
|
||||
"traditional text with optional 'tiles' graphics"
|
||||
#else
|
||||
/* assume that one or more of IBMgraphics, DECgraphics, or MACgraphics
|
||||
can be enabled; we can't tell from here whether that is accurate */
|
||||
"traditional text with optional line-drawing"
|
||||
#endif
|
||||
},
|
||||
#endif
|
||||
#ifdef CURSES_GRAPHICS
|
||||
{ "curses", "terminal-based graphics using curses libraries" },
|
||||
{ "curses", "terminal-based graphics" },
|
||||
#endif
|
||||
#ifdef X11_GRAPHICS
|
||||
{ "X11", "X11" },
|
||||
@@ -1736,12 +1750,38 @@ windowing_sanity()
|
||||
#endif /*DEFAULT_WINDOW_SYS*/
|
||||
}
|
||||
|
||||
static const char opt_indent[] = " ";
|
||||
|
||||
static void
|
||||
opt_out_words(str, length_p)
|
||||
char *str; /* input, but modified during processing */
|
||||
int *length_p; /* in/out */
|
||||
{
|
||||
char *word;
|
||||
|
||||
while (*str) {
|
||||
word = index(str, ' ');
|
||||
#if 0
|
||||
/* treat " (" as unbreakable space */
|
||||
if (word && *(word + 1) == '(')
|
||||
word = index(word + 1, ' ');
|
||||
#endif
|
||||
if (word)
|
||||
*word = '\0';
|
||||
if (*length_p + (int) strlen(str) > COLNO - 5)
|
||||
Fprintf(ofp, "\n%s", opt_indent),
|
||||
*length_p = (int) strlen(opt_indent);
|
||||
else
|
||||
Fprintf(ofp, " "), (*length_p)++;
|
||||
Fprintf(ofp, "%s", str), *length_p += (int) strlen(str);
|
||||
str += strlen(str) + (word ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
do_options()
|
||||
{
|
||||
static const char indent[] = " ";
|
||||
const char *str, *sep;
|
||||
char *word, buf[BUFSZ];
|
||||
char buf[BUFSZ];
|
||||
int i, length, winsyscnt;
|
||||
|
||||
windowing_sanity();
|
||||
@@ -1757,56 +1797,52 @@ do_options()
|
||||
}
|
||||
|
||||
build_savebones_compat_string();
|
||||
Fprintf(ofp,
|
||||
Fprintf(ofp, "\n%sNetHack version %d.%d.%d%s\n",
|
||||
opt_indent,
|
||||
VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL,
|
||||
#ifdef BETA
|
||||
"\n NetHack version %d.%d.%d [beta]\n",
|
||||
" [beta]"
|
||||
#else
|
||||
"\n NetHack version %d.%d.%d\n",
|
||||
""
|
||||
#endif
|
||||
VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
|
||||
);
|
||||
|
||||
Fprintf(ofp, "\nOptions compiled into this edition:\n");
|
||||
length = COLNO + 1; /* force 1st item onto new line */
|
||||
for (i = 0; i < SIZE(build_opts); i++) {
|
||||
str = strcat(strcpy(buf, build_opts[i]),
|
||||
(i < SIZE(build_opts) - 1) ? "," : ".");
|
||||
while (*str) {
|
||||
word = index(str, ' ');
|
||||
if (word)
|
||||
*word = '\0';
|
||||
if (length + strlen(str) > COLNO - 5)
|
||||
Fprintf(ofp, "\n%s", indent), length = strlen(indent);
|
||||
else
|
||||
Fprintf(ofp, " "), length++;
|
||||
Fprintf(ofp, "%s", str), length += strlen(str);
|
||||
str += strlen(str) + (word ? 1 : 0);
|
||||
}
|
||||
opt_out_words(strcat(strcpy(buf, build_opts[i]),
|
||||
(i < SIZE(build_opts) - 1) ? "," : "."),
|
||||
&length);
|
||||
}
|
||||
Fprintf(ofp, "\n"); /* terminate last line of words */
|
||||
|
||||
winsyscnt = SIZE(window_opts) - 1;
|
||||
Fprintf(ofp, "\n\nSupported windowing system%s:\n",
|
||||
Fprintf(ofp, "\nSupported windowing system%s:\n",
|
||||
(winsyscnt > 1) ? "s" : "");
|
||||
length = COLNO + 1; /* force 1st item onto new line */
|
||||
for (i = 0; i < winsyscnt; i++) {
|
||||
str = window_opts[i].name;
|
||||
if (length + strlen(str) > COLNO - 5)
|
||||
Fprintf(ofp, "\n%s", indent), length = strlen(indent);
|
||||
else
|
||||
Fprintf(ofp, " "), length++;
|
||||
Fprintf(ofp, "%s", str), length += strlen(str);
|
||||
sep = (winsyscnt == 1)
|
||||
? "."
|
||||
: (winsyscnt == 2)
|
||||
? ((i == 0) ? " and" : "")
|
||||
: (i < winsyscnt - 2)
|
||||
? ","
|
||||
: ((i == winsyscnt - 2) ? ", and" : "");
|
||||
Fprintf(ofp, "%s", sep), length += strlen(sep);
|
||||
Sprintf(buf, "\"%s\"", window_opts[i].id);
|
||||
if (strcmp(window_opts[i].name, window_opts[i].id))
|
||||
Sprintf(eos(buf), " (%s)", window_opts[i].name);
|
||||
/*
|
||||
* 1 : foo.
|
||||
* 2 : foo and bar (note no period; comes from 'with default' below)
|
||||
* 3+: for, bar, and quux
|
||||
*/
|
||||
opt_out_words(strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */
|
||||
: (winsyscnt == 2 && i == 0) ? " and"
|
||||
: (i == winsyscnt - 2) ? ", and"
|
||||
: ","),
|
||||
&length);
|
||||
}
|
||||
if (winsyscnt > 1)
|
||||
Fprintf(ofp, "\n%swith a default of %s.", indent, DEFAULT_WINDOW_SYS);
|
||||
Fprintf(ofp, "\n\n");
|
||||
if (winsyscnt > 1) {
|
||||
Sprintf(buf, "with a default of \"%s\".", DEFAULT_WINDOW_SYS);
|
||||
opt_out_words(buf, &length);
|
||||
}
|
||||
Fprintf(ofp, "\n"); /* terminate last line of words */
|
||||
|
||||
/* end with a blank line */
|
||||
Fprintf(ofp, "\n");
|
||||
Fclose(ofp);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user