Lazarus

Programming => General => Topic started by: Hartmut on September 12, 2019, 07:06:09 pm

Title: [SOLVED] How to compile FPC from SVN (including fpc.cfg)?
Post by: Hartmut on September 12, 2019, 07:06:09 pm
I want to verify a fix from https://bugs.freepascal.org/view.php?id=36068

By the documentation in https://freepascal.org/develop.html I could download Revision 42976 via SVN to h:\Progs\FPC\trunc\fpc\

Then I googled for how to compile FPC from there and found nothing helpful (if someone knows a link, please provide it).

So analog to how I compiled Lazarus from SVN (long time ago) I executed "H:\Progs\Lazarus\184\fpc\3.0.4\bin\i386-win32\make.exe all" in folder h:\Progs\FPC\trunc\fpc\ which seemed to work.

I found fpc.exe in h:\Progs\FPC\trunc\fpc\compiler\utils\ but when I started it, I got:
Error: ppc386.exe can't be executed, error message: Failed to execute ""ppc386.exe"  -?Fh:
\Progs\FPC\trunc\fpc\compiler\utils\fpc.exe ", error code: 2

I found ppc386.exe in h:\Progs\FPC\trunc\fpc\compiler\ and was surprised, that both don't reside in the same folder, as I always had before.

I started "ppc386.exe d:\FPC\work\archiv\test2.pas" to compile my program but got
Fatal: Can't find unit system used by Program

I saw, that fpc.cfg did not exist anywhere. Is that normal? I would expect that it is created automatically...

Then I googled for how to create fpc.cfg and found https://wiki.lazarus.freepascal.org/Configuration_file#Create

I tried to adapt it to my case and in folder "h:\Progs\FPC\trunc\fpc\compiler\" I excecuted "h:\Progs\FPC\trunc\fpc\utils\fpcmkcfg\bin\i386-win32\fpcmkcfg.exe -d basepath=h:\Progs\FPC\trunc\fpc\ -o .\fpc.cfg" which created h:\Progs\FPC\trunc\fpc\compiler\fpc.cfg

In this folder I started "ppc386.exe d:\FPC\work\archiv\test2.pas" again but got the same Error
Fatal: Can't find unit system used by Program

So I think fpc.cfg was not created correctly (I attached it).

I'm a bloody beginner to SVN and makefiles. Does anybody know what I am doing wrong? Thanks in advance. I use Windows 7.
Title: Re: How to compile FPC from SVN (including fpc.cfg)?
Post by: lucamar on September 12, 2019, 08:29:23 pm
I'd recommended that you use fpcupdeluxe (https://wiki.lazarus.freepascal.org/fpcupdeluxe) (or the forum thread (https://forum.lazarus.freepascal.org/index.php/topic,34645.0.html)).

It'll take care of most (if not all) tasks related to installing a trunk FPC (and/or Lazarus) for you.

If you still want to do it by hand, check the paths in the generated fpc.cfg and the system's path; this last may be causing extraneous executable searches.

Also note that the canonical "build-by-hand" manual is Marco van de Voort's Build FAQ (http://www.stack.nl/~marcov/buildfaq.pdf); you should read it before trying to build Free Pascal from sources.

You should also see: Installing Lazarus :: From source on Windows (https://wiki.lazarus.freepascal.org/Installing_Lazarus#From_source_on_Windows)
Title: Re: How to compile FPC from SVN (including fpc.cfg)?
Post by: marcov on September 12, 2019, 08:29:43 pm
Search for "fpc buildfaq" and start reading
Title: Re: How to compile FPC from SVN (including fpc.cfg)?
Post by: Hartmut on September 12, 2019, 09:22:39 pm
After having a look in your recommended links I saw how difficult it is, to compile FPC manually. I think it is a very good idea to use fpcupdeluxe for that (I used it on Linux to install Lazarus long time ago and forgot, that it can install FPC too). I will try tomorrow and report if I was successfull.
Thanks a lot for your valuable help. Have a good night.
Title: Re: How to compile FPC from SVN (including fpc.cfg)?
Post by: Bart on September 12, 2019, 09:48:36 pm
Basic install

Code: [Select]
h:
cd \Progs\FPC\trunc\fpc
make clean all (you need an installation of 3.0.4 as starting compiler for that to work)
make install (installs into c:\pp by default)
c:
cd c:\pp\bin\i386-win32 (assuming this is 32-bit)
fpcmkcfg -o .\fpc.cfg (makes the fpc.cfg)

Bart
Title: Re: How to compile FPC from SVN (including fpc.cfg)?
Post by: Hartmut on September 13, 2019, 07:39:41 pm
With fpcupdeluxe it was very easy to download and compile the FPC. I'm happy. Thanks a lot to all who helped me.
Title: Re: [SOLVED] How to compile FPC from SVN (including fpc.cfg)?
Post by: lucamar on September 14, 2019, 12:31:13 am
Glad it helped; now, have fun! :)
TinyPortal © 2005-2018