games/corewars fix -fno-common build error

With lots of help from daniel@ and naddy@, thank you!

OK naddy@
This commit is contained in:
bket 2021-02-28 06:13:34 +00:00
parent 0ba10032f1
commit c67ddd05a7
4 changed files with 50 additions and 13 deletions

View File

@ -1,22 +1,22 @@
# $OpenBSD: Makefile,v 1.28 2019/07/12 21:02:20 sthen Exp $
# $OpenBSD: Makefile,v 1.29 2021/02/28 06:13:34 bket Exp $
COMMENT= computer simulation game
DISTNAME= corewars-0.9.13
REVISION= 9
REVISION= 10
CATEGORIES= games x11
HOMEPAGE= http://corewars.org/
HOMEPAGE= https://corewars.org/
# GPLv2
PERMIT_PACKAGE= Yes
WANTLIB = GL X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
WANTLIB += Xrandr Xrender atk-1.0 c cairo expat fontconfig freetype
WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
WANTLIB += Xrandr Xrender atk-1.0 c cairo fontconfig freetype
WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0
WANTLIB += gtk-x11-2.0 iconv intl m pango-1.0 pangocairo-1.0
WANTLIB += pangoft2-1.0 pixman-1 png pthread xcb xcb-render xcb-shm z
WANTLIB += gtk-x11-2.0 harfbuzz intl m pango-1.0 pangocairo-1.0
WANTLIB += pangoft2-1.0 z
LIB_DEPENDS= x11/gtk+2

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_parser-cw_y,v 1.1 2021/02/28 06:13:34 bket Exp $
Fix -no-common build error.
Index: src/parser-cw.y
--- src/parser-cw.y.orig
+++ src/parser-cw.y
@@ -29,8 +29,8 @@
#include "program-cw.h"
#include "options.h"
- int current_line;
- struct cw_line *root_line;
+ static int current_line;
+ static struct cw_line *root_line;
char cw_error_message[1024];
void cw_error (char *s);

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-src_parser-rc_y,v 1.1 2021/02/28 06:13:34 bket Exp $
Fix -no-common build error.
Index: src/parser-rc.y
--- src/parser-rc.y.orig
+++ src/parser-rc.y
@@ -66,8 +66,9 @@
void free_expr(struct expr *expr);
struct expr *copy_expr(struct expr *expr);
- int current_line, *current_cell;
- struct line *root_line;
+ int *current_cell;
+ static int current_line;
+ static struct line *root_line;
struct expr *org;
struct label *label_list;
struct label *for_index;

View File

@ -1,6 +1,6 @@
Corewars is a simulation game where a number of warriors try to crash
each other while they are running in a virtual computer. The warriors
can be written in one of two assembler-like languages called Corewars
and Redcode. Corewars is the default language and is easier to learn
and understand. Redcode provides more advanced and powerful
instructions but also requires more time to learn.
Corewars is a simulation game where a number of warriors try to crash
each other while they are running in a virtual computer. The warriors
can be written in one of two assembler-like languages called Corewars
and Redcode. Corewars is the default language and is easier to learn
and understand. Redcode provides more advanced and powerful
instructions but also requires more time to learn.