Annotation of gcc/INSTALL, revision 1.1.1.3

1.1       root        1: This is a copy of one node from the Info file internals-1.
                      2: For full information on installing and porting GCC, refer to the
                      3: internals manual:
                      4: 
                      5:   Info file   internals
                      6:   TeX output  internals.dvi
                      7:   TeX source  internals.texinfo
                      8: 
                      9: Installing GNU CC
                     10: *****************
                     11: 
                     12: Here is the procedure for installing GNU CC on a Unix system.
                     13: 
                     14: * Menu:
                     15: 
                     16: * VMS Install::   See below for installation on VMS.
                     17: 
                     18: 
1.1.1.2   root       19:   1. Edit `Makefile'.  If you are using HPUX, or any form of system V, you
                     20:      must make a few changes described in comments at the beginning of the
                     21:      file.
                     22: 
                     23:   2. On a Sequent system, go to the Berkeley universe.
1.1       root       24: 
1.1.1.2   root       25:   3. Choose configuration files.
1.1       root       26: 
                     27:         * Make a symbolic link named `config.h' to the top-level config
                     28:           file for the machine you are using (*Note Config::.).  This file
                     29:           is responsible for defining information about the host machine. 
                     30:           It includes `tm.h'.
                     31: 
                     32:           The file's name should be `config-MACHINE.h'.  On VMS, use
                     33:           `config-vms.h' rather than `config-vax.h'.  On the HP 9000 series
                     34:           300, use `config-hp9k3.h' rather than `config-m68k.h'.
                     35: 
                     36:           If your system does not support symbolic links, you might want to
                     37:           set up `config.h' to contain a `#include' command which refers to
                     38:           the appropriate file.
                     39: 
                     40:         * Make a symbolic link named `tm.h' to the machine-description
                     41:           macro file for your machine (its name should be `tm-MACHINE.h').
                     42: 
                     43:           For the 68000/68020, do not use `tm-m68k.h' directly; instead use
                     44:           one of the files `tm-sun3.h', `tm-sun2.h', `tm-isi68.h',
                     45:           `tm-news800.h' or `tm-3b1.h'.  Each of those files includes
                     46:           `tm-m68k.h' but sets up a few things differently as appropriate
                     47:           to the specific model of machine.
                     48: 
                     49:           There are two files you can use for a 680x0 running HPUX:
                     50:           `tm-hp9k320.h' and `tm-hp9k320g.h'.  Use the former if you are
                     51:           installing GNU CC alone.  The latter is for another option where
                     52:           GNU CC together with the GNU assembler, linker, debugger and
                     53:           other utilities are used to replace all of HPUX that deals with
                     54:           compilation.  Not all of the pieces of GNU software needed for
                     55:           this mode of operation are as yet in distribution; full
                     56:           instructions will appear here in the future.
                     57: 
1.1.1.2   root       58:           For the vax, use `tm-vax.h' on Unix, or `tm-vms.h' on VMS.
                     59: 
1.1.1.3 ! root       60:           For the SPARC, use `tm-sparc.h'.  Note that the SPARC support
        !            61:           *has a fatal bug*; to use it, you will have to debug it.
1.1.1.2   root       62: 
1.1       root       63:           For the 32000, use `tm-sequent.h' if you are using a Sequent
1.1.1.2   root       64:           machine, or `tm-encore.h' for an Encore machine; otherwise,
                     65:           perhaps `tm-ns32k.h' will work for you.  If you are trying to use
                     66:           GNU CC on GENIX, you may need to get the version of `malloc' from
                     67:           GNU Emacs instead of the system library version, and you probably
                     68:           need to cause the following assembler code to be executed in
                     69:           `crt0.o' in order to run the GNU CC output:
                     70: 
                     71:                lprd    sb,$0
                     72:                sprd    mod,r0
                     73:                movqd   $0,0(r0)
1.1       root       74: 
1.1.1.2   root       75:           Note that Encore systems are supported only under BSD.
1.1       root       76: 
                     77:         * Make a symbolic link named `md' to the machine description
                     78:           pattern file (its name should be `MACHINE.md').
                     79: 
                     80:         * Make a symbolic link named `aux-output.c' to the output
                     81:           subroutine file for your machine (its name should be
                     82:           `OUTPUT-MACHINE.c').
                     83: 
1.1.1.2   root       84:   4. Make sure the Bison parser generator is installed.  (This is unnecessary
                     85:      if the Bison output files `parse.tab.c' and `cexp.c' are more recent
                     86:      than `parse.y' and `cexp.y' and you do not plan to change the `.y'
                     87:      files.)
1.1       root       88: 
                     89:      Note that if you have an old version of Bison you may get an error
                     90:      from the line with the `%expect' directive.  If so, simply remove that
                     91:      line from `parse.y' and proceed.
                     92: 
1.1.1.2   root       93:   5. If you are using a Sun, make sure the environment variable
1.1       root       94:      `FLOAT_OPTION' is not set.  If this option were set to `f68881' when
                     95:      `gnulib' is compiled, the resulting code would demand to be linked
                     96:      with a special startup file and will not link properly without special
                     97:      pains.
                     98: 
1.1.1.2   root       99:   6. Build the compiler.  Just type `make' in the compiler directory.
1.1       root      100: 
1.1.1.2   root      101:   7. Move the first-stage object files and executables into a subdirectory
1.1       root      102:      with this command:
                    103: 
                    104:           make stage1
                    105: 
                    106:      The files are moved into a subdirectory named `stage1'.  Once
                    107:      installation is complete, you may wish to delete these files with `rm
                    108:      -r stage1'.
                    109: 
