INSTALL 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. NOTE: the GCC4TI scripts can handle paths containing spaces, but the `configure`
  49. in binutils 2.16.1 and gcc 4.1.2 cannot. Don't use spaces either in the path
  50. where you decompress the GCC4TI source distribution or in the target PATH ($TIGCC).
  51. First, extract the source to a directory of your choosing such as /tmp.
  52. mkdir /tmp/gcc4ti-src
  53. cd /tmp/gcc4ti-src
  54. # substitute the directory you are using for /tmp
  55. bunzip2 gcc4ti-src.tar.bz2
  56. tar xfv gcc4ti-src.tar
  57. Then, copy or link binutils-2.16.1 and gcc-core-4.1.2.tar.bz2 in that folder.
  58. At this point, you have 2 options:
  59. 1. Use the installation wizard
  60. ------------------------------
  61. All you need to do now is:
  62. scripts/Install
  63. and follow the instructions. If you want a text-mode install on a system with
  64. KDE installed, you can use:
  65. cd scripts; DIALOG=dialog ./Install
  66. to tell the script to use the text-mode (curses) dialog instead of kdialog.
  67. You will be prompted for:
  68. * the destination directory you want to install GCC4TI to ($PREFIX_GCC4TI,
  69. used only internally during the compilation stage: will become $TIGCC when the
  70. build is finished)
  71. * the bootstrap compiler ($CC) you want to compile GCC4TI with (usually "gcc",
  72. unless you're cross-compiling, e.g. with "i586-mingw32msvc-gcc").
  73. * the optimization flags ($CFLAGS) you want to compile GCC4TI with (read the GCC
  74. documentation or just use the defaults)
  75. * the host platform of the generated executables ($GCC4TIHOST), leave blank if
  76. not cross-compiling. "i586-mingw32msvc" is a value that suits well when
  77. CC=i586-mingw32msvc-gcc.
  78. The wizard will ask you whether you want to apply the GCC4TI patch. The answer is
  79. usually "Yes". It will be "No" only if you are rebuilding the same source for a
  80. second (or more) time.
  81. When done, the wizard will ask you whether you want to add your $TIGCC setting
  82. to bashrc. If you answer "Yes", you are done here, you only need to restart
  83. bash. If you prefer to do things by hand, answer "No" and follow the
  84. instructions in section 2.1 below. (If you selected "No", but changed your mind,
  85. you can also run envreg by hand afterwards.)
  86. 2. Use the install scripts directly
  87. -----------------------------------
  88. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  89. WARNING: below, a number of places mention appending $TIGCC/bin to the path.
  90. We _really_ mean appending. This is because $TIGCC/bin contains "gcc" and "as" for
  91. m68k-coff target, and if $TIGCC/bin appears before /usr/bin in the PATH, the "gcc"
  92. and "as" in $TIGCC/bin would be used instead of the host system's executables...
  93. This is definitely not what you want.
  94. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  95. 2.1. Environment variable settings
  96. ----------------------------------
  97. Now, set the environment variable PREFIX_GCC4TI to the directory you want to
  98. install GCC4TI into (for example /usr/local/share/gcc4ti). This variable is
  99. used only during the compilation stage, so as not to interfere with any
  100. prior user-defined setting for the TIGCC environment variable (which is used
  101. _after_ the compilation stage).
  102. If you use bash, add it to your .bashrc file in your home directory. You could
  103. also use your .profile or .login if you have those. If you use tcsh or csh, put
  104. it in your .cshrc file (or if you use .tcshrc, put it there).
  105. I've never used korn shell. You're on your own if you do.
  106. For bash/sh users
  107. export PREFIX_GCC4TI=/usr/local/share/gcc4ti
  108. export PATH=$PATH:$PREFIX_GCC4TI/bin
  109. For csh/tcsh users
  110. setenv PREFIX_GCC4TI /usr/local/share/gcc4ti
  111. set path=($path $PREFIX_GCC4TI/bin)
  112. I've had problems using setenv to reset the path in tcsh.
  113. setenv path "$path ${PREFIX_GCC4TI}/bin"
  114. doesn't seem to work.
  115. You may need to logout and log back in for that to take
  116. effect. Or you can resource your profile.
  117. source ~/.profile
  118. source ~/.bashrc
  119. source ~/.cshrc
  120. source ~/.tcshrc
  121. You only need to resource the file you changed.
  122. 2.2. Installation
  123. -----------------
  124. The hard part should be over. Now, just change into the directory
  125. you extracted GCC4TI into
  126. cd /tmp/gcc4ti-src
  127. Optionally, you can now rebuild the HTML documentation from source: the required
  128. source code is in tigcclib/doc/source.tar.bz2 in your source tree. See the last
  129. section below for instructions to compile the documentation. Note that the tools
  130. to compile the documentation from source are for Windows only, so you will need
  131. Windows or WINE if you want to build the documentation from source. Unless of
  132. course you manage to port the Delphi sources of those tools yourself.
  133. Note that it comes precompiled, so you need not do this. (As for platform-
  134. independence: the documentation is "compiled" into platform-independent HTML
  135. files, so compiling it from source should usually not be necessary.)
  136. And run the installation script...
  137. export CFLAGS='-Os -s'
  138. If cross-compiling or using another custom compiler for some reason, set the
  139. CC and GCC4TIHOST environment variables, e.g.
  140. export CC=i586-mingw32msvc-gcc
  141. export GCC4TIHOST=i586-mingw32msvc
  142. Then launch the installation procedure.
  143. cd scripts; ./Install_All
  144. Assuming you have all the required tools, you should have yourself
  145. a GCC4TI build (except the Delphi executables) in 5 - 60 minutes.
  146. I hope this installation goes smoothly for you.
  147. 2.3. ALTERNATE WAY for installation
  148. -----------------------------------
  149. The following is the "hard" way to do step 2.2. It is used primarily for
  150. development purposes. You can use this if you experience some problems with
  151. the automated script.
  152. At first, you will have to register a variable depending on the location you
  153. want to install GCC4TI
  154. export PREFIX_GCC4TI=/usr/local/share/gcc4ti
  155. export PATH=$PATH:$PREFIX_GCC4TI/bin
  156. export CFLAGS='-Os -s'
  157. Next, simply go into the scripts directory.
  158. Then you must apply the patch supplied with this package:
  159. ./Install_step_1
  160. If cross-compiling or using another custom compiler for some reason, set the
  161. CC and GCC4TIHOST environment variables, e.g.
  162. export CC=i586-mingw32msvc-gcc
  163. export GCC4TIHOST=i586-mingw32msvc
  164. Next, compile binutils and gcc. This may take a while...
  165. ./Install_step_2
  166. If everything went correctly, you now should have a working GCC4TI for Linux
  167. compiler. For installing the TIGCC library, simply launch:
  168. ./Install_step_3
  169. If you want to be able to use the tigcc front-end and tprbuilder, you should
  170. append (not prepend !) $PREFIX_GCC4TI/bin to your PATH.
  171. You need the TI-68k Developer Utilities (several are required for using the
  172. tigcc front-end, most others are useful, well, utilities). Simply do:
  173. ./Install_step_4
  174. At last, you have to install the full documentation by
  175. ./Install_step_5
  176. REBUILDING THE DOCUMENTATION FROM ITS TRUE SOURCE (REQUIRES WINDOWS)
  177. --------------------------------------------------------------------
  178. This section is lifted from Sebastian's Readme.txt accompanying the Windows
  179. source release. Note that the Linux/Unix source release includes pre-generated
  180. HTML documentation, so you only need to rebuild it if you modify the hs? files.
  181. First, modify the file HelpSystem.ini in the 'Programs' subfolder of the
  182. 'Doc' folder to reflect your actual folder names. It exists so that the
  183. 'Programs' folder can reside at any given place on the hard disk.
  184. Then, you need to call all 'Update...' programs once.
  185. UpdateInclude.exe and UpdateInfo.exe take one or more complete file name(s)
  186. as parameters. The actual names of the files are discarded, and the remaining
  187. folder name is the folder to be updated. If the first parameter is '/ALL' or
  188. no parameters are specified, all folders are updated, and in case of
  189. UpdateInclude.exe, a header file index is generated.
  190. UpdateKeywords.exe and UpdateIndex.exe do not take any parameters.
  191. To compile the documentation, download the HTML Help Workshop from
  192. http://msdn.microsoft.com. Then compile the project in the 'System\CHMFiles'
  193. folder.
  194. Tools to make editing help system files more convenient are also included in
  195. this distribution.
  196. A tools to create help system files from the original GNU Texinfo documents
  197. is included as well, but it might need a recompilation to work with future
  198. versions of the documentation. Anyway, the .texi files should be in the
  199. current directory, and you should specify one of them in the command line.
  200. The appropriate subfolders need to exist (e.g. gnuexts).
  201. If you need detailed information about the file formats, look at the
  202. Readme.txt file in the documentation folder.
  203. When done with building the CHM documentation, you can convert it to the QT
  204. assistant format using my converters:
  205. cd srcdir/doc/converter # substitute the directory you are using for srcdir
  206. gcc -Os -s -Wall -W -Wwrite-strings chm2dcf.c -o chm2dcf # compile chm2dcf
  207. cd ../html
  208. ../converter/chm2dcf # convert the CHM to a Documentation Content File (DCF)
  209. ../converter/dcf2adp # convert the DCF to an Assistant Document Profile (ADP)
  210. (There is also a script called updatedoc to automate the copying and
  211. converting of the documentation.)
  212. WARNING: chm2dcf is slow (several minutes on a Core 2 @ 2 GHz).