Fix build with -fno-common

While here, add a license specification. The license appears to be a mix
of MIT and BSD licenses, but without the BSD clauses spelled out.
This commit is contained in:
Stefan Eßer 2020-09-03 13:42:20 +00:00
parent f0947e3ecc
commit df7ab5150a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=547450
7 changed files with 124 additions and 19 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= spider
PORTVERSION= 1.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= games
MASTER_SITES= SUNSITE/games/solitaires
DISTNAME= ${PORTNAME}
@ -11,6 +11,12 @@ DISTNAME= ${PORTNAME}
MAINTAINER= ports@FreeBSD.org
COMMENT= Challenging double decked solitaire game
LICENSE= Spider
LICENSE_GROUPS= BSD
LICENSE_NAME= Spider license
LICENSE_FILE= ${WRKSRC}/copyright.h
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
USES= imake tar:Z xorg
USE_XORG= x11 xext xaw xmu xt sm ice xpm
INSTALL_TARGET= install install.doc

View File

@ -1,5 +1,5 @@
--- Imakefile.orig Sat Sep 28 19:46:02 1991
+++ Imakefile Wed Oct 15 15:15:06 2003
--- Imakefile.orig 1991-09-28 17:46:02 UTC
+++ Imakefile
@@ -1,6 +1,6 @@
-/**/# Run imake -DUseInstalled -I/usr/lib/X11/config to make a Makefile.
-/**/# This is an R5 style Imakefile, so will need the R5 config files to
@ -39,7 +39,7 @@
XVTOP = $(XVIEWHOME)
XVLIBSRC = $(XVTOP)/lib
# if UseInstalled
@@ -253,7 +253,7 @@
@@ -253,7 +253,7 @@ MakeDirectories(install.man, $(MANDIR))
ComplexProgramTarget($(TARGET))
#ifdef SparcArchitecture

View File

@ -1,13 +1,84 @@
--- globals.h.orig 1991-09-28 17:46:20.000000000 +0000
+++ globals.h 2011-07-01 03:25:27.000000000 +0000
@@ -96,6 +96,10 @@
--- globals.h.orig 1991-09-28 17:46:20 UTC
+++ globals.h
@@ -10,40 +10,47 @@
*
*/
+#ifdef IN_MAIN
+#define EXTERN
+#warning EXTERN
+#else
+#define EXTERN extern
+#endif
+
/*
* spider global variables
*/
-Display *dpy;
-int screen;
-Window table;
+EXTERN Display *dpy;
+EXTERN int screen;
+EXTERN Window table;
#ifdef KITLESS
Window message_win;
XFontStruct *message_font;
#endif /* KITLESS */
-Pixmap greenmap;
-Pixmap redmap;
-Pixmap logomap;
+EXTERN Pixmap greenmap;
+EXTERN Pixmap redmap;
+EXTERN Pixmap logomap;
-unsigned long blackpixel;
-unsigned long whitepixel;
-unsigned long borderpixel;
-unsigned long greenpixel;
+EXTERN unsigned long blackpixel;
+EXTERN unsigned long whitepixel;
+EXTERN unsigned long borderpixel;
+EXTERN unsigned long greenpixel;
-Bool is_color;
+EXTERN Bool is_color;
-CardList deck;
-CardList stack[NUM_STACKS]; /* tableau */
-CardList piles[NUM_PILES]; /* full suits */
+EXTERN CardList deck;
+EXTERN CardList stack[NUM_STACKS]; /* tableau */
+EXTERN CardList piles[NUM_PILES]; /* full suits */
-int table_height;
-int table_width;
+EXTERN int table_height;
+EXTERN int table_width;
-int deck_index;
+extern int deck_index;
-int draw_count;
+EXTERN int draw_count;
-Bool restart;
-int deal_number;
+EXTERN Bool restart;
+EXTERN int deal_number;
extern char *version;
extern char *build_date;
@@ -96,6 +103,10 @@ void do_expand();
Bool can_get_help_files();
#endif
-extern char *malloc();
-extern char *calloc();
-extern char *realloc();
+#ifndef __FreeBSD__
extern char *malloc();
extern char *calloc();
extern char *realloc();
+EXTERN char *malloc();
+EXTERN char *calloc();
+EXTERN char *realloc();
+#else
+#include <stdlib.h>
+#endif

View File

@ -0,0 +1,11 @@
--- main.c.orig 1991-09-28 17:46:54 UTC
+++ main.c
@@ -14,6 +14,8 @@
* Spider solitaire
*/
+#define IN_MAIN
+
#include "defs.h"
#include "globals.h"

View File

@ -1,12 +1,18 @@
--- movelog.c.orig Tue May 29 18:49:36 2007
+++ movelog.c Tue May 29 18:52:19 2007
@@ -33,6 +33,9 @@
--- movelog.c.orig 1991-09-28 17:46:17 UTC
+++ movelog.c
@@ -28,10 +28,13 @@ static int move_index = 0;
static int *move_cache = NULL;
static int cache_size = 0;
-int deck_cache[NUM_CARDS];
-int deck_index = 0;
+int deck_cache[NUM_CARDS];
+int deck_index = 0;
extern int cheat_count;
+
+static int card_to_int(CardPtr card);
+static int restore_game(char *str, char *str2);
+
make_deck_cache()
{
CardPtr tmp;

View File

@ -0,0 +1,11 @@
--- spider.c.orig 1991-09-28 17:46:12 UTC
+++ spider.c
@@ -14,6 +14,8 @@
* Spider card logic
*/
+#define IN_MAIN
+
#include "defs.h"
#include "globals.h"
#include <ctype.h>

View File

@ -1,6 +1,6 @@
--- spider.man.orig Sun Sep 29 02:46:06 1991
+++ spider.man Wed Jan 18 00:00:00 2000
@@ -53,7 +53,7 @@
--- spider.man.orig 1991-09-28 17:46:06 UTC
+++ spider.man
@@ -53,7 +53,7 @@ is "true".
Specifies the time (in microseconds) to pause between each move when
showing a Replay. The default is 200.
.TP 8