瀏覽代碼

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

peter 24 年之前
父節點
當前提交
67f5dc7f76
共有 2 個文件被更改,包括 74 次插入19 次删除
  1. 23 2
      compiler/pstatmnt.pas
  2. 51 17
      compiler/utils/fpc.pp

+ 23 - 2
compiler/pstatmnt.pas

@@ -794,12 +794,30 @@ implementation
                     usedinproc:=usedinproc +[R_D0]
                   else if pattern='D1' then
                     usedinproc:=usedinproc + [R_D1]
-                  else if pattern='D6' then
+                  else if pattern='D2' then
                     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
                     usedinproc:=usedinproc + [R_A0]
                   else if pattern='A1' then
                     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}
 {$ifdef powerpc}
                   if pattern<>'' then
@@ -1246,7 +1264,10 @@ implementation
 end.
 {
   $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
       with no local vars or para's (this broke the backtrace printing in case
       of an rte)

+ 51 - 17
compiler/utils/fpc.pp

@@ -59,13 +59,33 @@ program fpc;
       findclose(Info);
     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
-     s,path,
+     s,
      ppcbin,
      processorstr   : shortstring;
      ppccommandline : ansistring;
      i : longint;
-
   begin
      ppccommandline:='';
 {$ifdef i386}
@@ -86,7 +106,17 @@ program fpc;
           if pos('-P',s)=1 then
             begin
                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'
                else if processorstr='m68k' then
                  ppcbin:='ppc68k'
@@ -100,19 +130,8 @@ program fpc;
             ppccommandline:=ppccommandline+s+' ';
        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 }
      swapvectors;
@@ -124,7 +143,22 @@ program fpc;
   end.
 {
   $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
 
+  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
+
 }