Skip to content

Commit

Permalink
Changes for legacy Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jul 2, 2023
1 parent 5f02b19 commit 445396d
Show file tree
Hide file tree
Showing 66 changed files with 223 additions and 204 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.0sp-2741(d914776)
[master]v2.2.0s-2745(4c0390f)
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_aixpowerpc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function TAny_AIXPowerPC.GetLibs(Basepath:string): boolean;
const
StaticLibName='libc.a';
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_aixpowerpc64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function TAny_AIXPowerPC64.GetLibs(Basepath:string): boolean;
const
StaticLibName='libc.a';
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_all_wasm32.pas
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TAny_AllWasm32.GetLibs(Basepath:string): boolean;
const
LibName='libc.a';
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

result:=SearchLibrary(Basepath,LibName);
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_amigam68k.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_Amigam68k = class(TCrossInstaller)

function Tany_Amigam68k.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_android_base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function Tany_android.GetLibs(Basepath:string): boolean;
PresetLibPath,aOption:string;
FilesFound,FilesFoundFiltered: TStringList;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_androidjvm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Tany_androidjvm = class(TCrossInstaller)

function Tany_androidjvm.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

FLibsPath:='';
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_apple_base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Tany_apple.GetLibs(Basepath:string): boolean;
Major,Minor,Release:integer;
found:boolean;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_aros386.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_Aros386 = class(TCrossInstaller)

function Tany_Aros386.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_arosarm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_ArosARM = class(TCrossInstaller)

function Tany_ArosARM.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_arosx64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_Arosx64 = class(TCrossInstaller)

function Tany_Arosx64.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_atarim68k.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_atarim68k = class(TCrossInstaller)

function Tany_atarim68k.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_dragonflyx64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tany_dragonflyx64 = class(TCrossInstaller)

function Tany_dragonflyx64.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_embeddedaarch64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function TAny_Embeddedaarch64.GetLibs(Basepath:string): boolean;
S:string;
begin
// Arm-embedded does not need libs by default, but user can add them.
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_embeddedarm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function TAny_Embeddedarm.GetLibs(Basepath:string): boolean;
S:string;
begin
// Arm-embedded does not need libs by default, but user can add them.
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_embeddedavr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function TAny_Embeddedavr.GetLibs(Basepath:string): boolean;
S:string;
begin
// AVR-embedded does not need libs by default, but user can add them.
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_embeddedmipsel.pas
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function TAny_Embeddedmipsel.GetLibs(Basepath:string): boolean;
var
aSubarchName:string;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_freebsd386.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Tany_freebsd386 = class(TCrossInstaller)
function Tany_freebsd386.GetLibs(Basepath:string): boolean;
begin

result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_freebsdaarch64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Tany_freebsdaarch64.GetLibs(Basepath:string): boolean;
var
aVersion:integer;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_freebsdx64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Tany_freebsdx64.GetLibs(Basepath:string): boolean;
var
aVersion:integer;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_freertosarm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function TAny_FreeRTOSArm.GetLibs(Basepath:string): boolean;
aABI:TABI;
S:string;
begin
result:=FLibsFound;
result:=inherited;

if result then exit;

Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_freertosxtensa.pas
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function TAny_FreeRTOSXtensa.GetLibs(Basepath:string): boolean;
aABI:TABI;
ActionNeeded:boolean;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

StaticLibNameESP:='';
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_go32v2i386.pas
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function TAny_go32v2i386.GetLibs(Basepath:string): boolean;
const
LibName='';
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// first search local paths based on libbraries provided for or adviced by fpc itself
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_haiku386.pas
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function Tany_haiku386.GetLibs(Basepath:string): boolean;
const
LibName='libroot.so';
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_haikux64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Tany_haikux64.GetLibs(Basepath:string): boolean;
const
LibName='libroot.so';
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

// begin simple: check presence of library file in basedir
Expand Down
2 changes: 1 addition & 1 deletion sources/crossinstallers/m_any_to_javajvm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Tany_javajvm = class(TCrossInstaller)

function Tany_javajvm.GetLibs(Basepath:string): boolean;
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

