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