mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 00:10:31 +02:00
* also print fpc-specific help when executed without parameters or with -h
(mantis #21323) * don't print a message about the ppc binary exiting with an error if no source file is specified (if a no option or -h is used, the help message will be printed; in other cases, a source file may not have been specified but that's an error like any other in that case -- that message only existed because the compiler binary also exits with a non-zero exit code in case the help is printed) - removed alpha and ia64 support for selecting ppc binary + added mips and mipsel support for selecting ppc binary git-svn-id: trunk@20487 -
This commit is contained in:
parent
524a5683d5
commit
2696c1f1d3
@ -121,7 +121,9 @@ program fpc;
|
|||||||
ppccommandlinelen : longint;
|
ppccommandlinelen : longint;
|
||||||
i : longint;
|
i : longint;
|
||||||
errorvalue : Longint;
|
errorvalue : Longint;
|
||||||
|
dohelp : Boolean;
|
||||||
begin
|
begin
|
||||||
|
dohelp := false;
|
||||||
setlength(ppccommandline,paramcount);
|
setlength(ppccommandline,paramcount);
|
||||||
ppccommandlinelen:=0;
|
ppccommandlinelen:=0;
|
||||||
cpusuffix :=''; // if not empty, signals attempt at cross
|
cpusuffix :=''; // if not empty, signals attempt at cross
|
||||||
@ -135,10 +137,6 @@ program fpc;
|
|||||||
ppcbin:='ppc68k';
|
ppcbin:='ppc68k';
|
||||||
processorname:='m68k';
|
processorname:='m68k';
|
||||||
{$endif m68k}
|
{$endif m68k}
|
||||||
{$ifdef alpha}
|
|
||||||
ppcbin:='ppcapx';
|
|
||||||
processorname:='alpha';
|
|
||||||
{$endif alpha}
|
|
||||||
{$ifdef powerpc}
|
{$ifdef powerpc}
|
||||||
ppcbin:='ppcppc';
|
ppcbin:='ppcppc';
|
||||||
processorname:='powerpc';
|
processorname:='powerpc';
|
||||||
@ -159,10 +157,6 @@ program fpc;
|
|||||||
ppcbin:='ppcx64';
|
ppcbin:='ppcx64';
|
||||||
processorname:='x86_64';
|
processorname:='x86_64';
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
{$ifdef ia64}
|
|
||||||
ppcbin:='ppcia64';
|
|
||||||
processorname:='ia64';
|
|
||||||
{$endif ia64}
|
|
||||||
versionstr:=''; { Default is just the name }
|
versionstr:=''; { Default is just the name }
|
||||||
for i:=1 to paramcount do
|
for i:=1 to paramcount do
|
||||||
begin
|
begin
|
||||||
@ -196,22 +190,22 @@ program fpc;
|
|||||||
else
|
else
|
||||||
if processorstr <> processorname then
|
if processorstr <> processorname then
|
||||||
begin
|
begin
|
||||||
if processorstr='i386' then
|
if processorstr='arm' then
|
||||||
|
cpusuffix:='arm'
|
||||||
|
else if processorstr='i386' then
|
||||||
cpusuffix:='386'
|
cpusuffix:='386'
|
||||||
else if processorstr='m68k' then
|
else if processorstr='m68k' then
|
||||||
cpusuffix:='68k'
|
cpusuffix:='68k'
|
||||||
else if processorstr='alpha' then
|
else if processorstr='mips' then
|
||||||
cpusuffix:='apx'
|
cpusuffix:='mips'
|
||||||
|
else if processorstr='mipsel' then
|
||||||
|
cpusuffix:='mipsel'
|
||||||
else if processorstr='powerpc' then
|
else if processorstr='powerpc' then
|
||||||
cpusuffix:='ppc'
|
cpusuffix:='ppc'
|
||||||
else if processorstr='powerpc64' then
|
else if processorstr='powerpc64' then
|
||||||
cpusuffix:='ppc64'
|
cpusuffix:='ppc64'
|
||||||
else if processorstr='arm' then
|
|
||||||
cpusuffix:='arm'
|
|
||||||
else if processorstr='sparc' then
|
else if processorstr='sparc' then
|
||||||
cpusuffix:='sparc'
|
cpusuffix:='sparc'
|
||||||
else if processorstr='ia64' then
|
|
||||||
cpusuffix:='ia64'
|
|
||||||
else if processorstr='x86_64' then
|
else if processorstr='x86_64' then
|
||||||
cpusuffix:='x64'
|
cpusuffix:='x64'
|
||||||
else
|
else
|
||||||
@ -233,6 +227,8 @@ program fpc;
|
|||||||
extrapath:=copy(s,4,length(s)-3)
|
extrapath:=copy(s,4,length(s)-3)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if pos('-h',s)=1 then
|
||||||
|
dohelp:=true;
|
||||||
ppccommandline[ppccommandlinelen]:=s;
|
ppccommandline[ppccommandlinelen]:=s;
|
||||||
inc(ppccommandlinelen);
|
inc(ppccommandlinelen);
|
||||||
end;
|
end;
|
||||||
@ -261,7 +257,26 @@ program fpc;
|
|||||||
on e : exception do
|
on e : exception do
|
||||||
error(ppcbin+' can''t be executed, error message: '+e.message);
|
error(ppcbin+' can''t be executed, error message: '+e.message);
|
||||||
end;
|
end;
|
||||||
if errorvalue<>0 then
|
if (errorvalue<>0) and
|
||||||
error(ppcbin+' returned an error exitcode (normal if you did not specify a source file to be compiled)');
|
(paramcount<>0) then
|
||||||
|
error(ppcbin+' returned an error exitcode');
|
||||||
|
if dohelp or
|
||||||
|
(paramcount=0) then
|
||||||
|
begin
|
||||||
|
if not dohelp then
|
||||||
|
begin
|
||||||
|
writeln('*** press enter ***');
|
||||||
|
readln;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
writeln;
|
||||||
|
writeln(paramstr(0),' [options] <inputfile> [options]');
|
||||||
|
writeln(' -X<x> Target CPU options');
|
||||||
|
writeln(' -PB Show default compiler binary');
|
||||||
|
writeln(' -PP Show default target cpu');
|
||||||
|
writeln(' -P<x> Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64)');
|
||||||
|
Writeln(' -V<x> Append ''-<x>'' to the used compiler binary name');
|
||||||
|
Writeln(' -Xp<x> First search for the compiler binary in the directory <x>');
|
||||||
|
end;
|
||||||
halt(errorvalue);
|
halt(errorvalue);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user