Browse Source

* save in the ppu if linked with obj file instead of using the
library flag, so the .inc files are also checked

peter 26 years ago
parent
commit
746f2e1510
3 changed files with 56 additions and 50 deletions
  1. 33 29
      compiler/files.pas
  2. 11 7
      compiler/ppu.pas
  3. 12 14
      compiler/symppu.inc

+ 33 - 29
compiler/files.pas

@@ -741,8 +741,7 @@ uses
         do_compile:=false;
         if (flags and uf_in_library)=0 then
          begin
-           if ((flags and uf_static_linked)<>0) or
-              ((flags and uf_smartlink)<>0) then
+           if (flags and (uf_static_linked or uf_smartlink))<>0 then
             begin
               objfiletime:=getnamedfiletime(staticlibfilename^);
               Message2(unit_u_check_time,staticlibfilename^,filetimestring(objfiletime));
@@ -766,32 +765,33 @@ uses
                 end;
              end
            else
-            begin
-            { the objectfile should be newer than the ppu file }
-              objfiletime:=getnamedfiletime(objfilename^);
-              Message2(unit_u_check_time,objfilename^,filetimestring(objfiletime));
-              if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
-               begin
-               { check if assembler file is older than ppu file }
-                 asmfileTime:=GetNamedFileTime(asmfilename^);
-                 Message2(unit_u_check_time,asmfilename^,filetimestring(asmfiletime));
-                 if (asmfiletime<0) or (ppufiletime>asmfiletime) then
-                  begin
-                    Message(unit_u_recompile_obj_and_asm_older);
-                    do_compile:=true;
-                    exit;
-                  end
-                 else
-                  begin
-                    Message(unit_u_recompile_obj_older_than_asm);
-                    if not(cs_asm_extern in aktglobalswitches) then
-                     begin
-                       do_compile:=true;
-                       exit;
-                     end;
-                  end;
-               end;
-            end;
+            if (flags and uf_obj_linked)<>0 then
+             begin
+             { the objectfile should be newer than the ppu file }
+               objfiletime:=getnamedfiletime(objfilename^);
+               Message2(unit_u_check_time,objfilename^,filetimestring(objfiletime));
+               if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
+                begin
+                { check if assembler file is older than ppu file }
+                  asmfileTime:=GetNamedFileTime(asmfilename^);
+                  Message2(unit_u_check_time,asmfilename^,filetimestring(asmfiletime));
+                  if (asmfiletime<0) or (ppufiletime>asmfiletime) then
+                   begin
+                     Message(unit_u_recompile_obj_and_asm_older);
+                     do_compile:=true;
+                     exit;
+                   end
+                  else
+                   begin
+                     Message(unit_u_recompile_obj_older_than_asm);
+                     if not(cs_asm_extern in aktglobalswitches) then
+                      begin
+                        do_compile:=true;
+                        exit;
+                      end;
+                   end;
+                end;
+             end;
          end;
         openppu:=true;
       end;
@@ -1097,7 +1097,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.86  1999-02-05 08:54:24  pierre
+  Revision 1.87  1999-02-16 00:48:23  peter
+    * save in the ppu if linked with obj file instead of using the
+      library flag, so the .inc files are also checked
+
+  Revision 1.86  1999/02/05 08:54:24  pierre
     + linkofiles splitted inot linkofiles and linkunitfiles
       because linkofiles must be stored with directory
       to enabled linking of different objects with same name

+ 11 - 7
compiler/ppu.pas

@@ -62,6 +62,7 @@ const
   ibdefref         = 11;
   ibendsymtablebrowser   = 12;
   ibbeginsymtablebrowser = 13;
+  iblinkunitfiles  = 14;
   {syms}
   ibtypesym       = 20;
   ibprocsym       = 21;
@@ -94,19 +95,18 @@ const
   ibwidestringdef = 56;
   ibfarpointerdef = 57;
 
-  iblinkunitfiles     = 58;
-
 { unit flags }
   uf_init          = $1;
   uf_finalize      = $2;
   uf_big_endian    = $4;
   uf_has_dbx       = $8;
   uf_has_browser   = $10;
-  uf_smartlink     = $20;
-  uf_in_library    = $40; { is the file in another file than <ppufile>.* ? }
-  uf_static_linked = $80;
-  uf_shared_linked = $100;
+  uf_smartlink     = $20;  { the ppu is smartlinked }
+  uf_in_library    = $40;  { is the file in another file than <ppufile>.* ? }
+  uf_static_linked = $80;  { the ppu is linked in a static library }
+  uf_shared_linked = $100; { the ppu is linked in a shared library }
   uf_local_browser = $200;
+  uf_obj_linked    = $400; { the ppu is linked in a object file }
 
 type
 {$ifdef m68k}
@@ -795,7 +795,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.22  1999-02-05 08:54:29  pierre
+  Revision 1.23  1999-02-16 00:48:24  peter
+    * save in the ppu if linked with obj file instead of using the
+      library flag, so the .inc files are also checked
+
+  Revision 1.22  1999/02/05 08:54:29  pierre
     + linkofiles splitted inot linkofiles and linkunitfiles
       because linkofiles must be stored with directory
       to enabled linking of different objects with same name

+ 12 - 14
compiler/symppu.inc

@@ -178,19 +178,13 @@
        { create unit flags }
          with Current_Module^ do
           begin
-            if (cs_create_staticlib in aktmoduleswitches) or
-               (cs_smartlink in aktmoduleswitches) then
-             begin
-               flags:=flags or uf_static_linked;
-               if SplitName(ppufilename^)<>SplitName(staticlibfilename^) then
-                 flags:=flags or uf_in_library;
-             end;
-            if cs_create_sharedlib in aktmoduleswitches then
-             begin
-               flags:=flags or uf_shared_linked;
-               if SplitName(ppufilename^)<>SplitName(sharedlibfilename^) then
-                 flags:=flags or uf_in_library;
-             end;
+            if (((cs_create_staticlib in aktmoduleswitches) or
+                 (cs_smartlink in aktmoduleswitches)) and
+                (SplitName(ppufilename^)<>SplitName(staticlibfilename^))) or
+
+               ((cs_create_sharedlib in aktmoduleswitches) and
+                (SplitName(ppufilename^)<>SplitName(sharedlibfilename^))) then
+             flags:=flags or uf_in_library;
             if cs_smartlink in aktmoduleswitches then
              flags:=flags or uf_smartlink;
 {$ifdef GDB}
@@ -445,7 +439,11 @@
 
 {
   $Log$
-  Revision 1.30  1999-02-05 08:54:30  pierre
+  Revision 1.31  1999-02-16 00:48:25  peter
+    * save in the ppu if linked with obj file instead of using the
+      library flag, so the .inc files are also checked
+
+  Revision 1.30  1999/02/05 08:54:30  pierre
     + linkofiles splitted inot linkofiles and linkunitfiles
       because linkofiles must be stored with directory
       to enabled linking of different objects with same name