INSTALL 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. HOW TO COMPILE AND INSTALL TIGCC FROM SOURCE
  2. ============================================
  3. Please note: read README.linux first. The instructions below apply only to
  4. compiling and installing the whole package from source if you need to do that. I
  5. recommend installing from binaries if possible.
  6. REQUIREMENTS
  7. ------------
  8. You must have the following programs before you attempt
  9. to install tigcc-unix.
  10. REQUIRED:
  11. 1. gcc 2.95 or later (other compilers are NOT supported)
  12. 2. binutils 2.8 or later (gnu or equivalent --
  13. ld, ar, as, etc.)
  14. 3. gnu patch (Solaris patch will NOT work)
  15. 4. bzip2 (to decompress this archive)
  16. 5. tar (gnu tar is best, but Solaris and SGI should be okay)
  17. 6. gnu make
  18. 7. At least 130 MB of free space (archive expands to over 80,
  19. build can take another 30-40 depending upon architecture)
  20. 8. bison or yacc
  21. 9. flex
  22. OPTIONAL:
  23. 10. Windows or WINE to compile the documentation from source
  24. (optional: the source distribution includes pre-generated HTML
  25. documentation)
  26. 11. A dialog executable (any of: kdialog, xdialog, gdialog, cdialog or
  27. dialog), if and only if you want to use the wizard (optional: the
  28. wizard now uses plain bash if no dialog executable is available)
  29. If you run into any problems, please contact me and let me know
  30. where the install failed...
  31. If you want to recompile TIGCC-Linux, you will need to dowload:
  32. gcc-core-4.1-20060728.tar.bz2 (gcc-core, full gcc may not compile !)
  33. binutils-2.16.1.tar.bz2
  34. Depending on your machine, compilation can take some time !
  35. INSTALLING TIGCC FOR UNIX
  36. -------------------------
  37. The installation should be very simple. The package has worked on
  38. Linux, Solaris 8, and SGI IRIX 6 to try and make the scripts
  39. compatible. UN*X provides some things better, some things worse. Let we know
  40. if you have a problem with the worse...
  41. First, extract the source to a directory of your choosing such as /tmp.
  42. Unpack binutils & gcc-core packages to the download/ directory as this, and
  43. create symlinks download/gcc.ti and download/binutils.ti pointing to them.
  44. Note that the sources on tigcc.ticalc.org ONLY support Linux/x86 and Windows, so
  45. you will need the COMPLETE GCC (gcc-core only, not the whole compiler
  46. collection) and Binutils sources from a GNU mirror for all other platforms. So,
  47. you should have done it like this:
  48. mkdir /tmp/tigcc-src
  49. cd /tmp/tigcc-src
  50. # substitute the directory you are using for /tmp
  51. bunzip2 tigcc-src.tar.bz2
  52. tar xfv tigcc-src.tar
  53. mkdir download
  54. cd download
  55. bunzip2 binutils-2.16.1.tar.bz2 gcc-core-4.1-20060728.tar.bz2
  56. tar xvf binutils-2.16.1.tar
  57. tar xvf gcc-core-4.0.2.tar
  58. ln -s binutils-2.16.1 binutils.ti
  59. ln -s gcc-4.1-20060728 gcc.ti
  60. cd ..
  61. At this point, you have 2 options:
  62. 1. Use the installation wizard
  63. ------------------------------
  64. All you need to do now is:
  65. cd scripts; ./Install
  66. and follow the instructions. If you want a text-mode install on a system with
  67. KDE installed, you can use:
  68. cd scripts; DIALOG=dialog ./Install
  69. to tell the script to use the text-mode (curses) dialog instead of kdialog.
  70. You will be prompted for:
  71. * the destination directory you want to install TIGCC to ($TIGCC)
  72. * the bootstrap compiler ($CC) you want to compile TIGCC with (usually "gcc")
  73. * the optimization flags ($CFLAGS) you want to compile TIGCC with (read the GCC
  74. documentation or just use the defaults)
  75. The wizard will ask you whether you want to apply the TIGCC patch. The answer is
  76. usually "Yes". It will be "No" only if you are rebuilding the same source for a
  77. second (or more) time.
  78. When done, the wizard will ask you whether you want to add your $TIGCC setting
  79. to bashrc. If you answer "Yes", you are done here, you only need to restart
  80. bash. If you prefer to do things by hand, answer "No" and follow the
  81. instructions in section 2.1 below. (If you selected "No", but changed your mind,
  82. you can also run envreg by hand afterwards.)
  83. 2. Use the install scripts directly
  84. -----------------------------------
  85. 2.1. Environment variable settings
  86. ----------------------------------
  87. Now, set the environment variable TIGCC to the directory you want to install
  88. TIGCC into (for example /usr/local/tigcc). You need to set this variable in your
  89. profile, because the compilation stage needs it to find some tools and tigcc
  90. front-end needs it to find the header files.
  91. If you use bash, add it to your .bashrc file in your home
  92. directory. You could also use your .profile or .login if
  93. you have those. If you use tcsh or csh, put it in your
  94. .cshrc file (or if you use .tcshrc, put it there).
  95. I've never used korn shell. You're on your own if you do.
  96. For bash/sh users
  97. export TIGCC=/usr/local/tigcc
  98. export PATH=$PATH:$TIGCC/bin
  99. For csh/tcsh users
  100. setenv TIGCC /usr/local/tigcc
  101. set path=($path $TIGCC/bin)
  102. I've had problems using setenv to reset the path in tcsh.
  103. setenv path "$path ${TIGCC}/bin"
  104. doesn't seem to work.
  105. You may need to logout and log back in for that to take
  106. effect. Or you can resource your profile.
  107. source ~/.profile
  108. source ~/.bashrc
  109. source ~/.cshrc
  110. source ~/.tcshrc
  111. You only need to resource the file you changed.
  112. 2.2. Installation
  113. -----------------
  114. The hard part should be over. Now, just change into the directory
  115. you extracted tigcc into
  116. cd /tmp/tigcc-src
  117. Optionally, you can now rebuild the HTML documentation from source: the required
  118. source code is in tigcclib/doc/source.tar.bz2 in your source tree. See the last
  119. section below for instructions to compile the documentation. Note that the tools
  120. to compile the documentation from source are for Windows only, so you will need
  121. Windows or WINE if you want to build the documentation from source. Unless of
  122. course you manage to port the Delphi sources of those tools yourself.
  123. Note that it comes precompiled, so you need not do this. (As for platform-
  124. independence: the documentation is "compiled" into platform-independent HTML
  125. files, so compiling it from source should usually not be necessary.)
  126. And run the installation script...
  127. export CFLAGS='-Os -s'
  128. cd scripts; ./Install_All
  129. Assuming you have all the required tools, you should have yourself
  130. a tigcc build in 5 - 60 minutes.
  131. I don't know how much time it will take you. It took less than
  132. 10 minutes on a Linux system with a Pentium II 450 and 128 MB RAM.
  133. But, it took 45 minutes on a Linux system with a K6 233 and 112MB RAM.
  134. It took nearly 40 minutes on a Solaris Sparc 400 with 256 MB RAM,
  135. but it had to read off a network with many other users, so that
  136. may have had some impact on compile time.
  137. It took over an hour on an SGI O2 machine. I would assume it's due
  138. to the slow SGI c compiler, which binutils and gcc will try and
  139. compile themselves with. Since you have a recent version of gcc,
  140. try setting CC=gcc and CXX=g++ to speed things up. You must have
  141. gcc 2.95 or above for this to work.
  142. I hope this installation goes smoothly for you.
  143. 2.3. ALTERNATE WAY for installation
  144. -----------------------------------
  145. The following is the "hard" way to do step 2.2. It is used primarily for
  146. development purposes. You can use this if you experience some problems with the
  147. automated script.
  148. At first, you will have to register a variable depending on the location you
  149. want to install TIGCC
  150. export TIGCC=/usr/local/tigcc
  151. export PATH=$PATH:$TIGCC/bin
  152. export CFLAGS='-Os -s'
  153. Next, simply go into the scripts directory.
  154. Then you must apply the patch supplied with this package:
  155. ./Install_step_1
  156. Next, compile binutils and gcc. This may take a while...
  157. ./Install_step_2
  158. If everything went correctly, you now should have a working Tigcc for Linux
  159. compiler. For installing the TIGCC library, simply launch:
  160. ./Install_step_3
  161. If you want to be able to use it, you should add /usr/local/tigcc to your
  162. PATH. The compiler is named m68k-coff-gcc, to avoid namecollision with your
  163. system's gcc. The other utilities follow the same naming.
  164. You may need the TIGCC Tools Suite utilities (required for using the tigcc
  165. front-end). Simply do:
  166. ./Install_step_4
  167. At last, you have to install the full documentation by
  168. ./Install_step_5
  169. REBUILDING THE DOCUMENTATION FROM ITS TRUE SOURCE (REQUIRES WINDOWS)
  170. --------------------------------------------------------------------
  171. This section is lifted from Sebastian's Readme.txt accompanying the Windows
  172. source release. Note that the Linux/Unix source release includes pre-generated
  173. HTML documentation, so you only need to rebuild it if you modify the hs? files.
  174. First, modify the file HelpSystem.ini in the 'Programs' subfolder of the
  175. 'Doc' folder to reflect your actual folder names. It exists so that the
  176. 'Programs' folder can reside at any given place on the hard disk.
  177. Then, you need to call all 'Update...' programs once.
  178. UpdateInclude.exe and UpdateInfo.exe take one or more complete file name(s)
  179. as parameters. The actual names of the files are discarded, and the remaining
  180. folder name is the folder to be updated. If the first parameter is '/ALL' or
  181. no parameters are specified, all folders are updated, and in case of
  182. UpdateInclude.exe, a header file index is generated.
  183. UpdateKeywords.exe and UpdateIndex.exe do not take any parameters.
  184. To compile the documentation, download the HTML Help Workshop from
  185. http://msdn.microsoft.com. Then compile the project in the 'System\CHMFiles'
  186. folder.
  187. Tools to make editing help system files more convenient are also included in
  188. this distribution.
  189. A tools to create help system files from the original GNU Texinfo documents
  190. is included as well, but it might need a recompilation to work with future
  191. versions of the documentation. Anyway, the .texi files should be in the
  192. current directory, and you should specify one of them in the command line.
  193. The appropriate subfolders need to exist (e.g. gnuexts).
  194. If you need detailed information about the file formats, look at the
  195. Readme.txt file in the documentation folder.
  196. When done with building the CHM documentation, you can convert it to the QT
  197. assistant format using my converters:
  198. cd srcdir/doc/converter # substitute the directory you are using for srcdir
  199. gcc -Os -s -Wall -W -Wwrite-strings chm2dcf.c -o chm2dcf # compile chm2dcf
  200. cd ../html
  201. ../converter/chm2dcf # convert the CHM to a Documentation Content File (DCF)
  202. ../converter/dcf2adp # convert the DCF to an Assistant Document Profile (ADP)
  203. (There is also a script called updatedoc to automate the copying and
  204. converting of the documentation.)
  205. WARNING: chm2dcf is slooooow. You have been warned.