[Lazarus] Building and running Lazarus natively on various architectures

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Oct 8 11:51:42 CEST 2010


Frank Church a écrit :
> 
> 
> On 3 October 2010 10:25, Frank Church
> <vfclists at gmail.com
> <mailto:vfclists at gmail.com>> wrote:
> 
> 
>     I have posted an article and some code on some bash scripts I have
>     developed to install FPC and Lazarus from source at
>     http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source.
> 
>     Any comments and tips are well come.
> 
> 
> Today I have add a few notes and comments to the script to help those
> new to FPC/Lazarus compilation and some of the Linux tools involved to
> understand what is going on.
> 
> Regards

Here is for example the scrip I use on Windows. I use TortoiseSVN
command line tools :

@echo on
set BASEDRV=c:
set FPCNEWVERSION=2.5.1
set FPCOLDVERSION=2.4.3
set BASEINSTALL=%BASEDRV%\programs\fpc
set FPCBASEDIR=%BASEINSTALL%\%FPCNEWVERSION%
set SRCDIR=%BASEINSTALL%\fpsrc\%FPCNEWVERSION%
set PPCNAME=ppc386
set FPCTARGET=i386-win32
set FPCSTART=%BASEINSTALL%\%FPCOLDVERSION%\bin\%FPCTARGET%\%PPCNAME%
set LOGDIR=%BASEDRV%\programs
set INSTALLDIR=%FPCBASEDIR%
set BINUTILSDIR=C:\programs\Binutils

@REM opts.
@REM set OPTS=-gl -dSAX_HTML_DEBUG -dUSE_MINGW_GDB
set OPTS=-gl
@REM set COMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%OPTS%"
GINSTALL=myinst.exe
set COMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%OPTS%"

@REM Lazarus variables
set LAZSRCDIR=%BASEDRV%\programs\lazarus_FPC_svn
@REM OPTSLAZ=-g- -O2 -CX -XX -WG
set OPTSLAZ=
set COMMONOPTSLAZ=OPT="%OPTSLAZ%"
set LAZCONFDIR=%USERPROFILE%\Local Settings\Application Data\lazarus

@rem  ===  invariant  part  ===

%BASEDRV%

del %LOGDIR%\build_fpc_log.txt
del %LOGDIR%\install_fpc_log.txt
del %LOGDIR%\install_laz_log.txt

@REM DPC sources svnupdate
TortoiseProc.exe /command:update /path:"%SRCDIR%\" /closeonend:1

@REM some files may be modified after build. I do a revert for this
@REM but this need to answer TortoiseProc.exe message box.
TortoiseProc.exe /command:revert /path:"%SRCDIR%\" /closeonend:1

cd %SRCDIR%
  Path=%BINUTILSDIR%;%Path%

@REM ********* Build FPC ***************
make clean all %COMMONOPTS% FPC=%FPCSTART% 1> %LOGDIR%\build_fpc_log.txt
2>&1

REM clean previous build
rmdir /S /Q %FPCBASEDIR%\doc
rmdir /S /Q %FPCBASEDIR%\examples
rmdir /S /Q %FPCBASEDIR%\msg
rmdir /S /Q %FPCBASEDIR%\units
rmdir /S /Q %FPCBASEDIR%\bin

@REM Add GNU tools and fpc.cfg to /bin/i386-win32
TortoiseProc.exe /command:update /path:"%BINUTILSDIR%\" /closeonend:1
tortoiseproc.exe /command:dropexport /droptarget:"%FPCBASEDIR%\bin"
/path:"%BINUTILSDIR%"
cd %FPCBASEDIR%\bin
rename Binutils %FPCTARGET%
cd %SRCDIR%
copy %BASEINSTALL%\fpc.cfg %FPCBASEDIR%\bin\%FPCTARGET%\fpc.cfg

@REM **** INSTALL FPC **************
make install %COMMONOPTS% INSTALL_PREFIX=%INSTALLDIR%
FPC=%SRCDIR%\compiler\%PPCNAME% 1> %LOGDIR%\install_fpc_log.txt 2>&1
make clean >NUL

@REM ********** INSTALL LAZARUS *********************************

@REM svn update de LAZARUS
TortoiseProc.exe /command:update /path:"%LAZSRCDIR%\" /closeonend:1

@REM some files may be modified after build. I do a revert for this
@REM but this need to answer TortoiseProc.exe message box.
TortoiseProc.exe /command:revert /path:"%LAZSRCDIR%\" /closeonend:1

@REM Delete previous UNITS directory s
rmdir /S /Q %LAZSRCDIR%\units

@REM ****** Compil/install LAZARUS *********************

cd %LAZSRCDIR%
make clean all %COMMONOPTSLAZ% FPC=%INSTALLDIR%\bin\%FPCTARGET%\fpc.exe
1> %LOGDIR%\install_laz_log.txt 2>&1

REM delete previous config dir.
rmdir /S /Q "%LAZCONFDIR%"

PAUSE





More information about the Lazarus mailing list