瀏覽代碼

+ Also take resources in main program source into account

git-svn-id: trunk@990 -
michael 20 年之前
父節點
當前提交
a578c9b7ed
共有 2 個文件被更改,包括 16 次插入11 次删除
  1. 7 5
      compiler/pmodules.pas
  2. 9 6
      compiler/systems/t_linux.pas

+ 7 - 5
compiler/pmodules.pas

@@ -283,11 +283,13 @@ implementation
         begin
         hp:=tused_unit(usedunits.first);
         found:=false;
-        While Assigned(hp) and not Found do
-          begin
-          Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
-          hp:=tused_unit(hp.next);
-          end;
+        Found:=((current_module.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+        If not found then
+          While Assigned(hp) and not Found do
+            begin
+            Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+            hp:=tused_unit(hp.next);
+            end;
         ResourceInfo:=TAAsmOutput.Create;
         if found then
           begin

+ 9 - 6
compiler/systems/t_linux.pas

@@ -660,13 +660,16 @@ begin
   postprocessexecutable:=True;
   if target_res.id=res_elf then
     begin
-    hp:=tused_unit(usedunits.first);
-    found:=false;
-    While Assigned(hp) and not Found do
+    found:=((current_module.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+    if not found then
       begin
-      Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
-      hp:=tused_unit(hp.next);
-      end;
+      hp:=tused_unit(usedunits.first);
+      While Assigned(hp) and not Found do
+        begin
+        Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+        hp:=tused_unit(hp.next);
+        end;
+      end;  
     if found then
       begin  
       cmdstr:=' -f -i '+maybequoted(fn);