README.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Welcome to pas2js
  2. =================
  3. Pas2js is an open source Pascal to JavaScript transpiler.
  4. It parses Object Pascal and emits JavaScript.
  5. Official site:
  6. http://wiki.freepascal.org/pas2js
  7. ********************************************************************************
  8. Directories
  9. ===========
  10. packages - source files needed to compile pas2js programs
  11. demo - examples
  12. bin - output folder for binaries, e.g. pas2js.exe
  13. compiler - source files to compile the compiler
  14. units - output folder of compiler ppu/o files
  15. utils - utilities
  16. ********************************************************************************
  17. Building
  18. ========
  19. 1. Install the Free Pascal compiler (fpc), 3.0.4 or better, 32 or 64bit.
  20. Either from their website
  21. https://www.freepascal.org/download.html
  22. Or via Lazarus
  23. http://wiki.freepascal.org/Getting_Lazarus
  24. Or on MacOS via homebrew
  25. Or on Linux via your package manager.
  26. 2. building pas2js
  27. 2.1 Under Linux/macOS type
  28. make all
  29. This creates with a 64-bit fpc the executable "bin/x86_64-linux/pas2js"
  30. and a basic config file "bin/x86_64-linux/pas2js.cfg".
  31. 2.2 Under Windows type
  32. Make sure that you use the make.exe from fpc, not from Delphi by setting
  33. the "PATH":
  34. For example if you installed the 32-bit version of fpc in C:\YourPathOfFPC\3.0.4
  35. set PATH=C:\YourPathOfFPC\3.0.4\bin\i386-win32;%PATH%
  36. If you installed the 64-bit version of fpc in C:\YourPathOfFPC\3.0.4 use
  37. set PATH=C:\YourPathOfFPC\3.0.4\bin\x86-64-win64;%PATH%
  38. Then compile
  39. make all
  40. If you see "Error makefile ... Command syntax error" your "set PATH" was
  41. not correct.
  42. When "make all" finished it created with a 32-bit fpc the executable
  43. "bin/i386-win32/pas2js.exe" and a basic config file "bin/i386-win32/pas2js.cfg".
  44. ********************************************************************************
  45. Configuration
  46. =============
  47. pas2js requires unit search paths (-Fu) in order to find its rtl units and
  48. rtl.js. Building and installing should have created a default pas2js.cfg
  49. containing those parameters.
  50. http://wiki.freepascal.org/pas2js.cfg