INSTALL 6.9 KB

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