Selaa lähdekoodia

* -Ur switch (merged)
* masm fixes (merged)
* quoted filenames for go32v2 and win32

peter 24 vuotta sitten
vanhempi
commit
e24474d9ac

+ 7 - 2
compiler/assemble.pas

@@ -73,7 +73,7 @@ interface
       public
         Function  FindAssembler:string;
         Function  CallAssembler(const command,para:string):Boolean;
-        Function  DoAssemble:boolean;
+        Function  DoAssemble:boolean;virtual;
         Procedure RemoveAsm;
         Procedure AsmFlush;
         Procedure AsmClear;
@@ -1515,7 +1515,12 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.20  2001-06-13 18:31:57  peter
+  Revision 1.21  2001-06-18 20:36:23  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.20  2001/06/13 18:31:57  peter
     * smartlink with dll fixed (merged)
 
   Revision 1.19  2001/04/21 15:34:49  peter

+ 31 - 1
compiler/cutils.pas

@@ -53,6 +53,7 @@ interface
     procedure valint(S : string;var V : longint;var code : integer);
     function is_number(const s : string) : boolean;
     function ispowerof2(value : longint;var power : longint) : boolean;
+    function maybequoted(const s:string):string;
 
     { releases the string p and assignes nil to p }
     { if p=nil then freemem isn't called          }
@@ -424,6 +425,30 @@ uses
       end;
 
 
+    function maybequoted(const s:string):string;
+      var
+        s1 : string;
+        i  : integer;
+      begin
+        if (pos('"',s)>0) then
+         begin
+           s1:='"';
+           for i:=1 to length(s) do
+            begin
+              if s[i]='"' then
+               s1:=s1+'\"'
+              else
+               s1:=s1+s[i];
+            end;
+           maybequoted:=s1+'"';
+         end
+        else if (pos(' ',s)>0) then
+         maybequoted:='"'+s+'"'
+        else
+         maybequoted:=s;
+      end;
+
+
     function pchar2pstring(p : pchar) : pstring;
       var
          w,i : longint;
@@ -633,7 +658,12 @@ initialization
 end.
 {
   $Log$
-  Revision 1.6  2001-05-09 14:11:10  jonas
+  Revision 1.7  2001-06-18 20:36:23  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.6  2001/05/09 14:11:10  jonas
     * range check error fixes from Peter
 
   Revision 1.5  2000/12/24 12:25:31  peter

+ 18 - 5
compiler/fppu.pas

@@ -561,9 +561,14 @@ uses
                     temp:=' time '+filetimestring(source_time);
                     if (source_time>ppufiletime) then
                      begin
-                       do_compile:=true;
-                       recompile_reason:=rr_sourcenewer;
-                       temp:=temp+' *'
+                       if {is_main or} ((flags and uf_release)=0) then
+                        begin
+                          do_compile:=true;
+                          recompile_reason:=rr_sourcenewer;
+                        end
+                       else
+                        Message2(unit_h_source_modified,hs,ppufilename^);
+                       temp:=temp+' *';
                      end;
                   end;
                end;
@@ -581,7 +586,8 @@ uses
          end;
       { check if we want to rebuild every unit, only if the sources are
         available }
-        if do_build and sources_avail then
+        if do_build and sources_avail and
+           ((flags and uf_release)=0) then
           begin
              do_compile:=true;
              recompile_reason:=rr_build;
@@ -714,6 +720,8 @@ uses
           flags:=flags or uf_has_browser;
          if cs_local_browser in aktmoduleswitches then
           flags:=flags or uf_local_browser;
+         if do_release then
+          flags:=flags or uf_release;
 
 {$ifdef Test_Double_checksum_write}
          Assign(CRCFile,s+'.IMP');
@@ -1172,7 +1180,12 @@ uses
 end.
 {
   $Log$
-  Revision 1.8  2001-06-04 11:49:08  peter
+  Revision 1.9  2001-06-18 20:36:23  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.8  2001/06/04 11:49:08  peter
     * store used units in original type in ppu
 
   Revision 1.7  2001/05/19 23:05:19  peter

+ 8 - 1
compiler/globals.pas

@@ -115,6 +115,7 @@ interface
 
        { some flags for global compiler switches }
        do_build,
+       do_release,
        do_make       : boolean;
        not_unit_proc : boolean;
        { path for searching units, different paths can be seperated by ; }
@@ -1198,6 +1199,7 @@ implementation
      begin
       { set global switches }
         do_build:=false;
+        do_release:=false;
         do_make:=true;
         compile_level:=0;
         { these two should not be cleared in
@@ -1282,7 +1284,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.37  2001-06-03 21:57:35  peter
+  Revision 1.38  2001-06-18 20:36:24  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.37  2001/06/03 21:57:35  peter
     + hint directive parsing support
 
   Revision 1.36  2001/06/03 20:21:08  peter

+ 42 - 7
compiler/i386/ag386int.pas

@@ -32,6 +32,7 @@ interface
       T386IntelAssembler = class(TExternalAssembler)
         procedure WriteTree(p:TAAsmoutput);override;
         procedure WriteAsmList;override;
+        Function  DoAssemble:boolean;override;
         procedure WriteExternals;
       end;
 
@@ -42,7 +43,7 @@ interface
       sysutils,
 {$endif}
       cutils,globtype,globals,systems,cclasses,
-      verbose,cpubase,cpuasm,finput,fmodule
+      verbose,cpubase,cpuasm,finput,fmodule,script
       ;
 
     const
@@ -262,7 +263,7 @@ interface
                 if s=S_FAR then
                   hs:='far ptr '
                 else
-                  hs:='near ptr ';
+                  hs:='dword ptr ';
               end;
             getopstr_jmp:=hs+getreferencestring(o.ref^);
           end;
@@ -342,7 +343,7 @@ interface
       i,j,l    : longint;
       consttyp : tait;
       found,
-      do_line,
+      do_line,DoNotSplitLine,
       quoted   : boolean;
       sep      : char;
     begin
@@ -353,10 +354,12 @@ interface
                 (cs_lineinfo in aktmoduleswitches))
                  and (p=codesegment);
       InlineLevel:=0;
+      DoNotSplitLine:=false;
       hp:=tai(p.first);
       while assigned(hp) do
        begin
-         if do_line and not(hp.typ in nolinetai) then
+         if do_line and not(hp.typ in nolinetai) and
+            not DoNotSplitLine then
            begin
            { load infile }
              if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
@@ -399,6 +402,7 @@ interface
              lastfileinfo:=hp.fileinfo;
              lastinfile:=infile;
            end;
+         DoNotSplitLine:=false;
          case hp.typ of
        ait_comment : Begin
                        AsmWrite(target_asm.comment);
@@ -545,7 +549,9 @@ interface
                              [ait_const_32bit,ait_const_16bit,ait_const_8bit,
                               ait_const_symbol,ait_const_rva,
                               ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_string]) then
-                           AsmWriteLn(':');
+                           AsmWriteLn(':')
+                          else
+                           DoNotSplitLine:=true;
                         end;
                      end;
         ait_direct : begin
@@ -661,6 +667,8 @@ ait_stab_function_name : ;
                           hp:=tai(hp.next);
                         end;
                        AsmWriteLn(#9'.386p');
+                       AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA');
+                       AsmWriteLn(#9'ASSUME'#9'CS:_CODE,ES:DGROUP,DS:DGROUP,SS:DGROUP');
                        { I was told that this isn't necesarry because }
                        { the labels generated by FPC are unique (FK)  }
                        { AsmWriteLn(#9'LOCALS '+target_asm.labelprefix); }
@@ -706,6 +714,28 @@ ait_stab_function_name : ;
       end;
 
 
+    function t386intelassembler.DoAssemble : boolean;
+    var f : file;
+    begin
+      DoAssemble:=Inherited DoAssemble;
+      { masm does not seem to recognize specific extensions and uses .obj allways PM }
+      if (aktoutputformat = as_i386_masm) then
+        begin
+          if not(cs_asm_extern in aktglobalswitches) then
+            begin
+              if Not FileExists(objfile) and
+                 FileExists(ForceExtension(objfile,'.obj')) then
+                begin
+                  Assign(F,ForceExtension(objfile,'.obj'));
+                  Rename(F,objfile);
+                end;
+            end
+          else
+            AsmRes.AddAsmCommand('mv',ForceExtension(objfile,'.obj')+' '+objfile,objfile);
+        end;
+    end;
+
+
     procedure T386IntelAssembler.WriteAsmList;
     begin
 {$ifdef EXTDEBUG}
@@ -777,7 +807,7 @@ ait_stab_function_name : ;
             id           : as_i386_masm;
             idtxt  : 'MASM';
             asmbin : 'masm';
-            asmcmd : '/c $ASM /Fo$OBJ';
+            asmcmd : '/c /Cp $ASM /Fo$OBJ';
             supported_target : target_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
@@ -798,7 +828,12 @@ initialization
 end.
 {
   $Log$
-  Revision 1.13  2001-05-06 17:13:23  jonas
+  Revision 1.14  2001-06-18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.13  2001/05/06 17:13:23  jonas
     * completed incomplete typed constant records
 
   Revision 1.12  2001/04/21 15:33:03  peter

+ 7 - 4
compiler/i386/n386add.pas

@@ -496,13 +496,11 @@ interface
          swapleftright;
 
         { optimize first loading of a set }
-{$ifdef usecreateset}
         if (right.nodetype=setelementn) and
-           not(assigned(right.right)) and
+           not(assigned(tsetelementnode(right).right)) and
            is_emptyset(left) then
          createset:=true
         else
-{$endif}
          begin
            createset:=false;
            secondpass(left);
@@ -2285,7 +2283,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.13  2001-05-27 14:30:56  florian
+  Revision 1.14  2001-06-18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.13  2001/05/27 14:30:56  florian
     + some widestring stuff added
 
   Revision 1.12  2001/05/06 17:12:14  jonas

+ 7 - 2
compiler/msg/errore.msg

@@ -914,10 +914,10 @@ parser_w_skipped_fields_before=03175_W_Some fields coming before "$1" weren't in
 parser_e_skipped_fields_before=03176_E_Some fields coming before "$1" weren't initialized
 % In all syntax modes but Delphi mode, you can't leave some fields uninitialized
 % in the middle of a typed constant record
-parser_w_skipped_fields_after=03177_W_Some fields coming after "$1" weren't initialized
+parser_h_skipped_fields_after=03177_H_Some fields coming after "$1" weren't initialized
 % You can leave some fields at the end of a type constant record uninitialized
 % (the compiler will initialize them to zero automatically), but the the
-% compiler warns you when it detects such situations.
+% compiler gives a hint because it can be the source of a problem.
 parser_e_varargs_need_cdecl_and_external=03178_E_VarArgs directive without CDecl and External
 % The varargs directive can only be used with procedures or functions
 % that are declared with CDecl and External directives. The varargs directive
@@ -1724,6 +1724,10 @@ unit_h_cond_set_in_last_compile=10039_H_Conditional $1 was set at startup in las
 unit_w_cant_compile_unit_with_changed_incfile=10040_W_Can't recompile unit $1, but found modifed include files
 % A unit was found to have modified include files, but
 % some source files were not found, so recompilation is impossible.
+unit_h_source_modified=10041_H_File $1 is newer than Release PPU file $2
+% A modified source file for a unit was found that was compiled with the
+% release flag (-Ur). The unit will not implicitly be recompiled because
+% this release flag is set.
 % \end{description}
 # EndOfTeX
 
@@ -1912,6 +1916,7 @@ option_help_pages=11025_[
 **1u<x>_undefines the symbol <x>
 **1U_unit options:
 **2Un_don't check the unit name
+**2Ur_generate release unit files
 **2Us_compile a system unit
 **1v<x>_Be verbose. <x> is a combination of the following letters:
 **2*_e : Show errors (default)       d : Show debug info

+ 4 - 3
compiler/msgidx.inc

@@ -252,7 +252,7 @@ const
   parser_e_no_local_external=03174;
   parser_w_skipped_fields_before=03175;
   parser_e_skipped_fields_before=03176;
-  parser_w_skipped_fields_after=03177;
+  parser_h_skipped_fields_after=03177;
   parser_e_varargs_need_cdecl_and_external=03178;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
@@ -560,6 +560,7 @@ const
   unit_h_cond_not_set_in_last_compile=10038;
   unit_h_cond_set_in_last_compile=10039;
   unit_w_cant_compile_unit_with_changed_incfile=10040;
+  unit_h_source_modified=10041;
   option_usage=11000;
   option_only_one_source_support=11001;
   option_def_only_for_os2=11002;
@@ -591,9 +592,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 32986;
+  MsgTxtSize = 33070;
 
   MsgIdxMax : array[1..20] of longint=(
-    17,59,179,37,41,41,98,14,35,41,
+    17,59,179,37,41,41,98,14,35,42,
     30,1,1,1,1,1,1,1,1,1
   );

+ 67 - 66
compiler/msgtxt.inc

@@ -284,7 +284,7 @@ const msgtxt : array[0..000137,1..240] of char=(
   '03174_E_Can'#039't declare local procedure as EXTE','RNAL'#000+
   '03175_W_Some fields coming before "$1" weren'#039't initialized'#000+
   '03176_E_Some fields coming before "$1" weren'#039't initialized'#000+
-  '03177_W_Some fields coming after "$1" weren'#039't initialized'#000+
+  '03177_H_Some fields coming after "$1" weren'#039't initialized'#000+
   '03178_E_VarArgs directive without CDecl and External'#000+
   '04000_','E_Type mismatch'#000+
   '04001_E_Incompatible types: got "$1" expected "$2"'#000+
@@ -609,201 +609,202 @@ const msgtxt : array[0..000137,1..240] of char=(
   '10039_H_Conditional $1 was set at startup in last compilation of $2'#000+
   '10040_W_Can'#039't reco','mpile unit $1, but found modifed include files'+
   #000+
+  '10041_H_File $1 is newer than Release PPU file $2'#000+
   '11000_$1 [options] <inputfile> [options]'#000+
   '11001_W_Only one source file supported'#000+
   '11002_W_DEF file can be created only for OS/2'#000+
-  '11003_E_nested response files are not supported'#000+
-  '11004_F_No source f','ile name in command line'#000+
+  '11003_E_nested re','sponse files are not supported'#000+
+  '11004_F_No source file name in command line'#000+
   '11005_N_No option inside $1 config file'#000+
   '11006_E_Illegal parameter: $1'#000+
   '11007_H_-? writes help pages'#000+
   '11008_F_Too many config files nested'#000+
-  '11009_F_Unable to open file $1'#000+
+  '11009_F_Unable to open file $','1'#000+
   '11010_D_Reading further options from $1'#000+
-  '11011_W_','Target is already set to: $1'#000+
+  '11011_W_Target is already set to: $1'#000+
   '11012_W_Shared libs not supported on DOS platform, reverting to static'+
   #000+
   '11013_F_too many IF(N)DEFs'#000+
   '11014_F_too many ENDIFs'#000+
-  '11015_F_open conditional at the end of the file'#000+
-  '11016_W_Debug information generation is n','ot supported by this execut'+
-  'able'#000+
+  '11015_F_open conditional at the end of ','the file'#000+
+  '11016_W_Debug information generation is not supported by this executab'+
+  'le'#000+
   '11017_H_Try recompiling with -dGDB'#000+
   '11018_E_You are using the obsolete switch $1'#000+
   '11019_E_You are using the obsolete switch $1, please use $2'#000+
-  '11020_N_Switching assembler to default source writing assembler'#000+
-  '1102','1_W_Assembler output selected "$1" is not compatible with "$2"'#000+
+  '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" assembler 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+
+  '11028_D_Hand','ling option "$1"'#000+
   '11029__*** press enter ***'#000+
-  '11023_','Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'+
-  #010+
+  '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+
   #010+
   'Compiler Date  : $FPCDATE'#010+
-  'Compiler Target: $FPCTARGET'#010+
+  'Compiler Targ','et: $FPCTARGET'#010+
   #010+
-  'This program comes under the GNU G','eneral 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+
-  '11025_**0*_put + after a boolean switch option to enable it, - to disa'+
-  'ble it'#010+
-  '**1a_the compiler doesn'#039't delet','e the generated assembler file'#010+
+  '11025_**0*_put + after a boolean switch option to enable i','t, - to di'+
+  'sable it'#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+
-  '**2at_list temp allocation/release info in assembler file'#010+
+  '**2at_list temp allocation/release info in assemble','r file'#010+
   '**1b_generate browser info'#010+
-  '**2bl_generate l','ocal symbol 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+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
-  '**2Ci_IO-checking'#010+
+  '**2Ci_IO-checki','ng'#010+
   '**2Cn_omit linking stage'#010+
-  '**2Co_check overflow o','f 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+
   '**1d<x>_defines the symbol <x>'#010+
   '*O1D_generate a DEF file'#010+
-  '*O2Dd<x>_set description to <x>'#010+
-  '*O2Dw_PM application',#010+
+  '*O','2Dd<x>_set description to <x>'#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+
   '**2Fe<x>_redirect error output to <x>'#010+
-  '**2FE<x>_set exe/unit output path to <x>'#010+
-  '**2Fi<x>_ad','ds <x> to include path'#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+
   '**2Fr<x>_load error message file <x>'#010+
-  '**2Fu<x>_adds <x> to unit path'#010+
-  '**2FU<x>_set unit output path to <x>, override','s -FE'#010+
+  '**2Fu<x>_adds <x> to unit p','ath'#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+
   '*g2gl_use line info unit to show more info for backtraces'#010+
-  '*g2gc_generate checks for pointers'#010+
+  '*g2gc_g','enerate checks for pointers'#010+
   '**1i_information'#010+
-  '**2iD','_return compiler date'#010+
+  '**2iD_return compiler date'#010+
   '**2iV_return compiler version'#010+
   '**2iSO_return compiler OS'#010+
   '**2iSP_return compiler processor'#010+
   '**2iTO_return target OS'#010+
   '**2iTP_return target processor'#010+
-  '**1I<x>_adds <x> to include path'#010+
+  '**1I<x>_adds <x> to incl','ude path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
-  '**1l_write',' logo'#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 files'#010+
-  '**1S<x>_syntax ','options:'#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+
   '**2Sd_tries to be Delphi compatible'#010+
-  '**2Se<x>_compiler stops after the <x> errors (default is 1)'#010+
-  '**2Sg_allow LA','BEL and GOTO'#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+
   '**2Sp_tries to be gpc compatible'#010+
-  '**2Ss_constructor name must be init (destructor must be done)'#010+
-  '**','2St_allow static keyword in objects'#010+
+  '**2Ss_construc','tor 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_unit options:'#010+
   '**2Un_don'#039't check the unit name'#010+
+  '**2Ur_generate rel','ease unit files'#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*_n : Show notes                  t : Show tried/used files'#010+
-  '**2*_h : Show hints                  ','m : Show defined macros'#010+
+  '**2*_n : Show no','tes                  t : Show tried/used files'#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*_a : Show everything             0 : Show nothing (except errors)'#010+
-  '**2*_b : Show all pro','cedure          r : Rhide/GCC compatibility mod'+
-  'e'#010+
+  '**2*_a ',': Show everything             0 : Show nothing (except errors'+
+  ')'#010+
+  '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#010+
   '**2*_    declarations if an error    x : Executable info (Win32 only)'#010+
   '**2*_    occurs'#010+
-  '**1X_executable options:'#010+
+  '**1X_executable optio','ns:'#010+
   '*L2Xc_link with the c library'#010+
   '**2Xs_strip all symbols from executable'#010+
-  '**2XD_try ','to link dynamic          (defines FPC_LINK_DYNAMIC)'#010+
+  '**2XD_try to link dynamic          (defines FPC_LINK_DYNAMIC)'#010+
   '**2XS_try to link static (default) (defines FPC_LINK_STATIC)'#010+
-  '**2XX_try to link smart            (defines FPC_LINK_SMART)'#010+
+  '**2XX_try to link smart            (defines',' FPC_LINK_SMART)'#010+
   '**0*_Processor specific options:'#010+
   '3*1A<x>_output format:'#010+
-  '3*2Aas_asse','mble using GNU AS'#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*2Anasmelf_elf32 (Linux) file using Nasm'#010+
-  '3*2Anasmobj_obj file using Nasm'#010+
+  '3*','2Anasmobj_obj file using Nasm'#010+
   '3*2Amasm_obj file using Masm (Microsoft)'#010+
-  '3*2Atasm_obj ','file using Tasm (Borland)'#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*1R<x>_assembler reading style:'#010+
-  '3*2Ratt_read AT&T style assembler'#010+
+  '3*2R','att_read AT&T style assembler'#010+
   '3*2Rintel_read Intel style assembler'#010+
-  '3*2Rdirect_copy a','ssembler text directly to assembler file'#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*2Or_keep certain variables in registers'#010+
+  '3*2Or_keep certain variable','s in registers'#010+
   '3*2Ou_enable uncertain optimizations (see docs)'#010+
-  '3*2O1_level 1 optimiz','ations (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*2Op<x>_target processor:'#010+
+  '3*2Op<x>_tar','get 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*2TGO32V1_version 1 of DJ Delorie DOS extender'#010+
+  '3*2TGO32V1_version 1 of DJ Delorie DOS exten','der'#010+
   '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#010+
   '3*2TLINUX_Linux'#010+
-  '3*2Tnetware_Nove','ll Netware Module (experimental)'#010+
+  '3*2Tnetware_Novell Netware Module (experimental)'#010+
   '3*2TOS2_OS/2 2.x'#010+
   '3*2TSUNOS_SunOS/Solaris'#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 H','exadecimal <x> value'#010+
   '3*2WC_Specify console type application'#010+
-  '3*2WD_Use DEFFILE to exp','ort functions of DLL or EXE'#010+
+  '3*2WD_Use DEFFILE to export functions of DLL or EXE'#010+
   '3*2WF_Specify full-screen type application (OS/2 only)'#010+
   '3*2WG_Specify graphic type application'#010+
-  '3*2WN_Do not generate relocation code (necessary for debugging)'#010+
+  '3*2WN_Do not generate relocation c','ode (necessary for debugging)'#010+
   '3*2WR_Generate relocation code'#010+
   '6*1A<x>_output format'#010+
-  '6','*2Aas_Unix o-file using GNU AS'#010+
+  '6*2Aas_Unix o-file using GNU AS'#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*2Oa_tur','n on the optimizer'#010+
   '6*2Og_generate smaller code'#010+
-  '6*2OG_generate faster code (default)'#010,
+  '6*2OG_generate faster code (default)'#010+
   '6*2Ox_optimize maximum (still BUGGY!!!)'#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*1T','<x>_Target operating system:'#010+
   '6*2TAMIGA_Commodore Amiga'#010+
   '6*2TATARI_Atari ST/STe/TT'#010+
-  '6*2','TMACOS_Macintosh m68k'#010+
+  '6*2TMACOS_Macintosh m68k'#010+
   '6*2TLINUX_Linux-68k'#010+
   '**1*_'#010+
   '**1?_shows this help'#010+

+ 7 - 1
compiler/options.pas

@@ -741,6 +741,7 @@ begin
                                 Message2(option_obsolete_switch_use_new,'-Up','-Fu');
                                 break;
                               end;
+                        'r' : do_release:=true;
                         's' : initmoduleswitches:=initmoduleswitches+[cs_compilesystem];
                         '-' : begin
                                 initmoduleswitches:=initmoduleswitches
@@ -1540,7 +1541,12 @@ finalization
 end.
 {
   $Log$
-  Revision 1.43  2001-06-02 19:21:45  peter
+  Revision 1.44  2001-06-18 20:36:24  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.43  2001/06/02 19:21:45  peter
     * extradefines field added to target_info, so that targets don't
       need to put code in options.pas for it
 

+ 13 - 6
compiler/pmodules.pas

@@ -319,11 +319,6 @@ implementation
             ;
 {$endif powerpc}
 {$ifdef i386}
-          target_i386_Win32 :
-            begin
-              if islibrary then
-                exportssection.concat(tai_const_symbol.create_rva(exportlib.edatalabel));
-            end;
           target_i386_GO32V2 :
             begin
               { stacksize can be specified }
@@ -1216,6 +1211,13 @@ implementation
           end;
          compile_proc_body(true,false);
 
+         { Add symbol to the exports section for win32 so smartlinking a
+           DLL will include the edata section }
+         if assigned(exportlib) and
+            (target_info.target=target_i386_win32) and
+            assigned(current_module._exports.first) then
+           codesegment.concat(tai_const_symbol.create(exportlib.edatalabel));
+
          { avoid self recursive destructor call !! PM }
          aktprocsym.definition.localst:=nil;
 
@@ -1333,7 +1335,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.36  2001-06-06 21:58:16  peter
+  Revision 1.37  2001-06-18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.36  2001/06/06 21:58:16  peter
     * Win32 fixes for Makefile so it doesn't require sh.exe
 
   Revision 1.35  2001/06/03 21:57:36  peter

+ 7 - 1
compiler/ppu.pas

@@ -126,6 +126,7 @@ const
                              external linking! }
   uf_has_resources = $800; { unit has resource section }
   uf_little_endian = $1000;
+  uf_release       = $2000;{ unit was compiled with -Ur option }
 
 type
   ppureal=extended;
@@ -956,7 +957,12 @@ end;
 end.
 {
   $Log$
-  Revision 1.9  2001-05-18 22:28:59  peter
+  Revision 1.10  2001-06-18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.9  2001/05/18 22:28:59  peter
     * endian define
 
   Revision 1.8  2001/05/06 14:49:17  peter

+ 8 - 20
compiler/ptconst.pas

@@ -63,9 +63,6 @@ implementation
     procedure readtypedconst(const t:ttype;sym : ttypedconstsym;no_change_allowed : boolean);
 
       var
-{$ifdef m68k}
-         j : longint;
-{$endif m68k}
          len,base  : longint;
          p,hp      : tnode;
          i,l,offset,
@@ -369,23 +366,9 @@ implementation
                      Message(cg_e_illegal_expression)
                    else
                      begin
-{$ifdef i386}
+                        { this writing is endian independant }
                         for l:=0 to t.def.size-1 do
                           curconstSegment.concat(Tai_const.Create_8bit(tsetconstnode(p).value_set^[l]));
-{$endif}
-{$ifdef m68k}
-                        j:=0;
-                        for l:=0 to ((def.size-1) div 4) do
-                        { HORRIBLE HACK because of endian       }
-                        { now use intel endian for constant sets }
-                         begin
-                           curconstSegment.concat(Tai_const.Create_8bit(tordconstnode(p).value_set^[j+3]));
-                           curconstSegment.concat(Tai_const.Create_8bit(tordconstnode(p).value_set^[j+2]));
-                           curconstSegment.concat(Tai_const.Create_8bit(tordconstnode(p).value_set^[j+1]));
-                           curconstSegment.concat(Tai_const.Create_8bit(tordconstnode(p).value_set^[j]));
-                           Inc(j,4);
-                         end;
-{$endif}
                      end;
                 end
               else
@@ -778,7 +761,7 @@ implementation
                     { don't complain if there only come other variant parts }
                     { after the last initialized field                      }
                     (tvarsym(srsym).address > tvarsym(recsym).address) then
-                   Message1(parser_w_skipped_fields_after,s);
+                   Message1(parser_h_skipped_fields_after,s);
 
                  for i:=1 to t.def.size-aktpos do
                    curconstSegment.concat(Tai_const.Create_8bit(0));
@@ -902,7 +885,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.23  2001-05-06 17:15:00  jonas
+  Revision 1.24  2001-06-18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.23  2001/05/06 17:15:00  jonas
     + detect incomplete typed constant records
 
   Revision 1.22  2001/04/18 22:01:57  peter

+ 9 - 4
compiler/targets/t_go32v2.pas

@@ -297,11 +297,11 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',current_module.exefilename^);
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
-  Replace(cmdstr,'$RES',outputexedir+Info.ResName);
+  Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
-  Replace(cmdstr,'$SCRIPT','--script='+outputexedir+Info.ResName);
+  Replace(cmdstr,'$SCRIPT','--script='+maybequoted(outputexedir+Info.ResName));
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
 
 { Remove ReponseFile }
@@ -473,7 +473,12 @@ initialization
 end.
 {
   $Log$
-  Revision 1.5  2001-06-03 15:15:31  peter
+  Revision 1.6  2001-06-18 20:36:26  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.5  2001/06/03 15:15:31  peter
     * dllprt0 stub for linux shared libs
     * pass -init and -fini for linux shared libs
     * libprefix splitted into staticlibprefix and sharedlibprefix

+ 13 - 8
compiler/targets/t_win32.pas

@@ -429,6 +429,7 @@ implementation
          if not(assigned(exportssection)) then
            exportssection:=TAAsmoutput.create;
          last_index:=0;
+         getdatalabel(edatalabel);
       end;
 
 
@@ -552,7 +553,6 @@ implementation
          exportsSection.concat(Tai_section.Create(sec_edata));
          { create label to reference from main so smartlink will include
            the .edata section }
-         getdatalabel(edatalabel);
          exportsSection.concat(Tai_symbol.Create(edatalabel,0));
          { export flags }
          exportsSection.concat(Tai_const.Create_32bit(0));
@@ -819,9 +819,9 @@ begin
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      if binstr<>'' then
       begin
-        Replace(cmdstr,'$EXE',current_module.exefilename^);
+        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
         Replace(cmdstr,'$OPT',Info.ExtraOptions);
-        Replace(cmdstr,'$RES',outputexedir+Info.ResName);
+        Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
         Replace(cmdstr,'$APPTYPE',AppTypeStr);
         Replace(cmdstr,'$ASBIN',AsbinStr);
         Replace(cmdstr,'$RELOC',RelocStr);
@@ -830,7 +830,7 @@ begin
         if not DefFile.Empty {and UseDefFileForExport} then
           begin
             DefFile.WriteFile;
-            Replace(cmdstr,'$DEF','-d '+deffile.fname);
+            Replace(cmdstr,'$DEF','-d '+maybequoted(deffile.fname));
           end
         else
           Replace(cmdstr,'$DEF','');
@@ -899,9 +899,9 @@ begin
      SplitBinCmd(Info.DllCmd[i],binstr,cmdstr);
      if binstr<>'' then
       begin
-        Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
+        Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
         Replace(cmdstr,'$OPT',Info.ExtraOptions);
-        Replace(cmdstr,'$RES',outputexedir+Info.ResName);
+        Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
         Replace(cmdstr,'$APPTYPE',AppTypeStr);
         Replace(cmdstr,'$ASBIN',AsbinStr);
         Replace(cmdstr,'$RELOC',RelocStr);
@@ -910,7 +910,7 @@ begin
         if not DefFile.Empty {and UseDefFileForExport} then
           begin
             DefFile.WriteFile;
-            Replace(cmdstr,'$DEF','-d '+deffile.fname);
+            Replace(cmdstr,'$DEF','-d '+maybequoted(deffile.fname));
           end
         else
           Replace(cmdstr,'$DEF','');
@@ -1456,7 +1456,12 @@ initialization
 end.
 {
   $Log$
-  Revision 1.11  2001-06-06 21:58:16  peter
+  Revision 1.12  2001-06-18 20:36:26  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.11  2001/06/06 21:58:16  peter
     * Win32 fixes for Makefile so it doesn't require sh.exe
 
   Revision 1.10  2001/06/03 20:18:13  peter