|
|
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:
! 60: For the sparc, use `tm-sparc.h'.
! 61:
1.1 root 62: For the 32000, use `tm-sequent.h' if you are using a Sequent
1.1.1.2 ! root 63: machine, or `tm-encore.h' for an Encore machine; otherwise,
! 64: perhaps `tm-ns32k.h' will work for you. If you are trying to use
! 65: GNU CC on GENIX, you may need to get the version of `malloc' from
! 66: GNU Emacs instead of the system library version, and you probably
! 67: need to cause the following assembler code to be executed in
! 68: `crt0.o' in order to run the GNU CC output:
! 69:
! 70: lprd sb,$0
! 71: sprd mod,r0
! 72: movqd $0,0(r0)
1.1 root 73:
1.1.1.2 ! root 74: Note that Encore systems are supported only under BSD.
1.1 root 75:
76: * Make a symbolic link named `md' to the machine description
77: pattern file (its name should be `MACHINE.md').
78:
79: * Make a symbolic link named `aux-output.c' to the output
80: subroutine file for your machine (its name should be
81: `OUTPUT-MACHINE.c').
82:
1.1.1.2 ! root 83: 4. Make sure the Bison parser generator is installed. (This is unnecessary
! 84: if the Bison output files `parse.tab.c' and `cexp.c' are more recent
! 85: than `parse.y' and `cexp.y' and you do not plan to change the `.y'
! 86: files.)
1.1 root 87:
88: Note that if you have an old version of Bison you may get an error
89: from the line with the `%expect' directive. If so, simply remove that
90: line from `parse.y' and proceed.
91:
1.1.1.2 ! root 92: 5. If you are using a Sun, make sure the environment variable
1.1 root 93: `FLOAT_OPTION' is not set. If this option were set to `f68881' when
94: `gnulib' is compiled, the resulting code would demand to be linked
95: with a special startup file and will not link properly without special
96: pains.
97:
1.1.1.2 ! root 98: 6. Build the compiler. Just type `make' in the compiler directory.
1.1 root 99:
1.1.1.2 ! root 100: 7. Move the first-stage object files and executables into a subdirectory
1.1 root 101: with this command:
102:
103: make stage1
104:
105: The files are moved into a subdirectory named `stage1'. Once
106: installation is complete, you may wish to delete these files with `rm
107: -r stage1'.
108:
1.1.1.2 ! root 109: 8. Recompile the compiler with itself, with this command:
1.1 root 110:
111: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
112:
113: On a 68000 or 68020 system lacking floating point hardware, unless you
114: have selected a `tm.h' file that expects by default that there is no
115: such hardware, do this instead:
116:
117: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
118:
1.1.1.2 ! root 119: 9. If you wish to test the compiler by compiling it with itself one more
1.1 root 120: time, do this:
121:
122: make stage2
123: make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
124: foreach file (*.o)
125: cmp $file stage2/$file
126: end
127:
128: This will notify you if any of these stage 3 object files differs from
129: those of stage 2. Any difference, no matter how innocuous, indicates
130: that the stage 2 compiler has compiled GNU CC incorrectly, and is
131: therefore a potentially serious bug which you should investigate and
132: report (*Note Bugs::.).
133:
1.1.1.2 ! root 134: 10. Install the compiler driver, the compiler's passes and run-time support.
1.1 root 135: You can use the following command:
136:
137: make install
138:
139: This copies the files `cc1', `cpp' and `gnulib' to files `gcc-cc1',
140: `gcc-cpp' and `gcc-gnulib' in directory `/usr/local/lib', which is
141: where the compiler driver program looks for them. It also copies the
142: driver program `gcc' into the directory `/usr/local', so that it
143: appears in typical execution search paths.
144:
145: *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and
146: other system header files unless the `-traditional' option is used.*
147: The bug is in the header files: at least on some machines, they rely
148: on behavior that is incompatible with ANSI C. This behavior consists
149: of substituting for macro argument names when they appear inside of
150: character constants. The `-traditional' option tells GNU CC to behave
151: the way these headers expect.
152:
153: Because of this problem, you might prefer to configure GNU CC to use
154: the system's own C preprocessor. To do so, make the file
155: `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
156:
157: Alternatively, on Sun systems and 4.3BSD at least, you can correct the
158: include files by running the shell script `fixincludes'. This
159: installs modified, corrected copies of the files `ioctl.h' and
160: `ttychars.h' in a special directory where only GNU CC will normally
161: look for them.
162:
163: The file `/usr/include/vaxuba/qvioctl.h' used in the X window system
164: needs a similar correction.
165:
166: If you cannot install the compiler's passes and run-time support in
167: `/usr/local/lib', you can alternatively use the `-B' option to specify a
168: prefix by which they may be found. The compiler concatenates the prefix
169: with the names `cpp', `cc1' and `gnulib'. Thus, you can put the files in
170: a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when you run GNU CC.
171:
1.1.1.2 ! root 172: Also, you can specify an alternative default directory for these files by
! 173: setting the Make variable `libdir' when you make GNU CC.
! 174:
! 175:
! 176: File: internals, Node: VMS Install, Prev: Installation, Up: Installation
! 177:
1.1 root 178: Installing GNU CC on VMS
179: ========================
180:
1.1.1.2 ! root 181: The VMS version of GNU CC is distributed in an unusual tape format which
! 182: consists of several tape files. The first is a command file; the second is
! 183: an executable program which reads Unix tar format; the third is another
! 184: command file which uses this program to read the remainder of the tape.
! 185:
! 186: To load the tape, it suffices to mount it `/foreign' and then do `@mta0:'
! 187: to execute the command file at the beginning of the tape.
! 188:
! 189: The tape contains executables and object files as well as sources, so no
! 190: compilation is necessary unless you change the sources. (This is a good
! 191: thing, since you probably don't have any other C compiler.) If you must
! 192: recompile, here is how:
1.1 root 193:
194: 1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to `config.h',
195: `vax.md' to `md.' and `output-vax.c' to `aux-output.c'.
196:
197: 2. Type `@make' to do recompile everything.
1.1.1.2 ! root 198:
! 199: To install the `GCC' command so you can use the compiler easily, in the
! 200: same manner as you use the VMS C compiler, you must install the VMS CLD
! 201: file for GNU CC as follows:
! 202:
! 203: 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to point to
! 204: the directories where the GNU CC executables (`gcc-cpp', `gcc-cc1',
! 205: etc.) and the C include files are kept. This should be done with the
! 206: commands:
! 207:
! 208: $ assign /super /system disk:[gcc] gnu_cc
! 209: $ assign /super /system disk:[gcc.include] gnu_cc_include
! 210:
! 211: with the appropriate disk and directory names. These commands can be
! 212: placed in your system startup file so they will be executed whenever
! 213: the machine is rebooted.
! 214:
! 215: 2. Install the `GCC' command with the command line:
! 216:
! 217: $ set command /table=sys$library:dcltables gnu_cc:gcc
! 218:
! 219: Now you can invoke the compiler with a command like `gcc /verbose
! 220: file.c', which is equivalent to the command `gcc -v -c file.c' in Unix.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.