Commits

camlspotter committed e2eb37f

fell back to 3.11.2

Comments (0)

Files changed (187)

 parsing/lexer.cmi: parsing/parser.cmi parsing/location.cmi 
 parsing/linenum.cmi: 
 parsing/location.cmi: utils/warnings.cmi 
+parsing/locident.cmi: parsing/location.cmi 
 parsing/longident.cmi: 
 parsing/parse.cmi: parsing/parsetree.cmi 
-parsing/parser.cmi: parsing/parsetree.cmi 
+parsing/parser.cmi: parsing/parsetree.cmi parsing/locident.cmi 
 parsing/parsetree.cmi: parsing/longident.cmi parsing/location.cmi \
     parsing/asttypes.cmi 
 parsing/printast.cmi: parsing/parsetree.cmi 
 parsing/parse.cmx: parsing/syntaxerr.cmx parsing/parser.cmx \
     parsing/location.cmx parsing/lexer.cmx parsing/parse.cmi 
 parsing/parser.cmo: parsing/syntaxerr.cmi parsing/parsetree.cmi \
-    parsing/longident.cmi parsing/location.cmi utils/clflags.cmi \
-    parsing/asttypes.cmi parsing/parser.cmi 
+    parsing/longident.cmi parsing/locident.cmi parsing/location.cmi \
+    utils/clflags.cmi parsing/asttypes.cmi parsing/parser.cmi 
 parsing/parser.cmx: parsing/syntaxerr.cmx parsing/parsetree.cmi \
-    parsing/longident.cmx parsing/location.cmx utils/clflags.cmx \
-    parsing/asttypes.cmi parsing/parser.cmi 
+    parsing/longident.cmx parsing/locident.cmi parsing/location.cmx \
+    utils/clflags.cmx parsing/asttypes.cmi parsing/parser.cmi 
 parsing/printast.cmo: parsing/parsetree.cmi parsing/longident.cmi \
     parsing/location.cmi parsing/asttypes.cmi parsing/printast.cmi 
 parsing/printast.cmx: parsing/parsetree.cmi parsing/longident.cmx \
 typing/primitive.cmi: 
 typing/printtyp.cmi: typing/types.cmi typing/path.cmi typing/outcometree.cmi \
     parsing/longident.cmi typing/ident.cmi 
+typing/spot.cmi: typing/types.cmi typing/typedtree.cmi typing/path.cmi \
+    parsing/location.cmi typing/ident.cmi 
 typing/stypes.cmi: typing/typedtree.cmi parsing/location.cmi typing/annot.cmi 
 typing/subst.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi 
 typing/typeclass.cmi: typing/types.cmi typing/typedtree.cmi \
     parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \
     utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \
     typing/printtyp.cmi 
+typing/spot.cmo: typing/types.cmi typing/typedtree.cmi typing/printtyp.cmi \
+    typing/path.cmi typing/mtype.cmi parsing/location.cmi typing/ident.cmi \
+    typing/ctype.cmi utils/config.cmi utils/clflags.cmi typing/spot.cmi 
+typing/spot.cmx: typing/types.cmx typing/typedtree.cmx typing/printtyp.cmx \
+    typing/path.cmx typing/mtype.cmx parsing/location.cmx typing/ident.cmx \
+    typing/ctype.cmx utils/config.cmx utils/clflags.cmx typing/spot.cmi 
 typing/stypes.cmo: typing/typedtree.cmi typing/printtyp.cmi \
     parsing/location.cmi utils/clflags.cmi typing/annot.cmi typing/stypes.cmi 
 typing/stypes.cmx: typing/typedtree.cmx typing/printtyp.cmx \
     utils/misc.cmx typing/ident.cmx typing/btype.cmx typing/subst.cmi 
 typing/typeclass.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
     typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \
-    typing/subst.cmi typing/stypes.cmi typing/printtyp.cmi typing/predef.cmi \
-    typing/path.cmi parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \
-    parsing/longident.cmi parsing/location.cmi typing/includeclass.cmi \
-    typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/clflags.cmi \
-    typing/btype.cmi parsing/asttypes.cmi typing/typeclass.cmi 
+    typing/subst.cmi typing/stypes.cmi typing/spot.cmi typing/printtyp.cmi \
+    typing/predef.cmi typing/path.cmi parsing/parsetree.cmi \
+    typing/parmatch.cmi utils/misc.cmi parsing/longident.cmi \
+    parsing/location.cmi typing/includeclass.cmi typing/ident.cmi \
+    typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \
+    parsing/asttypes.cmi typing/typeclass.cmi 
 typing/typeclass.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \
     typing/typedtree.cmx typing/typedecl.cmx typing/typecore.cmx \
-    typing/subst.cmx typing/stypes.cmx typing/printtyp.cmx typing/predef.cmx \
-    typing/path.cmx parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \
-    parsing/longident.cmx parsing/location.cmx typing/includeclass.cmx \
-    typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/clflags.cmx \
-    typing/btype.cmx parsing/asttypes.cmi typing/typeclass.cmi 
+    typing/subst.cmx typing/stypes.cmx typing/spot.cmx typing/printtyp.cmx \
+    typing/predef.cmx typing/path.cmx parsing/parsetree.cmi \
+    typing/parmatch.cmx utils/misc.cmx parsing/longident.cmx \
+    parsing/location.cmx typing/includeclass.cmx typing/ident.cmx \
+    typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \
+    parsing/asttypes.cmi typing/typeclass.cmi 
 typing/typecore.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
-    typing/typedtree.cmi typing/stypes.cmi typing/printtyp.cmi \
-    typing/primitive.cmi typing/predef.cmi typing/path.cmi \
-    parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \
+    typing/typedtree.cmi typing/stypes.cmi typing/spot.cmi \
+    typing/printtyp.cmi typing/primitive.cmi typing/predef.cmi \
+    typing/path.cmi parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \
     parsing/longident.cmi parsing/location.cmi typing/ident.cmi \
     typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \
     parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi 
 typing/typecore.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \
-    typing/typedtree.cmx typing/stypes.cmx typing/printtyp.cmx \
-    typing/primitive.cmx typing/predef.cmx typing/path.cmx \
-    parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \
+    typing/typedtree.cmx typing/stypes.cmx typing/spot.cmx \
+    typing/printtyp.cmx typing/primitive.cmx typing/predef.cmx \
+    typing/path.cmx parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \
     parsing/longident.cmx parsing/location.cmx typing/ident.cmx \
     typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \
     parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi 
 typing/typedecl.cmo: typing/typetexp.cmi typing/types.cmi \
-    typing/typedtree.cmi typing/subst.cmi typing/printtyp.cmi \
+    typing/typedtree.cmi typing/subst.cmi typing/spot.cmi typing/printtyp.cmi \
     typing/primitive.cmi typing/predef.cmi typing/path.cmi \
     parsing/parsetree.cmi utils/misc.cmi parsing/longident.cmi \
     parsing/location.cmi typing/includecore.cmi typing/ident.cmi \
     typing/env.cmi typing/ctype.cmi utils/config.cmi utils/clflags.cmi \
     typing/btype.cmi parsing/asttypes.cmi typing/typedecl.cmi 
 typing/typedecl.cmx: typing/typetexp.cmx typing/types.cmx \
-    typing/typedtree.cmx typing/subst.cmx typing/printtyp.cmx \
+    typing/typedtree.cmx typing/subst.cmx typing/spot.cmx typing/printtyp.cmx \
     typing/primitive.cmx typing/predef.cmx typing/path.cmx \
     parsing/parsetree.cmi utils/misc.cmx parsing/longident.cmx \
     parsing/location.cmx typing/includecore.cmx typing/ident.cmx \
     parsing/asttypes.cmi typing/typedtree.cmi 
 typing/typemod.cmo: typing/types.cmi typing/typedtree.cmi typing/typedecl.cmi \
     typing/typecore.cmi typing/typeclass.cmi typing/subst.cmi \
