Quote
How is this possible ?
I'll paste the explanation from the not-yet-public project website:
About
Welcome to CrossKylix, a free (as in beer and speech) toolkit to
integrate the Borland Kylix (Delphi for Linux) compiler into the
Delphi Windows IDE.
This project was created for people who wish to develop cross-platform
web/server/middleware applications with Delphi. Up until now doing
this required you to have a seperate Linux installation (either on a
dedicated box or inside VMWare) to recompile your project for the
Linux platform. With CrossKylix this is no longer needed - you are
able to build your project using the Kylix compiler from directly
inside your Windows Delphi IDE, without the requirement of a Linux
system. Sounds cool? Read on...
How it works
Of course CrossKylix isn't a real cross compiler. The only ones able
to build a real cross compiler would be Borland themselves. CrossKylix
actually is a faked together solution using a lot of tricks to achieve
the goal. But oh well, it works, and that's what counts :)
As you know, the Kylix compiler runs on Linux only. We want it to run
it on Windows. Sounds impossible? Not quite. There is a project called
LINE ("LINE Is Not an Emulator"). What it does is this: "LINE executes
unmodified Linux applications on Windows by intercepting Linux system
calls. The Linux applications themselves are not emulated. They run
directly on the CPU just like all other Windows applications.". What
LINE basicly does is implement an Linux ELF binary loader, load the
process into memory, catch Linux syscalls and redirect them to the
Cygwin DLL, which translates those calls to Windows API functions.
Sadly the project died in early Alpha stage in 2001 and was unable run
the Kylix command line compiler. So I took the LINE sources, ported
them to the current Cygwin version, added all missing syscalls needed
by Kylix, fixed some bugs - and well, now it IS able to run the Kylix
command line compiler (DCC) :)
Next step was writing a Delphi IDE plugin to integrate the compiler.
This plugin adds "Build with CrossKylix" and "Compile with CrossKylix"
items to the Project-menu. During compile, it also parses the output
of the Kylix compiler executed in the background to give out
Hints/Errors to the Delphi messages window - clicking on those brings
you to the source file at the correct line, like it uses to be in
Delphi. So after all, integration is pretty tight - not much
difference to compiling for Windows. One limitation exists: You can't
debug the linux executable.
Another problem to fix was that the Kylix compiler requires a few
shared objects to execute, and sadly Borland hardcoded their search
path to "/lib". Well, we don't have "/lib" on windows, so we need to
patch the compiler binary (dcc). This is covered in detail the
Installation section.
Now you know how it's done.