* Merge is complete for this file, cycles !

This commit is contained in:
mazen 2004-10-14 16:25:39 +00:00
parent 573ff47a1e
commit cdd920623b

View File

@ -29,7 +29,8 @@ interface
uses uses
cclasses, cclasses,
systems, systems,
fmodule; fmodule,
globtype;
Type Type
TLinkerInfo=record TLinkerInfo=record
@ -65,7 +66,7 @@ Type
Constructor Create;override; Constructor Create;override;
Destructor Destroy;override; Destructor Destroy;override;
Function FindUtil(const s:string):String; Function FindUtil(const s:string):String;
Function DoExec(const command,para:string;showinfo,useshell:boolean):boolean; Function DoExec(const command:string; para:TCmdStr;showinfo,useshell:boolean):boolean;
procedure SetDefaultInfo;virtual; procedure SetDefaultInfo;virtual;
Function MakeStaticLibrary:boolean;override; Function MakeStaticLibrary:boolean;override;
end; end;
@ -93,12 +94,12 @@ procedure DoneLinker;
Implementation Implementation
uses uses
{$ifdef Delphi} {$IFDEF USE_SYSUTILS}
dmisc, SysUtils,
{$else Delphi} {$ELSE USE_SYSUTILS}
dos, dos,
{$endif Delphi} {$ENDIF USE_SYSUTILS}
cutils,globtype, cutils,
script,globals,verbose,ppu, script,globals,verbose,ppu,
aasmbase,aasmtai,aasmcpu, aasmbase,aasmtai,aasmcpu,
ogbase,ogmap; ogbase,ogmap;
@ -479,7 +480,7 @@ begin
end; end;
Function TExternalLinker.DoExec(const command,para:string;showinfo,useshell:boolean):boolean; Function TExternalLinker.DoExec(const command:string; para:TCmdStr;showinfo,useshell:boolean):boolean;
var var
exitcode: longint; exitcode: longint;
begin begin
@ -489,6 +490,23 @@ begin
if useshell then if useshell then
exitcode := shell(maybequoted(command)+' '+para) exitcode := shell(maybequoted(command)+' '+para)
else else
{$IFDEF USE_SYSUTILS}
try
if ExecuteProcess(command,para) <> 0
then begin
Message(exec_e_error_while_linking);
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
DoExec:=false;
end;
except on E:EOSError do
begin
Message(exec_e_cant_call_linker);
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
DoExec:=false;
end;
end
end;
{$ELSE USE_SYSUTILS}
begin begin
swapvectors; swapvectors;
exec(command,para); exec(command,para);
@ -509,6 +527,7 @@ begin
DoExec:=false; DoExec:=false;
end; end;
end; end;
{$ENDIF USE_SYSUTILS}
{ Update asmres when externmode is set } { Update asmres when externmode is set }
if cs_link_extern in aktglobalswitches then if cs_link_extern in aktglobalswitches then
begin begin
@ -528,7 +547,7 @@ end;
Function TExternalLinker.MakeStaticLibrary:boolean; Function TExternalLinker.MakeStaticLibrary:boolean;
var var
smartpath, smartpath,
cmdstr, cmdstr : TCmdStr;
binstr : string; binstr : string;
success : boolean; success : boolean;
begin begin
@ -680,7 +699,10 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.44 2004-10-09 11:37:09 olle Revision 1.45 2004-10-14 16:25:39 mazen
* Merge is complete for this file, cycles !
Revision 1.44 2004/10/09 11:37:09 olle
* Exchanged hardcoded "./" to CurDirRelPath * Exchanged hardcoded "./" to CurDirRelPath
* In FindObjectFile, when link on target, special handling is now * In FindObjectFile, when link on target, special handling is now
only done for units. only done for units.