mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 06:48:31 +02:00
* palmos support from v10 merged
This commit is contained in:
parent
7b45b6a4a9
commit
fd8e5fa78c
@ -231,6 +231,12 @@ interface
|
|||||||
{ for error info in pp.pas }
|
{ for error info in pp.pas }
|
||||||
parser_current_file : string = '';
|
parser_current_file : string = '';
|
||||||
|
|
||||||
|
{$ifdef m68k}
|
||||||
|
{ PalmOS resources }
|
||||||
|
palmos_applicationname : string = 'FPC Application';
|
||||||
|
palmos_applicationid : string[4] = 'FPCA';
|
||||||
|
{$endif m68k}
|
||||||
|
|
||||||
|
|
||||||
procedure abstract;
|
procedure abstract;
|
||||||
|
|
||||||
@ -1327,7 +1333,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.40 2001-08-04 10:23:54 peter
|
Revision 1.41 2001-08-19 11:22:22 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.40 2001/08/04 10:23:54 peter
|
||||||
* updates so it works with the ide
|
* updates so it works with the ide
|
||||||
|
|
||||||
Revision 1.39 2001/07/01 20:16:15 peter
|
Revision 1.39 2001/07/01 20:16:15 peter
|
||||||
|
@ -27,7 +27,8 @@ unit link;
|
|||||||
|
|
||||||
{ Needed for LFN support in path to the executable }
|
{ Needed for LFN support in path to the executable }
|
||||||
{$ifdef GO32V2}
|
{$ifdef GO32V2}
|
||||||
{$define ALWAYSSHELL}
|
{ define ALWAYSSHELL, obsolete as go32v2 Dos.Exec
|
||||||
|
now handles LFN names and converts them to SFN PM }
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -482,7 +483,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.20 2001-08-13 19:26:03 peter
|
Revision 1.21 2001-08-19 11:22:22 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.20 2001/08/13 19:26:03 peter
|
||||||
* fixed ordering of object and libraries
|
* fixed ordering of object and libraries
|
||||||
|
|
||||||
Revision 1.19 2001/08/07 18:47:12 peter
|
Revision 1.19 2001/08/07 18:47:12 peter
|
||||||
|
@ -261,7 +261,7 @@ scan_w_unsupported_app_type=02044_W_Unsupported application type: "$1"
|
|||||||
% with the directive \var{\{\$APPTYPE\}}
|
% with the directive \var{\{\$APPTYPE\}}
|
||||||
scan_w_app_type_not_support=02045_W_APPTYPE isn't support by the target OS
|
scan_w_app_type_not_support=02045_W_APPTYPE isn't support by the target OS
|
||||||
% The \var{\{\$APPTYPE\}} directive is supported by win32 applications only.
|
% The \var{\{\$APPTYPE\}} directive is supported by win32 applications only.
|
||||||
scan_w_decription_not_support=02046_W_DESCRIPTION is only supported for OS2 and Win32
|
scan_w_description_not_support=02046_W_DESCRIPTION is only supported for OS2 and Win32
|
||||||
% The \var{\{\$DESCRIPTION\}} directive is only supported for OS2 and Win32 targets.
|
% The \var{\{\$DESCRIPTION\}} directive is only supported for OS2 and Win32 targets.
|
||||||
scan_n_version_not_support=02047_N_VERSION is not supported by target OS.
|
scan_n_version_not_support=02047_N_VERSION is not supported by target OS.
|
||||||
% The \var{\{\$VERSION\}} directive is only supported by win32 target.
|
% The \var{\{\$VERSION\}} directive is only supported by win32 target.
|
||||||
@ -296,6 +296,11 @@ scan_w_macro_support_turned_off=02057_W_Macro support has been turned off
|
|||||||
% so the declaration will be ignored. To turn macro support on compile with
|
% so the declaration will be ignored. To turn macro support on compile with
|
||||||
% -Sm on the commandline or add {$MACRO ON} in the source
|
% -Sm on the commandline or add {$MACRO ON} in the source
|
||||||
scan_e_invalid_interface_type=02058_E_Illegal interface type specified. Valids are COM, CORBA or DEFAULT.
|
scan_e_invalid_interface_type=02058_E_Illegal interface type specified. Valids are COM, CORBA or DEFAULT.
|
||||||
|
% The interface type that was specified is not supported
|
||||||
|
scan_w_appid_not_support=02059_W_APPID is only supported for PalmOS
|
||||||
|
% The \var{\{\$APPID\}} directive is only supported for the PalmOS target.
|
||||||
|
scan_w_appname_not_support=02060_W_APPNAME is only supported for PalmOS
|
||||||
|
% The \var{\{\$APPNAME\}} directive is only supported for the PalmOS target.
|
||||||
% \end{description}
|
% \end{description}
|
||||||
#
|
#
|
||||||
# Parser
|
# Parser
|
||||||
|
@ -62,7 +62,7 @@ const
|
|||||||
scan_t_back_in=02043;
|
scan_t_back_in=02043;
|
||||||
scan_w_unsupported_app_type=02044;
|
scan_w_unsupported_app_type=02044;
|
||||||
scan_w_app_type_not_support=02045;
|
scan_w_app_type_not_support=02045;
|
||||||
scan_w_decription_not_support=02046;
|
scan_w_description_not_support=02046;
|
||||||
scan_n_version_not_support=02047;
|
scan_n_version_not_support=02047;
|
||||||
scan_n_only_exe_version=02048;
|
scan_n_only_exe_version=02048;
|
||||||
scan_w_wrong_version_ignored=02049;
|
scan_w_wrong_version_ignored=02049;
|
||||||
@ -75,6 +75,8 @@ const
|
|||||||
scan_w_only_one_resourcefile_supported=02056;
|
scan_w_only_one_resourcefile_supported=02056;
|
||||||
scan_w_macro_support_turned_off=02057;
|
scan_w_macro_support_turned_off=02057;
|
||||||
scan_e_invalid_interface_type=02058;
|
scan_e_invalid_interface_type=02058;
|
||||||
|
scan_w_appid_not_support=02059;
|
||||||
|
scan_w_appname_not_support=02060;
|
||||||
parser_e_syntax_error=03000;
|
parser_e_syntax_error=03000;
|
||||||
parser_w_proc_far_ignored=03001;
|
parser_w_proc_far_ignored=03001;
|
||||||
parser_w_proc_near_ignored=03002;
|
parser_w_proc_near_ignored=03002;
|
||||||
@ -592,9 +594,9 @@ const
|
|||||||
option_info=11024;
|
option_info=11024;
|
||||||
option_help_pages=11025;
|
option_help_pages=11025;
|
||||||
|
|
||||||
MsgTxtSize = 33103;
|
MsgTxtSize = 33191;
|
||||||
|
|
||||||
MsgIdxMax : array[1..20] of longint=(
|
MsgIdxMax : array[1..20] of longint=(
|
||||||
17,59,179,37,41,41,98,14,35,42,
|
17,61,179,37,41,41,98,14,35,42,
|
||||||
30,1,1,1,1,1,1,1,1,1
|
30,1,1,1,1,1,1,1,1,1
|
||||||
);
|
);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,7 @@ type
|
|||||||
procedure Interpret_file(const filename : string);
|
procedure Interpret_file(const filename : string);
|
||||||
procedure Read_Parameters;
|
procedure Read_Parameters;
|
||||||
procedure parsecmd(cmd:string);
|
procedure parsecmd(cmd:string);
|
||||||
|
procedure TargetDefines(def:boolean);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TOptionClass=class of toption;
|
TOptionClass=class of toption;
|
||||||
@ -729,7 +730,7 @@ begin
|
|||||||
if not target_is_set then
|
if not target_is_set then
|
||||||
begin
|
begin
|
||||||
{ remove old target define }
|
{ remove old target define }
|
||||||
undef_symbol(upper(target_info.shortname));
|
TargetDefines(false);
|
||||||
{ Save assembler if set }
|
{ Save assembler if set }
|
||||||
if asm_is_set then
|
if asm_is_set then
|
||||||
forceasm:=target_asm.id;
|
forceasm:=target_asm.id;
|
||||||
@ -740,7 +741,7 @@ begin
|
|||||||
if asm_is_set then
|
if asm_is_set then
|
||||||
set_target_asm(forceasm);
|
set_target_asm(forceasm);
|
||||||
{ set new define }
|
{ set new define }
|
||||||
def_symbol(upper(target_info.shortname));
|
TargetDefines(true);
|
||||||
target_is_set:=true;
|
target_is_set:=true;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1241,6 +1242,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TOption.TargetDefines(def:boolean);
|
||||||
|
var
|
||||||
|
s : string;
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
if def then
|
||||||
|
def_symbol(upper(target_info.shortname))
|
||||||
|
else
|
||||||
|
undef_symbol(upper(target_info.shortname));
|
||||||
|
s:=target_info.extradefines;
|
||||||
|
while (s<>'') do
|
||||||
|
begin
|
||||||
|
i:=pos(';',s);
|
||||||
|
if i=0 then
|
||||||
|
i:=length(s)+1;
|
||||||
|
if def then
|
||||||
|
def_symbol(Copy(s,1,i-1))
|
||||||
|
else
|
||||||
|
def_symbol(Copy(s,1,i-1));
|
||||||
|
delete(s,1,i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor TOption.create;
|
constructor TOption.create;
|
||||||
begin
|
begin
|
||||||
DoWriteLogo:=false;
|
DoWriteLogo:=false;
|
||||||
@ -1437,15 +1462,7 @@ begin
|
|||||||
StopOptions;
|
StopOptions;
|
||||||
|
|
||||||
{ Non-core target defines }
|
{ Non-core target defines }
|
||||||
s:=target_info.extradefines;
|
Option.TargetDefines(true);
|
||||||
while (s<>'') do
|
|
||||||
begin
|
|
||||||
i:=pos(';',s);
|
|
||||||
if i=0 then
|
|
||||||
i:=length(s)+1;
|
|
||||||
def_symbol(Copy(s,1,i-1));
|
|
||||||
delete(s,1,i);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ endian define }
|
{ endian define }
|
||||||
case target_info.endian of
|
case target_info.endian of
|
||||||
@ -1567,10 +1584,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
UpdateAlignment(initalignment,option.paraalignment);
|
UpdateAlignment(initalignment,option.paraalignment);
|
||||||
|
|
||||||
{ Set defines depending on the target }
|
|
||||||
if (target_info.target in [target_i386_GO32V1,target_i386_GO32V2]) then
|
|
||||||
def_symbol('DPMI'); { MSDOS is not defined in BP when target is DPMI }
|
|
||||||
|
|
||||||
option.free;
|
option.free;
|
||||||
Option:=nil;
|
Option:=nil;
|
||||||
end;
|
end;
|
||||||
@ -1584,7 +1597,10 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.54 2001-08-12 17:57:06 peter
|
Revision 1.55 2001-08-19 11:22:23 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.54 2001/08/12 17:57:06 peter
|
||||||
* under development flag for targets
|
* under development flag for targets
|
||||||
|
|
||||||
Revision 1.53 2001/08/07 18:42:46 peter
|
Revision 1.53 2001/08/07 18:42:46 peter
|
||||||
|
@ -1386,9 +1386,9 @@ const
|
|||||||
mutexclpo : [po_external]
|
mutexclpo : [po_external]
|
||||||
),(
|
),(
|
||||||
idtok:_SYSCALL;
|
idtok:_SYSCALL;
|
||||||
pd_flags : pd_interface+pd_notobjintf;
|
pd_flags : pd_interface+pd_implemen+pd_notobjintf;
|
||||||
handler : {$ifdef FPCPROCVAR}@{$endif}pd_syscall;
|
handler : {$ifdef FPCPROCVAR}@{$endif}pd_syscall;
|
||||||
pocall : [pocall_palmossyscall];
|
pocall : [pocall_palmossyscall,pocall_cdecl,pocall_clearstack];
|
||||||
pooption : [];
|
pooption : [];
|
||||||
mutexclpocall : [pocall_cdecl,pocall_cppdecl,pocall_inline,
|
mutexclpocall : [pocall_cdecl,pocall_cppdecl,pocall_inline,
|
||||||
pocall_internproc,pocall_leftright];
|
pocall_internproc,pocall_leftright];
|
||||||
@ -1910,7 +1910,10 @@ const
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.31 2001-08-05 13:18:50 peter
|
Revision 1.32 2001-08-19 11:22:23 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.31 2001/08/05 13:18:50 peter
|
||||||
* turn pocall_inline off when inline is not supported
|
* turn pocall_inline off when inline is not supported
|
||||||
|
|
||||||
Revision 1.30 2001/08/01 15:07:29 jonas
|
Revision 1.30 2001/08/01 15:07:29 jonas
|
||||||
|
@ -1208,10 +1208,6 @@ implementation
|
|||||||
aktprocsym.definition.aliasnames.insert('program_init');
|
aktprocsym.definition.aliasnames.insert('program_init');
|
||||||
aktprocsym.definition.aliasnames.insert('PASCALMAIN');
|
aktprocsym.definition.aliasnames.insert('PASCALMAIN');
|
||||||
aktprocsym.definition.aliasnames.insert(target_info.cprefix+'main');
|
aktprocsym.definition.aliasnames.insert(target_info.cprefix+'main');
|
||||||
{$ifdef m68k}
|
|
||||||
if target_info.target=target_m68k_PalmOS then
|
|
||||||
aktprocsym.definition.aliasnames.insert('PilotMain');
|
|
||||||
{$endif m68k}
|
|
||||||
end;
|
end;
|
||||||
compile_proc_body(true,false);
|
compile_proc_body(true,false);
|
||||||
|
|
||||||
@ -1339,7 +1335,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.43 2001-08-12 19:59:49 peter
|
Revision 1.44 2001-08-19 11:22:23 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.43 2001/08/12 19:59:49 peter
|
||||||
* typo in extdebug msg
|
* typo in extdebug msg
|
||||||
|
|
||||||
Revision 1.42 2001/08/06 21:40:47 peter
|
Revision 1.42 2001/08/06 21:40:47 peter
|
||||||
|
@ -156,6 +156,28 @@ implementation
|
|||||||
Message1(scan_w_unsupported_asmmode_specifier,s);
|
Message1(scan_w_unsupported_asmmode_specifier,s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifdef m68k}
|
||||||
|
procedure dir_appid;
|
||||||
|
begin
|
||||||
|
if target_info.target<>target_m68k_palmos then
|
||||||
|
Message(scan_w_appid_not_support);
|
||||||
|
{ change description global var in all cases }
|
||||||
|
{ it not used but in win32 and os2 }
|
||||||
|
current_scanner^.skipspace;
|
||||||
|
palmos_applicationid:=current_scanner^.readcomment;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure dir_appname;
|
||||||
|
begin
|
||||||
|
if target_info.target<>target_m68k_palmos then
|
||||||
|
Message(scan_w_appname_not_support);
|
||||||
|
{ change description global var in all cases }
|
||||||
|
{ it not used but in win32 and os2 }
|
||||||
|
current_scanner^.skipspace;
|
||||||
|
palmos_applicationname:=current_scanner^.readcomment;
|
||||||
|
end;
|
||||||
|
{$endif m68k}
|
||||||
|
|
||||||
procedure dir_apptype;
|
procedure dir_apptype;
|
||||||
var
|
var
|
||||||
hs : string;
|
hs : string;
|
||||||
@ -198,7 +220,7 @@ implementation
|
|||||||
procedure dir_description;
|
procedure dir_description;
|
||||||
begin
|
begin
|
||||||
if not (target_info.target in [target_i386_os2,target_i386_win32,target_i386_netware]) then
|
if not (target_info.target in [target_i386_os2,target_i386_win32,target_i386_netware]) then
|
||||||
Message(scan_w_decription_not_support);
|
Message(scan_w_description_not_support);
|
||||||
{ change description global var in all cases }
|
{ change description global var in all cases }
|
||||||
{ it not used but in win32, os2 and netware }
|
{ it not used but in win32, os2 and netware }
|
||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
@ -810,6 +832,10 @@ implementation
|
|||||||
procedure InitScannerDirectives;
|
procedure InitScannerDirectives;
|
||||||
begin
|
begin
|
||||||
AddDirective('ALIGN',{$ifdef FPCPROCVAR}@{$endif}dir_align);
|
AddDirective('ALIGN',{$ifdef FPCPROCVAR}@{$endif}dir_align);
|
||||||
|
{$ifdef m68k}
|
||||||
|
AddDirective('APPID',{$ifdef FPCPROCVAR}@{$endif}dir_appid);
|
||||||
|
AddDirective('APPNAME',{$ifdef FPCPROCVAR}@{$endif}dir_appname);
|
||||||
|
{$endif m68k}
|
||||||
AddDirective('APPTYPE',{$ifdef FPCPROCVAR}@{$endif}dir_apptype);
|
AddDirective('APPTYPE',{$ifdef FPCPROCVAR}@{$endif}dir_apptype);
|
||||||
AddDirective('ASMMODE',{$ifdef FPCPROCVAR}@{$endif}dir_asmmode);
|
AddDirective('ASMMODE',{$ifdef FPCPROCVAR}@{$endif}dir_asmmode);
|
||||||
AddDirective('ASSERTIONS',{$ifdef FPCPROCVAR}@{$endif}dir_assertions);
|
AddDirective('ASSERTIONS',{$ifdef FPCPROCVAR}@{$endif}dir_assertions);
|
||||||
@ -887,7 +913,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2001-08-07 18:47:13 peter
|
Revision 1.7 2001-08-19 11:22:24 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.6 2001/08/07 18:47:13 peter
|
||||||
* merged netbsd start
|
* merged netbsd start
|
||||||
* profile for win32
|
* profile for win32
|
||||||
|
|
||||||
|
@ -69,7 +69,8 @@ interface
|
|||||||
as_i386_nasmelf,as_i386_nasmobj,
|
as_i386_nasmelf,as_i386_nasmobj,
|
||||||
as_i386_tasm,as_i386_masm,
|
as_i386_tasm,as_i386_masm,
|
||||||
as_i386_dbg,as_i386_coff,as_i386_pecoff,as_i386_elf32
|
as_i386_dbg,as_i386_coff,as_i386_pecoff,as_i386_elf32
|
||||||
,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
|
,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,
|
||||||
|
as_m68k_mpw,as_m68k_palm
|
||||||
,as_alpha_as
|
,as_alpha_as
|
||||||
,as_powerpc_as,as_powerpc_mpw
|
,as_powerpc_as,as_powerpc_mpw
|
||||||
);
|
);
|
||||||
@ -152,6 +153,9 @@ interface
|
|||||||
ttargetflags = (tf_none,
|
ttargetflags = (tf_none,
|
||||||
tf_under_development,tf_supports_stack_checking,
|
tf_under_development,tf_supports_stack_checking,
|
||||||
tf_need_export,tf_needs_isconsole
|
tf_need_export,tf_needs_isconsole
|
||||||
|
{$ifdef m68k}
|
||||||
|
,tf_code_small,tf_static_a5_based
|
||||||
|
{$endif m68k}
|
||||||
);
|
);
|
||||||
|
|
||||||
ptargetinfo = ^ttargetinfo;
|
ptargetinfo = ^ttargetinfo;
|
||||||
@ -637,7 +641,10 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.23 2001-08-12 17:57:07 peter
|
Revision 1.24 2001-08-19 11:22:24 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.23 2001/08/12 17:57:07 peter
|
||||||
* under development flag for targets
|
* under development flag for targets
|
||||||
|
|
||||||
Revision 1.22 2001/08/07 18:47:13 peter
|
Revision 1.22 2001/08/07 18:47:13 peter
|
||||||
|
@ -200,7 +200,7 @@ end;
|
|||||||
flags : [];
|
flags : [];
|
||||||
cpu : i386;
|
cpu : i386;
|
||||||
unit_env : 'GO32V1UNITS';
|
unit_env : 'GO32V1UNITS';
|
||||||
extradefines : '';
|
extradefines : 'DPMI';
|
||||||
sharedlibext : '.dll';
|
sharedlibext : '.dll';
|
||||||
staticlibext : '.a';
|
staticlibext : '.a';
|
||||||
sourceext : '.pp';
|
sourceext : '.pp';
|
||||||
@ -260,7 +260,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.8 2001-08-07 18:47:15 peter
|
Revision 1.9 2001-08-19 11:22:24 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.8 2001/08/07 18:47:15 peter
|
||||||
* merged netbsd start
|
* merged netbsd start
|
||||||
* profile for win32
|
* profile for win32
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ end;
|
|||||||
flags : [];
|
flags : [];
|
||||||
cpu : i386;
|
cpu : i386;
|
||||||
unit_env : 'GO32V2UNITS';
|
unit_env : 'GO32V2UNITS';
|
||||||
extradefines : '';
|
extradefines : 'DPMI';
|
||||||
sharedlibext : '.dll';
|
sharedlibext : '.dll';
|
||||||
staticlibext : '.a';
|
staticlibext : '.a';
|
||||||
sourceext : '.pp';
|
sourceext : '.pp';
|
||||||
@ -482,7 +482,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.10 2001-08-07 18:47:15 peter
|
Revision 1.11 2001-08-19 11:22:24 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.10 2001/08/07 18:47:15 peter
|
||||||
* merged netbsd start
|
* merged netbsd start
|
||||||
* profile for win32
|
* profile for win32
|
||||||
|
|
||||||
|
@ -27,14 +27,180 @@ unit t_palmos;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
link;
|
||||||
|
|
||||||
|
type
|
||||||
|
tlinkerPalmOS=class(tlinker)
|
||||||
|
private
|
||||||
|
Function WriteResponseFile : Boolean;
|
||||||
|
public
|
||||||
|
constructor Create;override;
|
||||||
|
procedure SetDefaultInfo;override;
|
||||||
|
function MakeExecutable:boolean;override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
link,
|
|
||||||
cutils,cclasses,
|
cutils,cclasses,
|
||||||
globtype,globals,systems,verbose,script,fmodule;
|
globtype,globals,systems,verbose,script,fmodule;
|
||||||
|
|
||||||
|
{****************************************************************************
|
||||||
|
TLinkerPalmOS
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
Constructor TLinkerPalmOS.Create;
|
||||||
|
begin
|
||||||
|
Inherited Create;
|
||||||
|
{ allow duplicated libs (PM) }
|
||||||
|
SharedLibFiles.doubles:=true;
|
||||||
|
StaticLibFiles.doubles:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TLinkerPalmOS.SetDefaultInfo;
|
||||||
|
begin
|
||||||
|
with Info do
|
||||||
|
begin
|
||||||
|
ExeCmd[1]:='ldpalm $OPT $STRIP -N -dy -T $SCRIPT -o $EXE @$RES';
|
||||||
|
ExeCmd[2]:='build-prc $EXE.prc "$APPNAME" $APPID $EXE *.bin';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Function TLinkerPalmOS.WriteResponseFile : Boolean;
|
||||||
|
Var
|
||||||
|
linkres : TLinkRes;
|
||||||
|
i : longint;
|
||||||
|
HPath : PStringQueueItem;
|
||||||
|
s : string;
|
||||||
|
linklibc : boolean;
|
||||||
|
begin
|
||||||
|
WriteResponseFile:=False;
|
||||||
|
|
||||||
|
{ Open link.res file }
|
||||||
|
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
|
||||||
|
|
||||||
|
{ Write path to search libraries }
|
||||||
|
HPath:=TStringListItem(current_module.locallibrarysearchpath.First);
|
||||||
|
while assigned(HPath) do
|
||||||
|
begin
|
||||||
|
LinkRes.Add('-L'+HPath.Str);
|
||||||
|
HPath:=TStringListItem(HPath.Next);
|
||||||
|
end;
|
||||||
|
HPath:=TStringListItem(LibrarySearchPath.First);
|
||||||
|
while assigned(HPath) do
|
||||||
|
begin
|
||||||
|
LinkRes.Add('-L'+HPath.Str);
|
||||||
|
HPath:=TStringListItem(HPath.Next);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ add objectfiles, start with crt0 always }
|
||||||
|
{ using crt0, we should stick C compatible }
|
||||||
|
LinkRes.AddFileName(FindObjectFile('crt0',''));
|
||||||
|
|
||||||
|
{ main objectfiles }
|
||||||
|
while not ObjectFiles.Empty do
|
||||||
|
begin
|
||||||
|
s:=ObjectFiles.GetFirst;
|
||||||
|
if s<>'' then
|
||||||
|
LinkRes.AddFileName(s);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Write staticlibraries }
|
||||||
|
if not StaticLibFiles.Empty then
|
||||||
|
begin
|
||||||
|
LinkRes.Add('-(');
|
||||||
|
While not StaticLibFiles.Empty do
|
||||||
|
begin
|
||||||
|
S:=StaticLibFiles.GetFirst;
|
||||||
|
LinkRes.AddFileName(s)
|
||||||
|
end;
|
||||||
|
LinkRes.Add('-)');
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ currently the PalmOS target must be linked always against the C lib }
|
||||||
|
LinkRes.Add('-lcrt');
|
||||||
|
|
||||||
|
{ Write sharedlibraries like -l<lib>, also add the needed dynamic linker
|
||||||
|
here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
|
||||||
|
linklibc:=false;
|
||||||
|
While not SharedLibFiles.Empty do
|
||||||
|
begin
|
||||||
|
S:=SharedLibFiles.GetFirst;
|
||||||
|
if s<>'c' then
|
||||||
|
begin
|
||||||
|
i:=Pos(target_info.sharedlibext,S);
|
||||||
|
if i>0 then
|
||||||
|
Delete(S,i,255);
|
||||||
|
LinkRes.Add('-l'+s);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
linklibc:=true;
|
||||||
|
end;
|
||||||
|
{ be sure that libc is the last lib }
|
||||||
|
if linklibc then
|
||||||
|
begin
|
||||||
|
LinkRes.Add('-lc');
|
||||||
|
LinkRes.Add('-lgcc');
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Write and Close response }
|
||||||
|
linkres.writetodisk;
|
||||||
|
linkres.Free;
|
||||||
|
|
||||||
|
WriteResponseFile:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TLinkerPalmOS.MakeExecutable:boolean;
|
||||||
|
var
|
||||||
|
binstr,
|
||||||
|
cmdstr : string;
|
||||||
|
success : boolean;
|
||||||
|
StripStr : string[40];
|
||||||
|
i : longint;
|
||||||
|
begin
|
||||||
|
if not(cs_link_extern in aktglobalswitches) then
|
||||||
|
Message1(exec_i_linking,current_module^.exefilename^);
|
||||||
|
|
||||||
|
{ Create some replacements }
|
||||||
|
StripStr:='';
|
||||||
|
if (cs_link_strip in aktglobalswitches) then
|
||||||
|
StripStr:='-s';
|
||||||
|
|
||||||
|
{ Write used files and libraries }
|
||||||
|
WriteResponseFile;
|
||||||
|
|
||||||
|
{ Call linker }
|
||||||
|
success:=false;
|
||||||
|
for i:=1 to 2 do
|
||||||
|
begin
|
||||||
|
SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
|
||||||
|
if binstr<>'' then
|
||||||
|
begin
|
||||||
|
Replace(cmdstr,'$EXE',MaybeQuote(current_module.exefilename^));
|
||||||
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
||||||
|
Replace(cmdstr,'$RES',outputexedir+Info.ResName);
|
||||||
|
Replace(cmdstr,'$STRIP',StripStr);
|
||||||
|
Replace(cmdstr,'$SCRIPT',FindUtil('palm.ld'));
|
||||||
|
Replace(cmdstr,'$APPNAME',palmos_applicationname);
|
||||||
|
Replace(cmdstr,'$APPID',palmos_applicationid);
|
||||||
|
success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
|
||||||
|
if not success then
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Remove ReponseFile }
|
||||||
|
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||||
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
end;
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
Initialize
|
Initialize
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
@ -46,7 +212,7 @@ implementation
|
|||||||
target : target_m68k_PalmOS;
|
target : target_m68k_PalmOS;
|
||||||
name : 'PalmOS';
|
name : 'PalmOS';
|
||||||
shortname : 'palmos';
|
shortname : 'palmos';
|
||||||
flags : [];
|
flags : [tf_code_small,tf_static_a5_based];
|
||||||
cpu : m68k;
|
cpu : m68k;
|
||||||
short_name : 'PALMOS';
|
short_name : 'PALMOS';
|
||||||
unit_env : 'PALMUNITS';
|
unit_env : 'PALMUNITS';
|
||||||
@ -78,7 +244,7 @@ implementation
|
|||||||
script : script_unix;
|
script : script_unix;
|
||||||
endian : endian_big;
|
endian : endian_big;
|
||||||
stackalignment : 2;
|
stackalignment : 2;
|
||||||
maxCrecordalignment : 32;
|
maxCrecordalignment : 4;
|
||||||
size_of_pointer : 4;
|
size_of_pointer : 4;
|
||||||
size_of_longint : 4;
|
size_of_longint : 4;
|
||||||
heapsize : 128*1024;
|
heapsize : 128*1024;
|
||||||
@ -97,7 +263,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2001-08-07 18:47:15 peter
|
Revision 1.5 2001-08-19 11:22:24 peter
|
||||||
|
* palmos support from v10 merged
|
||||||
|
|
||||||
|
Revision 1.4 2001/08/07 18:47:15 peter
|
||||||
* merged netbsd start
|
* merged netbsd start
|
||||||
* profile for win32
|
* profile for win32
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user