Difference between revisions of "Getting Lazarus"
m (→Make targets) |
|||
Line 129: | Line 129: | ||
<pre> | <pre> | ||
+ | |||
+ | make help | ||
+ | |||
Main targets | Main targets | ||
Without any target, target 'all' will be invoked. | Without any target, target 'all' will be invoked. | ||
− | all build minimal IDE, lazbuild, startlazarus. | + | all build all needed, i.e. minimal IDE, lazbuild, startlazarus. |
− | clean deletes files that ' | + | clean deletes files that 'bigide' creates. It does not clean up all possible |
+ | targets. Clean other target: make clean LCL_PLATFORM=qt | ||
+ | distclean Clean all targets and common leftovers. | ||
lazbuild build lazbuild and lcl with nogui widgetset | lazbuild build lazbuild and lcl with nogui widgetset | ||
bigide as all, except that the IDE is built with a lot of extra packages | bigide as all, except that the IDE is built with a lot of extra packages | ||
useride calls lazbuild to build an IDE with your active profile, requires lazbuild | useride calls lazbuild to build an IDE with your active profile, requires lazbuild | ||
+ | install installs Lazarus under /usr/local/share/lazarus | ||
+ | You can change the directory by appending INSTALL_PREFIX=/some/path | ||
Sub targets | Sub targets | ||
Line 141: | Line 148: | ||
lazutils build package LazUtils, requires registration | lazutils build package LazUtils, requires registration | ||
codetools build package CodeTools, requires lazutils | codetools build package CodeTools, requires lazutils | ||
− | lcl build package LCL, requires lazutils | + | lcl build package LCLBase and LCL, requires lazutils |
− | tools build lazres, svn2revisioninc, updatepofiles, lrstolfm, requires LCL with nogui widgetset | + | tools build lazres, svn2revisioninc, updatepofiles, lrstolfm, |
− | + | requires LCL with nogui widgetset | |
− | + | basecomponents build debuggerintf, lazdebuggergdbmi, lazcontrols, synedit, ideintf | |
+ | for the LCL_PLATFORM, requires lcl | ||
bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents | bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents | ||
+ | lhelp build lhelp, requires bigidecomponents | ||
starter build startlazarus, requires basecomponents | starter build startlazarus, requires basecomponents | ||
− | examples build basic examples, requires basecomponents | + | examples build basic examples, requires basecomponents |
− | Note: There are more examples having their own directory | + | Note: There are more examples having their own directory |
− | + | ||
− | Usage examples: | + | Flags: |
− | + | PP=/path/to/fpc use another compiler | |
− | Updating svn and build a minimal IDE, startlazarus and lazbuild: | + | USESVN2REVISIONINC=0 do not update ide/revision.inc |
− | make clean | + | INSTALL_PREFIX=/usr used by 'install' as path prefix |
− | svn up | + | FPC_DIR=/usr/share/fpcsrc/3.0.4 used by fpcmake when regenerating Makefiles |
− | make clean all | + | OPT='-vwnbq -gh' append these options when calling the compiler |
− | + | ||
− | Note: You can start lazarus with 'startlazarus' | + | Usage examples: |
− | Note: Use the IDE or lazbuild to compile your projects/packages. | + | |
+ | Updating svn and build a minimal IDE, startlazarus and lazbuild: | ||
+ | make clean | ||
+ | svn up | ||
+ | make clean all | ||
+ | |||
+ | Note: You can start lazarus with 'startlazarus' | ||
+ | Note: Use the IDE or lazbuild to compile your projects/packages. | ||
+ | |||
+ | Updating svn and build an IDE with your last set of packages: | ||
+ | make clean | ||
+ | svn up | ||
+ | make clean lazbuild useride | ||
+ | |||
+ | Clean up: | ||
+ | There is no command to clean up a svn repository completely, but | ||
+ | you can use the following command under Linux/OS X: | ||
+ | svn status | grep '\?' | sed -e 's/\? *//' | xargs rm -r | ||
+ | |||
+ | Another possibility is to create a clean copy via the svn export command. | ||
+ | |||
+ | Install: | ||
+ | Note: You can use Lazarus without installing. Just start the lazarus executable. | ||
+ | 1. Build Lazarus as normal user with one of the above commands. | ||
+ | 2. Install as root into /usr | ||
+ | sudo make install | ||
+ | This installs startlazarus, lazarus-ide, lazbuild under /usr/bin | ||
+ | and copies the whole lazarus source directory to /usr/share/lazarus | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
Revision as of 23:07, 18 October 2017
│
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.
For people who are blocked by SF, the Lazarus releases from Sourceforge are mirrored at:
- ftp://ftp.freepascal.org/pub/lazarus/releases/
- and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
- and http://mirrors.iwi.me/lazarus/
Specific for platform
Get Lazarus for Windows - use the Sourceforge link above.
Get Lazarus for Scientific Linux
Get Lazarus for Raspberry Pi (Raspbian)
Getting SVN client
TortoiseSVN client
TortoiseSVN Client is for Windows only. You may download it from http://tortoisesvn.tigris.org/.
This page demonstrates how to download and update Lazarus SVN source, but it can be used for FPC source in the same way.
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
Note that various alternative instructions for svn in this wiki are now incorrect, while the below svn instructions are currently (2017) working.
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 https://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 repository is mirrored on sourceforge with a delay of 3 minutes using svnsync. 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://lazarus.svn.sourceforge.net/svnroot/lazarus/trunk lazarus
The FPC and Lazarus svn repositories 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
There is also a tool built with FPC/Lazarus that does this for you; see fpcup or even more convenient: fpcUPdeluxe from github.
Compiling and running Lazarus
See Installing Lazarus - a detailed installation guide, or http://www.stack.nl/~marcov/buildfaq.pdf - still more detailed guide.
Using the command-line
Lazarus is shipped with an autogenerated Makefile (of the name "Makefile") for the gnu "make" utility.
Warning: If you also have Embarcadero (or Borland) tools installed, their "make" might conflict with gnu "make". In that case delete or rename the conflicting binary, or remove its directory from Windows PATH.
make allows you to compile 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.
One way to find out about working "make" is to look at the fpcUPdeluxe sources / logs , since those are sometimes working:
e.g. this is working (put it in a single line, replace fpXXdebug with your proper subdir) :
make "FPC=/home/YOU/fpXXdebug/fpc/bin/x86_64-linux/fpc.sh" "USESVN2REVISIONINC=0" "--directory=/home/YOU/fpXXdebug/lazarus" "INSTALL_PREFIX=/home/YOU/fpXXdebug/lazarus" "FPCDIR=/home/YOU/fpXXdebug/fpcsrc" "UPXPROG=echo" "COPYTREE=echo" "OPT=-vw-n-h-l-d-u-t-p-c- " "lazbuild"
Another useful command is
make bigide
which adds the same packages that the release version has and also fails with error.
Then you can run Lazarus from within the same source directory with command "lazarus" (in Unix systems "./lazarus").
In case you want to run several versions, you can direct lazarus to use use specific configuration directories via the --pcp option, e.g. :
lazarus --pcp=/home/YOU/myLaz19
Make targets
To see a list of available targets for make type make help. Note: "make help" exists since 1.0. Here is the output of "make help":
make help Main targets Without any target, target 'all' will be invoked. all build all needed, i.e. minimal IDE, lazbuild, startlazarus. clean deletes files that 'bigide' creates. It does not clean up all possible targets. Clean other target: make clean LCL_PLATFORM=qt distclean Clean all targets and common leftovers. lazbuild build lazbuild and lcl with nogui widgetset bigide as all, except that the IDE is built with a lot of extra packages useride calls lazbuild to build an IDE with your active profile, requires lazbuild install installs Lazarus under /usr/local/share/lazarus You can change the directory by appending INSTALL_PREFIX=/some/path Sub targets registration build package FCL lazutils build package LazUtils, requires registration codetools build package CodeTools, requires lazutils lcl build package LCLBase and LCL, requires lazutils tools build lazres, svn2revisioninc, updatepofiles, lrstolfm, requires LCL with nogui widgetset basecomponents build debuggerintf, lazdebuggergdbmi, lazcontrols, synedit, ideintf for the LCL_PLATFORM, requires lcl bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents lhelp build lhelp, requires bigidecomponents starter build startlazarus, requires basecomponents examples build basic examples, requires basecomponents Note: There are more examples having their own directory Flags: PP=/path/to/fpc use another compiler USESVN2REVISIONINC=0 do not update ide/revision.inc INSTALL_PREFIX=/usr used by 'install' as path prefix FPC_DIR=/usr/share/fpcsrc/3.0.4 used by fpcmake when regenerating Makefiles OPT='-vwnbq -gh' append these options when calling the compiler Usage examples: Updating svn and build a minimal IDE, startlazarus and lazbuild: make clean svn up make clean all Note: You can start lazarus with 'startlazarus' Note: Use the IDE or lazbuild to compile your projects/packages. Updating svn and build an IDE with your last set of packages: make clean svn up make clean lazbuild useride Clean up: There is no command to clean up a svn repository completely, but you can use the following command under Linux/OS X: svn status | grep '\?' | sed -e 's/\? *//' | xargs rm -r Another possibility is to create a clean copy via the svn export command. Install: Note: You can use Lazarus without installing. Just start the lazarus executable. 1. Build Lazarus as normal user with one of the above commands. 2. Install as root into /usr sudo make install This installs startlazarus, lazarus-ide, lazbuild under /usr/bin and copies the whole lazarus source directory to /usr/share/lazarus
Make parameters
There are additional parameters which can be used to make Lazarus. See a fully working example above.
- 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,wince,gtk,gtk2,qt,carbon,cocoa,customdrawn.
For example:
make LCL_PLATFORM=gtk2
Rebuilds LCL and IDE for gtk2 widgetset
- FPC=%compiler_path
or
- PP=%compiler_path
%compiler_path is the path+filename to a custom compiler binary you want to build the target with.
such as:
make FPC="~/Pfad/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.
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:
- The getlazarus distribution bundles cutting-edge versions of Lazarus with easy-to-use setup scripts for several platforms and additional components.
- FreeSparta is a commercial distribution of Lazarus for Windows.
- 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.
- The CodeTyphon distribution bundles Lazarus with additional packages and components.
- LiteZarus is a Lazarus distro intended for designing creating non-LCL projects.
- Lazarus is available on CDs and USB sticks from the Blaise Pascal Magazine store.