[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.40 For the (documented) libcc.fs C interface you need a C compiler and
11 :     libtool at run-time.
12 : anton 1.37
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 --help: tells you about other parameters.
92 : anton 1.1
93 : anton 1.40 The file Benchres shows the best gforth-fast performance that we
94 :     achieved.
95 : anton 1.21
96 : anton 1.9 If you don't like the defaults for the installation directories, you
97 :     should override them already during configure. E.g., if you want to
98 :     install in the /gnu hierarchy instead of in the default /usr/local
99 : anton 1.15 hierarchy, say
100 : anton 1.5
101 : anton 1.9 ./configure --prefix=/gnu
102 : anton 1.2
103 : anton 1.17 Moreover, if your GCC is not called gcc (but, e.g., gcc-2.7.1), you
104 :     should say so during configuration. E.g.:
105 : pazsan 1.16
106 : anton 1.35 ./configure CC=gcc-2.7.1
107 : pazsan 1.16
108 : anton 1.17 You can also pass additional options to gcc in this way, e.g., if you
109 :     want to generate an a.out executable under Linux with gcc-2.7.0:
110 : anton 1.15
111 : anton 1.35 ./configure CC="gcc -b i486-linuxaout -V 2.7.0"
112 : anton 1.15
113 : anton 1.22 You can change the sizes of the various areas used in the default
114 :     image `gforth.fi' by passing the appropriate Gforth command line
115 :     options in the FORTHSIZES environment variable:
116 :    
117 : anton 1.40 ./configure "FORTHSIZES=--dictionary-size=1048576 --data-stack-size=16k --fp-stack-size=16K --return-stack-size=15k --locals-stack-size=14848b"
118 : anton 1.22
119 :     The line above reaffirms the default sizes. Note that the locals
120 :     stack area is also used as input buffer stack.
121 : anton 1.17
122 : anton 1.24 If C's "long long" do not work properly on your machine (i.e., if the
123 :     tests involving double-cell numbers fail), you can build Gforth such
124 :     that it does not use "long long":
125 :    
126 : anton 1.35 ./configure ac_cv_sizeof_long_long=0
127 : anton 1.24
128 : anton 1.40 For MacOS X on Core 2 processors, you might want to use the 64-bit
129 :     version for increased speed (more registers available); you have to
130 :     ask for that on configuration, as follows:
131 :    
132 :     ./configure CC='gcc-4.2 -arch x86_64' --build=x86_64-apple-darwin9.4.0
133 :    
134 : anton 1.24
135 : anton 1.31 Cross-Installation
136 : anton 1.24
137 : anton 1.40 There is currently no simple way to do cross-installation of Gforth
138 :     (apart from Gforth EC). The current build process interleaves
139 :     compiling and running heavily, so multiple transfers between build and
140 :     target machine would be required. We don't have a testing environment
141 :     for cross-compilation, so we cannot fix this at the moment. If you
142 :     want to do cross-installation, please contact us.
143 :    
144 :     In any case, you might find the following useful:
145 :    
146 : anton 1.31 You need a cross-compilation toolchain for your target including gcc
147 :     (2.0 or later).
148 :    
149 :     The first step in cross-installation is the cross-configuration. A
150 :     few tests made by the configure script do not work in a
151 : anton 1.24 cross-compilation situation. You have to provide the results of these
152 : anton 1.36 tests by hand. E.g., if you compile for an ARM:
153 : anton 1.24
154 : anton 1.40 env skipcode=".skip 16" ac_cv_sizeof_char_p=4 ac_cv_sizeof_void_p=4 \
155 :     ac_cv_sizeof_char=1 ac_cv_sizeof_short=2 ac_cv_sizeof_int=4 \
156 :     ac_cv_sizeof_long=4 ac_cv_sizeof_long_long=8 ac_cv_sizeof_intptr_t=4 \
157 :     ac_cv_sizeof_int128_t=0 ac_cv_sizeof_uint128_t=0 \
158 : anton 1.36 ac_cv_c_bigendian=no ./configure CC=arm-elf-gcc --host=arm-linux
159 : anton 1.24
160 :     The ac_cv_sizeof_... variables give the sizes of various C types;
161 :     ac_cv_sizeof_char_p is the same as "sizeof(char*)" in C code. The
162 : anton 1.36 ac_cv_c_bigendian variable gives the byte order. The skipcode
163 :     specifies how to skip 16 bytes in the code (use "skipcode=no" to
164 :     disable skipping and dynamic native code generation).
165 : anton 1.31
166 : anton 1.24
167 : anton 1.17 Preloading installation-specific code
168 :    
169 :     If you want to have some installation-specific files loaded when
170 :     Gforth starts (e.g., an assembler for your processor), put commands
171 : anton 1.28 for loading them into /usr/local/share/gforth/site-forth/siteinit.fs
172 : anton 1.17 (if the commands work for all architectures) or
173 : anton 1.28 /usr/local/lib/gforth/site-forth/siteinit.fs (for
174 : anton 1.17 architecture-specific commands);
175 : anton 1.28 /usr/local/lib/gforth/site-forth/siteinit.fs takes precedence if both
176 : anton 1.17 files are present (unless you change the search path). The file names
177 :     given above are the defaults; if you have changed the prefix, you have
178 :     to replace "/usr/local" in these names with your prefix.
179 :    
180 :     By default, the installation procedure creates an empty
181 : anton 1.28 /usr/local/share/gforth/site-forth/siteinit.fs if there is no such
182 : anton 1.17 file.
183 :    
184 : anton 1.28 If you change the siteinit.fs file, you should run "make install"
185 : anton 1.17 again for the changes to take effect (Actually, the part of "make
186 :     install" starting with "rm gforth.fi" is sufficient).
187 :    
188 :    
189 : anton 1.12 Multiple Versions and Deinstallation
190 :    
191 :     Several versions of Gforth can be installed and used at the same
192 :     time. Version `foo' can be invoked with `gforth-foo'. We recommend to
193 :     keep the old version for some time after a new one has been installed.
194 : anton 1.10
195 : anton 1.12 You can deinstall this version of Gforth with 'make uninstall' and
196 :     version foo with 'make uninstall VERSION=foo'. 'make uninstall' also
197 :     tells you how to uninstall Gforth completely.
198 : crook 1.29
199 :    
200 :     Installing Info Files
201 :    
202 :     Info is the GNU project on-line documentation format. You can read
203 :     info files either from within Emacs (Ctrl-h i) or using the
204 :     stand-alone Info reader, 'info'.
205 :    
206 :     If you use the default install root of '/usr/local' then the info
207 :     files will be installed in '/usr/local/info'.
208 :    
209 :     Many GNU/Linux distributions are set up to put all of their
210 :     documentation in '/usr/info', in which case you might have to do a
211 :     couple of things to get your environment set up to accommodate files
212 :     in both areas:
213 :    
214 :     1. Add an INFOPATH environment variable. The easiest place to do
215 :     this is '/etc/profile', right next to PATH and MANPATH:
216 :    
217 :     INFOPATH=/usr/local/info:/usr/info
218 :    
219 :     2. Create a file called 'dir' in 'usr/local/info'. Use the file
220 :     '/usr/info/dir' as a template. You can add the line for gforth
221 :     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