diff --git a/compiler/globals.pas b/compiler/globals.pas index 13c2940ac0..8a5b23a289 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -344,8 +344,6 @@ interface prop_auto_setter_prefix : string; const - DLLsource : boolean = false; - Inside_asm_statement : boolean = false; global_unit_count : word = 0; @@ -1362,7 +1360,6 @@ implementation do_make:=true; compile_level:=0; codegenerror:=false; - DLLsource:=false; { Output } OutputFileName:=''; diff --git a/compiler/hlcgobj.pas b/compiler/hlcgobj.pas index 25ffb00c0d..86d40a2891 100644 --- a/compiler/hlcgobj.pas +++ b/compiler/hlcgobj.pas @@ -4652,7 +4652,7 @@ implementation look up procdef, use hlcgobj.a_call_name()) } { call __EXIT for main program } - if (not DLLsource) and + if (not current_module.islibrary) and (current_procinfo.procdef.proctypeoption=potype_proginit) then g_call_system_proc(list,'fpc_do_exit',[],nil); end; diff --git a/compiler/link.pas b/compiler/link.pas index aae7e93f0f..13b2f6604b 100644 --- a/compiler/link.pas +++ b/compiler/link.pas @@ -754,7 +754,7 @@ Implementation begin if showinfo then begin - if DLLsource then + if current_module.islibrary then AsmRes.AddLinkCommand(Command,Para,current_module.sharedlibfilename) else AsmRes.AddLinkCommand(Command,Para,current_module.exefilename); diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index eef004a625..b86f2f20bb 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -1977,7 +1977,6 @@ type i : Longint; sysinitmod: tmodule; begin - DLLsource:=islibrary; Status.IsLibrary:=IsLibrary; Status.IsPackage:=false; Status.IsExe:=true; @@ -2448,7 +2447,7 @@ type if not needsymbolinfo then unloaded_units.Clear; { finally we can create a executable } - if DLLSource then + if current_module.islibrary then linker.MakeSharedLibrary else linker.MakeExecutable; diff --git a/compiler/psub.pas b/compiler/psub.pas index c0becff9d1..010dd9585b 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1315,7 +1315,7 @@ implementation begin include(flags,pi_do_call); { the main program never returns due to the do_exit call } - if not(DLLsource) then + if not(current_module.islibrary) then include(procdef.procoptions,po_noreturn); end; diff --git a/compiler/symsym.pas b/compiler/symsym.pas index da7f2f876b..8a84fdb32a 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -1852,7 +1852,7 @@ implementation (owner.symtabletype=globalsymtable) or (create_smartlink and not(tf_smartlink_sections in target_info.flags)) or - DLLSource or + current_module.islibrary or (assigned(current_procinfo) and ((po_inline in current_procinfo.procdef.procoptions) or { globalasmsym is called normally before the body of a subroutine is parsed