mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 11:39:09 +02:00
codetools: ppu: splitted rtl group
git-svn-id: trunk@15670 -
This commit is contained in:
parent
b836129186
commit
cc89b8c867
@ -30,8 +30,8 @@ unit PPUGraph;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, PPUParser, CodeTree, AVL_Tree, FileProcs, BasicCodeTools,
|
Classes, SysUtils, dynlibs, PPUParser, CodeTree, AVL_Tree, FileProcs,
|
||||||
CodeGraph, CodeToolManager;
|
BasicCodeTools, CodeGraph, CodeToolManager;
|
||||||
|
|
||||||
const
|
const
|
||||||
FPCPPUGroupPrefix = 'fpc_';
|
FPCPPUGroupPrefix = 'fpc_';
|
||||||
@ -122,7 +122,7 @@ type
|
|||||||
procedure AddFPCGroupsForCurrentCompiler(const BaseDirectory: string);
|
procedure AddFPCGroupsForCurrentCompiler(const BaseDirectory: string);
|
||||||
procedure AddFPCGroups(const FPCPPUBaseDir: string // for example: /usr/lib/fpc/2.2.3/units/i386-linux/
|
procedure AddFPCGroups(const FPCPPUBaseDir: string // for example: /usr/lib/fpc/2.2.3/units/i386-linux/
|
||||||
);
|
);
|
||||||
procedure AddFPCGroup(const Groupname, Directory: string);
|
procedure AddFPCGroup(const BaseGroupname, Directory: string);
|
||||||
function FindGroupWithName(const AName: string): TPPUGroup;
|
function FindGroupWithName(const AName: string): TPPUGroup;
|
||||||
function FindMemberWithUnitName(const AName: string): TPPUMember;
|
function FindMemberWithUnitName(const AName: string): TPPUMember;
|
||||||
function UpdateDependencies: boolean;
|
function UpdateDependencies: boolean;
|
||||||
@ -209,7 +209,7 @@ begin
|
|||||||
if PPU=nil then PPU:=TPPU.Create;
|
if PPU=nil then PPU:=TPPU.Create;
|
||||||
PPU.LoadFromFile(PPUFilename);
|
PPU.LoadFromFile(PPUFilename);
|
||||||
debugln('================================================================');
|
debugln('================================================================');
|
||||||
DebugLn(['TPPUMember.UpdateDependencies Group=',Group.Name,' UnitName=',Unitname,' Filename=',PPUFilename]);
|
DebugLn(['TPPUMember.UpdatePPU Group=',Group.Name,' UnitName=',Unitname,' Filename=',PPUFilename]);
|
||||||
//PPU.Dump('');
|
//PPU.Dump('');
|
||||||
PPU.GetMainUsesSectionNames(MainUses);
|
PPU.GetMainUsesSectionNames(MainUses);
|
||||||
if MainUses.Count>0 then
|
if MainUses.Count>0 then
|
||||||
@ -395,7 +395,6 @@ function TPPUGroup.UpdateDependencies: boolean;
|
|||||||
AVLNode:=FMembers.FindLowest;
|
AVLNode:=FMembers.FindLowest;
|
||||||
while AVLNode<>nil do begin
|
while AVLNode<>nil do begin
|
||||||
Member:=TPPUMember(AVLNode.Data);
|
Member:=TPPUMember(AVLNode.Data);
|
||||||
if not Member.UpdatePPU then exit;
|
|
||||||
if Main then
|
if Main then
|
||||||
AddSectionDependencies(Member,Member.MainUses)
|
AddSectionDependencies(Member,Member.MainUses)
|
||||||
else
|
else
|
||||||
@ -433,8 +432,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TPPUGroup.UpdateLoader: boolean;
|
function TPPUGroup.UpdateLoader: boolean;
|
||||||
const
|
|
||||||
LibExtension = '.so';
|
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
GraphNode: TCodeGraphNode;
|
GraphNode: TCodeGraphNode;
|
||||||
@ -442,7 +439,7 @@ var
|
|||||||
Group: TPPUGroup;
|
Group: TPPUGroup;
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
LibName:=Name+LibExtension;
|
LibName:=Name+'.'+SharedSuffix;
|
||||||
DebugLn(['TPPUGroup.UpdateLoader Group=',Name,' LibName=',LibName]);
|
DebugLn(['TPPUGroup.UpdateLoader Group=',Name,' LibName=',LibName]);
|
||||||
// needed groups in topological order
|
// needed groups in topological order
|
||||||
DebugLn(['Required groups: ================================']);
|
DebugLn(['Required groups: ================================']);
|
||||||
@ -621,13 +618,14 @@ begin
|
|||||||
SysUtils.FindClose(FileInfo);
|
SysUtils.FindClose(FileInfo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPPUGroups.AddFPCGroup(const Groupname, Directory: string);
|
procedure TPPUGroups.AddFPCGroup(const BaseGroupname, Directory: string);
|
||||||
var
|
var
|
||||||
FileInfo: TSearchRec;
|
FileInfo: TSearchRec;
|
||||||
Filename: String;
|
Filename: String;
|
||||||
UnitName: String;
|
UnitName: String;
|
||||||
Group: TPPUGroup;
|
Group: TPPUGroup;
|
||||||
Member: TPPUMember;
|
Member: TPPUMember;
|
||||||
|
GroupName: String;
|
||||||
begin
|
begin
|
||||||
//DebugLn(['TPPUGroups.AddFPCGroup ',Groupname,' ',Directory]);
|
//DebugLn(['TPPUGroups.AddFPCGroup ',Groupname,' ',Directory]);
|
||||||
Group:=nil;
|
Group:=nil;
|
||||||
@ -645,10 +643,25 @@ begin
|
|||||||
DebugLn(['TPPUGroups.AddFPCGroup NOTE: invalid ppu name: ',Filename]);
|
DebugLn(['TPPUGroups.AddFPCGroup NOTE: invalid ppu name: ',Filename]);
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
if Group=nil then begin
|
GroupName:=BaseGroupName;
|
||||||
DebugLn(['TPPUGroups.AddFPCGroup Creating group ',Groupname]);
|
if BaseGroupname=FPCPPUGroupPrefix+'rtl' then begin
|
||||||
Group:=AddGroup(Groupname);
|
if (CompareFilenames(FileInfo.Name,'system.ppu')=0)
|
||||||
|
or (CompareFilenames(FileInfo.Name,'dl.ppu')=0)
|
||||||
|
then begin
|
||||||
|
// the RTL should only contain the minimum for dynamic libs.
|
||||||
|
// It looks strange to exclude the dynlibs.ppu, but
|
||||||
|
// the dynlibs.ppu uses objpas.ppu, which might not be needed.
|
||||||
|
// But: do they hurt?
|
||||||
|
GroupName:=BaseGroupName+'_system';
|
||||||
|
end else begin
|
||||||
|
// all other ppu of the rtl directory need to be loaded separately
|
||||||
|
// => put them into separate groups
|
||||||
|
GroupName:=BaseGroupName+'_'+lowercase(ExtractFileNameOnly(FileInfo.Name));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
if FindGroupWithName(GroupName)=nil then
|
||||||
|
DebugLn(['TPPUGroups.AddFPCGroup Creating group ',GroupName]);
|
||||||
|
Group:=AddGroup(GroupName);
|
||||||
Member:=Group.AddMember(UnitName);
|
Member:=Group.AddMember(UnitName);
|
||||||
Member.PPUFilename:=Filename;
|
Member.PPUFilename:=Filename;
|
||||||
until SysUtils.FindNext(FileInfo)<>0;
|
until SysUtils.FindNext(FileInfo)<>0;
|
||||||
|
Loading…
Reference in New Issue
Block a user