[fpc-pascal] Build scripts for Freepascal and Lazarus compilation from source

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Oct 5 15:57:27 CEST 2010


On 05 Oct 2010, at 15:40, Matthias K. wrote:

> there is one improvement to this.
> The first pass for the new compiler doesn't need "make all" which
> compiles all packages too. This results in
> duplicate package compilation on changes and packages take most time.
> The following lines are part of an old fpc 2.4 gentoo ebuild I use,
> which compiles the rtl/compiler with system compiler and compiles
> rtl/packages/utils with the new compiler afterwards. Those only rtl is
> compiled 2 times:
>
> # first pass, compile the new compiler with system compiler (no cycle,
> must be same target)
> make rtl
> make compiler
>
> # second pass, compile rtl/utils/packages with new compiler
> make PP=${FPC_BUILD_DIR}/compiler/${PPCNAME} rtl_clean
> make PP=${FPC_BUILD_DIR}/compiler/${PPCNAME} rtl packages_all utils

That is wrong, unless your starting compiler is exactly the same  
version as the compiler that you are compiling. The compiler needs a  
full cycle to guarantee that it's fully up-to-date, as some things may  
only be activated/fixed during the second compile (in case new  
features are added or bugs are fixed using such new features).

That said, the blog post indeed contains superfluous steps. As far as  
I can tell, this part can simply be removed:

***
#make again, using new build, rather than using SYSTEM_FPC_COMPILER
make all PP=${FPC_INSTALL_DIR}/lib/fpc/${FPCVER}/${PPCNAME}

# move current install out of the way
mv ${FPC_INSTALL_DIR} ${FPC_INSTALL_DIR}_backup
# mv ${FPC_INSTALL_DIR}/lib/fpc/${FPCVER} ${FPC_INSTALL_DIR}/lib/fpc/$ 
{FPCVER}_backup

#install using current compiler
make install PP=${FPC_BUILD_DIR}/compiler/${PPCNAME} INSTALL_PREFIX=$ 
{FPC_INSTALL_DIR}
***

"make all" starts with a "make cycle" exactly to make sure that you  
don't have to start everything again using the newly built compiler  
once you're done.


Jonas



More information about the fpc-pascal mailing list