1. Prepare the Directory
Suppose we want to install the entire freepascal environment to the FPC directory of drive d, then we need to create the following directories:
D: \ fpc_svn \ bin
D: \ laz_svn
2. Prepare the environment
1, install SVN client tortoisesvn and Chinese support package: http://tortoisesvn.net/downloads
2. Use the svn client to checkout the following data:
Svn url: http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32
Directory: D: \ fpc_svn \ bin \ i386-win32
Svn url: http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw64
Directory: D: \ fpc_svn \ bin \ x86_64-win64
Svn url: http://svn.freepascal.org/svn/fpc/trunk
Directory: D: \ fpc_svn
Svn url: http://svn.freepascal.org/svn/lazarus/trunk
Directory: D: \ laz_svn
3. Compile FPC
1. Download a compiler and decompress it to the D: \ fpc_svn \ bin directory,
Ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/i386-win32-ppc386.zip
Ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/x86_64-win64-ppcx64.zip
2. Compile a batch to compile the FPC:
@ Echo on
Set myfpc = D: \ fpc_svn
Set mybin = D: \ fpc_svn \ bin
Set Path = % mybin %\ i386-win32; % PATH %
Cd % myfpc %
RD/S/Q % myfpc % \ examples
Make clean all install install_prefix = % myfpc % pp = % mybin % \ ppc386.exe data2inc = % myfpc % \ utils \ data2inc.exe
Pause
// Configure //-----------------------------------------------------------------------------------------------------
@ Echo on
Set myfpc = D: \ fpc_svn
Set mybin = D: \ fpc_svn \ bin
Set Path = % mybin %\ x86_64-win64; % PATH %
Cd % myfpc %
RD/S/Q % myfpc % \ examples
Make clean all install install_prefix = % myfpc % pp = % mybin % \ ppcx64.exe data2inc = % myfpc % \ utils \ data2inc.exe
Pause
3. Save the preceding command as a makefpcwin32.bat file and run it to get the FPC compiling environment.
Open the CMD window:
Cd d: \ fpc_svn
Makefpcwin32 // makefpcwin64
4. Run the following command in the command line to generate the FPC. cfg file:
CD/d: \ fpc_svn \ bin \ i386-win32 // CD/d: \ fpc_svn \ bin \ x86_64-win64
Fpcmkcfg-D basepath = D: \ fpc_svn-o. \ FPC. cfg
4. Compile Lazarus
After step 3 is completed, there is an FPC compiling environment. We also need to compile an IDE environment: Lazarus.
1. Write a batch to compile Lazarus
@ Echo on
Set myfpc = D: \ fpc_svn
Set mybin = D: \ fpc_svn \ bin
Set Path = % mybin %\ i386-win32; % PATH %
Cd d: \ laz_svn
Make clean all opt = "-glw2"
Pause
// Configure //--------------------------------------------------------------------------------------------------------
Set myfpc = D: \ fpc_svn
Set mybin = D: \ fpc_svn \ bin
Set Path = % mybin %\ x86_64-win64; % PATH %
Cd d: \ laz_svn
Make clean all opt = "-glw2"
Pause
2. Save the preceding command as the makelazwin32.bat file and run it to get the fpc ide environment Lazarus.
Open the CMD window:
Cd d: \ fpc_svn
Makelazwin32 // makelazwin64
3. Run D: \ laz_svn \ lazarus.exe to open the IDE.
Warning the FPC source directory "D: \ fpc_svn \" does not
Look correct:
Found version .. 1, expected 2.7.1
Create Directory D: \ fpc_svn \ Source
Copy D: \ fpc_svn \ packages to D: \ fpc_svn \ Source
Copy D: \ fpc_svn \ RTL to D: \ fpc_svn \ Source
Lazarus Directory D: \ laz_svn \
Compiler path D: \ fpc_svn \ bin \ i386-win32 \ fpc.exe
FPC source code Directory D: \ fpc_svn \ Source
Make
GDB file directory upload path(((comppath()gdb.exe
Note: After the above process is completed, get the 32-bit FPC and Lazarus environment, if you want to build a 64-bit environment, the corresponding code in the i386-win32 to x86_64-win64.
Warning during win64 startup: gdb.exe is missing in win64bit. SVN does not obtain the 64-bit version of GDB.
When win64 is compiled for Win32, the prompt is: Compiler "D: \ fpc_svn \ bin \ x86_64-win64 \ fpc.exe
Does not support target i386-win32
Change the compiler path to D: \ fpc_svn \ bin \ i386-win32 \ fpc.exe
Bytes -----------------------------------------------------------------------------------------
Manufacturing green Lazarus:
1. Create a new directory in the installation directory, for example, config. The path is D: \ laz_svn \ config.
2. Set the directory c: \ Documents ents and Settings \ Administrator \ Local Settings \ Application Data \ Lazarus
Everything under is cut to D: \ laz_svn \ config.
6. Create a batch file in the installation directory, such as run_lazarus.bat.
D: \ laz_svn \ startlazarus.exe -- pcp = D: \ laz_svn \ config
7. Run run_lazarus.bat.
From: http://www.fpccn.com/thread-2754-1-1.html
Bytes -----------------------------------------------------------------------------------------
Install Lazarus in Linux and upgrade to the latest SVN Method
Ubuntu:
Sudo apt-Get install Lazarus
Fedora:
Sudo Yum install Lazarus
After installation, upgrade to the latest development version. Because SVN is officially used to manage source code, install the svn tool:
Ubuntu:
Sudo apt-Get install Subversion
Fedora:
Sudo Yum install Subversion
Download the Lazarus source code:
SVN Co http://svn.freepascal.org/svn/lazarus/trunk Lazarus
Download FPC source code:
[Pre] SVN Co http://svn.freepascal.org/svn/fpc/trunk FPC
Then compile and download some libraries before Compilation:
Sudo apt-Get install libgpmg1-dev fakeroot libncurses5-dev build-essential
CD Lazarus/tools/install
./Create_fpc_deb.sh FPC/home/user/FPC
Compile the FPC source code and generate the Deb package,/home/user/FPC source code path
A fpc. tgz and FPC. Deb package, such as fpc_2.5.1-101202_i386.deb fpc-2.5.1-101202.tar.gz, is generated after completion.
Install FPC:
Sudo dpkg-I fpc_2.5.1-101202_i386.deb
Then, CD... exits from the lazars Directory: Make clean all.
Use./Lazarus to open
Enter
Environment-& gt; Options
-& Gt; Lazarus directory (default for all projects)
/Home/user/Lazarus/
-& Gt; compiler path (e. g. FPC)
/Usr/bin/FPC
-& Gt; FPC source directory
/Home/user/FPC/
-& Gt; Make path
/Usr/bin/make
-& Gt; directory for building test projects
/Tmp
You can use it now!
Update the source region later:
SVN update FPC
SVN update Lazarus
Re-run./create_fpc_deb.sh FPC/home/user/FPC
Sudo dpkg-I fpc_2.5.1-101202_i386.deb
Make clena all
That's it! Fedora should use create_fpc_rpm.sh.
Http://www.fpccn.com/thread-886-1-1.html
Compile freepascal and Lazarus