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