mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-29 03:42:36 +02:00
+ made fpc work as an MPW tool, by itself calling asm and link.
This commit is contained in:
parent
2a4605eabc
commit
a06d889f52
@ -106,16 +106,74 @@ procedure TLinkerMPW.SetDefaultInfo;
|
|||||||
begin
|
begin
|
||||||
with Info do
|
with Info do
|
||||||
begin
|
begin
|
||||||
ExeCmd[1]:='PPCLink $OPT $DYNLINK $STATIC $STRIP -tocdataref off -dead on -o $EXE -@filelist $RES';
|
ExeCmd[1]:='Execute $RES'; {The link.res file contains the whole link command.}
|
||||||
DllCmd[1]:='PPCLink $OPT $INIT $FINI $SONAME -shared -o $EXE -@filelist $RES';
|
//ExeCmd[1]:='PPCLink $OPT $DYNLINK $STATIC $STRIP -tocdataref off -dead on -o $EXE -@filelist $RES';
|
||||||
|
//DllCmd[1]:='PPCLink $OPT $INIT $FINI $SONAME -shared -o $EXE -@filelist $RES';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TLinkerMPW.WriteResponseFile(isdll:boolean) : Boolean;
|
Function TLinkerMPW.WriteResponseFile(isdll:boolean) : Boolean;
|
||||||
|
Var
|
||||||
|
linkres : TLinkRes;
|
||||||
|
s: string;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
WriteResponseFile:=False;
|
WriteResponseFile:=False;
|
||||||
|
{ Open link.res file }
|
||||||
|
linkRes:=TLinkRes.Create(outputexedir+Info.ResName);
|
||||||
|
|
||||||
|
with linkRes do
|
||||||
|
begin
|
||||||
|
{#182 is escape char in MPW (analog to backslash in unix). The space}
|
||||||
|
{ensures there is whitespace separating items.}
|
||||||
|
Add('PPCLink '#182);
|
||||||
|
|
||||||
|
{ Add MPW standard libraries}
|
||||||
|
if apptype = app_cui then
|
||||||
|
Add('"{PPCLibraries}PPCSIOW.o" '#182);
|
||||||
|
|
||||||
|
if (apptype = app_tool) or (apptype = app_cui) then
|
||||||
|
Add('"{PPCLibraries}PPCToolLibs.o" '#182);
|
||||||
|
|
||||||
|
Add('"{SharedLibraries}InterfaceLib" '#182);
|
||||||
|
Add('"{SharedLibraries}StdCLib" '#182);
|
||||||
|
Add('"{SharedLibraries}MathLib" '#182);
|
||||||
|
Add('"{PPCLibraries}StdCRuntime.o" '#182);
|
||||||
|
Add('"{PPCLibraries}PPCCRuntime.o" '#182);
|
||||||
|
|
||||||
|
{Add main objectfiles}
|
||||||
|
while not ObjectFiles.Empty do
|
||||||
|
begin
|
||||||
|
s:=ObjectFiles.GetFirst;
|
||||||
|
if s<>'' then
|
||||||
|
Add(s+' '#182);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{Add last lines of the link command}
|
||||||
|
if apptype = app_tool then
|
||||||
|
Add('-t "MPST" -c "MPS " '#182);
|
||||||
|
|
||||||
|
if apptype = app_cui then {If SIOW, to avoid some warnings.}
|
||||||
|
Add('-ignoredups __start -ignoredups .__start -ignoredups main -ignoredups .main '#182);
|
||||||
|
|
||||||
|
Add('-tocdataref off -sym on -dead on -o '+ ScriptFixFileName(current_module.exefilename^));
|
||||||
|
|
||||||
|
Add('Exit If "{Status}" != 0');
|
||||||
|
|
||||||
|
{Add mac resources}
|
||||||
|
if apptype = app_cui then
|
||||||
|
begin
|
||||||
|
Add('Rez -append "{RIncludes}"SIOW.r -o ' + ScriptFixFileName(current_module.exefilename^));
|
||||||
|
Add('Exit If "{Status}" != 0');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Write and Close response }
|
||||||
|
linkres.writetodisk;
|
||||||
|
linkres.Free;
|
||||||
|
|
||||||
|
WriteResponseFile:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -161,49 +219,8 @@ begin
|
|||||||
|
|
||||||
with AsmRes do
|
with AsmRes do
|
||||||
begin
|
begin
|
||||||
{#182 is escape char in MPW (analog to backslash in unix). The space}
|
WriteResponseFile(false);
|
||||||
{ensures there is whitespace separating items.}
|
success:=DoExec('Execute',CmdStr,true,false);
|
||||||
Add('PPCLink '#182);
|
|
||||||
|
|
||||||
{ Add MPW standard libraries}
|
|
||||||
if apptype = app_cui then
|
|
||||||
begin
|
|
||||||
Add('"{PPCLibraries}PPCSIOW.o" '#182);
|
|
||||||
Add('"{PPCLibraries}PPCToolLibs.o" '#182);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Add('"{SharedLibraries}InterfaceLib" '#182);
|
|
||||||
Add('"{SharedLibraries}StdCLib" '#182);
|
|
||||||
Add('"{SharedLibraries}MathLib" '#182);
|
|
||||||
Add('"{PPCLibraries}StdCRuntime.o" '#182);
|
|
||||||
Add('"{PPCLibraries}PPCCRuntime.o" '#182);
|
|
||||||
|
|
||||||
{Add main objectfiles}
|
|
||||||
while not ObjectFiles.Empty do
|
|
||||||
begin
|
|
||||||
s:=ObjectFiles.GetFirst;
|
|
||||||
if s<>'' then
|
|
||||||
Add(s+' '#182);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{Add last lines of the link command}
|
|
||||||
if apptype = app_tool then
|
|
||||||
Add('-t "MPST" -c "MPS " '#182);
|
|
||||||
|
|
||||||
if apptype = app_cui then {If SIOW, to avoid some warnings.}
|
|
||||||
Add('-ignoredups __start -ignoredups .__start -ignoredups main -ignoredups .main '#182);
|
|
||||||
|
|
||||||
Add('-tocdataref off -sym on -dead on -o '+ ScriptFixFileName(current_module.exefilename^));
|
|
||||||
|
|
||||||
Add('Exit If "{Status}" != 0');
|
|
||||||
|
|
||||||
{Add mac resources}
|
|
||||||
if apptype = app_cui then
|
|
||||||
begin
|
|
||||||
Add('Rez -append "{RIncludes}"SIOW.r -o ' + ScriptFixFileName(current_module.exefilename^));
|
|
||||||
Add('Exit If "{Status}" != 0');
|
|
||||||
end;
|
|
||||||
success:= true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
@ -228,7 +245,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.10 2004-06-20 08:55:32 florian
|
Revision 1.11 2004-08-20 10:30:00 olle
|
||||||
|
+ made fpc work as an MPW tool, by itself calling asm and link.
|
||||||
|
|
||||||
|
Revision 1.10 2004/06/20 08:55:32 florian
|
||||||
* logs truncated
|
* logs truncated
|
||||||
|
|
||||||
Revision 1.9 2004/05/11 18:24:39 olle
|
Revision 1.9 2004/05/11 18:24:39 olle
|
||||||
|
Loading…
Reference in New Issue
Block a user