浏览代码

* object to class conversion
* more verbosity for -vt and -vd
* -i options can be put after eachother so the Makefiles only need
to call fpc once for all info (will be twice as the first one will
be to check the version if fpc supports multiple info)

peter 24 年之前
父节点
当前提交
be95b0758b
共有 5 个文件被更改,包括 236 次插入174 次删除
  1. 6 0
      compiler/errore.msg
  2. 13 4
      compiler/i386/cpuswtch.pas
  3. 5 2
      compiler/msgidx.inc
  4. 56 53
      compiler/msgtxt.inc
  5. 156 115
      compiler/options.pas

+ 6 - 0
compiler/errore.msg

@@ -1767,6 +1767,12 @@ option_asm_forced=11022_W_"$1" assembler use forced
 % The assembler output selected can not generate
 % object files with the correct format. Therefore, the
 % default assembler for this target is used instead.
+option_using_file=11026_T_Reading options from file $1
+% Options are also read from this file
+option_using_env=11027_T_Reading options from environment $1
+% Options are also read from this environment string
+option_handling_option=11028_D_Handling option "$1"
+% Debug info that an option is found and will be handled
 %\end{description}
 # EndOfTeX
 

+ 13 - 4
compiler/i386/cpuswtch.pas

@@ -30,9 +30,8 @@ uses
   options;
 
 type
-  poption386=^toption386;
-  toption386=object(toption)
-    procedure interpret_proc_specific_options(const opt:string);virtual;
+  toption386=class(toption)
+    procedure interpret_proc_specific_options(const opt:string);override;
   end;
 
 implementation
@@ -112,10 +111,20 @@ begin
   end;
 end;
 
