Annotation of gcc/INSTALL, revision 1.1.1.7

1.1.1.6   root        1: This is a copy of one node from the Info file gcc.info-1.
1.1       root        2: For full information on installing and porting GCC, refer to the
1.1.1.6   root        3: GCC manual:
1.1       root        4: 
1.1.1.6   root        5:   Info file   gcc.info
                      6:   TeX output  gcc.dvi
                      7:   TeX source  gcc.texinfo
                      8: 
                      9: File: gcc.info,  Node: Installation,  Next: Trouble,  Prev: Options,  Up: Top
1.1       root       10: 
                     11: Installing GNU CC
                     12: *****************
                     13: 
                     14: Here is the procedure for installing GNU CC on a Unix system.
                     15: 
                     16: * Menu:
                     17: 
                     18: * VMS Install::   See below for installation on VMS.
                     19: 
1.1.1.4   root       20:   1. Edit `Makefile'.  If you are using HPUX, or any form of system
                     21:      V, you must make a few changes described in comments at the
                     22:      beginning of the file.
1.1.1.2   root       23: 
                     24:   2. On a Sequent system, go to the Berkeley universe.
1.1       root       25: 
1.1.1.7 ! root       26:   3. Choose configuration files.  The easy way to do this is to run
        !            27:      the command file `config.gcc' with a single argument, which is
        !            28:      the name of the machine as it appears in the `tm-MACHINE.h' file
        !            29:      name.
        !            30: 
        !            31:      Here we spell out what files you need to set up:
1.1       root       32: 
1.1.1.4   root       33:         * Make a symbolic link named `config.h' to the top-level
                     34:           config file for the machine you are using (*note
                     35:           Config::.).  This file is responsible for defining
                     36:           information about the host machine.  It includes `tm.h'.
                     37: 
                     38:           The file's name should be `config-MACHINE.h', with these
                     39:           exceptions:
                     40: 
                     41:          `config-vms.h'
                     42:                for vaxen running VMS.
                     43: 
                     44:          `config-vaxv.h'
                     45:                for vaxen running system V.
                     46: 
                     47:          `config-i386v.h'
                     48:                for Intel 80386's running system V.
                     49: 
                     50:          `config-sun4.h'
1.1.1.5   root       51:                for Suns (model 2, 3 or 4) running *operating system*
1.1.1.4   root       52:                version 4.
                     53: 
                     54:          `config-hp9k3.h'
                     55:                for the HP 9000 series 300.
                     56: 
                     57:          `config-gnx.h'
                     58:                for the ns32000 running Genix
                     59: 
                     60:           If your system does not support symbolic links, you might
                     61:           want to set up `config.h' to contain a `#include' command
                     62:           which refers to the appropriate file.
                     63: 
                     64:         * Make a symbolic link named `tm.h' to the
                     65:           machine-description macro file for your machine (its name
                     66:           should be `tm-MACHINE.h').
                     67: 
                     68:           If your system is a 68000, don't use the file `tm-m68k.h'
                     69:           directly.  Instead, use one of these files:
                     70: 
                     71:          `tm-sun3.h'
                     72:                for Sun 3 machines.
                     73: 
                     74:          `tm-sun2.h'
                     75:                for Sun 2 machines.
                     76: 
                     77:          `tm-3b1.h'
                     78:                for AT&T 3b1 (aka 7300 Unix PC).
                     79: 
                     80:          `tm-isi68.h'
                     81:                for Integrated Solutions systems.
                     82: 
                     83:          `tm-news800.h'
                     84:                for SONY News systems.
                     85: 
                     86:          `tm-hp9k320.h'
                     87:                for HPUX systems, if you are using GNU CC with the
                     88:                system's assembler and linker.
                     89: 
                     90:          `tm-hp9k320g.h'
                     91:                for HPUX systems, if you are using the GNU assembler,
                     92:                linker and other utilities.  Not all of the pieces of
                     93:                GNU software needed for this mode of operation are as
                     94:                yet in distribution; full instructions will appear
                     95:                here in the future.
                     96: 
                     97:           For the vax, use `tm-vax.h' on BSD Unix, `tm-vaxv.h' on
                     98:           system V, or `tm-vms.h' on VMS.
                     99: 
1.1.1.7 ! root      100:           For the SPARC (Sun 4), use `tm-sparc.h'.  Note that SPARC
        !           101:           support currenty *does not work*.  It will probably be
        !           102:           fixed for version 1.31.
