mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:09:20 +02:00
+ Patch from Christian Iversen to implement LIBPREFIX/SUFFIX/EXTENSION directives
This commit is contained in:
parent
bd9e93087c
commit
ff069c5ecc
@ -132,12 +132,14 @@ interface
|
|||||||
type
|
type
|
||||||
tmodulebase = class(TLinkedListItem)
|
tmodulebase = class(TLinkedListItem)
|
||||||
{ index }
|
{ index }
|
||||||
unit_index : longint; { global counter for browser }
|
unit_index : longint; { global counter for browser }
|
||||||
{ status }
|
{ status }
|
||||||
state : tmodulestate;
|
state : tmodulestate;
|
||||||
{ sources }
|
{ sources }
|
||||||
sourcefiles : tinputfilemanager;
|
sourcefiles : tinputfilemanager;
|
||||||
{ paths and filenames }
|
{ paths and filenames }
|
||||||
|
paramallowoutput : boolean; { original allowoutput parameter }
|
||||||
|
paramfn, { original filename }
|
||||||
path, { path where the module is find/created }
|
path, { path where the module is find/created }
|
||||||
outputpath, { path where the .s / .o / exe are created }
|
outputpath, { path where the .s / .o / exe are created }
|
||||||
modulename, { name of the module in uppercase }
|
modulename, { name of the module in uppercase }
|
||||||
@ -613,6 +615,9 @@ uses
|
|||||||
p : dirstr;
|
p : dirstr;
|
||||||
n : NameStr;
|
n : NameStr;
|
||||||
e : ExtStr;
|
e : ExtStr;
|
||||||
|
prefix,
|
||||||
|
suffix,
|
||||||
|
extension : NameStr;
|
||||||
begin
|
begin
|
||||||
stringdispose(objfilename);
|
stringdispose(objfilename);
|
||||||
stringdispose(newfilename);
|
stringdispose(newfilename);
|
||||||
@ -624,6 +629,8 @@ uses
|
|||||||
stringdispose(outputpath);
|
stringdispose(outputpath);
|
||||||
stringdispose(path);
|
stringdispose(path);
|
||||||
{ Create names }
|
{ Create names }
|
||||||
|
paramfn := stringdup(fn);
|
||||||
|
paramallowoutput := allowoutput;
|
||||||
fsplit(fn,p,n,e);
|
fsplit(fn,p,n,e);
|
||||||
n:=FixFileName(n);
|
n:=FixFileName(n);
|
||||||
{ set path }
|
{ set path }
|
||||||
@ -643,18 +650,25 @@ uses
|
|||||||
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 }
|
{ lib and exe could be loaded with a file specified with -o }
|
||||||
if AllowOutput and (OutputFile<>'') and (compile_level=1) then
|
prefix := target_info.sharedlibprefix;
|
||||||
n:=OutputFile;
|
suffix := '';
|
||||||
|
extension := target_info.sharedlibext;
|
||||||
|
|
||||||
|
if AllowOutput and (compile_level=1) then
|
||||||
|
begin
|
||||||
|
if OutputFile <> '' then n:=OutputFile;
|
||||||
|
if Assigned(OutputPrefix) then prefix := OutputPrefix^;
|
||||||
|
if Assigned(OutputSuffix) then suffix := OutputSuffix^;
|
||||||
|
if OutputExtension <> '' then extension := OutputExtension;
|
||||||
|
end;
|
||||||
|
|
||||||
staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
|
staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
|
||||||
{ output dir of exe can be specified separatly }
|
{ output dir of exe can be specified separatly }
|
||||||
if AllowOutput and (OutputExeDir<>'') then
|
if AllowOutput and (OutputExeDir<>'') then
|
||||||
p:=OutputExeDir
|
p:=OutputExeDir
|
||||||
else
|
else
|
||||||
p:=path^;
|
p:=path^;
|
||||||
if target_info.system in [system_i386_WIN32,system_i386_wdosx] then
|
sharedlibfilename:=stringdup(p+prefix+n+suffix+extension);
|
||||||
sharedlibfilename:=stringdup(p+n+target_info.sharedlibext)
|
|
||||||
else
|
|
||||||
sharedlibfilename:=stringdup(p+target_info.sharedlibprefix+n+target_info.sharedlibext);
|
|
||||||
exefilename:=stringdup(p+n+target_info.exeext);
|
exefilename:=stringdup(p+n+target_info.exeext);
|
||||||
mapfilename:=stringdup(p+n+'.map');
|
mapfilename:=stringdup(p+n+'.map');
|
||||||
end;
|
end;
|
||||||
@ -712,7 +726,10 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.25 2004-06-20 08:55:29 florian
|
Revision 1.26 2004-08-02 07:15:54 michael
|
||||||
|
+ Patch from Christian Iversen to implement LIBPREFIX/SUFFIX/EXTENSION directives
|
||||||
|
|
||||||
|
Revision 1.25 2004/06/20 08:55:29 florian
|
||||||
* logs truncated
|
* logs truncated
|
||||||
|
|
||||||
Revision 1.24 2004/06/16 20:07:07 florian
|
Revision 1.24 2004/06/16 20:07:07 florian
|
||||||
|
@ -112,14 +112,17 @@ interface
|
|||||||
|
|
||||||
var
|
var
|
||||||
{ specified inputfile }
|
{ specified inputfile }
|
||||||
inputdir : dirstr;
|
inputdir : dirstr;
|
||||||
inputfile : namestr;
|
inputfile : namestr;
|
||||||
inputextension : extstr;
|
inputextension : extstr;
|
||||||
{ specified outputfile with -o parameter }
|
{ specified outputfile with -o parameter }
|
||||||
outputfile : namestr;
|
outputfile : namestr;
|
||||||
|
outputprefix : pstring;
|
||||||
|
outputsuffix : pstring;
|
||||||
|
outputextension : namestr;
|
||||||
{ specified with -FE or -FU }
|
{ specified with -FE or -FU }
|
||||||
outputexedir : dirstr;
|
outputexedir : dirstr;
|
||||||
outputunitdir : dirstr;
|
outputunitdir : dirstr;
|
||||||
|
|
||||||
{ things specified with parameters }
|
{ things specified with parameters }
|
||||||
paralinkoptions,
|
paralinkoptions,
|
||||||
@ -1803,6 +1806,10 @@ implementation
|
|||||||
|
|
||||||
{ Output }
|
{ Output }
|
||||||
OutputFile:='';
|
OutputFile:='';
|
||||||
|
OutputPrefix:=Nil;
|
||||||
|
OutputSuffix:=Nil;
|
||||||
|
OutputExtension:='';
|
||||||
|
|
||||||
OutputExeDir:='';
|
OutputExeDir:='';
|
||||||
OutputUnitDir:='';
|
OutputUnitDir:='';
|
||||||
|
|
||||||
@ -1913,7 +1920,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.133 2004-07-17 15:51:57 jonas
|
Revision 1.134 2004-08-02 07:15:54 michael
|
||||||
|
+ Patch from Christian Iversen to implement LIBPREFIX/SUFFIX/EXTENSION directives
|
||||||
|
|
||||||
|
Revision 1.133 2004/07/17 15:51:57 jonas
|
||||||
* shell now returns an exitcode
|
* shell now returns an exitcode
|
||||||
* print an error if linking failed when linking was done using a script
|
* print an error if linking failed when linking was done using a script
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user