|
@@ -21,16 +21,17 @@ interface
|
|
dos,
|
|
dos,
|
|
{$ifdef Unix}
|
|
{$ifdef Unix}
|
|
{$ifdef VER1_0}
|
|
{$ifdef VER1_0}
|
|
- {$ifdef linux}
|
|
|
|
|
|
+ {$ifdef linux}
|
|
{$ifndef BSD}
|
|
{$ifndef BSD}
|
|
linux,
|
|
linux,
|
|
{$endif}
|
|
{$endif}
|
|
- {$endif}
|
|
|
|
- {$ifdef BSD}
|
|
|
|
|
|
+ {$endif}
|
|
|
|
+ {$ifdef BSD}
|
|
Linux,
|
|
Linux,
|
|
- {$endif}
|
|
|
|
|
|
+ {$endif}
|
|
{$else}
|
|
{$else}
|
|
- unix,
|
|
|
|
|
|
+ baseunix,
|
|
|
|
+ unix,
|
|
{$endif}
|
|
{$endif}
|
|
{$endif}
|
|
{$endif}
|
|
sysutils,classes,
|
|
sysutils,classes,
|
|
@@ -96,7 +97,7 @@ interface
|
|
{ netbsd } ( true, true, false, false, false ),
|
|
{ netbsd } ( true, true, false, false, false ),
|
|
{ amiga } ( false, true, false, false, false ),
|
|
{ amiga } ( false, true, false, false, false ),
|
|
{ atari } ( false, true, false, false, false ),
|
|
{ atari } ( false, true, false, false, false ),
|
|
- { sunos } ( true, false, false, true, false ),
|
|
|
|
|
|
+ { sunos } ( true, false, false, true, false ),
|
|
{ qnx } ( true, false, false, false, false ),
|
|
{ qnx } ( true, false, false, false, false ),
|
|
{ netware } ( true, false, false, false, false ),
|
|
{ netware } ( true, false, false, false, false ),
|
|
{ openbsd } ( true, true, false, false, false ),
|
|
{ openbsd } ( true, true, false, false, false ),
|
|
@@ -584,11 +585,11 @@ implementation
|
|
procedure TFPCMake.Init;
|
|
procedure TFPCMake.Init;
|
|
var
|
|
var
|
|
t : ttarget;
|
|
t : ttarget;
|
|
- c : tcpu;
|
|
|
|
|
|
+ c : tcpu;
|
|
begin
|
|
begin
|
|
FSections:=TDictionary.Create;
|
|
FSections:=TDictionary.Create;
|
|
for t:=low(ttarget) to high(ttarget) do
|
|
for t:=low(ttarget) to high(ttarget) do
|
|
- for c:=low(tcpu) to high(tcpu) do
|
|
|
|
|
|
+ for c:=low(tcpu) to high(tcpu) do
|
|
FRequireList[t,c]:=TStringList.Create;
|
|
FRequireList[t,c]:=TStringList.Create;
|
|
FVariables:=TKeyValue.Create;
|
|
FVariables:=TKeyValue.Create;
|
|
FCommentChars:=[';','#'];
|
|
FCommentChars:=[';','#'];
|
|
@@ -608,7 +609,7 @@ implementation
|
|
destructor TFPCMake.Destroy;
|
|
destructor TFPCMake.Destroy;
|
|
var
|
|
var
|
|
t : ttarget;
|
|
t : ttarget;
|
|
- c : tcpu;
|
|
|
|
|
|
+ c : tcpu;
|
|
begin
|
|
begin
|
|
FSections.Free;
|
|
FSections.Free;
|
|
for t:=low(ttarget) to high(ttarget) do
|
|
for t:=low(ttarget) to high(ttarget) do
|
|
@@ -806,7 +807,7 @@ implementation
|
|
procedure TFPCMake.CreateExportSection;
|
|
procedure TFPCMake.CreateExportSection;
|
|
var
|
|
var
|
|
t : TTarget;
|
|
t : TTarget;
|
|
- c : TCpu;
|
|
|
|
|
|
+ c : TCpu;
|
|
begin
|
|
begin
|
|
{ Don't create a section twice }
|
|
{ Don't create a section twice }
|
|
if FExportSec<>nil then
|
|
if FExportSec<>nil then
|
|
@@ -821,7 +822,7 @@ implementation
|
|
FExportSec.AddKey('version',FPackageVersion);
|
|
FExportSec.AddKey('version',FPackageVersion);
|
|
{ Add required packages }
|
|
{ Add required packages }
|
|
for t:=low(TTarget) to high(TTarget) do
|
|
for t:=low(TTarget) to high(TTarget) do
|
|
- for c:=low(TCpu) to high(TCpu) do
|
|
|
|
|
|
+ for c:=low(TCpu) to high(TCpu) do
|
|
FExportSec.AddKey('require'+TargetSuffix[t]+CpuSuffix[c],FPackageSec['require'+TargetSuffix[t]+CpuSuffix[c]]);
|
|
FExportSec.AddKey('require'+TargetSuffix[t]+CpuSuffix[c],FPackageSec['require'+TargetSuffix[t]+CpuSuffix[c]]);
|
|
{ Unit dir }
|
|
{ Unit dir }
|
|
{FExportSec.AddKey('unitdir','$(UNITSDIR)/'+Lowercase(PackageName));}
|
|
{FExportSec.AddKey('unitdir','$(UNITSDIR)/'+Lowercase(PackageName));}
|
|
@@ -915,8 +916,8 @@ implementation
|
|
LoadRequires(t,c,ReqFPCMake);
|
|
LoadRequires(t,c,ReqFPCMake);
|
|
{ Add the current requirements to our parents requirements }
|
|
{ Add the current requirements to our parents requirements }
|
|
s:=Trim(ReqFPCMake.GetVariable('require_packages',true)+' '+
|
|
s:=Trim(ReqFPCMake.GetVariable('require_packages',true)+' '+
|
|
- ReqFPCMake.GetVariable('require_packages'+targetsuffix[t],true)+' '+
|
|
|
|
- ReqFPCMake.GetVariable('require_packages'+targetsuffix[t]+cpusuffix[c],true));
|
|
|
|
|
|
+ ReqFPCMake.GetVariable('require_packages'+targetsuffix[t],true)+' '+
|
|
|
|
+ ReqFPCMake.GetVariable('require_packages'+targetsuffix[t]+cpusuffix[c],true));
|
|
SetVariable('require_packages'+targetsuffix[t]+cpusuffix[c],s,true);
|
|
SetVariable('require_packages'+targetsuffix[t]+cpusuffix[c],s,true);
|
|
if ReqFPCMake.GetVariable('require_libc',false)<>'' then
|
|
if ReqFPCMake.GetVariable('require_libc',false)<>'' then
|
|
SetVariable('require_libc','y',false);
|
|
SetVariable('require_libc','y',false);
|
|
@@ -936,8 +937,8 @@ implementation
|
|
begin
|
|
begin
|
|
{ packages }
|
|
{ packages }
|
|
s:=Trim(FromFPCMake.GetVariable('require_packages',true)+' '+
|
|
s:=Trim(FromFPCMake.GetVariable('require_packages',true)+' '+
|
|
- FromFPCMake.GetVariable('require_packages'+TargetSuffix[t],true)+' '+
|
|
|
|
- FromFPCMake.GetVariable('require_packages'+TargetSuffix[t]+CpuSuffix[c],true));
|
|
|
|
|
|
+ FromFPCMake.GetVariable('require_packages'+TargetSuffix[t],true)+' '+
|
|
|
|
+ FromFPCMake.GetVariable('require_packages'+TargetSuffix[t]+CpuSuffix[c],true));
|
|
Verbose(FPCMakeDebug,'Required packages for '+TargetStr[t]+'-'+CpuStr[c]+': '+s);
|
|
Verbose(FPCMakeDebug,'Required packages for '+TargetStr[t]+'-'+CpuStr[c]+': '+s);
|
|
repeat
|
|
repeat
|
|
reqname:=GetToken(s,' ');
|
|
reqname:=GetToken(s,' ');
|
|
@@ -965,8 +966,8 @@ implementation
|
|
until false;
|
|
until false;
|
|
{ sub dirs }
|
|
{ sub dirs }
|
|
s:=Trim(FromFPCMake.GetVariable('target_dirs',true)+' '+
|
|
s:=Trim(FromFPCMake.GetVariable('target_dirs',true)+' '+
|
|
- FromFPCMake.GetVariable('target_dirs'+TargetSuffix[t],true)+' '+
|
|
|
|
- FromFPCMake.GetVariable('target_dirs'+TargetSuffix[t]+CpuSuffix[c],true));
|
|
|
|
|
|
+ FromFPCMake.GetVariable('target_dirs'+TargetSuffix[t],true)+' '+
|
|
|
|
+ FromFPCMake.GetVariable('target_dirs'+TargetSuffix[t]+CpuSuffix[c],true));
|
|
Verbose(FPCMakeDebug,'Required dirs for '+TargetStr[t]+'-'+CpuStr[c]+': '+s);
|
|
Verbose(FPCMakeDebug,'Required dirs for '+TargetStr[t]+'-'+CpuStr[c]+': '+s);
|
|
repeat
|
|
repeat
|
|
reqdir:=GetToken(s,' ');
|
|
reqdir:=GetToken(s,' ');
|
|
@@ -982,7 +983,7 @@ implementation
|
|
function CheckVar(const s:string):boolean;
|
|
function CheckVar(const s:string):boolean;
|
|
var
|
|
var
|
|
t : ttarget;
|
|
t : ttarget;
|
|
- c : tcpu;
|
|
|
|
|
|
+ c : tcpu;
|
|
begin
|
|
begin
|
|
result:=false;
|
|
result:=false;
|
|
if GetVariable(s,false)<>'' then
|
|
if GetVariable(s,false)<>'' then
|
|
@@ -1001,16 +1002,16 @@ implementation
|
|
for c:=low(tcpu) to high(tcpu) do
|
|
for c:=low(tcpu) to high(tcpu) do
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
begin
|
|
begin
|
|
- result:=true;
|
|
|
|
- exit;
|
|
|
|
- end;
|
|
|
|
|
|
+ result:=true;
|
|
|
|
+ exit;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
s : string;
|
|
s : string;
|
|
t : ttarget;
|
|
t : ttarget;
|
|
- c : tcpu;
|
|
|
|
|
|
+ c : tcpu;
|
|
begin
|
|
begin
|
|
{ Check FPCMake version }
|
|
{ Check FPCMake version }
|
|
s:=GetVariable('require_fpcmake',false);
|
|
s:=GetVariable('require_fpcmake',false);
|
|
@@ -1031,11 +1032,11 @@ implementation
|
|
{ Load recursively all required packages starting with this Makefile.fpc }
|
|
{ Load recursively all required packages starting with this Makefile.fpc }
|
|
for t:=low(TTarget) to high(TTarget) do
|
|
for t:=low(TTarget) to high(TTarget) do
|
|
if t in FIncludeTargets then
|
|
if t in FIncludeTargets then
|
|
- begin
|
|
|
|
- for c:=low(TCpu) to high(TCpu) do
|
|
|
|
|
|
+ begin
|
|
|
|
+ for c:=low(TCpu) to high(TCpu) do
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
LoadRequires(t,c,self);
|
|
LoadRequires(t,c,self);
|
|
- end;
|
|
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -1052,8 +1053,8 @@ implementation
|
|
i : integer;
|
|
i : integer;
|
|
begin
|
|
begin
|
|
s:=Sec['packages']+' '+
|
|
s:=Sec['packages']+' '+
|
|
- Sec['packages'+TargetSuffix[t]]+' '+
|
|
|
|
- Sec['packages'+TargetSuffix[t]+CpuSuffix[c]];
|
|
|
|
|
|
+ Sec['packages'+TargetSuffix[t]]+' '+
|
|
|
|
+ Sec['packages'+TargetSuffix[t]+CpuSuffix[c]];
|
|
repeat
|
|
repeat
|
|
ReqName:=GetToken(s,' ');
|
|
ReqName:=GetToken(s,' ');
|
|
if ReqName='' then
|
|
if ReqName='' then
|
|
@@ -1088,7 +1089,7 @@ implementation
|
|
i : integer;
|
|
i : integer;
|
|
RSec : TFPCMakeSection;
|
|
RSec : TFPCMakeSection;
|
|
t : ttarget;
|
|
t : ttarget;
|
|
- c : tcpu;
|
|
|
|
|
|
+ c : tcpu;
|
|
begin
|
|
begin
|
|
Result:=false;
|
|
Result:=false;
|
|
if GetVariable('require_libc',false)<>'' then
|
|
if GetVariable('require_libc',false)<>'' then
|
|
@@ -1101,7 +1102,7 @@ implementation
|
|
begin
|
|
begin
|
|
for c:=low(tcpu) to high(tcpu) do
|
|
for c:=low(tcpu) to high(tcpu) do
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
if (TargetCpuPossible[t,c]) and (c in FIncludeCpus) then
|
|
- begin
|
|
|
|
|
|
+ begin
|
|
for i:=0 to RequireList[t,c].Count-1 do
|
|
for i:=0 to RequireList[t,c].Count-1 do
|
|
begin
|
|
begin
|
|
RSec:=TFPCMakeSection(FSections[RequireList[t,c][i]+'_require']);
|
|
RSec:=TFPCMakeSection(FSections[RequireList[t,c][i]+'_require']);
|
|
@@ -1112,7 +1113,7 @@ implementation
|
|
Result:=true;
|
|
Result:=true;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
- end;
|
|
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1158,7 +1159,7 @@ implementation
|
|
{$ifndef NO_UNIX_UNIT}
|
|
{$ifndef NO_UNIX_UNIT}
|
|
if FileExists('/usr/local/bin/ppc386') then
|
|
if FileExists('/usr/local/bin/ppc386') then
|
|
begin
|
|
begin
|
|
- s:=ExtractFilePath(ReadLink('/usr/local/bin/ppc386'));
|
|
|
|
|
|
+ s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadlink{$endif}('/usr/local/bin/ppc386'));
|
|
if s<>'' then
|
|
if s<>'' then
|
|
begin
|
|
begin
|
|
if s[length(s)]='/' then
|
|
if s[length(s)]='/' then
|
|
@@ -1170,7 +1171,7 @@ implementation
|
|
begin
|
|
begin
|
|
if FileExists('/usr/bin/ppc386') then
|
|
if FileExists('/usr/bin/ppc386') then
|
|
begin
|
|
begin
|
|
- s:=ExtractFilePath(ReadLink('/usr/bin/ppc386'));
|
|
|
|
|
|
+ s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}('/usr/bin/ppc386'));
|
|
if s<>'' then
|
|
if s<>'' then
|
|
begin
|
|
begin
|
|
if s[length(s)]='/' then
|
|
if s[length(s)]='/' then
|
|
@@ -1554,7 +1555,10 @@ implementation
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.32 2003-05-20 23:54:45 florian
|
|
|
|
|
|
+ Revision 1.33 2003-09-27 13:00:30 peter
|
|
|
|
+ * fixed for unix
|
|
|
|
+
|
|
|
|
+ Revision 1.32 2003/05/20 23:54:45 florian
|
|
+ darwin support added
|
|
+ darwin support added
|
|
|
|
|
|
Revision 1.31 2003/04/24 23:21:01 peter
|
|
Revision 1.31 2003/04/24 23:21:01 peter
|