Skip to content

Commit

Permalink
Even better handling of Darwin cross-compiler naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jul 5, 2023
1 parent a5dd0a8 commit 9bfefe0
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 157 deletions.
2 changes: 1 addition & 1 deletion public/gitrevision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[master]v2.2.0s-2757(bc6bba2)
[master]v2.2.0s-2758(a5dd0a8)
20 changes: 4 additions & 16 deletions sources/installercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ TInstaller = class(TObject)
{$IFDEF UNIX}
FUseCompilerWrapper : boolean;
{$ENDIF}
function GetDefaultCompilerFilename(const TargetCPU: TCPU; const Cross: boolean): string;
private
FURL : string;
FUltibo : boolean;
Expand Down Expand Up @@ -403,7 +404,6 @@ TInstaller = class(TObject)
function GetCrossInstaller: TCrossInstaller;
function GetFullVersionString:string;
function GetFullVersion:dword;
function GetDefaultCompilerFilename(const TargetCPU: TCPU; Cross: boolean): string;
function GetInstallerClass(aClassToFind:TClass):boolean;
function IsFPCInstaller:boolean;
function IsLazarusInstaller:boolean;
Expand Down Expand Up @@ -4074,31 +4074,19 @@ function TInstaller.GetFPCConfigPath(const aCFG:string):string;
result:=result+aCFG;
end;

function TInstaller.GetDefaultCompilerFilename(const TargetCPU: TCPU; Cross: boolean): string;
function TInstaller.GetDefaultCompilerFilename(const TargetCPU: TCPU; const Cross: boolean): string;
var
s:string;
begin
s:='fpc';
if TargetCPU<>TCPU.cpuNone then
begin
if Cross then
begin
// See fpc.pp
{$ifndef darwin}
s:='ppcross'+ppcSuffix[TargetCPU]
{$else not darwin}
{ the mach-o format supports "fat" binaries whereby }
{ a single executable contains machine code for }
{ several architectures -> it is counter-intuitive }
{ and non-standard to use different binary names }
{ for cross-compilers vs. native compilers }
s:='ppc'+ppcSuffix[TargetCPU];
{$endif not darwin}
end
else
s:='ppc'+ppcSuffix[TargetCPU];
end;
Result:=s+GetExeExt;
result:=s+GetExeExt;
end;

function TInstaller.GetCompilerName(Cpu_Target:TCPU):string;
Expand Down Expand Up @@ -4126,7 +4114,7 @@ function TInstaller.GetCompilerName(Cpu_Target:string):string;

function TInstaller.GetCrossCompilerName(Cpu_Target:TCPU):string;
begin
if Cpu_Target<>TCPU.jvm
if (Cpu_Target<>TCPU.jvm)
then result:=GetDefaultCompilerFilename(Cpu_Target,true)
else result:=GetDefaultCompilerFilename(Cpu_Target,false);
end;
Expand Down
Loading

0 comments on commit 9bfefe0

Please sign in to comment.