- 19.12 (released) ...
Porting an Eiffel application from UNIX to Windows or vice-versa
Before starting your project, you must first decide if you want your program to run either single or multi-platform. If you decide to go multi-platform make sure you use platform independent Eiffel libraries or C/C++ code. Eiffel Software provides the following multi-platform libraries:
- Eiffel2Java (on platform that supports JNI)
- EiffelNet (except UNIX specific classes)
Configuring your project
For porting between different UNIX systems, you simply need one simple configuration file as the C/C++ externals should be the same. If this is not the case, as with UNIX and Windows, you will need to use conditions in the configuration file.
The usual scenario is to port from UNIX to Windows or vice versa. In this case, the only thing that needs to be conditioned in the configuration file are the externals. Conditioning of externals can be done in the project settings.
Note that externals are (in contrast to almost all other locations) taken literally, so you may need to use
\ for paths on Windows and
/ on UNIX.
It is important to also note that some multi-platform libraries such as EiffelVision2 do not include the same clusters for both UNIX and Windows. As with externals, clusters need to be specified depending on the target platform.
When compiling for many UNIX system, you should finalize without launching the C compilation. At the end, the EIFGENs/target_name/F_code directory is built. This is the portable C code that you can take from one platform to another. We recommend you to create an archive of the F_code for backup.
To compile on a given platform, you have to make sure that you have a complete EiffelStudio delivery for the target platform and that your PATH environment variable contains $ISE_EIFFEL/studio/spec/$ ISE_PLATFORM/bin. You then have to check that all C externals that you are using have been compiled for this platform.
You can then launch finish_freezing that will automatically recompile the C generated code and generate a new executable for the given platform.
Between UNIX and Windows
As shown above you will need to have a configuration file with conditions to port your Windows application to UNIX. You can then use the UNIX configuration file to re-finalize your project (without C compilation) and then you have ANSI compliant C code that may be compiled on a UNIX platform using the above instructions.
To compile your UNIX application on Windows simply follow the same instructions as above using a Windows configuration file instead. When the ANSI C code is generated, run finish_freezing in the F_code directory on the target Windows platform and your system will be compiled.