From e87e2f9c30e1db93e03fadcdd3ac403b5c9f254d Mon Sep 17 00:00:00 2001 From: pierre Date: Sun, 12 Jan 2014 23:06:19 +0000 Subject: [PATCH] Print out command line before running it with -vx option git-svn-id: trunk@26443 - --- compiler/cfileutl.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/compiler/cfileutl.pas b/compiler/cfileutl.pas index 77b9186bf2..049bde3646 100644 --- a/compiler/cfileutl.pas +++ b/compiler/cfileutl.pas @@ -1523,6 +1523,10 @@ end; var quote_script: tscripttype; begin + + if do_checkverbosity(V_Executable) then + do_comment(V_Executable,'Executing "'+Path+'" with command line "'+ + ComLine+'"'); if (cs_link_on_target in current_settings.globalswitches) then quote_script:=target_info.script else @@ -1535,7 +1539,21 @@ end; function RequotedExecuteProcess(const Path: AnsiString; const ComLine: array of AnsiString; Flags: TExecuteFlags): Longint; + var + i : longint; + st : string; begin + if do_checkverbosity(V_Executable) then + begin + if high(ComLine)=0 then + st:='' + else + st:=ComLine[1]; + for i:=2 to high(ComLine) do + st:=st+' '+ComLine[i]; + do_comment(V_Executable,'Executing "'+Path+'" with command line "'+ + st+'"'); + end; result:=sysutils.ExecuteProcess(Path,ComLine,Flags); end; @@ -1545,11 +1563,15 @@ end; expansion under linux } {$ifdef hasunix} begin + if do_checkverbosity(V_Used) then + do_comment(V_Executable,'Executing "'+Command+'" with fpSystem call'); result := Unix.fpsystem(command); end; {$else hasunix} {$ifdef hasamiga} begin + if do_checkverbosity(V_Used) then + do_comment(V_Executable,'Executing "'+Command+'" using RequotedExecuteProcess'); result := RequotedExecuteProcess('',command); end; {$else hasamiga} @@ -1557,6 +1579,9 @@ end; comspec : string; begin comspec:=GetEnvironmentVariable('COMSPEC'); + if do_checkverbosity(V_Used) then + do_comment(V_Executable,'Executing "'+Command+'" using comspec "' + +ComSpec+'"'); result := RequotedExecuteProcess(comspec,' /C '+command); end; {$endif hasamiga}