* do not try to call cross compiler if host CPU was specified using -P parameter.

* tabs to spaces.

git-svn-id: trunk@2768 -
This commit is contained in:
yury 2006-03-05 20:36:16 +00:00
parent ef36969ff6
commit d48f512146

View File

@ -84,16 +84,16 @@ program fpc;
if FileExists(path+ppcbin) then if FileExists(path+ppcbin) then
begin begin
ppcbin:=path+ppcbin; ppcbin:=path+ppcbin;
findexe:=true; findexe:=true;
end end
else else
begin begin
path:=FileSearch(ppcbin,getenvironmentvariable('PATH')); path:=FileSearch(ppcbin,getenvironmentvariable('PATH'));
if path<>'' then if path<>'' then
begin begin
ppcbin:=path; ppcbin:=path;
findexe:=true; findexe:=true;
end end
end; end;
end; end;
@ -109,8 +109,8 @@ program fpc;
errorvalue : Longint; errorvalue : Longint;
begin begin
ppccommandline:=''; ppccommandline:='';
cpusuffix :=''; // if not empty, signals attempt at cross cpusuffix :=''; // if not empty, signals attempt at cross
// compiler. // compiler.
{$ifdef i386} {$ifdef i386}
ppcbin:='ppc386'; ppcbin:='ppc386';
processorname:='i386'; processorname:='i386';
@ -177,31 +177,35 @@ program fpc;
writeln(processorname); writeln(processorname);
halt(0); halt(0);
end end
else if processorstr='i386' then else
cpusuffix:='386' if processorstr <> processorname then
else if processorstr='m68k' then begin
cpusuffix:='68k' if processorstr='i386' then
else if processorstr='alpha' then cpusuffix:='386'
cpusuffix:='apx' else if processorstr='m68k' then
else if processorstr='powerpc' then cpusuffix:='68k'
cpusuffix:='ppc' else if processorstr='alpha' then
else if processorstr='powerpc64' then cpusuffix:='apx'
cpusuffix:='ppc64' else if processorstr='powerpc' then
else if processorstr='arm' then cpusuffix:='ppc'
cpusuffix:='arm' else if processorstr='powerpc64' then
else if processorstr='sparc' then cpusuffix:='ppc64'
cpusuffix:='sparc' else if processorstr='arm' then
else if processorstr='ia64' then cpusuffix:='arm'
cpusuffix:='ia64' else if processorstr='sparc' then
else if processorstr='x86_64' then cpusuffix:='sparc'
cpusuffix:='x64' else if processorstr='ia64' then
else cpusuffix:='ia64'
error('Illegal processor type "'+processorstr+'"'); else if processorstr='x86_64' then
cpusuffix:='x64'
else
error('Illegal processor type "'+processorstr+'"');
ppcbin:='ppcross'+cpusuffix; ppcbin:='ppcross'+cpusuffix;
end end;
end
else else
ppccommandline:=ppccommandline+s+' '; ppccommandline:=ppccommandline+s+' ';
end; end;
end; end;
@ -209,16 +213,16 @@ program fpc;
ppcbin:=ppcbin+'-'+versionstr; ppcbin:=ppcbin+'-'+versionstr;
{ find the full path to the specified exe } { find the full path to the specified exe }
if not findexe(ppcbin) then if not findexe(ppcbin) then
begin begin
if cpusuffix<>'' Then if cpusuffix<>'' Then
begin begin
ppcbin:='ppc'+cpusuffix; ppcbin:='ppc'+cpusuffix;
if versionstr<>'' then if versionstr<>'' then
ppcbin:=ppcbin+'-'+versionstr; ppcbin:=ppcbin+'-'+versionstr;
findexe(ppcbin); findexe(ppcbin);
end; end;
end; end;
{ call ppcXXX } { call ppcXXX }
try try
errorvalue:=ExecuteProcess(ppcbin,ppccommandline); errorvalue:=ExecuteProcess(ppcbin,ppccommandline);
@ -229,4 +233,4 @@ program fpc;
if errorvalue<>0 then if errorvalue<>0 then
error(ppcbin+' returned an error exitcode (normal if you did not specify a source file to be compiled)'); error(ppcbin+' returned an error exitcode (normal if you did not specify a source file to be compiled)');
halt(errorvalue); halt(errorvalue);
end. end.