Annotation of gforth/INSTALL, revision 1.40
1.38 anton 1: Copyright (C) 2003,2007 Free Software Foundation, Inc.
1.33 anton 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.40 ! anton 10: For the (documented) libcc.fs C interface you need a C compiler and
! 11: libtool at run-time.
1.37 anton 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:
1.39 pazsan 36: This includes a check whether your shiny new Forth system works. If
37: you like to invoke the check alone, do
1.21 anton 38:
1.30 anton 39: make check
1.21 anton 40:
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:
1.28 anton 62: 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/.
1.21 anton 72:
73:
74: Configuration Options
75:
1.23 anton 76: 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:
1.21 anton 79:
80: $srcdir/configure
81:
1.23 anton 82: where $srcdir is the source directory. (Note that we tested this only
1.21 anton 83: for installation; i.e., if you want to hack the Gforth sources, you
84: should probably build in the source directory).
85:
1.4 pazsan 86: configure has the following useful parameters:
1.9 anton 87: --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]
1.8 anton 91: --help: tells you about other parameters.
1.1 anton 92:
1.40 ! anton 93: The file Benchres shows the best gforth-fast performance that we
! 94: achieved.
1.21 anton 95:
1.9 anton 96: 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
1.15 anton 99: hierarchy, say
1.5 anton 100:
1.9 anton 101: ./configure --prefix=/gnu
1.2 anton 102:
1.17 anton 103: Moreover, if your GCC is not called gcc (but, e.g., gcc-2.7.1), you
104: should say so during configuration. E.g.:
1.16 pazsan 105:
1.35 anton 106: ./configure CC=gcc-2.7.1
1.16 pazsan 107:
1.17 anton 108: 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:
1.15 anton 110:
1.35 anton 111: ./configure CC="gcc -b i486-linuxaout -V 2.7.0"
1.15 anton 112:
1.22 anton 113: 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:
1.40 ! anton 117: ./configure "FORTHSIZES=--dictionary-size=1048576 --data-stack-size=16k --fp-stack-size=16K --return-stack-size=15k --locals-stack-size=14848b"
1.22 anton 118:
119: The line above reaffirms the default sizes. Note that the locals
120: stack area is also used as input buffer stack.
1.17 anton 121:
1.24 anton 122: 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:
1.35 anton 126: ./configure ac_cv_sizeof_long_long=0
1.24 anton 127:
1.40 ! anton 128: 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:
1.24 anton 134:
1.31 anton 135: Cross-Installation
1.24 anton 136:
1.40 ! anton 137: 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:
1.31 anton 146: 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
1.24 anton 151: cross-compilation situation. You have to provide the results of these
1.36 anton 152: tests by hand. E.g., if you compile for an ARM:
1.24 anton 153:
1.40 ! anton 154: 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 \
1.36 anton 158: ac_cv_c_bigendian=no ./configure CC=arm-elf-gcc --host=arm-linux
1.24 anton 159:
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
1.36 anton 162: 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).
1.31 anton 165:
1.24 anton 166:
1.17 anton 167: 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
1.28 anton 171: for loading them into /usr/local/share/gforth/site-forth/siteinit.fs
1.17 anton 172: (if the commands work for all architectures) or
1.28 anton 173: /usr/local/lib/gforth/site-forth/siteinit.fs (for
1.17 anton 174: architecture-specific commands);
1.28 anton 175: /usr/local/lib/gforth/site-forth/siteinit.fs takes precedence if both
1.17 anton 176: 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
1.28 anton 181: /usr/local/share/gforth/site-forth/siteinit.fs if there is no such
1.17 anton 182: file.
183:
1.28 anton 184: If you change the siteinit.fs file, you should run "make install"
1.17 anton 185: again for the changes to take effect (Actually, the part of "make
186: install" starting with "rm gforth.fi" is sufficient).
187:
188:
1.12 anton 189: 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.
1.10 anton 194:
1.12 anton 195: 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.
1.29 crook 198:
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).
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>