|
help
xCross Help
xCross HelpxCross is a tool to easily create cross-platform Win/Mac/Linux applications. Even if you don't have the three operating system installed, you can create binaries for all of them from your favorite OS. How does it works ?xCross is using NekoVM and haXe. NekoVM is a small, crossplatform and fast embeddable Virtual Machine which is executing the Neko language. haXe is an highlevel OO programming language which targets Neko. An haXe program can then be compiled to Neko bytecode (.n file) and the bytecode is crossplatform (like Java .class files). xCross is a Fat VM which includes the NekoVM, but also some standard libraries for accessing the OS filesystem, sockets, xml, Zip files, regular expressions... All these libraries are linked statically into xCross, so to run a xCross binary you don't need to install any other library on your system. xCross distribution includes three versions of the VM binaries : for Windows, Linux and OSX (Universal binary, native on both PPC and Intel). A small tool included in xCross distribution can be used to inject a Neko bytecode file into a xCross binary, so when the binary is loaded the VM will execute the bytecode. Tutorial
haxelib install xcross class Test {
static function main() {
xcross.Api.message("Hello","Hello World !");
}
}haxe -neko test.n -lib xcross -main Test haxelib run xcross test.n (you might be required to provide an absolute path to test.n) This will produce three binaries :
You can launch the one which is on your system to see the Hello message. For further instructions, watch the haXe API and ask on the haXe mailing list. xCross File SizeA xCross binary size consists in the system-specific binary plus the bytecode size. Bytecode size tends to be quite low, around 200KB for a good application. System-specific binaries size are currently the following :
Compiling xCross
cvs -d:pserver:anonymous@cvs.motion-twin.com co neko cd neko/libs
svn checkout http://xcross.googlecode.com/svn/trunk/ xcrossCompile :
cd xcross
make linux cd xcross
make osxTo reduce xcross binary size, you can use UPX : at least 2.92beta for Linux at at least current SVN (should become 2.94) for OSX. |
Sign in to add a comment