[fpc-pascal] Where is fpmkconv?

Darius Blaszijk dhkblaszyk at zeelandnet.nl
Sun Aug 12 09:51:09 CEST 2007


Vincent Snijders wrote:
>>>> I would say just replace the macros with {$I %FPCTARGETOS%} and {$I 
>>>> %FPCTARGETCPU%} but how do others feel?
>>>
>>> I think that won't work for cross compilation. It returns the 
>>> targetos where fpmake s running, not the targetos you want to 
>>> compile too.
>>>
>> Are you shure? I mean once you have cross compiled the compiler, rtl 
>> and the lot using FPCTARGETOS or FPCTARGETCPU would yield the right 
>> information for that given compiler and rtl and the lot, not? Or do 
>> they give the actual system information? (which does not seem logical)
>
> No, I am not sure, feel free to test and proof otherwise.
I can't actually cross compile here, so I will never be able to 
determine who's right unfortunately.

> Suppose I am running on i386-linux and want to compile for i386-win32.
>
> I compile fpmake which has {$I %FPCTARGETOS%} in its source. Suppose I 
> compile fpmake for i386-win32, then it will contain the correct string 
> for the unit path. Unfortunately, I cannot run that fpmake on my linux 
> host, because it is compiled for win32.
>
> So it is necessary to set fpctarget when compiling fpmake to the os of 
> the host compiles the actual project using fpmake (i386-linux). In 
> that case the unit dirs are only correct if you don't cross compile.
 Sorry but I don't actually understand what you mean here. Is it that 
you mean that the following happens?

If Host = i386-linux and Target = i386-win32 then {$I %FPCTARGETOS%} = 
linux?
Instead of the expected {$I %FPCTARGETOS%} = win. Which is ok because 
the target IS i386-win32.

You never will run a "target" binary on the "host", unless the two are 
equal (which is normally the case). And therefore the FPC compiler info 
is always usable.

I'm not posing a proof here, but rather a Lemma ;)

Darius



More information about the fpc-pascal mailing list