| 1 : |
anton
|
1.7
|
You need gcc version 2.0 or later to compile gforth. |
| 2 : |
anton
|
1.1
|
|
| 3 : |
anton
|
1.5
|
First, type |
| 4 : |
anton
|
1.3
|
|
| 5 : |
anton
|
1.8
|
./configure |
| 6 : |
anton
|
1.1
|
|
| 7 : |
anton
|
1.21
|
(see Section Configuration Options below for details). |
| 8 : |
|
|
|
| 9 : |
|
|
After configuration, type |
| 10 : |
|
|
|
| 11 : |
|
|
make |
| 12 : |
|
|
|
| 13 : |
|
|
Now you can check whether your shiny new Forth system works. Say |
| 14 : |
|
|
|
| 15 : |
anton
|
1.30
|
make check |
| 16 : |
anton
|
1.21
|
|
| 17 : |
|
|
You can run some benchmarks with |
| 18 : |
|
|
|
| 19 : |
|
|
make bench |
| 20 : |
|
|
|
| 21 : |
|
|
and compare them with the results in Benchres and in the manual. |
| 22 : |
|
|
|
| 23 : |
|
|
If everything is all right, you may want to install gforth. Type |
| 24 : |
|
|
|
| 25 : |
|
|
make install |
| 26 : |
|
|
|
| 27 : |
crook
|
1.29
|
You have to make an entry in the info directory file manually (see |
| 28 : |
|
|
Installing Info Files, below). |
| 29 : |
anton
|
1.21
|
|
| 30 : |
|
|
For paper documentation, print gforth.ps (a Postscript file (300dpi |
| 31 : |
|
|
fonts, i.e., it works, but does not produce best quality on better |
| 32 : |
|
|
printers)), or say |
| 33 : |
|
|
|
| 34 : |
|
|
make gforth.dvi |
| 35 : |
|
|
|
| 36 : |
|
|
and print the resulting file gforth.dvi. You can also get the |
| 37 : |
|
|
documentation in HTML format by typing |
| 38 : |
|
|
|
| 39 : |
|
|
make html |
| 40 : |
|
|
|
| 41 : |
anton
|
1.28
|
If you prefer plain ASCII documentation, you can |
| 42 : |
|
|
|
| 43 : |
|
|
make doc/gforth.txt |
| 44 : |
|
|
|
| 45 : |
|
|
or just concatenate the files gforth.info-* ('cat gforth.info-*' under |
| 46 : |
|
|
Unix); the result of the latter option is a little worse. |
| 47 : |
|
|
|
| 48 : |
|
|
You can find binary distributions, documentation in HTML and plain |
| 49 : |
|
|
text format and information on known installation problems at |
| 50 : |
|
|
http://www.complang.tuwien.ac.at/forth/gforth/. |
| 51 : |
anton
|
1.21
|
|
| 52 : |
|
|
|
| 53 : |
|
|
Configuration Options |
| 54 : |
|
|
|
| 55 : |
anton
|
1.23
|
If you use GNU make, you can build in a directory different from the |
| 56 : |
|
|
source directory by changing to the build directory and invoking |
| 57 : |
|
|
configure thus: |
| 58 : |
anton
|
1.21
|
|
| 59 : |
|
|
$srcdir/configure |
| 60 : |
|
|
|
| 61 : |
anton
|
1.23
|
where $srcdir is the source directory. (Note that we tested this only |
| 62 : |
anton
|
1.21
|
for installation; i.e., if you want to hack the Gforth sources, you |
| 63 : |
|
|
should probably build in the source directory). |
| 64 : |
|
|
|
| 65 : |
pazsan
|
1.4
|
configure has the following useful parameters: |
| 66 : |
anton
|
1.9
|
--prefix=PREFIX install architecture-independent files in PREFIX |
| 67 : |
|
|
[default: /usr/local] |
| 68 : |
|
|
--exec-prefix=PREFIX install architecture-dependent files in PREFIX |
| 69 : |
|
|
[default: same as prefix] |
| 70 : |
anton
|
1.8
|
--enable-force-reg Use explicit register declarations if they appear in |
| 71 : |
|
|
the machine.h file. This can cause a good speedup, |
| 72 : |
|
|
but also incorrect code with some gcc versions on |
| 73 : |
|
|
some processors (default disabled). |
| 74 : |
|
|
--help: tells you about other parameters. |
| 75 : |
anton
|
1.1
|
|
| 76 : |
anton
|
1.21
|
The file Benchres shows which combination of the -enable options we |
| 77 : |
|
|
tried gave the best results for various machines. |
| 78 : |
|
|
|
| 79 : |
anton
|
1.9
|
If you don't like the defaults for the installation directories, you |
| 80 : |
|
|
should override them already during configure. E.g., if you want to |
| 81 : |
|
|
install in the /gnu hierarchy instead of in the default /usr/local |
| 82 : |
anton
|
1.15
|
hierarchy, say |
| 83 : |
anton
|
1.5
|
|
| 84 : |
anton
|
1.9
|
./configure --prefix=/gnu |
| 85 : |
anton
|
1.2
|
|
| 86 : |
anton
|
1.17
|
Moreover, if your GCC is not called gcc (but, e.g., gcc-2.7.1), you |
| 87 : |
|
|
should say so during configuration. E.g.: |
| 88 : |
pazsan
|
1.16
|
|
| 89 : |
anton
|
1.17
|
env CC=gcc-2.7.1 ./configure |
| 90 : |
pazsan
|
1.16
|
|
| 91 : |
anton
|
1.17
|
You can also pass additional options to gcc in this way, e.g., if you |
| 92 : |
|
|
want to generate an a.out executable under Linux with gcc-2.7.0: |
| 93 : |
anton
|
1.15
|
|
| 94 : |
anton
|
1.17
|
env "CC=gcc -b i486-linuxaout -V 2.7.0" ./configure |
| 95 : |
anton
|
1.15
|
|
| 96 : |
anton
|
1.22
|
You can change the sizes of the various areas used in the default |
| 97 : |
|
|
image `gforth.fi' by passing the appropriate Gforth command line |
| 98 : |
|
|
options in the FORTHSIZES environment variable: |
| 99 : |
|
|
|
| 100 : |
anton
|
1.26
|
env "FORTHSIZES=--dictionary-size=256k --data-stack-size=16k --fp-stack-size=15872b --return-stack-size=15k --locals-stack-size=14848b" ./configure |
| 101 : |
anton
|
1.22
|
|
| 102 : |
|
|
The line above reaffirms the default sizes. Note that the locals |
| 103 : |
|
|
stack area is also used as input buffer stack. |
| 104 : |
anton
|
1.17
|
|
| 105 : |
anton
|
1.24
|
If C's "long long" do not work properly on your machine (i.e., if the |
| 106 : |
|
|
tests involving double-cell numbers fail), you can build Gforth such |
| 107 : |
|
|
that it does not use "long long": |
| 108 : |
|
|
|
| 109 : |
|
|
env ac_cv_sizeof_long_long=0 ./configure |
| 110 : |
|
|
|
| 111 : |
|
|
|
| 112 : |
anton
|
1.31
|
Cross-Installation |
| 113 : |
anton
|
1.24
|
|
| 114 : |
anton
|
1.31
|
You need a cross-compilation toolchain for your target including gcc |
| 115 : |
|
|
(2.0 or later). |
| 116 : |
|
|
|
| 117 : |
|
|
The first step in cross-installation is the cross-configuration. A |
| 118 : |
|
|
few tests made by the configure script do not work in a |
| 119 : |
anton
|
1.24
|
cross-compilation situation. You have to provide the results of these |
| 120 : |
|
|
tests by hand. E.g., if you compile for a 386 architecture processor: |
| 121 : |
|
|
|
| 122 : |
anton
|
1.32
|
env ac_cv_sizeof_char_p=4 ac_cv_sizeof_char=1 ac_cv_sizeof_short=2 ac_cv_sizeof_int=4 ac_cv_sizeof_long=4 ac_cv_sizeof_long_long=8 ac_cv_sizeof_intptr_t=4 ac_cv_sizeof_int128_t=0 ac_cv_c_bigendian=no ./configure |
| 123 : |
anton
|
1.24
|
|
| 124 : |
|
|
The ac_cv_sizeof_... variables give the sizes of various C types; |
| 125 : |
|
|
ac_cv_sizeof_char_p is the same as "sizeof(char*)" in C code. The |
| 126 : |
|
|
ac_cv_c_bigendian variable gives the byte order. |
| 127 : |
anton
|
1.31
|
|
| 128 : |
|
|
After the cross-configuration you type |
| 129 : |
|
|
|
| 130 : |
|
|
make gforths |
| 131 : |
|
|
|
| 132 : |
|
|
This produces the gforth engines for the target. |
| 133 : |
|
|
|
| 134 : |
|
|
The next step is to transfer everything to the target; on the target, |
| 135 : |
|
|
you do |
| 136 : |
|
|
|
| 137 : |
|
|
make |
| 138 : |
|
|
|
| 139 : |
|
|
to complete building gforth. If you do not have a make on the target, |
| 140 : |
|
|
run |
| 141 : |
|
|
|
| 142 : |
|
|
make -n |
| 143 : |
|
|
|
| 144 : |
|
|
on the host; manually execute on the target the last command output by |
| 145 : |
|
|
"make -n" (GFORTHD=...); the other commands output by "make -n" are |
| 146 : |
|
|
not necessary unless you have changed the Gforth sources. You can |
| 147 : |
|
|
then check and benchmark Gforth with |
| 148 : |
|
|
|
| 149 : |
|
|
make check |
| 150 : |
|
|
make bench |
| 151 : |
|
|
|
| 152 : |
|
|
or equivalent. Finally, perform |
| 153 : |
|
|
|
| 154 : |
|
|
make install |
| 155 : |
|
|
|
| 156 : |
|
|
or the equivalent commands on the target. |
| 157 : |
anton
|
1.24
|
|
| 158 : |
|
|
|
| 159 : |
anton
|
1.17
|
Preloading installation-specific code |
| 160 : |
|
|
|
| 161 : |
|
|
If you want to have some installation-specific files loaded when |
| 162 : |
|
|
Gforth starts (e.g., an assembler for your processor), put commands |
| 163 : |
anton
|
1.28
|
for loading them into /usr/local/share/gforth/site-forth/siteinit.fs |
| 164 : |
anton
|
1.17
|
(if the commands work for all architectures) or |
| 165 : |
anton
|
1.28
|
/usr/local/lib/gforth/site-forth/siteinit.fs (for |
| 166 : |
anton
|
1.17
|
architecture-specific commands); |
| 167 : |
anton
|
1.28
|
/usr/local/lib/gforth/site-forth/siteinit.fs takes precedence if both |
| 168 : |
anton
|
1.17
|
files are present (unless you change the search path). The file names |
| 169 : |
|
|
given above are the defaults; if you have changed the prefix, you have |
| 170 : |
|
|
to replace "/usr/local" in these names with your prefix. |
| 171 : |
|
|
|
| 172 : |
|
|
By default, the installation procedure creates an empty |
| 173 : |
anton
|
1.28
|
/usr/local/share/gforth/site-forth/siteinit.fs if there is no such |
| 174 : |
anton
|
1.17
|
file. |
| 175 : |
|
|
|
| 176 : |
anton
|
1.28
|
If you change the siteinit.fs file, you should run "make install" |
| 177 : |
anton
|
1.17
|
again for the changes to take effect (Actually, the part of "make |
| 178 : |
|
|
install" starting with "rm gforth.fi" is sufficient). |
| 179 : |
|
|
|
| 180 : |
|
|
|
| 181 : |
anton
|
1.12
|
Multiple Versions and Deinstallation |
| 182 : |
|
|
|
| 183 : |
|
|
Several versions of Gforth can be installed and used at the same |
| 184 : |
|
|
time. Version `foo' can be invoked with `gforth-foo'. We recommend to |
| 185 : |
|
|
keep the old version for some time after a new one has been installed. |
| 186 : |
anton
|
1.10
|
|
| 187 : |
anton
|
1.12
|
You can deinstall this version of Gforth with 'make uninstall' and |
| 188 : |
|
|
version foo with 'make uninstall VERSION=foo'. 'make uninstall' also |
| 189 : |
|
|
tells you how to uninstall Gforth completely. |
| 190 : |
crook
|
1.29
|
|
| 191 : |
|
|
|
| 192 : |
|
|
Installing Info Files |
| 193 : |
|
|
|
| 194 : |
|
|
Info is the GNU project on-line documentation format. You can read |
| 195 : |
|
|
info files either from within Emacs (Ctrl-h i) or using the |
| 196 : |
|
|
stand-alone Info reader, 'info'. |
| 197 : |
|
|
|
| 198 : |
|
|
If you use the default install root of '/usr/local' then the info |
| 199 : |
|
|
files will be installed in '/usr/local/info'. |
| 200 : |
|
|
|
| 201 : |
|
|
Many GNU/Linux distributions are set up to put all of their |
| 202 : |
|
|
documentation in '/usr/info', in which case you might have to do a |
| 203 : |
|
|
couple of things to get your environment set up to accommodate files |
| 204 : |
|
|
in both areas: |
| 205 : |
|
|
|
| 206 : |
|
|
1. Add an INFOPATH environment variable. The easiest place to do |
| 207 : |
|
|
this is '/etc/profile', right next to PATH and MANPATH: |
| 208 : |
|
|
|
| 209 : |
|
|
INFOPATH=/usr/local/info:/usr/info |
| 210 : |
|
|
|
| 211 : |
|
|
2. Create a file called 'dir' in 'usr/local/info'. Use the file |
| 212 : |
|
|
'/usr/info/dir' as a template. You can add the line for gforth |
| 213 : |
|
|
manually, or use '/sbin/install-info' (man install-info for details). |
| 214 : |
|
|
|