import gforth 0.6.2

Gforth is a fast and portable implementation of the ANS Forth language.
It works nicely with the Emacs editor, offers some nice features such as
input completion and history, backtraces, a decompiler and a powerful
locals facility, and it even has a manual. Gforth combines traditional
implementation techniques with newer techniques for portability and
performance performance: its inner innerpreter is direct threaded with
several optimizations, but you can also use a traditional-style indirect
threaded interpreter.

originally based on a port by jack woehr, but completely overhauled since.
This commit is contained in:
jasper 2008-10-25 10:40:37 +00:00
parent e88bf85b89
commit 3b4f1cb46c
8 changed files with 441 additions and 0 deletions

55
lang/gforth/Makefile Normal file
View File

@ -0,0 +1,55 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
ONLY_FOR_ARCHS = amd64 i386 sparc sparc64
COMMENT = ANS Standard Forth interpreter and compiler
DISTNAME = gforth-0.6.2
CATEGORIES = lang
HOMEPAGE = http://www.jwdt.com/~paysan/gforth.html
# GPLv2+
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
MASTER_SITES = ${MASTER_SITE_GNU:=gforth/}
WANTLIB = c m
CONFIGURE_STYLE = gnu
CFLAGS += -Dunix
FAKE_FLAGS+= DESTDIR="${WRKINST}"
KERNEL = kernl${WORDSIZE}${ENDIAN}.fi
SUBST_VARS += KERNEL
# Remove a bunch of unused and unneeded directories
post-install:
find ${PREFIX}/share/gforth/arch/ -type d -empty | xargs rm -fr
${INSTALL_DATA_DIR} ${PREFIX}/share/emacs/site-lisp
${INSTALL_DATA} ${WRKSRC}/gforth.el ${PREFIX}/share/emacs/site-lisp
.include <bsd.port.mk>
# The filename of the gForth kernel is based on the wordsize
# and the byte order of the system.
.for m in ${MACHINE_ARCH}
.if ${LP64_ARCHS:L:M$m}
WORDSIZE = 64
.else
WORDSIZE = 32
.endif
.endfor
.if ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "mips64" \
|| ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sh" \
|| ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64"
ENDIAN = b
.else
ENDIAN = l
.endif

5
lang/gforth/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (gforth-0.6.2.tar.gz) = hpESvXYrB/xNIDii2ZZRSA==
RMD160 (gforth-0.6.2.tar.gz) = aSqkEuWZVPh6e0QCeQEkj4k56e4=
SHA1 (gforth-0.6.2.tar.gz) = km+urHzMAOhqdJVNx8aTsZ8T5hY=
SHA256 (gforth-0.6.2.tar.gz) = KKIBrniwc+81DXrEqCgyMwKcav5gcmIKxt1tsdGS1GI=
SIZE (gforth-0.6.2.tar.gz) = 1925536

View File

