Skip to content

Instantly share code, notes, and snippets.

@benibela
Created October 25, 2020 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benibela/8d1cee8b48ba891c27fd4cb2b1335bab to your computer and use it in GitHub Desktop.
Save benibela/8d1cee8b48ba891c27fd4cb2b1335bab to your computer and use it in GitHub Desktop.
How to install FreePascal
#!/bin/bash
#fpcmake -Tall
if [ -f /usr/lib/fpc/3.0.4/ppcx64 ]; then localpath=/usr/lib/fpc/3.0.4;
else if [ -f /usr/local/lib/fpc/3.0.4/ppcx64 ]; then localpath=/usr/local/lib/fpc/3.0.4;
else if [ -f /usr/lib64/fpc/3.0.4/ppcx64 ]; then localpath=/usr/lib64/fpc/3.0.4;
else if [ -f /usr/local/lib64/fpc/3.0.4/ppcx64 ]; then localpath=/usr/local/lib64/fpc/3.0.4;
else if [ -f /usr/lib/fpc/3.0.0/ppcx64 ]; then localpath=/usr/lib/fpc/3.0.0;
else if [ -f /usr/local/lib/fpc/3.0.0/ppcx64 ]; then localpath=/usr/local/lib/fpc/3.0.0;
else if [ -f /usr/lib64/fpc/3.0.0/ppcx64 ]; then localpath=/usr/lib64/fpc/3.0.0;
else if [ -f /usr/local/lib64/fpc/3.0.0/ppcx64 ]; then localpath=/usr/local/lib64/fpc/3.0.0;
else if [ -f /usr/bin/ppcx64 ] && (/usr/bin/ppcx64 -h|head |grep 3.0); then localpath=/usr/bin;
else echo Failed to find fpc 3; exit;
fi fi fi fi fi fi fi fi fi
localcompiler=$localpath/ppcx64
echo Using local fpc from $localpath
echo export localcompiler=$localpath/ppcx64
if find ./compiler/ -name "*.pas" >/dev/null; then echo;
else
echo Script needs to be started in the source directory of the FreePascal compiler to compile the compiler
exit
fi
set -e
sudo make clean
sudo make install PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=android CPU_TARGET=i386 PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=android CPU_TARGET=arm PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=android CPU_TARGET=aarch64 PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=android CPU_TARGET=x86_64 PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=linux CPU_TARGET=i386 PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=linux CPU_TARGET=arm PP=$localcompiler
#sudo env "PATH=$PATH" make crossinstall OS_TARGET=linux CPU_TARGET=aarch64 PP=$localcompiler
#sudo env "PATH=$PATH" make crossinstall OS_TARGET=linux CPU_TARGET=x86_64 PP=$localcompiler
sudo env "PATH=$PATH" make crossinstall OS_TARGET=win32 CPU_TARGET=i386 PP=$localcompiler
#sudo env "PATH=$PATH" make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 PP=$localcompiler
for ppc in /usr/local/lib/fpc/3.3.1/ppc*; do sudo ln -s $ppc /usr/local/bin/; done
@benibela
Copy link
Author

Call the script after svn checkout https://svn.freepascal.org/svn/fpc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment