|
@@ -30,7 +30,7 @@ type
|
|
FPCReleaseFilename: string; // released compiler binary
|
|
FPCReleaseFilename: string; // released compiler binary
|
|
FPCDevelFilename: string; // development compiler binary
|
|
FPCDevelFilename: string; // development compiler binary
|
|
Ini: TIniFile;
|
|
Ini: TIniFile;
|
|
- LazBuildFilename: string; // lazbuild binary
|
|
|
|
|
|
+ GitFilename: string; // 'git' binary
|
|
MakeFilename: string; // 'make' binary
|
|
MakeFilename: string; // 'make' binary
|
|
Pas2jsVersion: string;
|
|
Pas2jsVersion: string;
|
|
Simulate: boolean;
|
|
Simulate: boolean;
|
|
@@ -50,7 +50,7 @@ type
|
|
function Quote(const s: string): string;
|
|
function Quote(const s: string): string;
|
|
function GetDefaultCfgFilename: string;
|
|
function GetDefaultCfgFilename: string;
|
|
function GetDefaultBuildDir: string;
|
|
function GetDefaultBuildDir: string;
|
|
- function GetDefaultLazBuild: string;
|
|
|
|
|
|
+ function GetDefaultGit: string;
|
|
function GetDefaultMake: string;
|
|
function GetDefaultMake: string;
|
|
function GetLibExt(TargetOS: string = ''): string;
|
|
function GetLibExt(TargetOS: string = ''): string;
|
|
function GetOption_String(ShortOption: char; const LongOption: string): string;
|
|
function GetOption_String(ShortOption: char; const LongOption: string): string;
|
|
@@ -80,9 +80,9 @@ var
|
|
TargetOS, TargetCPU: String;
|
|
TargetOS, TargetCPU: String;
|
|
begin
|
|
begin
|
|
// quick check parameters
|
|
// quick check parameters
|
|
- ErrorMsg:=CheckOptions('hb:c:s:l:qvx', ['help', 'config:', 'lazbuild:',
|
|
|
|
|
|
+ ErrorMsg:=CheckOptions('hb:c:s:l:qvx', ['help', 'config:',
|
|
'builddir:', 'sourcedir:', 'quiet', 'verbose', 'execute',
|
|
'builddir:', 'sourcedir:', 'quiet', 'verbose', 'execute',
|
|
- 'fpcrelease:', 'fpcdevel:']);
|
|
|
|
|
|
+ 'fpcrelease:', 'fpcdevel:', 'git:', 'make:']);
|
|
if ErrorMsg<>'' then
|
|
if ErrorMsg<>'' then
|
|
Err(ErrorMsg);
|
|
Err(ErrorMsg);
|
|
|
|
|
|
@@ -114,22 +114,22 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
BuildDir:=GetOption_Directory('b','builddir',@GetDefaultBuildDir);
|
|
BuildDir:=GetOption_Directory('b','builddir',@GetDefaultBuildDir);
|
|
- LazBuildFilename:=GetOption_Executable('l','lazbuild',@GetDefaultLazBuild);
|
|
|
|
SourceDir:=GetOption_Directory('s','sourcedir',nil);
|
|
SourceDir:=GetOption_Directory('s','sourcedir',nil);
|
|
if SourceDir='' then
|
|
if SourceDir='' then
|
|
Err('missing source directory');
|
|
Err('missing source directory');
|
|
FPCReleaseFilename:=GetOption_Executable(' ','fpcrelease',nil);
|
|
FPCReleaseFilename:=GetOption_Executable(' ','fpcrelease',nil);
|
|
FPCDevelFilename:=GetOption_Executable(' ','fpcdevel',nil);
|
|
FPCDevelFilename:=GetOption_Executable(' ','fpcdevel',nil);
|
|
|
|
+ GitFilename:=GetOption_Executable(' ','git',@GetDefaultGit);
|
|
MakeFilename:=GetOption_Executable(' ','make',@GetDefaultMake);
|
|
MakeFilename:=GetOption_Executable(' ','make',@GetDefaultMake);
|
|
|
|
|
|
// write options
|
|
// write options
|
|
if Verbosity>=0 then begin
|
|
if Verbosity>=0 then begin
|
|
|
|
+ Log(etInfo,'SourceDir: "'+SourceDir+'"');
|
|
Log(etInfo,'BuildDir: "'+BuildDir+'"');
|
|
Log(etInfo,'BuildDir: "'+BuildDir+'"');
|
|
- Log(etInfo,'LazBuild: "'+LazBuildFilename+'"');
|
|
|
|
Log(etInfo,'FPCRelease: "'+FPCReleaseFilename+'"');
|
|
Log(etInfo,'FPCRelease: "'+FPCReleaseFilename+'"');
|
|
Log(etInfo,'FPCDevel: "'+FPCDevelFilename+'"');
|
|
Log(etInfo,'FPCDevel: "'+FPCDevelFilename+'"');
|
|
- Log(etInfo,'Make: "'+MakeFilename+'"');
|
|
|
|
- Log(etInfo,'SourceDir: "'+SourceDir+'"');
|
|
|
|
|
|
+ Log(etInfo,'git: "'+GitFilename+'"');
|
|
|
|
+ Log(etInfo,'make: "'+MakeFilename+'"');
|
|
end;
|
|
end;
|
|
|
|
|
|
if HasOption('x','execute') then
|
|
if HasOption('x','execute') then
|
|
@@ -142,9 +142,9 @@ begin
|
|
Err('BuildDir missing: "'+BuildDir+'"');
|
|
Err('BuildDir missing: "'+BuildDir+'"');
|
|
if not DirectoryExists(SourceDir) then
|
|
if not DirectoryExists(SourceDir) then
|
|
Err('SourceDir missing: "'+SourceDir+'"');
|
|
Err('SourceDir missing: "'+SourceDir+'"');
|
|
- CheckExecutable(LazBuildFilename,'lazbuild');
|
|
|
|
CheckExecutable(FPCReleaseFilename,'fpcrelease');
|
|
CheckExecutable(FPCReleaseFilename,'fpcrelease');
|
|
CheckExecutable(FPCDevelFilename,'fpcdevel');
|
|
CheckExecutable(FPCDevelFilename,'fpcdevel');
|
|
|
|
+ CheckExecutable(GitFilename,'git');
|
|
CheckExecutable(MakeFilename,'make');
|
|
CheckExecutable(MakeFilename,'make');
|
|
|
|
|
|
ReadVersion;
|
|
ReadVersion;
|
|
@@ -193,9 +193,10 @@ begin
|
|
writeln(' Default: '+GetDefaultCfgFilename);
|
|
writeln(' Default: '+GetDefaultCfgFilename);
|
|
writeln('--fpcrelease=<filename>: Path of released version fpc executable.');
|
|
writeln('--fpcrelease=<filename>: Path of released version fpc executable.');
|
|
writeln('--fpcdevel=<filename>: Path of development version fpc executable.');
|
|
writeln('--fpcdevel=<filename>: Path of development version fpc executable.');
|
|
- writeln('-l <filename>, --lazbuild=<filename>: Path of lazbuild executable.');
|
|
|
|
- writeln(' Default: '+GetDefaultLazBuild);
|
|
|
|
|
|
+ writeln('--git=<filename>: Path of gnu make executable.');
|
|
|
|
+ writeln(' Default: '+GetDefaultGit);
|
|
writeln('--make=<filename>: Path of gnu make executable.');
|
|
writeln('--make=<filename>: Path of gnu make executable.');
|
|
|
|
+ writeln(' Default: '+GetDefaultMake);
|
|
writeln('-s <filename>, --sourcedir=<filename>: git directory of the pas2js release');
|
|
writeln('-s <filename>, --sourcedir=<filename>: git directory of the pas2js release');
|
|
writeln('-x, --execute: Do not simulate, execute the commands');
|
|
writeln('-x, --execute: Do not simulate, execute the commands');
|
|
end;
|
|
end;
|
|
@@ -534,14 +535,14 @@ begin
|
|
Result:=AppendPathDelim(ResolveDots(GetTempDir(false)));
|
|
Result:=AppendPathDelim(ResolveDots(GetTempDir(false)));
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPas2jsReleaseCreator.GetDefaultLazBuild: string;
|
|
|
|
|
|
+function TPas2jsReleaseCreator.GetDefaultGit: string;
|
|
begin
|
|
begin
|
|
- Result:='lazbuild';
|
|
|
|
|
|
+ Result:='git'+GetExeExt;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TPas2jsReleaseCreator.GetDefaultMake: string;
|
|
function TPas2jsReleaseCreator.GetDefaultMake: string;
|
|
begin
|
|
begin
|
|
- Result:='make';
|
|
|
|
|
|
+ Result:='make'+GetExeExt;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TPas2jsReleaseCreator.GetLibExt(TargetOS: string): string;
|
|
function TPas2jsReleaseCreator.GetLibExt(TargetOS: string): string;
|