If you use Free Pascal and/or Lazarus and update them often to follow the development in trunk, or if you just need to use multiple versions side by side, have a look at fpcupdeluxe (GitHub).
It’s a GUI front-end which lets you easily select a release and build it, including cross-compilers, with a click of a button. The result is installed into its own directory where it doesn’t interfere with any other installations of Free Pascal and Lazarus.
Update: It seems the latest fpcupdeluxe (1.6.0k) now builds trunk without any problems, no tweaks necessary, so you can ignore the rest of this post.
As a side note, updating trunk today failed for me when it was trying to build the intermediate (“bootstrap”) compiler. I haven’t thoroughly investigated it but I think it’s due to the fact that fpc 3.0.4 is now the required compiler to build trunk and I have found a quick fix which works for me now and comprises the following two steps:
1. Create a patch file with the following content in $(fpcupdeluxe)/patchfpc directory:
--- Makefile.fpc (revision 37707)
+++ Makefile.fpc (working copy)
@@ -21,7 +21,7 @@
# make versions < 3.77 (OS2 version) are buggy
and activate it in the fpcupdeluxe’s settings (see screenshot below). This should “force” the bootstrap compiler 3.0.4 to be used instead of 3.0.2 as before.
2. Click “Trunk” and let fpcupdeluxe clone the 3.0.4 release into its fpcbootstrap subdirectory. This would still fail for me as for some reason the generated bootstrap compiler was still 3.0.2. Just replace the binary (ppcx64) with the 3.0.4 binary (you can build one yourself from source or copy it from the official release).
On the next click of the “Trunk” button, you should get a successful build of the current trunk fpc (3.1.1) and Lazarus (1.9). Updating the cross-compilers then worked for me again as well. I usually use x86_64-linux and cross-compile to arm-linux, i386-linux, x86_64-win64, i386-win32, x86_64-darwin and i386-darwin.