Commit 5ac57222 authored by pazsan's avatar pazsan

Install process fixes for DOS and OS/2

EC primitive count fixed
EC relocate problem fixed
parent 4f6cc241
......@@ -7,6 +7,22 @@ features of the 80386, but on the other hand it requires at least a
required if you don't have a DPMI host yourself (Windows/OS/2/Linux
DOS-box, Quemm or others).
First run
config
config has the following useful parameters:
--enable-force-reg Use explicit register declarations if they appear in
the machine.h file. This can cause a good speedup,
but also incorrect code with some gcc versions on
some processors (default disabled).
--enable-direct-threaded Force direct threading. This may not work on
some machines and may cause slowdown on others.
(default disabled)
--enable-indirect-threaded Force indirect threading. This can cause a
slowdown on some machines.
(default enabled)
OS/2:
You need EMX 0.9c to compile Gforth. The EMX package provides all
......@@ -19,15 +35,17 @@ beta test, so expect bugs and quirks.
If you don't want to install the DJGPP, CYGWIN32 or EMX package (quite
large), look for a binary distribution of Gforth for DOS, Win32 or
OS/2. You also must have a version of GNU make, because DOS/Win32/OS/2
make programs are likely to have problems with the Makefile. If you
want to change Gforth, you may need GNU m4, too. Because DJGPP
provides use of long filenames under Windows 95, you should unpack the
gforth package with a Windows-95-aware archiver (those from DJGPP or
the Cygnus Win32-package come in mind), because otherwise gforth will
not find the necessary files. With MS-DOS versions prior 7.0 or
DR-DOS, these names are cut due to the 8.3 rule. This might confuse
DJGPP 2.0's make, you could use DJGPP 1.x's make instead. Gforth 0.2.0
OS/2.
You also must have a version of GNU make, because DOS/Win32/OS/2 make
programs are likely to have problems with the Makefile. If you want to
change Gforth, you may need GNU m4, too. Because DJGPP provides some
use of long filenames under Windows 95, you should unpack the gforth
package with a Windows-95-aware archiver (those from DJGPP or the
Cygnus Win32-package come in mind), because otherwise gforth will not
find the necessary files. With MS-DOS versions prior 7.0 or DR-DOS,
these names are cut due to the 8.3 rule. This might confuse DJGPP
2.0's make, you could use DJGPP 1.x's make instead. Gforth 0.4.0
hasn't been compiled with a MS-DOS prior 7.0.
Compiling under DOS or OS/2 has a number of quirks, and if it doesn't
......@@ -47,18 +65,14 @@ then I mount /usr, /usr/local and /bin with
once. Each time I start CygWin32's bash, I set up the following variables:
export TMPDIR=/usr/tmp
export COMPILER_PATH=/usr/local/lib/gcc-lib/i386-cygwin32/cygnus-2.7.2-961023
export COMPILER_PATH=/usr/local/lib/gcc-lib/i386-cygwin32/cygnus-2.7.2-970404
export LIBRARY_PATH="/usr/lib;/usr/local/lib"
export C_INCLUDE_PATH=/usr/local/i386-cygwin32/include
export GCC_DEFAULT_OPTIONS="-specs=$COMPILER_PATH/specs"
export PATH=/bin:.:$PATH
Write this into a script and source it in at each bash invocation.
Because Windows doesn't know about interpreters and shell scripts, you
must run them from bash with e.g. "bash ./configure" instead just
typing "./configure".
Write this into a script and source it in at each bash invocation, or
put it into your .bashrc.
If you don't bother and want to make it yourself, type
......@@ -88,11 +102,13 @@ You can run some benchmarks with
make bench
and compare them with the results in Benchres and in the manual.
and compare them with the results in Benchres and in the manual. DOS
and OS/2 don't allow to run the benchmarks, since the command TIME
means something different there.
Don't try to do "make install", it won't work, either. It is not possible to
"make dist" or "make bindist", too, because of the limitations of DOS
command lines.
Don't try to do "make install" there, it won't work, either. It is not
possible to "make dist" or "make bindist", too, because of the
limitations of DOS command lines.
Add the following entry to your Autoexec.bat:
......@@ -101,7 +117,7 @@ SET GFORTHPATH=<your gforth source directory>;.
Use / instead of \ in your gforth source directory. Gforth now uses
';' as path separator for DOS and OS/2 (not for Cygwin32), so you
won't have problems with DOS pathes that may contain ':', which is the
default path separator in Unix.
default path separator in Unix. Use ~+ for the current directory.
For paper documentation, print gforth.ps (a Postscript file (300dpi
fonts, i.e., it works, but does not produce best quality on better
......@@ -113,4 +129,9 @@ and print the resulting file gforth.dvi (you need TeX for that! But
with TeX you can print it even if you don't have a Postscript printer
nor Ghostscript). You could be able to make a HTML version of the
document, but AFAIK there is no texi2html for DOS available, as there
is no perl available.
is no perl available. You should get the HTML pages from the same
location where you got Gforth or from
http://www.complang.tuwien.ac.at/forth/gforth/
or
ftp://ftp.complang.tuwien.ac.at/pub/forth/gforth/
......@@ -65,7 +65,7 @@ CC = $(GCC)
FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
FORTHSIZES = @FORTHSIZES@
FORTH = ./gforth --die-on-signal -p $(FORTHPATH)$(PATHSEP)$(srcdir)
FORTHKFLAGS= --die-on-signal -p .$(PATHSEP)$\~+$(PATHSEP)$(srcdir) -i $(kernel_fi)
FORTHKFLAGS= --die-on-signal -p ".$(PATHSEP)~+$(PATHSEP)$(srcdir)" -i $(kernel_fi)
FORTHK = ./gforth $(FORTHKFLAGS)
FORTHP = ./gforth --die-on-signal -i ./$(kernel_fi)
STRIP = strip
......
......@@ -6,10 +6,12 @@ traditional implementation techniques: its inner innerpreter is
indirect or direct threaded. Gforth is distributed under the GNU
General Public license (see COPYING).
Gforth runs under Unix and DOS and should not be hard to port to other
systems supported by GCC. This version has been tested successfully on the
following platforms:
Gforth runs under Unix, Win95, OS/2, and DOS and should not be hard to
port to other systems supported by GCC. This version has been tested
successfully on the following platforms:
i486-pc-linux-gnulibc1 (libc5)
i586-pc-linux-gnulibc1 (libc5)
i686-pc-linux-gnu (libc6)
alphaev56-unknown-linux-gnulibc1
alpha-dec-osf4.0b
......@@ -19,6 +21,9 @@ sparc-sun-sunos4.1.4
sparc-sun-solaris2.5.1
powerpc-unknown-linux-gnu
hppa1.1-hp-hpux10.20
i386-pc-cygwin32 (CygWin32 b18, Win95)
i386-pc-djgpp (DGJPP 2.0, MS-DOS 7.0 under Win95)
i386-pc-os2 (OS/2 3.0, EMX 0.9c)
Read INSTALL for installation instructions, or INSTALL.DOS for DOS, Windows
95, and OS/2. Mail bug-gforth@gnu.ai.mit.edu if you have problems. To start
......
/*
Copyright (C) 1996,1997,1998 Free Software Foundation, Inc.
This file is part of Gforth.
Gforth is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
say "*** Configuring for OS/2 with EMX 3.0 GNU C ***"
parse arg args
THREAD="i"
FREGS="n"
do while args \== ""
parse var args arg args
select
when arg="--enable-direct-threaded" then THREAD="d"
when arg="--enable-indirect-threaded" then THREAD="i"
when arg="--enable-force-reg" then FREGS="y"
when arg="--help" then do
say "--enable and --with options recognized:"
say " --enable-force-reg Use explicit register declarations if they appear in"
say " the machine.h file. This can cause a good speedup,"
say " but also incorrect code with some gcc versions on"
say " some processors (default disabled)."
say " --enable-direct-threaded Force direct threading. This may not work on"
say " some machines and may cause slowdown on others."
say " (default processor-dependent)"
say " --enable-indirect-threaded Force indirect threading. This can cause a"
say " slowdown on some machines."
say " (default processor-dependent)"
end
otherwise
do
say "*** Unknown option:" arg
call Usage
end
end
end
copy makefile.os2 makefile
copy kernl32l.fi kernel.fi
copy envos.os2 envos.fs
copy os2conf.h engine\config.h
if THREAD="i" THEN DO
call lineout engine\config.h, "#ifndef INDIRECT_THREADED"
call lineout engine\config.h, "#define INDIRECT_THREADED 1"
call lineout engine\config.h, "#endif"
end
IF THREAD="d" THEN do
call lineout engine\config.h, "#ifndef DIRECT_THREADED"
call lineout engine\config.h, "#define DIRECT_THREADED 1"
call lineout engine\config.h, "#endif"
end
IF FREGS="y" THEN do
call lineout engine\config.h, "#ifndef FORCE_REG"
call lineout engine\config.h, "#define FORCE_REG 1"
call lineout engine\config.h, "#endif"
end
call lineout version.h1, 'static char gforth_version[]="0.4.0";'
call lineout version.fs1, ': version-string s" 0.4.0" ;'
call lineout 'version-stamp', '0.4.0'
/*
Copyright (C) 1996,1997,1998 Free Software Foundation, Inc.
This file is part of Gforth.
Gforth is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
say "*** Configuring for OS/2 with EMX 3.0 GNU C ***"
parse arg args
THREAD="i"
FREGS="n"
do while args \== ""
parse var args arg args
select
when arg="--enable-direct-threaded" then THREAD="d"
when arg="--enable-indirect-threaded" then THREAD="i"
when arg="--enable-force-reg" then FREGS="y"
when arg="--help" then do
say "--enable and --with options recognized:"
say " --enable-force-reg Use explicit register declarations if they appear in"
say " the machine.h file. This can cause a good speedup,"
say " but also incorrect code with some gcc versions on"
say " some processors (default disabled)."
say " --enable-direct-threaded Force direct threading. This may not work on"
say " some machines and may cause slowdown on others."
say " (default processor-dependent)"
say " --enable-indirect-threaded Force indirect threading. This can cause a"
say " slowdown on some machines."
say " (default processor-dependent)"
end
otherwise
do
say "*** Unknown option:" arg
call Usage
end
end
end
copy makefile.os2 makefile
copy "engine\makefile.os2" "engine\makefile"
copy kernl32l.fi kernel.fi
copy envos.os2 envos.fs
copy os2conf.h "engine\config.h"
if THREAD="i" THEN DO
call lineout "engine\config.h", "#ifndef INDIRECT_THREADED"
call lineout "engine\config.h", "#define INDIRECT_THREADED 1"
call lineout "engine\config.h", "#endif"
end
IF THREAD="d" THEN do
call lineout "engine\config.h", "#ifndef DIRECT_THREADED"
call lineout "engine\config.h", "#define DIRECT_THREADED 1"
call lineout "engine\config.h", "#endif"
end
IF FREGS="y" THEN do
call lineout "engine\config.h", "#ifndef FORCE_REG"
call lineout "engine\config.h", "#define FORCE_REG 1"
call lineout "engine\config.h", "#endif"
end
call lineout version.h1, 'static char gforth_version[]="0.4.0";'
call lineout "kernel\version.fs", ': version-string s" 0.4.0" ;'
call lineout 'version-stamp', '0.4.0'
......@@ -1164,6 +1164,11 @@ VARIABLE ;Resolve 1 cells allot
.sourcepos ." needs doer: " >in @ bl word count type >in ! cr
THEN
ghost tuck swap resolve <do:> swap >magic ! ;
Variable prim#
: first-primitive ( n -- ) prim# ! ;
: Primitive ( -- ) \ name
prim# @ T Alias H -1 prim# +! ;
>CROSS
\ Conditionals and Comments 11may93jaw
......
......@@ -76,7 +76,7 @@ ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
DEBUGFLAG = @DEBUGFLAG@
CFLAGS = $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
CFLAGS2 = $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
FORTHKFLAGS= --die-on-signal -p ..$(PATHSEP)$(srcdir) -i ../$(kernel_fi)
FORTHKFLAGS= --die-on-signal -p "..$(PATHSEP)$(srcdir)" -i ../$(kernel_fi)
FORTHK = ../gforth $(FORTHKFLAGS)
#John Wavrik should use -Xlinker -N to get a writable text (executable)
......
......@@ -48,7 +48,7 @@
/* increment this whenever the primitives change in an incompatible way */
#ifndef DEFAULTPATH
# define DEFAULTPATH "."
# define DEFAULTPATH "~+"
#endif
#ifdef MSDOS
......@@ -128,7 +128,7 @@ typedef struct {
void relocate(Cell *image, const char *bitstring, int size, Label symbols[])
{
int i=0, j, k, steps=(size/sizeof(Cell))/8;
int i=0, j, k, steps=(size/sizeof(Cell))/RELINFOBITS;
Cell token;
char bits;
/* static char bits[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};*/
......
......@@ -26,3 +26,4 @@
-7 Alias: :dofield
-8 Alias: :dodoes
-9 Alias: :doesjump
-&10 first-primitive
......@@ -39,7 +39,7 @@ s%$(FORTHPATH)$(PATHSEP)%%g
s%@FORTHSIZES@%%g
s%test x'$(VERSION)' = x`cat $@` || %%g
s%--clear-dictionary%-c%g
s%.$(PATHSEP)$(srcdir)%.%g
s%".$(PATHSEP)~+$(PATHSEP)$(srcdir)"%"~+$(PATHSEP)."%g
# s% -I$(srcdir)%%g
s%GFORTHD=.*gforth.fi%gforthmi gforth.fi%g
s%gforth-ditc%gforth-d%g
......@@ -52,4 +52,5 @@ s%@EXE@%.exe%g
s%cd engine && $(MAKE)%$(MAKE) -C engine%g
s%\(CFLAGS2.*\) -O4%\1%g
s%gforthmi gforth\$%gforthmi.bat gforth\$%g
s%engine/Makefile configure%engine/Makefile%g
\ No newline at end of file
s%engine/Makefile configure%engine/Makefile%g
s%$(exec_prefix)/bin%%g
\ No newline at end of file
......@@ -3,7 +3,7 @@ s% cp% copy%g
s% rm% del%g
s% ./gforth % gforth %g
s%@srcdir@%.%g
s%\"$(FORTHPATH)\"%\".\"%g
s%\"$(FORTHPATH)\"%\"~+\"%g
s%@CFLAGS@%%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
......@@ -49,7 +49,7 @@ s%@LN_S@%ln -s%g
s%@INSTALL@%install-sh -c%g
s%@INSTALL_PROGRAM@%${INSTALL}%g
s%@INSTALL_DATA@%${INSTALL} -m 644%g
s%@LIBOBJS@% pow10.o strsig.o ecvt.o atanh.o%g
s%@LIBOBJS@% pow10.o strsignal.o ecvt.o atanh.o getopt.o getopt1.o%g
s%@getopt_long@%getopt.o getopt1.o%g
s%@kernel_fi@%kernl32l.fi%g
s%@PATHSEP@%;%g
......@@ -60,7 +60,6 @@ s%$(srcdir)/config.h.in: stamp-h.in%#$(srcdir)/config.h.in: stamp-h.in%g
s%engine/config.h: stamp-h%#engine/config.h: stamp-h%g
s%$(FORTHPATH)$(PATHSEP)%%g
s%@FORTHSIZES@%%g
s%$(PATHSEP)$(srcdir)%%g
s%test x'$(VERSION)' = x`cat $@` || %%g
s%GFORTHD="./gforth-ditc -p .* $(srcdir)/%%g
s%'s"%"s\\"%g
......@@ -68,4 +67,13 @@ s%"'%\\""%g
s%@OSCLASS@%dos%g
s%@machine@%386%g
s%@VERSION@%0.4.0%g
s%@EXE@%exe%g
\ No newline at end of file
s%@EXE@%.exe%g
s%engine/$@%engine\\$@%g
s%gforthmi gforth\$(EXE)%gforthmi.cmd gforth\$(EXE)%g
s%if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi%echo $(VERSION) > $@%g
s%echo ": version-string s\\" $(VERSION)\\" ;" > kernel/version.fs%%g
s%GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc -p .$(PATHSEP)$(srcdir) -i $(kernel_fi) startup.fs" ./%%g
s%\*\.h %%g
s%\*\.\[h\]%machine.h%g
s%config.h.in ../config.status%%g
s%cd .. && CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status%%g
\ No newline at end of file
......@@ -6,7 +6,13 @@
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* #undef WORDS_BIGENDIAN */
/* Package name */
#define PACKAGE "gforth"
/* Package version */
#define VERSION "0.4.0"
/* an integer type that is as long as a pointer */
#define CELL_TYPE int
......
......@@ -666,7 +666,7 @@ set-current
: output-alias ( -- ) flush-comment on
?flush-comment
primitive-number @ . ." alias " forth-name 2@ type cr
( primitive-number @ . ." alias " ) ." Primitive " forth-name 2@ type cr
-1 primitive-number +! ;
: output-forth ( -- ) flush-comment on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment