README 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Welcome to the MacOS port of FreePascal (FPC)
  2. ==============================================
  3. It is considered under construction, at the moment.
  4. Most of the programs in demo/text works.
  5. Prerequisites:
  6. --------------
  7. Please note that compiling must be done on a platform
  8. supported by FPC, either in Darwin (MacOS X) or e g on
  9. Windows or Linux.
  10. MPW (or ToolServer, but the rest of the description consider doing it
  11. from MPW) must be installed on the target Macintosh.
  12. It can be downloaded from Apple Computer, see
  13. ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./
  14. Compiling on host:
  15. ------------------
  16. When compiling for target MacOS, use FPC as for other
  17. operating systems with these options:
  18. -Tmacos # target macos
  19. -st # dont generate executable, link on target
  20. If make is used, add OPT=-st OS_TARGET=macos (on foreign platforms
  21. CPU_TARGET=powerpc must also be added)
  22. Note that one must build the RTL by issuing make in rtl/macos, with
  23. the above options, to be able to buld other programs. (Currently only
  24. system.pp and som OS independant units are available)
  25. Assembling and linking on target:
  26. ---------------------------------
  27. In case that host and target machine is different, transfer the produced
  28. files, that is assembler files (*.s) and link script *_ppas, to the host.
  29. On the target, use MPW to assemble and link the output from FreePascal by
  30. executing the link script (which is an MPW script), with its directory
  31. as current directory. Unfortunatelly the link script does not have the
  32. proper mac file type, so this has to be fixed first e. g with
  33. the MPW command SetFile.
  34. Example: To build Hello World, execute:
  35. Directory HD:Projekt:FreePascal:fpc:rtl:macos
  36. SetFile -c 'MPS ' -t 'TEXT' system_ppas
  37. system_ppas #executes the script
  38. Directory HD:Projekt:FreePascal:fpc:demo:text
  39. SetFile -c 'MPS ' -t 'TEXT' hello_ppas
  40. hello_ppas #executes the script
  41. Note on the compiler implementation
  42. ===================================
  43. Global variables
  44. ----------------
  45. Currently all global variables are indirect, that is the entry in
  46. the TOC is always a pointer to data. (In the future small data items
  47. may be stored directly in the TOC)
  48. Thus all references to globals are via a construct like:
  49. lwz rX, yyy[TC](r2) ;loads a pointer to a global into rX
  50. Debugging
  51. ----------
  52. -g is considered under construction.
  53. When -g has been fixed, some debugging should be possible in
  54. Power Mac Debugger 2.1, can be downloaded from Apple,
  55. ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools
  56. /MPW_etc./Debuggers/Power_Mac_Debugger.sit.hqx
  57. It should be possible to see source code
  58. but it will not be possible to examine variables.
  59. One can of course examine registers, especially
  60. at entry and exit point where the parameter lists is stored
  61. in registers, according to the calling conventions.
  62. A suggestion is to do the main debugging in GDB in the Darwin version of the
  63. program.