|
|
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'
1.1.1.5 ! root 44: for Suns (model 2, 3 or 4) running *operating system*
1.1.1.4 root 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:
1.1.1.5 ! root 128: Bison versions older that Sept 8, 1988 will produce incorrect
! 129: output for `c-parse.tab.c'.
1.1 root 130:
1.1.1.2 root 131: 5. If you are using a Sun, make sure the environment variable
1.1.1.4 root 132: `FLOAT_OPTION' is not set. If this option were set to `f68881'
133: when `gnulib' is compiled, the resulting code would demand to be
134: linked with a special startup file and will not link properly
135: without special pains.
1.1 root 136:
1.1.1.2 root 137: 6. Build the compiler. Just type `make' in the compiler directory.
1.1 root 138:
1.1.1.4 root 139: 7. Move the first-stage object files and executables into a
140: subdirectory with this command:
1.1 root 141:
142: make stage1
143:
144: The files are moved into a subdirectory named `stage1'. Once
1.1.1.4 root 145: installation is complete, you may wish to delete these files
146: with `rm -r stage1'.
1.1 root 147:
1.1.1.2 root 148: 8. Recompile the compiler with itself, with this command:
1.1 root 149:
150: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
151:
1.1.1.4 root 152: On a 68000 or 68020 system lacking floating point hardware,
153: unless you have selected a `tm.h' file that expects by default
154: that there is no such hardware, do this instead:
1.1 root 155:
156: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
157:
1.1.1.4 root 158: 9. If you wish to test the compiler by compiling it with itself one
159: more time, do this:
1.1 root 160:
161: make stage2
1.1.1.4 root 162: Make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
1.1 root 163: foreach file (*.o)
164: cmp $file stage2/$file
165: end
166:
1.1.1.4 root 167: This will notify you if any of these stage 3 object files
168: differs from those of stage 2. Any difference, no matter how
169: innocuous, indicates that the stage 2 compiler has compiled GNU
170: CC incorrectly, and is therefore a potentially serious bug which
171: you should investigate and report (*note Bugs::.).
1.1 root 172:
1.1.1.4 root 173: Aside from the `-B' option, the options should be the same as
174: when you made stage 2.
175:
176: 10. Install the compiler driver, the compiler's passes and run-time
177: support. You can use the following command:
1.1 root 178:
179: make install
180:
1.1.1.4 root 181: This copies the files `cc1', `cpp' and `gnulib' to files
182: `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
183: `/usr/local/lib', which is where the compiler driver program
184: looks for them. It also copies the driver program `gcc' into
185: the directory `/usr/local', so that it appears in typical
186: execution search paths.
187:
188: *Warning: there is a bug in `alloca' in the Sun library. To
189: avoid this bug, install the binaries of GNU CC that were
190: compiled by GNU CC. They use `alloca' as a built-in function
191: and never the one in the library.*
192:
193: *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h'
194: and other system header files unless the `-traditional' option
195: is used.* The bug is in the header files: at least on some
196: machines, they rely on behavior that is incompatible with ANSI
197: C. This behavior consists of substituting for macro argument
198: names when they appear inside of character constants. The
199: `-traditional' option tells GNU CC to behave the way these
200: headers expect.
1.1 root 201:
1.1.1.4 root 202: Because of this problem, you might prefer to configure GNU CC to
203: use the system's own C preprocessor. To do so, make the file
1.1 root 204: `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
205:
1.1.1.4 root 206: Alternatively, on Sun systems and 4.3BSD at least, you can
207: correct the include files by running the shell script
208: `fixincludes'. This installs modified, corrected copies of the
209: files `ioctl.h', `ttychars.h' and many others, in a special
210: directory where only GNU CC will normally look for them.
1.1 root 211:
1.1.1.4 root 212: See the file `fixincludes' for a list of all the files we know
213: to require correction.
1.1 root 214:
215: If you cannot install the compiler's passes and run-time support in
1.1.1.4 root 216: `/usr/local/lib', you can alternatively use the `-B' option to
217: specify a prefix by which they may be found. The compiler
218: concatenates the prefix with the names `cpp', `cc1' and `gnulib'.
219: Thus, you can put the files in a directory `/usr/foo/gcc' and specify
220: `-B/usr/foo/gcc/' when you run GNU CC.
221:
222: Also, you can specify an alternative default directory for these
223: files by setting the Make variable `libdir' when you make GNU CC.
1.1 root 224:
1.1.1.2 root 225:
226:
227: File: internals, Node: VMS Install, Prev: Installation, Up: Installation
228:
1.1 root 229: Installing GNU CC on VMS
230: ========================
231:
1.1.1.4 root 232: The VMS version of GNU CC is distributed in an unusual tape format
233: which consists of several tape files. The first is a command file;
234: the second is an executable program which reads Unix tar format; the
235: third is another command file which uses this program to read the
236: remainder of the tape.
237:
238: To load the tape, it suffices to mount it `/foreign' and then do
239: `@mta0:' to execute the command file at the beginning of the tape.
240:
241: The tape contains executables and object files as well as sources, so
242: no compilation is necessary unless you change the sources. (This is
243: a good thing, since you probably don't have any other C compiler.)
244: If you must recompile, here is how:
245:
246: 1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to
247: `config.h', `vax.md' to `md.' and `output-vax.c' to
248: `aux-output.c'.
1.1 root 249:
250: 2. Type `@make' to do recompile everything.
1.1.1.2 root 251:
1.1.1.4 root 252: To install the `GCC' command so you can use the compiler easily, in
253: the same manner as you use the VMS C compiler, you must install the
254: VMS CLD file for GNU CC as follows:
255:
256: 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
257: point to the directories where the GNU CC executables
258: (`gcc-cpp', `gcc-cc1', etc.) and the C include files are kept.
259: This should be done with the commands:
1.1.1.2 root 260:
261: $ assign /super /system disk:[gcc] gnu_cc
262: $ assign /super /system disk:[gcc.include] gnu_cc_include
263:
1.1.1.4 root 264: with the appropriate disk and directory names. These commands
265: can be placed in your system startup file so they will be
266: executed whenever the machine is rebooted.
1.1.1.2 root 267:
268: 2. Install the `GCC' command with the command line:
269:
270: $ set command /table=sys$library:dcltables gnu_cc:gcc
271:
1.1.1.4 root 272: Now you can invoke the compiler with a command like `gcc
273: /verbose file.c', which is equivalent to the command `gcc -v -c
274: file.c' in Unix.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.