README 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 first 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. You might also want to add option -a, then the link script will not delete
  26. not needed files, in particular the assembler files (*.s). This can be
  27. useful if there are problems with the link script and you want to rerun it.
  28. Assembling and linking on target:
  29. ---------------------------------
  30. In case that host and target machine is different, transfer the produced
  31. files, that is assembler files (*.s) and link script *_ppas, to the host.
  32. On the target, use MPW to assemble and link the output from FreePascal by
  33. executing the link script (which is an MPW script), with its directory
  34. as current directory. Unfortunatelly the link script does not have the
  35. proper mac file type, so this has to be fixed first e. g with
  36. the MPW command SetFile.
  37. Example: To build Hello World, execute:
  38. Directory HD:Projekt:FreePascal:fpc:rtl:macos
  39. SetFile -c 'MPS ' -t 'TEXT' system_ppas
  40. system_ppas #executes the script
  41. Directory HD:Projekt:FreePascal:fpc:demo:text
  42. SetFile -c 'MPS ' -t 'TEXT' hello_ppas
  43. hello_ppas #executes the script
  44. Note on the compiler implementation
  45. ===================================
  46. Global variables
  47. ----------------
  48. Currently all global variables are indirect, that is the entry in
  49. the TOC is always a pointer to data. (In the future small data items
  50. may be stored directly in the TOC)
  51. Thus all references to globals are via a construct like:
  52. lwz rX, yyy[TC](r2) ;loads a pointer to a global into rX
  53. Debugging
  54. ----------
  55. -g is considered under construction.
  56. When -g has been fixed, some debugging should be possible in
  57. Power Mac Debugger 2.1, can be downloaded from Apple,
  58. ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools
  59. /MPW_etc./Debuggers/Power_Mac_Debugger.sit.hqx
  60. It should be possible to see source code
  61. but it will not be possible to examine variables.
  62. One can of course examine registers, especially
  63. at entry and exit point where the parameter lists is stored
  64. in registers, according to the calling conventions.
  65. A suggestion is to do the main debugging in GDB in the Darwin version of the
  66. program.