Skip to content

Commit

Permalink
Improve library scanner on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jul 15, 2023
1 parent e9abc42 commit 0640f89
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
38 changes: 35 additions & 3 deletions fpcuptools/libraryscanner/scannercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ implementation
'/usr/local/lib/aarch64-linux-gnu',
'/lib/aarch64-linux-gnu',
{$endif CPUAARCH64}
{$ifdef CPULOONGARCH}
'/usr/lib/loongarch-linux-gnu',
'/usr/local/lib/loongarch-linux-gnu',
'/lib/loongarch-linux-gnu',
{$endif CPULOONGARCH}
'/usr/lib',
'/usr/local/lib',
'/lib',
Expand Down Expand Up @@ -102,7 +107,11 @@ implementation
);
{$endif}


{$ifdef Windows}
DYNLINKV1='ld-*.so.1';
DYNLINKV2='ld-*.so.2';
DYNLINKV3='ld-*.so.3';
{$else}
{$ifdef CPUX86}
DYNLINKV1='ld-linux.so.1';
DYNLINKV2='ld-linux.so.2';
Expand All @@ -129,9 +138,14 @@ implementation
DYNLINKV2='ld-linux-aarch64.so.2';
DYNLINKV3='ld-linux-aarch64.so.3';
{$endif CPUAARCH64}
{$ifdef CPULOONGARCH}
DYNLINKV1='ld-linux-loongarch-lp64d.so.1';
DYNLINKV2='ld-linux-loongarch-lp64d.so.2';
DYNLINKV3='ld-linux-loongarch-lp64d.so.3';
{$endif CPULOONGARCH}
{$endif}


const FPCLIBS : array [0..45] of string = (
const FPCLIBS : array [0..48] of string = (
'crtbegin.o',
'crtbeginS.o',
'crtend.o',
Expand All @@ -142,6 +156,9 @@ implementation
'Mcrt1.o',
'Scrt1.o',
'grcrt1.o',
'ld.so.1',
'ld.so.2',
'ld.so.3',
DYNLINKV1,
DYNLINKV2,
DYNLINKV3,
Expand Down Expand Up @@ -758,6 +775,21 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
FileName:=sd+DirectorySeparator+aLib;
{$ifdef Windows}
FileName:=StringReplace(FileName,'dummy',FLibraryLocation,[]);
// Do we have a wildcard ?
if (Pos('*',aLib)>0) then
begin
SearchResultList.Clear;
FindAllFiles(SearchResultList,ExtractFileDir(FileName),aLib,false);
if (SearchResultList.Count>0) then
begin
for sr in SearchResultList do
begin
StoreLibrary('['+ExtractFileName(sr)+']');
end;
end;
FileName:='';
break;
end;
{$endif}
if FileExists(FileName) then
begin
Expand Down
2 changes: 1 addition & 1 deletion public/gitrevision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[master]crosslibs_all-2789(46894d9)
[master]crosslibs_all-2790(e9abc42)
3 changes: 1 addition & 2 deletions sources/installermanager.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ procedure TFPCupManager.GetCrossToolsFileName(out BinsFileName,LibsFileName:stri
if (CrossCPU_Target=TCPU.arm) then s:='LinuxARMHF_Ubuntu_1804.zip';
if (CrossCPU_Target=TCPU.x86_64) then s:='LinuxAMD64_Ubuntu_1804.zip';
if (CrossCPU_Target=TCPU.i386) then s:='Linuxi386_Ubuntu_1804.zip';
if (CrossCPU_Target=TCPU.loongarch64) then s:='LinuxLoongarch64_Deepin_0803.zip';
end;
if (CrossOS_Target=TOS.android) then
begin
Expand Down Expand Up @@ -1299,8 +1300,6 @@ procedure TFPCupManager.GetCrossToolsFileName(out BinsFileName,LibsFileName:stri
LibsFileName:=s;
end;



end;

procedure TFPCupManager.GetCrossToolsPath(out BinPath,LibPath:string);
Expand Down

0 comments on commit 0640f89

Please sign in to comment.