+ output is flushed before launching external utilities

git-svn-id: trunk@3539 -
This commit is contained in:
Tomas Hajny 2006-05-15 00:28:55 +00:00
parent 71402d3ac2
commit a62c1faa2d
5 changed files with 25 additions and 3 deletions

View File

@ -51,7 +51,8 @@ interface
public public
{filenames} {filenames}
path : pathstr; path : pathstr;
name : namestr; fname, name: namestr; (* name for modulename given in source, fname
for base file name w/o path and extension *)
AsmFileName, { current .s and .o file } AsmFileName, { current .s and .o file }
ObjFileName, ObjFileName,
ppufilename : string; ppufilename : string;
@ -201,6 +202,7 @@ Implementation
AsmFileName:=current_module.get_AsmFilename; AsmFileName:=current_module.get_AsmFilename;
ObjFileName:=current_module.ObjFileName^; ObjFileName:=current_module.ObjFileName^;
name:=Lower(current_module.modulename^); name:=Lower(current_module.modulename^);
fname:=current_module.newfilename^;
path:=current_module.outputpath^; path:=current_module.outputpath^;
asmprefix := current_module.asmprefix^; asmprefix := current_module.asmprefix^;
if not assigned(current_module.outputpath) then if not assigned(current_module.outputpath) then
@ -261,7 +263,7 @@ Implementation
inherited Create(smart); inherited Create(smart);
if SmartAsm then if SmartAsm then
begin begin
path:=FixPath(path+FixFileName(name)+target_info.smartext,false); path:=FixPath(path+FixFileName(fname)+target_info.smartext,false);
CreateSmartLinkPath(path); CreateSmartLinkPath(path);
end; end;
Outcnt:=0; Outcnt:=0;
@ -372,6 +374,7 @@ Implementation
if not(cs_asm_extern in aktglobalswitches) then if not(cs_asm_extern in aktglobalswitches) then
{$IFDEF USE_SYSUTILS} {$IFDEF USE_SYSUTILS}
try try
FlushOutput;
DosExitCode := ExecuteProcess(command,para); DosExitCode := ExecuteProcess(command,para);
if DosExitCode <>0 if DosExitCode <>0
then begin then begin
@ -387,6 +390,7 @@ Implementation
end end
{$ELSE USE_SYSUTILS} {$ELSE USE_SYSUTILS}
begin begin
FlushOutput;
swapvectors; swapvectors;
exec(maybequoted(command),para); exec(maybequoted(command),para);
swapvectors; swapvectors;

View File

@ -121,6 +121,7 @@ begin
begin begin
Message1(exec_i_compilingresource,fname); Message1(exec_i_compilingresource,fname);
Message2(exec_d_resbin_params,resbin,s); Message2(exec_d_resbin_params,resbin,s);
FlushOutput;
{$IFDEF USE_SYSUTILS} {$IFDEF USE_SYSUTILS}
try try
if ExecuteProcess(resbin,s) <> 0 then if ExecuteProcess(resbin,s) <> 0 then

View File

@ -173,6 +173,7 @@ procedure CreateTempDir(const s:string);
end; end;
procedure call_as(const name:string); procedure call_as(const name:string);
begin begin
FlushOutput;
{$IFDEF USE_SYSUTILS} {$IFDEF USE_SYSUTILS}
ExecuteProcess(as_name,'-o '+name+'o '+name); ExecuteProcess(as_name,'-o '+name+'o '+name);
{$ELSE USE_SYSUTILS} {$ELSE USE_SYSUTILS}
@ -192,6 +193,7 @@ procedure call_ar;
GetFAttr(f,attr); GetFAttr(f,attr);
If DOSError=0 then If DOSError=0 then
erase(f); erase(f);
FlushOutput;
{$IFDEF USE_SYSUTILS} {$IFDEF USE_SYSUTILS}
ExecuteProcess(ar_name,'rs '+impname+' '+path+dirsep+'*.swo'); ExecuteProcess(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
{$ELSE USE_SYSUTILS} {$ELSE USE_SYSUTILS}

View File

@ -571,6 +571,7 @@ begin
DoExec:=true; DoExec:=true;
if not(cs_link_nolink in aktglobalswitches) then if not(cs_link_nolink in aktglobalswitches) then
begin begin
FlushOutput;
if useshell then if useshell then
exitcode := shell(maybequoted(command)+' '+para) exitcode := shell(maybequoted(command)+' '+para)
else else
@ -651,7 +652,7 @@ begin
{ remove the library, to be sure that it is rewritten } { remove the library, to be sure that it is rewritten }
RemoveFile(current_module.staticlibfilename^); RemoveFile(current_module.staticlibfilename^);
{ Call AR } { Call AR }
smartpath:=current_module.outputpath^+FixPath(lower(current_module.modulename^)+target_info.smartext,false); smartpath:=current_module.outputpath^+FixPath(current_module.newfilename^+target_info.smartext,false);
SplitBinCmd(target_ar.arcmd,binstr,cmdstr); SplitBinCmd(target_ar.arcmd,binstr,cmdstr);
binstr := FindUtil(utilsprefix + binstr); binstr := FindUtil(utilsprefix + binstr);

View File

@ -103,6 +103,8 @@ interface
procedure CGMessagePos2(const pos:tfileposinfo;t:longint;const s1,s2:string); procedure CGMessagePos2(const pos:tfileposinfo;t:longint;const s1,s2:string);
procedure CGMessagePos3(const pos:tfileposinfo;t:longint;const s1,s2,s3:string); procedure CGMessagePos3(const pos:tfileposinfo;t:longint;const s1,s2,s3:string);
procedure FlushOutput;
procedure InitVerbose; procedure InitVerbose;
procedure DoneVerbose; procedure DoneVerbose;
@ -784,6 +786,18 @@ var
end; end;
procedure FlushOutput;
begin
if not (Status.Use_StdErr) then (* StdErr is flushed after every line *)
begin
if Status.Use_Redir then
Flush(Status.RedirFile)
else
Flush(Output);
end;
end;
{***************************************************************************** {*****************************************************************************
Initialization Initialization
*****************************************************************************} *****************************************************************************}