CrossFPC
About
Welcome to CrossFPC, a free toolkit to integrate the FreePascal compiler, targetting various OS and hardware platforms, as a cross-compiler into the Embarcadero® Delphi® IDE.
Using an integrated toolchain, CrossFPC enables you to cross-compile your Windows® Delphi® applications to 32 bit and 64 bit native Linux applications for X86, Linux ARM and Android without ever leaving the IDE. In addition you can compile 64 Bit Windows applications. CrossFPC also runs in a stand-alone not requiring any Delphi IDE, and can be used as an easy cross-build tool for FPC / Lazarus users.
This project was created for people who wish to develop cross-platform applications with Delphi while staying inside the familar Delphi IDE. The project is best suited for usage in console and web applications and embedded projects. The typical work process looks like that you develop, debug and test your application under windows, and then cross-compile it to the deployment platforms with a single click. For now, Visual VCL or CLX applications are not supported. The project is therefore best suited for embedded applications and applications that do not use a standard OS GUI. Today, CrossFPC mostly is used to develop cross-platform embedded applications, for example digital gadgets, and to create multimedia apps and games for ARM-based platforms like mobile handsets. Today, CrossFPC for example is used to write applications used on plug computers like the SheevaPlug or to develop application servers deployed on Linux server systems in data centers.
CrossFPC was born due to the fact that during the last 15 years, Borland® and later Embarcadero have failed to provide Linux plattform support for the Object Pascal language after the Kylix® product line was declared dead. Since 2005, CrossFPC and its discontinued sister project CrossKylix are used internally for R&D for some rather large projects by their authors, and therefore can be regarded production quality. Now, in (very) late 2012 we finally invested some time to clean up the project, write a tiny bit of documentation, clean up licenses and get the project in shape for a public release.
It should be understood that CrossFPC is not meant as a replacement or competition for neither Embarcadero (hopefully finally) upcoming cross-platform offerings, nor for the excellent Lazarus tool chain. CrossFPC fills a niche - people who wish to do their R&D work completely under Windows inside the Delphi IDE, but would like to also natively target other hardware and OS platforms while doing so. There are situations where such a cross-compiler based work-flow makes sense, but there are also situations where it makes much more sense to adapt and compile applications on the target platform itself (which is the Lazarus approach).
Features
CrossFPC has the following features:
- Allows you to compile native Linux applications from inside the Windows® Delphi® IDE - supported IDE versions are Delphi 7, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE up to Delphi XE10.1 Berlin. Recommended/most tested IDE version is Delphi 7.
- Stand-alone version of the cross-compiler is also available, to automate builds outside of the Delphi IDE
- Console projects, packages and any kind of non-visual applications are fully supported
- CrossFPC is perfectly integrated into the Delphi® IDE - you will get compile warnings, hints and error messages, and be able to jump to the lines in question by clicking on the message pane the same way as with the internal Delphi® Windows® compiler
- Source compatible with Kylix® - it's more or less a drop-in replacement for the Kylix® compiler
- It's free! :)
Supported target platforms
CrossFPC will constantly try to add more useful target platforms. For now, the following platforms are supported:
- 32 Bit Windows - Well, Delphi can do that itself, so it's of limited use
- 64 Bit Windows - Thanks to CrossFPC, you may now also compile to 64 Bit Windows with Delphi versions that don't support this yet
- 32 Bit x86 Linux - Binaries created will run on pretty much every 32 bit and 64 Linux distribution. If Libc is used, the level of compatibility with Kylix source code is very high. This platform is a good future replacement for people currently still using CrossKylix, which while still being in use is end of life due to Borland having discontinued Kylix long ago. Parallel installation of CrossFPC and CrossKylix work fine, so CrossKylix still may be used as an alternative to this CrossFPC platform.
- 64 Bit x86 Linux - Binaries created should run on pretty much every 64 Bit Linux distribution.
- ARM Kirkwood / SheevaPlug / GuruPlug - Binaries created for this target will run on the Marvel Kirkwood ARM platform. The most common examples are the SheevaPlug and GuruPlug embedded plug computers. This is the main target platform used by the CrossFPC authors and supported very well.
- ARM Android - CrossFPC may also be used to create binaries that run on modern mobile handset devices based on the ARM platform, for example Android phones. This requires quite a lot of work and detailed platform knowledge. We plan to work on this and create examples and instructions for various phone platforms in the future. The minimum supported ARM version for Android is ARMv7a.
How it works
We've built cross-compiler versions of the FPC compiler and binutils and cross-compiled all FPC RTL units for all supported platforms. We've then integrated these cross-compilers into the Delphi IDE using IDE plug-ins we wrote.
Things still to come
CrossFPC is used for years internally, and was designed to suit the authors needs only. Now that we have done a public release it is our intention to maintain this project and keep our internal versions and the public one in sync. You may therefore expect frequent updates. No, the next update won't take 7 years to come. Things currently being worked on:
- Integrated remote debugging - The remote debugger is already there and integrated inside the Delphi IDE, but it is a mess and completely undocumentated. This is going to change. You will be able to debug your applications running on remote hardware in future using this.
- More documentation and examples - We really need to improve on this. Also, some how-tos for Android are needed.
- CLX support? - Internally we have written compatibility units which allow to use CLX with CrossFPC. Most likely however, this is not relevant anymore as CLX is dead. We'll see what user Feedback on this is.
- FMX support? Other GUI support? - We'll wait for user feedback and see if it makes sense to support one or more GUI toolkits for CrossFPC.
Requirements and Download
The following things are needed to use CrossFPC:
- Windows XP, Vista, 7 or 8, 32 or 64 Bit computer with administrator privileges
-
Installed Delphi 7, 2007, 2009, 2010, XE, XE2, XE3 or XE4 *). From Delphi 2007 and up the minimum supported SKU is the Professional version, as the command line compiler dcc32 is required for CrossFPC installation.
*) Versions from XE5 up should work too, but we haven't tested. Please us know if you have tested. - Access to one or more Linux systems to test programs
Download CrossFPC v0.45 installer (260 MB)
Installation
Close any Delphi IDE instances you have opened. Then just launch the setup program which will guide you through the installation. After the installation has finished, restart the Delphi IDE. CrossFPC can now be configured using Tools / CrossFPC options inside the Delphi® IDE.
Hints & Limitations
Here are a few hints and tips for using CrossFPC:
- Resource files are not supported. This means: No forms, not data modules.
- Remember you need to program in a cross-platform way. Make sure you never use absolute paths in your uses clauses. Have a look at the examples.
- If you use third-party-components created for Kylix®, you'll need the sources, as the binary object (DCU) format used is incompatible.
- When building for Android, the resulting .so file must be placed into lib/armeabi-v7a. Check the readme.txt of the Android NDK (Native Development Kit) on the details.
Compatible 3rd party components
In general all software components that are compatible with both Delphi and FreePascal will also work with CrossFPC. Also, next to all components designed for Kylix will work with minimal changes.
The following third-party components are tested and known to work with CrossFPC
License
The short and simple version is: You may use CrossFPC and the included libraries both in commercial closed-source software and of course in open-source products. You may however not create your own distribution of CrossFPC itself.
The longer explanation is:
- CrossFPC includes the FreePascal compiler. The FPC compiler comes under the GNU General Public License. If you modify the compiler, you need to distribute its sources. The compiler license does not have any effect on programs compiled with it. For details, see the GNU General Public License.
- CrossFPC includes FreePascal packages and runtime library, which come under a modified Library GNU Public License. This allows you to use this source code as static libraries included in your application without putting license restrictions on your application. If you modify FreePascal packages or the runtime library, you have to distribute those sources. For details, see the FPC modified Library GNU Public License.
- The CrossFPC IDE plugin and all the CrossFPC examples are licensed under the Mozilla Public License (MPL). You may use them to create software under any license you want. However, if you wish to modify and redistribute CrossFPC itself, you will have to keep CrossFPC sources under the MPL, and additional restrictions apply.
- CrossFPC ships several example projects. These come under various licenses, which you need to study. Most examples are either licensed under the 2-clause simplified BSD license or the MPL license.
- CrossFPC does not include any source code copyrighted by Borland or Embarcadero. However, if you use CrossFPC inside the Delphi IDE, Borland/Embarcadero license terms may apply to you.
Version history
Here is a list of recent changes to the project:
- 0.45 8 October 2015
- Updated FPC builds to fixes_3_0 SVN revision 31772
- Rewrote ReadAndConvertProjectCfg as the code used until now produced broken paths
- Cleaned up source code tree and removed all the duplicates, and moved this code to ../common
- 0.44 23 February 2015 (internal release)
- Updated FPC builds to SVN revision 28288
- Added CrossProfiler unit
- Added unfinished and untested Delphi XE5 support
- Fixed build options
- Fixed standalone install issue in the installer, when no Delphi version was installed
- Added units
- Added experimental Delphi XE6 and Delphi XE7 support
- 0.43 14 September 2013
- Updated FPC builds to SVN revision 25438 (improved performance for ARM targets)
- Added ARMv7a softfloat linux target
- Fixed path overwrite issue in the installer
- Fixed possible crash issue in the installer
- 0.42 24 April 2013 - Delphi XE4 is now supported
- 0.41 14 February 2013 - now supports Android and 64bit Linux. Changes:
- Fixed non-english Delphi installation bugs in the installer
- Added program-group-create-feature to the installer
- Added android ARM target
- Fixed and reenabled x86-64 linux target
- Verified INI code on the IDE plugin side for correct target handling
- Updated all FPC binaries and units to revision 23583 (and the android ARM target to revision 23607)
- Updated BRRE and BESEN externals
- 0.40 31 December 2012 (first public release)
- 0.35 24 December 2012 (internal beta)
- 0.20 7 May 2005 (internal)
- 0.10 28 Feb 2005 (internal)
So, we did it take us 7 years to get a public release done? Well, the project serves a niche, and was created out of own needs only when we needed to support additional Linux hardware platforms and CrossKylix alone just did not cut it anymore. The project however had been in an unclean state, and we never quite felt the urge to clean it up and release it. But in late 2012 we decided to finally no longer ignore the continuous emails requesting a public release, so we finally took some time to clean this up and bring it into a shape suitable for public release. For the future we plan to keep our internal versions and the public one in sync, so you may expect frequent updates.
CrossFPC application deployment
Applications compiled with CrossFPC are statically linked and do not have any special deployment requirements. Copy the compiled binary to a Linux box, mark the file executable and run it.
Mailing list
For discussion and peer support, a mailing list exists.
Please understand that this software is provided for free "as is", and that the authors are not offering any product support, neither free nor commercial.