mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 10:52:50 +02:00
* fixed -o for sharedlibrary
git-svn-id: trunk@5991 -
This commit is contained in:
parent
8bf63f4f69
commit
5531ac8c91
@ -603,8 +603,7 @@ uses
|
|||||||
|
|
||||||
procedure tmodulebase.setfilename(const fn:string;allowoutput:boolean);
|
procedure tmodulebase.setfilename(const fn:string;allowoutput:boolean);
|
||||||
var
|
var
|
||||||
p,n,e,
|
p,n,
|
||||||
extension,
|
|
||||||
prefix,
|
prefix,
|
||||||
suffix : string;
|
suffix : string;
|
||||||
begin
|
begin
|
||||||
@ -624,7 +623,6 @@ uses
|
|||||||
paramallowoutput := allowoutput;
|
paramallowoutput := allowoutput;
|
||||||
p := FixPath(ExtractFilePath(fn),false);
|
p := FixPath(ExtractFilePath(fn),false);
|
||||||
n := FixFileName(ChangeFileExt(ExtractFileName(fn),''));
|
n := FixFileName(ChangeFileExt(ExtractFileName(fn),''));
|
||||||
e := ExtractFileExt(fn);
|
|
||||||
{ set path }
|
{ set path }
|
||||||
path:=stringdup(p);
|
path:=stringdup(p);
|
||||||
{ obj,asm,ppu names }
|
{ obj,asm,ppu names }
|
||||||
@ -640,23 +638,6 @@ uses
|
|||||||
asmfilename:=stringdup(p+n+target_info.asmext);
|
asmfilename:=stringdup(p+n+target_info.asmext);
|
||||||
objfilename:=stringdup(p+n+target_info.objext);
|
objfilename:=stringdup(p+n+target_info.objext);
|
||||||
ppufilename:=stringdup(p+n+target_info.unitext);
|
ppufilename:=stringdup(p+n+target_info.unitext);
|
||||||
{ lib and exe could be loaded with a file specified with -o }
|
|
||||||
prefix := target_info.sharedlibprefix;
|
|
||||||
suffix := '';
|
|
||||||
extension := target_info.sharedlibext;
|
|
||||||
|
|
||||||
if AllowOutput and (compile_level=1) then
|
|
||||||
begin
|
|
||||||
if OutputFileName <> '' then
|
|
||||||
n:=OutputFileName;
|
|
||||||
if Assigned(OutputPrefix) then
|
|
||||||
prefix := OutputPrefix^;
|
|
||||||
if Assigned(OutputSuffix) then
|
|
||||||
suffix := OutputSuffix^;
|
|
||||||
if ExtractFileExt(OutputFileName) <> '' then
|
|
||||||
extension := ExtractFileExt(OutputFileName);
|
|
||||||
end;
|
|
||||||
|
|
||||||
importlibfilename:=stringdup(p+target_info.staticClibprefix+'imp'+n+target_info.staticlibext);
|
importlibfilename:=stringdup(p+target_info.staticClibprefix+'imp'+n+target_info.staticlibext);
|
||||||
staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
|
staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
|
||||||
|
|
||||||
@ -665,13 +646,28 @@ uses
|
|||||||
p:=OutputExeDir
|
p:=OutputExeDir
|
||||||
else
|
else
|
||||||
p:=path^;
|
p:=path^;
|
||||||
sharedlibfilename:=stringdup(p+prefix+n+suffix+extension);
|
|
||||||
|
|
||||||
{ don't use extension alone to check, it can be empty !! }
|
{ lib and exe could be loaded with a file specified with -o }
|
||||||
if (OutputFileName<>'')then
|
if AllowOutput and
|
||||||
exefilename:=stringdup(p+OutputFileName)
|
(compile_level=1) and
|
||||||
|
(OutputFileName<>'')then
|
||||||
|
begin
|
||||||
|
exefilename:=stringdup(p+OutputFileName);
|
||||||
|
sharedlibfilename:=stringdup(p+OutputFileName);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
exefilename:=stringdup(p+n+target_info.exeext);
|
begin
|
||||||
|
exefilename:=stringdup(p+n+target_info.exeext);
|
||||||
|
if Assigned(OutputPrefix) then
|
||||||
|
prefix := OutputPrefix^
|
||||||
|
else
|
||||||
|
prefix := target_info.sharedlibprefix;
|
||||||
|
if Assigned(OutputSuffix) then
|
||||||
|
suffix := OutputSuffix^
|
||||||
|
else
|
||||||
|
suffix := '';
|
||||||
|
sharedlibfilename:=stringdup(p+prefix+n+suffix+target_info.sharedlibext);
|
||||||
|
end;
|
||||||
mapfilename:=stringdup(p+n+'.map');
|
mapfilename:=stringdup(p+n+'.map');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user