fpc.pas 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. $Id$
  3. Copyright (c) 2000 by Florian Klaempfl
  4. This file is the "loader" for the Free Pascal compiler
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************}
  17. program fpc;
  18. uses
  19. {$ifdef go32v2}
  20. dpmiexcp,
  21. {$endif go32v2}
  22. dos;
  23. procedure error(const s : string);
  24. begin
  25. writeln('Error: ',s);
  26. halt(1);
  27. end;
  28. var
  29. ppccommandline,processorpostfix,processorstr : string;
  30. i : longint;
  31. begin
  32. ppccommandline:='';
  33. {$ifdef i386}
  34. processorpostfix:='386';
  35. {$endif i386}
  36. {$ifdef m68k}
  37. processorpostfix:='386';
  38. {$endif m68k}
  39. {$ifdef alpha}
  40. processorpostfix:='alpha';
  41. {$endif alpha}
  42. {$ifdef powerpc}
  43. processorpostfix:='powerpc';
  44. {$endif powerpc}
  45. for i:=1 to paramcount do
  46. begin
  47. if pos('-P',paramstr(i))=1 then
  48. begin
  49. processorstr:=copy(paramstr(i),3,length(paramstr(i))-2);
  50. if processorstr='i386' then
  51. processorpostfix:='386'
  52. else if processorstr='m68k' then
  53. processorpostfix:='68k'
  54. else if processorstr='alpha' then
  55. processorpostfix:='alpha'
  56. else if processorstr='powerpc' then
  57. processorpostfix:='ppc'
  58. else error('Illegal processor type');
  59. end
  60. else
  61. ppccommandline:=ppccommandline+paramstr(i)+' ';
  62. end;
  63. { ppcXXX is expected to be in the same directory }
  64. swapvectors;
  65. exec('ppc'+processorpostfix,ppccommandline);
  66. swapvectors;
  67. if doserror<>0 then
  68. error('ppc'+processorpostfix+' can''t be executed');
  69. halt(dosexitcode);
  70. end.
  71. {
  72. $Log$
  73. Revision 1.2 2000-07-13 11:32:41 michael
  74. + removed logs
  75. }