2010-02-13 Jb Evain <jbevain@novell.com>
[mcs.git] / tools / cilc / README
bloba40bdc74e61b002a009f28d9a97659b26449b933
1 cilc
2 ====
4 cilc is a CIL-to-C binding generator. It can be used to expose any CIL library
5 to the C (and C++) world using the GObject object model and coding style. This
6 should be of particular interest to GNOME developers who wish to make use of
7 libraries developed in C#, perhaps Gtk# widgets, within their own C
8 applications. Developers who use a generated binding need no specific knowledge
9 pertaining to Mono and runtime embedding -- almost everything is done behind
10 the scenes.
12 Right now, cilc is in an early stage of development. See TODO for a list of
13 pending tasks.
15 For a demonstration, see Test.cs and demo.c to get an idea of what's going on.
16 Then run:
18 $ make run-test-local
19 $ cd generated
20 $ ./demo
22 To make a redistributable shared object that includes the assembly, you can
23 then:
25 $ make clean
26 $ make bundle=true
27 $ rm *.dll
28 $ ./demo
30 Note that you must have Mono's mkbundle tool installed to use the bundle
31 feature.
33 If all you want to do is generate a binding for an assembly, you can simply
34 pass the assembly name as a single argument to cilc and it will automatically
35 generate bindings in a temporary directory, compile them using the bundle
36 feature, and install the produced shared library in the lib/ subdirectory and
37 the headers in include/.
39 $ cilc Assembly.dll
41 To tie-in with existing GOjbect hierarchies, pass pairs of pkg-config package
42 and comma-separated namespaces. For example:
44 If you want to use a Gtk# widget in a Gtk+ application:
46 $ cilc Widget.dll gtk+-2.0 gtk
48 To bind gtk-sharp, but tying it into the native hierarchy for gdk:
50 $ cilc gtk-sharp.dll gtk+-2.0 gdk
52 -- 
53 Alp Toker <alp@atoker.com>