Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2005-08-19 16:20:34 -0700 (Fri, 19 Aug 2005)
Revision: 1408
Log message:

      This is some exploration into dynamic linking.  It contains:
         - a parser for C code     parse/C/{Parse,Lex}.om
         - a stub code generator   parse/C/Dll.om
      
      The contrib/gtk directory gives an demo for Gtk (I chose Gtk
      because it has nice header files, and it is sufficiently
      complicated).
      
      I'll write up some docs at some point, but here is the basic idea
      of how a DLL is generated.
      
         1. Parse the C header files.
         2. Extract the declarations.
         3. Generate C stubs for each of the declarations.
         4. Produce a (large) C file that can be compiled
            and then dynamically linked into your OCaml process.
      
      Doing this all from your OMakefile is pretty simple.  Mainly
      you need to specify which functions you want to include
      in your DLL.
      
      This is reasonably independent from omake, so you can use it as
      a generic way to generate wrappers around C functions.
      
      Note that the C file for GTK is perhaps 120k lines of code, so
      you get to stress your C compiler too.
      

Changes  Path
+9 -0 libmojave-branches/omake_0_9_7_pre5/cutil/lm_unix_cutil.c
+1 -0 libmojave-branches/omake_0_9_7_pre5/unix/lm_unix_util.ml
+4 -0 libmojave-branches/omake_0_9_7_pre5/unix/lm_unix_util.mli
+8 -1 libmojave-branches/omake_0_9_7_pre5/util/lm_channel.ml
+2 -0 libmojave-branches/omake_0_9_7_pre5/util/lm_channel.mli
+93 -84 libmojave-branches/omake_0_9_7_pre5/util/lm_parser.ml
+1 -0 libmojave-branches/omake_0_9_7_pre5/util/lm_parser.mli
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C
Added omake-branches/omake_0_9_7_pre5/lib/parse/C/.cvsignore
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C/.cvsignore
Added omake-branches/omake_0_9_7_pre5/lib/parse/C/Common.om
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C/Common.om
Added omake-branches/omake_0_9_7_pre5/lib/parse/C/Dll.om
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C/Dll.om
Added omake-branches/omake_0_9_7_pre5/lib/parse/C/Lex.om
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C/Lex.om
Added omake-branches/omake_0_9_7_pre5/lib/parse/C/Parse.om
Properties omake-branches/omake_0_9_7_pre5/lib/parse/C/Parse.om
+1 -0 omake-branches/omake_0_9_7_pre5/mk/defaults
+17 -7 omake-branches/omake_0_9_7_pre5/src/Makefile
+17 -7 omake-branches/omake_0_9_7_pre5/src/Makefile.nt
+1 -0 omake-branches/omake_0_9_7_pre5/src/build/OMakefile
+20 -2 omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_base.ml
Added omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_dll.ml
Properties omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_dll.ml
Added omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_dll.mli
Properties omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_dll.mli
+31 -1 omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_io.ml
+64 -76 omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_io_fun.ml
+124 -27 omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_object.ml
+16 -1 omake-branches/omake_0_9_7_pre5/src/build/omake_builtin_sys.ml
+1 -0 omake-branches/omake_0_9_7_pre5/src/clib/OMakefile
Added omake-branches/omake_0_9_7_pre5/src/clib/lm_dll.c
Properties omake-branches/omake_0_9_7_pre5/src/clib/lm_dll.c
Added omake-branches/omake_0_9_7_pre5/src/clib/lm_dll.h
Properties omake-branches/omake_0_9_7_pre5/src/clib/lm_dll.h
Added omake-branches/omake_0_9_7_pre5/src/clib/lm_dll_hooks.h
Properties omake-branches/omake_0_9_7_pre5/src/clib/lm_dll_hooks.h
+56 -8 omake-branches/omake_0_9_7_pre5/src/env/omake_ast_lex.mll
+8 -0 omake-branches/omake_0_9_7_pre5/src/env/omake_ast_parse.input
+100 -20 omake-branches/omake_0_9_7_pre5/src/env/omake_env.ml
+16 -1 omake-branches/omake_0_9_7_pre5/src/env/omake_env.mli
+4 -0 omake-branches/omake_0_9_7_pre5/src/env/omake_exn_print.ml
+32 -26 omake-branches/omake_0_9_7_pre5/src/env/omake_ir_ast.ml
+1 -0 omake-branches/omake_0_9_7_pre5/src/env/omake_lexer.ml
+68 -15 omake-branches/omake_0_9_7_pre5/src/eval/omake_eval.ml
+4 -0 omake-branches/omake_0_9_7_pre5/src/eval/omake_eval.mli
+60 -5 omake-branches/omake_0_9_7_pre5/src/eval/omake_value.ml
+4 -0 omake-branches/omake_0_9_7_pre5/src/eval/omake_value.mli
+5 -1 omake-branches/omake_0_9_7_pre5/src/ir/omake_symbol.ml
+2 -0 omake-branches/omake_0_9_7_pre5/src/ir/omake_virtual_id.ml
+2 -0 omake-branches/omake_0_9_7_pre5/src/ir/omake_virtual_id.mli
+1 -0 omake-branches/omake_0_9_7_pre5/src/libmojave/OMakefile
Added omake-branches/omake_0_9_7_pre5/src/libmojave/lm_dll.ml
Properties omake-branches/omake_0_9_7_pre5/src/libmojave/lm_dll.ml