INSTALL 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. HOW TO COMPILE AND INSTALL GCC4TI 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. I recommend installing
  5. from binaries if possible.
  6. REQUIREMENTS
  7. ------------
  8. You must have the following programs AND sources before you attempt
  9. to install gcc4ti-unix.
  10. REQUIRED:
  11. 1. GNU GCC 2.95 or later (other compilers might work, but are NOT supported)
  12. GNU GCC cross-compilers are supported.
  13. 2. GNU binutils (ld, ar, as, etc.) 2.8 or later.
  14. Other binutils might work, but are NOT supported.
  15. 3. GNU or BSD patch (Solaris patch will NOT work)
  16. 4. bzip2 (to decompress this archive)
  17. 5. tar (all of GNU, BSD and Solaris tar seem to be OK)
  18. 6. GNU make (Solaris make will NOT work)
  19. 7. GNU or BSD install (Solaris install will NOT work)
  20. 8. At least 130 MB of free space (archive expands to over 80,
  21. build can take another 30-40 depending upon architecture)
  22. 9. bison or yacc
  23. 10. flex
  24. 11. GNU GCC 4.1.2 and GNU binutils 2.16.1 _sources_, which are used
  25. for compiling gcc and as for m68k-coff target.
  26. You'll need to download them from one of the numerous GCC / binutils
  27. mirrors listed at http://gcc.gnu.org/mirrors.html, e.g.
  28. ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.1.2/gcc-core-4.1.2.tar.bz2
  29. ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/binutils/releases/binutils-2.16.1.tar.bz2
  30. (DON'T use gcc-4.1.2.tar.bz2, i.e. the full version: it may fail to compile !)
  31. OPTIONAL:
  32. 12. Windows or Wine to compile the documentation from source
  33. (optional: the source distribution includes pre-generated HTML
  34. documentation)
  35. 13. Wine or equivalent + binfmt-support with Wine registered, when
  36. cross-compiling, under a *nix host, executables running on Windows
  37. platforms. Without this (or something equivalent), `configure`
  38. aborts early, because the *nix host cannot run Windows executables.
  39. If you run into any problems, please contact us (tigccpp AT box.godzil.net)
  40. and let us know what platform you're running on, and where the install failed.
  41. Depending on your machine, compilation can take some time !
  42. INSTALLING GCC4TI FOR UNIX
  43. -------------------------
  44. The installation should be very simple. The package has worked on Ubuntu 9.04,
  45. Fedora 8, Fedora 11, SimplyMEPIS 8 (very close to Debian Lenny), OpenSolaris
  46. 2009.06, FreeBSD 7.2. UN*X provides some things better, some things worse.
  47. Let us know if you have a problem with the worse...
  48. First, extract the source to a directory of your choosing such as /tmp.
  49. mkdir /tmp/gcc4ti-src
  50. cd /tmp/gcc4ti-src
  51. # substitute the directory you are using for /tmp
  52. bunzip2 gcc4ti-src.tar.bz2
  53. tar xfv gcc4ti-src.tar
  54. Then, copy or link binutils-2.16.1 and gcc-core-4.1.2.tar.bz2 in that folder.
  55. At this point, you have 2 options:
  56. 1. Use the installation wizard
  57. ------------------------------
  58. All you need to do now is:
  59. scripts/Install
  60. and follow the instructions. If you want a text-mode install on a system with
  61. KDE installed, you can use:
  62. cd scripts; DIALOG=dialog ./Install
  63. to tell the script to use the text-mode (curses) dialog instead of kdialog.
  64. You will be prompted for:
  65. * the destination directory you want to install GCC4TI to ($PREFIX_GCC4TI,
  66. used only internally during the compilation stage: will become $TIGCC when the
  67. build is finished)
  68. * the bootstrap compiler ($CC) you want to compile GCC4TI with (usually "gcc",
  69. unless you're cross-compiling, e.g. with "i586-mingw32msvc-gcc").
  70. * the optimization flags ($CFLAGS) you want to compile GCC4TI with (read the GCC
  71. documentation or just use the defaults)
  72. * the host platform of the generated executables ($GCC4TIHOST), leave blank if
  73. not cross-compiling. "i586-mingw32msvc" is a value that suits well when
  74. CC=i586-mingw32msvc-gcc.
  75. The wizard will ask you whether you want to apply the GCC4TI 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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  86. WARNING: below, a number of places mention appending $TIGCC/bin to the path.
  87. We _really_ mean appending. This is because $TIGCC/bin contains "gcc" and "as" for
  88. m68k-coff target, and if $TIGCC/bin appears before /usr/bin in the PATH, the "gcc"
  89. and "as" in $TIGCC/bin would be used instead of the host system's executables...
  90. This is definitely not what you want.
  91. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  92. 2.1. Environment variable settings
  93. ----------------------------------
  94. Now, set the environment variable PREFIX_GCC4TI to the directory you want to
  95. install GCC4TI into (for example /usr/local/share/gcc4ti). This variable is
  96. used only during the compilation stage, so as not to interfere with any
  97. prior user-defined setting for the TIGCC environment variable (which is used
  98. _after_ the compilation stage).
  99. If you use bash, add it to your .bashrc file in your home directory. You could
  100. also use your .profile or .login if you have those. If you use tcsh or csh, put
  101. it in your .cshrc file (or if you use .tcshrc, put it there).
  102. I've never used korn shell. You're on your own if you do.
  103. For bash/sh users
  104. export PREFIX_GCC4TI=/usr/local/share/gcc4ti
  105. export PATH=$PATH:$PREFIX_GCC4TI/bin
  106. For csh/tcsh users
  107. setenv PREFIX_GCC4TI /usr/local/share/gcc4ti
  108. set path=($path $PREFIX_GCC4TI/bin)
  109. I've had problems using setenv to reset the path in tcsh.
  110. setenv path "$path ${PREFIX_GCC4TI}/bin"
  111. doesn't seem to work.
  112. You may need to logout and log back in for that to take
  113. effect. Or you can resource your profile.
  114. source ~/.profile
  115. source ~/.bashrc
  116. source ~/.cshrc
  117. source ~/.tcshrc
  118. You only need to resource the file you changed.
  119. 2.2. Installation
  120. -----------------
  121. The hard part should be over. Now, just change into the directory
  122. you extracted GCC4TI into
  123. cd /tmp/gcc4ti-src
  124. Optionally, you can now rebuild the HTML documentation from source: the required
  125. source code is in tigcclib/doc/source.tar.bz2 in your source tree. See the last
  126. section below for instructions to compile the documentation. Note that the tools
  127. to compile the documentation from source are for Windows only, so you will need
  128. Windows or WINE if you want to build the documentation from source. Unless of
  129. course you manage to port the Delphi sources of those tools yourself.
  130. Note that it comes precompiled, so you need not do this. (As for platform-
  131. independence: the documentation is "compiled" into platform-independent HTML
  132. files, so compiling it from source should usually not be necessary.)
  133. And run the installation script...
  134. export CFLAGS='-Os -s'
  135. If cross-compiling or using another custom compiler for some reason, set the
  136. CC and GCC4TIHOST environment variables, e.g.
  137. export CC=i586-mingw32msvc-gcc
  138. export GCC4TIHOST=i586-mingw32msvc
  139. Then launch the installation procedure.
  140. cd scripts; ./Install_All
  141. Assuming you have all the required tools, you should have yourself
  142. a GCC4TI build (except the Delphi executables) in 5 - 60 minutes.
  143. I hope this installation goes smoothly for you.
  144. 2.3. ALTERNATE WAY for installation
  145. -----------------------------------
  146. The following is the "hard" way to do step 2.2. It is used primarily for
  147. development purposes. You can use this if you experience some problems with
  148. the automated script.
  149. At first, you will have to register a variable depending on the location you
  150. want to install GCC4TI
  151. export PREFIX_GCC4TI=/usr/local/share/gcc4ti
  152. export PATH=$PATH:$PREFIX_GCC4TI/bin
  153. export CFLAGS='-Os -s'
  154. Next, simply go into the scripts directory.
  155. Then you must apply the patch supplied with this package:
  156. ./Install_step_1
  157. If cross-compiling or using another custom compiler for some reason, set the
  158. CC and GCC4TIHOST environment variables, e.g.
  159. export CC=i586-mingw32msvc-gcc
  160. export GCC4TIHOST=i586-mingw32msvc
  161. Next, compile binutils and gcc. This may take a while...
  162. ./Install_step_2
  163. If everything went correctly, you now should have a working GCC4TI for Linux
  164. compiler. For installing the TIGCC library, simply launch:
  165. ./Install_step_3
  166. If you want to be able to use the tigcc front-end and tprbuilder, you should
  167. append (not prepend !) $PREFIX_GCC4TI/bin to your PATH.
  168. You need the TI-68k Developer Utilities (several are required for using the
  169. tigcc front-end, most others are useful, well, utilities). Simply do:
  170. ./Install_step_4
  171. At last, you have to install the full documentation by
  172. ./Install_step_5
  173. REBUILDING THE DOCUMENTATION FROM ITS TRUE SOURCE (REQUIRES WINDOWS)
  174. --------------------------------------------------------------------
  175. This section is lifted from Sebastian's Readme.txt accompanying the Windows
  176. source release. Note that the Linux/Unix source release includes pre-generated
  177. HTML documentation, so you only need to rebuild it if you modify the hs? files.
  178. First, modify the file HelpSystem.ini in the 'Programs' subfolder of the
  179. 'Doc' folder to reflect your actual folder names. It exists so that the
  180. 'Programs' folder can reside at any given place on the hard disk.
  181. Then, you need to call all 'Update...' programs once.
  182. UpdateInclude.exe and UpdateInfo.exe take one or more complete file name(s)
  183. as parameters. The actual names of the files are discarded, and the remaining
  184. folder name is the folder to be updated. If the first parameter is '/ALL' or
  185. no parameters are specified, all folders are updated, and in case of
  186. UpdateInclude.exe, a header file index is generated.
  187. UpdateKeywords.exe and UpdateIndex.exe do not take any parameters.
  188. To compile the documentation, download the HTML Help Workshop from
  189. http://msdn.microsoft.com. Then compile the project in the 'System\CHMFiles'
  190. folder.
  191. Tools to make editing help system files more convenient are also included in
  192. this distribution.
  193. A tools to create help system files from the original GNU Texinfo documents
  194. is included as well, but it might need a recompilation to work with future
  195. versions of the documentation. Anyway, the .texi files should be in the
  196. current directory, and you should specify one of them in the command line.
  197. The appropriate subfolders need to exist (e.g. gnuexts).
  198. If you need detailed information about the file formats, look at the
  199. Readme.txt file in the documentation folder.
  200. When done with building the CHM documentation, you can convert it to the QT
  201. assistant format using my converters:
  202. cd srcdir/doc/converter # substitute the directory you are using for srcdir
  203. gcc -Os -s -Wall -W -Wwrite-strings chm2dcf.c -o chm2dcf # compile chm2dcf
  204. cd ../html
  205. ../converter/chm2dcf # convert the CHM to a Documentation Content File (DCF)
  206. ../converter/dcf2adp # convert the DCF to an Assistant Document Profile (ADP)
  207. (There is also a script called updatedoc to automate the copying and
  208. converting of the documentation.)
  209. WARNING: chm2dcf is slow (several minutes on a Core 2 @ 2 GHz).