* separate compiler setting for compiling fpmake.pp

* first auto-detected fpc is used for compiling fpmake.pp

git-svn-id: trunk@6567 -
This commit is contained in:
peter 2007-02-19 22:20:43 +00:00
parent c9a2067b61
commit 7fa93d8b1a
3 changed files with 26 additions and 9 deletions

View File

@ -297,8 +297,8 @@ var
Args : TActionArgs; Args : TActionArgs;
OldCurrDir : String; OldCurrDir : String;
begin begin
LoadGlobalDefaults;
OldCurrDir:=GetCurrentDir; OldCurrDir:=GetCurrentDir;
LoadGlobalDefaults;
Try Try
ProcessCommandLine; ProcessCommandLine;
MaybeCreateLocalDirs; MaybeCreateLocalDirs;

View File

@ -76,8 +76,8 @@ begin
if Not HaveFPMake then if Not HaveFPMake then
Error(SErrMissingFPMake); Error(SErrMissingFPMake);
{ Call compiler } { Call compiler }
C:=Defaults.Compiler; C:=Defaults.FPMakeCompiler;
O:=FPmakeSrc; O:='-vi -n -Fu'+Defaults.FPMakeUnitDir+' -Fu'+Defaults.FPMakeUnitDir+'..'+PathDelim+'rtl'+PathDelim+' '+FPmakeSrc;
If ExecuteProcess(C,O)<>0 then If ExecuteProcess(C,O)<>0 then
Error(SErrFailedToCompileFPCMake) Error(SErrFailedToCompileFPCMake)
end end
@ -112,14 +112,14 @@ end;
function TFPMakeRunnerBuild.Execute(const Args:TActionArgs):boolean; function TFPMakeRunnerBuild.Execute(const Args:TActionArgs):boolean;
begin begin
result:=(RunFPMake('--build')=0); result:=(RunFPMake('build')=0);
end; end;
function TFPMakeRunnerInstall.Execute(const Args:TActionArgs):boolean; function TFPMakeRunnerInstall.Execute(const Args:TActionArgs):boolean;
begin begin
result:=(RunFPMake('--install')=0); result:=(RunFPMake('install')=0);
end; end;

View File

