EiffelStudio 6.1 and MinGW on Windows
This week we added a new backend C compiler for EiffelStudio. We chose MinGW (gcc based) as it is made to target Windows and its Win32 API. Surprisingly, it was fairly easy to do. Indeed we have tried to do this in the past but without too much success.
In 1996, we tried but quickly failed because the Windows API support was really not ready. In 1999, it got better and we did some ground work to make our tools support gcc. But unfortunately they were some limitations in the toolchain and it would not compile large application (as they often say in this case it was a limitation in the binutils, see the Cygwin mailing list archive). Regardless of this, some of the issues we had were:
- Directory separator convention: / instead of \
- The difference between .lib/.obj and .o/.a, and more precisely the correct usage of ar rc vs. ld -r -o.
- Ordering of libraries for linking.
In 2002, we tested it again with gcc coming from the cygwin distribution. It worked great but not for compiling Windows application. We simply used cygwin as if we were on a Unix platform and compiled everything as on Unix. The command line compiler was up and running but no way to generate a graphical application unless using GTK.
We choose MinGW because they have started to do a 64-bit version and once we have the 32-bit version up and running it should be straightforward to support 64-bit. We are unsure when the 64-bit version will be available, but the 32-bit version will be a very good replacement for the Borland C compiler which is starting to get a little bit too old. Like Borland, MinGW does not require any user configuration, it will be properly configured at install time.
The result today is that we have compiled the default Vision2 application out of the box. The good news is that what we have done could work with 6.0 as long as you copy the necessary files over, but the target is the next release of EiffelStudio in November.
Anyone interested in testing this should wait the first intermediate release of 6.1 in the next couple of weeks.