From a578c9b7ed7d30f1321975597a8d17e14f156a40 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 31 Aug 2005 14:12:41 +0000 Subject: [PATCH] + Also take resources in main program source into account git-svn-id: trunk@990 - --- compiler/pmodules.pas | 12 +++++++----- compiler/systems/t_linux.pas | 15 +++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index 6fe3a6475b..3c5d31db77 100644 --- a/compiler/pmodules.pas +++ b/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 diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index 74518e215f..bcaad521a7 100644 --- a/compiler/systems/t_linux.pas +++ b/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);