[gforth] / gforth / INSTALL  

gforth: gforth/INSTALL


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help