new package: gforth

This commit is contained in:
Tee KOBAYASHI 2022-01-27 16:16:05 +09:00 committed by Henrik Grimler
parent d056daed9b
commit a10194c0e2
7 changed files with 179 additions and 0 deletions

View File

@ -0,0 +1,43 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -862,7 +858,7 @@
.SUFFIXES: .c .pri
.pri.c: $< prim2cl.fs
- $(FORTHK) prim2cl.fs -e "file $< altogether bye" >$@
+ $(PREFORTH) prim2cl.fs -e "file $< altogether bye" >$@
.c.so: $<
$(GCC) -shared $(CFLAGS) $(CPPFLAGS) $< -o $@
@@ -877,15 +873,15 @@
$(CP) gforth.tags $@
install.TAGS: TAGS install-tags.fs
- sed 's;^\$(srcdir)/;;' TAGS|./gforth -e 's" '$(datadir)/gforth/$(VERSION)/'"' $(srcdir)/install-tags.fs -e bye >install.TAGS
+ sed 's;^\$(srcdir)/;;' TAGS|$(PREFORTH) -e 's" '$(datadir)/gforth/$(VERSION)/'"' $(srcdir)/install-tags.fs -e bye >install.TAGS
gforth.TAGS: @kernel_fi@ gforth$(EC)$(EXE) $(GFORTH_FI_SRC) prim.TAGS kernel.TAGS
- $(FORTHK) etags.fs except.fs startup.fs -e bye
+ $(PREFORTH) etags.fs except.fs startup.fs -e bye
cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS
rm TAGS
gforth.tags: @kernel_fi@ gforth$(EC)$(EXE) $(GFORTH_FI_SRC) prim.tags kernel.tags
- $(FORTHK) tags.fs except.fs startup.fs -e bye
+ $(PREFORTH) tags.fs except.fs startup.fs -e bye
cat tags prim.tags kernel.tags >gforth.tags
rm tags
@@ -915,10 +911,10 @@
#Documentation
doc/doc.fd: doc/makedoc.fs $(GFORTH_FI_SRC) code.fs objects.fs oof.fs moofglos.fs
- $(FORTHK) -e "s\" doc/doc.fd\"" doc/makedoc.fs except.fs startup.fs code.fs objects.fs oof.fs moofglos.fs regexp.fs fft.fs -e bye
+ $(PREFORTH) -e "s\" doc/doc.fd\"" doc/makedoc.fs except.fs startup.fs code.fs objects.fs oof.fs moofglos.fs regexp.fs fft.fs -e bye
doc/crossdoc.fd: $(KERN_SRC) kernel/version.fs $(FORTH_GEN0)
- $(FORTHK) -e 's" mach32l.fs"' kernel/main.fs -e bye
+ $(PREFORTH) -e 's" mach32l.fs"' kernel/main.fs -e bye
doc/gforth.texi: doc/gforth.ds prim.b ds2texi.fs prims2x.fs \
doc/doc.fd doc/crossdoc.fd

View File

