[Pkg-pascal-devel] rebuilding with fpc 3.0.0

Michalis Kamburelis michalis.kambi at gmail.com
Mon Feb 1 23:58:44 UTC 2016


Paul Gevers wrote:
> Hi all,
> 
> On 05-11-15 02:31, Michalis Kamburelis wrote:
>>> # castle-game-engine (after changing it to "Architecture:
>>> any"): Running fpmake. If this fails saying that "rtl" is not
>>> found, remember to set FPCDIR environment variable, see
>>> http://wiki.freepascal.org/FPMake . ./fpmake -v -o -Ur The
>>> installer encountered the following error: Could not find unit
>>> directory for dependency package "rtl"
>> 
>> This is a problem with fpmake setup, the message even suggests a
>> fix --- setting FPCDIR environment variable. Although I'm not
>> sure why it's needed, if FPC is installed in default location it
>> should automatically be Ok.
>> 
>> Can you try compiling any example program directly, for example
>> compile fps_game demo using 
>> castle_game_engine/examples/fps_game/fps_game_compile.sh script.
>> This will not use fpmake, it will directly call FPC and the
>> appropriate engine units should be automatically recompiled. This
>> should confirm that the problem is isolated to fpmake approach.
> 
> I am running into this issue now, because I want to upload a fixed
> cge for fpc 3.0.0. I compiled fps_game with the script and that
> runs fine. I tried to export FPCDIR in several locations, but that
> didn't help. Seems like we need to fix fpmake in fpc. Does anybody
> have a good idea how to debug this and what to use as a patch?
> @Michalis, where do YOU set the FPCDIR?
> 

1. First of all, if FPC is the default (system-wide) location, using
$FPCDIR indeed should not be necessary. You can see the defalt
system-wide paths used in packages/fpmkunit/src/fpmkunit.pp , in
TFPCDefaults.CompilerDefaults :

{$ifdef Unix}
  BD:=FixPath(GetEnvironmentVariable('FPCDIR'), False);
  if BD='' then
    begin
      BD:='/usr/local/lib/fpc/'+FCompilerVersion;
      if not DirectoryExists(BD) and
         DirectoryExists('/usr/lib/fpc/'+FCompilerVersion) then
        BD:='/usr/lib/fpc/'+FCompilerVersion;
    end;
{$else unix}

2. As for using $FPCDIR: I found that there's a bug FPC 3.x (3.0.0 and
FPC trunk 3.1.1), $FPCDIR is unfortunately ignored. The workaround is
to use

  ./fpmake --globalunitdir="$(FPCDIR)"

instead of

  ./fpmake

in the Makefile. You can see how I solved it in engine SVN:
http://svn.code.sf.net/p/castle-engine/code/trunk/castle_game_engine/Makefile
.

This makes $FPCDIR work Ok, so I can do:

  $ export FPCDIR=/home/michalis/installed/fpc/current/lib/fpc/3.0.0/
  $ make

The directory pointed to by $FPCDIR should have a "units"
subdirectory, and inside "units" there should be subdirectories for
each architecture-OS with compiled unit files (.o, .ppu files).

Of course, I would like to fix (or at least report) this on the FPC
side of course, but I didn't have time to do it yet.

Regards,
Michalis




More information about the Pkg-pascal-devel mailing list