Skip to content

Commit

Permalink
More use of new libs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jul 15, 2023
1 parent 1bdbf21 commit 46894d9
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 56 deletions.
44 changes: 20 additions & 24 deletions docs/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,12 @@ dtparam=spi=on

# Comment out the following line if the edges of the desktop appear outside
# the edges of your display
# disable_overscan=1
disable_overscan=1

# If you have issues with audio, you may try uncommenting the following line
# which forces the HDMI output into HDMI mode instead of DVI (which doesn't
# support audio output)
hdmi_drive=2
config_hdmi_boost=4

hdmi_force_hotplug=1

hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=1024 600 60 6 0 0 0
#hdmi_drive=1

gpu_mem_1024=256
hdmi_ignore_cec_init=1
disable_overscan=1
start_x=1
disable_splash=1
hdmi_pixel_encoding=2
gpu_mem_256=112
sdtv_aspect=1
gpu_mem_512=144
sdtv_mode=2
max_usb_current=1

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
Expand All @@ -55,13 +34,30 @@ dtoverlay=dwc2,dr_mode=host
# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the
# default (the kernel is in control of graphics memory with full KMS)
# dtoverlay=vc4-kms-v3d
# dtoverlay=vc4-fkms-v3d
# dtoverlay=vc4-fkms-v3d

# Autoload overlays for any recognized cameras or displays that are attached
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
# the legacy camera stack
# camera_auto_detect=1
# display_auto_detect=1

hdmi_drive=2
config_hdmi_boost=4

hdmi_force_hotplug=1

hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=1024 600 60 6 0 0 0

gpu_mem_1024=256
hdmi_ignore_cec_init=1
start_x=1
disable_splash=1
hdmi_pixel_encoding=2
gpu_mem_256=112
sdtv_aspect=1
gpu_mem_512=144
sdtv_mode=2
max_usb_current=1
67 changes: 67 additions & 0 deletions docs/config.txt.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel

[pi4]
max_framebuffers=2
arm_boost=1

[all]
# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these
# parameters related to the base device-tree they must appear *before* any
# other dtoverlay= specification
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on

# Comment out the following line if the edges of the desktop appear outside
# the edges of your display
# disable_overscan=1

# If you have issues with audio, you may try uncommenting the following line
# which forces the HDMI output into HDMI mode instead of DVI (which doesn't
# support audio output)
hdmi_drive=2
config_hdmi_boost=4

hdmi_force_hotplug=1

hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=1024 600 60 6 0 0 0
#hdmi_drive=1

gpu_mem_1024=256
hdmi_ignore_cec_init=1
disable_overscan=1
start_x=1
disable_splash=1
hdmi_pixel_encoding=2
gpu_mem_256=112
sdtv_aspect=1
gpu_mem_512=144
sdtv_mode=2
max_usb_current=1

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
# such a board)
dtoverlay=dwc2,dr_mode=host

[all]

# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the
# default (the kernel is in control of graphics memory with full KMS)
# dtoverlay=vc4-kms-v3d
# dtoverlay=vc4-fkms-v3d
# dtoverlay=vc4-fkms-v3d

# Autoload overlays for any recognized cameras or displays that are attached
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
# the legacy camera stack
# camera_auto_detect=1
# display_auto_detect=1


73 changes: 43 additions & 30 deletions fpcuptools/libraryscanner/scannercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ TScannerCore = class
FLibraryNotFoundList: TStringList;
FLibraryLocationList: TStringList;
chkQT:boolean;
function StoreLibrary(aLib:string):boolean;
procedure CheckAndAddLibrary(aLib:string);
public
procedure GetAndSaveLibs(Location:string);
Expand All @@ -32,46 +33,48 @@ implementation