FLibsPath:='';
Expand Down
49 changes: 18 additions & 31 deletions sources/crossinstallers/m_any_to_linux_base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -184,32 +184,25 @@ function Tany_linux.GetLibs(Basepath:string): boolean;
SDENDMAGIC='");';
{$ENDIF UNIX}
var
aDirName,aLibName:string;
aLibName:string;
{$IFDEF UNIX}
s,sd:string;
i,j:integer;
{$ENDIF UNIX}
begin
result:=FLibsFound;
result:=inherited;
if result then exit;

if FMUSL then
begin
aDirName:=TargetCPUName+'-musl'+TargetOSName;
aLibName:='libc.musl-'+TargetCPUName+'.so.1';
end
else
begin
aDirName:=DirName;
aLibName:=LIBCFILENAME;
end;
aLibName:=LIBCFILENAME;

if FMUSL then aLibName:='libc.musl-'+TargetCPUName+'.so.1';

// begin simple: check presence of library file in basedir
result:=SearchLibrary(Basepath,aLibName);

// first search local paths based on libbraries provided for or adviced by fpc itself
if not result then
result:=SimpleSearchLibrary(BasePath,aDirName,aLibName);
result:=SimpleSearchLibrary(BasePath,DirName,aLibName);

if result then
begin
Expand Down Expand Up @@ -363,7 +356,6 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
var
AsFile: string;
BinPrefixTry: string;
aDirName: string;
{$IFDEF UNIX}
s: string;
i: integer;
Expand All @@ -373,18 +365,13 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;

if result then exit;

if FMUSL then
aDirName:=TargetCPUName+'-musl'+TargetOSName
else
aDirName:=DirName;

BinPrefixTry:=FBinUtilsPrefix;

AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;

result:=SearchBinUtil(BasePath,AsFile);
if not result then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);


if FMUSL then
Expand All @@ -395,15 +382,15 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
end;
if (not result) then
begin
BinPrefixTry:=TargetCPUName+'-alpine-linux-musl-';
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
end;
end;

Expand All @@ -413,7 +400,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
begin
for i:=Low(UnixBinDirs) to High(UnixBinDirs) do
begin
result:=SearchBinUtil(IncludeTrailingPathDelimiter(UnixBinDirs[i])+aDirName, AsFile);
result:=SearchBinUtil(IncludeTrailingPathDelimiter(UnixBinDirs[i])+DirName, AsFile);
if (not result) then
result:=SearchBinUtil(UnixBinDirs[i], AsFile);
if result then break;
Expand All @@ -433,7 +420,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=ASFILENAME+GetExeExt;
result:=SearchBinUtil(s,AsFile);
if not result then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
end;
end;
{$ENDIF}
Expand All @@ -446,7 +433,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
{$IFDEF UNIX}
if (not result) then
begin
Expand All @@ -465,7 +452,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
{$IFDEF UNIX}
if (not result) then
begin
Expand All @@ -486,7 +473,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
{$IFDEF UNIX}
if (not result) then
begin
Expand All @@ -509,7 +496,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
if (not result) then
begin
for i:=Low(UnixBinDirs) to High(UnixBinDirs) do
Expand All @@ -526,7 +513,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
if (not result) then
begin
for i:=Low(UnixBinDirs) to High(UnixBinDirs) do
Expand All @@ -545,7 +532,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
if (not result) then
begin
for i:=Low(UnixBinDirs) to High(UnixBinDirs) do
Expand All @@ -566,7 +553,7 @@ function Tany_linux.GetBinUtils(Basepath:string): boolean;
AsFile:=BinPrefixTry+ASFILENAME+GetExeExt;
result:=SearchBinUtil(BasePath,AsFile);
if (not result) then
result:=SimpleSearchBinUtil(BasePath,aDirName,AsFile);
result:=SimpleSearchBinUtil(BasePath,DirName,AsFile);
end;

if result then FBinUtilsPrefix:=BinPrefixTry;
Expand Down
Loading

0 comments on commit 445396d

Please sign in to comment.