Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/warp Integrate Warp Kit into the NetBSD build
details: https://anonhg.NetBSD.org/src/rev/97577d14142e
branches: trunk
changeset: 956916:97577d14142e
user: kamil <kamil%NetBSD.org@localhost>
date: Tue Nov 10 08:49:08 2020 +0000
description:
Integrate Warp Kit into the NetBSD build
Fix the build and make it install and run with minimal required changes.
diffstat:
distrib/sets/lists/base/mi | 3 +-
distrib/sets/lists/debug/mi | 3 +-
distrib/sets/lists/games/mi | 16 ++++++-
games/Makefile | 6 +-
games/warp/Makefile | 110 +++++++++++++++++++++++++------------------
games/warp/config.h | 3 +-
games/warp/intrp.c | 17 ++++++-
games/warp/score.c | 6 +-
games/warp/sig.c | 6 +-
games/warp/sig.h | 6 +-
games/warp/sm.c | 2 +
games/warp/term.c | 4 +-
games/warp/term.h | 23 ++++++--
games/warp/util.c | 1 -
games/warp/util.h | 2 +-
games/warp/version.c | 2 +
games/warp/warp.c | 1 +
games/warp/warp.h | 17 ++++--
games/warp/warp.news | 3 +-
19 files changed, 151 insertions(+), 80 deletions(-)
diffs (truncated from 579 to 300 lines):
diff -r ac1c86790072 -r 97577d14142e distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi Tue Nov 10 08:02:35 2020 +0000
+++ b/distrib/sets/lists/base/mi Tue Nov 10 08:49:08 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1268 2020/11/09 01:05:51 kamil Exp $
+# $NetBSD: mi,v 1.1269 2020/11/10 08:49:08 kamil Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -2366,6 +2366,7 @@
./usr/share/games/fortune base-games-share
./usr/share/games/larn base-games-share
./usr/share/games/quiz.db base-games-share
+./usr/share/games/warp base-games-share
./usr/share/gdb base-util-share
./usr/share/gdb/syscalls base-util-share
./usr/share/gnats base-gnats-share
diff -r ac1c86790072 -r 97577d14142e distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi Tue Nov 10 08:02:35 2020 +0000
+++ b/distrib/sets/lists/debug/mi Tue Nov 10 08:49:08 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.342 2020/10/18 10:10:18 rin Exp $
+# $NetBSD: mi,v 1.343 2020/11/10 08:49:09 kamil Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@@ -939,6 +939,7 @@
./usr/libdata/debug/usr/games/tetris.debug comp-games-debug debug
./usr/libdata/debug/usr/games/trek.debug comp-games-debug debug
./usr/libdata/debug/usr/games/unstr.debug comp-utils-debug debug
+./usr/libdata/debug/usr/games/warp.debug comp-games-debug debug
./usr/libdata/debug/usr/games/worm.debug comp-games-debug debug
./usr/libdata/debug/usr/games/worms.debug comp-games-debug debug
./usr/libdata/debug/usr/games/wump.debug comp-games-debug debug
diff -r ac1c86790072 -r 97577d14142e distrib/sets/lists/games/mi
--- a/distrib/sets/lists/games/mi Tue Nov 10 08:02:35 2020 +0000
+++ b/distrib/sets/lists/games/mi Tue Nov 10 08:49:08 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.57 2020/11/09 01:05:51 kamil Exp $
+# $NetBSD: mi,v 1.58 2020/11/10 08:49:09 kamil Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -89,6 +89,7 @@
./usr/games/trek games-games-bin
./usr/games/unstr games-utils-bin
./usr/games/wargames games-games-bin
+./usr/games/warp games-games-bin
./usr/games/worm games-games-bin
./usr/games/worms games-games-bin
./usr/games/wtf games-utils-bin
@@ -254,6 +255,17 @@
./usr/share/man/cat8/dm.0 games-obsolete obsolete
./usr/share/man/cat8/strfile.0 games-obsolete obsolete
./usr/share/man/cat8/unstr.0 games-obsolete obsolete
+./usr/share/games/warp/README games-games-share share
+./usr/share/games/warp/smap.0 games-games-share share
+./usr/share/games/warp/smap.1 games-games-share share
+./usr/share/games/warp/smap.2 games-games-share share
+./usr/share/games/warp/smap.3 games-games-share share
+./usr/share/games/warp/smap.4 games-games-share share
+./usr/share/games/warp/smap.5 games-games-share share
+./usr/share/games/warp/smap.6 games-games-share share
+./usr/share/games/warp/smap.7 games-games-share share
+./usr/share/games/warp/warp.doc games-games-share share
+./usr/share/games/warp/warp.news games-games-share share
./usr/share/man/html5/dm.conf.html games-games-htmlman html
./usr/share/man/html6/adventure.html games-games-htmlman html
./usr/share/man/html6/arithmetic.html games-games-htmlman html
@@ -302,6 +314,7 @@
./usr/share/man/html6/tetris.html games-games-htmlman html
./usr/share/man/html6/trek.html games-games-htmlman html
./usr/share/man/html6/wargames.html games-games-htmlman html
+./usr/share/man/html6/warp.html games-games-htmlman html
./usr/share/man/html6/worm.html games-games-htmlman html
./usr/share/man/html6/worms.html games-games-htmlman html
./usr/share/man/html6/wtf.html games-utils-htmlman html
@@ -358,6 +371,7 @@
./usr/share/man/man6/tetris.6 games-games-man .man
./usr/share/man/man6/trek.6 games-games-man .man
./usr/share/man/man6/wargames.6 games-games-man .man
+./usr/share/man/man6/warp.6 games-games-man .man
./usr/share/man/man6/worm.6 games-games-man .man
./usr/share/man/man6/worms.6 games-games-man .man
./usr/share/man/man6/wtf.6 games-utils-man .man
diff -r ac1c86790072 -r 97577d14142e games/Makefile
--- a/games/Makefile Tue Nov 10 08:02:35 2020 +0000
+++ b/games/Makefile Tue Nov 10 08:49:08 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.29 2013/11/12 17:46:20 mbalmer Exp $
+# $NetBSD: Makefile,v 1.30 2020/11/10 08:49:08 kamil Exp $
# @(#)Makefile 8.3 (Berkeley) 7/24/94
-# Missing: dungeon warp
+# Missing: dungeon
# Moved: chess
# Don't belong: xneko xroach
@@ -14,7 +14,7 @@
hack hals_end hangman hunt larn mille monop morse number \
phantasia pig pom ppt primes quiz \
rain random robots rogue sail snake tetris trek \
- wargames worm worms wtf wump
+ wargames warp worm worms wtf wump
.if ${MKCXX} != "no"
SUBDIR+= dab
diff -r ac1c86790072 -r 97577d14142e games/warp/Makefile
--- a/games/warp/Makefile Tue Nov 10 08:02:35 2020 +0000
+++ b/games/warp/Makefile Tue Nov 10 08:49:08 2020 +0000
@@ -1,61 +1,79 @@
-CFLAGS+=-O
+# $NetBSD: Makefile,v 1.2 2020/11/10 08:49:08 kamil Exp $
+
+.include <bsd.own.mk>
+
+PROG= warp
+
SRCS= bang.c init.c intrp.c move.c object.c play.c score.c sig.c term.c \
them.c us.c util.c version.c warp.c weapon.c
-OBJS= bang.o init.o intrp.o move.o object.o play.o score.o sig.o term.o \
- them.o us.o util.o version.o warp.o weapon.o
-warp: ${OBJS}
- ${CC} ${OBJS} -o $@ -ltermlib -lm
+DPADD= ${LIBTERMLIB} ${LIBM} ${LIBCOMPAT}
+LDADD= -ltermlib -lm -lcompat
+
+CPPFLAGS+=-DHAVETERMLIB
-install: warp
- export PATH || exit 1
- - mv $(bin)/warp $(bin)/warp.old
- - if test `pwd` != $(bin); then cp $(public) $(bin); fi
- - cd $(bin); chmod 755 $(public); chown '$(CHOWNER)' $(public)
- - chmod 4711 $(bin)/warp
- - chmod 755 makedir
- - ./makedir `./filexp $(privlib)`
- - \
-if test `pwd` != `./filexp $(privlib)`; then \
-cp $(private) `./filexp $(privlib)`; \
-fi
- - \
-cd `./filexp $(privlib)`; \
-chmod 755 $(private); \
-chown '$(CHOWNER)' . $(private); \
-cp /dev/null save.blurfl
- - \
-if test ! -f `./filexp $(privlib)/warp.news`; then \
-cp warp.news `./filexp $(privlib)`; \
-fi
- - \
-if test `pwd` != $(mansrc); then \
-for page in $(manpages); do \
-cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
-done; \
-fi
+CLEANFILES+=sm sm.lo smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
+CLEANFILES+=warp.6
+HIDEGAME=hidegame
+SETGIDGAME=yes
+MAN= warp.6
-clean:
- rm -f warp core ${OBJS}
+warp.6:
+ ${_MKTARGET_CREATE}
+ cat ${.CURDIR}/warp.man > ${.TARGET}
+
+DPSRCS+=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
smap.0: smp.0 sm
- sm <smp.0 >smap.0
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.0 > ${.TARGET}
+
smap.1: smp.1 sm
- sm <smp.1 >smap.1
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.1 > ${.TARGET}
+
smap.2: smp.2 sm
- sm <smp.2 >smap.2
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.2 > ${.TARGET}
+
smap.3: smp.3 sm
- sm <smp.3 >smap.3
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.3 > ${.TARGET}
+
smap.4: smp.4 sm
- sm <smp.4 >smap.4
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.4 > ${.TARGET}
+
smap.5: smp.5 sm
- sm <smp.5 >smap.5
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.5 > ${.TARGET}
+
smap.6: smp.6 sm
- sm <smp.6 >smap.6
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.6 > ${.TARGET}
+
smap.7: smp.7 sm
- sm <smp.7 >smap.7
-sm: sm.c
- ${CC} sm.c -o $@
+ ${_MKTARGET_CREATE}
+ ./sm < ${.CURDIR}/smp.7 > ${.TARGET}
+
+sm: sm.lo
+ ${_MKTARGET_LINK}
+ ${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC}
-depend: ${SRCS}
- mkdep ${SRCS}
+.if ${MKSHARE} != "no"
+FILES=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
+FILES+=warp.doc warp.news README
+FILESDIR=/usr/share/games/warp
+.endif
+
+CFLAGS+= -Wno-error=old-style-definition -Wno-error=strict-prototypes
+CFLAGS+= -Wno-error=comment -Wno-error=maybe-uninitialized
+CFLAGS+= -Wno-error=discarded-qualifiers -Wno-error=dangling-else
+CFLAGS+= -Wno-error=char-subscripts -Wno-error=parentheses
+CFLAGS+= -Wno-error=unused-value -Wno-error=format-extra-args
+CFLAGS+= -Wno-error=format-overflow= -Wno-error=builtin-declaration-mismatch
+CFLAGS+= -Wno-error=format= -Wno-error=sign-compare -Wno-error=return-type
+CFLAGS+= -Wno-error=unused-label -Wno-error=unused-variable
+CFLAGS+= -Wno-error=format-nonliteral -Wno-error=implicit-fallthrough=
+
+.include <bsd.prog.mk>
diff -r ac1c86790072 -r 97577d14142e games/warp/config.h
--- a/games/warp/config.h Tue Nov 10 08:02:35 2020 +0000
+++ b/games/warp/config.h Tue Nov 10 08:49:08 2020 +0000
@@ -145,5 +145,4 @@
#endif
/* warp private library, may use ~ expansion, %x and %l */
-#define PRIVLIB "/usr/games/lib/warp" /**/
-
+#define PRIVLIB "/usr/share/games/warp" /**/
diff -r ac1c86790072 -r 97577d14142e games/warp/intrp.c
--- a/games/warp/intrp.c Tue Nov 10 08:02:35 2020 +0000
+++ b/games/warp/intrp.c Tue Nov 10 08:49:08 2020 +0000
@@ -257,6 +257,21 @@
}
#endif
+static char *mygets(char *str, size_t n)
+{
+ char *ret;
+ size_t last;
+
+ if ((ret = fgets(str, n, stdin)) != NULL) {
+ last = strlen(str) - 1;
+
+ if (str[last] == '\n')
+ str[last] = '\0';
+ }
+
+ return ret;
+}
+
/* interpret interpolations */
char *
@@ -367,7 +382,7 @@
pattern = dointerp(scrbuf,(sizeof scrbuf),pattern+1,"\"");
fputs(scrbuf,stdout);
resetty();
- gets(scrbuf);
+ mygets(scrbuf, sizeof(scrbuf));
crmode();
raw();
noecho();
diff -r ac1c86790072 -r 97577d14142e games/warp/score.c
--- a/games/warp/score.c Tue Nov 10 08:02:35 2020 +0000
+++ b/games/warp/score.c Tue Nov 10 08:49:08 2020 +0000
@@ -35,6 +35,7 @@
Reg2 int i;
FILE *savfil;
+#if 0
if (stat(SAVEDIR,&filestat)) {
printf("Cannot access %s\r\n",SAVEDIR);
finalize(1);
@@ -47,6 +48,7 @@
printf("%s is not protected correctly (must be u+rw o+rx).\r\n",SAVEDIR);
finalize(1);
}
+#endif
#ifdef SCOREFULL
interp(longlognam, sizeof longlognam, "%N");
@@ -535,12 +537,12 @@
Home |
Main Index |
Thread Index |
Old Index