Skip to content

Commit

Permalink
BSD changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jul 16, 2023
1 parent 0640f89 commit 7c3771b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 16 deletions.
54 changes: 39 additions & 15 deletions fpcuptools/libraryscanner/scannercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ implementation
);
{$endif}

{$if defined(FreeBSD) OR defined(NetBSD) OR defined(OenBSD) OR defined(DragonFly)}
BSDSEARCHDIRS : array [0..5] of string = (
'/lib',
'/libexec',
'/usr/lib',
'/usr/local/lib',
'/usr/local/lib/qt5',
'/usr/local/lib/qt6'
);
{$endif}

{$ifdef Windows}
WINDOWSSEARCHDIRS : array [0..0] of string = (
'dummy'
Expand All @@ -112,6 +123,11 @@ implementation
DYNLINKV2='ld-*.so.2';
DYNLINKV3='ld-*.so.3';
{$else}
{$if defined(FreeBSD) OR defined(NetBSD) OR defined(OenBSD) OR defined(DragonFly)}
DYNLINKV1='ld-elf.so.1';
DYNLINKV2='ld-elf.so.2';
DYNLINKV3='ld-elf.so.3';
{$else}
{$ifdef CPUX86}
DYNLINKV1='ld-linux.so.1';
DYNLINKV2='ld-linux.so.2';
Expand All @@ -123,15 +139,15 @@ implementation
DYNLINKV3='ld-linux-x86-64.so.3';
{$endif CPUX86_64}
{$ifdef CPUARM}
{$ifdef CPUARMHF}
DYNLINKV1='ld-linux-armhf.so.1';
DYNLINKV2='ld-linux-armhf.so.2';
DYNLINKV3='ld-linux-armhf.so.3';
{$else}
DYNLINKV1='ld-linux.so.1';
DYNLINKV2='ld-linux.so.2';
DYNLINKV3='ld-linux.so.3';
{$endif CPUARMHF}
{$ifdef CPUARMHF}
DYNLINKV1='ld-linux-armhf.so.1';
DYNLINKV2='ld-linux-armhf.so.2';
DYNLINKV3='ld-linux-armhf.so.3';
{$else}
DYNLINKV1='ld-linux.so.1';
DYNLINKV2='ld-linux.so.2';
DYNLINKV3='ld-linux.so.3';
{$endif CPUARMHF}
{$endif CPUARM}
{$ifdef CPUAARCH64}
DYNLINKV1='ld-linux-aarch64.so.1';
Expand All @@ -144,8 +160,9 @@ implementation
DYNLINKV3='ld-linux-loongarch-lp64d.so.3';
{$endif CPULOONGARCH}
{$endif}
{$endif}

const FPCLIBS : array [0..48] of string = (
const FPCLIBS : array [0..47] of string = (
'crtbegin.o',
'crtbeginS.o',
'crtend.o',
Expand All @@ -164,8 +181,7 @@ implementation
DYNLINKV3,
'libanl.so.1',
'libcrypt.so.1',
'libc.so.6',
'libc.so.7',
'libc.so.*',
'libc_nonshared.a',
'libgcc.a',
'libdb1.so.2',
Expand Down Expand Up @@ -763,7 +779,11 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
{$ifdef Haiku}
for sd in HAIKUSEARCHDIRS do
{$else}
for sd in UNIXSEARCHDIRS do
{$if defined(FreeBSD) OR defined(NetBSD) OR defined(OenBSD) OR defined(DragonFly)}
for sd in BSDSEARCHDIRS do
{$else}
for sd in UNIXSEARCHDIRS do
{$endif}
{$endif}
{$endif}
begin
Expand All @@ -775,6 +795,7 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
FileName:=sd+DirectorySeparator+aLib;
{$ifdef Windows}
FileName:=StringReplace(FileName,'dummy',FLibraryLocation,[]);
{$endif}
// Do we have a wildcard ?
if (Pos('*',aLib)>0) then
begin
Expand All @@ -790,7 +811,6 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
FileName:='';
break;
end;
{$endif}
if FileExists(FileName) then
begin
StoreLibrary('['+ExtractFileName(FileName)+']');
Expand Down Expand Up @@ -912,7 +932,11 @@ procedure TScannerCore.GetAndSaveLibs(Location:string);
{$ifdef Haiku}
for SearchDir in HAIKUSEARCHDIRS do
{$else}
for SearchDir in UNIXSEARCHDIRS do
{$if defined(FreeBSD) OR defined(NetBSD) OR defined(OenBSD) OR defined(DragonFly)}
for SearchDir in BSDSEARCHDIRS do
{$else}
for SearchDir in UNIXSEARCHDIRS do
{$endif}
{$endif}
{$endif}
begin
Expand Down
29 changes: 29 additions & 0 deletions fpcuptools/libraryscanner/scannergui.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,35 @@
</Linking>
</CompilerOptions>
</Item>
<Item Name="FreeBSDAMD64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="bin\$NameOnly($(ProjFile))-$(TargetCPU)-$(TargetOS)"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="freebsd"/>
<Optimizations>
<OptimizationLevel Value="2"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<DebugInfoType Value="dsDwarf2"/>
<UseLineInfoUnit Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
Expand Down
6 changes: 6 additions & 0 deletions installscripts/freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ sudo pkg install -y liberation-fonts-ttf
sudo pkg install -y gtkglext
sudo pkg install -y gtk3

sudo pkg install -y sdl2
sudo pkg install -y sdl2_image
sudo pkg install -y sdl2_mixer
sudo pkg install -y sdl2_net
sudo pkg install -y sdl2_ttf

sudo pkg install -y qt5
sudo pkg install -y qt5-webkit
sudo pkg install -y qt5-x11extras
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-2790(e9abc42)
[master]crosslibs_all-2791(0640f89)

0 comments on commit 7c3771b

Please sign in to comment.