+
+initialization
+  coption:=toption386;
 end.
 {
   $Log$
-  Revision 1.1  2000-11-30 22:42:50  florian
+  Revision 1.2  2000-12-23 19:46:49  peter
+    * object to class conversion
+    * more verbosity for -vt and -vd
+    * -i options can be put after eachother so the Makefiles only need
+      to call fpc once for all info (will be twice as the first one will
+      be to check the version if fpc supports multiple info)
+
+  Revision 1.1  2000/11/30 22:42:50  florian
   * renamed
 
   Revision 1.1  2000/11/30 22:21:56  florian

+ 5 - 2
compiler/msgidx.inc

@@ -565,13 +565,16 @@ const
   option_switch_bin_to_src_assembler=11020;
   option_incompatible_asm=11021;
   option_asm_forced=11022;
+  option_using_file=11026;
+  option_using_env=11027;
+  option_handling_option=11028;
   option_logo=11023;
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 31966;
+  MsgTxtSize = 32076;
 
   MsgIdxMax : array[1..20] of longint=(
     17,59,174,37,41,41,86,14,35,40,
-    26,1,1,1,1,1,1,1,1,1
+    29,1,1,1,1,1,1,1,1,1
   );

+ 56 - 53
compiler/msgtxt.inc

@@ -616,171 +616,174 @@ const msgtxt : array[0..000133,1..240] of char=(
   '11020_N_Switching assembler to default source writing assembler'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
   '11022_W_"$1" assemble','r use forced'#000+
+  '11026_T_Reading options from file $1'#000+
+  '11027_T_Reading options from environment $1'#000+
+  '11028_D_Handling option "$1"'#000+
   '11023_Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'#010+
   'Copyright (c) 1993-2000 by Florian Klaempfl'#000+
-  '11024_Free Pascal Compiler version $FPCVER'#010+
+  '1102','4_Free Pascal Compiler version $FPCVER'#010+
   #010+
   'Compiler Date  : $FPCDATE'#010+
   'Compiler Target: $FPCTARGET'#010+
   #010+
-  'This program co','mes under the GNU General Public Licence'#010+
+  'This program comes under the GNU General Public Licence'#010+
   'For more information read COPYING.FPC'#010+
   #010+
   'Report bugs,suggestions etc to:'#010+
-  '                 [email protected]'#000+
+  '                 b','[email protected]'#000+
   '11025_**0*_put + after a boolean switch option to enable it, - to disa'+
   'ble it'#010+
-  '**1a_the com','piler doesn'#039't delete the generated assembler file'#010+
+  '**1a_the compiler doesn'#039't delete the generated assembler file'#010+
   '**2al_list sourcecode lines in assembler file'#010+
-  '**2ar_list register allocation/release info in assembler file'#010+
+  '**2ar_list register allocation/rel','ease info in assembler file'#010+
   '**2at_list temp allocation/release info in assembler file'#010+
-  '**1b_generate browser in','fo'#010+
+  '**1b_generate browser info'#010+
   '**2bl_generate local symbol info'#010+
   '**1B_build all modules'#010+
   '**1C<x>_code generation options:'#010+
-  '**2CD_create also dynamic library (not supported)'#010+
+  '**2CD_create also dynamic library (not',' supported)'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ci_IO-checking'#010+
   '**2Cn_omit linking stage'#010+
-  '**2','Co_check overflow of integer operations'#010+
+  '**2Co_check overflow of integer operations'#010+
   '**2Cr_range checking'#010+
   '**2Cs<n>_set stack size to <n>'#010+
   '**2Ct_stack checking'#010+
-  '**2CX_create also smartlinked library'#010+
+  '**2CX_create also',' smartlinked library'#010+
   '**1d<x>_defines the symbol <x>'#010+
   '*O1D_generate a DEF file'#010+
   '*O2Dd<x>_set description to <x>'#010+
-  '*','O2Dw_PM application'#010+
+  '*O2Dw_PM application'#010+
   '**1e<x>_set path to executable'#010+
   '**1E_same as -Cn'#010+
   '**1F<x>_set file names and paths:'#010+
-  '**2FD<x>_sets the directory where to search for compiler utilities'#010+
+  '**2FD<x>_sets the directory ','where to search for compiler utilities'#010+
   '**2Fe<x>_redirect error output to <x>'#010+
-  '**2FE<x>_set exe/unit output path',' to <x>'#010+
+  '**2FE<x>_set exe/unit output path to <x>'#010+
   '**2Fi<x>_adds <x> to include path'#010+
   '**2Fl<x>_adds <x> to library path'#010+
   '*L2FL<x>_uses <x> as dynamic linker'#010+
-  '**2Fo<x>_adds <x> to object path'#010+
+  '**2Fo<x>_adds <x> ','to object path'#010+
   '**2Fr<x>_load error message file <x>'#010+
   '**2Fu<x>_adds <x> to unit path'#010+
-  '**2FU<x>_set unit output pa','th to <x>, overrides -FE'#010+
+  '**2FU<x>_set unit output path to <x>, overrides -FE'#010+
   '*g1g_generate debugger information:'#010+
   '*g2gg_use gsym'#010+
   '*g2gd_use dbx'#010+
-  '*g2gh_use heap trace unit (for memory leak debugging)'#010+
+  '*g2gh_use heap trace unit (for memory le','ak debugging)'#010+
   '*g2gl_use line info unit to show more info for backtraces'#010+
   '*g2gc_generate checks for pointers'#010+
-  '**1','i_information'#010+
+  '**1i_information'#010+
   '**2iD_return compiler date'#010+
   '**2iV_return compiler version'#010+
   '**2iSO_return compiler OS'#010+
-  '**2iSP_return compiler processor'#010+
+  '**2iSP_return compiler processor'#010,
   '**2iTO_return target OS'#010+
   '**2iTP_return target processor'#010+
   '**1I<x>_adds <x> to include path'#010+
-  '**1k<x>_Pass <x> to th','e linker'#010+
+  '**1k<x>_Pass <x> to the linker'#010+
   '**1l_write logo'#010+
   '**1n_don'#039't read the default config file'#010+
   '**1o<x>_change the name of the executable produced to <x>'#010+
-  '**1pg_generate profile code for gprof (defines FPC_PROFILE)'#010+
-  '*L1P_use pipes instead of creating temporary assembler fi','les'#010+
+  '**1pg_g','enerate profile code for gprof (defines FPC_PROFILE)'#010+
+  '*L1P_use pipes instead of creating temporary assembler files'#010+
   '**1S<x>_syntax options:'#010+
   '**2S2_switch some Delphi 2 extensions on'#010+
   '**2Sc_supports operators like C (*=,+=,/= and -=)'#010+
-  '**2Sa_include assertion code.'#010+
+  '**2Sa_inclu','de assertion code.'#010+
   '**2Sd_tries to be Delphi compatible'#010+
-  '**2Se<x>_compiler stops after the <x> errors (default i','s 1)'#010+
+  '**2Se<x>_compiler stops after the <x> errors (default is 1)'#010+
   '**2Sg_allow LABEL and GOTO'#010+
   '**2Sh_Use ansistrings'#010+
   '**2Si_support C++ styled INLINE'#010+
   '**2Sm_support macros like C (global)'#010+
-  '**2So_tries to be TP/BP 7.0 compatible'#010+
+  '**2So_t','ries to be TP/BP 7.0 compatible'#010+
   '**2Sp_tries to be gpc compatible'#010+
-  '**2Ss_constructor name must be init (destruct','or must be done)'#010+
+  '**2Ss_constructor name must be init (destructor must be done)'#010+
   '**2St_allow static keyword in objects'#010+
   '**1s_don'#039't call assembler and linker (only with -a)'#010+
-  '**1u<x>_undefines the symbol <x>'#010+
+  '**1u<x>_undefines the s','ymbol <x>'#010+
   '**1U_unit options:'#010+
   '**2Un_don'#039't check the unit name'#010+
   '**2Us_compile a system unit'#010+
-  '**1v<x>_Be verbose. <','x> is a combination of the following letters:'#010+
+  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**2*_e : Show errors (default)       d : Show debug info'#010+
-  '**2*_w : Show warnings               u : Show unit info'#010+
+  '**2*_w : Show warnings     ','          u : Show unit info'#010+
   '**2*_n : Show notes                  t : Show tried/used files'#010+
-  '**2*_h : Show hint','s                  m : Show defined macros'#010+
+  '**2*_h : Show hints                  m : Show defined macros'#010+
   '**2*_i : Show general info           p : Show compiled procedures'#010+
-  '**2*_l : Show linenumbers            c : Show conditionals'#010+
+  '**2*_l : Show linenum','bers            c : Show conditionals'#010+
   '**2*_a : Show everything             0 : Show nothing (except errors)'#010+
-  '**','2*_b : Show all procedure          r : Rhide/GCC compatibility mod'+
-  'e'#010+
-  '**2*_    declarations if an error    x : Executable info (Win32 only)'#010+
+  '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#010+
+  '**2*_    declarations if an error    x : Executable info (Win3','2 only'+
+  ')'#010+
   '**2*_    occurs'#010+
   '**1X_executable options:'#010+
   '*L2Xc_link with the c library'#010+
-  '**2Xs_strip all symbols from ex','ecutable'#010+
+  '**2Xs_strip all symbols from executable'#010+
   '**2XD_try to link dynamic          (defines FPC_LINK_DYNAMIC)'#010+
-  '**2XS_try to link static (default) (defines FPC_LINK_STATIC)'#010+
+  '**2XS_try to link static (default) (defines FPC_LINK_STATIC',')'#010+
   '**2XX_try to link smart            (defines FPC_LINK_SMART)'#010+
   '**0*_Processor specific options:'#010+
-  '3*1A<x>_output ','format:'#010+
+  '3*1A<x>_output format:'#010+
   '3*2Aas_assemble using GNU AS'#010+
   '3*2Aasaout_assemble using GNU AS for aout (Go32v1)'#010+
-  '3*2Anasmcoff_coff (Go32v2) file using Nasm'#010+
+  '3*2Anasmcoff_coff (Go32v2) file using Nasm',#010+
   '3*2Anasmelf_elf32 (Linux) file using Nasm'#010+
   '3*2Anasmobj_obj file using Nasm'#010+
-  '3*2Amasm_obj file using Masm (Micro','soft)'#010+
+  '3*2Amasm_obj file using Masm (Microsoft)'#010+
   '3*2Atasm_obj file using Tasm (Borland)'#010+
   '3*2Acoff_coff (Go32v2) using internal writer'#010+
-  '3*2Apecoff_pecoff (Win32) using internal writer'#010+
+  '3*2Apecoff_pecoff (Win32) using internal',' writer'#010+
   '3*1R<x>_assembler reading style:'#010+
   '3*2Ratt_read AT&T style assembler'#010+
-  '3*2Rintel_read Intel style assemble','r'#010+
+  '3*2Rintel_read Intel style assembler'#010+
   '3*2Rdirect_copy assembler text directly to assembler file'#010+
   '3*1O<x>_optimizations:'#010+
   '3*2Og_generate smaller code'#010+
-  '3*2OG_generate faster code (default)'#010+
+  '3*2OG_generate fast','er code (default)'#010+
   '3*2Or_keep certain variables in registers'#010+
   '3*2Ou_enable uncertain optimizations (see docs)'#010+
-  '3*','2O1_level 1 optimizations (quick optimizations)'#010+
+  '3*2O1_level 1 optimizations (quick optimizations)'#010+
   '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#010+
-  '3*2O3_level 3 optimizations (-O2 repeatedly, max 5 times)'#010+
+  '3*2O3_level 3 optimizatio','ns (-O2 repeatedly, max 5 times)'#010+
   '3*2Op<x>_target processor:'#010+
   '3*3Op1_set target processor to 386/486'#010+
-  '3*3Op2_set ','target processor to Pentium/PentiumMMX (tm)'#010+
+  '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#010+
   '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#010+
-  '3*1T<x>_Target operating system:'#010+
+  '3*1T<x>_Target operating system:',#010+
   '3*2TGO32V1_version 1 of DJ Delorie DOS extender'#010+
   '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#010+
-  '3*2TLINUX_Lin','ux'#010+
+  '3*2TLINUX_Linux'#010+
   '3*2Tnetware_Novell Netware Module (experimental)'#010+
   '3*2TOS2_OS/2 2.x'#010+
   '3*2TWin32_Windows 32 Bit'#010+
   '3*1W<x>_Win32 target options'#010+
-  '3*2WB<x>_Set Image base to Hexadecimal <x> value'#010+
+  '3*2WB<x','>_Set Image base to Hexadecimal <x> value'#010+
   '3*2WC_Specify console type application'#010+
-  '3*2WD_Use DEFFILE to export f','unctions of DLL or EXE'#010+
+  '3*2WD_Use DEFFILE to export functions of DLL or EXE'#010+
   '3*2WG_Specify graphic type application'#010+
   '3*2WN_Do not generate relocation code (necessary for debugging)'#010+
-  '3*2WR_Generate relocation code'#010+
+  '3*2W','R_Generate relocation code'#010+
   '6*1A<x>_output format'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
-  '6*2Agas_GNU Motorola assemble','r'#010+
+  '6*2Agas_GNU Motorola assembler'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
   '6*2Amot_Standard Motorola assembler'#010+
   '6*1O_optimizations:'#010+
   '6*2Oa_turn on the optimizer'#010+
-  '6*2Og_generate smaller code'#010+
+  '6*2Og_generate ','smaller code'#010+
   '6*2OG_generate faster code (default)'#010+
   '6*2Ox_optimize maximum (still BUGGY!!!)'#010+
-  '6*2O2_set target pro','cessor to a MC68020+'#010+
+  '6*2O2_set target processor to a MC68020+'#010+
   '6*1R<x>_assembler reading style:'#010+
   '6*2RMOT_read motorola style assembler'#010+
   '6*1T<x>_Target operating system:'#010+
-  '6*2TAMIGA_Commodore Amiga'#010+
+  '6*2TA','MIGA_Commodore Amiga'#010+
   '6*2TATARI_Atari ST/STe/TT'#010+
   '6*2TMACOS_Macintosh m68k'#010+
   '6*2TLINUX_Linux-68k'#010+
   '**1*_'#010+
-  '**1?_shows t','his help'#010+
+  '**1?_shows this help'#010+
   '**1h_shows this help without waiting'#000
 );

+ 156 - 115
compiler/options.pas

@@ -30,22 +30,22 @@ uses
   globtype,globals,verbose;
 
 type
-  POption=^TOption;
-  TOption=object
+  TOption=class
     FirstPass,
     NoPressEnter,
     DoWriteLogo : boolean;
     FileLevel : longint;
+    QuickInfo : string;
     ParaIncludePath,
     ParaUnitPath,
     ParaObjectPath,
     ParaLibraryPath : TSearchPathList;
-    Constructor Init;
-    Destructor Done;
+    Constructor Create;
+    Destructor Destroy;override;
     procedure WriteLogo;
     procedure WriteInfo;
     procedure WriteHelpPages;
-    procedure QuickInfo(const s:string);
+    procedure WriteQuickInfo;
     procedure IllegalPara(const opt:string);
     function  Unsetbool(const opts:string; pos: Longint):boolean;
     procedure interpret_proc_specific_options(const opt:string);virtual;
@@ -56,6 +56,9 @@ type
     procedure parsecmd(cmd:string);
   end;
 
+var
+  coption : class of toption;
+
 procedure read_arguments(cmd:string);
 
 
@@ -72,14 +75,13 @@ uses
 {$ifdef BrowserLog}
   ,browlog
 {$endif BrowserLog}
-  ,cpuswtch
   ;
 
 const
   page_size = 24;
 
 var
-  option     : poption;
+  option     : toption;
   read_configfile,        { read config file, set when a cfgfile is found }
   disable_configfile,
   target_is_set : boolean;  { do not allow contradictory target settings }
@@ -143,6 +145,7 @@ begin
   check_symbol:=false;
 end;
 
+
 procedure MaybeLoadMessageFile;
 begin
 { Load new message file }
@@ -162,7 +165,7 @@ procedure StopOptions;
 begin
   if assigned(Option) then
    begin
-     dispose(Option,Done);
+     Option.free;
      Option:=nil;
    end;
   DoneVerbose;
@@ -307,16 +310,6 @@ begin
 end;
 
 
-procedure Toption.QuickInfo(const s:string);
-begin
-  if source_os.newline=#13#10 then
-    Write(s+#10)
-  else
-    Writeln(s);
-  StopOptions;
-end;
-
-
 procedure Toption.IllegalPara(const opt:string);
 begin
   Message1(option_illegal_para,opt);
@@ -357,6 +350,7 @@ begin
      not((opt[1]='-') and (opt[2] in ['i','d','v','T','u','n','X'])) then
    exit;
 
+  Message1(option_handling_option,opt);
   case opt[1] of
  '-' : begin
          more:=Copy(opt,3,255);
@@ -618,34 +612,10 @@ begin
                       NoPressEnter:=true;
                       WriteHelpPages;
                     end;
-              'i' : if more='' then
+              'i' : if More='' then
                      WriteInfo
                     else
-                     begin
-                        { Specific info, which can be used in Makefiles }
-                        case More[1] of
-                          'S' : begin
-                                  case More[2] of
-                                   'O' : QuickInfo(source_os.shortname);
-{$ifdef Delphi !!!!!!!!!}
-                                   'P' : QuickInfo('unknown');
-{$else}
-                                   'P' : QuickInfo(source_cpu_string);
-{$endif}
-                                  end;
-                                end;
-                          'T' : begin
-                                  case More[2] of
-                                   'O' : QuickInfo(target_os.shortname);
-                                   'P' : QuickInfo(target_cpu_string);
-                                  end;
-                                end;
-                          'V' : QuickInfo(version_string);
-                          'D' : QuickInfo(date_string);
-                        else
-                          IllegalPara(Opt);
-                        end;
-                     end;
+                     QuickInfo:=QuickInfo+More;
               'I' : if ispara then
                      ParaIncludePath.AddPath(More,false)
                     else
@@ -735,17 +705,19 @@ begin
                       if not target_is_set then
                        begin
                          {Remove non core targetname extra defines}
-                         CASE target_info.target OF
-                          target_i386_freebsd: begin
-                                                 undef_symbol('LINUX');
-                                                 undef_symbol('BSD');
-                                                 undef_symbol('UNIX');
-                                               end;
-                          target_i386_linux:   undef_symbol('UNIX');
-                          end;
-
-                           { remove old target define }
-
+                         case target_info.target of
+                          target_i386_freebsd :
+                            begin
+                              undef_symbol('LINUX');
+                              undef_symbol('BSD');
+                              undef_symbol('UNIX');
+                            end;
+                          target_i386_linux :
+                            begin
+                              undef_symbol('UNIX');
+                            end;
+                         end;
+                         { remove old target define }
                          undef_symbol(target_info.short_name);
                        { load new target }
                          if not(set_string_target(More)) then
@@ -915,10 +887,8 @@ begin
   If FileLevel>MaxLevel then
    Message(option_too_many_cfg_files);
 { open file }
+  Message1(option_using_file,filename);
   assign(f,filename);
-{$ifdef extdebug}
-  Comment(V_Info,'trying to open file: '+filename);
-{$endif extdebug}
   {$I-}
   reset(f);
   {$I+}
@@ -1043,6 +1013,7 @@ var
   quote  : set of char;
   hs     : string;
 begin
+  Message1(option_using_env,envname);
   env:=GetEnvPChar(envname);
   pc:=env;
   if assigned(pc) then
@@ -1166,12 +1137,80 @@ begin
 end;
 
 
-constructor TOption.Init;
+procedure toption.writequickinfo;
+var
+  s : string;
+  i : longint;
+
+  procedure addinfo(const hs:string);
+  begin
+    if s<>'' then
+     s:=s+' '+hs
+    else
+     s:=hs;
+  end;
+
+begin
+  s:='';
+  i:=0;
+  while (i<length(quickinfo)) do
+   begin
+     inc(i);
+     case quickinfo[i] of
+      'S' :
+        begin
+          inc(i);
+          case quickinfo[i] of
+           'O' :
+             addinfo(source_os.shortname);
+{$ifdef Delphi}
+           'P' :
+             addinfo('i386');
+{$else Delphi}
+           'P' :
+             addinfo(source_cpu_string);
+{$endif Delphi}
+           else
+             IllegalPara('-iS'+QuickInfo);
+          end;
+        end;
+      'T' :
+        begin
+          inc(i);
+          case quickinfo[i] of
+           'O' :
+             addinfo(target_os.shortname);
+           'P' :
+             AddInfo(target_cpu_string);
+           else
+             IllegalPara('-iT'+QuickInfo);
+          end;
+        end;
+      'V' :
+        AddInfo(version_string);
+      'D' :
+        AddInfo(date_string);
+      '_' :
+        ;
+      else
+        IllegalPara('-i'+QuickInfo);
+    end;
+  end;
+  if s<>'' then
+   begin
+     writeln(s);
+     stopoptions;
+   end;
+end;
+
+
+constructor TOption.create;
 begin
   DoWriteLogo:=false;
   NoPressEnter:=false;
   FirstPass:=false;
   FileLevel:=0;
+  Quickinfo:='';
   ParaIncludePath.Init;
   ParaObjectPath.Init;
   ParaUnitPath.Init;
@@ -1179,7 +1218,7 @@ begin
 end;
 
 
-destructor TOption.Done;
+destructor TOption.destroy;
 begin
   ParaIncludePath.Done;
   ParaObjectPath.Done;
@@ -1196,23 +1235,14 @@ procedure read_arguments(cmd:string);
 var
   configpath : pathstr;
 begin
-{$ifdef i386}
-  option:=new(poption386,Init);
-{$endif}
-{$ifdef m68k}
-  option:=new(poption68k,Init);
-{$endif}
-{$ifdef alpha}
-  option:=new(poption,Init);
-{$endif}
-{$ifdef powerpc}
-  option:=new(poption,Init);
-{$endif}
+  option:=coption.create;
+
 { Load messages }
   if (cmd='') and (paramcount=0) then
-   Option^.WriteHelpPages;
+   option.WriteHelpPages;
 
   disable_configfile:=false;
+
 { default defines }
   def_symbol(target_info.short_name);
   def_symbol('FPC');
@@ -1223,18 +1253,15 @@ begin
   def_symbol('WITHNEWCG');
 {$endif}
 
-
-
 { Temporary defines, until things settle down }
+{$ifdef SUPPORT_FIXED}
+  def_symbol('HASFIXED');
+{$endif SUPPORT_FIXED}
   def_symbol('HASWIDECHAR');
   def_symbol('HASOUT');
   def_symbol('HASINTF');
   def_symbol('INTERNSETLENGTH');
   def_symbol('INT64FUNCRESOK');
-
-{$ifdef SUPPORT_FIXED}
-  def_symbol('HASFIXED');
-{$endif SUPPORT_FIXED}
   def_symbol('PACKENUMFIXED');
 
 { some stuff for TP compatibility }
@@ -1266,6 +1293,7 @@ begin
 {$else Delphi}
   msgfilename:=dos.getenv('PPC_ERROR_FILE');
 {$endif Delphi}
+
 { default configfile }
   if (cmd<>'') and (cmd[1]='[') then
    begin
@@ -1277,8 +1305,11 @@ begin
 {$ifdef i386}
      ppccfg:='ppc386.cfg';
 {$endif i386}
+{$ifdef ia64}
+     ppccfg:='ppcia64.cfg';
+{$endif ia64}
 {$ifdef m68k}
-     ppccfg:='ppc.cfg';
+     ppccfg:='ppc68k.cfg';
 {$endif}
 {$ifdef alpha}
      ppccfg:='ppcalpha.cfg';
@@ -1333,48 +1364,46 @@ begin
 
   if read_configfile then
    begin
-   { read the parameters quick, only -v -T }
-     option^.firstpass:=true;
+   { read the parameters quick, only -i -v -T }
+     option.firstpass:=true;
      if cmd<>'' then
-       option^.parsecmd(cmd)
+       option.parsecmd(cmd)
      else
-       option^.read_parameters;
-     option^.firstpass:=false;
+       option.read_parameters;
+     option.firstpass:=false;
+   { Write only quickinfo }
+     if option.quickinfo<>'' then
+      option.writequickinfo;
+   { Read the configfile }
      if read_configfile then
-      begin
-{$ifdef DEBUG}
-        Comment(V_Debug,'read config file: '+ppccfg);
-{$endif DEBUG}
-        option^.interpret_file(ppccfg);
-      end;
+      option.interpret_file(ppccfg);
    end;
   if cmd<>'' then
-    option^.parsecmd(cmd)
+    option.parsecmd(cmd)
   else
-    option^.read_parameters;
+    option.read_parameters;
 
 { Stop if errors in options }
   if ErrorCount>0 then
    StopOptions;
 
-
- if target_info.target=target_i386_freebsd then
-  begin
-   def_symbol('LINUX'); { Hack: Linux define is also needed for freebsd (MvdV) }
-   def_symbol('BSD');
-   def_symbol('FREEBSD');
-   def_symbol('UNIX');
-  end;
-
- if target_info.target=target_i386_linux then
-  begin
-   def_symbol('LINUX');
-   def_symbol('UNIX');
-  end;
+  { Non-core target defines }
+  case target_info.target of
+    target_i386_freebsd :
+      begin
+        def_symbol('LINUX'); { Hack: Linux define is also needed for freebsd (MvdV) }
+        def_symbol('BSD');
+        def_symbol('UNIX');
+      end;
+    target_i386_linux :
+      begin
+        def_symbol('UNIX');
+      end;
+   end;
 
 { write logo if set }
-  if option^.DoWriteLogo then
-   option^.WriteLogo;
+  if option.DoWriteLogo then
+   option.WriteLogo;
 
 { Check file to compile }
   if param_file='' then
@@ -1396,10 +1425,10 @@ begin
    end;
 
 { Add paths specified with parameters to the searchpaths }
-  UnitSearchPath.AddList(Option^.ParaUnitPath,true);
-  ObjectSearchPath.AddList(Option^.ParaObjectPath,true);
-  IncludeSearchPath.AddList(Option^.ParaIncludePath,true);
-  LibrarySearchPath.AddList(Option^.ParaLibraryPath,true);
+  UnitSearchPath.AddList(option.ParaUnitPath,true);
+  ObjectSearchPath.AddList(option.ParaObjectPath,true);
+  IncludeSearchPath.AddList(option.ParaIncludePath,true);
+  LibrarySearchPath.AddList(option.ParaLibraryPath,true);
 
 { add unit environment and exepath to the unit search path }
   if inputdir<>'' then
@@ -1496,15 +1525,27 @@ begin
 
   MaybeLoadMessageFile;
 
-  dispose(option,Done);
+  option.free;
   Option:=nil;
 end;
 
 
+initialization
+  coption:=toption;
+finalization
+  if assigned(option) then
+   option.free;
 end.
 {
   $Log$
-  Revision 1.21  2000-12-16 15:56:19  jonas
+  Revision 1.22  2000-12-23 19:46:49  peter
+    * object to class conversion
+    * more verbosity for -vt and -vd
+    * -i options can be put after eachother so the Makefiles only need
+      to call fpc once for all info (will be twice as the first one will
+      be to check the version if fpc supports multiple info)
+
+  Revision 1.21  2000/12/16 15:56:19  jonas
     - removed all ifdef cardinalmulfix code
 
   Revision 1.20  2000/12/15 13:26:01  jonas