@ -0,0 +1,20 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -622,9 +622,6 @@
$(INSTALL_DATA) gforth.fi $(DESTDIR)$(libdir)/gforth/$(VERSION)
$(INSTALL_DATA) install.TAGS $(DESTDIR)$(datadir)/gforth/$(VERSION)/TAGS
$(INSTALL_DATA) include/gforth/$(VERSION)/* $(DESTDIR)$(includedir)/gforth/$(VERSION)
- if test -n "$(LIBTOOL)"; then for i in $(LIBCC_BUILD_SRC); do \
- $(LIBTOOL) --silent --mode=install $(INSTALL) lib/gforth/$(VERSION)/libcc-named/`basename $$i .fs`.la $(DESTDIR)$(libccdir)`basename $$i .fs`.la; \
- done; fi
$(POST_INSTALL)
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gforth.info
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/vmgen.info
@@ -650,7 +647,6 @@
build-libcc-named: $(LIBCC_BUILD_SRC) $(FORTH_GEN) $(GEN) FORCE
$(RMTREE) lib/gforth/$(VERSION)/libcc-named/
- for i in $(LIBCC_BUILD_SRC); do ./gforth -e "s\" `pwd`/lib/gforth/$(VERSION)/libcc-named/\" libcc-named-dir-v 2! libcc-path clear-path libcc-named-dir libcc-path also-path :noname 2drop s\" $(libccdir)\" ; is replace-rpath" $(srcdir)/$$i -e bye; done
check: gforths gforth.fi
$(MAKE) checkone check-nofast ENGINE="./gforth --no-dynamic" >/dev/null 2>&1

View File

@ -0,0 +1,12 @@
--- a/arch/arm/machine.h
+++ b/arch/arm/machine.h
@@ -35,8 +35,7 @@
/* this calls a dummy function in cacheflush0.S */
/* you can replace it through "./configure arm_cacheflush=<file>" */
/* if you know how to flush the icache on the arm in general, mail me */
-#define FLUSH_ICACHE(addr,size) cacheflush(addr,size)
-void cacheflush(void *p, size_t size);
+#define FLUSH_ICACHE(addr,size) __builtin___clear_cache((addr),(addr)+(size))
#if defined(FORCE_REG) && !defined(DOUBLY_INDIRECT) && !defined(VM_PROFILING)
/*

42
packages/gforth/build.sh Normal file
View File

@ -0,0 +1,42 @@
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gforth/
TERMUX_PKG_DESCRIPTION="The Forth implementation of the GNU project"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.7.3
TERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/gforth/gforth-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=2f62f2233bf022c23d01c920b1556aa13eab168e3236b13352ac5e9f18542bb0
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
ac_cv_file___arch_386_asm_fs=yes
ac_cv_file___arch_386_disasm_fs=yes
ac_cv_file___arch_amd64_asm_fs=yes
ac_cv_file___arch_amd64_disasm_fs=yes
ac_cv_file___arch_arm_asm_fs=no
ac_cv_file___arch_arm_disasm_fs=no
ac_cv_file___arch_generic_asm_fs=no
ac_cv_file___arch_generic_disasm_fs=no
ac_cv_func_memcmp_working=yes
skipcode=no
--without-check
"
TERMUX_MAKE_PROCESSES=1
TERMUX_PKG_HOSTBUILD=true
termux_step_host_build() {
_PREFIX_FOR_BUILD=$TERMUX_PKG_HOSTBUILD_DIR/prefix
mkdir -p $_PREFIX_FOR_BUILD
find $TERMUX_PKG_SRCDIR -mindepth 1 -maxdepth 1 -exec cp -a \{\} ./ \;
./configure --prefix=$_PREFIX_FOR_BUILD CC="gcc -m$TERMUX_ARCH_BITS"
make -j $TERMUX_MAKE_PROCESSES
make install
}
termux_step_pre_configure() {
PATH=$_PREFIX_FOR_BUILD/bin:$PATH
}
termux_step_post_configure() {
sed -i -e 's:\.\(/gforth-ditc\):'$TERMUX_PKG_HOSTBUILD_DIR'\1:g' \
Makefile
}

View File

@ -0,0 +1,41 @@
--- a/config.sub
+++ b/config.sub
@@ -238,10 +238,11 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | arc | arm | arm[bl]e | arme[lb] | armv* | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
@@ -285,7 +286,7 @@
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | x86_64 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -314,6 +315,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
@@ -1203,7 +1205,7 @@
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ -gnu* | -android* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \

View File

@ -0,0 +1,11 @@
--- a/preforth.in
+++ b/preforth.in
@@ -20,7 +20,7 @@
test -z "$ENGINE" && ENGINE=./gforth
test -f "@srcdir@/@kernel_fi@" && KERNEL="@srcdir@/@kernel_fi@"
test -f "@kernel_fi@" && KERNEL="@kernel_fi@"
-if test -f $ENGINE -a -f $KERNEL; then
+if false && test -f $ENGINE -a -f $KERNEL; then
path1="$1"
path2="$2"
shift; shift

View File

@ -0,0 +1,10 @@
--- a/prim
+++ b/prim
@@ -2153,6 +2153,7 @@
size_t siglen;
int flag;
int decpt;
+char *ecvt(double, int, int *, int *);
sig=ecvt(r, u, &decpt, &flag);
n=(r==0. ? 1 : decpt);
f1=FLAG(flag!=0);