-    typing/stypes.cmi typing/printtyp.cmi typing/path.cmi \
+    typing/stypes.cmi typing/spot.cmi typing/printtyp.cmi typing/path.cmi \
     parsing/parsetree.cmi typing/mtype.cmi utils/misc.cmi \
     parsing/longident.cmi parsing/location.cmi typing/includemod.cmi \
     typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/config.cmi \
     typing/typemod.cmi 
 typing/typemod.cmx: typing/types.cmx typing/typedtree.cmx typing/typedecl.cmx \
     typing/typecore.cmx typing/typeclass.cmx typing/subst.cmx \
-    typing/stypes.cmx typing/printtyp.cmx typing/path.cmx \
+    typing/stypes.cmx typing/spot.cmx typing/printtyp.cmx typing/path.cmx \
     parsing/parsetree.cmi typing/mtype.cmx utils/misc.cmx \
     parsing/longident.cmx parsing/location.cmx typing/includemod.cmx \
     typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/config.cmx \
 typing/types.cmx: typing/primitive.cmx typing/path.cmx utils/misc.cmx \
     typing/ident.cmx parsing/asttypes.cmi typing/types.cmi 
 typing/typetexp.cmo: utils/warnings.cmi typing/types.cmi utils/tbl.cmi \
-    typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi utils/misc.cmi \
-    parsing/longident.cmi parsing/location.cmi typing/env.cmi \
+    typing/spot.cmi typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi \
+    utils/misc.cmi parsing/longident.cmi parsing/location.cmi typing/env.cmi \
     typing/ctype.cmi utils/clflags.cmi typing/btype.cmi typing/typetexp.cmi 
 typing/typetexp.cmx: utils/warnings.cmx typing/types.cmx utils/tbl.cmx \
-    typing/printtyp.cmx typing/path.cmx parsing/parsetree.cmi utils/misc.cmx \
-    parsing/longident.cmx parsing/location.cmx typing/env.cmx \
+    typing/spot.cmx typing/printtyp.cmx typing/path.cmx parsing/parsetree.cmi \
+    utils/misc.cmx parsing/longident.cmx parsing/location.cmx typing/env.cmx \
     typing/ctype.cmx utils/clflags.cmx typing/btype.cmx typing/typetexp.cmi 
 typing/unused_var.cmo: utils/warnings.cmi parsing/parsetree.cmi \
     parsing/longident.cmi parsing/location.cmi parsing/asttypes.cmi \
     utils/clflags.cmx utils/ccomp.cmx bytecomp/bytesections.cmx \
     bytecomp/bytelink.cmi 
 bytecomp/bytepackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \
-    typing/subst.cmi typing/path.cmi utils/misc.cmi bytecomp/instruct.cmi \
-    typing/ident.cmi typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi \
-    bytecomp/cmo_format.cmi utils/clflags.cmi bytecomp/bytelink.cmi \
-    bytecomp/bytegen.cmi bytecomp/bytepackager.cmi 
+    typing/subst.cmi typing/spot.cmi typing/path.cmi utils/misc.cmi \
+    bytecomp/instruct.cmi typing/ident.cmi typing/env.cmi \
+    bytecomp/emitcode.cmi utils/config.cmi bytecomp/cmo_format.cmi \
+    utils/clflags.cmi bytecomp/bytelink.cmi bytecomp/bytegen.cmi \
+    bytecomp/bytepackager.cmi 
 bytecomp/bytepackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \
-    typing/subst.cmx typing/path.cmx utils/misc.cmx bytecomp/instruct.cmx \
-    typing/ident.cmx typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \
-    bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \
-    bytecomp/bytegen.cmx bytecomp/bytepackager.cmi 
+    typing/subst.cmx typing/spot.cmx typing/path.cmx utils/misc.cmx \
+    bytecomp/instruct.cmx typing/ident.cmx typing/env.cmx \
+    bytecomp/emitcode.cmx utils/config.cmx bytecomp/cmo_format.cmi \
+    utils/clflags.cmx bytecomp/bytelink.cmx bytecomp/bytegen.cmx \
+    bytecomp/bytepackager.cmi 
 bytecomp/bytesections.cmo: utils/config.cmi bytecomp/bytesections.cmi 
 bytecomp/bytesections.cmx: utils/config.cmx bytecomp/bytesections.cmi 
 bytecomp/dll.cmo: utils/misc.cmi utils/config.cmi bytecomp/dll.cmi 
     asmcomp/cmmgen.cmx utils/clflags.cmx utils/ccomp.cmx asmcomp/asmgen.cmx \
     asmcomp/asmlink.cmi 
 asmcomp/asmpackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \
-    utils/misc.cmi parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \
-    typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \
-    asmcomp/clambda.cmi utils/ccomp.cmi asmcomp/asmlink.cmi \
+    typing/spot.cmi utils/misc.cmi parsing/location.cmi bytecomp/lambda.cmi \
+    typing/ident.cmi typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi \
+    utils/clflags.cmi asmcomp/clambda.cmi utils/ccomp.cmi asmcomp/asmlink.cmi \
     asmcomp/asmgen.cmi asmcomp/asmpackager.cmi 
 asmcomp/asmpackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \
-    utils/misc.cmx parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \
-    typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \
-    asmcomp/clambda.cmx utils/ccomp.cmx asmcomp/asmlink.cmx \
+    typing/spot.cmx utils/misc.cmx parsing/location.cmx bytecomp/lambda.cmx \
+    typing/ident.cmx typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx \
+    utils/clflags.cmx asmcomp/clambda.cmx utils/ccomp.cmx asmcomp/asmlink.cmx \
     asmcomp/asmgen.cmx asmcomp/asmpackager.cmi 
 asmcomp/clambda.cmo: bytecomp/lambda.cmi typing/ident.cmi \
     asmcomp/debuginfo.cmi parsing/asttypes.cmi asmcomp/clambda.cmi 
 driver/pparse.cmi: 
 driver/compile.cmo: utils/warnings.cmi typing/unused_var.cmi \
     typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \
-    typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \
-    bytecomp/printlambda.cmi bytecomp/printinstr.cmi parsing/printast.cmi \
-    driver/pparse.cmi parsing/parse.cmi utils/misc.cmi parsing/location.cmi \
-    typing/ident.cmi typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi \
-    utils/clflags.cmi utils/ccomp.cmi bytecomp/bytegen.cmi driver/compile.cmi 
+    typing/stypes.cmi typing/spot.cmi bytecomp/simplif.cmi \
+    typing/printtyp.cmi bytecomp/printlambda.cmi bytecomp/printinstr.cmi \
+    parsing/printast.cmi driver/pparse.cmi parsing/parse.cmi utils/misc.cmi \
+    parsing/location.cmi typing/ident.cmi typing/env.cmi \
+    bytecomp/emitcode.cmi utils/config.cmi utils/clflags.cmi utils/ccomp.cmi \
+    bytecomp/bytegen.cmi driver/compile.cmi 
 driver/compile.cmx: utils/warnings.cmx typing/unused_var.cmx \
     typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \
-    typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \
-    bytecomp/printlambda.cmx bytecomp/printinstr.cmx parsing/printast.cmx \
-    driver/pparse.cmx parsing/parse.cmx utils/misc.cmx parsing/location.cmx \
-    typing/ident.cmx typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \
-    utils/clflags.cmx utils/ccomp.cmx bytecomp/bytegen.cmx driver/compile.cmi 
+    typing/stypes.cmx typing/spot.cmx bytecomp/simplif.cmx \
+    typing/printtyp.cmx bytecomp/printlambda.cmx bytecomp/printinstr.cmx \
+    parsing/printast.cmx driver/pparse.cmx parsing/parse.cmx utils/misc.cmx \
+    parsing/location.cmx typing/ident.cmx typing/env.cmx \
+    bytecomp/emitcode.cmx utils/config.cmx utils/clflags.cmx utils/ccomp.cmx \
+    bytecomp/bytegen.cmx driver/compile.cmi 
 driver/errors.cmo: utils/warnings.cmi typing/typetexp.cmi typing/typemod.cmi \
     typing/typedecl.cmi typing/typecore.cmi typing/typeclass.cmi \
     bytecomp/translmod.cmi bytecomp/translcore.cmi bytecomp/translclass.cmi \
 driver/main_args.cmx: driver/main_args.cmi 
 driver/optcompile.cmo: utils/warnings.cmi typing/unused_var.cmi \
     typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \
