Annotation of gforth/INSTALL, revision 1.31

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>