mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 01:08:07 +02:00
* cleanup external/nolink options
git-svn-id: trunk@3375 -
This commit is contained in:
parent
469789071d
commit
d69ad5d84d
@ -92,10 +92,10 @@ begin
|
||||
{$ELSE USE_SYSUTILS}
|
||||
fsplit(resbin,respath,n,e);
|
||||
{$ENDIF USE_SYSUTILS}
|
||||
if (not resfound) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (not resfound) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
Message(exec_e_res_not_found);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end;
|
||||
{$IFDEF USE_SYSUTILS}
|
||||
srcfilepath := SplitPath(current_module.mainsource^);
|
||||
@ -117,7 +117,7 @@ begin
|
||||
(srcfilepath<>'') then
|
||||
s:=s+' --include '+maybequoted(srcfilepath);
|
||||
{ Execute the command }
|
||||
if not (cs_link_extern in aktglobalswitches) then
|
||||
if not (cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
Message1(exec_i_compilingresource,fname);
|
||||
Message2(exec_d_resbin_params,resbin,s);
|
||||
@ -126,13 +126,13 @@ begin
|
||||
if ExecuteProcess(resbin,s) <> 0 then
|
||||
begin
|
||||
Message(exec_e_error_while_linking);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end;
|
||||
except
|
||||
on E:EOSError do
|
||||
begin
|
||||
Message(exec_e_cant_call_linker);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end
|
||||
end;
|
||||
{$ELSE USE_SYSUTILS}
|
||||
@ -142,18 +142,18 @@ begin
|
||||
if (doserror<>0) then
|
||||
begin
|
||||
Message(exec_e_cant_call_linker);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end
|
||||
else
|
||||
if (dosexitcode<>0) then
|
||||
begin
|
||||
Message(exec_e_error_while_linking);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end;
|
||||
{$ENDIF USE_SYSUTILS}
|
||||
end;
|
||||
{ Update asmres when externmode is set }
|
||||
if cs_link_extern in aktglobalswitches then
|
||||
if cs_link_nolink in aktglobalswitches then
|
||||
AsmRes.AddLinkCommand(resbin,s,'');
|
||||
if ObjUsed then
|
||||
current_module.linkotherofiles.add(resobj,link_always);
|
||||
|
@ -92,6 +92,4 @@
|
||||
{$DEFINE MACOS_USE_FAKE_SYSUTILS}
|
||||
{$ENDIF MACOS}
|
||||
|
||||
{ Use the internal linker by default }
|
||||
{ define INTERNALLINKER}
|
||||
{$define SUPPORT_UNALIGNED}
|
||||
{$define SUPPORT_UNALIGNED}
|
||||
|
@ -69,7 +69,7 @@ end;
|
||||
destructor tdeffile.destroy;
|
||||
begin
|
||||
if WrittenOnDisk and
|
||||
not(cs_link_extern in aktglobalswitches) then
|
||||
not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(FName);
|
||||
importlist.Free;
|
||||
exportlist.Free;
|
||||
|
@ -2266,7 +2266,7 @@ end;
|
||||
initmodeswitches:=fpcmodeswitches;
|
||||
initlocalswitches:=[cs_check_io,cs_typed_const_writable];
|
||||
initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
|
||||
initglobalswitches:=[cs_check_unit_name,cs_link_static{$ifdef INTERNALLINKER},cs_link_internal{$endif}];
|
||||
initglobalswitches:=[cs_check_unit_name,cs_link_static,cs_link_extern];
|
||||
initoptimizerswitches:=[];
|
||||
initsourcecodepage:='8859-1';
|
||||
initpackenum:=4;
|
||||
|
@ -132,8 +132,8 @@ than 255 characters. That's why using Ansi Strings}
|
||||
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
|
||||
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
|
||||
{ linking }
|
||||
cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
|
||||
cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_internal,cs_link_opt_vtable,
|
||||
cs_link_nolink,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
|
||||
cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
|
||||
cs_link_opt_used_sections,
|
||||
cs_link_map,cs_link_pthread
|
||||
);
|
||||
|
@ -190,7 +190,7 @@ begin
|
||||
found:=objectsearchpath.FindFile(s,foundfile);
|
||||
if not(cs_link_on_target in aktglobalswitches) and (not found) then
|
||||
found:=FindFile(s,exepath,foundfile);
|
||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
||||
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||
Message1(exec_w_objfile_not_found,s);
|
||||
|
||||
{Restore file extension}
|
||||
@ -435,7 +435,7 @@ begin
|
||||
if s='' then
|
||||
exit;
|
||||
found:=FindLibraryFile(s,target_info.staticlibprefix,target_info.staticlibext,ns);
|
||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
||||
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||
Message1(exec_w_libfile_not_found,s);
|
||||
StaticLibFiles.Concat(ns);
|
||||
end;
|
||||
@ -464,7 +464,7 @@ begin
|
||||
if s='' then
|
||||
exit;
|
||||
found:=FindLibraryFile(s,target_info.staticclibprefix,target_info.staticclibext,ns);
|
||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
||||
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||
Message1(exec_w_libfile_not_found,s);
|
||||
StaticLibFiles.Concat(ns);
|
||||
end;
|
||||
@ -553,10 +553,10 @@ begin
|
||||
Found:=FindFile(utilexe,utilsdirectory,Foundbin);
|
||||
if (not Found) then
|
||||
Found:=FindExe(utilexe,Foundbin);
|
||||
if (not Found) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (not Found) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
Message1(exec_e_util_not_found,utilexe);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
end;
|
||||
if (FoundBin<>'') then
|
||||
Message1(exec_t_using_util,FoundBin);
|
||||
@ -569,7 +569,7 @@ var
|
||||
exitcode: longint;
|
||||
begin
|
||||
DoExec:=true;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
if useshell then
|
||||
exitcode := shell(maybequoted(command)+' '+para)
|
||||
@ -579,13 +579,13 @@ begin
|
||||
if ExecuteProcess(command,para) <> 0
|
||||
then begin
|
||||
Message(exec_e_error_while_linking);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
DoExec:=false;
|
||||
end;
|
||||
except on E:EOSError do
|
||||
begin
|
||||
Message(exec_e_cant_call_linker);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
DoExec:=false;
|
||||
end;
|
||||
end
|
||||
@ -600,20 +600,20 @@ begin
|
||||
if (doserror<>0) then
|
||||
begin
|
||||
Message(exec_e_cant_call_linker);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
DoExec:=false;
|
||||
end
|
||||
else
|
||||
if (exitcode<>0) then
|
||||
begin
|
||||
Message(exec_e_error_while_linking);
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
||||
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||
DoExec:=false;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF USE_SYSUTILS}
|
||||
{ Update asmres when externmode is set }
|
||||
if cs_link_extern in aktglobalswitches then
|
||||
if cs_link_nolink in aktglobalswitches then
|
||||
begin
|
||||
if showinfo then
|
||||
begin
|
||||
@ -702,7 +702,7 @@ begin
|
||||
|
||||
{ Clean up }
|
||||
if not(cs_asm_leave in aktglobalswitches) then
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
while not SmartLinkOFiles.Empty do
|
||||
RemoveFile(SmartLinkOFiles.GetFirst);
|
||||
@ -976,33 +976,32 @@ end;
|
||||
Init/Done
|
||||
*****************************************************************************}
|
||||
|
||||
procedure InitLinker;
|
||||
var
|
||||
lk : TlinkerClass;
|
||||
begin
|
||||
if (cs_link_internal in aktglobalswitches) and
|
||||
assigned(target_info.link) then
|
||||
begin
|
||||
lk:=TLinkerClass(target_info.link);
|
||||
linker:=lk.Create;
|
||||
end
|
||||
else if assigned(target_info.linkextern) then
|
||||
begin
|
||||
lk:=TlinkerClass(target_info.linkextern);
|
||||
linker:=lk.Create;
|
||||
end
|
||||
else
|
||||
begin
|
||||
linker:=Tlinker.Create;
|
||||
end;
|
||||
end;
|
||||
procedure InitLinker;
|
||||
var
|
||||
lk : TlinkerClass;
|
||||
begin
|
||||
if (cs_link_extern in aktglobalswitches) and
|
||||
assigned(target_info.linkextern) then
|
||||
begin
|
||||
lk:=TlinkerClass(target_info.linkextern);
|
||||
linker:=lk.Create;
|
||||
end
|
||||
else
|
||||
if assigned(target_info.link) then
|
||||
begin
|
||||
lk:=TLinkerClass(target_info.link);
|
||||
linker:=lk.Create;
|
||||
end
|
||||
else
|
||||
linker:=Tlinker.Create;
|
||||
end;
|
||||
|
||||
|
||||
procedure DoneLinker;
|
||||
begin
|
||||
if assigned(linker) then
|
||||
Linker.Free;
|
||||
end;
|
||||
procedure DoneLinker;
|
||||
begin
|
||||
if assigned(linker) then
|
||||
Linker.Free;
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
|
@ -101,25 +101,11 @@ var
|
||||
|
||||
procedure set_default_link_type;
|
||||
begin
|
||||
{ win32 and wdosx need smartlinking by default to prevent including too much
|
||||
dll dependencies }
|
||||
if not(cs_link_internal in initglobalswitches) and
|
||||
(target_info.system in [system_i386_win32,system_i386_wdosx]) then
|
||||
begin
|
||||
def_system_macro('FPC_LINK_SMART');
|
||||
undef_system_macro('FPC_LINK_STATIC');
|
||||
undef_system_macro('FPC_LINK_DYNAMIC');
|
||||
initglobalswitches:=initglobalswitches+[cs_link_smart];
|
||||
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static];
|
||||
end
|
||||
else
|
||||
begin
|
||||
undef_system_macro('FPC_LINK_SMART');
|
||||
def_system_macro('FPC_LINK_STATIC');
|
||||
undef_system_macro('FPC_LINK_DYNAMIC');
|
||||
initglobalswitches:=initglobalswitches+[cs_link_static];
|
||||
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
|
||||
end;
|
||||
undef_system_macro('FPC_LINK_SMART');
|
||||
def_system_macro('FPC_LINK_STATIC');
|
||||
undef_system_macro('FPC_LINK_DYNAMIC');
|
||||
initglobalswitches:=initglobalswitches+[cs_link_static];
|
||||
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
|
||||
end;
|
||||
|
||||
|
||||
@ -544,9 +530,9 @@ begin
|
||||
include(initlocalswitches,cs_check_io);
|
||||
'n' :
|
||||
If UnsetBool(More, j) then
|
||||
exclude(initglobalswitches,cs_link_extern)
|
||||
exclude(initglobalswitches,cs_link_nolink)
|
||||
Else
|
||||
include(initglobalswitches,cs_link_extern);
|
||||
include(initglobalswitches,cs_link_nolink);
|
||||
'o' :
|
||||
If UnsetBool(More, j) then
|
||||
exclude(initlocalswitches,cs_check_overflow)
|
||||
@ -675,9 +661,9 @@ begin
|
||||
'E' :
|
||||
begin
|
||||
if UnsetBool(More, 0) then
|
||||
exclude(initglobalswitches,cs_link_extern)
|
||||
exclude(initglobalswitches,cs_link_nolink)
|
||||
else
|
||||
include(initglobalswitches,cs_link_extern);
|
||||
include(initglobalswitches,cs_link_nolink);
|
||||
end;
|
||||
|
||||
'F' :
|
||||
@ -982,13 +968,13 @@ begin
|
||||
begin
|
||||
if UnsetBool(More, 0) then
|
||||
begin
|
||||
initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern];
|
||||
initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern,cs_link_nolink];
|
||||
if more<>'' then
|
||||
IllegalPara(opt);
|
||||
end
|
||||
else
|
||||
begin
|
||||
initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern];
|
||||
initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
|
||||
if more='h' then
|
||||
initglobalswitches:=initglobalswitches-[cs_link_on_target]
|
||||
else if more='t' then
|
||||
@ -1225,12 +1211,23 @@ begin
|
||||
while j<=length(more) do
|
||||
begin
|
||||
case More[j] of
|
||||
'c' : Cshared:=TRUE;
|
||||
'd' : Dontlinkstdlibpath:=TRUE;
|
||||
'e' :
|
||||
begin
|
||||
If UnsetBool(More, j) then
|
||||
exclude(initglobalswitches,cs_link_extern)
|
||||
else
|
||||
include(initglobalswitches,cs_link_extern);
|
||||
end;
|
||||
'f' :
|
||||
include(initglobalswitches,cs_link_pthread);
|
||||
'i' :
|
||||
begin
|
||||
If UnsetBool(More, j) then
|
||||
exclude(initglobalswitches,cs_link_internal)
|
||||
include(initglobalswitches,cs_link_extern)
|
||||
else
|
||||
include(initglobalswitches,cs_link_internal);
|
||||
exclude(initglobalswitches,cs_link_extern);
|
||||
end;
|
||||
'm' :
|
||||
begin
|
||||
@ -1239,8 +1236,12 @@ begin
|
||||
else
|
||||
include(initglobalswitches,cs_link_map);
|
||||
end;
|
||||
'f' :
|
||||
include(initglobalswitches,cs_link_pthread);
|
||||
'r' :
|
||||
begin
|
||||
rlinkpath:=Copy(more,2,length(More)-1);
|
||||
DefaultReplacements(rlinkpath);
|
||||
More:='';
|
||||
end;
|
||||
's' :
|
||||
begin
|
||||
If UnsetBool(More, j) then
|
||||
@ -1248,7 +1249,6 @@ begin
|
||||
else
|
||||
include(initglobalswitches,cs_link_strip);
|
||||
end;
|
||||
'c' : Cshared:=TRUE;
|
||||
't' :
|
||||
include(initglobalswitches,cs_link_staticflag);
|
||||
'v' :
|
||||
@ -1268,17 +1268,17 @@ begin
|
||||
include(initglobalswitches,cs_link_shared);
|
||||
LinkTypeSetExplicitly:=true;
|
||||
end;
|
||||
'd' : Dontlinkstdlibpath:=TRUE;
|
||||
'P' : Begin
|
||||
utilsprefix:=Copy(more,2,length(More)-1);
|
||||
DefaultReplacements(utilsprefix);
|
||||
More:='';
|
||||
End;
|
||||
'r' : Begin
|
||||
rlinkpath:=Copy(more,2,length(More)-1);
|
||||
DefaultReplacements(rlinkpath);
|
||||
More:='';
|
||||
end;
|
||||
'M' :
|
||||
begin
|
||||
mainaliasname:=Copy(more,2,length(More)-1);
|
||||
More:='';
|
||||
end;
|
||||
'P' :
|
||||
begin
|
||||
utilsprefix:=Copy(more,2,length(More)-1);
|
||||
DefaultReplacements(utilsprefix);
|
||||
More:='';
|
||||
end;
|
||||
'S' :
|
||||
begin
|
||||
def_system_macro('FPC_LINK_STATIC');
|
||||
@ -1299,11 +1299,6 @@ begin
|
||||
exclude(initglobalswitches,cs_link_shared);
|
||||
LinkTypeSetExplicitly:=true;
|
||||
end;
|
||||
'M' :
|
||||
begin
|
||||
mainaliasname:=Copy(more,2,length(More)-1);
|
||||
More:='';
|
||||
end;
|
||||
'-' :
|
||||
begin
|
||||
exclude(initglobalswitches,cs_link_staticflag);
|
||||
@ -2188,10 +2183,12 @@ begin
|
||||
set_target_asm(target_info.assemextern);
|
||||
end;
|
||||
|
||||
{ disable internal linker if it is not registered }
|
||||
if not assigned(target_info.link) and
|
||||
(cs_link_internal in initglobalswitches) then
|
||||
exclude(initglobalswitches,cs_link_internal);
|
||||
{ disable internal linker if it is not registered or
|
||||
if we skip the linking }
|
||||
if not(cs_link_extern in initglobalswitches) and
|
||||
(not assigned(target_info.link) or
|
||||
(cs_link_nolink in initglobalswitches)) then
|
||||
exclude(initglobalswitches,cs_link_extern);
|
||||
|
||||
{ turn off stripping if compiling with debuginfo or profile }
|
||||
if (cs_debuginfo in initmoduleswitches) or
|
||||
@ -2204,13 +2201,10 @@ begin
|
||||
|
||||
{ Section smartlinking conflicts with import sections on Windows }
|
||||
if GenerateImportSection and
|
||||
(target_info.system in [system_i386_win32]) then
|
||||
(target_info.system in [system_i386_win32,system_x86_64_win64]) then
|
||||
exclude(target_info.flags,tf_smartlink_sections);
|
||||
|
||||
if (cs_link_extern in initglobalswitches) then
|
||||
exclude(initglobalswitches,cs_link_internal);
|
||||
|
||||
if (cs_link_internal in initglobalswitches) then
|
||||
begin
|
||||
{ By default don't create import section if we use the internal linker }
|
||||
if not GenerateImportSectionSetExplicitly then
|
||||
|
@ -379,7 +379,7 @@ var
|
||||
StaticStr,
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -414,7 +414,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,true);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
@ -432,7 +432,7 @@ var
|
||||
|
||||
begin
|
||||
MakeSharedLibrary:=false;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -474,7 +474,7 @@ var
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||
|
@ -529,7 +529,7 @@ var
|
||||
StaticStr,
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -582,7 +582,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,LdSupportsNoResponseFile);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
@ -599,7 +599,7 @@ var
|
||||
success : boolean;
|
||||
begin
|
||||
MakeSharedLibrary:=false;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||
|
||||
{ Write used files and libraries }
|
||||
@ -637,7 +637,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||
|
@ -443,7 +443,7 @@ var
|
||||
ES: ExtStr;
|
||||
OutName: PathStr;
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -497,7 +497,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -242,7 +242,7 @@ var
|
||||
StaticStr,
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -282,7 +282,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -215,7 +215,7 @@ var
|
||||
success : boolean;
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -238,7 +238,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
RemoveFile(outputexedir+Info.ScriptName);
|
||||
@ -289,7 +289,7 @@ var
|
||||
zerobuf : pointer;
|
||||
begin
|
||||
{ when -s is used quit, because there is no .exe }
|
||||
if cs_link_extern in aktglobalswitches then
|
||||
if cs_link_nolink in aktglobalswitches then
|
||||
exit;
|
||||
{ open file }
|
||||
assign(f,n);
|
||||
|
@ -583,7 +583,7 @@ var
|
||||
StaticStr,
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -629,7 +629,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
if (success) then
|
||||
@ -650,7 +650,7 @@ var
|
||||
success : boolean;
|
||||
begin
|
||||
MakeSharedLibrary:=false;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||
|
||||
{ Write used files and libraries }
|
||||
@ -682,7 +682,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||
|
@ -210,7 +210,7 @@ var
|
||||
begin
|
||||
//TODO Only external link in MPW is possible, otherwise yell.
|
||||
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -248,7 +248,7 @@ begin
|
||||
success:=DoExec('Execute',CmdStr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -207,7 +207,7 @@ var
|
||||
StripStr: string[40];
|
||||
begin
|
||||
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
if not (cs_link_on_target in aktglobalswitches) then
|
||||
@ -251,7 +251,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -549,7 +549,7 @@ var
|
||||
xdcpresent,usexdc : boolean;
|
||||
f : file;
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -596,7 +596,7 @@ begin
|
||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
{ Call nlmconv }
|
||||
@ -608,7 +608,7 @@ begin
|
||||
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
||||
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
RemoveFile(outputexedir+'n'+Info.ResName);
|
||||
RemoveFile(outputexedir+tmpLinkFileName);
|
||||
|
@ -516,7 +516,7 @@ var
|
||||
success : boolean;
|
||||
StripStr : string[2];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -540,7 +540,7 @@ begin
|
||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
{ Call nlmconv }
|
||||
@ -552,7 +552,7 @@ begin
|
||||
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
||||
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
RemoveFile(outputexedir+'n'+Info.ResName);
|
||||
RemoveFile(outputexedir+tmpLinkFileName);
|
||||
|
@ -443,7 +443,7 @@ var
|
||||
ES: ExtStr;
|
||||
OutName: PathStr;
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -497,7 +497,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -162,7 +162,7 @@ var
|
||||
StripStr : string[40];
|
||||
i : longint;
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -194,7 +194,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -398,7 +398,7 @@ var
|
||||
StaticStr,
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -428,7 +428,7 @@ begin
|
||||
|
||||
{ Remove ReponseFile }
|
||||
{$IFNDEF LinkTest}
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
{$ENDIF}
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
@ -442,7 +442,7 @@ var
|
||||
success : boolean;
|
||||
begin
|
||||
MakeSharedLibrary:=false;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||
|
||||
{ Write used files and libraries }
|
||||
@ -465,7 +465,7 @@ begin
|
||||
|
||||
{ Remove ReponseFile }
|
||||
{$IFNDEF LinkTest}
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
{$ENDIF}
|
||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||
|
@ -137,7 +137,7 @@ var
|
||||
success : boolean;
|
||||
StripStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -157,7 +157,7 @@ begin
|
||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
|
||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||
|
@ -1212,7 +1212,7 @@ var
|
||||
EntryStr,
|
||||
ImageBaseStr : string[40];
|
||||
begin
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -1289,7 +1289,7 @@ begin
|
||||
success:=PostProcessExecutable(current_module.exefilename^,false);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
RemoveFile('base.$$$');
|
||||
@ -1318,7 +1318,7 @@ var
|
||||
ImageBaseStr : string[40];
|
||||
begin
|
||||
MakeSharedLibrary:=false;
|
||||
if not(cs_link_extern in aktglobalswitches) then
|
||||
if not(cs_link_nolink in aktglobalswitches) then
|
||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||
|
||||
{ Create some replacements }
|
||||
@ -1391,7 +1391,7 @@ begin
|
||||
success:=PostProcessExecutable(current_module.sharedlibfilename^,true);
|
||||
|
||||
{ Remove ReponseFile }
|
||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
RemoveFile(outputexedir+Info.ResName);
|
||||
RemoveFile('base.$$$');
|
||||
@ -1498,7 +1498,7 @@ var
|
||||
begin
|
||||
postprocessexecutable:=false;
|
||||
{ when -s is used or it's a dll then quit }
|
||||
if (cs_link_extern in aktglobalswitches) then
|
||||
if (cs_link_nolink in aktglobalswitches) then
|
||||
begin
|
||||
case apptype of
|
||||
app_native :
|
||||
@ -1687,7 +1687,6 @@ initialization
|
||||
RegisterTarget(system_i386_wince_info);
|
||||
{$endif i386}
|
||||
{$ifdef x86_64}
|
||||
RegisterExternalLinker(system_x64_win64_info,TLinkerWin32);
|
||||
RegisterInternalLinker(system_x64_win64_info,TPECoffLinker);
|
||||
RegisterImport(system_x86_64_win64,TImportLibWin32);
|
||||
RegisterExport(system_x86_64_win64,TExportLibWin32);
|
||||
|
Loading…
Reference in New Issue
Block a user