-    typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \
-    bytecomp/printlambda.cmi parsing/printast.cmi driver/pparse.cmi \
-    parsing/parse.cmi utils/misc.cmi parsing/location.cmi typing/ident.cmi \
-    typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \
-    utils/ccomp.cmi asmcomp/asmgen.cmi driver/optcompile.cmi 
+    typing/stypes.cmi typing/spot.cmi bytecomp/simplif.cmi \
+    typing/printtyp.cmi bytecomp/printlambda.cmi parsing/printast.cmi \
+    driver/pparse.cmi parsing/parse.cmi utils/misc.cmi parsing/location.cmi \
+    typing/ident.cmi typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi \
+    utils/clflags.cmi utils/ccomp.cmi asmcomp/asmgen.cmi \
+    driver/optcompile.cmi 
 driver/optcompile.cmx: utils/warnings.cmx typing/unused_var.cmx \
     typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \
-    typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \
-    bytecomp/printlambda.cmx parsing/printast.cmx driver/pparse.cmx \
-    parsing/parse.cmx utils/misc.cmx parsing/location.cmx typing/ident.cmx \
-    typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \
-    utils/ccomp.cmx asmcomp/asmgen.cmx driver/optcompile.cmi 
+    typing/stypes.cmx typing/spot.cmx bytecomp/simplif.cmx \
+    typing/printtyp.cmx bytecomp/printlambda.cmx parsing/printast.cmx \
+    driver/pparse.cmx parsing/parse.cmx utils/misc.cmx parsing/location.cmx \
+    typing/ident.cmx typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx \
+    utils/clflags.cmx utils/ccomp.cmx asmcomp/asmgen.cmx \
+    driver/optcompile.cmi 
 driver/opterrors.cmo: utils/warnings.cmi typing/typetexp.cmi \
     typing/typemod.cmi typing/typedecl.cmi typing/typecore.cmi \
     typing/typeclass.cmi bytecomp/translmod.cmi bytecomp/translcore.cmi \

.hgtags

-44487b29b382f81c989876c293cbe266532784c9 ocaml3110rc1
-dcce7f620fb633c7fd78500b392bc62df5617bad ocaml3110
-8978bc8842bebab725216b06dc79ed161ce3e4e4 ocaml3111rc0
-b4974e63d55e8409f3c704ed315da2965012f547 ocaml3111rc1
-10f98a71c87760184281b6e695b323f2d64968c9 ocaml3111
-ae6728f0e0439d38ee8522c4d7386b5f742ec9d1 ocaml3112
-682f910ff10a427a3a4b9ef2f207262751b8abf0 ocaml3112

0scripts/0ADD-RELEASE-TAG

+#!/bin/sh
+set -e
+ver=`../ocamlspot/ocamlspot --version 2>&1`
+tag=`echo $ver | sed -r -e 's/ocamlspot ([^ ]+) for ocaml ([^ ]+)/ocamlspot-\1-for-\2/'`
+echo hg tag $tag
+
+
+

0scripts/0BUILD.sh

+#!/bin/sh
+
+set -e
+./configure --prefix $PREFIX
+make clean core coreboot
+./build/mixed-boot.sh
+cp boot/myocamlbuild boot/myocamlbuild.boot
+make world opt opt.opt

0scripts/0CONF.sh

+#!/bin/sh
+
+SVNREV=10643
+VERSION=3.12.0
+SPOTVERSION=1.2.1
+
+BIGVERSION=`echo $VERSION | sed -r -e 's/^([0-9]+\.[0-9]+)\..*$/\1/'`
+
+OCAMLSPOTVERSION=$VERSION-$SPOTVERSION
+HG_PURE_OCAML="ocaml-$VERSION-$SVNREV"

0scripts/0MAKESCRIPTS.sh

+#!/bin/sh
+
+set -e
+
+. ./0CONF.sh
+
+SED="sed -e s/%BIGVERSION%/$BIGVERSION/g -e s/%VERSION%/$VERSION/g -e s/%OCAMLSPOTVERSION%/$OCAMLSPOTVERSION/g -e s/%SVNREV%/$SVNREV/g"
+
+$SED INSTALL-ocamlspot.txt.in > ../ocamlspot/INSTALL-ocamlspot.txt
+$SED BRAIN_DEAD_INSTALL.sh.in > ../ocamlspot/BRAIN_DEAD_INSTALL.sh
+chmod +x ../ocamlspot/BRAIN_DEAD_INSTALL.sh
+$SED VERIFY.sh.in > ../ocamlspot/VERIFY.sh
+chmod +x ../ocamlspot/VERIFY.sh

0scripts/0VERIFY.sh

