CrossKylix - Kylix Crosscompiler for Delphi/Windows
实在是不知道写什么好,就介绍介绍有用的工具吧。
CrossKylix - Kylix Crosscompiler for Delphi/Windows
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.
一个免费的开发工具(CrossKylix)
This project was created for people who wish to develop cross-platform web/server/middleware applications with Delphi. Compiling CLX GUI applications currently is NOT supported! 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...
给那些需要进行交叉平台开发网页、服务器、中间件应用程序的开发人员使用。
目前不支持编译CLX图形界面应用程序。
听起来不错,接着往下看....
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 :)
这个工具使用了大量的技巧来达到使Kylix能够在Windows下编译的目标。
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, added some path translations, 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.
Now you know how it's done. Let's go test that beast.
Requirements and Download
The following things are needed to use CrossKylix:
- Installed Delphi 6 or 7
- Kylix 3 installation CD or finished installation (I've tested the project with Kylix 3 Enterprise, other versions might work too, Feedback welcome)
- Windows 2000 or XP (Windows 95/98/Me might work, but are untested)
Download CrossKylix Version 0.7, 8. June 2004 -Still in beta state, you have been warned!
请注意:还在进行Beat测试
Other usefull downloads are:
- IZArc - a free file compressor that is able to unpack the RPM files on the Kylix installation CD
- Novell Netdrive - Allows you to create virtual drives using FTP connections. VERY cool if you want CrossKylix compiled binaries to be automaticly uploaded to a remote Linux server for testing.