1.1.1.4   root      103: 
                    104:           For the Motorola 88000, use `tm-m88k.h'.  The support for
                    105:           the 88000 has a few unfinished spots because there was no
                    106:           way to run the output.  Bugs are suspected in handling of
                    107:           branch-tables and in the function prologue and epilogue.
                    108: 
                    109:           For the 80386, don't use `tm-i386.h' directly.  Use
                    110:           `tm-i386v.h' if the target machine is running system V,
                    111:           `tm-seq386.h' for a Sequent 386 system, or `tm-compaq.h'
                    112:           for a Compaq.
                    113: 
                    114:           For the 32000, use `tm-sequent.h' if you are using a
                    115:           Sequent machine, or `tm-encore.h' for an Encore machine, or
                    116:           `tm-gnx.h' if you are using Genix version 3; otherwise,
                    117:           perhaps `tm-ns32k.h' will work for you.
                    118: 
                    119:           Note that Genix has bugs in `alloca' and `malloc'; you must
                    120:           get the compiled versions of these from GNU Emacs and edit
                    121:           GNU CC's `Makefile' to use them.
1.1       root      122: 
1.1.1.2   root      123:           Note that Encore systems are supported only under BSD.
1.1       root      124: 
                    125:         * Make a symbolic link named `md' to the machine description
1.1.1.7 ! root      126:           pattern file.  Its name should be `MACHINE.md', but MACHINE
        !           127:           is often not the same as the name used in the `tm.h' file
        !           128:           because the `md' files are more general.
