* Do not fail configfile generation when gcc is not found

* Give a nice warning when gcc is not executed properly

git-svn-id: trunk@17606 -
This commit is contained in:
joost 2011-05-29 20:37:25 +00:00
parent 898a4debca
commit b057c320da

View File

@ -83,6 +83,7 @@ Resourcestring
SWarnIgnoringFile = 'Warning: Ignoring non-existent file: ';
SWarnIgnoringPair = 'Warning: Ignoring wrong name/value pair: ';
SWarngccNotFound = 'Warning: Could not find gcc. Unable to determine the gcclib path.';
SWarnCouldNotExecute= 'Warning: Could not execute command ''%s''';
SBackupCreated = 'Saved old "%s" to "%s"';
@ -194,16 +195,21 @@ var GccExecutable: string;
count: integer;
begin
result := '';
S:=TProcess.Create(Nil);
try
S.Commandline:=CommandLine;
S.Options:=[poUsePipes,poWaitOnExit];
S.execute;
Count:=s.output.read(buf,BufSize);
if (count=0) and ReadStdErr then
Count:=s.Stderr.read(buf,BufSize);
setlength(result,count);
move(buf[0],result[1],count);
try
S.execute;
Count:=s.output.read(buf,BufSize);
if (count=0) and ReadStdErr then
Count:=s.Stderr.read(buf,BufSize);
setlength(result,count);
move(buf[0],result[1],count);
except
Writeln(StdErr,Format(SWarnCouldNotExecute,[CommandLine]));
end;
finally
S.Free;
end;
@ -243,11 +249,17 @@ var GccExecutable: string;
libgccFilename: string;
gccDir: string;
begin
ExecResult:=ExecuteProc(GetGccExecutable+' -v '+GCCParams, True);
libgccFilename:=Get4thWord(ExecResult);
if libgccFilename='' then
libgccFilename:=ExecuteProc(GetGccExecutable+' --print-libgcc-file-name '+GCCParams, False);
gccDir := ExtractFileDir(libgccFilename);
if FileExists(GetGccExecutable) then
begin
ExecResult:=ExecuteProc(GetGccExecutable+' -v '+GCCParams, True);
libgccFilename:=Get4thWord(ExecResult);
if libgccFilename='' then
libgccFilename:=ExecuteProc(GetGccExecutable+' --print-libgcc-file-name '+GCCParams, False);
gccDir := ExtractFileDir(libgccFilename);
end
else
gccDir := '';
if gccDir='' then
result := ''
else if ACpuType = '' then