commands-to-cross-compile-linux.sh 1.1 KB

12345678910111213141516171819202122232425
  1. # Commands to make fpc cross compilers for Win32 and Win64
  2. # To use the fpc version number later
  3. # It has the version number, e.g. 3.0.4
  4. export FPCVER=`fpc -iV`
  5. # Navigate to the fpc source folder.
  6. # One of them will fail, but this is normal. If it changes into a directory, you're fine.
  7. cd /usr/lib/fpc/src/ || cd /usr/share/fpcsrc/$FPCVER
  8. # Compile the cross-compiler for win32.
  9. sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  10. # It could take a minute or two, depending on your hardware
  11. # Install the cross-compiler.
  12. sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr
  13. # You should see messages like: Installation package fpc-all for target i386-win32 succeeded
  14. # Link the cross-compiler and place the link where Lazarus can see it.
  15. sudo ln -sf /usr/lib/fpc/$FPCVER/ppcross386 /usr/bin/ppcross386
  16. # You can do the same using Windows 64 bit as target.
  17. export FPCVER=`fpc -iV`
  18. sudo make clean all OS_TARGET=win64 CPU_TARGET=x86_64
  19. sudo make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=/usr
  20. sudo ln -sf /usr/lib/fpc/$FPCVER/ppcrossx64 /usr/bin/ppcrossx64