Difference between revisions of "Getting Lazarus"
JuhaManninen (talk | contribs) |
JuhaManninen (talk | contribs) |
||
Line 163: | Line 163: | ||
You can also use TortoiseSVN client on Windows as explained earlier. | You can also use TortoiseSVN client on Windows as explained earlier. | ||
− | == | + | ==Compiling and installing FPC== |
− | There are many ways to compile and install FPC. | + | There are many ways to compile and install FPC. |
+ | |||
+ | * Use plain ''make''. | ||
+ | * Build a FPC package for your Linux distribution (.deb or .rpm file). The package allows to easily uninstall, upgrade and downgrade FPC and makes sure that all files are installed at the common places. So if something goes wrong, other users know how to help you. | ||
+ | |||
+ | In either case Lazarus must finally be configured for the new FPC. | ||
===Build and install with make=== | ===Build and install with make=== |
Revision as of 07:38, 28 June 2010
│
Deutsch (de) │
English (en) │
español (es) │
français (fr) │
日本語 (ja) │
polski (pl) │
português (pt) │
русский (ru) │
slovenčina (sk) │
Download and install Lazarus release version
From SourceForge
Binary releases for various platforms are available via the Lazarus Sourceforge download area.
Specific for platform
Lazarus for Windows - use the Sourceforge link above.
Getting SVN
TortoiseSVN client
TortoiseSVN Client is for Windows only. You may download it from http://tortoisesvn.tigris.org/.
The following page demonstrates how to download and update Lazarus SVN source, but it can be used for FPC source in the same way. TortoiseSVN
Other clients
A SVN command line client is available from the official SVN website for many platforms.
On Linux, it is recommended to install subversion using the package management system offered by your distribution. For example:
sudo apt-get install subversion
Getting Lazarus SVN development version
Using the command line
To get Lazarus for the first time:
Open a terminal/command prompt, change to the directory you wish the Lazarus folder to be created in and type:
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
To update Lazarus sources:
Open a terminal/command prompt, change to the lazarus directory and type:
svn update
For compiling see here.
Alternative URLs
Sometimes the URL of repository given above does not work, because between the svn server there is a http-proxy server. That server usually claims to be a 'transparent' proxy, but still doesn't pass your svn commands correctly to the svn.freepascal.org server.
The svn.freepascal.org server also listens on port 8080. Maybe the proxy doesn't interfere with http trafic on that port, so you can try:
svn co http://svn.freepascal.org:8080/svn/lazarus/trunk lazarus
The Lazarus svn repostory is mirrored on sourceforge with a delay of 15 minutes using fpsvnsync. The sourceforge repository uses the https protocol. Proxy servers usually don't interfere with that protocol. You can check out form sourceforge using the following command
svn co https://svn.sourceforge.net/svnroot/lazarus/trunk lazarus
The FPC and Lazarus svn repostories are also mirrored to svn2.freepascal.org. You can check out from svn2.freepascal.org with
svn co http://svn2.freepascal.org/svn/lazarus/trunk lazarus
If you own the proxy server, or are friends with the person who does, there are details of setting up a proxy to pass svn commands here: http://subversion.tigris.org/faq.html#proxy This contains an example for squid. Remember to set up the client to use the proxy ! (For TortoiseSVN, see settings/network)
Scripts
There are scripts for Windows and Linux to automate downloading and building Lazarus: Scripts for Lazarus
Compiling and installing Lazarus
See Installing Lazarus - A detailed installation guide.
Building from command-line
Lazarus is shipped with Makefile for gnu make util. (Be warn, if you also have Codegear(or Borland) tools installed, it might conflict with gnu "make" util).
The tool allows you to compile the lazarus from command-line easily. You need to have fpc and fpc-packages installed and configured first.
To compile go to Lazarus directory in your terminal and type
make
This should rebuild LCL and Lazarus IDE (with basic packages installed).
Make targets
Following compiling targets can be specified for the make tool:
- clean
The command will clean all compiled LCL and IDE units. Warning, this might make your project uncompilable (even though IDE still run, since binary is not deleted)
For example:
make clean
- bigide - the command rebuilds LCL and IDE with additional packages.
For example:
make bigide
- lcl - the command rebuild LCL only. IDE is left untouched. The command is very useful if you're making changes to LCL and need to test the changes on your project without breaking Lazarus. Rebuild LCL only is faster than rebuilding both LCL and IDE
For example:
make lcl
- components
- packager/registration
- ideintf
- packager
- bigidecomponents
- ide
- idepkg
- idebig
- bigide
- starter - the command rebuilds startlazarus binary.
- lazbuilder
- tools
- all
- cleanide
- purge
- examples - the command rebuilds examples lazarus
- install
- lazbuild
If no target is specified LCL and IDE Lazarus (with basic set of components) is rebuilt.
Make parameters
There're also additional parameters, can be used for 'making' Lazarus.
- OPT=%compiler_switches
the %compiler_switches is passed to each fpc call. The option is useful for specifying defines
For example:
make bigide OPT="-dNoGdkPixBufLib -gw2"
makes LCL and ide with NoGdkPixBufLib defined and dwarf2 debug info.
- LCL_PLATFORM=%platform
%platform is the target Widgetset. It can be win32,gtk,gtk2,qt,carbon or cocoa.
For example:
make LCL_PLATFORM=gtk2
Rebuilds LCL and IDE for gtk2 widgetset
- FPC=%compiler_path
%compiler_path is the path to a custom compiler binary you want to build the target with.
Getting FPC SVN development version
Here are some hints how to install the development version of fpc (at the moment 2.5.1), which contains new features, bug fixes but is less stable and contains new bugs. The compiler is not included in the Lazarus SVN, but has its own FPC SVN. You must install first the latest released fpc. See here: Installing the Free Pascal Compiler.
Create a directory and download fpc from svn:
mkdir -p ~/freepascal cd ~/freepascal svn co http://svn.freepascal.org/svn/fpc/trunk fpc
This will take some time.
You can also use TortoiseSVN client on Windows as explained earlier.
Compiling and installing FPC
There are many ways to compile and install FPC.
- Use plain make.
- Build a FPC package for your Linux distribution (.deb or .rpm file). The package allows to easily uninstall, upgrade and downgrade FPC and makes sure that all files are installed at the common places. So if something goes wrong, other users know how to help you.
In either case Lazarus must finally be configured for the new FPC.
Build and install with make
This is for Linux. ToDo: update commands for other platforms.
On command line, go to fpc source root directory (~/freepascal/fpc) loaded from svn server. Run:
make all
It compiles the compiler in 3 cycles, first using the already installed compiler and then using the newly compiled compiler. After successful compilation, run:
make install INSTALL_PREFIX=~
It install all needed files under your home directory. You can install to any other directory if needed. You just have to use the root account if the directory does not allow writing with your normal user account. Then create a file
~/.fpc.cfg
It is a hidden file (note the first dot). Enter the following contents to the file, replacing "/home/username" with your actual home directory name (if you installed to another directory, use that instead).
#include /etc/fpc.cfg -Fu/home/username/lib/fpc/$fpcversion/units/$fpctarget -Fu/home/username/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/home/username/lib/fpc/$fpcversion/units/$fpctarget/rtl
This allows installing any future fpc versions into PREFIX=~ without editing the config file.
See "Configure Lazarus for the new fpc" below for the next step.
Build a debian/ubuntu package
Important: This script does not create the official debian/ubuntu packages. It creates a fpc package that contains the compiler and all packages.
To build the package you need to install some packages:
sudo apt-get install libgpmg1-dev fakeroot libncurses5-dev build-essential
Go into your lazarus source directory. The directory must be writable.
cd ~/freepascal/lazarus/tools/install ./create_fpc_deb.sh fpc ~/freepascal/fpc
If you get an error about a missing file or tool you may have to install a missing package. If you get a compilation error your installed fpc is not the released compiler or you were unlucky and fetched a fpc svn reversion that contains a bug. Search help on the mailing list, forum or chat. If it ran through you now have a deb file, which you can install:
sudo dpkg -i fpc_2.5.1-091121_i386.deb
The file name is different for you.
Configure Lazarus for the new FPC
Now fpc is installed either by "make install" or by using a distro specific package. The next step is to compile lazarus svn with the new compiler and tell the IDE to use the directory /home/username/freepascal/fpc as FPC source directory.
If you have not yet downloaded the lazarus svn, do it now: Development versions from SVN. For example:
cd ~/freepascal svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
This will take some time, continue with:
cd ~/freepascal/lazarus make clean all
If this gives linker errors, you have to install some packages (build-essential, libgtk2.0-dev,libgdk-pixbuf-dev). Start the IDE:
cd ~/freepascal/lazarus ./lazarus
This is a minimal IDE without any extra packages. Now the IDE must be setup and can be built with packages:
- Go to Environment / Options / Environment
- Set lazarus directory to /home/username/freepascal/lazarus
- Set FPC source directory to /home/username/freepascal/fpc
- Click Ok to close the dialog
- Tools / Configure Build Lazarus / Quick Build Options / Build IDE with packages
- Click Build.
- Restart the IDE
- Now you have the latest and greatest IDE built with the latest and greatest FPC.
Development versions from Git
There is a Git mirror of the official SubVersion repository being maintained on GitHub. This mirror gets sync'ed every 15 minutes with the SubVersion repository. For more information on getting Git and cloning the Lazarus repository, follow this link: Git Mirrors. You can also use git directly with SubVersion server using git-svn link. See Lazarus git-svn for details.
Development versions from Mercurial
There is a Hg mirror of the official SubVersion repository being maintained on florianklaempfl.de.
This mirror does not exist any more. See the message from Florian Klämpfl.
Daily Snapshot method
If you don't want to use svn directly, you can try a daily snapshot. For a list of mirrors see the Lazarus Snapshots Downloads page.
Browse the Source Repository with a Web Browser
The contents of the SVN archive can also be browsed with your web-browser through this viewcvs interface.
Lazarus Distributions
There are some unofficial sites where you can find Lazarus and Free Pascal too:
- You can get a Ubuntu LiveCD from Austrian University of Applied Sciences hosting
http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso and md5sum file is here http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.
Original contributors and changes
This page has been converted from the epikwiki version.