Commits

camlspotter committed 79382e8

readme

  • Participants
  • Parent commits c99e508

Comments (0)

Files changed (3)

 * A very small compiler patch which activates -annot and -bin-annot if OCAML_ANNOT environment variable is defined. (You no longder need to add -annot/-bin-annot to the build scripts.)
 * A small tool to install annotation files to the library destination directory. (You no longer need to add annotation file installation to the build scripts.)
 
-For the first workaround, you need a small patch available from 
->>
-  hg clone -b annot https://bitbucket.org/camlspotter/mutated_ocaml
-<<
+For the first workaround, you need a small patch available from::
+
+    hg clone -b annot https://bitbucket.org/camlspotter/mutated_ocaml
+
+or included in this directory, ocaml-annot-<version>.patch.
 
 For the second one, you can use SpotInstall. This tool.
 
 Synopsis
 ==============================
 
->>
-  spotinstall <packages>
-<<
+::
+
+    spotinstall <packages>
 
 The command checks the files in the installation directory of OCamlFind package <package>, and if there are corresponding annotation files in the current and its sub directories, copy them to the installation directory.
 

ocaml-annot-4.00.0.patch

+diff -r 973d50fe6fa4 README.annot.rst
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/README.annot.rst	Thu Aug 02 00:01:24 2012 +0900
+@@ -0,0 +1,13 @@
++=====================
++OCaml annot patch
++=====================
++
++This small modification to OCaml compiler introduces OCAML_ANNOT environment variable which enables annotation file creation by default without the compiler switch -annot and -bin-annot.
++
++For example::
++
++   OCAML_ANNOT=1 ocamlc hello.ml
++
++creates hello.annot and hello.cmt even without -annot or -bin-annot.
++
++
+diff -r 973d50fe6fa4 VERSION
+--- a/VERSION	Mon Jul 30 11:21:53 2012 +0800
++++ b/VERSION	Thu Aug 02 00:01:24 2012 +0900
+@@ -1,4 +1,4 @@
+-4.00.0
++4.00.0+annot
+ 
+ # The version string is the first line of this file.
+ # It must be in the format described in stdlib/sys.mli
+diff -r 973d50fe6fa4 driver/main.ml
+--- a/driver/main.ml	Mon Jul 30 11:21:53 2012 +0800
++++ b/driver/main.ml	Thu Aug 02 00:01:24 2012 +0900
+@@ -160,6 +160,11 @@
+ 
+ let main () =
+   try
++    (* OCAML_ANNOT env variable to turn on -annot by default *)
++    (try ignore (Sys.getenv "OCAML_ANNOT"); 
++         Clflags.annotations := true;
++         Clflags.binary_annotations := true;
++    with Not_found -> ()); 
+     Arg.parse Options.list anonymous usage;
+     if
+       List.length (List.filter (fun x -> !x)
+diff -r 973d50fe6fa4 driver/optmain.ml
+--- a/driver/optmain.ml	Mon Jul 30 11:21:53 2012 +0800
++++ b/driver/optmain.ml	Thu Aug 02 00:01:24 2012 +0900
+@@ -175,6 +175,11 @@
+   native_code := true;
+   let ppf = Format.err_formatter in
+   try
++    (* OCAML_ANNOT env variable to turn on -annot by default *)
++    (try ignore (Sys.getenv "OCAML_ANNOT"); 
++         Clflags.annotations := true;
++         Clflags.binary_annotations := true;
++    with Not_found -> ()); 
+     Arg.parse (Arch.command_line_options @ Options.list) anonymous usage;
+     if
+       List.length (List.filter (fun x -> !x)
 let exts_of_sp = function
   | ".cmx" | ".cmo" -> [ ".spot"; ".cmt" ]
   | ".cmi" -> [ ".spit"; ".cmti"; ".cmt" ] (* Packed .cmi has no .spit but .spot *)
+  | ".ml" -> [ ".annot" ]
   | _ -> assert false
 
 let dest_dir package= ocamlfind_path ^/ package
 
   Unix.find ["."] ~f:(fun path ->
     match Filename.split_extension path.Unix.base with
-    | body, (".cmx" | ".cmo" | ".cmi" as ext) -> 
+    | body, (".cmx" | ".cmo" | ".cmi" | ".ml" as ext) -> 
         begin match 
             let spotspits = 
               List.map (fun ext -> path.Unix.dir ^/ body ^ ext) (exts_of_sp ext)