mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 06:59:33 +01:00 
			
		
		
		
	+ output is flushed before launching external utilities
git-svn-id: trunk@3539 -
This commit is contained in:
		
							parent
							
								
									71402d3ac2
								
							
						
					
					
						commit
						a62c1faa2d
					
				@ -51,7 +51,8 @@ interface
 | 
			
		||||
      public
 | 
			
		||||
      {filenames}
 | 
			
		||||
        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 }
 | 
			
		||||
        ObjFileName,
 | 
			
		||||
        ppufilename  : string;
 | 
			
		||||
@ -201,6 +202,7 @@ Implementation
 | 
			
		||||
        AsmFileName:=current_module.get_AsmFilename;
 | 
			
		||||
        ObjFileName:=current_module.ObjFileName^;
 | 
			
		||||
        name:=Lower(current_module.modulename^);
 | 
			
		||||
        fname:=current_module.newfilename^;
 | 
			
		||||
        path:=current_module.outputpath^;
 | 
			
		||||
        asmprefix := current_module.asmprefix^;
 | 
			
		||||
        if not assigned(current_module.outputpath) then
 | 
			
		||||
@ -261,7 +263,7 @@ Implementation
 | 
			
		||||
        inherited Create(smart);
 | 
			
		||||
        if SmartAsm then
 | 
			
		||||
         begin
 | 
			
		||||
           path:=FixPath(path+FixFileName(name)+target_info.smartext,false);
 | 
			
		||||
           path:=FixPath(path+FixFileName(fname)+target_info.smartext,false);
 | 
			
		||||
           CreateSmartLinkPath(path);
 | 
			
		||||
         end;
 | 
			
		||||
        Outcnt:=0;
 | 
			
		||||
@ -372,6 +374,7 @@ Implementation
 | 
			
		||||
        if not(cs_asm_extern in aktglobalswitches) then
 | 
			
		||||
{$IFDEF USE_SYSUTILS}
 | 
			
		||||
        try
 | 
			
		||||
          FlushOutput;
 | 
			
		||||
          DosExitCode := ExecuteProcess(command,para);
 | 
			
		||||
          if DosExitCode <>0
 | 
			
		||||
          then begin
 | 
			
		||||
@ -387,6 +390,7 @@ Implementation
 | 
			
		||||
        end
 | 
			
		||||
{$ELSE USE_SYSUTILS}
 | 
			
		||||
         begin
 | 
			
		||||
           FlushOutput;
 | 
			
		||||
           swapvectors;
 | 
			
		||||
           exec(maybequoted(command),para);
 | 
			
		||||
           swapvectors;
 | 
			
		||||
 | 
			
		||||
@ -121,6 +121,7 @@ begin
 | 
			
		||||
   begin
 | 
			
		||||
     Message1(exec_i_compilingresource,fname);
 | 
			
		||||
     Message2(exec_d_resbin_params,resbin,s);
 | 
			
		||||
     FlushOutput;
 | 
			
		||||
{$IFDEF USE_SYSUTILS}
 | 
			
		||||
     try
 | 
			
		||||
       if ExecuteProcess(resbin,s) <> 0 then
 | 
			
		||||
 | 
			
		||||
@ -173,6 +173,7 @@ procedure CreateTempDir(const s:string);
 | 
			
		||||
 end;
 | 
			
		||||
procedure call_as(const name:string);
 | 
			
		||||
 begin
 | 
			
		||||
  FlushOutput;
 | 
			
		||||
{$IFDEF USE_SYSUTILS}
 | 
			
		||||
  ExecuteProcess(as_name,'-o '+name+'o '+name);
 | 
			
		||||
{$ELSE USE_SYSUTILS}
 | 
			
		||||
@ -192,6 +193,7 @@ procedure call_ar;
 | 
			
		||||
  GetFAttr(f,attr);
 | 
			
		||||
  If DOSError=0 then
 | 
			
		||||
   erase(f);
 | 
			
		||||
  FlushOutput;
 | 
			
		||||
{$IFDEF USE_SYSUTILS}
 | 
			
		||||
  ExecuteProcess(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
 | 
			
		||||
{$ELSE USE_SYSUTILS}
 | 
			
		||||
 | 
			
		||||
@ -571,6 +571,7 @@ begin
 | 
			
		||||
  DoExec:=true;
 | 
			
		||||
  if not(cs_link_nolink in aktglobalswitches) then
 | 
			
		||||
   begin
 | 
			
		||||
     FlushOutput;
 | 
			
		||||
     if useshell then
 | 
			
		||||
       exitcode := shell(maybequoted(command)+' '+para)
 | 
			
		||||
     else
 | 
			
		||||
@ -651,7 +652,7 @@ begin
 | 
			
		||||
{ remove the library, to be sure that it is rewritten }
 | 
			
		||||
  RemoveFile(current_module.staticlibfilename^);
 | 
			
		||||
{ 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);
 | 
			
		||||
  binstr := FindUtil(utilsprefix + binstr);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -103,6 +103,8 @@ interface
 | 
			
		||||
    procedure CGMessagePos2(const pos:tfileposinfo;t:longint;const s1,s2:string);
 | 
			
		||||
    procedure CGMessagePos3(const pos:tfileposinfo;t:longint;const s1,s2,s3:string);
 | 
			
		||||
 | 
			
		||||
    procedure FlushOutput;
 | 
			
		||||
 | 
			
		||||
    procedure InitVerbose;
 | 
			
		||||
    procedure DoneVerbose;
 | 
			
		||||
 | 
			
		||||
@ -784,6 +786,18 @@ var
 | 
			
		||||
      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
 | 
			
		||||
*****************************************************************************}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user