linking with cygwin fixed

This commit is contained in:
peter 2004-11-04 17:12:52 +00:00
parent 79e754cb8c
commit 2eb3dfd077

View File

@ -874,10 +874,10 @@ Var
HPath : TStringListItem; HPath : TStringListItem;
s,s2 : string; s,s2 : string;
i : integer; i : integer;
linklibc : boolean; linklibcygwin : boolean;
begin begin
WriteResponseFile:=False; WriteResponseFile:=False;
linklibc:=false; linklibcygwin:=(SharedLibFiles.Find('cygwin')<>nil);
{ Open link.res file } { Open link.res file }
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
@ -904,8 +904,14 @@ begin
else else
if (cs_profile in aktmoduleswitches) then if (cs_profile in aktmoduleswitches) then
LinkRes.AddFileName(MaybeQuoted(FindObjectFile('gprt0','',false))) LinkRes.AddFileName(MaybeQuoted(FindObjectFile('gprt0','',false)))
else
begin
if linklibcygwin then
LinkRes.AddFileName(MaybeQuoted(FindObjectFile('wcygprt0','',false)))
else else
LinkRes.AddFileName(MaybeQuoted(FindObjectFile('wprt0','',false))); LinkRes.AddFileName(MaybeQuoted(FindObjectFile('wprt0','',false)));
end;
while not ObjectFiles.Empty do while not ObjectFiles.Empty do
begin begin
s:=ObjectFiles.GetFirst; s:=ObjectFiles.GetFirst;
@ -949,22 +955,11 @@ begin
end; end;
if pos(target_info.sharedlibprefix,s)=1 then if pos(target_info.sharedlibprefix,s)=1 then
s:=copy(s,length(target_info.sharedlibprefix)+1,255); s:=copy(s,length(target_info.sharedlibprefix)+1,255);
if s<>'c' then
begin
i:=Pos(target_info.sharedlibext,S); i:=Pos(target_info.sharedlibext,S);
if i>0 then if i>0 then
Delete(S,i,255); Delete(S,i,255);
LinkRes.Add('-l'+s); LinkRes.Add('-l'+s);
end
else
begin
LinkRes.Add('-l'+s);
linklibc:=true;
end; end;
end;
{ be sure that libc is the last lib }
if linklibc then
LinkRes.Add('-lc');
LinkRes.Add(')'); LinkRes.Add(')');
end; end;
@ -1617,7 +1612,10 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.40 2004-10-25 15:38:41 peter Revision 1.41 2004-11-04 17:12:52 peter
linking with cygwin fixed
Revision 1.40 2004/10/25 15:38:41 peter
* heap and heapsize removed * heap and heapsize removed
* checkpointer fixes * checkpointer fixes