@ -0,0 +1,103 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
--- Makefile.in.orig Mon Aug 25 09:57:49 2003
+++ Makefile.in Sat Oct 25 00:05:42 2008
@@ -51,7 +51,7 @@ osclass = @OSCLASS@
# ------------- Utility programs
SHELL = /bin/sh
-RM = rm
+RM = rm -f
RMTREE = rm -rf
CP = cp -p
MV = mv
@@ -60,10 +60,11 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_INFO = @INSTALL_INFO@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
LN_S = @LN_S@
GCC = @CC@
CC = $(GCC)
-FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
+FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(libdir)/gforth/$(PATHSEP)$(datadir)/gforth/
FORTHSIZES = @FORTHSIZES@
FORTHS_ARGS = -p "$(FORTHPATH)$(PATHSEP)$(srcdir)"
FORTH_ARGS = --die-on-signal $(FORTHS_ARGS)
@@ -110,8 +111,8 @@ LDLIBS = @LIBS@
# ------------ Install Directorys
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
+prefix = ${DESTDIR}@prefix@
+exec_prefix =${DESTDIR}@prefix@
srcdir = @srcdir@
bindir = $(exec_prefix)/bin
#read-only architecture-independent files
@@ -519,35 +520,30 @@ hpux-workaround:
#we delete $build/gforth.fi and $build/install.TAGS after installation because of ownership.
install: gforth$(EXE) $(FORTH_SRC) $(kernel_fi) gforth.fi gforthmi vmgen doc/gforth.1 prim install.TAGS installdirs
touch $(siteforthdir)/siteinit.fs
- -$(RM) $(bindir)/gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE) $(bindir)/gforthmi $(bindir)/vmgen
- -$(RM) $(bindir)/gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
- -$(RM) $(bindir)/gforth-itc$(EXE) $(bindir)/gforth-itc-$(VERSION)$(EXE)
- $(INSTALL_PROGRAM) -s gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE)
- (cd $(bindir) && $(LN_S) gforth-$(VERSION)$(EXE) gforth$(EXE))
- $(INSTALL_PROGRAM) -s gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
- (cd $(bindir) && $(LN_S) gforth-fast-$(VERSION)$(EXE) gforth-fast$(EXE))
- $(INSTALL_PROGRAM) -s gforth-itc$(EXE) $(bindir)/gforth-itc-$(VERSION)$(EXE)
- (cd $(bindir) && $(LN_S) gforth-itc-$(VERSION)$(EXE) gforth-itc$(EXE))
- $(INSTALL_PROGRAM) gforthmi $(bindir)/gforthmi-$(VERSION)
- $(INSTALL_PROGRAM) vmgen $(bindir)/vmgen-$(VERSION)
- $(INSTALL_PROGRAM) gforth-ditc $(libdir)/gforth/$(VERSION)
- (cd $(bindir) && $(LN_S) gforthmi-$(VERSION) gforthmi)
- (cd $(bindir) && $(LN_S) vmgen-$(VERSION) vmgen)
+ -$(RM) $(bindir)/gforth$(EXE) $(bindir)/gforth$(EXE) $(bindir)/gforthmi $(bindir)/vmgen
+ -$(RM) $(bindir)/gforth-fast$(EXE) $(bindir)/gforth-fast$(EXE)
+ -$(RM) $(bindir)/gforth-itc$(EXE) $(bindir)/gforth-itc$(EXE)
+ $(INSTALL_PROGRAM) -s gforth$(EXE) $(bindir)/gforth$(EXE)
+ $(INSTALL_PROGRAM) -s gforth-fast$(EXE) $(bindir)/gforth-fast$(EXE)
+ $(INSTALL_PROGRAM) -s gforth-itc$(EXE) $(bindir)/gforth-itc$(EXE)
+ $(INSTALL_SCRIPT) gforthmi $(bindir)/gforthmi
+ $(INSTALL_SCRIPT) vmgen $(bindir)/vmgen
+ $(INSTALL_PROGRAM) gforth-ditc $(libdir)/gforth/
-$(INSTALL_DATA) $(srcdir)/doc/gforth.1 $(man1dir)
-for i in $(srcdir)/doc/gforth.info* $(srcdir)/doc/vmgen.info*; do $(INSTALL_DATA) $$i $(infodir); done
for i in $(FORTH_SRC) $(COMPAT) prim; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(datadir)/gforth/$(VERSION)/$$i; \
+ $(INSTALL_DATA) $(srcdir)/$$i $(datadir)/gforth/$$i; \
done
- $(INSTALL_DATA) $(kernel_fi) $(datadir)/gforth/$(VERSION)
+ $(INSTALL_DATA) $(kernel_fi) $(datadir)/gforth/
@if test -d "$(emacssitelispdir)"; then \
$(INSTALL_DATA) $(srcdir)/gforth.el $(emacssitelispdir); \
else \
echo ">>>>>Please install $(srcdir)/gforth.el in your .../emacs/site-lisp directory"; \
fi
-$(RM) gforth.fi
- GFORTHD="./gforth-ditc -p $(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(datadir)/gforth/$(VERSION) -i $(kernel_fi)" GFORTH="./gforth-ditc --die-on-signal -i $(kernel_fi) $(STARTUP)" ./gforthmi gforth.fi $(FORTHSIZES) $(STARTUP)
- $(INSTALL_DATA) gforth.fi $(libdir)/gforth/$(VERSION)
- $(INSTALL_DATA) install.TAGS $(datadir)/gforth/$(VERSION)/TAGS
+ GFORTHD="./gforth-ditc -p $(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(datadir)/gforth/ -i $(kernel_fi)" GFORTH="./gforth-ditc --die-on-signal -i $(kernel_fi) $(STARTUP)" ./gforthmi gforth.fi $(FORTHSIZES) $(STARTUP)
+ $(INSTALL_DATA) gforth.fi $(libdir)/gforth/site-forth/
+ $(INSTALL_DATA) install.TAGS $(datadir)/gforth/TAGS
$(RM) gforth.fi install.TAGS
$(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/gforth.info
$(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/vmgen.info
@@ -555,13 +551,13 @@ install: gforth$(EXE) $(FORTH_SRC) $(kernel_fi) gforth
install-strip: install
installdirs: mkinstalldirs
- for i in $(bindir) $(man1dir) $(infodir) $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(libdir)/gforth/site-forth $(siteforthdir); do \
+ for i in $(bindir) $(man1dir) $(infodir) $(libdir)/gforth/ $(datadir)/gforth/ $(libdir)/gforth/site-forth $(siteforthdir); do \
$(srcdir)/mkinstalldirs $$i; \
done
for i in $(CVSDIRS); do \
- $(srcdir)/mkinstalldirs $(datadir)/gforth/$(VERSION)/`dirname $$i`; \
+ $(srcdir)/mkinstalldirs $(datadir)/gforth/`dirname $$i`; \
done
- $(RM) -rf $(datadir)/gforth/$(VERSION)/engine
+ $(RM) -rf $(datadir)/gforth/engine
#deinstall all files specific to this version of gforth
#to uninstall version foo, type `make uninstall VERSION=foo'

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-comp-i_fs,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
Fix for a known problem of gForth 0.6.2:
http://www.complang.tuwien.ac.at/forth/gforth/Known-problems.html#exec-shield
--- comp-i.fs.orig Mon Aug 25 08:11:25 2003
+++ comp-i.fs Tue Oct 21 09:20:54 2008
@@ -43,7 +43,7 @@ s" address-unit-bits" environment? drop constant bits/
if
." : images have the same base address; producing only a data-relocatable image" cr
else
- offset abs expected-offset <> abort" images produced by different engines"
+ \ offset abs expected-offset <> abort" images produced by different engines"
." offset=" offset . cr
0 image1 i-field + ! 0 image2 i-field + !
endif

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-configure,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
From NetBSD:
The gforth configure script tests for linker support of -export-dynamic,
and then adds it to LDFLAGS. Later, the configure script tests for the
presence of certain functions in libc, and expects to get an error at
link time if the functions are missing. On Interix with -export-dynamic,
the link succeeds even if there are missing functions. This causes
configure to detect all tested functions as present, and produce
binaries that fail at run time.
To work around this issue, postpone adding -export-dynamic to LDFLAGS
until the end of the configure script.
--- configure.orig Fri Oct 24 23:09:18 2008
+++ configure Fri Oct 24 23:10:29 2008
@@ -3316,7 +3316,7 @@ ac_export_dynamic=no
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-test $ac_export_dynamic = yes|| LDFLAGS=$OLDLDFLAGS
+LDFLAGS=$OLDLDFLAGS
echo "$as_me:$LINENO: result: $ac_export_dynamic" >&5
echo "${ECHO_T}$ac_export_dynamic" >&6
@@ -10853,6 +10853,8 @@ do
mv conftest.tail conftest.undefs
done
rm -f conftest.undefs
+
+test $ac_export_dynamic = yes && LDFLAGS="$LDFLAGS -export-dynamic"
cat >>$CONFIG_STATUS <<\_ACEOF
# Let's still pretend it is `configure' which instantiates (i.e., don't

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-engine_main_c,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
--- engine/main.c.orig Sat Oct 25 00:36:45 2008
+++ engine/main.c Sat Oct 25 00:38:05 2008
@@ -70,8 +70,18 @@ va_alist clist;
void engine_callback(Xt* fcall, void * alist)
{
+ Cell *rp = RP;
+ Cell *sp = SP;
+ Float *fp = FP;
+ Address lp = LP;
+
clist = (va_alist)alist;
- engine(fcall, SP, RP, FP, LP);
+ engine(fcall, sp, rp, fp, lp);
+
+ RP = rp;
+ SP = sp;
+ FP = fp;
+ LP = lp;
}
#endif

8
lang/gforth/pkg/DESCR Normal file
View File

@ -0,0 +1,8 @@
Gforth is a fast and portable implementation of the ANS Forth language.
It works nicely with the Emacs editor, offers some nice features such as
input completion and history, backtraces, a decompiler and a powerful
locals facility, and it even has a manual. Gforth combines traditional
implementation techniques with newer techniques for portability and
performance performance: its inner innerpreter is direct threaded with
several optimizations, but you can also use a traditional-style indirect
threaded interpreter.

197
lang/gforth/pkg/PLIST Normal file
View File

@ -0,0 +1,197 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2008/10/25 10:40:37 jasper Exp $
@bin bin/gforth
@bin bin/gforth-fast
@bin bin/gforth-itc
bin/gforthmi
bin/vmgen
@info info/gforth.info
@info info/vmgen.info
lib/gforth/
@bin lib/gforth/gforth-ditc
lib/gforth/site-forth/
lib/gforth/site-forth/gforth.fi
@man man/man1/gforth.1
share/emacs/
share/emacs/site-lisp/
share/emacs/site-lisp/gforth.el
share/gforth/
share/gforth/TAGS
share/gforth/add.fs
share/gforth/ans-report.fs
share/gforth/ansi.fs
share/gforth/answords.fs
share/gforth/arch/
share/gforth/arch/386/
share/gforth/arch/386/asm.fs
share/gforth/arch/386/disasm.fs
share/gforth/arch/alpha/
share/gforth/arch/alpha/asm.fs
share/gforth/arch/alpha/disasm.fs
share/gforth/arch/mips/
share/gforth/arch/mips/asm.fs
share/gforth/arch/mips/disasm.fs
share/gforth/arch/mips/insts.fs
share/gforth/asm/
share/gforth/asm/README
share/gforth/asm/basic.fs
share/gforth/asm/bitmask.fs
share/gforth/asm/generic.fs
share/gforth/asm/numref.fs
share/gforth/asm/target.fs
share/gforth/assert.fs
share/gforth/backtrac.fs
share/gforth/blocked.fb
share/gforth/blocks.fs
share/gforth/bubble.fs
share/gforth/bufio.fs
share/gforth/chains.fs
share/gforth/code.fs
share/gforth/colorize.fs
share/gforth/comp-i.fs
share/gforth/compat/
share/gforth/compat/README
share/gforth/compat/anslocal.fs
share/gforth/compat/assert.fs
share/gforth/compat/control.fs
share/gforth/compat/defer.fs
share/gforth/compat/exception.fs
share/gforth/compat/loops.fs
share/gforth/compat/required.fs
share/gforth/compat/strcomp.fs
share/gforth/compat/struct.fs
share/gforth/compat/vocabulary.fs
share/gforth/cross.fs
share/gforth/debug.fs
share/gforth/debugs.fs
share/gforth/doc/
share/gforth/doc/makedoc.fs
share/gforth/doskey.fs
share/gforth/ds2texi.fs
share/gforth/ec/
share/gforth/ec/README
share/gforth/ec/builttag.fs
share/gforth/ec/dotx.fs
share/gforth/ec/mirror.fs
share/gforth/ec/nesting.fs
share/gforth/ec/shex.fs
share/gforth/ekey.fs
share/gforth/environ.fs
share/gforth/envos.dos
share/gforth/envos.fs
share/gforth/envos.os2
share/gforth/errors.fs
share/gforth/etags.fs
share/gforth/exboot.fs
share/gforth/except.fs
share/gforth/extend.fs
share/gforth/fflib.fs
share/gforth/fi2c.fs
share/gforth/fib.fs
share/gforth/filedump.fs
share/gforth/fixpath.fs
share/gforth/float.fs
share/gforth/glocals.fs
share/gforth/glosgen.fs
share/gforth/gray.fs
share/gforth/hash.fs
share/gforth/history.fs
share/gforth/httpd.fs
share/gforth/intcomp.fs
share/gforth/kernel/
share/gforth/kernel/accept.fs
share/gforth/kernel/aliases.fs
share/gforth/kernel/aliases0.fs
share/gforth/kernel/args.fs
share/gforth/kernel/basics.fs
share/gforth/kernel/cbr.fs
share/gforth/kernel/cloop.fs
share/gforth/kernel/comp.fs
share/gforth/kernel/cond-old.fs
share/gforth/kernel/cond.fs
share/gforth/kernel/doers.fs
share/gforth/kernel/errore.fs
share/gforth/kernel/files.fs
share/gforth/kernel/getdoers.fs
share/gforth/kernel/input.fs
share/gforth/kernel/int.fs
share/gforth/kernel/io.fs
share/gforth/kernel/kernel.fs
share/gforth/kernel/license.fs
share/gforth/kernel/main.fs
share/gforth/kernel/nio.fs
share/gforth/kernel/pass.fs
share/gforth/kernel/paths.fs
share/gforth/kernel/prim0.fs
share/gforth/kernel/quotes.fs
share/gforth/kernel/require.fs
share/gforth/kernel/saccept.fs
share/gforth/kernel/tools.fs
share/gforth/kernel/toolsext.fs
share/gforth/kernel/vars.fs
share/gforth/${KERNEL}
share/gforth/lib.fs
share/gforth/locals.fs
share/gforth/locate.fs
share/gforth/look.fs
share/gforth/mach16b.fs
share/gforth/mach16l.fs
share/gforth/mach32b.fs
share/gforth/mach32l.fs
share/gforth/mach64b.fs
share/gforth/mach64l.fs
share/gforth/machpc.fs.in
share/gforth/make-app.fs
share/gforth/matrix.fs
share/gforth/mini-oof.fs
share/gforth/moof-exm.fs
share/gforth/moofglos.fs
share/gforth/more.fs
share/gforth/objects.fs
share/gforth/objexamp.fs
share/gforth/oldlib.fs
share/gforth/oof.fs
share/gforth/oofsampl.fs
share/gforth/other.fs
share/gforth/prim
share/gforth/prims2x.fs
share/gforth/proxy.fs
share/gforth/quotes.fs
share/gforth/random.fs
share/gforth/savesys.fs
share/gforth/search.fs
share/gforth/see-ext.fs
share/gforth/see.fs
share/gforth/siev.fs
share/gforth/sieve.fs
share/gforth/simp-see.fs
share/gforth/site-forth/
share/gforth/site-forth/siteinit.fs
share/gforth/sokoban.fs
share/gforth/source.fs
share/gforth/startup.fs
share/gforth/string.fs
share/gforth/struct.fs
share/gforth/stuff.fs
share/gforth/table.fs
share/gforth/tags.fs
share/gforth/tasker.fs
share/gforth/termsize.fs
share/gforth/test/
share/gforth/test/checkans.fs
share/gforth/test/coretest.fs
share/gforth/test/dbltest.fs
share/gforth/test/float.fs
share/gforth/test/gforth.fs
share/gforth/test/other.fs
share/gforth/test/postpone.fs
share/gforth/test/signals.fs
share/gforth/test/string.fs
share/gforth/test/tester.fs
share/gforth/tt.fs
share/gforth/unbuffer.fs
share/gforth/unix/
share/gforth/unix/socket.fs
share/gforth/vt100.fs
share/gforth/vt100key.fs
share/gforth/wordinfo.fs
share/gforth/wordsets.fs