1.1.1.2   root      110:   8. Recompile the compiler with itself, with this command:
1.1       root      111: 
                    112:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
                    113: 
                    114:      On a 68000 or 68020 system lacking floating point hardware, unless you
                    115:      have selected a `tm.h' file that expects by default that there is no
                    116:      such hardware, do this instead:
                    117: 
                    118:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
                    119: 
1.1.1.2   root      120:   9. If you wish to test the compiler by compiling it with itself one more
1.1       root      121:      time, do this:
                    122: 
                    123:           make stage2
                    124:           make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
                    125:           foreach file (*.o)
                    126:           cmp $file stage2/$file
                    127:           end
                    128: 
                    129:      This will notify you if any of these stage 3 object files differs from
                    130:      those of stage 2.  Any difference, no matter how innocuous, indicates
                    131:      that the stage 2 compiler has compiled GNU CC incorrectly, and is
                    132:      therefore a potentially serious bug which you should investigate and
                    133:      report (*Note Bugs::.).
                    134: 
1.1.1.2   root      135:  10. Install the compiler driver, the compiler's passes and run-time support.
1.1.1.3 ! root      136:      You can use the following command:
1.1       root      137: 
                    138:           make install
                    139: 
                    140:      This copies the files `cc1', `cpp' and `gnulib' to files `gcc-cc1',
                    141:      `gcc-cpp' and `gcc-gnulib' in directory `/usr/local/lib', which is
                    142:      where the compiler driver program looks for them.  It also copies the
                    143:      driver program `gcc' into the directory `/usr/local', so that it
                    144:      appears in typical execution search paths.
                    145: 
                    146:      *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and
                    147:      other system header files unless the `-traditional' option is used.* 
                    148:      The bug is in the header files: at least on some machines, they rely
                    149:      on behavior that is incompatible with ANSI C.  This behavior consists
                    150:      of substituting for macro argument names when they appear inside of
                    151:      character constants.  The `-traditional' option tells GNU CC to behave
                    152:      the way these headers expect.
                    153: 
                    154:      Because of this problem, you might prefer to configure GNU CC to use
                    155:      the system's own C preprocessor.  To do so, make the file
                    156:      `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
                    157: 
                    158:      Alternatively, on Sun systems and 4.3BSD at least, you can correct the
                    159:      include files by running the shell script `fixincludes'.  This
1.1.1.3 ! root      160:      installs modified, corrected copies of the files `ioctl.h',
        !           161:      `ttychars.h' and many others, in a special directory where only GNU CC
        !           162:      will normally look for them.
1.1       root      163: 
1.1.1.3 ! root      164:      See the file `fixincludes' for a list of all the files we know to
        !           165:      require correction.
1.1       root      166: 
                    167: If you cannot install the compiler's passes and run-time support in
                    168: `/usr/local/lib', you can alternatively use the `-B' option to specify a
                    169: prefix by which they may be found.  The compiler concatenates the prefix
                    170: with the names  `cpp', `cc1' and `gnulib'.  Thus, you can put the files in
                    171: a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when you run GNU CC.
                    172: 
1.1.1.2   root      173: Also, you can specify an alternative default directory for these files by
                    174: setting the Make variable `libdir' when you make GNU CC.
                    175: 
                    176: 
                    177: File: internals,  Node: VMS Install,  Prev: Installation,  Up: Installation
                    178: 
1.1       root      179: Installing GNU CC on VMS
                    180: ========================
                    181: 
1.1.1.2   root      182: The VMS version of GNU CC is distributed in an unusual tape format which
                    183: consists of several tape files.  The first is a command file; the second is
                    184: an executable program which reads Unix tar format; the third is another
                    185: command file which uses this program to read the remainder of the tape.
                    186: 
                    187: To load the tape, it suffices to mount it `/foreign' and then do `@mta0:'
                    188: to execute the command file at the beginning of the tape.
                    189: 
                    190: The tape contains executables and object files as well as sources, so no
                    191: compilation is necessary unless you change the sources.  (This is a good
                    192: thing, since you probably don't have any other C compiler.)  If you must
                    193: recompile, here is how:
1.1       root      194: 
                    195:   1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to `config.h',
                    196:      `vax.md' to `md.' and `output-vax.c' to `aux-output.c'.
                    197: 
                    198:   2. Type `@make' to do recompile everything.
1.1.1.2   root      199: 
                    200: To install the `GCC' command so you can use the compiler easily, in the
                    201: same manner as you use the VMS C compiler, you must install the VMS CLD
                    202: file for GNU CC as follows:
                    203: 
                    204:   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to point to
                    205:      the directories where the GNU CC executables (`gcc-cpp', `gcc-cc1',
                    206:      etc.) and the C include files are kept.  This should be done with the
                    207:      commands:
                    208: 
                    209:           $ assign /super /system disk:[gcc] gnu_cc
                    210:           $ assign /super /system disk:[gcc.include] gnu_cc_include
                    211: 
                    212:      with the appropriate disk and directory names.  These commands can be
                    213:      placed in your system startup file so they will be executed whenever
                    214:      the machine is rebooted.
                    215: 
                    216:   2. Install the `GCC' command with the command line:
                    217: 
                    218:           $ set command /table=sys$library:dcltables gnu_cc:gcc
                    219: 
                    220:      Now you can invoke the compiler with a command like `gcc /verbose
                    221:      file.c', which is equivalent to the command `gcc -v -c file.c' in Unix.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.