|
|
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: ! 15: * Menu: ! 16: ! 17: * VMS Install:: See below for installation on VMS. ! 18: ! 19: ! 20: 1. Edit `Makefile'. If you are using HPUX, you must make a few changes ! 21: described in comments at the beginning of the file. ! 22: ! 23: 2. Choose configuration files. ! 24: ! 25: * Make a symbolic link named `config.h' to the top-level config ! 26: file for the machine you are using (*Note Config::.). This file ! 27: is responsible for defining information about the host machine. ! 28: It includes `tm.h'. ! 29: ! 30: The file's name should be `config-MACHINE.h'. On VMS, use ! 31: `config-vms.h' rather than `config-vax.h'. On the HP 9000 series ! 32: 300, use `config-hp9k3.h' rather than `config-m68k.h'. ! 33: ! 34: If your system does not support symbolic links, you might want to ! 35: set up `config.h' to contain a `#include' command which refers to ! 36: the appropriate file. ! 37: ! 38: * Make a symbolic link named `tm.h' to the machine-description ! 39: macro file for your machine (its name should be `tm-MACHINE.h'). ! 40: ! 41: For the 68000/68020, do not use `tm-m68k.h' directly; instead use ! 42: one of the files `tm-sun3.h', `tm-sun2.h', `tm-isi68.h', ! 43: `tm-news800.h' or `tm-3b1.h'. Each of those files includes ! 44: `tm-m68k.h' but sets up a few things differently as appropriate ! 45: to the specific model of machine. ! 46: ! 47: There are two files you can use for a 680x0 running HPUX: ! 48: `tm-hp9k320.h' and `tm-hp9k320g.h'. Use the former if you are ! 49: installing GNU CC alone. The latter is for another option where ! 50: GNU CC together with the GNU assembler, linker, debugger and ! 51: other utilities are used to replace all of HPUX that deals with ! 52: compilation. Not all of the pieces of GNU software needed for ! 53: this mode of operation are as yet in distribution; full ! 54: instructions will appear here in the future. ! 55: ! 56: For the 32000, use `tm-sequent.h' if you are using a Sequent ! 57: machine; otherwise, use `tm-ns32k.h'. ! 58: ! 59: For the vax, use `tm-vax.h' on BSD Unix, `tm-ultrix.h' on Ultrix, ! 60: or `tm-vms.h' on VMS. ! 61: ! 62: * Make a symbolic link named `md' to the machine description ! 63: pattern file (its name should be `MACHINE.md'). ! 64: ! 65: * Make a symbolic link named `aux-output.c' to the output ! 66: subroutine file for your machine (its name should be ! 67: `OUTPUT-MACHINE.c'). ! 68: ! 69: 3. Make sure the Bison parser generator is installed. (This is unnecessary ! 70: if the Bison output file `parse.tab.c' is more recent than `parse.y' ! 71: and you do not plan to change `parse.y'.) ! 72: ! 73: Note that if you have an old version of Bison you may get an error ! 74: from the line with the `%expect' directive. If so, simply remove that ! 75: line from `parse.y' and proceed. ! 76: ! 77: 4. If you are using a Sun, make sure the environment variable ! 78: `FLOAT_OPTION' is not set. If this option were set to `f68881' when ! 79: `gnulib' is compiled, the resulting code would demand to be linked ! 80: with a special startup file and will not link properly without special ! 81: pains. ! 82: ! 83: 5. Build the compiler. Just type `make' in the compiler directory. ! 84: ! 85: 6. Move the first-stage object files and executables into a subdirectory ! 86: with this command: ! 87: ! 88: make stage1 ! 89: ! 90: ! 91: The files are moved into a subdirectory named `stage1'. Once ! 92: installation is complete, you may wish to delete these files with `rm ! 93: -r stage1'. ! 94: ! 95: 7. Recompile the compiler with itself, with this command: ! 96: ! 97: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/" ! 98: ! 99: ! 100: On a 68000 or 68020 system lacking floating point hardware, unless you ! 101: have selected a `tm.h' file that expects by default that there is no ! 102: such hardware, do this instead: ! 103: ! 104: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float" ! 105: ! 106: ! 107: 8. If you wish to test the compiler by compiling it with itself one more ! 108: time, do this: ! 109: ! 110: make stage2 ! 111: make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" ! 112: foreach file (*.o) ! 113: cmp $file stage2/$file ! 114: end ! 115: ! 116: ! 117: This will notify you if any of these stage 3 object files differs from ! 118: those of stage 2. Any difference, no matter how innocuous, indicates ! 119: that the stage 2 compiler has compiled GNU CC incorrectly, and is ! 120: therefore a potentially serious bug which you should investigate and ! 121: report (*Note Bugs::.). ! 122: ! 123: 9. Install the compiler driver, the compiler's passes and run-time support. ! 124: You can use the following command: ! 125: ! 126: make install ! 127: ! 128: ! 129: This copies the files `cc1', `cpp' and `gnulib' to files `gcc-cc1', ! 130: `gcc-cpp' and `gcc-gnulib' in directory `/usr/local/lib', which is ! 131: where the compiler driver program looks for them. It also copies the ! 132: driver program `gcc' into the directory `/usr/local', so that it ! 133: appears in typical execution search paths. ! 134: ! 135: *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and ! 136: other system header files unless the `-traditional' option is used.* ! 137: The bug is in the header files: at least on some machines, they rely ! 138: on behavior that is incompatible with ANSI C. This behavior consists ! 139: of substituting for macro argument names when they appear inside of ! 140: character constants. The `-traditional' option tells GNU CC to behave ! 141: the way these headers expect. ! 142: ! 143: Because of this problem, you might prefer to configure GNU CC to use ! 144: the system's own C preprocessor. To do so, make the file ! 145: `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'. ! 146: ! 147: Alternatively, on Sun systems and 4.3BSD at least, you can correct the ! 148: include files by running the shell script `fixincludes'. This ! 149: installs modified, corrected copies of the files `ioctl.h' and ! 150: `ttychars.h' in a special directory where only GNU CC will normally ! 151: look for them. ! 152: ! 153: The file `/usr/include/vaxuba/qvioctl.h' used in the X window system ! 154: needs a similar correction. ! 155: ! 156: If you cannot install the compiler's passes and run-time support in ! 157: `/usr/local/lib', you can alternatively use the `-B' option to specify a ! 158: prefix by which they may be found. The compiler concatenates the prefix ! 159: with the names `cpp', `cc1' and `gnulib'. Thus, you can put the files in ! 160: a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when you run GNU CC. ! 161: ! 162: Installing GNU CC on VMS ! 163: ======================== ! 164: ! 165: The VMS version of GNU CC is normally distributed as a Backup saveset, so ! 166: the only installation required is to copy the files. But here is how to ! 167: rebuild GNU CC if you change it: ! 168: ! 169: 1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to `config.h', ! 170: `vax.md' to `md.' and `output-vax.c' to `aux-output.c'. ! 171: ! 172: 2. Type `@make' to do recompile everything.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.