1.1       root      129: 
                    130:         * Make a symbolic link named `aux-output.c' to the output
                    131:           subroutine file for your machine (its name should be
1.1.1.4   root      132:           `output-MACHINE.c').
1.1       root      133: 
1.1.1.4   root      134:   4. Make sure the Bison parser generator is installed.  (This is
                    135:      unnecessary if the Bison output files `c-parse.tab.c' and
                    136:      `cexp.c' are more recent than `c-parse.y' and `cexp.y' and you
                    137:      do not plan to change the `.y' files.)
                    138: 
1.1.1.5   root      139:      Bison versions older that Sept 8, 1988 will produce incorrect
                    140:      output for `c-parse.tab.c'.
1.1       root      141: 
1.1.1.2   root      142:   5. If you are using a Sun, make sure the environment variable
1.1.1.4   root      143:      `FLOAT_OPTION' is not set.  If this option were set to `f68881'
                    144:      when `gnulib' is compiled, the resulting code would demand to be
                    145:      linked with a special startup file and will not link properly
                    146:      without special pains.
1.1       root      147: 
1.1.1.2   root      148:   6. Build the compiler.  Just type `make' in the compiler directory.
1.1       root      149: 
1.1.1.7 ! root      150:      Ignore any warnings you may see about ``statement not reached''
        !           151:      in the `insn-emit.c'; they are normal.  Any other compilation
        !           152:      errors may represent bugs in the port to your machine or
        !           153:      operating system, and should be investigated and reported (*note
        !           154:      Bugs::.).
        !           155: 
1.1.1.4   root      156:   7. Move the first-stage object files and executables into a
                    157:      subdirectory with this command:
1.1       root      158: 
                    159:           make stage1
                    160: 
                    161:      The files are moved into a subdirectory named `stage1'.  Once
1.1.1.4   root      162:      installation is complete, you may wish to delete these files
                    163:      with `rm -r stage1'.
1.1       root      164: 
1.1.1.2   root      165:   8. Recompile the compiler with itself, with this command:
1.1       root      166: 
                    167:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
                    168: 
1.1.1.4   root      169:      On a 68000 or 68020 system lacking floating point hardware,
                    170:      unless you have selected a `tm.h' file that expects by default
                    171:      that there is no such hardware, do this instead:
1.1       root      172: 
                    173:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
                    174: 
1.1.1.4   root      175:   9. If you wish to test the compiler by compiling it with itself one
                    176:      more time, do this:
1.1       root      177: 
                    178:           make stage2
1.1.1.6   root      179:           make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
1.1       root      180:           foreach file (*.o)
                    181:           cmp $file stage2/$file
                    182:           end
                    183: 
1.1.1.4   root      184:      This will notify you if any of these stage 3 object files
                    185:      differs from those of stage 2.  Any difference, no matter how
                    186:      innocuous, indicates that the stage 2 compiler has compiled GNU
                    187:      CC incorrectly, and is therefore a potentially serious bug which
                    188:      you should investigate and report (*note Bugs::.).
1.1       root      189: 
1.1.1.4   root      190:      Aside from the `-B' option, the options should be the same as
                    191:      when you made stage 2.
                    192: 
                    193:  10. Install the compiler driver, the compiler's passes and run-time
                    194:      support.  You can use the following command:
1.1       root      195: 
                    196:           make install
                    197: 
1.1.1.4   root      198:      This copies the files `cc1', `cpp' and `gnulib' to files
                    199:      `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
                    200:      `/usr/local/lib', which is where the compiler driver program
                    201:      looks for them.  It also copies the driver program `gcc' into
                    202:      the directory `/usr/local', so that it appears in typical
                    203:      execution search paths.
                    204: 
                    205:      *Warning: there is a bug in `alloca' in the Sun library.  To
                    206:      avoid this bug, install the binaries of GNU CC that were
                    207:      compiled by GNU CC.  They use `alloca' as a built-in function
                    208:      and never the one in the library.*
                    209: 
                    210:      *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h'
                    211:      and other system header files unless the `-traditional' option
                    212:      is used.*  The bug is in the header files: at least on some
                    213:      machines, they rely on behavior that is incompatible with ANSI
                    214:      C.  This behavior consists of substituting for macro argument
                    215:      names when they appear inside of character constants.  The
                    216:      `-traditional' option tells GNU CC to behave the way these
                    217:      headers expect.
1.1       root      218: 
1.1.1.4   root      219:      Because of this problem, you might prefer to configure GNU CC to
                    220:      use the system's own C preprocessor.  To do so, make the file
1.1       root      221:      `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
                    222: 
1.1.1.4   root      223:      Alternatively, on Sun systems and 4.3BSD at least, you can
                    224:      correct the include files by running the shell script
                    225:      `fixincludes'.  This installs modified, corrected copies of the
                    226:      files `ioctl.h', `ttychars.h' and many others, in a special
1.1.1.7 ! root      227:      directory where only GNU CC will normally look for them.  This
        !           228:      script will work on various systems because it choose the files
        !           229:      by searching all the system headers for the problem cases that
        !           230:      we know about.
1.1       root      231: 
                    232: If you cannot install the compiler's passes and run-time support in
1.1.1.4   root      233: `/usr/local/lib', you can alternatively use the `-B' option to
                    234: specify a prefix by which they may be found.  The compiler
                    235: concatenates the prefix with the names  `cpp', `cc1' and `gnulib'. 
                    236: Thus, you can put the files in a directory `/usr/foo/gcc' and specify
                    237: `-B/usr/foo/gcc/' when you run GNU CC.
                    238: 
                    239: Also, you can specify an alternative default directory for these
                    240: files by setting the Make variable `libdir' when you make GNU CC.
1.1       root      241: 
1.1.1.2   root      242: 
1.1.1.7 ! root      243: 
1.1.1.6   root      244: File: gcc.info,  Node: VMS Install,  Prev: Installation,  Up: Installation
1.1.1.2   root      245: 
1.1       root      246: Installing GNU CC on VMS
                    247: ========================
                    248: 
1.1.1.4   root      249: The VMS version of GNU CC is distributed in an unusual tape format
                    250: which consists of several tape files.  The first is a command file;
                    251: the second is an executable program which reads Unix tar format; the
                    252: third is another command file which uses this program to read the
                    253: remainder of the tape.
                    254: 
                    255: To load the tape, it suffices to mount it `/foreign' and then do
                    256: `@mta0:' to execute the command file at the beginning of the tape.
                    257: 
                    258: The tape contains executables and object files as well as sources, so
                    259: no compilation is necessary unless you change the sources.  (This is
                    260: a good thing, since you probably don't have any other C compiler.) 
                    261: If you must recompile, here is how:
                    262: 
                    263:   1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to
                    264:      `config.h', `vax.md' to `md.' and `output-vax.c' to
                    265:      `aux-output.c'.
1.1       root      266: 
                    267:   2. Type `@make' to do recompile everything.
1.1.1.2   root      268: 
1.1.1.4   root      269: To install the `GCC' command so you can use the compiler easily, in
                    270: the same manner as you use the VMS C compiler, you must install the
                    271: VMS CLD file for GNU CC as follows:
                    272: 
                    273:   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
                    274:      point to the directories where the GNU CC executables
                    275:      (`gcc-cpp', `gcc-cc1', etc.) and the C include files are kept. 
                    276:      This should be done with the commands:
1.1.1.2   root      277: 
                    278:           $ assign /super /system disk:[gcc] gnu_cc
                    279:           $ assign /super /system disk:[gcc.include] gnu_cc_include
                    280: 
1.1.1.4   root      281:      with the appropriate disk and directory names.  These commands
                    282:      can be placed in your system startup file so they will be
                    283:      executed whenever the machine is rebooted.
1.1.1.2   root      284: 
                    285:   2. Install the `GCC' command with the command line:
                    286: 
                    287:           $ set command /table=sys$library:dcltables gnu_cc:gcc
                    288: 
1.1.1.4   root      289:      Now you can invoke the compiler with a command like `gcc
                    290:      /verbose file.c', which is equivalent to the command `gcc -v -c
                    291:      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.