summaryrefslogtreecommitdiff
path: root/games/crafty
diff options
context:
space:
mode:
authorjlam <jlam>2000-10-15 02:06:27 +0000
committerjlam <jlam>2000-10-15 02:06:27 +0000
commit613c7ed26699072a24174e226d1c77e30b6e1675 (patch)
tree002d5cb3236cd6967fcd42c8145a6a710eff4839 /games/crafty
parentbffee2e69bd74b252fd397b8cdeb0e2d2c85670d (diff)
downloadpkgsrc-613c7ed26699072a24174e226d1c77e30b6e1675.tar.gz
crafty: chess engine -- plays a MUCH better game of chess than GNU Chess.
Diffstat (limited to 'games/crafty')
-rw-r--r--games/crafty/Makefile60
-rw-r--r--games/crafty/files/md56
-rw-r--r--games/crafty/files/patch-sum8
-rw-r--r--games/crafty/patches/patch-aa485
-rw-r--r--games/crafty/patches/patch-ab87
-rw-r--r--games/crafty/patches/patch-ac22
-rw-r--r--games/crafty/patches/patch-ad12
-rw-r--r--games/crafty/patches/patch-ae13
-rw-r--r--games/crafty/patches/patch-af13
-rw-r--r--games/crafty/pkg/COMMENT1
-rw-r--r--games/crafty/pkg/DESCR10
-rw-r--r--games/crafty/pkg/PLIST7
12 files changed, 724 insertions, 0 deletions
diff --git a/games/crafty/Makefile b/games/crafty/Makefile
new file mode 100644
index 00000000000..8bc215803c0
--- /dev/null
+++ b/games/crafty/Makefile
@@ -0,0 +1,60 @@
+# $NetBSD: Makefile,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+DISTNAME= crafty-17.13
+CATEGORIES= games
+MASTER_SITES= ftp://ftp.cis.uab.edu/pub/hyatt/ \
+ ftp://ftp.cis.uab.edu/pub/hyatt/common/ \
+ ftp://ftp.cis.uab.edu/pub/hyatt/v17/
+DISTFILES= ${CRAFTY_DISTFILES}
+DISTFILES+= ${CRAFTY_STARTPGN} ${CRAFTY_DOCFILES}
+
+MAINTAINER= jlam@netbsd.org
+
+DIST_SUBDIR= ${DISTNAME}
+NO_WRKSUBDIR= # defined
+CRAFTY_DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+CRAFTY_STARTPGN= start.pgn
+CRAFTY_DOCFILES= read.me crafty.faq
+EXTRACT_ONLY= ${CRAFTY_DISTFILES}
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${MACHINE_ARCH} == "i386"
+.if ${OBJECT_FMT} == "ELF"
+ALL_TARGET= netbsd-i386-elf
+.else
+ALL_TARGET= netbsd-i386
+.endif
+.elif ${MACHINE_ARCH} == "sparc"
+ALL_TARGET= netbsd-sparc
+.endif
+
+CRAFTY_OPTS= -DBOOKDIR=\\\"${BOOKDIR}\\\"
+CRAFTY_OPTS+= -DTBDIR=\\\"${TBDIR}\\\"
+MAKE_ENV+= opt="${CRAFTY_OPTS}"
+
+BOOKDIR= ${PREFIX}/lib/crafty
+TBDIR= ${PREFIX}/share/egtb
+DOCDIR= ${PREFIX}/share/doc/crafty
+
+CRAFTYRC= ${WRKDIR}/.craftyrc
+
+post-extract:
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${CRAFTY_STARTPGN} ${WRKDIR}
+
+post-build:
+ ${RM} -f ${CRAFTYRC}
+ ${ECHO} "books create ${CRAFTY_STARTPGN} 60" > ${CRAFTYRC}
+ ${ECHO} "quit" >> ${CRAFTYRC}
+ cd ${WRKSRC} && ${WRKSRC}/crafty bookpath=.
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/crafty ${PREFIX}/bin
+ ${INSTALL_DATA_DIR} ${BOOKDIR}
+ ${INSTALL_DATA} ${WRKDIR}/books.bin ${BOOKDIR}
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ for file in ${DISTFILES}; do \
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/$${file} ${DOCDIR}; \
+ done
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/games/crafty/files/md5 b/games/crafty/files/md5
new file mode 100644
index 00000000000..05f318a41a9
--- /dev/null
+++ b/games/crafty/files/md5
@@ -0,0 +1,6 @@
+$NetBSD: md5,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+MD5 (crafty-17.13/crafty-17.13.tar.gz) = b4834719fe166ea3d4d5446114299e73
+MD5 (crafty-17.13/start.pgn) = 36185094abfee19d7d47af89bcb8969e
+MD5 (crafty-17.13/read.me) = 14ed88844764137e023e28539feb936b
+MD5 (crafty-17.13/crafty.faq) = f744727e291b6dec7e7c69bb3586b6dd
diff --git a/games/crafty/files/patch-sum b/games/crafty/files/patch-sum
new file mode 100644
index 00000000000..8c088897f0b
--- /dev/null
+++ b/games/crafty/files/patch-sum
@@ -0,0 +1,8 @@
+$NetBSD: patch-sum,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+MD5 (patch-aa) = 94fc6f5fa59071f8e7f92c112c078a15
+MD5 (patch-ab) = bc5f2fe5c04f68c92cb418d643024df4
+MD5 (patch-ac) = c36255b29dc281bad35b67dd9f9a1764
+MD5 (patch-ad) = 02b8426d52fc79ceb69be67881fa95e0
+MD5 (patch-ae) = f0bb4e480e431328c106639be43246d0
+MD5 (patch-af) = 09d40c9d26133164b161ade98736e3b5
diff --git a/games/crafty/patches/patch-aa b/games/crafty/patches/patch-aa
new file mode 100644
index 00000000000..89bcb307d92
--- /dev/null
+++ b/games/crafty/patches/patch-aa
@@ -0,0 +1,485 @@
+$NetBSD: patch-aa,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- Makefile.orig Fri Jun 9 12:56:10 2000
++++ Makefile
+@@ -1,8 +1,6 @@
+
+ # To build crafty:
+ #
+-# Uncomment the sections relevant to your architecture.
+-# You may need to tune the two gcc lines below to match your compiler.
+ # You want to set up for maximum optimization, but typically you will
+ # need to experiment to see which options provide the fastest code.
+ # This is optimized for pgcc, which is a fairly current compiler.
+@@ -14,8 +12,8 @@
+ # ALPHALINUX {DEC Alpha running Linux}
+ # CRAY1 {any Cray-1 compatible architecture including XMP, YMP,
+ # C90, etc.}
+-# HP {HP workstation running HP_UX operating system (unix)}
+-# LINUX {80X86 architecture running LINUX (unix)}
++# HP {HP workstation running HP_UX operating system (Unix)}
++# LINUX {80X86 architecture running LINUX (Unix)}
+ # NT_i386 {80X86 architecture running Windows 95 or NT}
+ # NT_AXP {DEC Alpha running Windows NT}
+ # DOS {PC running dos/windows, using DJGPP port of gcc to compile}
+@@ -24,7 +22,8 @@
+ # SGI {SGI Workstation running Irix (SYSV/R4) Unix}
+ # SUN {Sun SparcStation running Solaris (SYSV/R4) Unix}
+ # SUN_GCC {Sun SparcStation running Solaris but using gcc
+-# FreeBSD {80X86 architecture running FreeBSD (unix)}
++# FreeBSD {80X86 architecture running FreeBSD (Unix)}
++# NetBSD {multi-architecture running NetBSD (Unix)}
+ #
+ # The next options are optimizations inside Crafty that you will have
+ # test to see if they help. on some machines, these will slow things
+@@ -44,20 +43,45 @@
+ #
+ # if you want 6 man EGTB support, you will need to add -DEGTB6 to the
+ # options above.
+-#
+-#
+-# AIX
+-#target = AIX
+-#CC = cc
+-#CFLAGS = -O2
+-#CPP = $(CC)
+-#LDFLAGS =
+-#opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS
+-#opt = -DCOMPACT_ATTACKS
+-
+-# ALPHA
+-#target = ALPHA
+-#CC = cc
++
++nothing-specified:
++ @echo "You must specify the system which you want to compile for:"
++ @echo ""
++ @echo "make aix IBM AIX"
++ @echo "make alpha DEC Alpha with OSF/1-Digital UNIX"
++ @echo "make alpha-host Alpha DECstation optimized for host"
++ @echo "make alpha-host-nocix Alpha DECstation optimezed for host, no CIX insn"
++ @echo "make dos DOS on i386 with DJGPP"
++ @echo "make hpux HP/UX 9/10, /7xx"
++ @echo "make linux Linux optimized for i386"
++ @echo "make linux-elf Linux optimized for i386, ELF format"
++ @echo "make linux-i686 Linux optimized for i686"
++ @echo "make linux-i686-elf Linux optimized for i686, ELF format"
++ @echo "make linux-alpha Linux optimized for alpha"
++ @echo "make freebsd FreeBSD"
++ @echo "make freebsd-pgcc FreeBSD using Pentium GNU cc"
++ @echo "make netbsd NetBSD"
++ @echo "make netbsd-i386 NetBSD optimized for i386"
++ @echo "make netbsd-i386-elf NetBSD optimized for i386, ELF format"
++ @echo "make netbsd-sparc NetBSD optimized for sparc"
++ @echo "make next NeXTSTEP"
++ @echo "make os2 IBM OS/2 Warp"
++ @echo "make sgi SGI running IRIX"
++ @echo "make solaris Solaris 2.x"
++ @echo "make solaris-gcc Solaris 2.x using GNU cc"
++ @echo ""
++ @echo "make generic Try this one if your system isn't listed above;"
++ @echo " it assumes you have installed GNU cc"
++ @echo ""
++
++aix:
++ $(MAKE) target=AIX \
++ CC=cc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS} -O2' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS' \
++ crafty-make
++
+ #Note: "-arch host" assumes you will run the binary on exactly the
+ # same kind of ALPHA you compiled it on. Omit it if you want to run
+ # the same binary on several kinds of Alpha. If you are on an early
+@@ -66,133 +90,242 @@
+ # happens you'll see a message about "instr emulated" after starting
+ # crafty; to fix it, change "-arch host" to "-arch ev56 -tune host"
+ # and recompile.
+-#CFLAGS = -std -fast -O4 -pthread -newc -arch host
+-#CPP = cxx
+-#LDFLAGS = $(CFLAGS)
+-#LIBS = -lpthread -lexc
+-#opt = -DSMP -DCPUS=8 -DFAST -DPOSIX
+-
+-# ALPHALINUX (experimental)
+-#target = ALPHA
+-#CC = gcc
+-#Note: change <your_cpu> below to the type of your CPU
+-# (ev4,ev45... or 21064,21064A...) or remove the option -mcpu
+-# option for less optimization. If you have the Compaq C Compiler for
+-# AlphaLinux you can link the machine/builtins.h from ccc's private
+-# include file to /usr/include/alpha, link the directory alpha to machine
+-# and remove -DNOBUILTINS from the opt-line
+-# THIS TARGET IS EXPERIMENTAL !!!
+-#CFLAGS = -O4 -ffast-math -funroll-loops -mcpu=<your_cpu>
+-#CPP = g++
+-#LDFLAGS = $(CFLAGS)
+-#LIBS = -lpthread
+-#opt = -DSMP -DCPUS=8 -DFAST -DPOSIX -DNOBUILTINS
+-
+-# DOS
+-# target = DOS
+-# CC = gcc
+-# CFLAGS = -fomit-frame-pointer -m486 -O3
+-# CPP = $(CC)
+-# LDFLAGS =
+-# opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+-# -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B
+-# asm = X86.o
+-
+-# FreeBSD (gcc 2.6.3)
+-#target = FreeBSD
+-#CC = gcc
+-#CFLAGS = -fomit-frame-pointer -m486 -O3 -Wall
+-#CPP = $(CC)
+-#LDFLAGS =
+-#opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+-# -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST
+-
+-# FreeBSD (pgcc)
+-#target = FreeBSD
+-#CC = gcc
+-#CFLAGS = -pipe -D_REENTRANT -mpentium -O -Wall
+-#CPP = $(CC)
+-#LDFLAGS =
+-#opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+-# -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST
+-
+-# HP
+-#target = HP
+-#CC = cc
+-#OPT = +O3 +Onolimit
+-#CFLAGS = +ESlit -Ae +w1
+-#CPP = $(CC)
+-#LDFLAGS = $(OPT) $(CFLAGS)
+-#opt =
+-
+-# LINUX (gcc 2.95)
+-# Note: You have to uncomment exactly ONE of the `asm' lines below.
+-target = LINUX
+-CC = gcc
+-CPP = g++
+-CFLAGS = -Wall -pipe -D_REENTRANT -march=i686 -O -fforce-mem \
+- -fomit-frame-pointer -mpreferred-stack-boundary=2
+-LDFLAGS = -lpthread
+-opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+- -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST -DSMP -DCPUS=4 -DDGT
+
+-# Uncomment the FIRST `asm' line for a.out systems.
+-# Uncomment the SECOND `asm' line for ELF systems.
++alpha:
++ $(MAKE) target=ALPHA \
++ CC=cc CXX=cxx \
++ CFLAGS='$(CFLAGS) -std -fast -O4 -pthread -newc' \
++ LDFLAGS='$(LDFLAGS) $(CFLAGS)' \
++ LIBS='-lpthread -lexc' \
++ opt='$(opt) -DSMP -DCPUS=8 -DFAST -DPOSIX' \
++ crafty-make
++
++alpha-host:
++ $(MAKE) target=ALPHA \
++ CC=cc CXX=cxx \
++ CFLAGS='$(CFLAGS) -std -fast -O4 -pthread -newc -arch host' \
++ LDFLAGS='$(LDFLAGS) $(CFLAGS)' \
++ LIBS='-lpthread -lexc' \
++ opt='$(opt) -DSMP -DCPUS=8 -DFAST -DPOSIX' \
++ crafty-make
++
++alpha-host-nocix:
++ $(MAKE) target=ALPHA \
++ CC=cc CXX=cxx \
++ CFLAGS='$(CFLAGS) -std -fast -O4 -pthread -newc \
++ -arch ev56 -tune host' \
++ LDFLAGS='$(LDFLAGS) $(CFLAGS)' \
++ LIBS='-lpthread -lexc' \
++ opt='$(opt) -DSMP -DCPUS=8 -DFAST -DPOSIX' \
++ crafty-make
++
++dos:
++ $(MAKE) target=DOS \
++ CC=gcc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) -fomit-frame-pointer -m486 -O3' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B' \
++ asm='X86.o' \
++ crafty-make
++
++freebsd:
++ $(MAKE) target=FreeBSD \
++ CC=gcc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) -fomit-frame-pointer -m486 -O3 -Wall' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST' \
++ crafty-make
++
++freebsd-pgcc:
++ $(MAKE) target=FreeBSD \
++ CC=gcc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) -pipe -D_REENTRANT -mpentium -O -Wall' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST' \
++ crafty-make
++
++hpux:
++ $(MAKE) target=HP \
++ CC=cc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) +ESlit -Ae +w1' \
++ LDFLAGS='$(LDFLAGS) +O3 +Onolimit $(CFLAGS)' \
++ crafty-make
++
++linux:
++ $(MAKE) target=LINUX \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -Wall -pipe -D_REENTRANT -O3 \
++ -fforce-mem -fomit-frame-pointer \
++ LDFLAGS='$(LDFLAGS) -lpthread' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST' \
++ asm=X86-aout.o \
++ crafty-make
++
++linux-elf:
++ $(MAKE) target=LINUX \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -Wall -pipe -D_REENTRANT -O3 \
++ -fforce-mem -fomit-frame-pointer \
++ LDFLAGS='$(LDFLAGS) -lpthread' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST' \
++ asm=X86-elf.o \
++ crafty-make
++
++linux-i686:
++ $(MAKE) target=LINUX \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -Wall -pipe -D_REENTRANT -march=i686 -O \
++ -fforce-mem -fomit-frame-pointer \
++ -mpreferred-stack-boundary=2' \
++ LDFLAGS='$(LDFLAGS) -lpthread' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST \
++ -DSMP -DCPUS=4 -DDGT' \
++ asm=X86-aout.o \
++ crafty-make
++
++linux-i686-elf:
++ $(MAKE) target=LINUX \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -Wall -pipe -D_REENTRANT -march=i686 -O \
++ -fforce-mem -fomit-frame-pointer \
++ -mpreferred-stack-boundary=2' \
++ LDFLAGS='$(LDFLAGS) -lpthread' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST \
++ -DSMP -DCPUS=4 -DDGT' \
++ asm=X86-elf.o \
++ crafty-make
++
++# You may wish to add additional targets called linux-alpha-<your_cpu>
++# to produce optimized code for your CPU. Just copy the linux-alpha target
++# and add -mcpu=<your_cpu> to the CFLAGS, where the type of your CPU is
++# ev4,ev45... or 21064,21064A... Or, just type
+ #
+-#asm = X86-aout.o
+-asm = X86-elf.o
+-
+-# NEXT
+-#target = NEXT
+-#CC = /bin/cc
+-#CFLAGS = -O2
+-#CPP = $(CC)
+-#LDFLAGS = $(CFLAGS)
+-#opt = -DCOMPACT_ATTACKS
+-
+-# OS2 (emx09c)
+-# target = OS2
+-# CC = gcc
+-# CFLAGS = -fomit-frame-pointer -m486 -O3 -Wall
+-# CPP = $(CC)
+-# LDFLAGS = -Zexe -Zcrtdll -s
+-# opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+-# -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST -DOS2
+-# asm = X86.o
+-
+-# SGI
+-#target = SGI
+-#AS = /bin/as
+-#CC = cc
+-#AFLAGS = -P
+-#CFLAGS = -g -32 -mips2 -cckr
+-#CPP = $(CC)
+-#LDFLAGS =
+-#opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS
+-#opt =
+-
+-# SUN
+-#target = SUN
+-#AS = /usr/ccs/bin/as
+-#CC = cc
+-#AFLAGS = -P
+-#CPP = $(CC)
+-#CFLAGS = -fast -xO5 -xunroll=20
+-#LDFLAGS = -lpthread
+-#opt = -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+-# -DUSE_ASSEMBLY_A -DSMP -DCPUS=4 -DMUTEX -DPOSIX
+-#asm = Sparc.o
+-
+-# SUN_GCC (using gcc comiler)
+-#target = SUN
+-#AS = /usr/ccs/bin/as
+-#CC = gcc
+-#AFLAGS=-P
+-#CPP = g++
+-#CFLAGS= -Wall -pipe -D_REENTRANT -O2 -fforce-mem -fomit-frame-pointer
+-#LDFLAGS=
+-#opt = -DCOMPACT_ATTACK -DUSE_ATTACK_FUNCTIONS -DUSE_ASSEMBLY_A
+-#asm = Sparc.o
++# make linux-alpha CFLAGS='-mcpu=<your_cpu>'
++#
++# If you have the Compaq C Compiler for AlphaLinux you can link the
++# machine/builtins.h from ccc's private include file to /usr/include/alpha,
++# link the directory alpha to machine and remove -DNOBUILTINS from the
++# opt-line.
++#
++# THIS TARGET IS EXPERIMENTAL !!!
++
++linux-alpha:
++ $(MAKE) target=ALPHA \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -O4 -ffast-math -funroll-loops' \
++ LDFLAGS='$(LDFLAGS) $(CFLAGS)' \
++ LIBS='-lpthread' \
++ opt='$(opt) -DSMP -DCPUS=8 -DFAST -DPOSIX -DNOBUILTINS' \
++ crafty-make
++
++netbsd:
++ $(MAKE) target=NetBSD \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -D_REENTRANT -O3 -Wall \
++ -fomit-frame-pointer -funroll-all-loops \
++ -finline-functions -ffast-math' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS -DFAST' \
++ crafty-make
++
++netbsd-i386:
++ $(MAKE) target=NetBSD \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -D_REENTRANT -O3 -Wall -m486 \
++ -fomit-frame-pointer -funroll-all-loops \
++ -finline-functions -ffast-math' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS -DFAST \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B' \
++ asm=X86-aout.o \
++ crafty-make
++
++netbsd-i386-elf:
++ $(MAKE) target=NetBSD \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -D_REENTRANT -O3 -Wall -m486 \
++ -fomit-frame-pointer -funroll-all-loops \
++ -finline-functions -ffast-math' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS -DFAST \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B' \
++ asm=X86-elf.o \
++ crafty-make
++
++netbsd-sparc:
++ $(MAKE) target=NetBSD \
++ CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS) -D_REENTRANT -O3 -Wall \
++ -fomit-frame-pointer -funroll-all-loops \
++ -finline-functions -ffast-math' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS -DFAST \
++ -DUSE_ASSEMBLY_A' \
++ asm=Sparc.o \
++ crafty-make
++
++next:
++ $(MAKE) target=NEXT \
++ CC=/bin/cc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) -O2' \
++ LDFLAGS='$(LDFLAGS) $(CFLAGS)'
++ opt='$(opt) -DCOMPACT_ATTACKS' \
++ crafty-make
++
++os2:
++ $(MAKE) target=OS2 \
++ CC=gcc CXX='$$(CC)' \
++ CFLAGS='$(CFLAGS) -fomit-frame-pointer -m486 -O3 -Wall' \
++ LDFLAGS='$(LDFLAGS) -Zexe -Zcrtdll -s' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST' \
++ asm=X86.o \
++ crafty-make
++
++sgi:
++ $(MAKE) target=SGI \
++ AS=/bin/as CC=cc CXX='$$(CC)' \
++ AFLAGS='-P' \
++ CFLAGS='$(CFLAGS) -g -32 -mips2 -cckr' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS' \
++ crafty-make
++
++solaris:
++ $(MAKE) target=SUN \
++ AS=/usr/ccs/bin/as CC=cc CXX='$$(CC)' \
++ AFLAGS='-P' \
++ CFLAGS='$(CFLAGS) -fast -xO5 -xunroll=20' \
++ LDFLAGS='$(LDFLAGS) -lpthread' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A -DSMP -DCPUS=4 -DMUTEX -DPOSIX' \
++ asm=Sparc.o \
++ crafty-make
++
++solaris-gcc:
++ $(MAKE) target=SUN \
++ AS=/usr/ccs/bin/as CC=gcc CXX=g++ \
++ AFLAGS='-P' \
++ CFLAGS='$(CFLAGS) -Wall -pipe -D_REENTRANT -O2 \
++ -fforce-mem -fomit-frame-pointer' \
++ LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt) -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
++ -DUSE_ASSEMBLY_A' \
++ asm=Sparc.o \
++ crafty-make
++
++generic:
++ $(MAKE) CC=gcc CXX=g++ \
++ CFLAGS='$(CFLAGS)' \
++ LDFLAGS='$(LDFLAGS)' \
++ crafty-make
+
+ # Do not change anything below this line!
+
+@@ -212,6 +345,13 @@
+
+ eval_users = data.o evaluate.o preeval.o
+
++crafty-make:
++ @$(MAKE) \
++ AS='$(AS)' CC='$(CC)' CXX='$(CXX)' \
++ AFLAGS='$(AFLAGS)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
++ opt='$(opt)' asm='$(asm)' \
++ crafty
++
+ crafty: $(objects)
+ $(CC) $(LDFLAGS) -o crafty $(objects) -lm $(LIBS)
+ @rm -f X86-elf.S
+@@ -221,7 +361,7 @@
+ @cc -O -o dgt dgtdrv.c
+
+ egtb.o: egtb.cpp
+- $(CPP) -c $(CFLAGS) $(opts) egtb.cpp
++ $(CXX) -c $(CFLAGS) $(opts) egtb.cpp
+ clean:
+ -rm -f *.o crafty X86-elf.X X86-aout.S
+
diff --git a/games/crafty/patches/patch-ab b/games/crafty/patches/patch-ab
new file mode 100644
index 00000000000..f15e17dbe6a
--- /dev/null
+++ b/games/crafty/patches/patch-ab
@@ -0,0 +1,87 @@
+$NetBSD: patch-ab,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- chess.h.orig Sun Aug 13 23:59:55 2000
++++ chess.h
+@@ -54,6 +54,12 @@
+ #define CDECL
+ #define STDCALL
+
++/* Provide reasonable defaults for UNIX systems. */
++#undef HAS_64BITS /* machine has 64-bit integers / operators */
++#define HAS_LONGLONG /* machine has 32-bit/64-bit integers */
++#define UNIX /* system is unix-based */
++
++/* Architecture-specific definitions */
+ #if defined(AIX)
+ # undef HAS_64BITS /* machine has 64-bit integers / operators */
+ # define HAS_LONGLONG /* machine has 32-bit/64-bit integers */
+@@ -99,6 +105,17 @@
+ # define HAS_LONGLONG /* machine has 32-bit/64-bit integers */
+ # define UNIX /* system is unix-based */
+ #endif
++#if defined(NetBSD)
++# if defined(__alpha__)
++# define HAS_64BITS /* machine has 64-bit integers / operators */
++# undef HAS_LONGLONG /* machine has 32-bit/64-bit integers */
++# define UNIX /* system is unix-based */
++# else
++# undef HAS_64BITS /* machine has 64-bit integers / operators */
++# define HAS_LONGLONG /* machine has 32-bit/64-bit integers */
++# define UNIX /* system is unix-based */
++# endif
++#endif
+ #if defined(NEXT)
+ # undef HAS_64BITS /* machine has 64-bit integers / operators */
+ # define HAS_LONGLONG /* machine has 32-bit/64-bit integers */
+@@ -156,16 +173,34 @@
+
+ # define COMPACT_ATTACKS
+ # define USE_ATTACK_FUNCTIONS
++#endif
+
+-# define BOOKDIR "Books"
+-# define LOGDIR "Logs"
+-# define TBDIR "TB"
+-# define RCDIR "."
++#if defined(MACOS)
++# if !defined(BOOKDIR)
++# define BOOKDIR "Books"
++# endif
++# if !defined(LOGDIR)
++# define LOGDIR "Logs"
++# endif
++# if !defined(TBDIR)
++# define TBDIR "TB"
++# endif
++# if !defined(RCDIR)
++# define RCDIR "."
++# endif
+ #else
+-# define BOOKDIR "."
+-# define LOGDIR "."
+-# define TBDIR "./TB"
+-# define RCDIR "."
++# if !defined(BOOKDIR)
++# define BOOKDIR "."
++# endif
++# if !defined(LOGDIR)
++# define LOGDIR "."
++# endif
++# if !defined(TBDIR)
++# define TBDIR "./TB"
++# endif
++# if !defined(RCDIR)
++# define RCDIR "."
++# endif
+ #endif
+
+ # define EGTB_CACHE_DEFAULT 1024*1024
+@@ -195,7 +230,7 @@
+ extension is exactly one ply.
+ */
+
+-#define INCPLY 60 /* 1.00 */
++#define INCPLY 60 /* 1.00 */
+ #define NULL_MOVE_DEPTH 120 /* 2.00 */
+ #define RAZORING_DEPTH 60 /* 1.00 */
+
diff --git a/games/crafty/patches/patch-ac b/games/crafty/patches/patch-ac
new file mode 100644
index 00000000000..2e1e7ed4bef
--- /dev/null
+++ b/games/crafty/patches/patch-ac
@@ -0,0 +1,22 @@
+$NetBSD: patch-ac,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- egtb.cpp.orig Fri Jun 9 23:29:59 2000
++++ egtb.cpp
+@@ -1234,7 +1234,7 @@
+ for (pi3 = x_pieceNone; pi3 <= pi2; pi3 = (piece) (pi3 + 1))
+ {
+ if (0 != rgcTriplePawnPresent[pi1][pi2][pi3])
+- printf ("%c%c%c - %d enumerated positions\n",
++ printf ("%c%c%c - %ld enumerated positions\n",
+ "pPNBRQ"[pi1], "pPNBRQ"[pi2], "pPNBRQ"[pi3],
+ rgcTriplePawnPresent[pi1][pi2][pi3]);
+ }
+@@ -1243,7 +1243,7 @@
+ for (pi3 = x_pieceNone; pi3 <= pi2; pi3 = (piece) (pi3 + 1))
+ {
+ if (0 != rgcTriplePawnless[pi1][pi2][pi3])
+- printf ("pawnless %c%c%c - %d enumerated positions\n",
++ printf ("pawnless %c%c%c - %ld enumerated positions\n",
+ "pPNBRQ"[pi1], "pPNBRQ"[pi2], "pPNBRQ"[pi3],
+ rgcTriplePawnless[pi1][pi2][pi3]);
+ }
diff --git a/games/crafty/patches/patch-ad b/games/crafty/patches/patch-ad
new file mode 100644
index 00000000000..9998fd0a863
--- /dev/null
+++ b/games/crafty/patches/patch-ad
@@ -0,0 +1,12 @@
+$NetBSD: patch-ad,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- init.c.orig Mon Aug 14 14:00:03 2000
++++ init.c
+@@ -276,7 +276,6 @@
+ position_lrn_file=fopen(log_filename,"r");
+ if (!position_lrn_file) {
+ position_lrn_file=fopen(log_filename,"a");
+- fprintf(position_lrn_file,"position\n");
+ }
+ else {
+ fclose(position_lrn_file);
diff --git a/games/crafty/patches/patch-ae b/games/crafty/patches/patch-ae
new file mode 100644
index 00000000000..dfe0aa7e85e
--- /dev/null
+++ b/games/crafty/patches/patch-ae
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- tbdecode.h.orig Mon Aug 14 00:00:30 2000
++++ tbdecode.h
+@@ -76,7 +76,7 @@
+ #define dprintf(x) ((void) 0)
+ #endif
+
+-extern "C" int cbEGTBCompBytes = 0;
++extern "C" { int cbEGTBCompBytes = 0; }
+
+ /* --------------------- Constants, types, etc. ----------------------- */
+ /* ---------------------- */
diff --git a/games/crafty/patches/patch-af b/games/crafty/patches/patch-af
new file mode 100644
index 00000000000..cbc3b5e1b24
--- /dev/null
+++ b/games/crafty/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+
+--- utility.c.orig Mon Aug 14 14:39:13 2000
++++ utility.c
+@@ -27,7 +27,7 @@
+ #if defined(UNIX)
+ # include <unistd.h>
+ # include <sys/types.h>
+-# if !defined(LINUX) && !defined(ALPHA) && !defined(HP) && !defined(CRAY1) && !defined(FreeBSD) && !defined(__EMX__)
++# if !defined(LINUX) && !defined(ALPHA) && !defined(HP) && !defined(CRAY1) && !defined(FreeBSD) && !defined(NetBSD) && !defined(__EMX__)
+ # if defined(AIX)
+ # include <sys/termio.h>
+ # include <sys/select.h>
diff --git a/games/crafty/pkg/COMMENT b/games/crafty/pkg/COMMENT
new file mode 100644
index 00000000000..81e2bc8a846
--- /dev/null
+++ b/games/crafty/pkg/COMMENT
@@ -0,0 +1 @@
+chess engine
diff --git a/games/crafty/pkg/DESCR b/games/crafty/pkg/DESCR
new file mode 100644
index 00000000000..e8bce00102e
--- /dev/null
+++ b/games/crafty/pkg/DESCR
@@ -0,0 +1,10 @@
+Crafty is a chess program written by Bob Hyatt (hyatt@cis.uab.edu).
+It is modeled after Cray Blitz (also written by Bob).
+
+Crafty has the following features:
+
+ - written in C
+ - can be compiled with the GNU C compiler on various platforms
+ - has a customizable opening book
+ - supports tablebases (Steven Edward's endgame database)
+ - text interface
diff --git a/games/crafty/pkg/PLIST b/games/crafty/pkg/PLIST
new file mode 100644
index 00000000000..7458c4b045f
--- /dev/null
+++ b/games/crafty/pkg/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2000/10/15 02:06:27 jlam Exp $
+bin/crafty
+lib/crafty/books.bin
+share/doc/crafty/read.me
+share/doc/crafty/crafty.faq
+@unexec rmdir -p %D/share/doc/crafty 2>/dev/null || true
+@dirrm lib/crafty