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