+#!/bin/sh
+
+# This script checks that the patch extends ocaml compiler conservatively:
+# Object files created by the original and patched compilers are the same.
+
+set -e
+
+. ./0CONF.sh
+
+cd ..
+
+# build boot/myocamlbuild.boot
+
+make core coreboot
+./build/mixed-boot.sh
+cp boot/myocamlbuild boot/myocamlbuild.boot
+
+# recover the original compiler
+rm -rf patched-boot
+mkdir patched-boot
+mv boot/ocamlc boot/ocamldep boot/ocamllex patched-boot
+hg revert -r $HG_PURE_OCAML boot/ocamlc boot/ocamldep boot/ocamllex
+make world opt opt.opt
+
+rm -rf boot/Saved _build/boot/Saved
+find . -iregex '.*\.\(cm.*\|o\)' | sort | xargs md5sum > MD5-original
+
+make clean 
+mv patched-boot/* boot
+make world opt opt.opt
+rm -rf boot/Saved _build/boot/Saved
+find . -iregex '.*\.\(cm.*\|o\)' | sort | xargs md5sum > MD5-ocamlspot
+
+if cmp MD5-original MD5-ocamlspot; then
+    echo "All the object files are equal!"
+else
+    echo "Something different is created by compiler+ocamlspot!"
+fi

0scripts/0checkout

+svn co http://caml.inria.fr/svn/ocaml/release/3.12.0/

0scripts/BRAIN_DEAD_INSTALL.sh.in

+#!/bin/sh
+# No warranty, no question. Just for brain-dead people.
+set -e
+svn checkout http://caml.inria.fr/svn/ocaml/release/%VERSION% .
+svn update -r %SVNREV%
+patch -p1 < compiler_patch.diff
+./configure
+make core coreboot
+./build/mixed-boot.sh
+cp boot/myocamlbuild boot/myocamlbuild.boot
+make world opt opt.opt
+echo ===================== testing =======================
+(cd ocamlspot/tests; make; ./auto-test.pl  *.ml *.mli) 
+echo ===================== congrats ======================
+echo Now you can type make intall
+echo Do not forget to install the elisp file, ocamlspot/ocamlspot.el
+echo and configure your .emacs

0scripts/INSTALL-ocamlspot.txt.in

+0. If you have no time to read the following, just try the script in the package:
+  
+    $ ./BRAIN_DEAD_INSTALL.sh
+
+  It will clone the official source of version %VERSION% in the current directory, then apply the patch, and compile with the default configuration. Jump to 8 for the emacs lisp installation.
+
+1. Ok, you are not brain dead. Download OCaml compiler version %VERSION%:
+
+  - grab it from http://caml.inria.fr/pub/distrib/ocaml-%BIGVERSION%/%VERSION%.tar.gz
+  - You can also use the SVN version
+    ( svn checkout http://caml.inria.fr/svn/ocaml/release/%VERSION% )
+
+2. Extract the compiler source.
+
+  - tar zxvf ocaml-%VERSION%.tar.gz
+  - cd ocaml-%VERSION%                 # do not forget this
+
+3. Extract ocamlspot.tgz and Apply the patch
+
+  - tar zxvf ocamlspotter-%OCAMLSPOTVERSION%.tgz
+  - mv ocamlspotter-%OCAMLSPOTVERSION%/* .
+  - patch -p1 < compiler_patch.diff
+
+  Check your patched source tree. It should have ocamlspot directory with the original files like INSTALL, LICENSE and VERSION.
+
+4. Build a bytecode compiler
+
+  - ./configure
+  - make core coreboot
+
+5. Manual ocamlbuild bootstrap:
+
+   Do not forget the following after make coreboot:
+
+  - ./build/mixed-boot.sh
+  - cp boot/myocamlbuild boot/myocamlbuild.boot
+
+6. Continue building
+
+  - make world
+  - make opt
+  - make opt.opt
+
+7. Check the patched compiler is compatible with the original
+
+  You can use VERIFY.sh to check that the patched compiler produces the same object files as the orignal compiler.
+
+8. Install it
+
+  - make install
+
+9. Emacs interface
+
+  Write the following into your .emacs:
+
+  ; load-path
+  (setq load-path (cons "WHERE-YOU-HAVE-INSTALLED-THE-ELISP" load-path))
+ 
+  ; set the path of the ocamlspot binary
+  (setq ocamlspot-path "WHERE-YOU-HAVE-INSTALLED-THE-BINARIES/ocamlspot")
+ 
+  ; autoload
+  (autoload 'ocamlspot-query "ocamlspot" "OCamlSpot")
+ 
+  ; tuareg mode hook (use caml-mode-hook instead if you use caml-mode)
+    (add-hook 'tuareg-mode-hook 
+    	  '(lambda ()
+  	     (local-set-key "\C-c;" 'ocamlspot-query)
+  	     (local-set-key "\C-c\C-t" 'ocamlspot-type)
+             (local-set-key "\C-c\C-y" 'ocamlspot-type-and-copy)
+  	     (local-set-key "\C-c\C-u" 'ocamlspot-use)
+  	     (local-set-key "\C-ct" 'caml-types-show-type)))
+ 
+10. How to use
+
+  Compiler your ML project by this patched compiler with -annot option to create .spot files. Open one of the source files in Emacs and place the cursor at the name whose definition is in question. Type C-c; will show you the defintion.
+
+11. bug report
+
+  Please report bugs to jun.furuse at gmail.

0scripts/VERIFY.sh.in

+#!/bin/sh
+
+# This script checks that the patch extends ocaml compiler conservatively:
+# Object files created by the original and patched compilers are the same.
+
+set -e
+rm -rf verify
+svn checkout http://caml.inria.fr/svn/ocaml/release/%VERSION% verify/
+cd verify
+svn update -r %SVNREV%
+./configure
+make clean core coreboot world opt opt.opt
+rm -rf boot/Saved _build/boot/Saved
+find . -iregex '.*\.\(cm.*\|o\)' | sort | xargs md5sum > MD5-original
+rm -rf boot/*
+cp ../boot/[a-z]* boot
+make clean world opt opt.opt
+rm -rf boot/Saved _build/boot/Saved
+find . -iregex '.*\.\(cm.*\|o\)' | sort | xargs md5sum > MD5-ocamlspot
+if cmp MD5-original MD5-ocamlspot; then
+    echo "All the object files are equal!"
+else
+    echo "Something different is created by compiler+ocamlspot!"
+fi
+ 
 
 CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
 CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
-COMPFLAGS=-warn-error A $(INCLUDES)
+COMPFLAGS=-warn-error A $(INCLUDES) -annot
 LINKFLAGS=
 
 CAMLYACC=boot/ocamlyacc
   typing/datarepr.cmo typing/env.cmo \
   typing/typedtree.cmo typing/ctype.cmo \
   typing/printtyp.cmo typing/includeclass.cmo \
-  typing/mtype.cmo typing/includecore.cmo \
+  typing/mtype.cmo typing/spot.cmo typing/includecore.cmo \
   typing/includemod.cmo typing/parmatch.cmo \
   typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \
   typing/typedecl.cmo typing/typeclass.cmo \
 
 # Recompile the system using the bootstrap compiler
 all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
-  otherlibraries ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc
+  otherlibraries ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc ocamlspot
 
 # Compile everything the first time
 world:
 opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
          ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc ocamlopt.opt \
          otherlibrariesopt \
-         ocamllex.opt ocamltoolsopt.opt ocamlbuild.native camlp4opt ocamldoc.opt
+         ocamllex.opt ocamltoolsopt.opt ocamlbuild.native camlp4opt ocamldoc.opt ocamlspot.opt
 
 # Installation
 install:
           (cd otherlibs/$$i; $(MAKE) install) || exit $$?; \
         done
 	cd ocamldoc; $(MAKE) install
+	cd ocamlspot; $(MAKE) install
 	if test -f ocamlopt; then $(MAKE) installopt; else :; fi
 	if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \
 	   else :; fi
 	cp ocamlopt $(BINDIR)/ocamlopt$(EXE)
 	cd stdlib; $(MAKE) installopt
 	cd ocamldoc; $(MAKE) installopt
+	cd ocamlspot; $(MAKE) installopt
 	for i in $(OTHERLIBRARIES); \
 	  do (cd otherlibs/$$i; $(MAKE) installopt) || exit $$?; done
 	if test -f ocamlc.opt; \
 alldepend::
 	cd ocamldoc && $(MAKE) depend
 
+# OCamlSpot
+
+ocamlspot: ocamlc ocamlyacc ocamllex otherlibraries
+	cd ocamlspot && $(MAKE) all
+
+ocamlspot.opt: ocamlc.opt ocamlyacc ocamllex
+	cd ocamlspot && $(MAKE) opt.opt
+
+partialclean::
+	cd ocamlspot && $(MAKE) clean
+
+alldepend::
+	cd ocamlspot && $(MAKE) depend
+
 # The extra libraries
 
 otherlibraries: ocamltools
 
 partialclean::
 	for d in utils parsing typing bytecomp asmcomp driver toplevel tools; \
-	  do rm -f $$d/*.cm[iox] $$d/*.annot $$d/*.[so] $$d/*~; done
+	  do rm -f $$d/*.cm[iox] $$d/*.annot $$d/*.sp*t $$d/*.[so] $$d/*~; done
 	rm -f *~
 
 depend: beforedepend
 .PHONY: coreboot defaultentry depend distclean install installopt
 .PHONY: library library-cross libraryopt ocamlbuild-mixed-boot
 .PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
-.PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltools.opt
+.PHONY: ocamldoc.opt ocamlspot ocamlspot.opt ocamllex ocamllex.opt ocamltools ocamltools.opt
 .PHONY: ocamlyacc opt-core opt opt.opt otherlibraries
 .PHONY: otherlibrariesopt package-macosx promote promote-cross
 .PHONY: restore runtime runtimeopt makeruntimeopt world world.opt
-3.11.2
+3.11.2+ocamlspotter-1.2+camlp4-lexer-plugs
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
 true: -traverse
 
 # Traverse only these directories
-<{bytecomp,driver,stdlib,tools,asmcomp,camlp4,ocamlbuild,toplevel,ocamldoc,typing,otherlibs,utils,debugger,lex,parsing,byterun,asmrun}/**>: traverse
+<{bytecomp,driver,stdlib,tools,asmcomp,camlp4,ocamlbuild,toplevel,ocamldoc,typing,otherlibs,utils,debugger,lex,parsing,byterun,asmrun,ocamlspot}/**>: traverse
 
 "boot" or "byterun" or "asmrun": not_hygienic
 

asmcomp/asmpackager.ml

   Compilenv.reset ?packname:!Clflags.for_package targetname;
   try
     let coercion = Typemod.package_units files targetcmi targetname in
-    package_object_files ppf files targetcmx targetobj targetname coercion
+    package_object_files ppf files targetcmx targetobj targetname coercion;
+    Spot.File.dump_package ~prefix ~source:(prefix ^ ".cmx") files
   with x ->
     remove_file targetcmx; remove_file targetobj;
     raise x

build/partial-install.sh

   mkdir -p $CAMLP4DIR/$dir
   installdir     \
     $dir/*.cm*   \
+    $dir/*.sp?t   \
     $dir/*.$O    \
     $CAMLP4DIR/$dir
 done

bytecomp/bytepackager.ml

   let targetname = String.capitalize(Filename.basename prefix) in
   try
     let coercion = Typemod.package_units files targetcmi targetname in
-    package_object_files files targetfile targetname coercion
+    package_object_files files targetfile targetname coercion;
+    Spot.File.dump_package ~prefix ~source:(prefix ^ ".cmo") files
   with x ->
     remove_file targetfile; raise x
 

bytecomp/translmod.ml

               transl_structure (List.rev ids @ fields) cc rootpath rem)
   | Tstr_cltype cl_list :: rem ->
       transl_structure fields cc rootpath rem
-  | Tstr_include(modl, ids) :: rem ->
+  | Tstr_include(modl, ids, _sg) :: rem ->
       let mid = Ident.create "include" in
       let rec rebind_idents pos newfields = function
         [] ->
                 transl_store (add_idents false ids subst) rem)
   | Tstr_cltype cl_list :: rem ->
       transl_store subst rem
-  | Tstr_include(modl, ids) :: rem ->
+  | Tstr_include(modl, ids, _sg) :: rem ->
       let mid = Ident.create "include" in
       let rec store_idents pos = function
         [] -> transl_store (add_idents true ids subst) rem
   | Tstr_class cl_list :: rem ->
       List.map (fun (i, _, _, _, _) -> i) cl_list @ defined_idents rem
   | Tstr_cltype cl_list :: rem -> defined_idents rem
-  | Tstr_include(modl, ids) :: rem -> ids @ defined_idents rem
+  | Tstr_include(modl, ids, _sg) :: rem -> ids @ defined_idents rem
 
 (* Transform a coercion and the list of value identifiers defined by
    a toplevel structure into a table [id -> (pos, coercion)],
                 cl_list)
   | Tstr_cltype cl_list ->
       lambda_unit
-  | Tstr_include(modl, ids) ->
+  | Tstr_include(modl, ids, _sg) ->
       let mid = Ident.create "include" in
       let rec set_idents pos = function
         [] ->

camlp4/.ocamlspot

+build_dir=../_build/camlp4/

camlp4/Camlp4/Sig.ml

     value lex_string : Loc.t -> string
                             -> not_filtered (Stream.t (Token.t * Loc.t));
 
+    value set_from_lexbuf : 
+      (?quotations: bool -> Lexing.lexbuf -> Stream.t (Token.t * Loc.t)) 
+    -> unit;
+      
     (** Filter a token stream using the {!Token.Filter} module *)
     value filter : not_filtered (Stream.t (Token.t * Loc.t))
                               -> Stream.t (Token.t * Loc.t);
       The lexer do not use global (mutable) variables: instantiations
       of [Lexer.mk ()] do not perturb each other. *)
   value mk : unit -> (Loc.t -> Stream.t char -> Stream.t (Token.t * Loc.t));
+
+  value from_lexbuf : 
+    ?quotations: bool -> Lexing.lexbuf -> Stream.t (Token.t * Loc.t);
+
+  value set_from_lexbuf : 
+    (?quotations: bool -> Lexing.lexbuf -> Stream.t (Token.t * Loc.t)) -> unit;
 end;
 
 

camlp4/Camlp4/Struct/Grammar/Static.ml

 
   value lex_string loc str = lex loc (Stream.of_string str);
 
+  value set_from_lexbuf = Lexer.set_from_lexbuf;
+
   value filter ts = Token.Filter.filter gram.gfilter ts;
 
   value parse_tokens_after_filter entry ts = Entry.E.parse_tokens_after_filter entry ts;

camlp4/Camlp4/Struct/Lexer.mll

         | Some x ->
             Stream.junk s;
             buff.[n] <- x;
-            succ n
+            self (succ n) s
         | _ -> n
     in
     self 0 s
 
-  let from_context c =
+  let from_context quotations lb =
+    let c = { (default_context lb) with
+              loc        = Loc.of_lexbuf lb;
+              antiquots  = !Camlp4_config.antiquotations;
+              quotations = quotations      }
+    in
     let next _ =
       let tok = with_curr_loc token c in
       let loc = Loc.of_lexbuf c.lexbuf in
     in Stream.from next
 
   let from_lexbuf ?(quotations = true) lb =
-    let c = { (default_context lb) with
-              loc        = Loc.of_lexbuf lb;
-              antiquots  = !Camlp4_config.antiquotations;
-              quotations = quotations      }
-    in from_context c
+    from_context quotations lb
+
+  let from_lexbuf_ref = ref from_lexbuf
+
+  let set_from_lexbuf from_lexbuf = from_lexbuf_ref := from_lexbuf
+
+  let from_lexbuf ?(quotations = true) lb =
+    let zstream = lazy (!from_lexbuf_ref ~quotations lb) in
+    Stream.from (fun _ ->
+      try
+	Some (Stream.next (Lazy.force zstream))
+      with
+      | Stream.Failure -> None)
 
   let setup_loc lb loc =
     let start_pos = Loc.start_pos loc in

camlp4/Camlp4Parsers/Camlp4OCamlParser.ml

     labeled_ipatt:
       [ [ i = a_LABEL; p = patt LEVEL "simple" ->
             <:patt< ~ $i$ : $p$ >>
-        | "~"; i = a_LIDENT -> <:patt< ~ $i$ >>
+        | "~"; i = a_LIDENT -> <:patt< ~ $i$ : $lid:i$ >>
         | "~"; "("; i = a_LIDENT; ")" ->
-            <:patt< ~ $i$ >>
+            <:patt< ~ $i$ : $lid:i$ >>
         | "~"; "("; i = a_LIDENT; ":"; t = ctyp; ")" ->
             <:patt< ~ $i$ : ($lid:i$ : $t$) >>
         | i = a_OPTLABEL; j = a_LIDENT -> (* ?a:b <> ?a : b *)
             <:patt< ? $i$ : ($lid:j$) >>
+        | i = a_OPTLABEL; "_" ->
+            <:patt< ? $i$ : (_) >>
         | i = a_OPTLABEL; "("; p = patt; ")" ->
             <:patt< ? $i$ : ($p$) >>
         | i = a_OPTLABEL; "("; p = patt; "="; e = expr; ")" ->
         | i = a_OPTLABEL; "("; p = patt; ":"; t = ctyp; "=";
           e = expr; ")" ->
             <:patt< ? $i$ : ( $p$ : $t$ = $e$ ) >>
-        | "?"; i = a_LIDENT -> <:patt< ? $i$ >>
+        | "?"; i = a_LIDENT -> <:patt< ? $i$ : ($lid:i$) >>
         | "?"; "("; i = a_LIDENT; "="; e = expr; ")" ->
             <:patt< ? ( $lid:i$ = $e$ ) >>
         | "?"; "("; i = a_LIDENT; ":"; t = ctyp; "="; e = expr; ")" ->
             <:patt< ? ( $lid:i$ : $t$ = $e$ ) >>
         | "?"; "("; i = a_LIDENT; ")" ->
-            <:patt< ? $i$ >>
+            <:patt< ? $i$ : ($lid:i$) >>
         | "?"; "("; i = a_LIDENT; ":"; t = ctyp; ")" ->
             <:patt< ? ( $lid:i$ : $t$ ) >>
         | p = patt LEVEL "simple" -> p

camlp4/Camlp4Top/Top.ml

 open Syntax;
 open Camlp4.Sig;
 module Ast2pt = Camlp4.Struct.Camlp4Ast2OCamlAst.Make Ast;
-module Lexer = Camlp4.Struct.Lexer.Make Token;
+(* module Lexer = Camlp4.Struct.Lexer.Make Token; *)
+module Lexer = PreCast.Lexer;
 
 external not_filtered : 'a -> Gram.not_filtered 'a = "%identity";
 

debugger/Makefile.shared

 
 clean::
 	rm -f ocamldebug$(EXE)
-	rm -f *.cmo *.cmi
+	rm -f *.cmo *.cmi *.annot *.sp*t
 
 .SUFFIXES:
 .SUFFIXES: .ml .cmo .mli .cmi

driver/compile.ml

   with Exit -> ()
 ;;
 
+let protect ~finally f arg =
+  try f arg; finally arg with e -> finally arg; raise e
+
 (* Compile a .mli file *)
 
 let interface ppf sourcefile outputprefix =
       Pparse.file ppf inputfile Parse.interface ast_intf_magic_number in
     if !Clflags.dump_parsetree then fprintf ppf "%a@." Printast.interface ast;
     let sg = Typemod.transl_signature (initial_env()) ast in
+    Spot.Top.record_signature sg;
     if !Clflags.print_types then
       fprintf std_formatter "%a@." Printtyp.signature
                                    (Typemod.simplify_signature sg);
     Warnings.check_fatal ();
-    if not !Clflags.print_types then
+    if not !Clflags.print_types && not !Clflags.annotations_only then
       Env.save_signature sg modulename (outputprefix ^ ".cmi");
     Pparse.remove_preprocessed inputfile
   with e ->
     Pparse.remove_preprocessed_if_ast inputfile;
     raise e
 
+let interface ppf sourcefile outputprefix =
+  protect ~finally:(fun () ->  
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spit"))
+    (fun () -> interface ppf sourcefile outputprefix)
+    ()
+
 (* Compile a .ml file *)
 
 let print_if ppf flag printer arg =
       raise x
   end else begin
     let objfile = outputprefix ^ ".cmo" in
-    let oc = open_out_bin objfile in
+    let oc = if !Clflags.annotations_only then None else Some (open_out_bin objfile) in
     try
       Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number
       ++ print_if ppf Clflags.dump_parsetree Printast.implementation
       ++ print_if ppf Clflags.dump_lambda Printlambda.lambda
       ++ Bytegen.compile_implementation modulename
       ++ print_if ppf Clflags.dump_instr Printinstr.instrlist
-      ++ Emitcode.to_file oc modulename;
+      ++ begin match oc with 
+         | Some oc -> Emitcode.to_file oc modulename;
+	 | None -> ignore
+         end;
       Warnings.check_fatal ();
-      close_out oc;
+      begin match oc with Some oc -> close_out oc | None -> () end;
       Pparse.remove_preprocessed inputfile;
-      Stypes.dump (outputprefix ^ ".annot");
+      Stypes.dump (outputprefix ^ ".annot")
     with x ->
-      close_out oc;
-      remove_file objfile;
+      begin match oc with Some oc -> 
+	close_out oc;
+	remove_file objfile;
+      | None -> () 
+      end;
       Pparse.remove_preprocessed_if_ast inputfile;
       Stypes.dump (outputprefix ^ ".annot");
       raise x
   end
 
+let implementation ppf sourcefile outputprefix =
+  protect ~finally:(fun () ->
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spot"))
+    (fun () -> implementation ppf sourcefile outputprefix) ()
+    
 let c_file name =
   Location.input_name := name;
   if Ccomp.compile_file name <> 0 then exit 2
 
 let main () =
   try
+    (* OCAML_ANNOT env variable to turn on -annot by default *)
+    (try ignore (Sys.getenv "OCAML_ANNOT"); Clflags.annotations := true with Not_found -> ()); 
     Arg.parse Options.list anonymous usage;
     if
       List.length (List.filter (fun x -> !x)

driver/ocamlcomp.sh.in

 
 topdir=`dirname $0`
 
-exec @compiler@ -nostdlib -I $topdir/stdlib "$@"
+exec @compiler@ -nostdlib -I $topdir/stdlib -annot "$@"

driver/optcompile.ml

       fprintf std_formatter "%a@." Printtyp.signature
                                    (Typemod.simplify_signature sg);
     Warnings.check_fatal ();
-    if not !Clflags.print_types then
+    if not !Clflags.print_types && not !Clflags.annotations_only then
       Env.save_signature sg modulename (outputprefix ^ ".cmi");
     Pparse.remove_preprocessed inputfile;
     Stypes.dump (outputprefix ^ ".annot");
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spit");
   with e ->
     Pparse.remove_preprocessed_if_ast inputfile;
     Stypes.dump (outputprefix ^ ".annot");
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spit");
     raise e
 
 (* Compile a .ml file *)
       +++ Simplif.simplify_lambda
       +++ print_if ppf Clflags.dump_lambda Printlambda.lambda
       ++ Asmgen.compile_implementation outputprefix ppf;
-      Compilenv.save_unit_info cmxfile;
+      if not !Clflags.annotations_only then Compilenv.save_unit_info cmxfile;
     end;
     Warnings.check_fatal ();
     Pparse.remove_preprocessed inputfile;
     Stypes.dump (outputprefix ^ ".annot");
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spot");
   with x ->
-    remove_file objfile;
-    remove_file cmxfile;
+    if not !Clflags.annotations_only then begin
+      remove_file objfile;
+      remove_file cmxfile;
+    end;
     Pparse.remove_preprocessed_if_ast inputfile;
     Stypes.dump (outputprefix ^ ".annot");
+    Spot.File.dump ~source:(Some sourcefile) (outputprefix ^ ".spot");
     raise x
 
 let c_file name =

driver/optmain.ml

   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 with Not_found -> ()); 
     Arg.parse (Arch.command_line_options @ [
        "-a", Arg.Set make_archive, " Build a library";
        "-annot", Arg.Set annotations,
     if mixed then
       let patt = String.concat ","
         ["asmcomp"; "bytecomp"; "debugger"; "driver";
-         "lex"; "ocamldoc"; "otherlibs"; "parsing"; "stdlib"; "tools";
+         "lex"; "ocamldoc"; "ocamlspot"; "otherlibs"; "parsing"; "stdlib"; "tools";
          "toplevel"; "typing"; "utils"]
       in Ocamlbuild_pack.Configuration.parse_string
            (sprintf "<{%s}/**>: not_hygienic, -traverse" patt)
 Pathname.define_context "parsing" ["parsing"; "utils"; "stdlib"];;
 Pathname.define_context "typing" ["typing"; "parsing"; "utils"; "stdlib"];;
 Pathname.define_context "ocamldoc" ["typing"; "parsing"; "utils"; "tools"; "bytecomp"; "stdlib"];;
+Pathname.define_context "ocamlspot" ["typing"; "parsing"; "utils"; "tools"; "bytecomp"; "stdlib"];;
 Pathname.define_context "bytecomp" ["bytecomp"; "parsing"; "typing"; "utils"; "stdlib"];;
 Pathname.define_context "tools" ["tools"; (* "toplevel"; *) "parsing"; "utils"; "driver"; "bytecomp"; "asmcomp"; "typing"; "stdlib"];;
 Pathname.define_context "toplevel" ["toplevel"; "parsing"; "typing"; "bytecomp"; "utils"; "driver"; "stdlib"];;

ocamlbuild/.ocamlspot

+build_dir=../_build/ocamlbuild/

ocamldoc/Makefile

 	$(OCAMLSRCDIR)/typing/oprint.cmo \
 	$(OCAMLSRCDIR)/typing/printtyp.cmo \
 	$(OCAMLSRCDIR)/typing/includecore.cmo \
-	$(OCAMLSRCDIR)/typing/typetexp.cmo \
 	$(OCAMLSRCDIR)/typing/typedtree.cmo \
 	$(OCAMLSRCDIR)/typing/parmatch.cmo \
 	$(OCAMLSRCDIR)/typing/stypes.cmo \
+	$(OCAMLSRCDIR)/typing/includeclass.cmo \
+	$(OCAMLSRCDIR)/typing/mtype.cmo \
+	$(OCAMLSRCDIR)/typing/spot.cmo \
+	$(OCAMLSRCDIR)/typing/typetexp.cmo \
+	$(OCAMLSRCDIR)/typing/typedecl.cmo \
 	$(OCAMLSRCDIR)/typing/typecore.cmo \
-	$(OCAMLSRCDIR)/typing/includeclass.cmo \
-	$(OCAMLSRCDIR)/typing/typedecl.cmo \
 	$(OCAMLSRCDIR)/typing/typeclass.cmo \
-	$(OCAMLSRCDIR)/typing/mtype.cmo \
 	$(OCAMLSRCDIR)/typing/includemod.cmo \
 	$(OCAMLSRCDIR)/typing/typemod.cmo \
 	$(OCAMLSRCDIR)/bytecomp/lambda.cmo \
 clean:: dummy
 	@rm -f *~ \#*\#
 	@rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.a *.o
+	@rm -f *.annot *.sp*t
 	@rm -f odoc_parser.output odoc_text_parser.output
 	@rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
 	@rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli

ocamldoc/odoc_ast.ml

     let tt_get_included_module_list tt_structure =
       let f acc item =
         match item with
-          Typedtree.Tstr_include (mod_expr, _) ->
+          Typedtree.Tstr_include (mod_expr, _, _) ->
             acc @ [
                   { (* A VOIR : chercher dans les modules et les module types, avec quel env ? *)
                     im_name = tt_name_from_module_expr mod_expr ;

ocamlspot/.depend

+command.cmi:
+pathreparse.cmi: spotapi.cmi ../typing/path.cmi
+spotapi.cmi: ../typing/types.cmi ../typing/typedtree.cmi ../typing/spot.cmi \
+    ../typing/path.cmi ../typing/ident.cmi
+spotconfig.cmi: spotapi.cmi
+spoteval.cmi: utils.cmi ../typing/types.cmi spotapi.cmi ../typing/path.cmi \
+    ../typing/ident.cmi
+spotfile.cmi: spoteval.cmi spotconfig.cmi spotapi.cmi ../typing/spot.cmi \
+    ../typing/path.cmi ../typing/ident.cmi ../typing/env.cmi \
+    ../typing/annot.cmi
+treeset.cmi: xset.cmi
+utils.cmi:
+xmain.cmi:
+xset.cmi:
+command.cmo: command.cmi
+command.cmx: command.cmi
+dotfile.cmo:
+dotfile.cmx:
+ocamlspot.cmo: xmain.cmi utils.cmi spotfile.cmi spoteval.cmi spotconfig.cmi \
+    spotapi.cmi ../typing/printtyp.cmi pathreparse.cmi ../typing/path.cmi \
+    ../typing/ident.cmi ../typing/env.cmi command.cmi ../typing/annot.cmi
+ocamlspot.cmx: xmain.cmx utils.cmx spotfile.cmx spoteval.cmx spotconfig.cmx \
+    spotapi.cmx ../typing/printtyp.cmx pathreparse.cmx ../typing/path.cmx \
+    ../typing/ident.cmx ../typing/env.cmx command.cmx ../typing/annot.cmi
+pathreparse.cmo: utils.cmi spotapi.cmi ../typing/path.cmi ../typing/ident.cmi \
+    pathreparse.cmi
+pathreparse.cmx: utils.cmx spotapi.cmx ../typing/path.cmx ../typing/ident.cmx \
+    pathreparse.cmi
+spotapi.cmo: utils.cmi ../typing/types.cmi treeset.cmi ../typing/spot.cmi \
+    ../typing/printtyp.cmi ../typing/predef.cmi ../typing/path.cmi \
+    ../typing/ident.cmi ../typing/btype.cmi ../typing/annot.cmi spotapi.cmi
+spotapi.cmx: utils.cmx ../typing/types.cmx treeset.cmx ../typing/spot.cmx \
+    ../typing/printtyp.cmx ../typing/predef.cmx ../typing/path.cmx \
+    ../typing/ident.cmx ../typing/btype.cmx ../typing/annot.cmi spotapi.cmi
+spotconfig.cmo: utils.cmi spoteval.cmi spotapi.cmi ../typing/spot.cmi \
+    ../typing/path.cmi spotconfig.cmi
+spotconfig.cmx: utils.cmx spoteval.cmx spotapi.cmx ../typing/spot.cmx \
+    ../typing/path.cmx spotconfig.cmi
+spoteval.cmo: utils.cmi ../typing/types.cmi spotapi.cmi ../typing/predef.cmi \
+    ../typing/path.cmi ../typing/ident.cmi spoteval.cmi
+spoteval.cmx: utils.cmx ../typing/types.cmx spotapi.cmx ../typing/predef.cmx \
+    ../typing/path.cmx ../typing/ident.cmx spoteval.cmi
+spotfile.cmo: utils.cmi spoteval.cmi spotconfig.cmi spotapi.cmi \
+    ../typing/spot.cmi ../typing/path.cmi ../typing/ident.cmi \
+    ../typing/env.cmi dotfile.cmo ../typing/annot.cmi spotfile.cmi
+spotfile.cmx: utils.cmx spoteval.cmx spotconfig.cmx spotapi.cmx \
+    ../typing/spot.cmx ../typing/path.cmx ../typing/ident.cmx \
+    ../typing/env.cmx dotfile.cmx ../typing/annot.cmi spotfile.cmi
+treeset.cmo: xset.cmi treeset.cmi
+treeset.cmx: xset.cmx treeset.cmi
+utils.cmo: utils.cmi
+utils.cmx: utils.cmi
+xmain.cmo: ../typing/spot.cmi xmain.cmi
+xmain.cmx: ../typing/spot.cmx xmain.cmi
+xset.cmo: xset.cmi
+xset.cmx: xset.cmi

ocamlspot/BRAIN_DEAD_INSTALL.sh

+#!/bin/sh
+# No warranty, no question. Just for brain-dead people.
+set -e
+svn checkout http://caml.inria.fr/svn/ocaml/release/3.12.0 .
+svn update -r 10643
+patch -p1 < compiler_patch.diff
+./configure
+make core coreboot
+./build/mixed-boot.sh
+cp boot/myocamlbuild boot/myocamlbuild.boot
+make world opt opt.opt
+echo ===================== testing =======================
+(cd ocamlspot/tests; make; ./auto-test.pl  *.ml *.mli) 
+echo ===================== congrats ======================
+echo Now you can type make intall
+echo Do not forget to install the elisp file, ocamlspot/ocamlspot.el
+echo and configure your .emacs
+- this will be filled with bugs YOU find and report to jun.furuse@gmail.com.

ocamlspot/Changes

+1.2.0
+--------------
+
+- For OCaml 3.12.0
+- Code cleanups
+
+1.1
+-----
+
+Bug fix
+
+- if x.spot file was obsolete, ocamlspot searched x.spit file instead, 
+  which was not a correct behavior.
+- exceptions in pattern were not browsable.
+- ocamldoc recorded top structures.
+- fix for predefined exception
+
+New feature
+
+- added -n option which does not analyze definition position.
+- ocamlspot-type function is added for type query in ocamlspot.el
+- ocamlspot-use function is added for use query in ocamlspot.el
+- supports a new position format l<line>c<column in bytes> 
+- supports a new query file:kind:path
+- more spots are saved
+- Work around for ocamlbuild. If .ocamlspot file with the text build_dir=dirname
+  is placed in a directory $DIR, then spot files of source files under $DIR 
+  ex. $DIR/subdir/source.ml is searched in $DIR/dirname/subdir/. See an example
+  at camlp4/.ocamlspot
+
+
+ocamlspot.el
+* ocamlspot-path is now ocamlspot-command. Please fix your .emacs.
+- defcustom'ed and code clean-ups (thanks to Sam Steingold) 
+- various elisp bug fixes
+- multi-byte character support in emacs
+
+1.0
+---
+
+Complete rewrite.
+
+beta3
+-----
+
+Clean-ups:
+- Annotation data type simplification
+
+Features:
+- Spot file version number is introduced
+- New browsables:
+    - Data type names to their type defs
+    - Module names to their defs (preliminary support)
+
+beta2p1
+-------
+
+Features:
+- New browsables: variants and record labels to their type defs
+
+beta2:
+------
+
+Complete rewrite.
+
+Features:
+- Enhanced spot file search: if ocamlspot finds no .spot in the load paths 
+  but the corresponding symlinked .cmi, it also searches the .spot file 
+  in the linked directory. 
+
+beta1:
+------
+
+Clean-up and announce.
+
+alpha3:
+-------
+
+Features:
+- File time stamp check
+- .spot file versioning
+
+alpha2:
+-------
+
+Features:
+- Support spotting externals.
+- Enhanced elisp display
+- ocamlopt creates .annot and .spot too
+
+Performance:
+- Things are evaluated more lazily.
+
+Clean-up:
+- Less verbose messages.
+- Removed unnecessary files
+
+Bug-fixes:
+- Location order was mis-defined.
+
+alpha1:
+-------
+
+The first release
+

ocamlspot/INSTALL-ocamlspot.txt

+0. If you have no time to read the following, just try the script in the package:
+  
+    $ ./BRAIN_DEAD_INSTALL.sh
+
+  It will clone the official source of version 3.12.0 in the current directory, then apply the patch, and compile with the default configuration. Jump to 8 for the emacs lisp installation.
+
+1. Ok, you are not brain dead. Download OCaml compiler version 3.12.0:
+
+  - grab it from http://caml.inria.fr/pub/distrib/ocaml-3.12/3.12.0.tar.gz
+  - You can also use the SVN version
+    ( svn checkout http://caml.inria.fr/svn/ocaml/release/3.12.0 )
+
+2. Extract the compiler source.
+
+  - tar zxvf ocaml-3.12.0.tar.gz
+  - cd ocaml-3.12.0                 # do not forget this
+
+3. Extract ocamlspot.tgz and Apply the patch
+
+  - tar zxvf ocamlspotter-3.12.0-1.2.1.tgz
+  - mv ocamlspotter-3.12.0-1.2.1/* .
+  - patch -p1 < compiler_patch.diff
+
+  Check your patched source tree. It should have ocamlspot directory with the original files like INSTALL, LICENSE and VERSION.
+
+4. Build a bytecode compiler
+
+  - ./configure
+  - make core coreboot
+
+5. Manual ocamlbuild bootstrap:
+
+   Do not forget the following after make coreboot:
+
+  - ./build/mixed-boot.sh
+  - cp boot/myocamlbuild boot/myocamlbuild.boot
+
+6. Continue building
+
+  - make world
+  - make opt
+  - make opt.opt
+
+7. Check the patched compiler is compatible with the original
+
+  You can use VERIFY.sh to check that the patched compiler produces the same object files as the orignal compiler.
+
+8. Install it
+
+  - make install
+
+9. Emacs interface
+
+  Write the following into your .emacs:
+
+  ; load-path
+  (setq load-path (cons "WHERE-YOU-HAVE-INSTALLED-THE-ELISP" load-path))
+ 
+  ; set the path of the ocamlspot binary
+  (setq ocamlspot-path "WHERE-YOU-HAVE-INSTALLED-THE-BINARIES/ocamlspot")
+ 
+  ; autoload
+  (autoload 'ocamlspot-query "ocamlspot" "OCamlSpot")
+ 
+  ; tuareg mode hook (use caml-mode-hook instead if you use caml-mode)
+    (add-hook 'tuareg-mode-hook 
+    	  '(lambda ()
+  	     (local-set-key "\C-c;" 'ocamlspot-query)
+  	     (local-set-key "\C-c\C-t" 'ocamlspot-type)
+             (local-set-key "\C-c\C-y" 'ocamlspot-type-and-copy)
+  	     (local-set-key "\C-c\C-u" 'ocamlspot-use)
+  	     (local-set-key "\C-ct" 'caml-types-show-type)))
+ 
+10. How to use
+
+  Compiler your ML project by this patched compiler with -annot option to create .spot files. Open one of the source files in Emacs and place the cursor at the name whose definition is in question. Type C-c; will show you the defintion.
+
+11. bug report
+
+  Please report bugs to jun.furuse at gmail.

ocamlspot/LICENSE

+In the following, "the Library" refers to all files marked "Copyright
+Jun FURUSE" in this directory.
+
+and "the Patch" refers to the file named "ocamldpot.diff" in this directory.
+
+The Patch is distributed under the terms of the Q Public License
+version 1.0 with a change to choice of law (included below), following
+the license of the patch target, OCaml compiler, copyrighted INRIA.
+
+The Library is distributed under the terms of the GNU Library General
+Public License version 2 (included below).
+
+As a special exception to the Q Public Licence, you may develop
+application programs, reusable components and other software items
+that link with the original or modified versions of the Compiler
+and are not made available to the general public, without any of the
+additional requirements listed in clause 6c of the Q Public licence.
+
+As a special exception to the GNU Library General Public License, you
+may link, statically or dynamically, a "work that uses the Library"
+with a publicly distributed version of the Library to produce an
+executable file containing portions of the Library, and distribute
+that executable file under terms of your choice, without any of the
+additional requirements listed in clause 6 of the GNU Library General
+Public License.  By "a publicly distributed version of the Library",
+we mean either the unmodified Library as distributed by INRIA, or a
+modified version of the Library that is distributed under the
+conditions defined in clause 2 of the GNU Library General Public
+License.  This exception does not however invalidate any other reasons
+why the executable file might be covered by the GNU Library General
+Public License.
+
+----------------------------------------------------------------------
+
+                   THE Q PUBLIC LICENSE version 1.0
+
+              Copyright (C) 1999 Troll Tech AS, Norway.
+                  Everyone is permitted to copy and
+                  distribute this license document.
+
+The intent of this license is to establish freedom to share and change
+the software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the
+copyright holder saying that it may be distributed under the terms of
+the Q Public License version 1.0. Such software is herein referred to
+as the Software. This license covers modification and distribution of
+the Software, use of third-party application programs based on the
+Software, and development of free software which uses the Software.
+
+                            Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license
+provided you agree to and comply with any and all conditions in this
+license. Whole or partial distribution of the Software, or software
+items that link with the Software, in any form signifies acceptance of
+this license.
+
+2. You may copy and distribute the Software in unmodified form
+provided that the entire package, including - but not restricted to -
+copyright, trademark notices and disclaimers, as released by the
+initial developer of the Software, is distributed.
+
+3. You may make modifications to the Software and distribute your
+modifications, in a form that is separate from the Software, such as
+patches. The following restrictions apply to modifications:
+
+      a. Modifications must not alter or remove any copyright notices
+      in the Software.
+
+      b. When modifications to the Software are released under this
+      license, a non-exclusive royalty-free right is granted to the
+      initial developer of the Software to distribute your
+      modification in future versions of the Software provided such
+      versions remain available under these terms in addition to any
+      other license(s) of the initial developer.
+
+4. You may distribute machine-executable forms of the Software or
+machine-executable forms of modified versions of the Software,
+provided that you meet these restrictions:
+
+      a. You must include this license document in the distribution.
+
+      b. You must ensure that all recipients of the machine-executable
+      forms are also able to receive the complete machine-readable
+      source code to the distributed Software, including all
+      modifications, without any charge beyond the costs of data
+      transfer, and place prominent notices in the distribution
+      explaining this.
+
+      c. You must ensure that all modifications included in the
+      machine-executable forms are available under the terms of this
+      license.
+
+5. You may use the original or modified versions of the Software to
+compile, link and run application programs legally developed by you or
+by others.
+
+6. You may develop application programs, reusable components and other
+software items that link with the original or modified versions of the
+Software. These items, when distributed, are subject to the following
+requirements:
+
+      a. You must ensure that all recipients of machine-executable
+      forms of these items are also able to receive and use the
+      complete machine-readable source code to the items without any
+      charge beyond the costs of data transfer.
+
+      b. You must explicitly license all recipients of your items to
+      use and re-distribute original and modified versions of the
+      items in both machine-executable and source code forms. The
+      recipients must be able to do so without any charges whatsoever,
+      and they must be able to re-distribute to anyone they choose.
+
+      c. If the items are not available to the general public, and the
+      initial developer of the Software requests a copy of the items,
+      then you must supply one.
+
+                       Limitations of Liability
+
+In no event shall the initial developers or copyright holders be
+liable for any damages whatsoever, including - but not restricted to -
+lost revenue or profits or other direct, indirect, special, incidental
+or consequential damages, even if they have been advised of the
+possibility of such damages, except to the extent invariable law, if
+any, provides otherwise.
+
+                             No Warranty
+
+The Software and this license document are provided AS IS with NO
+WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN,
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+                            Choice of Law
+
+This license is governed by the Laws of France.
+
+----------------------------------------------------------------------
+
+                  GNU LIBRARY GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+                  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABIL