mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 13:39:36 +02:00
* Fix getlibraryfilename: do not add .so if output already contains it, do not add lib prefix if output already contains it. Take care of -o option
This commit is contained in:
parent
354c4ddcc1
commit
b83673ecf9
@ -9898,11 +9898,20 @@ end;
|
||||
|
||||
|
||||
function TTarget.GetBinFileBase: String;
|
||||
|
||||
var
|
||||
S : String;
|
||||
|
||||
begin
|
||||
if FExeName <> '' then
|
||||
Result := FExeName
|
||||
else
|
||||
begin
|
||||
Result:=Name;
|
||||
for S in Options do
|
||||
if Copy(S,1,2)='-o' then
|
||||
Result:=Copy(S,3);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -9919,9 +9928,12 @@ end;
|
||||
|
||||
function TTarget.GetLibraryFileName(AOS : TOS): String;
|
||||
begin
|
||||
result := AddLibraryExtension(GetBinFileBase, AOS);
|
||||
Result:=GetBinFileBase;
|
||||
if ExtractFileExt(Result)='' then
|
||||
result := AddLibraryExtension(Result, AOS);
|
||||
if aOS in AllUnixOSes then
|
||||
Result:='lib'+Result;
|
||||
if Copy(Result,1,3)<>'lib' then
|
||||
Result:='lib'+Result;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user