|
@@ -95,9 +95,7 @@ uses
|
|
App,Commands,
|
|
App,Commands,
|
|
CompHook, systems, browcol,
|
|
CompHook, systems, browcol,
|
|
WUtils,WEditor,
|
|
WUtils,WEditor,
|
|
-{$ifdef redircompiler}
|
|
|
|
FPRedir,
|
|
FPRedir,
|
|
-{$endif}
|
|
|
|
FPIde,FPConst,FPVars,FPUtils,FPIntf,FPSwitch;
|
|
FPIde,FPConst,FPVars,FPUtils,FPIntf,FPSwitch;
|
|
|
|
|
|
{$ifndef NOOBJREG}
|
|
{$ifndef NOOBJREG}
|
|
@@ -394,16 +392,21 @@ function CompilerStatus: boolean; {$ifndef FPC}far;{$endif}
|
|
var
|
|
var
|
|
event : tevent;
|
|
event : tevent;
|
|
begin
|
|
begin
|
|
-{$ifdef redircompiler}
|
|
|
|
- RedirDisableAll;
|
|
|
|
-{$endif}
|
|
|
|
GetKeyEvent(Event);
|
|
GetKeyEvent(Event);
|
|
if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
|
|
if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
|
|
begin
|
|
begin
|
|
CompilationPhase:=cpAborted;
|
|
CompilationPhase:=cpAborted;
|
|
{ update info messages }
|
|
{ update info messages }
|
|
if assigned(CompilerStatusDialog) then
|
|
if assigned(CompilerStatusDialog) then
|
|
- CompilerStatusDialog^.Update;
|
|
|
|
|
|
+ begin
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirDisableAll;
|
|
|
|
+{$endif}
|
|
|
|
+ CompilerStatusDialog^.Update;
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirEnableAll;
|
|
|
|
+{$endif}
|
|
|
|
+ end;
|
|
CompilerStatus:=true;
|
|
CompilerStatus:=true;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
@@ -412,15 +415,18 @@ begin
|
|
if (status.currentline mod 100=0) then
|
|
if (status.currentline mod 100=0) then
|
|
begin
|
|
begin
|
|
{ update info messages }
|
|
{ update info messages }
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirDisableAll;
|
|
|
|
+{$endif}
|
|
if assigned(CompilerStatusDialog) then
|
|
if assigned(CompilerStatusDialog) then
|
|
CompilerStatusDialog^.Update;
|
|
CompilerStatusDialog^.Update;
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirEnableAll;
|
|
|
|
+{$endif}
|
|
{ update memory usage }
|
|
{ update memory usage }
|
|
{ HeapView^.Update; }
|
|
{ HeapView^.Update; }
|
|
end;
|
|
end;
|
|
CompilerStatus:=false;
|
|
CompilerStatus:=false;
|
|
-{$ifdef redircompiler}
|
|
|
|
- RedirEnableAll;
|
|
|
|
-{$endif}
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -434,25 +440,31 @@ begin
|
|
{$ifdef TEMPHEAP}
|
|
{$ifdef TEMPHEAP}
|
|
switch_to_base_heap;
|
|
switch_to_base_heap;
|
|
{$endif TEMPHEAP}
|
|
{$endif TEMPHEAP}
|
|
-{$ifdef redircompiler}
|
|
|
|
- RedirDisableAll;
|
|
|
|
-{$endif}
|
|
|
|
CompilerComment:=false;
|
|
CompilerComment:=false;
|
|
{$ifndef DEV}
|
|
{$ifndef DEV}
|
|
if (status.verbosity and Level)=Level then
|
|
if (status.verbosity and Level)=Level then
|
|
{$endif}
|
|
{$endif}
|
|
begin
|
|
begin
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirDisableAll;
|
|
|
|
+{$endif}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
|
|
CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
|
|
status.currentline,status.currentcolumn);
|
|
status.currentline,status.currentcolumn);
|
|
{ update info messages }
|
|
{ update info messages }
|
|
if assigned(CompilerStatusDialog) then
|
|
if assigned(CompilerStatusDialog) then
|
|
CompilerStatusDialog^.Update;
|
|
CompilerStatusDialog^.Update;
|
|
|
|
+{$ifdef redircompiler}
|
|
|
|
+ RedirEnableAll;
|
|
|
|
+{$endif}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
{ update memory usage }
|
|
{ update memory usage }
|
|
{ HeapView^.Update; }
|
|
{ HeapView^.Update; }
|
|
end;
|
|
end;
|
|
-{$ifdef redircompiler}
|
|
|
|
- RedirEnableAll;
|
|
|
|
-{$endif}
|
|
|
|
{$ifdef TEMPHEAP}
|
|
{$ifdef TEMPHEAP}
|
|
switch_to_temp_heap;
|
|
switch_to_temp_heap;
|
|
{$endif TEMPHEAP}
|
|
{$endif TEMPHEAP}
|
|
@@ -511,7 +523,9 @@ procedure DoCompile(Mode: TCompileMode);
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
- FileName: string;
|
|
|
|
|
|
+ s,FileName: string;
|
|
|
|
+ ErrFile : Text;
|
|
|
|
+ Error : longint;
|
|
E : TEvent;
|
|
E : TEvent;
|
|
const
|
|
const
|
|
PpasFile = 'ppas';
|
|
PpasFile = 'ppas';
|
|
@@ -571,6 +585,8 @@ begin
|
|
split_heap;
|
|
split_heap;
|
|
switch_to_temp_heap;
|
|
switch_to_temp_heap;
|
|
{$endif TEMPHEAP}
|
|
{$endif TEMPHEAP}
|
|
|
|
+ if mode=cBuild then
|
|
|
|
+ FileName:='-B '+FileName;
|
|
Compile(FileName);
|
|
Compile(FileName);
|
|
if LinkAfter and
|
|
if LinkAfter and
|
|
(CompilationPhase<>cpAborted) and
|
|
(CompilationPhase<>cpAborted) and
|
|
@@ -578,14 +594,38 @@ begin
|
|
begin
|
|
begin
|
|
CompilationPhase:=cpLinking;
|
|
CompilationPhase:=cpLinking;
|
|
CompilerStatusDialog^.Update;
|
|
CompilerStatusDialog^.Update;
|
|
|
|
+{$ifndef redircompiler}
|
|
|
|
+ { At least here we want to catch output
|
|
|
|
+ of batch file PM }
|
|
|
|
+ ChangeRedirOut(FPOutFileName,false);
|
|
|
|
+ ChangeRedirError(FPErrFileName,false);
|
|
|
|
+{$endif}
|
|
{$ifdef linux}
|
|
{$ifdef linux}
|
|
- Shell(PpasFile+source_os.scriptext);
|
|
|
|
|
|
+ Shell('./'+PpasFile+source_os.scriptext);
|
|
|
|
+ Error:=LinuxError;
|
|
{$else}
|
|
{$else}
|
|
Dos.Exec(GetEnv('COMSPEC'),'/C '+PpasFile+source_os.scriptext);
|
|
Dos.Exec(GetEnv('COMSPEC'),'/C '+PpasFile+source_os.scriptext);
|
|
- if DosError<>0 then
|
|
|
|
- Inc(status.errorCount);
|
|
|
|
|
|
+ Error:=DosError;
|
|
{$endif}
|
|
{$endif}
|
|
-
|
|
|
|
|
|
+{$ifndef redircompiler}
|
|
|
|
+ RestoreRedirOut;
|
|
|
|
+ RestoreRedirError;
|
|
|
|
+{$endif}
|
|
|
|
+ if Error<>0 then
|
|
|
|
+ Inc(status.errorCount);
|
|
|
|
+ if not ExistsFile(EXEFile) then
|
|
|
|
+ begin
|
|
|
|
+ Inc(status.errorCount);
|
|
|
|
+ CompilerMessageWindow^.AddMessage(V_error,'could not create '+ExeFile,'',0,0);
|
|
|
|
+ Assign(ErrFile,FPErrFileName);
|
|
|
|
+ Reset(ErrFile);
|
|
|
|
+ While not eof(ErrFile) do
|
|
|
|
+ begin
|
|
|
|
+ readln(ErrFile,s);
|
|
|
|
+ CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
|
|
|
|
+ end;
|
|
|
|
+ Close(ErrFile);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
{$ifdef TEMPHEAP}
|
|
{$ifdef TEMPHEAP}
|
|
switch_to_base_heap;
|
|
switch_to_base_heap;
|
|
@@ -702,7 +742,13 @@ end;
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.35 1999-08-22 22:27:30 pierre
|
|
|
|
|
|
+ Revision 1.36 1999-09-07 11:32:13 pierre
|
|
|
|
+ * fix for Linux ./ prepended to ppas.sh
|
|
|
|
+ * Build add '-B' option
|
|
|
|
+ * if linkAfter is set, get errors from linker
|
|
|
|
+ by redirecting files
|
|
|
|
+
|
|
|
|
+ Revision 1.35 1999/08/22 22:27:30 pierre
|
|
* not ppas call on compile failure
|
|
* not ppas call on compile failure
|
|
|
|
|
|
Revision 1.34 1999/08/16 18:25:13 peter
|
|
Revision 1.34 1999/08/16 18:25:13 peter
|