[gforth] / gforth / INSTALL  

gforth: gforth/INSTALL


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