2
0
Эх сурвалжийг харах

* "fpc -P?" command to query for used ppcXXX compiler

peter 24 жил өмнө
parent
commit
67f5dc7f76

+ 23 - 2
compiler/pstatmnt.pas

@@ -794,12 +794,30 @@ implementation
                     usedinproc:=usedinproc +[R_D0]
                     usedinproc:=usedinproc +[R_D0]
                   else if pattern='D1' then
                   else if pattern='D1' then
                     usedinproc:=usedinproc + [R_D1]
                     usedinproc:=usedinproc + [R_D1]
-                  else if pattern='D6' then
+                  else if pattern='D2' then
                     usedinproc:=usedinproc + [R_D2]
                     usedinproc:=usedinproc + [R_D2]
+                  else if pattern='D3' then
+                    usedinproc:=usedinproc + [R_D3]
+                  else if pattern='D4' then
+                    usedinproc:=usedinproc + [R_D4]
+                  else if pattern='D5' then
+                    usedinproc:=usedinproc + [R_D5]
+                  else if pattern='D6' then
+                    usedinproc:=usedinproc + [R_D6]
+                  else if pattern='D7' then
+                    usedinproc:=usedinproc + [R_D7]
                   else if pattern='A0' then
                   else if pattern='A0' then
                     usedinproc:=usedinproc + [R_A0]
                     usedinproc:=usedinproc + [R_A0]
                   else if pattern='A1' then
                   else if pattern='A1' then
                     usedinproc:=usedinproc + [R_A1]
                     usedinproc:=usedinproc + [R_A1]
+                  else if pattern='A2' then
+                    usedinproc:=usedinproc + [R_A2]
+                  else if pattern='A3' then
+                    usedinproc:=usedinproc + [R_A3]
+                  else if pattern='A4' then
+                    usedinproc:=usedinproc + [R_A4]
+                  else if pattern='A5' then
+                    usedinproc:=usedinproc + [R_A5]
 {$endif m68k}
 {$endif m68k}
 {$ifdef powerpc}
 {$ifdef powerpc}
                   if pattern<>'' then
                   if pattern<>'' then
@@ -1246,7 +1264,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.36  2001-09-06 10:21:50  jonas
+  Revision 1.37  2001-09-22 11:11:43  peter
+    * "fpc -P?" command to query for used ppcXXX compiler
+
+  Revision 1.36  2001/09/06 10:21:50  jonas
     * fixed superfluous generation of stackframes for assembler procedures
     * fixed superfluous generation of stackframes for assembler procedures
       with no local vars or para's (this broke the backtrace printing in case
       with no local vars or para's (this broke the backtrace printing in case
       of an rte)
       of an rte)

+ 51 - 17
compiler/utils/fpc.pp

@@ -59,13 +59,33 @@ program fpc;
       findclose(Info);
       findclose(Info);
     end;
     end;
 
 
+
+  procedure findexe(var ppcbin:string);
+    var
+      path : string;
+    begin
+      { add .exe extension }
+      ppcbin:=ppcbin+exeext;
+
+      { get path of fpc.exe }
+      path:=splitpath(paramstr(0));
+      if FileExists(path+ppcbin) then
+       ppcbin:=path+ppcbin
+      else
+       begin
+         path:=FSearch(ppcbin,getenv('PATH'));
+         if path<>'' then
+          ppcbin:=path;
+       end;
+    end;
+
+
   var
   var
-     s,path,
+     s,
      ppcbin,
      ppcbin,
      processorstr   : shortstring;
      processorstr   : shortstring;
      ppccommandline : ansistring;
      ppccommandline : ansistring;
      i : longint;
      i : longint;
-
   begin
   begin
      ppccommandline:='';
      ppccommandline:='';
 {$ifdef i386}
 {$ifdef i386}
@@ -86,7 +106,17 @@ program fpc;
           if pos('-P',s)=1 then
           if pos('-P',s)=1 then
             begin
             begin
                processorstr:=copy(s,3,length(s)-2);
                processorstr:=copy(s,3,length(s)-2);
-               if processorstr='i386' then
+               { -P? is a special code that will show the
+                 default compiler and exit immediatly. It's
+                 main usage is for Makefile }
+               if processorstr='?' then
+                begin
+                  { report the full name of the ppcbin }
+                  findexe(ppcbin);
+                  writeln(ppcbin);
+                  halt(0);
+                end
+               else if processorstr='i386' then
                  ppcbin:='ppc386'
                  ppcbin:='ppc386'
                else if processorstr='m68k' then
                else if processorstr='m68k' then
                  ppcbin:='ppc68k'
                  ppcbin:='ppc68k'
@@ -100,19 +130,8 @@ program fpc;
             ppccommandline:=ppccommandline+s+' ';
             ppccommandline:=ppccommandline+s+' ';
        end;
        end;
 
 
-     { add .exe extension }
-     ppcbin:=ppcbin+exeext;
-
-     { get path of fpc.exe }
-     path:=splitpath(paramstr(0));
-     if FileExists(path+ppcbin) then
-      ppcbin:=path+ppcbin
-     else
-      begin
-        path:=FSearch(ppcbin,getenv('PATH'));
-        if path<>'' then
-         ppcbin:=path;
-      end;
+     { find the full path to the specified exe }
+     findexe(ppcbin);
 
 
      { call ppcXXX }
      { call ppcXXX }
      swapvectors;
      swapvectors;
@@ -124,7 +143,22 @@ program fpc;
   end.
   end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2001-04-25 22:40:07  peter
+  Revision 1.2  2001-09-22 11:11:43  peter
+    * "fpc -P?" command to query for used ppcXXX compiler
+
+  Revision 1.1.2.1  2001/04/25 22:43:24  peter
     * compiler dependent utils in utils/ subdir
     * compiler dependent utils in utils/ subdir
 
 
+  Revision 1.1.2.2  2000/12/12 19:47:40  peter
+    * fixed for go32v2 and win32
+
+  Revision 1.1.2.1  2000/11/18 14:16:12  peter
+    * really working now
+
+  Revision 1.1  2000/07/13 06:29:50  michael
+  + Initial import
+
+  Revision 1.1  2000/07/07 17:07:20  florian
+    + initial revision
+
 }
 }