const
{$ifdef CPUX86}
UNIXSEARCHDIRS : array [0..9] of string = (
UNIXSEARCHDIRS : array [0..10] of string = (
{$else}
UNIXSEARCHDIRS : array [0..6] of string = (
UNIXSEARCHDIRS : array [0..7] of string = (
{$endif CPUX86}
'/lib',
'/usr/lib',
'/usr/local/lib',
{$ifdef CPUX86}
'/lib/i386-linux-gnu',
'/usr/lib/i386-linux-gnu',
'/usr/local/lib/i386-linux-gnu',
'/lib/i686-linux-gnu',
'/lib/i386-linux-gnu',
'/usr/lib/i686-linux-gnu',
'/usr/local/lib/i686-linux-gnu',
'/lib/i686-linux-gnu',
{$endif CPUX86}
{$ifdef CPUX86_64}
'/lib/x86_64-linux-gnu',
'/usr/lib/x86_64-linux-gnu',
'/usr/local/lib/x86_64-linux-gnu',
'/lib/x86_64-linux-gnu',
{$endif CPUX86_64}
{$ifdef CPUARM}
{$ifdef CPUARMHF}
'/lib/arm-linux-gnueabihf',
'/usr/lib/arm-linux-gnueabihf',
'/usr/local/lib/arm-linux-gnueabihf',
'/lib/arm-linux-gnueabihf',
{$else}
'/lib/arm-linux-gnueabi',
'/usr/lib/arm-linux-gnueabi',
'/usr/local/lib/arm-linux-gnueabi',
'/lib/arm-linux-gnueabi',
{$endif CPUARMHF}
{$endif CPUARM}
{$ifdef CPUAARCH64}
'/lib/aarch64-linux-gnu',
'/usr/lib/aarch64-linux-gnu',
'/usr/local/lib/aarch64-linux-gnu',
'/lib/aarch64-linux-gnu',
{$endif CPUAARCH64}
'/usr/lib',
'/usr/local/lib',
'/lib',
{$ifdef CPU32}
'/usr/lib32',
'/lib32'
{$endif CPU32}
{$ifdef CPU64}
'/usr/lib64',
'/lib64'
{$endif CPU64}
);
Expand Down Expand Up @@ -165,13 +168,13 @@ implementation
const FPCLINKLIBS : array [0..10] of string = (
'ld.so',
'libc.so',
'libm.so',
'libpthread.so',
'libdl.so',
'libgobject-2.0.so',
'libglib-2.0.so',
'libgthread-2.0.so',
'libgmodule-2.0.so',
'libm.so',
'libpthread.so',
'librt.so',
'libz.so'
);
Expand Down Expand Up @@ -703,6 +706,10 @@ function GetDistro(const aID:string=''):string;
result:=t;
end;

function TScannerCore.StoreLibrary(aLib:string):boolean;
begin
result:=(FinalSearchResultList.Add(aLib)<>-1);
end;

procedure TScannerCore.CheckAndAddLibrary(aLib:string);
var
Expand All @@ -728,9 +735,9 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
FileName:=sd+DirectorySeparator+aLib;
if FileExists(FileName) then
begin
FinalSearchResultList.Add('['+ExtractFileName(FileName)+']');
// libc.so might be a text-file, so skip analysis
if ExtractFileName(FileName)='libc.so' then
StoreLibrary('['+ExtractFileName(FileName)+']');
// These files might be a text-file, so skip analysis
if ((ExtractFileName(FileName)='libc.so') OR (ExtractFileName(FileName)='libm.so') OR (ExtractFileName(FileName)='libpthread.so')) then
begin
FileName:='';
break;
Expand All @@ -755,7 +762,7 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
if (i<>-1) then
begin
s:=Trim(Copy(s,i+Length(MAGICSHARED),MaxInt));
if (FinalSearchResultList.Add(s)<>-1) then
if StoreLibrary(s) then
begin
s:=Copy(s,2,Length(s)-2);
CheckAndAddLibrary(s);
Expand All @@ -772,7 +779,7 @@ procedure TScannerCore.CheckAndAddLibrary(aLib:string);
FileName:=GccDirectory+DirectorySeparator+aLib;
if FileExists(FileName) then
begin
FinalSearchResultList.Add('['+aLib+']');
StoreLibrary('['+aLib+']');
FileName:='';
end;
if (Length(FileName)>0) then
Expand Down Expand Up @@ -800,11 +807,11 @@ procedure TScannerCore.GetAndSaveLibs(Location:string);

FinalSearchResultList:=TLookupStringList.Create;
try
for SearchLib in FPCLIBS do
for SearchLib in FPCLINKLIBS do
begin
CheckAndAddLibrary(SearchLib);
end;
for SearchLib in FPCLINKLIBS do
for SearchLib in FPCLIBS do
begin
CheckAndAddLibrary(SearchLib);
end;
Expand All @@ -831,7 +838,7 @@ procedure TScannerCore.GetAndSaveLibs(Location:string);
CheckAndAddLibrary(SearchLib);
end;
end;
FinalSearchResultList.Sort;

FLibraryList.Text:=FinalSearchResultList.Text;

for sl in FinalSearchResultList do
Expand Down Expand Up @@ -886,31 +893,41 @@ procedure TScannerCore.GetAndSaveLibs(Location:string);
aList.Free;
end;

for Index:=Pred(FLibraryLocationList.Count) downto 0 do
// copy the libraries found
for Index:=0 to Pred(FLibraryLocationList.Count) do
begin
FileName:=FLibraryLocationList.Strings[Index];
TargetFile:=ExtractFileName(FileName);
CopyFile(FileName,Location+'libs'+DirectorySeparator+TargetFile,[]);
end;

// if there are any linklibs not found, create them now
for Index:=0 to Pred(FLibraryLocationList.Count) do
begin
FileName:=FLibraryLocationList.Strings[Index];
TargetFile:=ExtractFileName(FileName);

for LinkFile in FPCLINKLIBS do
begin
if (Pos(LinkFile,TargetFile)=1) then
begin
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile);
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile,[]);
break;
end;
end;
for LinkFile in FPCEXTRALIBS do
begin
if (Pos(LinkFile,TargetFile)=1) then
begin
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile);
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile,[]);
break;
end;
end;
for LinkFile in LAZLINKLIBS do
begin
if (Pos(LinkFile,TargetFile)=1) then
begin
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile);
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile,[]);
break;
end;
end;
Expand All @@ -921,16 +938,12 @@ procedure TScannerCore.GetAndSaveLibs(Location:string);
begin
if (Pos(LinkFile,TargetFile)=1) then
begin
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile);
CopyFile(FileName,Location+'libs'+DirectorySeparator+LinkFile,[]);
break;
end;
end;
end;

if CopyFile(FileName,Location+'libs'+DirectorySeparator+TargetFile) then
begin
FLibraryLocationList.Delete(Index);
end;
end;

end;
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-2787(3cb7fd8)
[master]crosslibs_all-2788(1bdbf21)
Loading

0 comments on commit 46894d9

Please sign in to comment.