@ -41,6 +41,9 @@ Type
FCompilerOS: TOS; FCompilerOS: TOS;
FCompilerVersion : String; FCompilerVersion : String;
FInstallDir : String; FInstallDir : String;
// Compiler settings for compiling FPMake.pp
FFPMakeCompiler : String;
FFPMakeUnitDir : String;
function GetOptString(Index: integer): String; function GetOptString(Index: integer): String;
procedure SetOptString(Index: integer; const AValue: String); procedure SetOptString(Index: integer; const AValue: String);
procedure SetCompilerCPU(const AValue: TCPU); procedure SetCompilerCPU(const AValue: TCPU);
@ -75,6 +78,8 @@ Type
Property DefaultVerbosity : String Index 11 Read GetOptString Write SetOptString; Property DefaultVerbosity : String Index 11 Read GetOptString Write SetOptString;
Property PackagesDir : String Index 12 Read GetOptString Write SetOptString; Property PackagesDir : String Index 12 Read GetOptString Write SetOptString;
Property CompilerConfigDir : String Index 13 Read GetOptString Write SetOptString; Property CompilerConfigDir : String Index 13 Read GetOptString Write SetOptString;
Property FPMakeCompiler : String Index 14 Read GetOptString Write SetOptString;
Property FPMakeUnitDir : String Index 15 Read GetOptString Write SetOptString;
Property CompilerOS : TOS Read FCompilerOS Write SetCompilerOS; Property CompilerOS : TOS Read FCompilerOS Write SetCompilerOS;
Property CompilerCPU : TCPU Read FCompilerCPU Write SetCompilerCPU; Property CompilerCPU : TCPU Read FCompilerCPU Write SetCompilerCPU;
end; end;
@ -122,6 +127,8 @@ Const
KeyCompilerOS = 'OS'; KeyCompilerOS = 'OS';
KeyCompilerCPU = 'CPU'; KeyCompilerCPU = 'CPU';
KeyCompilerVersion = 'Version'; KeyCompilerVersion = 'Version';
KeyFPMakeCompiler = 'FPMakeCompiler';
KeyFPMakeUnitDir = 'FPMakeUnitDir';
{ TPackagerOptions } { TPackagerOptions }
@ -148,6 +155,8 @@ begin
11 : Result:=FDefaultVerbosity; 11 : Result:=FDefaultVerbosity;
12 : Result:=FPackagesDir; 12 : Result:=FPackagesDir;
13 : Result:=FCompilerConfigDir; 13 : Result:=FCompilerConfigDir;
14 : Result:=FFPMakeCompiler;
15 : Result:=FFPMakeUnitDir;
end; end;
end; end;
@ -169,6 +178,8 @@ begin
11 : FDefaultVerbosity:=AValue; 11 : FDefaultVerbosity:=AValue;
12 : FPackagesDir:=FixPath(AValue); 12 : FPackagesDir:=FixPath(AValue);
13 : FCompilerConfigDir:=FixPath(AValue); 13 : FCompilerConfigDir:=FixPath(AValue);
14 : FFPMakeCompiler:=AValue;
15 : FFPMakeUnitDir:=FixPath(AValue);
end; end;
FDirty:=True; FDirty:=True;
end; end;
@ -209,7 +220,6 @@ begin
Result:=FLocalRepository+Format(DefaultVersionsFile,[CompilerConfig]); Result:=FLocalRepository+Format(DefaultVersionsFile,[CompilerConfig]);
end; end;
Procedure TPackagerOptions.InitGlobalDefaults; Procedure TPackagerOptions.InitGlobalDefaults;
var var
LocalDir : String; LocalDir : String;
@ -258,9 +268,9 @@ begin
FInstallDir:=FixPath(GetEnvironmentVariable('FPCDIR')); FInstallDir:=FixPath(GetEnvironmentVariable('FPCDIR'));
if FInstallDir='' then if FInstallDir='' then
begin begin
if DirectoryExists('/usr/local/lib/fpc/'+FCompilerVersion) then FInstallDir:='/usr/local/lib/fpc/'+FCompilerVersion+'/';
FInstallDir:='/usr/local/lib/fpc/'+FCompilerVersion+'/' if not DirectoryExists(FInstallDir) and
else DirectoryExists('/usr/lib/fpc/'+FCompilerVersion) then
FInstallDir:='/usr/lib/fpc/'+FCompilerVersion+'/'; FInstallDir:='/usr/lib/fpc/'+FCompilerVersion+'/';
end; end;
{$else unix} {$else unix}
@ -273,6 +283,9 @@ begin
FInstallDir:=FInstallDir+'../'; FInstallDir:=FInstallDir+'../';
end; end;
{$endif unix} {$endif unix}
// Detect directory where fpmake units are located
FFPMakeCompiler:=FCompiler;
FFPMakeUnitDir:=FInstallDir+'units'+PathDelim+CompilerTarget+PathDelim+'fpmake'+PathDelim;
end; end;
@ -346,6 +359,8 @@ begin
FCompilerOS:=StringToOS(ReadString(SDefaults,KeyCompilerOS,OSToString(CompilerOS))); FCompilerOS:=StringToOS(ReadString(SDefaults,KeyCompilerOS,OSToString(CompilerOS)));
FCompilerCPU:=StringToCPU(ReadString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU))); FCompilerCPU:=StringToCPU(ReadString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU)));
FCompilerVersion:=ReadString(SDefaults,KeyCompilerVersion,FCompilerVersion); FCompilerVersion:=ReadString(SDefaults,KeyCompilerVersion,FCompilerVersion);
FFPMakeCompiler:=ReadString(SDefaults,KeyFPMakeCompiler,FFPMakeCompiler);
FFPMakeUnitDir:=FixPath(ReadString(SDefaults,KeyFPMakeUnitDir,FFPMakeUnitDir));
end; end;
end; end;
@ -359,6 +374,8 @@ begin
WriteString(SDefaults,KeyCompilerOS,OSToString(CompilerOS)); WriteString(SDefaults,KeyCompilerOS,OSToString(CompilerOS));
WriteString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU)); WriteString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU));
WriteString(SDefaults,KeyCompilerVersion,FCompilerVersion); WriteString(SDefaults,KeyCompilerVersion,FCompilerVersion);
WriteString(SDefaults,KeyFPMakeCompiler,FFPMakeCompiler);
WriteString(SDefaults,KeyFPMakeUnitDir,FFPMakeUnitDir);
end; end;
end; end;