Recent

Author Topic: [SOLVED] How to compile FPC from SVN (including fpc.cfg)?  (Read 1581 times)

Hartmut

  • Hero Member
  • *****
  • Posts: 742
[SOLVED] How to compile FPC from SVN (including fpc.cfg)?
« 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.
« Last Edit: September 13, 2019, 07:39:59 pm by Hartmut »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: How to compile FPC from SVN (including fpc.cfg)?
« Reply #1 on: September 12, 2019, 08:29:23 pm »
I'd recommended that you use fpcupdeluxe (or the forum thread).

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; you should read it before trying to build Free Pascal from sources.

You should also see: Installing Lazarus :: From source on Windows
« Last Edit: September 12, 2019, 08:39:48 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: How to compile FPC from SVN (including fpc.cfg)?
« Reply #2 on: September 12, 2019, 08:29:43 pm »
Search for "fpc buildfaq" and start reading

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: How to compile FPC from SVN (including fpc.cfg)?
« Reply #3 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.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: How to compile FPC from SVN (including fpc.cfg)?
« Reply #4 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

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: How to compile FPC from SVN (including fpc.cfg)?
« Reply #5 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.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: [SOLVED] How to compile FPC from SVN (including fpc.cfg)?
« Reply #6 on: September 14, 2019, 12:31:13 am »
Glad it helped; now, have fun! :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018