[fpc-pascal] Where is fpmkconv?

Vincent Snijders vsnijders at quicknet.nl
Sat Aug 11 23:24:08 CEST 2007


Darius Blaszijk schreef:
> 
> 
> Vincent Snijders wrote:
>> Darius Blaszijk schreef:
>>> Do we need to use a "Case Installer.OS of" construct or can we 
>>> implement$(CPU_TARGET) and $(OS_TARGET) as functions that return a 
>>> string with the current targets?
>>
>>> 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.

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.

It is almost a proof :-)

Vincent



More information about the fpc-pascal mailing list