/docs/INSTALL.txt

http://github.com/graemeg/lazarus · Plain Text · 325 lines · 222 code · 103 blank · 0 comment · 0 complexity · 7a85f2f4bbd1add34b4a2c5f5af9a971 MD5 · raw file

  1. Installation hints for lazarus
  2. ==============================
  3. Lazarus provides two main parts:
  4. - LCL - the Lazarus Component Library
  5. - IDE - the RAD tool (editor, form designer, GUI for debugger and compiler, ...)
  6. What is required for Lazarus:
  7. - FreePascal - the FreePascal Compiler plus packages plus FPC sources.
  8. IMPORTANT: try to get the same version of the compiler sources
  9. as the installed compiler.
  10. - Under Linux/xxxBSD: gtk2 libaries - Most distributions already install them.
  11. See www.gtk.org.
  12. The FAQ - Frequently Asked Question is available at www.lazarus.freepascal.org
  13. and some can be found in the file 'FAQ'.
  14. The following will describe how to get FreePascal and how to install Lazarus
  15. properly:
  16. ================================================================================
  17. 1. Quick installation guide
  18. --------------------------------------------------------------------------------
  19. 1.1 This is the short version. For more details, see the following sections.
  20. Lazarus is intended to be a development tool. Therefore it is designed, that
  21. any normal user can easily install his local copy. This means Lazarus does
  22. not need to be installed as root and it does not create any symlinks or
  23. configuration entries. You can literally just unpack it into a directory of
  24. your choice and compile it.
  25. 1.2 Under Linux/BSD:
  26. Make sure that you have installed X, gtk2 and gtk2-devel.
  27. Fedora:
  28. yum install gtk2 gtk2-devel
  29. Debian/Ubuntu:
  30. apt-get install lazarus #will pull in required gtk dependencies
  31. Download and install FreePascal. Either the rpm, tgz or the daily snapshot.
  32. You need at least FPC 2.6.4 (3.0.0 is the stable version of FPC; uneven
  33. versions like 3.1.1 are development versions).
  34. To compile Lazarus (LCL + IDE) go to your unpacked Lazarus source and do:
  35. []$ make clean all
  36. You don't need "./configure" and you don't need "make install". You now
  37. already have a complete Lazarus. You can start the IDE with "./lazarus".
  38. The "make install" as root will just copy the files and set some nice symlinks
  39. and desktop entries.
  40. 1.3 Under Mac OS X:
  41. What you need: Apple Developer tools
  42. The Developer tools are included on the original OSX installation CDs, or
  43. can be downloaded at ADC (free registration required)
  44. http://developer.apple.com/.
  45. Download and install FreePascal. Either the dmg or the daily snapshot.
  46. You need at least FPC 2.6.4 (2.6.4 is the stable version of FPC; uneven
  47. versions like 3.1.1 are development versions).
  48. To compile Lazarus (LCL + IDE) go to your unpacked Lazarus source and do:
  49. []$ make clean all
  50. You don't need "./configure" and you don't need "make install". You now have
  51. already a complete lazarus. You can start the IDE with "./lazarus".
  52. The "make install" as root will just copy the files and set some nice symlinks
  53. and desktop entries.
  54. ================================================================================
  55. 2. Installing FreePascal
  56. --------------------------------------------------------------------------------
  57. 2.1 Installing FreePascal under Linux:
  58. Lazarus requires FPC (Free Pascal) version 2.6.4 (or newer) and it requires
  59. both the compiled FPC libs (binaries) and the FPC sources. Most of the Linux
  60. distributions contain packages for FreePascal (look for FPC). Use your package
  61. manager to install them.
  62. The FPC binaries:
  63. At the Lazarus downloads section (www.lazarus.freepascal.org
  64. or http://sourceforge.net/project/showfiles.php?group_id=89339) you can get
  65. the rpm/deb of the Free Pascal compiler(compiler / linux) and its packages.
  66. Alternatively, if you don't have a rpm system, you can download and install
  67. the tars from www.freepascal.org.
  68. If you want to compile the binaries for yourself see the BSD section.
  69. The FPC sources:
  70. The easiest way to get the Free Pascal sources is via svn. Of course you can
  71. also download it as whole, see http://www.freepascal.org/develop.html
  72. for the daily snapshot of the release tree (3.1.x).
  73. The FPC sources via svn:
  74. Create a directory where you would like to put the sources. You don't need
  75. to be root to do this.
  76. First create a directory for fpc (e.g. /home/username/freepascal) then do
  77. the following:
  78. []$ bash
  79. []$ svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
  80. This will create a directory fpc, which can later be used in the IDE.
  81. Hint:
  82. To download/update the latest changes you can simply do
  83. []$ cd /home/username/freepascal/fpc
  84. []$ svn up
  85. --------------------------------------------------------------------------------
  86. 2.2 Installing FreePascal under Windows:
  87. If you use the Windows installer for lazarus, then you don't need to install
  88. Free Pascal separately, because the installer already contains the necessary
  89. files.
  90. See http://www.freepascal.org/down-win32.html. You can find a list of mirrors
  91. at http://www.freepascal.org/sdown.html. Download for example FPC as one big
  92. file, unzip it and run install.exe. Then extend your PATH variable to the
  93. FPC directory. For example under Windows 98:
  94. Edit autoexec.bat and add the line
  95. PATH=%PATH%;C:\pp\bin\bin\win32
  96. Then restart Windows.
  97. ToDo: explain how to download fpc sources and build the compiler
  98. --------------------------------------------------------------------------------
  99. 2.3 Installing FreePascal under BSD/manually:
  100. Read 1.2 first.
  101. Effectively, you need:
  102. - a file with all sources, or two (FPC and Lazarus)
  103. (1) e.g. for FPC ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar
  104. preferably an export (no SVN/ dirs). The above file misses this
  105. (2) Lazarus source snapshot.
  106. - _any_ starting compiler from the 2.6.4 branch) You can do a check by parsing
  107. the output of 'fpc -v' if it is 2.6.4, it is ok.
  108. - dependant packages. (for FreeBSD that is gtk2, and
  109. GNU make, iconv and gettext)
  110. FPC build:
  111. (1) (fetch) necessary files (FPC source, starting compiler)
  112. (2) (extract) Then de-tgz in work directory,
  113. (3 (build) enter work/fpc/ and run
  114. $MAKE all OPT='-gl -O3p3' PP=/path/to/startingcompiler-name-ppc386
  115. (/path/to/ can be omitted when ppc386 is in the path)
  116. ($MAKE is make on linux and gmake on BSD)
  117. (4) (install) then, again in work/fpc, run
  118. $MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
  119. (THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg
  120. for ports)
  121. Create a symlink
  122. ln -s $THEPREFIX/lib/fpc/2.6.4/ppc386 $THEPREFIX/bin/ppc386
  123. install sourceinstall PREFIX=$THEPREFIX
  124. (5) (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/2.6.4 $ETCDIR
  125. (6) (optional, test), see if ppc386 -i gives output, else give a warning
  126. that user need to add $PREFIX/bin to his current path.
  127. Try to compiler a program with -viwn, and see if that gives errors.
  128. Notes:
  129. - If you need fpcmake package lists, you need to generate or supply them
  130. yourself, (in the port, or in an extra archive)
  131. either way, do a dummy install to /tmp/pack and determine the files
  132. installed with find . >ll
  133. - $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs
  134. aren't possible.
  135. - BSDHIER=1 on all make commands forces BSD hierarchy conventions.
  136. --------------------------------------------------------------------------------
  137. 2.4 Installing FPC on Mac OSX
  138. Read 1.3 first.
  139. Information:
  140. http://www.freepascal.org/fpcmac.html#TargetDarwin
  141. Download the latest Mac OSX dmg package.
  142. Since FPC for Mac OSX is under heavy development, it s recommended to use
  143. the latest FPC from svn.
  144. Open a terminal and type (without the []$)
  145. []$ svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
  146. This will create a directory fpc, which can also be later used by the IDE.
  147. Compile fpc:
  148. []$ make clean all
  149. Install fpc
  150. []$ sudo make install
  151. This will install fpc in /usr/local/bin. The compiler is for example
  152. /usr/local/bin/fpc. You can add the path to your /Users/username/.profile.
  153. Hint:
  154. To download/update the latest changes you can simply do
  155. []$ cd /Users/username/fpc
  156. []$ svn up
  157. ================================================================================
  158. 3. Installing Lazarus
  159. --------------------------------------------------------------------------------
  160. 3.1 Installing Lazarus under Linux/BSD/Mac OSX:
  161. Because the whole Lazarus stuff is installed into one directory, uninstall
  162. is very easy and you don't need to be root to install Lazarus.
  163. You can get tgz/zip files from the downloads section or you can download it
  164. directly via svn.
  165. Hint: Most Linux distributions contain a Lazarus package. Go to your package
  166. manager and install it.
  167. Downloading Lazarus svn: svn provides an easy way to update your sources by
  168. only downloading the changes. This is the recommended way and saves you a lot
  169. of time. A connection to the internet is needed for this.
  170. You don't to be root. Lazarus does not need any special permissions, neither
  171. during installation nor at runtime.
  172. First create a directory for Lazarus (e.g. /home/username/freepascal) then do
  173. the following:
  174. connect to the svn server (note: Lazarus and Free Pascal use the same server)
  175. []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
  176. compile Lazarus:
  177. []$ cd lazarus
  178. []$ make (gmake on BSD)
  179. If FPC is installed correctly, the compilation should work without problems.
  180. If not, see the FAQ.
  181. Start Lazarus:
  182. []$ ./lazarus
  183. The IDE should start. If you started Lazarus in a terminal, you can see some
  184. notes about missing settings. This is normal at first start.
  185. The IDE automatically tries to find out where the Free Pascal compiler and its
  186. sources are installed by searching in the most common directories.
  187. Check the paths:
  188. Use the IDE menu to go to
  189. Environment -> Environment Options -> Files
  190. The 'FPC Source directory' should point to your FPC source directory. This
  191. directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/share/fpcsrc or
  192. /home/username/freepascal/fpc) and
  193. contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.
  194. ToDo: explain the other paths
  195. Hint:
  196. To update Lazarus you can use
  197. []$ cd /home/username/freepascal/lazarus
  198. []$ svn up
  199. []$ make clean all (gmake on BSD)
  200. This will rebuild Lazarus and create a minimal IDE with only the basic
  201. packages.
  202. []$ make idepkg
  203. --------------------------------------------------------------------------------
  204. 3.1 Installing Lazarus under Windows:
  205. Just download and install the .exe file. You can get the files from:
  206. http://sourceforge.net/project/showfiles.php?group_id=89339 (stable release)
  207. or
  208. http://snapshots.lazarus.shikami.org/lazarus/ (snapshots)
  209. Thanks to Joe for this Step-by-step description:
  210. You have to download the Lazarus source:
  211. ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip
  212. Then unzip it to c:\lazarus for example.
  213. You have to install at least FPC 2.6.4, e.g. in
  214. c:\pp\bin\win32.
  215. In this directory you can find a lot of exes (make, grep, ppc386, and so on).
  216. Open a command line. Start->Run...>command or choose MS-DOS icon.
  217. Type:
  218. cd c:\lazarus
  219. rem of course adjust to your path:
  220. set path=c:\pp\bin\win32;c:\lazarus
  221. make
  222. If you are lucky then you can type: lazarus.exe