[fpc-devel] Building a debug version of FPC-main on Windows

Werner Pamler werner.pamler at freenet.de
Mon Aug 23 13:36:39 CEST 2021


I am using the following script to build a debug version of FPC-main on 
Windows:

set BINUTILS_DIR=C:\Lazarus\fpc_bootstrap_compiler\3.2.2\i386-win32
set BOOTSTRAP_COMPILER=%BINUTILS_DIR%\ppc386.exe
set FPC_DEST_DIR=c:\Lazarus\fpc-main
set BIN_DIR=bin\i386-win32
set FPC_BIN_DIR=%FPC_DEST_DIR%\%BIN_DIR%
set OPTIONS="-dDEBUG -gl -gw2"

::------------------------------------------------------------------------------
:: Set Path
::------------------------------------------------------------------------------
path %BINUTILS_DIR%;%PATH%

::------------------------------------------------------------------------------
:: Build FPC
::------------------------------------------------------------------------------
cd %FPC_DEST_DIR%
md %FPC_BIN_DIR%
copy %BINUTILS_DIR%\*.* %FPC_BIN_DIR%

make distclean
make install all OPT=%OPTIONS% INSTALL_PREFIX=%FPC_DEST_DIR% 
PP=%BOOTSTRAP_COMPILER%

::------------------------------------------------------------------------------
:: Make fpc.cfg,
::------------------------------------------------------------------------------
cd %FPC_DEST_DIR%
fpcmkcfg -d basepath=%FPC_DEST_DIR% -o %FPC_BIN_DIR%\fpc.cfg

This works fine for the first time when I apply it in a freshly cloned 
folder. But after having pulled a new version later, I does not work any 
more, it fails when the percentage counter of the installer is at 99% 
and when the command "make -C utils all" is to be executed, and when 
ptop.pp is compiled. The error message is "Can't find unit CustApp used 
by PtoP"

[...]
make[2]: Entering directory `c:/Lazarus/fpc-main/utils'
c:/Lazarus/fpc-main/compiler/ppc386.exe fpmake.pp 
-Fuc:/Lazarus/fpc-main/rtl/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/paszlib/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/fcl-process/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/hash/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/libtar/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/fpmkunit/units/i386-win32 
-Fuc:/Lazarus/fpc-main/packages/fcl-json/units/i386-win32 -dDEBUG -gl 
-gw2 -dDEBUG -gl -gw2
./fpmake.exe compile --localunitdir=.. --globalunitdir=../packages 
--os=win32 --cpu=i386 -o -Ur -o -Xs -o -O2 -o -n -o -dDEBUG -o -gl -o 
-gw2 -o -di386 -o -dRELEASE 
--compiler=c:/Lazarus/fpc-main/compiler/ppc386.exe -bu
Start compiling package utils for target i386-win32.
        Compiling BuildUnit_utils.pp
        Compiling usubst.pp
        Compiling ptopu.pp
        Compiling ptop.pp
The installer encountered the following error:
External command "c:/Lazarus/fpc-main/compiler/ppc386.exe -Twin32 
-FEbin\i386-win32 -FUunits\i386-win32\ 
-FuC:\Lazarus\fpc-main\rtl\units\i386-win32\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\fcl-base\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\rtl-objpas\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\paszlib\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\hash\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\fcl-json\ 
-FuC:\Lazarus\fpc-main\units\i386-win32\rtl-extra\ -Ur -Xs -O2 -n 
-dDEBUG -gl -gw2 -di386 -dRELEASE -viq ptop.pp" failed with exit code 1. 
Console output:
Target OS: Win32 for i386
Compiling ptop.pp
PPU Loading C:\Lazarus\fpc-main\units\i386-win32\fcl-base\custapp.ppu
PPU Source: custapp.pp not available
Recompiling CustApp, checksum changed for 
C:\Lazarus\fpc-main\rtl\units\i386-win32\sysutils.ppu
ptop.pp(21,29) Fatal: Can't find unit CustApp used by PtoP
Fatal: Compilation aborted

The error does not occur when I remove the OPT=%OPTIONS% from the make 
command line.

Does somebody have an idea what I am doing wrong?

Thanks.





More information about the fpc-devel mailing list