Coccinelle release 1.0.0-rc12
authorCoccinelle <cocci@diku.dk>
Mon, 9 Apr 2012 17:45:37 +0000 (19:45 +0200)
committerRene Rydhof Hansen <rrh@cs.aau.dk>
Mon, 9 Apr 2012 17:45:37 +0000 (19:45 +0200)
** Language:
- Addition of initializer list metavariables.  Thanks to Michael Stefaniuc
  for noticing the need for them.
- Allow multiple position variables per token
- ++ can now be associated with - code
- Allow /* */ comments as smpl comments, not only as + code
- Add support for && (label addresses)
- local idexpression metavariable no longer matches static local x
- Consider using to be a comment in C++ code.  Patch submitted by Jani Monoses.
- Command line cocci
- print_main etc for ocaml Coccilib
- =~ not ~= is used to indicate a regular expression constraint on an
  identifier.  And !~ for a nonmatch.
- allow long double, short int, long int, and long long int in SmPL code.
- gcc constructors allowed in SmPL.  Thanks to Uwe Kleine-Koenig for
  pointing out the problem.
- Allow ! to appear before () in depends.  Thanks to SF Markus Elfring for
  noticing the problem.
- Can add code containing #pragma or #line.
- Multicharacter command-line options now begin with -- and contain -
  rather than _.
- Allow multiple types of hidden metavariables, each preceded by @.
  Position variables can be attached to these.
- Python code now receives a structure containing a list of matched
  elements for list metavariables.  Thanks to Michael Stefaniuc for
  suggesting this features.
- Python code now receives expressions and identifiers as ordinary strings,
  not as elements of specific structures.

** Features:
- Preserve spacing before // comments when not at the beginning of a line
- Adjusted parsing of endif to put it after jump code
- Improve warning message when using -use_cache
- More helpful initial value for exported variables in python
- Support - on expression nests
- Better handling of the case of a matched declaration that should only
  be replaced by other top level things.
- Allow a semantic patch beginning and ending with braces to match the
  complete body of a function if the braces are not removed and if nothing
  is added before the first brace or after the last one.
- Add -cache_prefix option, to specify where to put cached files.
- Allow module_init(foo); to match module_init(foo) (or likewise for any
  declarer), when no transformation is specified on the semicolon.
- Add Coccilib.exit() for ocaml code and cocci.exit() for python code,
  to abort the treatment of the current file.
- Don't multiply print the same patch for the same file
- Drop date in diff
- Don't repeat smpl type warnings
- -sp_file/-cocci_file are now optional.  If not present an argument that
  ends in .cocci is assumed to be the name of the file containing the
  semantic patch.
- Allow limiting the size of a named cache using -cache_limit
- Cache name specified with -cache_prefix is extended according to the
  index (parallelism), if any.
- Allow multi-character constants in C code and SmPL code.  Thanks to Kamil
  Pilch for pointing out the problem.
- Better parsing of K&R C functions.  No longer convert all parameters to
  typedefs.
- Implement newes as a hash table, for more efficiency on big sets of
  environments.
- A local variable that is declared without a type is not considered to be
  a local variable.  Actually, such a variable is probably really a macro
  that expends to a declaration, and this macro is not the variable name.
- Allow iteration to make modifications when the modifications are done
  inplace.
- -debug gives information about defined virtual rules and about virtual
  identifier bindings.
- no more crashing on c++-like code without the c++ argument.
- dependencies can have ! on ()
- Give ocaml code access to Flag and thus the current file name.
- Slightly more efficient handling of lists.
- Slightly better error message in the case of inconsistent paths
- Improve limited size caching
- Remove #ifdefs when everything else is removed

** Bugfix:
- Corrected parsing of script strings delimited by a single quote.  Thanks
  to Eugeniy Meshcheryakov for reporting the problem.
- Improved indentation of added ifdefs.
- Allow added comments and #ifdefs to precede other added code.  Thanks to
  Jani Monoses for noticing the problem.
- Corrected failure to due missing ocamlfind. Thanks to Derek M. Jones for
  reporting the problem.
- Allow fake nodes to be - in the allminus case, to drop tokens related to
  a function definition or forward declaration but before the first code
  mentioned in the semantic patch.
- Drop __init etc when deleting a whole function.
- Cause appropriate newlines to be preserved when multiple matches (trees)
  contain adjacent modifications derived from the same SmPL code.
- check_meta takes into account fresh identifier seed information.
- Types for worth-trying optimization should not be followed by space
- Improved filtering of result of matching atomic patterns
- Drop positions before creating function prototype rules
- Adjust position of { introduced by adding multiple statements in a
  single-statement position
- Drop newline after function call ( when all arguments on that line are
  eliminated
- Accept removal of a single declaration, replaced by arbitrary,
  non-declaration code
- smpl_spacing takes into account newlines, indentation
- Improved prevention of transformations on toplevel { ... } from causing
  changes outside function boundaries; also outside ifs, whiles, etc.
  Changes are still allowed on { ... } present for other reasons.
- Fix bug in include_match that caused everything to halt when all matches
  were discarded
- Don't call Insert_plus on rules that cannot be evaluated due to failed
  dependencies.
- Allow variable declaration right after a case in switch.
- The top of a loop is also after the body of a loop, for ... in loop body
- Do not anchor Str regexp at the beginning of the string to check
- Type annotation for C code uses most recent env for typedefs when
  possible.  Thanks to Andrea Canciani for pointing out the problem.
- Pretty print pointer types without a trailing space.  Thanks to Michael
  Stefaniuc for pointing out the problem.
- Propagate dependencies further in get_constants2
- Make lexer more dos friendly
- slightly better handling of long long
- Strip constraints from metavariables in function prototype treatment
  before comparison, due to incomparability of pcre regexps.
- Fixed obsolete regexp doc, thanks to Dmitry Osmakov
- Improved x || ... || y to avoid double modification
- Transparently allow \( \| and \) to be on lines beginning with -.  The -
  has no effect.
- Remove memory leak related to pr2_once management.  Thanks to Robert
  Gomulka for helping to solve the problem.  Don't use once hashtable if
  messages won't be printed anyway.
- Change the type of subtraction mixing pointer and array to have int result.
  Thanks to Robert Gomulka for noticing the problem.
- Fix interpretation of dependencies in the presence of virtual rules.
  Ignore constraints on inherited position metavariables in a rule that
  will be ignored.
- Better support meta iterator and meta declarer tokens, and symid tokens.
- Better indentation after added noindent.
- Fixed length bug in the treatment of structures.
- Allow inheriting declaration/field metavariables.
- Don't drop spaces after parentheses in when no minus code present.
  Thanks to Terry Wilson for reporting the problem.
- Keep inherited metavariables in asttomember (preprocessing for matching)
- allminus for types, to allow removing const, not just matching it
- improved pretty printing when something is added before a closed brace
- Allow matching on nameless structs.  Thanks to Ron Minnich for reporting
  the problem.
- Pretty printing of const/volatile arrays in smpl code.
- Don't allow just dropping an exp or type
- Avoid removing #endif when surrounded by - code

397 files changed:
Makefile
Makefile.config.in [new file with mode: 0644]
Makefile.dev
Makefile.libs
Makefile.release
aclocal.m4 [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
bundles/extlib/Makefile [new file with mode: 0644]
bundles/extlib/extlib-1.5.2.tar.gz [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/.marker [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/IO.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/IO.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/LICENSE [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/META [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/Makefile [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/README.txt [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/base64.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/base64.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/bitSet.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/bitSet.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/dllist.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/dllist.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/dynArray.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/dynArray.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/enum.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/enum.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extArray.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extArray.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extHashtbl.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extHashtbl.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extLib.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extList.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extList.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extString.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/extString.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/global.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/global.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/install.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/odoc_style.css [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/optParse.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/optParse.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/option.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/option.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/pMap.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/pMap.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/refList.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/refList.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/std.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/std.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/uChar.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/uChar.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/uTF8.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/uTF8.mli [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/unzip.ml [new file with mode: 0644]
bundles/extlib/extlib-1.5.2/unzip.mli [new file with mode: 0644]
bundles/menhirLib/Makefile [new file with mode: 0644]
bundles/menhirLib/menhir-20120123.tar.gz [new file with mode: 0644]
bundles/pcre/Makefile [new file with mode: 0644]
bundles/pcre/pcre-ocaml-release-6.2.5.tar.gz [new file with mode: 0644]
bundles/pycaml/Makefile [new file with mode: 0644]
bundles/pycaml/pycaml_0.82-14.debian.tar.gz [new file with mode: 0644]
bundles/pycaml/pycaml_0.82.orig.tar.gz [new file with mode: 0644]
bundles/readme.txt [new file with mode: 0644]
bundles/sexplib/Makefile [new file with mode: 0644]
bundles/sexplib/sexp-3.10-compat.patch [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5.tar.gz [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/.hg_archival.txt [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/.marker [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/COPYRIGHT [moved from ocamlsexp/copyright.txt with 100% similarity]
bundles/sexplib/sexplib-7.0.5/Changelog [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/INSTALL [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/LICENSE [moved from ocamlsexp/license.txt with 100% similarity]
bundles/sexplib/sexplib-7.0.5/LICENSE.Tywith [moved from ocamlsexp/license-tywith.txt with 100% similarity]
bundles/sexplib/sexplib-7.0.5/Makefile [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/README.txt [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/_oasis [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/_tags [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/configure [new file with mode: 0755]
bundles/sexplib/sexplib-7.0.5/doc/Makefile [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/doc/OMakefile [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/doc/README.tex [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/doc/custom.hva [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/doc/hevea.sty [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/META [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/conv.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/conv.mli [moved from ocamlsexp/conv.mli with 56% similarity]
bundles/sexplib/sexplib-7.0.5/lib/conv_error.ml [moved from ocamlsexp/conv_error.ml with 64% similarity]
bundles/sexplib/sexplib-7.0.5/lib/exn_magic.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/exn_magic.mli [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/lexer.mll [moved from ocamlsexp/lexer.mll with 67% similarity]
bundles/sexplib/sexplib-7.0.5/lib/parser.mly [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/path.ml [moved from ocamlsexp/path.ml with 75% similarity]
bundles/sexplib/sexplib-7.0.5/lib/path.mli [moved from ocamlsexp/path.mli with 54% similarity]
bundles/sexplib/sexplib-7.0.5/lib/pre_sexp.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/sexp.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/sexp.mli [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/sexp_intf.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/sexplib.mlpack [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/sexplib.odocl [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/std.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib/type.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib_test/Makefile [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib_test/OMakefile [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib_test/conv_test.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib_test/sexp_test.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/lib_test/test.sexp [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/myocamlbuild.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/setup.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mli [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mllib [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/top/install_printers.ml [new file with mode: 0644]
bundles/sexplib/sexplib-7.0.5/top/sexplib_top.mllib [new file with mode: 0644]
changes.txt
cocci.ml
cocci.mli
commons/Makefile
commons/commands.ml.in [new file with mode: 0644]
commons/common.ml
commons/common.mli
configure
configure.ac [new file with mode: 0644]
ctl/Makefile
ctl/ast_ctl.ml
ctl/ctl_engine.ml
ctl/ctl_engine.mli
ctl/flag_ctl.ml
ctl/pretty_print_ctl.ml
ctl/pretty_print_ctl.mli
ctl/test_ctl.ml
ctl/wrapper_ctl.ml
ctl/wrapper_ctl.mli
docs/Makefile
docs/manual/Makefile
docs/manual/macros.tex
docs/manual/main_grammar.pdf
docs/manual/manual.pdf
docs/manual/manual.tex [new file with mode: 0644]
docs/manual/options.pdf
docs/manual/options.tex [new file with mode: 0644]
docs/spatch.1.in
engine/Makefile
engine/asttoctl.ml
engine/asttoctl.mli
engine/asttoctl2.ml
engine/asttoctl2.mli
engine/asttomember.ml
engine/asttomember.mli
engine/c_vs_c.ml
engine/c_vs_c.mli
engine/check_exhaustive_pattern.ml
engine/check_reachability.ml
engine/check_reachability.mli
engine/cocci_vs_c.ml
engine/cocci_vs_c.mli
engine/ctlcocci_integration.ml
engine/ctlcocci_integration.mli
engine/ctltotex.ml
engine/ctltotex.mli
engine/flag_engine.ml
engine/flag_matcher.ml
engine/isomorphisms_c_c.ml
engine/lib_engine.ml
engine/lib_matcher_c.ml
engine/lib_matcher_c.mli
engine/main.ml
engine/pattern_c.ml
engine/pattern_c.mli
engine/postprocess_transinfo.ml
engine/postprocess_transinfo.mli
engine/pretty_print_engine.ml
engine/pretty_print_engine.mli
engine/sgrep.ml
engine/transformation_c.ml
engine/transformation_c.mli
extra/Makefile
flag_cocci.ml
globals/Makefile
globals/config.ml.in
globals/flag.ml
globals/iteration.ml
globals/iteration.mli
globals/regexp.ml [deleted file]
globals/regexp.ml.in
globals/regexp_pcre.ml
globals/regexp_str.ml
install-sh [new file with mode: 0755]
main.ml
menhirlib/Makefile [deleted file]
menhirlib/convert.ml [deleted file]
menhirlib/engine.ml [deleted file]
menhirlib/engineTypes.ml [deleted file]
menhirlib/infiniteArray.ml [deleted file]
menhirlib/license.txt [deleted file]
menhirlib/packedIntArray.ml [deleted file]
menhirlib/readme.txt [deleted file]
menhirlib/rowDisplacement.ml [deleted file]
menhirlib/tableFormat.ml [deleted file]
menhirlib/tableInterpreter.ml [deleted file]
ocaml/Makefile
ocaml/Makefile.doc
ocaml/prepare_ocamlcocci.ml [deleted file]
ocaml/prepare_ocamlcocci.ml.in
ocaml/yes_prepare_ocamlcocci.ml
ocamlsexp/Makefile [deleted file]
ocamlsexp/conv.ml [deleted file]
ocamlsexp/modif-orig.txt [deleted file]
ocamlsexp/parser.mly [deleted file]
ocamlsexp/pre_sexp.ml [deleted file]
ocamlsexp/sexp.ml [deleted file]
ocamlsexp/sexp.mli [deleted file]
ocamlsexp/sexp_intf.ml [deleted file]
ocamlsexp/type.ml [deleted file]
parsing_c/Makefile
parsing_c/parse_c.ml
parsing_c/parsing_hacks.ml
parsing_c/pretty_print_c.ml
parsing_c/token_c.ml
parsing_c/token_views_c.ml
parsing_c/token_views_c.mli
parsing_c/unparse_c.ml
parsing_cocci/Makefile
parsing_cocci/adjacency.ml
parsing_cocci/adjacency.mli
parsing_cocci/adjust_pragmas.ml
parsing_cocci/adjust_pragmas.mli
parsing_cocci/arity.ml
parsing_cocci/arity.mli
parsing_cocci/ast0_cocci.ml
parsing_cocci/ast0_cocci.mli
parsing_cocci/ast0toast.ml
parsing_cocci/ast0toast.mli
parsing_cocci/ast_cocci.ml
parsing_cocci/ast_cocci.mli
parsing_cocci/check_meta.ml
parsing_cocci/check_meta.mli
parsing_cocci/comm_assoc.ml
parsing_cocci/comm_assoc.mli
parsing_cocci/command_line.ml
parsing_cocci/command_line.mli
parsing_cocci/compute_lines.ml
parsing_cocci/compute_lines.mli
parsing_cocci/context_neg.ml
parsing_cocci/context_neg.mli
parsing_cocci/data.ml
parsing_cocci/data.mli
parsing_cocci/disjdistr.ml
parsing_cocci/disjdistr.mli
parsing_cocci/flag_parsing_cocci.ml
parsing_cocci/free_vars.ml
parsing_cocci/free_vars.mli
parsing_cocci/function_prototypes.ml
parsing_cocci/function_prototypes.mli
parsing_cocci/get_constants.ml
parsing_cocci/get_constants.mli
parsing_cocci/get_constants2.ml
parsing_cocci/get_constants2.mli
parsing_cocci/get_metas.ml
parsing_cocci/get_metas.mli
parsing_cocci/id_utils.ml
parsing_cocci/id_utils.mli
parsing_cocci/index.ml
parsing_cocci/index.mli
parsing_cocci/insert_plus.ml
parsing_cocci/insert_plus.mli
parsing_cocci/iso_compile.ml
parsing_cocci/iso_compile.mli
parsing_cocci/iso_pattern.ml
parsing_cocci/iso_pattern.mli
parsing_cocci/lexer_cli.ml [new file with mode: 0644]
parsing_cocci/lexer_cli.mll
parsing_cocci/lexer_cocci.ml [new file with mode: 0644]
parsing_cocci/lexer_cocci.mll
parsing_cocci/lexer_script.ml [new file with mode: 0644]
parsing_cocci/lexer_script.mll
parsing_cocci/main.ml
parsing_cocci/merge.ml
parsing_cocci/merge.mli
parsing_cocci/obsolete/parser_cocci.mly [moved from parsing_cocci/parser_cocci.mly with 97% similarity]
parsing_cocci/parse_aux.ml
parsing_cocci/parse_cocci.ml
parsing_cocci/parse_cocci.mli
parsing_cocci/plus.ml
parsing_cocci/plus.mli
parsing_cocci/pretty_print_cocci.ml
parsing_cocci/pretty_print_cocci.mli
parsing_cocci/safe_for_multi_decls.ml
parsing_cocci/safe_for_multi_decls.mli
parsing_cocci/semantic_cocci.ml
parsing_cocci/simple_assignments.ml
parsing_cocci/simple_assignments.mli
parsing_cocci/single_statement.ml
parsing_cocci/single_statement.mli
parsing_cocci/test_exps.ml
parsing_cocci/test_exps.mli
parsing_cocci/top_level.ml
parsing_cocci/top_level.mli
parsing_cocci/type_cocci.ml
parsing_cocci/type_cocci.mli
parsing_cocci/type_infer.ml
parsing_cocci/type_infer.mli
parsing_cocci/unify_ast.ml
parsing_cocci/unify_ast.mli
parsing_cocci/unitary_ast0.ml
parsing_cocci/unitary_ast0.mli
parsing_cocci/unparse_ast0.ml
parsing_cocci/unparse_ast0.mli
parsing_cocci/visitor_ast.ml
parsing_cocci/visitor_ast.mli
parsing_cocci/visitor_ast0.ml
parsing_cocci/visitor_ast0.mli
parsing_cocci/visitor_ast0_types.ml
popl/Makefile
popl/ast_popl.ml
popl/asttopopl.ml
popl/asttopopl.mli
popl/insert_befaft.ml
popl/insert_befaft.mli
popl/insert_quantifiers.ml
popl/insert_quantifiers.mli
popl/popl.ml
popl/popl.mli
popl/popltoctl.ml
popl/popltoctl.mli
popl/pretty_print_popl.ml
popl/pretty_print_popl.mli
popl09/Makefile
popl09/ast_popl.ml
popl09/asttopopl.ml
popl09/asttopopl.mli
popl09/flag_popl.ml
popl09/insert_quantifiers.ml
popl09/insert_quantifiers.mli
popl09/popl.ml
popl09/popl.mli
popl09/popltoctl.ml
popl09/popltoctl.mli
popl09/pretty_print_popl.ml
popl09/pretty_print_popl.mli
pycaml/Makefile [deleted file]
pycaml/Makefile.in [deleted file]
pycaml/OCamlMakefile [deleted file]
pycaml/acinclude.m4 [deleted file]
pycaml/aclocal.m4 [deleted file]
pycaml/configure [deleted file]
pycaml/configure.in [deleted file]
pycaml/getprefix.py [deleted file]
pycaml/getversion.py [deleted file]
pycaml/license.txt [deleted file]
pycaml/modif-orig.txt [deleted file]
pycaml/ocamlobj.ml [deleted file]
pycaml/pycaml.html [deleted file]
pycaml/pycaml.ml [deleted file]
pycaml/pycaml_ml.c [deleted file]
pycaml/pycamltest.ml [deleted file]
pycaml/tupletest.ml [deleted file]
python/Makefile
python/no_pycocci.ml
python/pycocci.ml.in
python/pycocci.mli
python/pycocci_aux.ml
python/pycocci_aux.mli
python/yes_pycocci.ml
release.nix
scripts/genversion.sh [new file with mode: 0755]
scripts/spatch.bash_completion
scripts/spatch.sh [deleted file]
scripts/spatch.sh.in [new file with mode: 0644]
setup/cocci.m4 [new file with mode: 0644]
setup/fake-menhir.sh [new file with mode: 0755]
setup/fake-pdflatex.sh [new file with mode: 0755]
setup/fake-subst.sh [new file with mode: 0755]
setup/ocaml.m4 [new file with mode: 0644]
setup/replies.txt [new file with mode: 0644]
test.ml [new file with mode: 0644]
testing.ml
testing.mli
tests/SCORE_expected.sexp
tests/SCORE_expected_orig.sexp
tests/orexp.cocci
tests/orexp.res
tools/Makefile
tools/alloc_free.ml
tools/bridge.ml
tools/dir_stats.ml
tools/dumper.ml
tools/dumper.mli
tools/extract_c_and_res.ml
tools/generate_dependencies.ml
tools/gitgrep.ml
tools/gitsort.ml
tools/licensify.ml
tools/process_isoprofile.ml
tools/splitpatch.ml
tools/spp.ml
version
version.ml.in [new file with mode: 0644]

index df350ea..d6caf58 100644 (file)
--- a/Makefile
+++ b/Makefile
 # Coccinelle under other licenses.
 
 
-
 #############################################################################
 # Configuration section
 #############################################################################
 
--include Makefile.libs
+include Makefile.libs
+
+# 'distclean' does not require configure to have run, and should also
+# clean all the bundled directories. Hence, a special case.
+ifeq ($(MAKECMDGOALS),distclean)
+MAKELIBS:=$(dir $(wildcard ./bundles/*/Makefile))
+else
+ifneq ($(MAKECMDGOALS),configure)
 -include Makefile.config
+endif
+endif
+
 -include /etc/lsb-release
+-include Makefile.override         # local customizations, if any
+-include /etc/Makefile.coccinelle  # local customizations, if any
+
 
-VERSION=$(shell cat ./version)
-CCVERSION=$(shell cat scripts/coccicheck/README |grep "Coccicheck version" |perl -p -e 's/.*version (.*)[ ]*/$$1/;')
+VERSION=$(shell cat ./version | tr -d '\n')
+CCVERSION=$(shell cat scripts/coccicheck/README | egrep -o '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' | head -n1)
 PKGVERSION=$(shell dpkg-parsechangelog -ldebian/changelog.$(DISTRIB_CODENAME) 2> /dev/null \
         | sed -n 's/^Version: \(.*\)/\1/p' )
 
 ##############################################################################
 # Variables
 ##############################################################################
+
 TARGET=spatch
 PRJNAME=coccinelle
-
-LEXER_SOURCES =
 SRC=flag_cocci.ml cocci.ml testing.ml test.ml $(LEXER_SOURCES:.mll=.ml) main.ml
 
 ifeq ($(FEATURE_PYTHON),1)
-PYCMA=pycaml.cma
-# the following is essential for Coccinelle to compile under gentoo (weird)
-#OPTLIBFLAGS=-cclib dllpycaml_stubs.so
+       PYTHON_INSTALL_TARGET=install-python
 else
-PYCMA=
+       PYTHON_INSTALL_TARGET=
 endif
-OPTLIBFLAGS=
-
-ifeq ("$(SEXPDIR)","ocamlsexp")
-SEXPLIB=ocamlsexp/sexplib.cmo
-OPTSEXPLIB=sexplib.cmx
-else
-SEXPLIB=sexplib.cma
-OPTSEXPLIB=sexplib.cmxa
-endif
-
-ifeq ("$(DYNLINK)","no")
-DYNLINK=
-else
-DYNLINK=dynlink.cma
-endif
-
-ifdef PCREDIR
-PCRELIB=pcre.cma
-else
-PCRELIB=
-PCREDIR=
-endif
-
-SEXPSYSCMA=bigarray.cma nums.cma
 
-SYSLIBS=str.cma unix.cma $(SEXPSYSCMA) $(DYNLINK) $(PCRELIB) # threads.cma
+SYSLIBS=str.cma unix.cma bigarray.cma nums.cma
 LIBS=commons/commons.cma \
      commons/commons_sexp.cma \
      globals/globals.cma \
@@ -86,58 +71,29 @@ LIBS=commons/commons.cma \
      engine/cocciengine.cma popl09/popl.cma \
      extra/extra.cma python/coccipython.cma ocaml/cocciocaml.cma
 
-# Should we use the local version of pycaml
-ifeq ($(FEATURE_PYTHON),1)
-ifeq ("$(PYCAMLDIR)","pycaml")
-LOCALPYCAML=pycaml
-else
-LOCALPYCAML=
-endif
-endif
-
-# Should we use the local version of menhirLib
-ifeq ("$(MENHIRDIR)","menhirlib")
-LOCALMENHIR=menhirlib
-else
-LOCALMENHIR=
-endif
-
-# Should we use the local version of ocamlsexp
-ifeq ("$(SEXPDIR)","ocamlsexp")
-LOCALSEXP=ocamlsexp
-else
-LOCALSEXP=
-endif
+MAKESUBDIRS=$(MAKELIBS) commons \
+ globals ctl parsing_cocci parsing_c \
+ engine popl09 extra python ocaml
 
-# used for depend: and a little for rec & rec.opt
-MAKESUBDIRS=$(LOCALSEXP) commons \
- globals $(LOCALMENHIR) ctl parsing_cocci parsing_c \
- engine popl09 extra python ocaml \
+CLEANSUBDIRS=commons \
+ globals ctl parsing_cocci parsing_c \
+ engine popl09 extra python ocaml docs \
  $(MAKELIBS)
 
-# used for clean:
-# It is like MAKESUBDIRS but also
-# force cleaning of local library copies
-CLEANSUBDIRS=pycaml ocamlsexp commons \
- globals menhirlib ctl parsing_cocci parsing_c \
- engine popl09 extra python ocaml \
- $(CLEANLIBS)
-
-INCLUDEDIRSDEP=commons commons/ocamlextra $(LOCALSEXP) \
- globals $(LOCALMENHIR) $(LOCALPYCAML) ctl \
+INCLUDEDIRSDEP=commons commons/ocamlextra \
+ globals ctl \
  parsing_cocci parsing_c engine popl09 extra python ocaml \
- $(DEPLIBS)
-
-INCLUDEDIRS=$(INCLUDEDIRSDEP) $(SEXPDIR) $(MENHIRDIR) $(PYCAMLDIR) $(PCREDIR) $(INCLIBS)
+ $(MAKELIBS)
 
-EXTRALINKS=
-LINKFLAGS=$(EXTRALINKS:%=-cclib -l%)
+INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(INCLIBS)
 
 ##############################################################################
 # Generic variables
 ##############################################################################
 
-INCLUDES=$(INCLUDEDIRS:%=-I %)
+# sort to remove duplicates
+INCLUDESET=$(sort $(INCLUDEDIRS))
+INCLUDES=$(INCLUDESET:%=-I %)
 
 OBJS=    $(SRC:.ml=.cmo)
 OPTOBJS= $(SRC:.ml=.cmx)
@@ -157,12 +113,11 @@ OCAMLCFLAGS=
 # to also link with -g.
 OPTFLAGS= -g
 
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(LINKFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(LINKFLAGS) $(INCLUDES)
-OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep $(INCLUDEDIRSDEP:%=-I %)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLYACC_CMD=$(OCAMLYACC) -v
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDEDIRSDEP:%=-I %)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 # can also be set via 'make static'
 CFLAGS=-pie -fPIE -fpic -fPIC -static
@@ -175,46 +130,85 @@ BYTECODE_STATIC=-custom
 ##############################################################################
 # Top rules
 ##############################################################################
-.PHONY:: all all.opt byte opt top clean distclean configure
-.PHONY:: $(MAKESUBDIRS) $(MAKESUBDIRS:%=%.opt) subdirs subdirs.opt
+.PHONY:: all all.opt byte opt top clean distclean configure opt-compil
+.PHONY:: $(MAKESUBDIRS:%=%.all) $(MAKESUBDIRS:%=%.opt) subdirs.all subdirs.opt
+.PHONY:: all-opt all-byte byte-only opt-only
 
-all: Makefile.config byte preinstall
 
-opt all.opt: opt-compil preinstall
+# All make targets that are expected to be an entry point have a dependency on
+# 'Makefile.config' to ensure that if Makefile.config is not present, an error
+# message is printed first before any other actions are executed.
+# In addition, the targets that actually build something have a dependency on
+# '.depend' and 'version.ml'.
 
-world: preinstall
+# dispatches to either 'all-without-opt' or 'all-with-opt'
+all: Makefile.config .depend $(TARGET_ALL)
+
+# make "all" comes in three flavours
+world: Makefile.config .depend version.ml
+       @echo "building both versions of spatch"
        $(MAKE) byte
        $(MAKE) opt-compil
+       $(MAKE) preinstall
+       $(MAKE) docs
+       @echo ""
+       @echo -e "\tcoccinelle can now be installed via 'make install'"
+
+# note: the 'all-dev' target excludes the documentation
+all-dev: Makefile.config .depend version.ml
+       @echo "building the unoptimized version of spatch"
+       $(MAKE) byte
+       $(MAKE) preinstall
+       @echo ""
+       @echo -e "\tcoccinelle can now be installed via 'make install'"
+
+all-release: Makefile.config .depend version.ml
+       @echo building the optimized version of spatch
+       $(MAKE) opt-compil
+       $(MAKE) preinstall
+       $(MAKE) docs
+       @echo ""
+       @echo -e "\tcoccinelle can now be installed via 'make install'"
+
+all.opt: Makefile.config opt-only preinstall
 
-byte: .depend
-       $(MAKE) subdirs
+# aliases for "byte" and "opt-compil"
+opt opt-only: Makefile.config opt-compil
+byte-only: Makefile.config byte
+
+byte: Makefile.config .depend version.ml
+       $(MAKE) subdirs.all
        $(MAKE) $(EXEC)
+       @echo the compilation of $(EXEC) finished
+       @echo $(EXEC) can be installed or used
 
-opt-compil: .depend
+opt-compil: Makefile.config .depend version.ml
        $(MAKE) subdirs.opt
        $(MAKE) $(EXEC).opt
+       @echo the compilation of $(EXEC).opt finished
+       @echo $(EXEC).opt can be installed or used
 
 top: $(EXEC).top
 
-subdirs:
-       +for D in $(MAKESUBDIRS); do $(MAKE) $$D || exit 1 ; done
-       $(MAKE) -C commons sexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
+subdirs.all:
+       +for D in $(MAKESUBDIRS); do $(MAKE) $$D.all || exit 1 ; done
+       $(MAKE) -C commons sexp.all OCAMLCFLAGS="$(OCAMLCFLAGS)"
 
 subdirs.opt:
        +for D in $(MAKESUBDIRS); do $(MAKE) $$D.opt || exit 1 ; done
        $(MAKE) -C commons sexp.opt OPTFLAGS="$(OPTFLAGS)"
 
-$(MAKESUBDIRS):
-       $(MAKE) -C $@ OCAMLCFLAGS="$(OCAMLCFLAGS)" all
+$(MAKESUBDIRS:%=%.all):
+       $(MAKE) -C $(@:%.all=%) -j1 OCAMLCFLAGS="$(OCAMLCFLAGS)" all
 
 $(MAKESUBDIRS:%=%.opt):
-       $(MAKE) -C $(@:%.opt=%) OPTFLAGS="$(OPTFLAGS)" all.opt
+       $(MAKE) -C $(@:%.opt=%) -j1 OPTFLAGS="$(OPTFLAGS)" all.opt
 
 #dependencies:
 # commons:
 # globals:
-# menhirlib:
-# parsing_cocci: commons globals menhirlib
+# menhirLib:
+# parsing_cocci: commons globals menhirLib
 # parsing_c:parsing_cocci
 # ctl:globals commons
 # engine: parsing_cocci parsing_c ctl
@@ -223,28 +217,28 @@ $(MAKESUBDIRS:%=%.opt):
 # pycaml:
 # python:pycaml parsing_cocci parsing_c
 
-clean::
-       set -e; for i in $(CLEANSUBDIRS); do $(MAKE) -C $$i $@; done
+clean:: Makefile.config
+       set -e; for i in $(CLEANSUBDIRS); do $(MAKE) -C $$i -j1 $@; done
        $(MAKE) -C demos/spp $@
 
-$(LIBS): $(MAKESUBDIRS)
+$(LIBS): $(MAKESUBDIRS:%=%.all)
 $(LIBS:.cma=.cmxa): $(MAKESUBDIRS:%=%.opt)
-$(LNKLIBS) : $(MAKESUBDIRS)
+$(LNKLIBS) : $(MAKESUBDIRS:%=%.all)
 $(LNKOPTLIBS) : $(MAKESUBDIRS:%=%.opt)
 
-$(OBJS):$(LIBS) $(LNKLIBS)
-$(OPTOBJS):$(LIBS:.cma=.cmxa) $(LNKOPTLIBS)
+$(OBJS):$(LIBS)
+$(OPTOBJS):$(LIBS:.cma=.cmxa)
 
 $(EXEC): $(LIBS) $(OBJS)
-       $(OCAMLC) $(BYTECODE_STATIC) -o $@ $(SYSLIBS) $(SEXPLIB) $(LNKLIBS) $^
+       $(OCAMLC_CMD) $(BYTECODE_STATIC) $(FLAGSLIBS) -o $@ $(SYSLIBS) $(LNKLIBS) $^
 
 $(EXEC).opt: $(LIBS:.cma=.cmxa) $(OPTOBJS)
-       $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(OPTSEXPLIB) $(OPTLIBFLAGS) $(FLAGSLIB) $(OPTLNKLIBS) $^
+       $(OCAMLOPT_CMD) $(STATIC) $(FLAGSLIBS) -o $@ $(SYSLIBS:.cma=.cmxa) $(OPTLNKLIBS) $^
 
 $(EXEC).top: $(LIBS) $(OBJS) $(LNKLIBS)
-       $(OCAMLMKTOP) -custom -o $@ $(SYSLIBS) $(SEXPLIB) $(LNKLIBS) $^
+       $(OCAMLMKTOP_CMD) -custom -o $@ $(SYSLIBS) $(FLAGSLIBS) $(LNKLIBS) $^
 
-clean::
+clean distclean::
        rm -f $(TARGET) $(TARGET).opt $(TARGET).top
 
 .PHONY:: tools configure
@@ -253,8 +247,8 @@ configure:
        ./configure
 
 Makefile.config:
-       @echo "Makefile.config is missing. Have you run ./configure?"
-       @exit 1
+       @echo "Makefile.config is missing. Run ./configure to generate it."
+       @false
 
 tools: $(LIBS) $(LNKLIBS)
        $(MAKE) -C tools
@@ -264,14 +258,22 @@ distclean::
 
 static:
        rm -f spatch.opt spatch
-       $(MAKE) STATIC="$(STATICCFLAGS)" spatch.opt
+       $(MAKE) STATIC="$(STATICCFLAGS)" opt-only
        cp spatch.opt spatch
 
 purebytecode:
        rm -f spatch.opt spatch
-       $(MAKE) BYTECODE_STATIC="" spatch
-       perl -p -i -e 's/^#!.*/#!\/usr\/bin\/ocamlrun/' spatch
+       $(MAKE) BYTECODE_STATIC="" byte-only
+       # disabled the following command because it does not match
+       # perl -p -i -e 's/^#!.*/#!\/usr\/bin\/ocamlrun/' spatch
+
+##############################################################################
+# Build version information
+##############################################################################
 
+version.ml:
+       @echo "version.ml is missing. Run ./configure to generate it."
+       @false
 
 ##############################################################################
 # Build documentation
@@ -279,17 +281,18 @@ purebytecode:
 .PHONY:: docs
 
 docs:
-       $(MAKE) -C docs
-       if [ -x "$(TARGET)" -o -x "$(TARGET).opt" ]; \
-               then $(MAKE) -C ocaml doc; fi
-
-clean::
+       @$(MAKE) -C docs || (echo "warning: ignored the failed construction of the manual" 1>&2)
+       @if test "x$(FEATURE_OCAML)" = x1; then \
+               if test -f ./parsing_c/ast_c.cmo; then \
+                       $(MAKE) -C ocaml doc; \
+               else echo "note: to obtain coccilib documenation, it is required to build 'spatch' first so that ./parsing_c/ast_c.cmo gets build."; \
+               fi fi
+       @echo "finished building manuals"
+
+clean:: Makefile.config
        $(MAKE) -C docs clean
        $(MAKE) -C ocaml cleandoc
 
-distclean::
-       $(MAKE) -C docs distclean
-
 ##############################################################################
 # Pre-Install (customization of spatch frontend script)
 ##############################################################################
@@ -300,34 +303,21 @@ docs/spatch.1: Makefile.config
        $(MAKE) -C docs spatch.1
 
 # user will use spatch to run spatch.opt (native)
-scripts/spatch: Makefile.config
-       cp scripts/spatch.sh scripts/spatch.tmp2
-       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.tmp2 > scripts/spatch.tmp
-       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.tmp > scripts/spatch
-       rm -f scripts/spatch.tmp2 scripts/spatch.tmp
+scripts/spatch: Makefile.config scripts/spatch.sh
+       cp scripts/spatch.sh scripts/spatch
+       chmod +x scripts/spatch
 
 # user will use spatch to run spatch (bytecode)
-scripts/spatch.byte: Makefile.config
-       cp scripts/spatch.sh scripts/spatch.byte.tmp3
-       sed "s|\.opt||" scripts/spatch.byte.tmp3 > scripts/spatch.byte.tmp2
-       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.byte.tmp2 \
-               > scripts/spatch.byte.tmp
-       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.byte.tmp \
-               > scripts/spatch.byte
-       rm -f   scripts/spatch.byte.tmp3 \
-               scripts/spatch.byte.tmp2 \
-               scripts/spatch.byte.tmp
+scripts/spatch.byte: Makefile.config scripts/spatch.sh
+       cp scripts/spatch.sh scripts/spatch.byte
+       chmod +x scripts/spatch.byte
 
 # user will use spatch.opt to run spatch.opt (native)
-scripts/spatch.opt: Makefile.config
-       cp scripts/spatch.sh scripts/spatch.opt.tmp2
-       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.opt.tmp2 \
-               > scripts/spatch.opt.tmp
-       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.opt.tmp \
-               > scripts/spatch.opt
-       rm -f scripts/spatch.opt.tmp scripts/spatch.opt.tmp2
-
-clean::
+scripts/spatch.opt: Makefile.config scripts/spatch.sh
+       cp scripts/spatch.sh scripts/spatch.opt
+       chmod +x scripts/spatch.opt
+
+distclean::
        rm -f scripts/spatch scripts/spatch.byte scripts/spatch.opt
 
 ##############################################################################
@@ -337,40 +327,43 @@ clean::
 # don't remove DESTDIR, it can be set by package build system like ebuild
 # for staged installation.
 install-common:
-       mkdir -p $(DESTDIR)$(BINDIR)
-       mkdir -p $(DESTDIR)$(LIBDIR)
-       mkdir -p $(DESTDIR)$(SHAREDIR)/ocaml
-       mkdir -p $(DESTDIR)$(SHAREDIR)/commons
-       mkdir -p $(DESTDIR)$(SHAREDIR)/globals
-       mkdir -p $(DESTDIR)$(SHAREDIR)/parsing_c
+       $(MKDIR_P) $(DESTDIR)$(BINDIR)
+       $(MKDIR_P) $(DESTDIR)$(LIBDIR)
+       $(MKDIR_P) $(DESTDIR)$(SHAREDIR)/ocaml
+       $(MKDIR_P) $(DESTDIR)$(SHAREDIR)/commons
+       $(MKDIR_P) $(DESTDIR)$(SHAREDIR)/globals
+       $(MKDIR_P) $(DESTDIR)$(SHAREDIR)/parsing_c
        $(INSTALL_DATA) standard.h $(DESTDIR)$(SHAREDIR)
        $(INSTALL_DATA) standard.iso $(DESTDIR)$(SHAREDIR)
        $(INSTALL_DATA) ocaml/coccilib.cmi $(DESTDIR)$(SHAREDIR)/ocaml/
        $(INSTALL_DATA) parsing_c/*.cmi $(DESTDIR)$(SHAREDIR)/parsing_c/
        $(INSTALL_DATA) commons/*.cmi $(DESTDIR)$(SHAREDIR)/commons/
        $(INSTALL_DATA) globals/iteration.cmi $(DESTDIR)$(SHAREDIR)/globals/
-       @if [ $(FEATURE_PYTHON) -eq 1 ]; then $(MAKE) install-python; fi
 
 install-man:
-       mkdir -p $(DESTDIR)$(MANDIR)/man1
-       mkdir -p $(DESTDIR)$(MANDIR)/man3
+       @echo "Installing manuals in: ${DESTDIR}${MANDIR}"
+       $(MKDIR_P) $(DESTDIR)$(MANDIR)/man1
+       $(MKDIR_P) $(DESTDIR)$(MANDIR)/man3
        $(INSTALL_DATA) docs/spatch.1 $(DESTDIR)$(MANDIR)/man1/
        $(INSTALL_DATA) docs/Coccilib.3cocci $(DESTDIR)$(MANDIR)/man3/
 
 install-bash:
-       mkdir -p $(DESTDIR)$(BASH_COMPLETION_DIR)
+       @echo "Installing bash completion in: ${DESTDIR}${BASH_COMPLETION_DIR}"
+       $(MKDIR_P) $(DESTDIR)$(BASH_COMPLETION_DIR)
        $(INSTALL_DATA) scripts/spatch.bash_completion \
                $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
 
 install-tools:
-       mkdir -p $(DESTDIR)$(BINDIR)
+       @echo "Installing tools in: ${DESTDIR}${BINDIR}"
+       $(MKDIR_P) $(DESTDIR)$(BINDIR)
        $(INSTALL_PROGRAM) tools/splitpatch \
                $(DESTDIR)$(BINDIR)/splitpatch
        $(INSTALL_PROGRAM) tools/cocci-send-email.perl \
                $(DESTDIR)$(BINDIR)/cocci-send-email.perl
 
 install-python:
-       mkdir -p $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
+       @echo "Installing python support in: ${DESTDIR}${SHAREDIR}/python"
+       $(MKDIR_P) $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
        $(INSTALL_DATA) python/coccilib/*.py \
                $(DESTDIR)$(SHAREDIR)/python/coccilib
        $(INSTALL_DATA) python/coccilib/coccigui/*.py \
@@ -379,33 +372,34 @@ install-python:
                $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
        $(INSTALL_DATA) python/coccilib/coccigui/pygui.gladep \
                $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
-       if [ -f pycaml/dllpycaml_stubs.so ]; then \
-               $(INSTALL_LIB) pycaml/dllpycaml_stubs.so $(DESTDIR)$(LIBDIR) ; fi
-
-install: install-man install-common
-       @if test -x spatch -a ! -x spatch.opt ; then \
-               $(MAKE) install-byte;fi
-       @if test ! -x spatch -a -x spatch.opt ; then \
-               $(MAKE) install-def; $(MAKE) install-opt;fi
-       @if test -x spatch -a -x spatch.opt ; then \
-               $(MAKE) install-byte; $(MAKE) install-opt;fi
+
+install: install-man install-common $(PYTHON_TARGET)
+       @if test -x spatch -o -x spatch.opt; then \
+               $(MAKE) install-def;fi
+       @if test -x spatch ; then \
+               $(MAKE) install-byte; fi
+       @if test -x spatch.opt ; then \
+               $(MAKE) install-opt;fi
        @if test ! -x spatch -a ! -x spatch.opt ; then \
-               echo "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
+               echo -e "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
        @echo ""
-       @echo "\tYou can also install spatch by copying the program spatch"
-       @echo "\t(available in this directory) anywhere you want and"
-       @echo "\tgive it the right options to find its configuration files."
+       @echo -e "\tYou can also install spatch by copying the program spatch"
+       @echo -e "\t(available in this directory) anywhere you want and"
+       @echo -e "\tgive it the right options to find its configuration files."
        @echo ""
 
-# user will use spatch to run spatch.opt (native)
+#
+# Installation of spatch and spatch.opt and their wrappers
+#
+
+# user will use spatch to run one of the binaries
 install-def:
-       $(INSTALL_PROGRAM) spatch.opt $(DESTDIR)$(SHAREDIR)
        $(INSTALL_PROGRAM) scripts/spatch $(DESTDIR)$(BINDIR)/spatch
 
-# user will use spatch to run spatch (bytecode)
+# user will use spatch.byte to run spatch (bytecode)
 install-byte:
        $(INSTALL_PROGRAM) spatch $(DESTDIR)$(SHAREDIR)
-       $(INSTALL_PROGRAM) scripts/spatch.byte $(DESTDIR)$(BINDIR)/spatch
+       $(INSTALL_PROGRAM) scripts/spatch.byte $(DESTDIR)$(BINDIR)/spatch.byte
 
 # user will use spatch.opt to run spatch.opt (native)
 install-opt:
@@ -415,6 +409,7 @@ install-opt:
 uninstall:
        rm -f $(DESTDIR)$(BINDIR)/spatch
        rm -f $(DESTDIR)$(BINDIR)/spatch.opt
+       rm -f $(DESTDIR)$(BINDIR)/spatch.byte
        rm -f $(DESTDIR)$(LIBDIR)/dllpycaml_stubs.so
        rm -f $(DESTDIR)$(SHAREDIR)/spatch
        rm -f $(DESTDIR)$(SHAREDIR)/spatch.opt
@@ -469,6 +464,10 @@ test: $(TARGET)
 testparsing:
        ./$(TARGET) -D standard.h -parse_c -dir tests/
 
+check:
+       ./$(TARGET) --testall --no-update-score-file \
+               --iso-file ./standard.iso \
+               --macro-file-builtins ./standard.h
 
 
 # -inline 0  to see all the functions in the profile.
@@ -477,14 +476,14 @@ testparsing:
 forprofiling:
        $(MAKE) OPTFLAGS="-p -inline 0 " opt
 
-clean::
+clean distclean::
        rm -f gmon.out
 
 tags:
        otags -no-mli-tags -r  .
 
 dependencygraph:
-       find . -name "*.ml" |grep -v "scripts" | xargs ocamldep -I commons -I globals -I ctl -I parsing_cocci -I parsing_c -I engine -I popl09 -I extra > /tmp/dependfull.depend
+       find . -name "*.ml" |grep -v "scripts" | xargs $(OCAMLDEP) -I commons -I globals -I ctl -I parsing_cocci -I parsing_c -I engine -I popl09 -I extra > /tmp/dependfull.depend
        ocamldot -lr /tmp/dependfull.depend > /tmp/dependfull.dot
        dot -Tps /tmp/dependfull.dot > /tmp/dependfull.ps
        ps2pdf /tmp/dependfull.ps /tmp/dependfull.pdf
@@ -499,18 +498,6 @@ test.ml:
        echo "let foo_ctl () = failwith \"there is no foo_ctl formula\"" \
          > test.ml
 
-beforedepend:: test.ml
-
-
-#INC=$(dir $(shell which ocaml))
-#INCX=$(INC:/=)
-#INCY=$(dir $(INCX))
-#INCZ=$(INCY:/=)/lib/ocaml
-#
-#prim.o: prim.c
-#      gcc -c -o prim.o -I $(INCZ) prim.c
-
-
 ##############################################################################
 # Generic ocaml rules
 ##############################################################################
@@ -518,39 +505,68 @@ beforedepend:: test.ml
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC)    -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC)    -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
-$(LEXER_SOURCES:.mll=.ml) :    $(LEXER_SOURCES)
-       $(OCAMLLEX) $(LEXER_SOURCES)
-
-clean::
+clean distclean::
+       rm -f .depend
        rm -f *.cm[iox] *.o *.annot
        rm -f *~ .*~ *.exe #*#
 
-distclean:: clean
-       set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
-       rm -f .depend
-       rm -f Makefile.config
-       rm -f globals/config.ml test.ml
+distclean::
+       set -e; for i in $(CLEANSUBDIRS); do $(MAKE) -C $$i -j1 $@; done
+       rm -f test.ml
        rm -f TAGS
        rm -f tests/SCORE_actual.sexp
        rm -f tests/SCORE_best_of_both.sexp
        find . -name ".#*1.*" | xargs rm -f
+       rm -f $(EXEC) $(EXEC).opt $(EXEC).top
 
-beforedepend::
+.PHONY:: depend
+.depend: Makefile.config test.ml version
+       touch .depend  # prevents infinite recursion with 'make depend'
+       $(MAKE) depend
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml > .depend
-       set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
+depend: Makefile.config test.ml version
+       @echo constructing '.depend'
+       rm -f .depend
+       set -e; for i in $(MAKESUBDIRS); do $(MAKE) -j1 -C $$i depend; done
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
-.depend::
-       @if [ ! -f .depend ] ; then $(MAKE) depend ; fi
+##############################################################################
+# configure-related
+##############################################################################
 
+distclean::
+       @echo "cleaning configured files"
+       if test -z "${KEEP_CONFIG}"; then rm -f Makefile.config; fi
+       rm -rf autom4te.cache
+       rm -f config.status
+       rm -f config.log
+       rm -f version.ml
+       rm -f globals/config.ml
+       rm -f globals/regexp.ml python/pycocci.ml ocaml/prepare_ocamlcocci.ml
+       rm -f scripts/spatch.sh
+       @echo "run 'configure' again prior to building coccinelle"
+
+
+# prevent building or using dependencies when cleaning
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+ifneq ($(MAKECMDGOALS),configure)
+ifneq ($(MAKECMDGOALS),prerelease)
+ifneq ($(MAKECMDGOALS),release)
+ifneq ($(MAKECMDGOALS),package)
 -include .depend
+endif
+endif
+endif
+endif
+endif
+endif
diff --git a/Makefile.config.in b/Makefile.config.in
new file mode 100644 (file)
index 0000000..08ea24a
--- /dev/null
@@ -0,0 +1,107 @@
+# autogenerated by configure
+
+# * for each library $1, add another entry in the same manner
+MAKELIBS=@MAKE_dynlink@ @MAKE_extlib@ @MAKE_sexplib@ @MAKE_menhirLib@ @MAKE_pycaml@ @MAKE_pcre@
+LNKLIBS=@MODULES_dynlink@ @MODULES_extlib@ @MODULES_sexplib@ @MODULES_menhirLib@ @MODULES_pycaml@ @MODULES_pcre@
+OPTLNKLIBS=@MODULESOPT_dynlink@ @MODULESOPT_extlib@ @MODULESOPT_sexplib@ @MODULESOPT_menhirLib@ @MODULESOPT_pycaml@ @MODULESOPT_pcre@
+INCLIBS=@PATH_dynlink@ @PATH_extlib@ @PATH_sexplib@ @PATH_menhirLib@ @PATH_pycaml@ @PATH_pcre@
+FLAGSLIBS=@FLAGS_dynlink@ @FLAGS_extlib@ @FLAGS_sexplib@ @FLAGS_menhirLib@ @FLAGS_pycaml@ @FLAGS_pcre@
+# * end of library variables
+
+# system packages inc libs
+SYSINCLIBS=@PATH_unix@ @PATH_bigarray@ @PATH_num@ @PATH_str@ @PATH_threads@ @PATH_dynlink@
+
+# camlp4 library location
+PATH_camlp4=@PATH_camlp4@
+
+SHELL?=@SHELL@
+PKG_CONFIG=@PKG_CONFIG@
+INSTALL=@INSTALL@
+TAR=@TAR@
+PATCH=@PATCH@
+PDFLATEX=@PDFLATEX@
+
+# paths
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+datarootdir=@datarootdir@
+includedir=@includedir@
+libdir=@libdir@
+sysconfdir=@sysconfdir@
+mandir=@mandir@
+
+# C compiler
+CC=@CC@
+CFLAGS=@CFLAGS@
+CPP=@CPP@
+CPPFLAGS=@CPPFLAGS@
+
+# portable MKDIR_P
+MKDIR_P=@MKDIR_P@
+
+# the default Make target
+TARGET_ALL=@MAKETARGET_ALL@
+
+PYTHON_CFLAGS=@PYTHON_CFLAGS@
+PYTHON_LIBS=@PYTHON_LIBS@
+
+PCRE_CFLAGS=@PCRE_CFLAGS@
+PCRE_LIBS=@PCRE_LIBS@
+
+OCAMLFIND=@OCAMLFIND@
+OCAMLBUILD=@OCAMLBUILD@
+OCAMLC=@OCAMLC@
+OCAMLDEP=@OCAMLDEP@
+OCAMLDOC=@OCAMLDOC@
+OCAMLLEX=@OCAMLLEX@
+OCAMLYACC=@OCAMLYACC@
+OCAMLLIB=@OCAMLLIB@
+OCAMLMKLIB=@OCAMLMKLIB@
+OCAMLMKTOP=@OCAMLMKTOP@
+OCAMLOPT=@OCAMLOPT@
+CAMLP4=@CAMLP4@
+CAMLP4O=@CAMLP4O@
+MENHIR=@MENHIR@
+OCAMLVERSION=@OCAMLVERSION@
+
+INSTALL_PROGRAM=$(INSTALL) -m 755
+INSTALL_LIB=$(INSTALL) -m 755
+INSTALL_DATA=$(INSTALL) -m 644
+
+# Where to install the binary
+BINDIR=${bindir}
+
+# Where to install the man pages
+MANDIR=${mandir}
+
+# Where to install the lib
+LIBDIR=${libdir}
+
+# Where to install the configuration files
+SHAREDIR=@SHAREDIR@
+
+BASH_COMPLETION_DIR=${sysconfdir}/bash_completion.d
+
+# selected libraries
+FEATURE_sexplib=@FEATURE_sexplib@
+FEATURE_menhirLib=@FEATURE_menhirLib@
+FEATURE_pycaml=@FEATURE_pycaml@
+FEATURE_pcre=@FEATURE_pcre@
+LOCALLIB_sexplib=@LOCALLIB_sexplib@
+LOCALLIB_pycaml=@LOCALLIB_pycaml@
+
+# Features
+FEATURE_PYTHON=@FEATURE_PYTHON@
+FEATURE_OCAML=@FEATURE_OCAML@
+
+# Include paths
+PCREDIR=@PATH_pcre@
+PYCAMLDIR=@PATH_pycaml@
+MENHIRDIR=@PATH_menhirLib@
+SEXPDIR=@PATH_sexplib@
+
+# selected ocaml modules
+PYCOCCI_FILE=@PYCOCCI_FILE@
+OCAMLCOCCI_FILE=@OCAMLCOCCI_FILE@
+REGEXP_FILE=@REGEXP_FILE@
index 2e571a5..5c6599e 100644 (file)
@@ -57,7 +57,7 @@ gitupdate:
 #      git cvsimport -d :ext:topps:/var/cvs/cocci  coccinelle
 
 #UBUNTU=karmic lucid maverick natty
-UBUNTU=lucid maverick natty
+UBUNTU=lucid maverick natty oneiric
 UBUNTURELEASE=$(UBUNTU:%=ubuntu-%)
 
 .PHONY:: ubuntu $(UBUNTURELEASE)
@@ -84,6 +84,9 @@ ubuntu-natty:
        debchange -c debian/changelog.natty -D natty -v $(VERSION)~1104npalix$(IDX) "New release $(VERSION)"
 
 ubuntu-oneiric:
+       debchange -c debian/changelog.oneiric -D oneiric -v $(VERSION)~1110npalix$(IDX) "New release $(VERSION)"
+
+ubuntu-p:
        if [ ! -f debian/changelog.$(@:ubuntu-%=%) ] ; then \
                debchange --create -c debian/changelog.$(@:ubuntu-%=%) -D UNRELEASED \
                        -v $(VERSION)~npalix$(IDX) "New release $(VERSION)" --package $(PRJNAME) ; \
index 7716476..ba8dd70 100644 (file)
@@ -19,7 +19,7 @@ LOCAL_pycaml     = pycaml.cma
 LOCALOPT_pycaml  = pycaml.cmxa
 GLOBAL_pycaml    = pycaml.cma
 GLOBALOPT_pycaml = pycaml.cmxa
-FLAGS_pycaml     = 
+FLAGS_pycaml     = -cclib -lpycaml_stubs -cclib "${PYTHON_LIBS}"
 
 # sexplib library
 LOCAL_sexplib     = sexplib.cmo
@@ -33,7 +33,7 @@ LOCAL_pcre     = pcre.cmo
 LOCALOPT_pcre  = pcre.cmx
 GLOBAL_pcre    = pcre.cma
 GLOBALOPT_pcre = pcre.cmxa
-FLAGS_pcre     = -cclib -lpcre
+FLAGS_pcre     = -cclib -lpcre_stubs -cclib "${PCRE_LIBS}"
 
 # dynlink library
 LOCAL_dynlink     =
@@ -42,8 +42,15 @@ GLOBAL_dynlink    = dynlink.cma
 GLOBALOPT_dynlink = dynlink.cmxa
 
 # extlib library
-LOCAL_extlib     =
-LOCALOPT_extlib  =
+LOCAL_extlib     = extLib.cma
+LOCALOPT_extlib  = extLib.cmxa
 GLOBAL_extlib    = extLib.cma
 GLOBALOPT_extlib = extLib.cmxa
 FLAGS_extlib     =
+
+# type conv library
+LOCAL_type_conv     = pa_type_conv.cma
+LOCALOPT_type_conv  = pa_type_conv.cmxa
+GLOBAL_type_conv    = pa_type_conv.cma
+GLOBALOPT_type_conv = pa_type_conv.cma
+FLAGS_type_conv     =
index 1ccbc03..8a612ea 100644 (file)
@@ -23,8 +23,21 @@ EXCL=$(EXCLUDE:%=--exclude=%)
 BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
 BINSRC2-PY=$(BINSRC-PY:%=$(PACKAGE)/%)
 
+ifndef TMP
 TMP=/tmp
+endif
+
+# should be defined by Makefile.config
+ifndef OCAMLVERSION
 OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
+endif
+
+# can be overriden in the environment
+ifndef GIT
+GIT=git
+endif
+
+
 
 # Procedure to do first time:
 #  cd ~/release
@@ -42,51 +55,42 @@ OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
 #
 #  The project is then automatically licensified.
 #
-#  Remember to comment the -g -dtypes in this Makefile
-#  You can also remove a few things, for instance I removed in this
-#   Makefile things related to popl/ and popl09/
-#  make sure that ocaml is the distribution ocaml of /usr/bin, not ~pad/...
-#
 #  3) make package
 #
 #  if WEBSITE is set properly, you can also run 'make website'
 # Check that run an ocaml in /usr/bin
 
-# To test you can try compile and run spatch from different instances
-# like my ~/coccinelle, ~/release/coccinelle, and the /tmp/coccinelle-0.X
-# downloaded from the website.
-
-# For 'make srctar' it must done from a clean
-# repo such as ~/release/coccinelle. It must also be a repo where
-# the scripts/licensify has been run at least once.
-# For the 'make bintar' I can do it from my original repo.
-
 # The 'git rebase' is in there just in case you started with
 # unpushed changes. However, that is probably something you should
 # not do in the first place.
 
-prerelease:
-       git pull --rebase
+prerelease: Makefile.config
+       @echo "pulling changes from the repository"
+       $(GIT) pull --rebase
        $(MAKE) fix-expected
-       $(MAKE) distclean
-       sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" Makefile
+       $(MAKE) distclean KEEP_CONFIG=1
        @echo "\n\tEdit ./version"
        @echo "\tCommit with 'make release'\n"
+       @echo "\tYou can skip the actual commit using 'GIT=echo make release'"
 
 fix-expected:
+       @echo "going to generate: tests/SCORE_expected_orig.sexp"
        $(MAKE) distclean
-       ./configure --without-python
-       $(MAKE) world
-       yes | ./spatch.opt -testall
+       ./configure --disable-python
+       $(MAKE) opt-only
+       yes | ./spatch.opt -testall --iso-file ./standard.iso --macro-file-builtins ./standard.h
        cp tests/SCORE_actual.sexp tests/SCORE_expected_orig.sexp
+       @echo "generated: test/SCORE_expected_orig.sexp"
 
 release:
-       sed -i -e 's|^let version = ".*"$$|let version = "$(VERSION)"|g' globals/config.ml.in
-       git add ./ version globals/config.ml.in
-       git commit -m "Release $(VERSION)"
-       git tag -a -m "Release $(VERSION)" $(VERSION)
-       git push --mirror
+       @echo "Marking version: $(VERSION)"
+       echo -n "$(VERSION)" > ./version
+       $(GIT) add ./version
+       $(GIT) commit -m "Release $(VERSION)"
+       $(GIT) tag -a -m "Release $(VERSION)" $(VERSION)
+       $(GIT) push --mirror
        $(MAKE) licensify
+       @echo "\n\tLicensify has run: do not commit any files from now on!"
        @echo "\n\tRun 'make package'\n"
 
 package:
@@ -97,20 +101,20 @@ package:
        @echo "\tThe coccinelle SVN repository must be in $(WEBBASE)\n"
 
 package-src:
-       $(MAKE) distclean       # Clean project
+       $(MAKE) distclean KEEP_CONFIG=1  # Clean project (keep the config for the make actions)
        $(MAKE) srctar
        $(MAKE) coccicheck
 
 package-nopython:
-       $(MAKE) distclean       # Clean project
-       ./configure --without-python
+       $(MAKE) distclean             # Clean project
+       ./configure --disable-python  # Reconfigure project without Python support
        $(MAKE) bintar
        $(MAKE) bytecodetar
 #      $(MAKE) staticbintar
 
 package-python:
-       $(MAKE) distclean       # Clean project
-       ./configure             # Reconfigure project with Python support
+       $(MAKE) distclean            # Clean project
+       ./configure --enable-python  # Reconfigure project with Python support
        $(MAKE) bintar-python
        $(MAKE) bytecodetar-python
 
@@ -122,22 +126,27 @@ package-python:
 # update: make docs generates pdf but also some ugly .log files, so
 # make clean is there to remove them while not removing the pdf
 # (only distclean remove the pdfs).
-srctar:
+#
+# Prerequisite: a distclean with preservation of Makefile.config
+srctar: Makefile.config
        $(MAKE) docs
        $(MAKE) clean
-       cp -a .  $(TMP)/$(PACKAGE)
+       if test -f "$(TMP)/$(PACKAGE)/"; then rm -f "$(TMP)/$(PACKAGE)/"; fi # remove it if it is a symlink
+       $(MKDIR_P) "$(TMP)/$(PACKAGE)/"
+       cp -rfa ./*  "$(TMP)/$(PACKAGE)/"
        cd $(TMP)/$(PACKAGE); cd parsing_cocci/; $(MAKE) parser_cocci_menhir.ml
+       rm -f $(TMP)/$(PACKAGE)/Makefile.config
        cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(EXCL) $(PACKAGE)
        rm -rf  $(TMP)/$(PACKAGE)
 
-bintar: all
+bintar: all-dev
        $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        cd $(TMP); tar cvfz $(PACKAGE)-bin-x86.tgz --exclude-vcs $(BINSRC2)
        rm -f $(TMP)/$(PACKAGE)
 
-staticbintar: all.opt
+staticbintar: all-release
        $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
@@ -146,7 +155,7 @@ staticbintar: all.opt
        rm -f $(TMP)/$(PACKAGE)
 
 # add ocaml version in name ?
-bytecodetar: all
+bytecodetar: all-dev
        $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
@@ -162,7 +171,7 @@ bintar-python: all
        rm -f $(TMP)/$(PACKAGE)
 
 # add ocaml version in name ?
-bytecodetar-python: all
+bytecodetar-python: all-dev
        $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
@@ -171,7 +180,7 @@ bytecodetar-python: all
        rm -f $(TMP)/$(PACKAGE)
 
 coccicheck:
-       cp -a `pwd`/scripts/coccicheck $(TMP)/$(CCPACKAGE)
+       cp -a ./scripts/coccicheck $(TMP)/$(CCPACKAGE)
        tar cvfz $(TMP)/$(CCPACKAGE).tgz -C $(TMP) --exclude-vcs $(CCPACKAGE)
        rm -rf $(TMP)/$(CCPACKAGE)
 
@@ -232,6 +241,7 @@ packsrc: prepack
        $(MAKE) -C $(TMP)/$(PACKAGE)/debian karmic
        $(MAKE) -C $(TMP)/$(PACKAGE)/debian maverick
        $(MAKE) -C $(TMP)/$(PACKAGE)/debian natty
+       $(MAKE) -C $(TMP)/$(PACKAGE)/debian oneiric
        $(MAKE) push
        rm -rf  $(TMP)/$(PACKAGE)/
 
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..39122d3
--- /dev/null
@@ -0,0 +1,172 @@
+# generated automatically by aclocal 1.11.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+               
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+               [AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+       ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+               [$4])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+m4_include([setup/cocci.m4])
+m4_include([setup/ocaml.m4])
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..c895932
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+# build the 'configure' script
+echo "running aclocal (requires 'pkg-config' macros)"
+aclocal -I setup
+
+echo "running autoconf"
+autoconf
diff --git a/bundles/extlib/Makefile b/bundles/extlib/Makefile
new file mode 100644 (file)
index 0000000..bb8e45c
--- /dev/null
@@ -0,0 +1,61 @@
+# This Makefile serves as a wrapper to bundle the
+# extlib package without modifications.
+
+# the extlib package is a conventional package that
+# requires a plain compilation of its .ml files and
+# then packed into an archive file.
+
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
+VERSION=1.5.2
+EXTLIB=extlib-$(VERSION)
+EXTMARKER=$(EXTLIB)/.marker
+
+all: depend extLib.cma META
+all.opt: depend extLib.cmxa META
+
+clean:
+       rm -f .depend META extLib.cm[ioxa] extLib.[ao] \
+               $(EXTLIB)/*.cm[ioxa] extLib.cmxa \
+               .mli-marker
+
+distclean: clean
+       rm -rf $(EXTLIB)
+
+depend: $(EXTMARKER)
+
+$(EXTMARKER): $(EXTLIB).tar.gz
+       $(TAR) xfvz $<
+       touch $@
+
+$(EXTLIB).tar.gz:
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
+
+.PHONEY: all all.opt clean distclean depend
+
+# SOURCES
+MODULES = \
+ enum bitSet dynArray extArray extHashtbl extList extString global IO option \
+ pMap std uChar uTF8 base64 unzip refList optParse dllist
+
+MLI=$(MODULES:%=$(EXTLIB)/%.mli)
+SRC=$(MODULES:%=$(EXTLIB)/%.ml) $(EXTLIB)/extLib.ml
+
+# note: the interface files must be build at must once when compiling both 'all' and 'all.opt'
+# otherwise errors such as 'module X makes inconsistent assumptions about interface Y' may
+# arise. The dependencies on this marker establishes this sharing.
+.mli-marker: $(MLI) $(SRC)
+       $(OCAMLC) -c -thread -I $(EXTLIB) $(MLI)
+       touch .mli-marker
+
+extLib.cma: .mli-marker $(SRC)
+       $(OCAMLC) -a -custom -thread -I $(EXTLIB) -o extLib.cma $(MLI) $(SRC)
+
+extLib.cmxa: .mli-marker $(SRC)
+       $(OCAMLOPT) -a -linkall -thread -I $(EXTLIB) -o extLib.cmxa $(SRC)
+
+META: $(EXTLIB)/META
+       cp $< $@
diff --git a/bundles/extlib/extlib-1.5.2.tar.gz b/bundles/extlib/extlib-1.5.2.tar.gz
new file mode 100644 (file)
index 0000000..df8efa7
Binary files /dev/null and b/bundles/extlib/extlib-1.5.2.tar.gz differ
diff --git a/bundles/extlib/extlib-1.5.2/.marker b/bundles/extlib/extlib-1.5.2/.marker
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/bundles/extlib/extlib-1.5.2/IO.ml b/bundles/extlib/extlib-1.5.2/IO.ml
new file mode 100644 (file)
index 0000000..533a0ca
--- /dev/null
@@ -0,0 +1,769 @@
+(*
+ * IO - Abstract input/output
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type input = {
+       mutable in_read : unit -> char;
+       mutable in_input : string -> int -> int -> int;
+       mutable in_close : unit -> unit;
+}
+
+type 'a output = {
+       mutable out_write : char -> unit;
+       mutable out_output : string -> int -> int -> int;
+       mutable out_close : unit -> 'a;
+       mutable out_flush : unit -> unit;
+}
+
+exception No_more_input
+exception Input_closed
+exception Output_closed
+
+(* -------------------------------------------------------------- *)
+(* API *)
+
+let default_close = (fun () -> ())
+
+let create_in ~read ~input ~close =
+       {
+               in_read = read;
+               in_input = input;
+               in_close = close;
+       }
+
+let create_out ~write ~output ~flush ~close =
+       {
+               out_write = write;
+               out_output = output;
+               out_close = close;
+               out_flush = flush;
+       }
+
+let read i = i.in_read()
+
+let nread i n =
+       if n < 0 then invalid_arg "IO.nread";
+       if n = 0 then
+               ""
+       else
+       let s = String.create n in
+       let l = ref n in
+       let p = ref 0 in
+       try
+               while !l > 0 do
+                       let r = i.in_input s !p !l in
+                       if r = 0 then raise No_more_input;
+                       p := !p + r;
+                       l := !l - r;
+               done;
+               s
+       with
+               No_more_input as e ->
+                       if !p = 0 then raise e;
+                       String.sub s 0 !p
+
+let really_output o s p l' =
+       let sl = String.length s in
+       if p + l' > sl || p < 0 || l' < 0 then invalid_arg "IO.really_output";
+       let l = ref l' in
+       let p = ref p in
+       while !l > 0 do 
+               let w = o.out_output s !p !l in
+               if w = 0 then raise Sys_blocked_io;
+               p := !p + w;
+               l := !l - w;
+       done;
+       l'
+
+let input i s p l =
+       let sl = String.length s in
+       if p + l > sl || p < 0 || l < 0 then invalid_arg "IO.input";
+       if l = 0 then
+               0
+       else
+               i.in_input s p l
+
+let really_input i s p l' =
+       let sl = String.length s in
+       if p + l' > sl || p < 0 || l' < 0 then invalid_arg "IO.really_input";
+       let l = ref l' in
+       let p = ref p in
+       while !l > 0 do
+               let r = i.in_input s !p !l in
+               if r = 0 then raise Sys_blocked_io;
+               p := !p + r;
+               l := !l - r;
+       done;
+       l'
+
+let really_nread i n =
+       if n < 0 then invalid_arg "IO.really_nread";
+       if n = 0 then ""
+       else
+       let s = String.create n 
+       in
+       ignore(really_input i s 0 n);
+       s
+
+let close_in i =
+       let f _ = raise Input_closed in
+       i.in_close();
+       i.in_read <- f;
+       i.in_input <- f;
+       i.in_close <- f
+
+let write o x = o.out_write x
+
+let nwrite o s =
+       let p = ref 0 in
+       let l = ref (String.length s) in
+       while !l > 0 do
+               let w = o.out_output s !p !l in
+               if w = 0 then raise Sys_blocked_io;
+               p := !p + w;
+               l := !l - w;
+       done
+
+let output o s p l =
+       let sl = String.length s in
+       if p + l > sl || p < 0 || l < 0 then invalid_arg "IO.output";
+       o.out_output s p l
+
+let printf o fmt =
+       Printf.kprintf (fun s -> nwrite o s) fmt
+
+let flush o = o.out_flush()
+
+let close_out o =
+       let f _ = raise Output_closed in
+       let r = o.out_close() in
+       o.out_write <- f;
+       o.out_output <- f;
+       o.out_close <- f;
+       o.out_flush <- f;
+       r
+
+let read_all i =
+       let maxlen = 1024 in
+       let str = ref [] in
+       let pos = ref 0 in
+       let rec loop() =
+               let s = nread i maxlen in
+               str := (s,!pos) :: !str;
+               pos := !pos + String.length s;
+               loop()
+       in
+       try
+               loop()
+       with
+               No_more_input ->
+                       let buf = String.create !pos in
+                       List.iter (fun (s,p) ->
+                               String.unsafe_blit s 0 buf p (String.length s)
+                       ) !str;
+                       buf
+
+let pos_in i =
+       let p = ref 0 in
+       {
+               in_read = (fun () ->
+                       let c = i.in_read() in
+                       incr p;
+                       c
+               );
+               in_input = (fun s sp l ->
+                       let n = i.in_input s sp l in
+                       p := !p + n;
+                       n
+               );
+               in_close = i.in_close
+       } , (fun () -> !p)
+
+let pos_out o =
+       let p = ref 0 in
+       {
+               out_write = (fun c ->
+                       o.out_write c;
+                       incr p
+               );
+               out_output = (fun s sp l ->
+                       let n = o.out_output s sp l in
+                       p := !p + n;
+                       n
+               );
+               out_close = o.out_close;
+               out_flush = o.out_flush;
+       } , (fun () -> !p)
+
+(* -------------------------------------------------------------- *)
+(* Standard IO *)
+
+let input_string s =
+       let pos = ref 0 in
+       let len = String.length s in
+       {
+               in_read = (fun () ->
+                       if !pos >= len then raise No_more_input;
+                       let c = String.unsafe_get s !pos in
+                       incr pos;
+                       c
+               );
+               in_input = (fun sout p l ->
+                       if !pos >= len then raise No_more_input;
+                       let n = (if !pos + l > len then len - !pos else l) in
+                       String.unsafe_blit s !pos sout p n;
+                       pos := !pos + n;
+                       n
+               );
+               in_close = (fun () -> ());
+       }
+
+let output_string() =
+       let b = Buffer.create 0 in
+       {
+               out_write = (fun c ->
+                       Buffer.add_char b c
+               );
+               out_output = (fun s p l ->
+                       Buffer.add_substring b s p l;
+                       l
+               );
+               out_close = (fun () -> Buffer.contents b);
+               out_flush = (fun () -> ());
+       }
+
+let input_channel ch =
+       {
+               in_read = (fun () ->
+                       try
+                               input_char ch
+                       with
+                               End_of_file -> raise No_more_input
+               );
+               in_input = (fun s p l ->
+                       let n = Pervasives.input ch s p l in
+                       if n = 0 then raise No_more_input;
+                       n
+               );
+               in_close = (fun () -> Pervasives.close_in ch);
+       }
+
+let output_channel ch =
+       {
+               out_write = (fun c -> output_char ch c);
+               out_output = (fun s p l -> Pervasives.output ch s p l; l);
+               out_close = (fun () -> Pervasives.close_out ch);
+               out_flush = (fun () -> Pervasives.flush ch);
+       }
+
+let input_enum e =
+       let pos = ref 0 in
+       {
+               in_read = (fun () ->
+                       match Enum.get e with
+                       | None -> raise No_more_input
+                       | Some c ->
+                               incr pos;
+                               c
+               );
+               in_input = (fun s p l ->
+                       let rec loop p l =
+                               if l = 0 then
+                                       0
+                               else
+                                       match Enum.get e with
+                                       | None -> l
+                                       | Some c ->
+                                               String.unsafe_set s p c;
+                                               loop (p + 1) (l - 1)
+                       in
+                       let k = loop p l in
+                       if k = l then raise No_more_input;
+                       l - k
+               );
+               in_close = (fun () -> ());
+       }
+
+let output_enum() =
+       let b = Buffer.create 0 in
+       {
+               out_write = (fun x ->
+                       Buffer.add_char b x
+               );
+               out_output = (fun s p l ->
+                       Buffer.add_substring b s p l;
+                       l
+               );
+               out_close = (fun () ->
+                       let s = Buffer.contents b in
+                       ExtString.String.enum s
+               );
+               out_flush = (fun () -> ());
+       }
+
+let pipe() =
+       let input = ref "" in
+       let inpos = ref 0 in
+       let output = Buffer.create 0 in
+       let flush() =
+               input := Buffer.contents output;
+               inpos := 0;
+               Buffer.reset output;
+               if String.length !input = 0 then raise No_more_input
+       in
+       let read() =
+               if !inpos = String.length !input then flush();
+               let c = String.unsafe_get !input !inpos in
+               incr inpos;
+               c
+       in
+       let input s p l =
+               if !inpos = String.length !input then flush();
+               let r = (if !inpos + l > String.length !input then String.length !input - !inpos else l) in
+               String.unsafe_blit !input !inpos s p r;
+               inpos := !inpos + r;
+               r
+       in
+       let write c =
+               Buffer.add_char output c
+       in
+       let output s p l =
+               Buffer.add_substring output s p l;
+               l
+       in
+       let input = {
+               in_read = read;
+               in_input = input;
+               in_close = (fun () -> ());
+       } in
+       let output = {
+               out_write = write;
+               out_output = output;
+               out_close = (fun () -> ());
+               out_flush = (fun () -> ());
+       } in
+       input , output
+
+external cast_output : 'a output -> unit output = "%identity"
+
+(* -------------------------------------------------------------- *)
+(* BINARY APIs *)
+
+exception Overflow of string
+
+let read_byte i = int_of_char (i.in_read())
+
+let read_signed_byte i =
+       let c = int_of_char (i.in_read()) in
+       if c land 128 <> 0 then
+               c - 256
+       else
+               c
+
+let read_string i =
+       let b = Buffer.create 8 in
+       let rec loop() =
+               let c = i.in_read() in
+               if c <> '\000' then begin
+                       Buffer.add_char b c;
+                       loop();
+               end;
+       in
+       loop();
+       Buffer.contents b
+
+let read_line i =
+       let b = Buffer.create 8 in
+       let cr = ref false in
+       let rec loop() =
+               let c = i.in_read() in
+               match c with
+               | '\n' ->
+                       ()
+               | '\r' ->
+                       cr := true;
+                       loop()
+               | _ when !cr ->
+                       cr := false;
+                       Buffer.add_char b '\r';
+                       Buffer.add_char b c;
+                       loop();
+               | _ ->
+                       Buffer.add_char b c;
+                       loop();
+       in
+       try
+               loop();
+               Buffer.contents b
+       with
+               No_more_input ->
+                       if !cr then Buffer.add_char b '\r';
+                       if Buffer.length b > 0 then
+                               Buffer.contents b
+                       else
+                               raise No_more_input
+
+let read_ui16 i =
+       let ch1 = read_byte i in
+       let ch2 = read_byte i in
+       ch1 lor (ch2 lsl 8)
+
+let read_i16 i =
+       let ch1 = read_byte i in
+       let ch2 = read_byte i in
+       let n = ch1 lor (ch2 lsl 8) in
+       if ch2 land 128 <> 0 then
+               n - 65536
+       else
+               n
+
+let read_i32 ch =
+       let ch1 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch3 = read_byte ch in
+       let ch4 = read_byte ch in
+       if ch4 land 128 <> 0 then begin
+               if ch4 land 64 = 0 then raise (Overflow "read_i32");
+               ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor ((ch4 land 127) lsl 24)
+       end else begin
+               if ch4 land 64 <> 0 then raise (Overflow "read_i32");
+               ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor (ch4 lsl 24)
+       end
+
+let read_real_i32 ch =
+       let ch1 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch3 = read_byte ch in
+       let base = Int32.of_int (ch1 lor (ch2 lsl 8) lor (ch3 lsl 16)) in
+       let big = Int32.shift_left (Int32.of_int (read_byte ch)) 24 in
+       Int32.logor base big
+
+let read_i64 ch =
+       let ch1 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch3 = read_byte ch in
+       let ch4 = read_byte ch in
+       let base = Int64.of_int (ch1 lor (ch2 lsl 8) lor (ch3 lsl 16)) in
+       let small = Int64.logor base (Int64.shift_left (Int64.of_int ch4) 24) in
+       let big = Int64.of_int32 (read_real_i32 ch) in
+       Int64.logor (Int64.shift_left big 32) small
+
+let read_double ch =
+       Int64.float_of_bits (read_i64 ch)
+
+let write_byte o n =
+       (* doesn't test bounds of n in order to keep semantics of Pervasives.output_byte *)
+       write o (Char.unsafe_chr (n land 0xFF))
+
+let write_string o s =
+       nwrite o s;
+       write o '\000'
+
+let write_line o s =
+       nwrite o s;
+       write o '\n'
+
+let write_ui16 ch n =
+       if n < 0 || n > 0xFFFF then raise (Overflow "write_ui16");
+       write_byte ch n;
+       write_byte ch (n lsr 8)
+
+let write_i16 ch n =
+       if n < -0x8000 || n > 0x7FFF then raise (Overflow "write_i16");
+       if n < 0 then
+               write_ui16 ch (65536 + n)
+       else
+               write_ui16 ch n
+
+let write_i32 ch n =
+       write_byte ch n;
+       write_byte ch (n lsr 8);
+       write_byte ch (n lsr 16);
+       write_byte ch (n asr 24)
+
+let write_real_i32 ch n =
+       let base = Int32.to_int n in
+       let big = Int32.to_int (Int32.shift_right_logical n 24) in
+       write_byte ch base;
+       write_byte ch (base lsr 8);
+       write_byte ch (base lsr 16);
+       write_byte ch big
+
+let write_i64 ch n =
+       write_real_i32 ch (Int64.to_int32 n);
+       write_real_i32 ch (Int64.to_int32 (Int64.shift_right_logical n 32))
+
+let write_double ch f =
+       write_i64 ch (Int64.bits_of_float f)
+
+(* -------------------------------------------------------------- *)
+(* Big Endians *)
+
+module BigEndian = struct
+
+let read_ui16 i =
+       let ch2 = read_byte i in
+       let ch1 = read_byte i in
+       ch1 lor (ch2 lsl 8)
+
+let read_i16 i =
+       let ch2 = read_byte i in
+       let ch1 = read_byte i in
+       let n = ch1 lor (ch2 lsl 8) in
+       if ch2 land 128 <> 0 then
+               n - 65536
+       else
+               n
+
+let read_i32 ch =
+       let ch4 = read_byte ch in
+       let ch3 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch1 = read_byte ch in
+       if ch4 land 128 <> 0 then begin
+               if ch4 land 64 = 0 then raise (Overflow "read_i32");
+               ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor ((ch4 land 127) lsl 24)
+       end else begin
+               if ch4 land 64 <> 0 then raise (Overflow "read_i32");
+               ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor (ch4 lsl 24)
+       end
+
+let read_real_i32 ch =
+       let big = Int32.shift_left (Int32.of_int (read_byte ch)) 24 in
+       let ch3 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch1 = read_byte ch in
+       let base = Int32.of_int (ch1 lor (ch2 lsl 8) lor (ch3 lsl 16)) in
+       Int32.logor base big
+
+let read_i64 ch =
+       let big = Int64.of_int32 (read_real_i32 ch) in
+       let ch4 = read_byte ch in
+       let ch3 = read_byte ch in
+       let ch2 = read_byte ch in
+       let ch1 = read_byte ch in
+       let base = Int64.of_int (ch1 lor (ch2 lsl 8) lor (ch3 lsl 16)) in
+       let small = Int64.logor base (Int64.shift_left (Int64.of_int ch4) 24) in
+       Int64.logor (Int64.shift_left big 32) small
+
+let read_double ch =
+       Int64.float_of_bits (read_i64 ch)
+
+let write_ui16 ch n =
+       if n < 0 || n > 0xFFFF then raise (Overflow "write_ui16");
+       write_byte ch (n lsr 8);
+       write_byte ch n
+
+let write_i16 ch n =
+       if n < -0x8000 || n > 0x7FFF then raise (Overflow "write_i16");
+       if n < 0 then
+               write_ui16 ch (65536 + n)
+       else
+               write_ui16 ch n
+
+let write_i32 ch n =
+       write_byte ch (n asr 24);
+       write_byte ch (n lsr 16);
+       write_byte ch (n lsr 8);
+       write_byte ch n
+
+let write_real_i32 ch n =
+       let base = Int32.to_int n in
+       let big = Int32.to_int (Int32.shift_right_logical n 24) in
+       write_byte ch big;
+       write_byte ch (base lsr 16);
+       write_byte ch (base lsr 8);
+       write_byte ch base
+
+let write_i64 ch n =
+       write_real_i32 ch (Int64.to_int32 (Int64.shift_right_logical n 32));
+       write_real_i32 ch (Int64.to_int32 n)
+
+let write_double ch f =
+       write_i64 ch (Int64.bits_of_float f)
+
+end
+
+(* -------------------------------------------------------------- *)
+(* Bits API *)
+
+type 'a bc = {
+       ch : 'a;
+       mutable nbits : int;
+       mutable bits : int;
+}
+
+type in_bits = input bc
+type out_bits = unit output bc
+
+exception Bits_error
+
+let input_bits ch =
+       {
+               ch = ch;
+               nbits = 0;
+               bits = 0;
+       }
+
+let output_bits ch =
+       {
+               ch = cast_output ch;
+               nbits = 0;
+               bits = 0;
+       }
+
+let rec read_bits b n =
+       if b.nbits >= n then begin
+               let c = b.nbits - n in
+               let k = (b.bits asr c) land ((1 lsl n) - 1) in
+               b.nbits <- c;
+               k
+       end else begin
+               let k = read_byte b.ch in
+               if b.nbits >= 24 then begin
+                       if n >= 31 then raise Bits_error;
+                       let c = 8 + b.nbits - n in
+                       let d = b.bits land ((1 lsl b.nbits) - 1) in
+                       let d = (d lsl (8 - c)) lor (k lsr c) in
+                       b.bits <- k;
+                       b.nbits <- c;
+                       d
+               end else begin                  
+                       b.bits <- (b.bits lsl 8) lor k;
+                       b.nbits <- b.nbits + 8;
+                       read_bits b n;
+               end
+       end
+
+let drop_bits b =
+       b.nbits <- 0
+
+let rec write_bits b ~nbits x =
+       let n = nbits in
+       if n + b.nbits >= 32 then begin
+               if n > 31 then raise Bits_error;
+               let n2 = 32 - b.nbits - 1 in
+               let n3 = n - n2 in
+               write_bits b ~nbits:n2 (x asr n3);
+               write_bits b ~nbits:n3 (x land ((1 lsl n3) - 1));
+       end else begin
+               if n < 0 then raise Bits_error;
+               if (x < 0 || x > (1 lsl n - 1)) && n <> 31 then raise Bits_error;
+               b.bits <- (b.bits lsl n) lor x;
+               b.nbits <- b.nbits + n;
+               while b.nbits >= 8 do
+                       b.nbits <- b.nbits - 8;
+                       write_byte b.ch (b.bits asr b.nbits)
+               done
+       end
+
+let flush_bits b =
+       if b.nbits > 0 then write_bits b (8 - b.nbits) 0
+
+(* -------------------------------------------------------------- *)
+(* Generic IO *)
+
+class in_channel ch =
+  object
+       method input s pos len = input ch s pos len
+       method close_in() = close_in ch
+  end
+
+class out_channel ch =
+  object
+       method output s pos len = output ch s pos len
+       method flush() = flush ch
+       method close_out() = ignore(close_out ch)
+  end
+
+class in_chars ch =
+  object
+       method get() = try read ch with No_more_input -> raise End_of_file
+       method close_in() = close_in ch
+  end
+
+class out_chars ch =
+  object
+       method put t = write ch t
+       method flush() = flush ch
+       method close_out() = ignore(close_out ch)
+  end
+
+let from_in_channel ch =
+       let cbuf = String.create 1 in
+       let read() =
+               try
+                       if ch#input cbuf 0 1 = 0 then raise Sys_blocked_io;
+                       String.unsafe_get cbuf 0
+               with
+                       End_of_file -> raise No_more_input
+       in
+       let input s p l =
+               ch#input s p l
+       in
+       create_in
+               ~read
+               ~input
+               ~close:ch#close_in
+
+let from_out_channel ch =
+       let cbuf = String.create 1 in
+       let write c =
+               String.unsafe_set cbuf 0 c;
+               if ch#output cbuf 0 1 = 0 then raise Sys_blocked_io;
+       in
+       let output s p l =
+               ch#output s p l
+       in
+       create_out
+               ~write
+               ~output
+               ~flush:ch#flush
+               ~close:ch#close_out
+
+let from_in_chars ch =
+       let input s p l =
+               let i = ref 0 in
+               try
+                       while !i < l do
+                               String.unsafe_set s (p + !i) (ch#get());
+                               incr i
+                       done;
+                       l
+               with
+                       End_of_file when !i > 0 ->
+                               !i
+       in
+       create_in
+               ~read:ch#get
+               ~input
+               ~close:ch#close_in
+
+let from_out_chars ch =
+       let output s p l =
+               for i = p to p + l - 1 do
+                       ch#put (String.unsafe_get s i)
+               done;
+               l
+       in
+       create_out
+               ~write:ch#put
+               ~output
+               ~flush:ch#flush
+               ~close:ch#close_out
diff --git a/bundles/extlib/extlib-1.5.2/IO.mli b/bundles/extlib/extlib-1.5.2/IO.mli
new file mode 100644 (file)
index 0000000..2d8bd77
--- /dev/null
@@ -0,0 +1,321 @@
+(* 
+ * IO - Abstract input/output
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** High-order abstract I/O.
+
+       IO module simply deals with abstract inputs/outputs. It provides a
+       set of methods for working with these IO as well as several
+       constructors that enable to write to an underlying channel, buffer,
+       or enum.
+*)
+
+type input
+(** The abstract input type. *)
+
+type 'a output
+(** The abstract output type, ['a] is the accumulator data, it is returned
+       when the [close_out] function is called. *)
+
+exception No_more_input
+(** This exception is raised when reading on an input with the [read] or
+  [nread] functions while there is no available token to read. *)
+
+exception Input_closed
+(** This exception is raised when reading on a closed input. *)
+
+exception Output_closed
+(** This exception is raised when reading on a closed output. *)
+
+(** {6 Standard API} *)
+
+val read : input -> char
+(** Read a single char from an input or raise [No_more_input] if
+  no input available. *)
+
+val nread : input -> int -> string
+(** [nread i n] reads a string of size up to [n] from an input.
+  The function will raise [No_more_input] if no input is available.
+  It will raise [Invalid_argument] if [n] < 0. *)
+
+val really_nread : input -> int -> string
+(** [really_nread i n] reads a string of exactly [n] characters
+  from the input. Raises [No_more_input] if at least [n] characters are
+  not available. Raises [Invalid_argument] if [n] < 0. *)
+
+val input : input -> string -> int -> int -> int
+(** [input i s p l] reads up to [l] characters from the given input, storing
+  them in string [s], starting at character number [p]. It returns the actual
+  number of characters read or raise [No_more_input] if no character can be
+  read. It will raise [Invalid_argument] if [p] and [l] do not designate a
+  valid substring of [s]. *)
+
+val really_input : input -> string -> int -> int -> int
+(** [really_input i s p l] reads exactly [l] characters from the given input,
+  storing them in the string [s], starting at position [p]. For consistency with
+  {!IO.input} it returns [l]. Raises [No_more_input] if at [l] characters are
+  not available. Raises [Invalid_argument] if [p] and [l] do not designate a
+  valid substring of [s]. *)
+
+val close_in : input -> unit
+(** Close the input. It can no longer be read from. *)
+
+val write : 'a output -> char -> unit
+(** Write a single char to an output. *)
+
+val nwrite : 'a output -> string -> unit
+(** Write a string to an output. *)
+
+val output : 'a output -> string -> int -> int -> int
+(** [output o s p l] writes up to [l] characters from string [s], starting at
+  offset [p]. It returns the number of characters written. It will raise
+  [Invalid_argument] if [p] and [l] do not designate a valid substring of [s]. *)
+
+val really_output : 'a output -> string -> int -> int -> int
+(** [really_output o s p l] writes exactly [l] characters from string [s] onto
+  the the output, starting with the character at offset [p]. For consistency with
+  {!IO.output} it returns [l]. Raises [Invalid_argument] if [p] and [l] do not
+  designate a valid substring of [s]. *)
+
+val flush : 'a output -> unit
+(** Flush an output. *)
+
+val close_out : 'a output -> 'a
+(** Close the output and return its accumulator data.
+  It can no longer be written. *)
+
+(** {6 Creation of IO Inputs/Outputs} *)
+
+val input_string : string -> input
+(** Create an input that will read from a string. *)
+
+val output_string : unit -> string output
+(** Create an output that will write into a string in an efficient way.
+  When closed, the output returns all the data written into it. *)
+
+val input_channel : in_channel -> input
+(** Create an input that will read from a channel. *)
+
+val output_channel : out_channel -> unit output
+(** Create an output that will write into a channel. *) 
+
+val input_enum : char Enum.t -> input
+(** Create an input that will read from an [enum]. *)
+
+val output_enum : unit -> char Enum.t output
+(** Create an output that will write into an [enum]. The 
+  final enum is returned when the output is closed. *)
+
+val create_in :
+  read:(unit -> char) ->
+  input:(string -> int -> int -> int) -> close:(unit -> unit) -> input
+(** Fully create an input by giving all the needed functions. *)
+
+val create_out :
+  write:(char -> unit) ->
+  output:(string -> int -> int -> int) ->   
+  flush:(unit -> unit) -> close:(unit -> 'a) -> 'a output
+(** Fully create an output by giving all the needed functions. *)
+
+(** {6 Utilities} *)
+
+val printf : 'a output -> ('b, unit, string, unit) format4 -> 'b
+(** The printf function works for any output. *)
+
+val read_all : input -> string
+(** read all the contents of the input until [No_more_input] is raised. *)
+
+val pipe : unit -> input * unit output
+(** Create a pipe between an input and an ouput. Data written from
+  the output can be read from the input. *)
+
+val pos_in : input -> input * (unit -> int)
+(** Create an input that provide a count function of the number of bytes
+  read from it. *)
+
+val pos_out : 'a output -> 'a output * (unit -> int)
+(** Create an output that provide a count function of the number of bytes
+  written through it. *)
+
+external cast_output : 'a output -> unit output = "%identity"
+(** You can safely transform any output to an unit output in a safe way 
+  by using this function. *)
+
+(** {6 Binary files API}
+
+       Here is some API useful for working with binary files, in particular
+       binary files generated by C applications. By default, encoding of
+       multibyte integers is low-endian. The BigEndian module provide multibyte
+       operations with other encoding.
+*)
+
+exception Overflow of string
+(** Exception raised when a read or write operation cannot be completed. *)
+
+val read_byte : input -> int
+(** Read an unsigned 8-bit integer. *)
+
+val read_signed_byte : input -> int
+(** Read an signed 8-bit integer. *)
+
+val read_ui16 : input -> int
+(** Read an unsigned 16-bit word. *)
+
+val read_i16 : input -> int
+(** Read a signed 16-bit word. *)
+
+val read_i32 : input -> int
+(** Read a signed 32-bit integer. Raise [Overflow] if the
+  read integer cannot be represented as a Caml 31-bit integer. *)
+
+val read_real_i32 : input -> int32
+(** Read a signed 32-bit integer as an OCaml int32. *)
+
+val read_i64 : input -> int64
+(** Read a signed 64-bit integer as an OCaml int64. *)
+
+val read_double : input -> float
+(** Read an IEEE double precision floating point value. *)
+
+val read_string : input -> string
+(** Read a null-terminated string. *)
+
+val read_line : input -> string
+(** Read a LF or CRLF terminated string. *)
+
+val write_byte : 'a output -> int -> unit
+(** Write an unsigned 8-bit byte. *)
+
+val write_ui16 : 'a output -> int -> unit
+(** Write an unsigned 16-bit word. *)
+
+val write_i16 : 'a output -> int -> unit
+(** Write a signed 16-bit word. *)
+
+val write_i32 : 'a output -> int -> unit
+(** Write a signed 32-bit integer. *) 
+
+val write_real_i32 : 'a output -> int32 -> unit
+(** Write an OCaml int32. *)
+
+val write_i64 : 'a output -> int64 -> unit
+(** Write an OCaml int64. *)
+
+val write_double : 'a output -> float -> unit
+(** Write an IEEE double precision floating point value. *)
+
+val write_string : 'a output -> string -> unit
+(** Write a string and append an null character. *)
+
+val write_line : 'a output -> string -> unit
+(** Write a line and append a LF (it might be converted
+       to CRLF on some systems depending on the underlying IO). *)
+
+(** Same as operations above, but use big-endian encoding *)
+module BigEndian :
+sig
+
+       val read_ui16 : input -> int
+       val read_i16 : input -> int
+       val read_i32 : input -> int
+       val read_real_i32 : input -> int32
+       val read_i64 : input -> int64
+       val read_double : input -> float
+       
+       val write_ui16 : 'a output -> int -> unit
+       val write_i16 : 'a output -> int -> unit
+       val write_i32 : 'a output -> int -> unit
+       val write_real_i32 : 'a output -> int32 -> unit
+       val write_i64 : 'a output -> int64 -> unit
+       val write_double : 'a output -> float -> unit
+
+end
+
+(** {6 Bits API}
+
+       This enable you to read and write from an IO bit-by-bit or several bits
+       at the same time.
+*)
+
+type in_bits
+type out_bits
+
+exception Bits_error
+
+val input_bits : input -> in_bits
+(** Read bits from an input *)
+
+val output_bits : 'a output -> out_bits
+(** Write bits to an output *)
+
+val read_bits : in_bits -> int -> int
+(** Read up to 31 bits, raise Bits_error if n < 0 or n > 31 *)
+
+val write_bits : out_bits -> nbits:int -> int -> unit
+(** Write up to 31 bits represented as a value, raise Bits_error if nbits < 0
+ or nbits > 31 or the value representation excess nbits. *)
+
+val flush_bits : out_bits -> unit
+(** Flush remaining unwritten bits, adding up to 7 bits which values 0. *)
+
+val drop_bits : in_bits -> unit
+(** Drop up to 7 buffered bits and restart to next input character. *)
+
+(** {6 Generic IO Object Wrappers}
+
+       Theses OO Wrappers have been written to provide easy support of ExtLib
+       IO by external librairies. If you want your library to support ExtLib
+       IO without actually requiring ExtLib to compile, you can should implement
+       the classes [in_channel], [out_channel], [poly_in_channel] and/or
+       [poly_out_channel] which are the common IO specifications established
+       for ExtLib, OCamlNet and Camomile.
+
+       (see http://www.ocaml-programming.de/tmp/IO-Classes.html for more details).
+*)
+
+class in_channel : input ->
+  object
+       method input : string -> int -> int -> int
+       method close_in : unit -> unit
+  end
+
+class out_channel : 'a output ->
+  object
+       method output : string -> int -> int -> int
+       method flush : unit -> unit
+       method close_out : unit -> unit
+  end
+
+class in_chars : input ->
+  object
+       method get : unit -> char
+       method close_in : unit -> unit
+  end
+
+class out_chars : 'a output ->
+  object
+       method put : char -> unit
+       method flush : unit -> unit
+       method close_out : unit -> unit
+  end
+
+val from_in_channel : #in_channel -> input
+val from_out_channel : #out_channel -> unit output
+val from_in_chars : #in_chars -> input
+val from_out_chars : #out_chars -> unit output
diff --git a/bundles/extlib/extlib-1.5.2/LICENSE b/bundles/extlib/extlib-1.5.2/LICENSE
new file mode 100644 (file)
index 0000000..d158692
--- /dev/null
@@ -0,0 +1,199 @@
+The Library is distributed under the terms of the GNU Library General
+Public License version 2 (included below).
+
+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, or a
+modified version of the Library that is distributed under the
+conditions defined in clause 3 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.
+
+------------
+
+GNU LESSER GENERAL PUBLIC LICENSE
+Version 2.1, February 1999 
+
+
+Copyright (C) 1991, 1999 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 Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+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 Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. 
+
+When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. 
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these 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 other code 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. 
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. 
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. 
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. 
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. 
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. 
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. 
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. 
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. 
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. 
+
+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, whereas the latter must be combined with the library in order to run. 
+
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. 
+c) 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. 
+d) 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. 
+e) 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 materials to be 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 with 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 Lesser 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 INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
+
+
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Libraries
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). 
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 
+
+
+one line to give the library's name and an idea of what it does.
+Copyright (C) year  name of author
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail. 
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: 
+
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+the library `Frob' (a library for tweaking knobs) written
+by James Random Hacker.
+
+signature of Ty Coon, 1 April 1990
+Ty Coon, President of Vice
+
+That's all there is to it! 
diff --git a/bundles/extlib/extlib-1.5.2/META b/bundles/extlib/extlib-1.5.2/META
new file mode 100644 (file)
index 0000000..9a8fc05
--- /dev/null
@@ -0,0 +1,4 @@
+version="1.5.2"
+description="Extended standard library"
+archive(byte)="extLib.cma"
+archive(native)="extLib.cmxa"
diff --git a/bundles/extlib/extlib-1.5.2/Makefile b/bundles/extlib/extlib-1.5.2/Makefile
new file mode 100644 (file)
index 0000000..b50f463
--- /dev/null
@@ -0,0 +1,30 @@
+# Makefile contributed by Alain Frisch
+
+MODULES = \
+ enum bitSet dynArray extArray extHashtbl extList extString global IO option \
+ pMap std uChar uTF8 base64 unzip refList optParse dllist
+
+# the list is topologically sorted
+
+MLI = $(MODULES:=.mli)
+SRC = $(MLI) $(MODULES:=.ml) extLib.ml
+
+all: 
+       ocamlc -a -o extLib.cma $(SRC)
+opt: 
+       ocamlopt -a -o extLib.cmxa $(SRC)
+doc:
+       ocamlc -c $(MODULES:=.mli)
+       mkdir -p doc/
+       ocamldoc -sort -html -d doc/ $(MODULES:=.mli)
+       cp odoc_style.css doc/style.css
+
+install:
+       ocamlfind install extlib META *.cmi *.cma $(MLI) $(wildcard *.cmxa) $(wildcard *.a)
+
+uninstall:
+       ocamlfind remove extlib
+
+clean:
+       rm -f *.cmo *.cmx *.o *.cmi *.cma *.cmxa *.a
+       rm -Rf doc
diff --git a/bundles/extlib/extlib-1.5.2/README.txt b/bundles/extlib/extlib-1.5.2/README.txt
new file mode 100644 (file)
index 0000000..435916f
--- /dev/null
@@ -0,0 +1,54 @@
+OCaml Extended standard Library - ExtLib.
+=========================================
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+What is ExtLib ?
+----------------
+
+ExtLib is a set of additional useful functions and modules for OCaml.
+Project page :
+       http://code.google.com/p/ocaml-extlib
+and you can join the mailing list here :
+       http://lists.sourceforge.net/lists/listinfo/ocaml-lib-devel
+
+People are encouraged to contribute and to report any bug or problem
+they might have with ExtLib by using the mailing list.
+
+Installation :
+--------------
+
+Unzip or untar in any directory, then simply run
+
+> ocaml install.ml
+
+and follow the instructions.
+
+Usage :
+-------
+
+Generate and watch the documentation.
+
+Contributors :
+--------------
+
+Nicolas Cannasse (ncannasse@motion-twin.com)
+Brian Hurt (brian.hurt@qlogic.com)
+Yamagata Yoriyuki (yori@users.sourceforge.net)
+
+License :
+---------
+
+See LICENSE
diff --git a/bundles/extlib/extlib-1.5.2/base64.ml b/bundles/extlib/extlib-1.5.2/base64.ml
new file mode 100644 (file)
index 0000000..0ac9613
--- /dev/null
@@ -0,0 +1,119 @@
+(*
+ * Base64 - Base64 codec
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+exception Invalid_char
+exception Invalid_table
+
+external unsafe_char_of_int : int -> char = "%identity"
+
+type encoding_table = char array
+type decoding_table = int array
+
+let chars = [|
+       'A';'B';'C';'D';'E';'F';'G';'H';'I';'J';'K';'L';'M';'N';'O';'P';
+       'Q';'R';'S';'T';'U';'V';'W';'X';'Y';'Z';'a';'b';'c';'d';'e';'f';
+       'g';'h';'i';'j';'k';'l';'m';'n';'o';'p';'q';'r';'s';'t';'u';'v';
+       'w';'x';'y';'z';'0';'1';'2';'3';'4';'5';'6';'7';'8';'9';'+';'/'
+|]
+
+let make_decoding_table tbl =
+       if Array.length tbl <> 64 then raise Invalid_table;
+       let d = Array.make 256 (-1) in
+       for i = 0 to 63 do
+               Array.unsafe_set d (int_of_char (Array.unsafe_get tbl i)) i;
+       done;
+       d
+
+let inv_chars = make_decoding_table chars
+
+let encode ?(tbl=chars) ch =
+       if Array.length tbl <> 64 then raise Invalid_table;
+       let data = ref 0 in
+       let count = ref 0 in
+       let flush() =
+               if !count > 0 then begin
+                       let d = (!data lsl (6 - !count)) land 63 in
+                       IO.write ch (Array.unsafe_get tbl d);
+               end;            
+       in
+       let write c =
+               let c = int_of_char c in
+               data := (!data lsl 8) lor c;
+               count := !count + 8;
+               while !count >= 6 do
+                       count := !count - 6;
+                       let d = (!data asr !count) land 63 in
+                       IO.write ch (Array.unsafe_get tbl d)
+               done;
+       in
+       let output s p l =
+               for i = p to p + l - 1 do
+                       write (String.unsafe_get s i)
+               done;
+               l
+       in
+       IO.create_out ~write ~output
+               ~flush:(fun () -> flush(); IO.flush ch)
+               ~close:(fun() -> flush(); IO.close_out ch)
+
+let decode ?(tbl=inv_chars) ch =
+       if Array.length tbl <> 256 then raise Invalid_table;
+       let data = ref 0 in
+       let count = ref 0 in
+       let rec fetch() =
+               if !count >= 8 then begin
+                       count := !count - 8;
+                       let d = (!data asr !count) land 0xFF in
+                       unsafe_char_of_int d
+               end else
+                       let c = int_of_char (IO.read ch) in
+                       let c = Array.unsafe_get tbl c in
+                       if c = -1 then raise Invalid_char;
+                       data := (!data lsl 6) lor c;
+                       count := !count + 6;
+                       fetch()
+       in
+       let read = fetch in
+       let input s p l =
+               let i = ref 0 in
+               try
+                       while !i < l do
+                               String.unsafe_set s (p + !i) (fetch());
+                               incr i;
+                       done;
+                       l
+               with
+                       IO.No_more_input when !i > 0 ->
+                               !i
+       in
+       let close() =
+               count := 0;
+               IO.close_in ch
+       in
+       IO.create_in ~read ~input ~close
+
+let str_encode ?(tbl=chars) s =
+       let ch = encode ~tbl (IO.output_string()) in
+       IO.nwrite ch s;
+       IO.close_out ch
+
+let str_decode ?(tbl=inv_chars) s =
+       let ch = decode ~tbl (IO.input_string s) in
+       IO.nread ch ((String.length s * 6) / 8)
diff --git a/bundles/extlib/extlib-1.5.2/base64.mli b/bundles/extlib/extlib-1.5.2/base64.mli
new file mode 100644 (file)
index 0000000..38dd9b4
--- /dev/null
@@ -0,0 +1,57 @@
+(*
+ * Base64 - Base64 codec
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Base64 codec.
+
+       8-bit characters are encoded into 6-bit ones using ASCII lookup tables.
+       Default tables maps 0..63 values on characters A-Z, a-z, 0-9, '+' and '/'
+       (in that order). 
+*)
+
+(** This exception is raised when reading an invalid character
+       from a base64 input. *)
+exception Invalid_char
+
+(** This exception is raised if the encoding or decoding table
+       size is not correct. *)
+exception Invalid_table
+
+(** An encoding table maps integers 0..63 to the corresponding char. *)
+type encoding_table = char array
+
+(** A decoding table mais chars 0..255 to the corresponding 0..63 value
+ or -1 if the char is not accepted. *)
+type decoding_table = int array
+
+(** Encode a string into Base64. *)
+val str_encode : ?tbl:encoding_table -> string -> string
+
+(** Decode a string encoded into Base64, raise [Invalid_char] if a
+       character in the input string is not a valid one. *)
+val str_decode : ?tbl:decoding_table -> string -> string
+
+(** Generic base64 encoding over an output. *)
+val encode : ?tbl:encoding_table -> 'a IO.output -> 'a IO.output
+
+(** Generic base64 decoding over an input. *)
+val decode : ?tbl:decoding_table -> IO.input -> IO.input
+
+(** Create a valid decoding table from an encoding one. *)
+val make_decoding_table : encoding_table -> decoding_table
diff --git a/bundles/extlib/extlib-1.5.2/bitSet.ml b/bundles/extlib/extlib-1.5.2/bitSet.ml
new file mode 100644 (file)
index 0000000..6556bb0
--- /dev/null
@@ -0,0 +1,324 @@
+(*
+ * Bitset - Efficient bit sets
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA    02111-1307      USA
+ *)
+
+type intern
+
+let bcreate : int -> intern = Obj.magic String.create
+external fast_get : intern -> int -> int = "%string_unsafe_get"
+external fast_set : intern -> int -> int -> unit = "%string_unsafe_set"
+external fast_bool : int -> bool = "%identity"
+let fast_blit : intern -> int -> intern -> int -> int -> unit = Obj.magic String.blit
+let fast_fill : intern -> int -> int -> int -> unit = Obj.magic String.fill
+let fast_length : intern -> int= Obj.magic String.length
+
+let bget s ndx =
+  assert (ndx >= 0 && ndx < fast_length s);
+  fast_get s ndx
+
+let bset s ndx v =
+  assert (ndx >= 0 && ndx < fast_length s);
+  fast_set s ndx v
+
+let bblit src srcoff dst dstoff len = 
+  assert (srcoff >= 0 && dstoff >= 0 && len >= 0);
+  fast_blit src srcoff dst dstoff len
+
+let bfill dst start len c = 
+  assert (start >= 0 && len >= 0);
+  fast_fill dst start len c
+
+exception Negative_index of string
+
+type t = {
+       mutable data : intern;
+       mutable len : int;
+}
+
+let error fname = raise (Negative_index fname)
+
+let empty() =
+       {
+               data = bcreate 0;
+               len = 0;
+       }
+
+let int_size = 7 (* value used to round up index *)
+let log_int_size = 3 (* number of shifts *)
+
+let create n =
+       if n < 0 then error "create";
+       let size = (n+int_size) lsr log_int_size in
+       let b = bcreate size in
+       bfill b 0 size 0;
+       {
+               data = b;
+               len = size;
+       }
+
+let copy t =
+       let b = bcreate t.len in
+       bblit t.data 0 b 0 t.len;
+       {
+               data = b;
+               len = t.len
+       }
+
+let clone = copy
+
+let set t x =
+       if x < 0 then error "set";
+       let pos = x lsr log_int_size and delta = x land int_size in
+       let size = t.len in
+       if pos >= size then begin
+               let b = bcreate (pos+1) in
+               bblit t.data 0 b 0 size;
+               bfill b size (pos - size + 1) 0;
+               t.len <- pos + 1;
+               t.data <- b;
+       end;
+       bset t.data pos ((bget t.data pos) lor (1 lsl delta))
+
+let unset t x =
+       if x < 0 then error "unset";
+       let pos = x lsr log_int_size and delta = x land int_size in
+       if pos < t.len then
+               bset t.data pos ((bget t.data pos) land (0xFF lxor (1 lsl delta)))
+
+let toggle t x =
+       if x < 0 then error "toggle";
+       let pos = x lsr log_int_size and delta = x land int_size in
+       let size = t.len in
+       if pos >= size then begin
+               let b = bcreate (pos+1) in
+               bblit t.data 0 b 0 size;
+               bfill b size (pos - size + 1) 0;
+               t.len <- pos + 1;
+               t.data <- b;
+       end;
+       bset t.data pos ((bget t.data pos) lxor (1 lsl delta))
+
+let put t = function
+       | true -> set t
+       | false -> unset t
+
+let is_set t x =
+  if x < 0 then error "is_set";
+  let pos = x lsr log_int_size and delta = x land int_size in
+  let size = t.len in
+  if pos < size then
+       fast_bool (((bget t.data pos) lsr delta) land 1)
+  else
+       false
+
+
+exception Break_int of int
+
+(* Find highest set element or raise Not_found *)
+let find_msb t =
+  (* Find highest set bit in a byte.  Does not work with zero. *)
+  let byte_msb b = 
+    assert (b <> 0);
+    let rec loop n = 
+      if b land (1 lsl n) = 0 then
+        loop (n-1)
+      else n in
+    loop 7 in
+  let n = t.len - 1
+  and buf = t.data in
+  try 
+    for i = n downto 0 do
+      let byte = bget buf i in
+      if byte <> 0 then raise (Break_int ((i lsl log_int_size)+(byte_msb byte)))
+    done;
+    raise Not_found
+  with 
+    Break_int n -> n
+  | _ -> raise Not_found
+
+let compare t1 t2 =
+  let some_msb b = try Some (find_msb b) with Not_found -> None in
+  match (some_msb t1, some_msb t2) with
+    (None, Some _) -> -1 (* 0-y -> -1 *)
+  | (Some _, None) -> 1  (* x-0 ->  1 *)
+  | (None, None) -> 0    (* 0-0 ->  0 *)
+  | (Some a, Some b) ->  (* x-y *)
+      if a < b then -1
+      else if a > b then 1
+      else
+        begin
+          (* MSBs differ, we need to scan arrays until we find a
+             difference *)
+          let ndx = a lsr log_int_size in 
+          assert (ndx < t1.len && ndx < t2.len);
+          try
+            for i = ndx downto 0 do
+              let b1 = bget t1.data i 
+              and b2 = bget t2.data i in
+              if b1 <> b2 then raise (Break_int (compare b1 b2))
+            done;
+            0
+          with
+            Break_int res -> res
+        end
+
+let equals t1 t2 =
+       compare t1 t2 = 0
+
+let partial_count t x =
+       let rec nbits x =
+               if x = 0 then
+                       0
+               else if fast_bool (x land 1) then
+                       1 + (nbits (x lsr 1))
+               else
+                       nbits (x lsr 1)
+       in
+       let size = t.len in
+       let pos = x lsr log_int_size and delta = x land int_size in
+       let rec loop n acc =
+               if n = size then
+                       acc
+               else
+                       let x = bget t.data n in
+                       loop (n+1) (acc + nbits x)
+       in
+       if pos >= size then
+               0
+       else
+               loop (pos+1) (nbits ((bget t.data pos) lsr delta))
+
+let count t =
+  partial_count t 0
+
+(* Find the first set bit in the bit array *)
+let find_first_set b n =
+  (* TODO there are many ways to speed this up.  Lookup table would be
+     one way to speed this up. *)
+  let find_lsb b =
+    assert (b <> 0);
+    let rec loop n =
+      if b land (1 lsl n) <> 0 then n else loop (n+1) in
+    loop 0 in
+
+  let buf = b.data in
+  let rec find_bit byte_ndx bit_offs =
+    if byte_ndx >= b.len then
+      None
+    else
+      let byte = (bget buf byte_ndx) lsr bit_offs in
+      if byte = 0 then
+        find_bit (byte_ndx + 1) 0
+      else
+        Some ((find_lsb byte) + (byte_ndx lsl log_int_size) + bit_offs) in
+  find_bit (n lsr log_int_size) (n land int_size)
+      
+let enum t =
+  let rec make n =
+    let cur = ref n in
+    let rec next () =
+      match find_first_set t !cur with
+        Some elem ->
+          cur := (elem+1);
+          elem
+      | None ->
+          raise Enum.No_more_elements in
+    Enum.make
+      ~next
+      ~count:(fun () -> partial_count t !cur)
+      ~clone:(fun () -> make !cur)
+  in
+  make 0
+
+let raw_create size = 
+  let b = bcreate size in
+  bfill b 0 size 0;
+  { data = b; len = size }
+
+let inter a b =
+  let max_size = max a.len b.len in
+  let d = raw_create max_size in
+  let sl = min a.len b.len in
+  let abuf = a.data
+  and bbuf = b.data in
+  (* Note: rest of the array is set to zero automatically *)
+  for i = 0 to sl-1 do
+    bset d.data i ((bget abuf i) land (bget bbuf i))
+  done;
+  d
+
+(* Note: rest of the array is handled automatically correct, since we
+   took a copy of the bigger set. *)
+let union a b = 
+  let d = if a.len > b.len then copy a else copy b in
+  let sl = min a.len b.len in
+  let abuf = a.data
+  and bbuf = b.data in
+  for i = 0 to sl-1 do
+    bset d.data i ((bget abuf i) lor (bget bbuf i))
+  done;
+  d
+
+let diff a b = 
+  let maxlen = max a.len b.len in
+  let buf = bcreate maxlen in
+  bblit a.data 0 buf 0 a.len;
+  let sl = min a.len b.len in
+  let abuf = a.data
+  and bbuf = b.data in
+  for i = 0 to sl-1 do
+    bset buf i ((bget abuf i) land (lnot (bget bbuf i)))
+  done;
+  { data = buf; len = maxlen }
+
+let sym_diff a b = 
+  let maxlen = max a.len b.len in
+  let buf = bcreate maxlen in
+  (* Copy larger (assumes missing bits are zero) *)
+  bblit (if a.len > b.len then a.data else b.data) 0 buf 0 maxlen;
+  let sl = min a.len b.len in
+  let abuf = a.data
+  and bbuf = b.data in
+  for i = 0 to sl-1 do
+    bset buf i ((bget abuf i) lxor (bget bbuf i))
+  done;
+  { data = buf; len = maxlen }
+
+(* TODO the following set operations can be made faster if you do the
+   set operation in-place instead of taking a copy.  But be careful
+   when the sizes of the bitvector strings differ. *)
+let intersect t t' =
+  let d = inter t t' in
+  t.data <- d.data;
+  t.len <- d.len
+
+let differentiate t t' =
+  let d = diff t t' in
+  t.data <- d.data;
+  t.len <- d.len
+
+let unite t t' =
+  let d = union t t' in
+  t.data <- d.data;
+  t.len <- d.len
+
+let differentiate_sym t t' =
+  let d = sym_diff t t' in
+  t.data <- d.data;
+  t.len <- d.len
diff --git a/bundles/extlib/extlib-1.5.2/bitSet.mli b/bundles/extlib/extlib-1.5.2/bitSet.mli
new file mode 100644 (file)
index 0000000..aeff7f7
--- /dev/null
@@ -0,0 +1,101 @@
+(*
+ * Bitset - Efficient bit sets
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Efficient bit sets.
+
+ A bitset is an array of boolean values that can be accessed with indexes
+ like an array but provides a better memory usage (divided by 8) for a
+ very small speed trade-off. *)
+
+type t
+
+exception Negative_index of string
+(** When a negative bit value is used for one of the BitSet functions,
+ this exception is raised with the name of the function. *)
+
+val empty : unit ->  t
+(** Create an empty bitset of size 0, the bitset will automatically expand
+ when needed. *)
+
+val create : int -> t
+(** Create an empty bitset with an initial size (in number of bits). *)
+
+val copy : t -> t
+(** Copy a bitset : further modifications of first one will not affect the
+ copy. *)
+
+val clone : t -> t
+(** Same as [copy] *)
+
+val set : t -> int -> unit
+(** [set s n] sets the nth-bit in the bitset [s] to true. *)
+
+val unset : t -> int -> unit
+(** [unset s n] sets the nth-bit in the bitset [s] to false. *)
+
+val put : t -> bool -> int -> unit
+(** [put s v n] sets the nth-bit in the bitset [s] to [v]. *)
+
+val toggle : t -> int -> unit
+(** [toggle s n] changes the nth-bit value in the bitset [s]. *)
+
+val is_set : t -> int -> bool
+(** [is_set s n] returns true if nth-bit in the bitset [s] is set,
+ or false otherwise. *)
+
+val compare : t -> t -> int
+(** [compare s1 s2] compares two bitsets. Highest bit indexes are
+ compared first. *)
+
+val equals : t -> t -> bool
+(** [equals s1 s2] returns true if, and only if, all bits values in s1 are
+  the same as in s2. *)
+
+val count : t -> int
+(** [count s] returns the number of bits set in the bitset [s]. *)
+
+val enum : t -> int Enum.t
+(** [enum s] returns an enumeration of bits which are set
+  in the bitset [s]. *)
+
+val intersect : t -> t -> unit
+(** [intersect s t] sets [s] to the intersection of the sets [s] and [t]. *)
+
+val unite : t -> t -> unit
+(** [unite s t] sets [s] to the union of the sets [s] and [t]. *)
+
+val differentiate : t -> t -> unit
+(** [differentiate s t] removes the elements of [t] from [s]. *)
+
+val differentiate_sym : t -> t -> unit
+(** [differentiate_sym s t] sets [s] to the symmetrical difference of the
+  sets [s] and [t]. *)
+
+val inter : t -> t -> t
+(** [inter s t] returns the intersection of sets [s] and [t]. *)
+
+val union : t -> t -> t
+(** [union s t] return the union of sets [s]  and [t]. *)
+
+val diff : t -> t -> t
+(** [diff s t] returns [s]-[t]. *)
+
+val sym_diff : t -> t -> t
+(** [sym_diff s t] returns the symmetrical difference of [s] and [t]. *)
diff --git a/bundles/extlib/extlib-1.5.2/dllist.ml b/bundles/extlib/extlib-1.5.2/dllist.ml
new file mode 100644 (file)
index 0000000..0718291
--- /dev/null
@@ -0,0 +1,287 @@
+(*
+ * Dllist- a mutable, circular, doubly linked list library
+ * Copyright (C) 2004 Brian Hurt, Jesse Guardiani
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type 'a node_t = {
+       mutable data : 'a;
+       mutable next : 'a node_t;
+       mutable prev : 'a node_t
+}
+
+type 'a enum_t = {
+       mutable curr : 'a node_t;
+       mutable valid : bool
+}
+
+exception Empty
+
+let create x = let rec nn = { data = x; next = nn; prev = nn} in nn
+
+let length node =
+       let rec loop cnt n =
+               if n == node then
+                       cnt
+               else
+                       loop (cnt + 1) n.next
+       in
+       loop 1 node.next
+
+let add node elem =
+       let nn = { data = elem; next = node.next; prev = node } in
+       node.next.prev <- nn;
+       node.next <- nn
+
+let append node elem =
+       let nn = { data = elem; next = node.next; prev = node } in
+       node.next.prev <- nn;
+       node.next <- nn;
+       nn
+
+let prepend node elem =
+       let nn = { data = elem; next = node; prev = node.prev } in
+       node.prev.next <- nn;
+       node.prev <- nn;
+       nn
+
+let promote node =
+       let next = node.next in
+       let prev = node.prev in
+       if next != prev then begin
+               next.next.prev <- node;
+               node.next <- next.next;
+               node.prev <- next;
+               next.next <- node;
+               next.prev <- prev;
+               prev.next <- next
+       end
+
+let demote node =
+       let next = node.next in
+       let prev = node.prev in
+       if next != prev then begin
+               prev.prev.next <- node;
+               node.prev <- prev.prev;
+               node.next <- prev;
+               prev.prev <- node;
+               prev.next <- next;
+               next.prev <- prev
+       end
+
+let remove node =
+       let next = node.next in
+       let prev = node.prev in
+       prev.next <- next;
+       next.prev <- prev;
+       node.next <- node;
+       node.prev <- node
+
+let drop node =
+       let next = node.next in
+       let prev = node.prev in
+       prev.next <- next;
+       next.prev <- prev;
+       node.next <- node;
+       node.prev <- node;
+       next
+
+let rev_drop node =
+       let next = node.next in
+       let prev = node.prev in
+       prev.next <- next;
+       next.prev <- prev;
+       node.next <- node;
+       node.prev <- node;
+       prev
+
+let splice node1 node2 =
+       let next = node1.next in
+       let prev = node2.prev in
+       node1.next <- node2;
+       node2.prev <- node1;
+       next.prev <- prev;
+       prev.next <- next
+
+let set node data = node.data <- data
+
+let get node = node.data
+
+let next node = node.next
+
+let prev node = node.prev
+
+let skip node idx =
+       let m = if idx > 0 then -1 else 1 in
+       let rec loop idx n =
+               if idx == 0 then
+                       n
+               else
+                       loop (idx + m) n.next
+       in
+       loop idx node
+
+let rev node =
+       let rec loop next n =
+               begin
+                       let prev = n.prev in
+                       n.next <- prev;
+                       n.prev <- next;
+
+                       if n != node then
+                               loop n prev
+               end
+       in
+       loop node node.prev
+
+let iter f node =
+       let () = f node.data in
+       let rec loop n =
+               if n != node then
+                       let () = f n.data in
+                       loop n.next
+       in
+       loop node.next
+
+let fold_left f init node =
+       let rec loop accu n =
+               if n == node then
+                       accu
+               else
+                       loop (f accu n.data) n.next
+       in
+       loop (f init node.data) node.next
+
+let fold_right f node init =
+       let rec loop accu n =
+               if n == node then
+                       f n.data accu
+               else
+                       loop (f n.data accu) n.prev
+       in
+       loop init node.prev
+
+let map f node =
+       let first = create (f node.data) in
+       let rec loop last n =
+               if n == node then
+                       begin
+                               first.prev <- last;
+                               first
+                       end
+               else
+                       begin
+                               let nn = { data = f n.data; next = first; prev = last } in
+                               last.next <- nn;
+                               loop nn n.next
+                       end
+       in
+       loop first node.next
+
+let copy node = map (fun x -> x) node
+
+let to_list node = fold_right (fun d l -> d::l) node []
+
+let of_list lst =
+       match lst with
+               | [] -> raise Empty
+               | h :: t ->
+                       let first = create h in
+                       let rec loop last = function
+                               | [] ->
+                                       last.next <- first;
+                                       first.prev <- last;
+                                       first
+                               | h :: t ->
+                                       let nn = { data = h; next = first; prev = last } in
+                                       last.next <- nn;
+                                       loop nn t
+                       in
+                       loop first t
+
+let enum node =
+       let next e () =
+               if e.valid == false then
+                       raise Enum.No_more_elements
+               else
+                       begin
+                       let rval = e.curr.data in
+                       e.curr <- e.curr.next;
+
+                       if (e.curr == node) then
+                               e.valid <- false;
+                       rval
+                       end
+       and count e () =
+               if e.valid == false then
+                       0
+               else
+                       let rec loop cnt n =
+                               if n == node then
+                                       cnt
+                               else
+                                       loop (cnt + 1) (n.next)
+                       in
+                       loop 1 (e.curr.next)
+       in
+       let rec clone e () =
+               let e' = { curr = e.curr; valid = e.valid } in
+               Enum.make ~next:(next e') ~count:(count e') ~clone:(clone e')
+       in
+       let e = { curr = node; valid = true } in
+       Enum.make ~next:(next e) ~count:(count e) ~clone:(clone e)
+
+let rev_enum node =
+       let prev e () =
+               if e.valid == false then
+                       raise Enum.No_more_elements
+               else
+                       begin
+                       let rval = e.curr.data in
+                       e.curr <- e.curr.prev;
+
+                       if (e.curr == node) then
+                               e.valid <- false;
+                       rval
+                       end
+       and count e () =
+               if e.valid == false then
+                       0
+               else
+                       let rec loop cnt n =
+                               if n == node then
+                                       cnt
+                               else
+                                       loop (cnt + 1) (n.prev)
+                       in
+                       loop 1 (e.curr.prev)
+       in
+       let rec clone e () =
+               let e' = { curr = e.curr; valid = e.valid } in
+               Enum.make ~next:(prev e') ~count:(count e') ~clone:(clone e')
+       in
+       let e = { curr = node; valid = true } in
+       Enum.make ~next:(prev e) ~count:(count e) ~clone:(clone e)
+
+let of_enum enm =
+       match Enum.get enm with
+               | None -> raise Empty
+               | Some(d) ->
+                       let first = create d in
+                       let f d n = append n d in
+                       ignore(Enum.fold f first enm);
+                       first
diff --git a/bundles/extlib/extlib-1.5.2/dllist.mli b/bundles/extlib/extlib-1.5.2/dllist.mli
new file mode 100644 (file)
index 0000000..0e0990e
--- /dev/null
@@ -0,0 +1,182 @@
+(*
+ * Dllist- a mutable, circular, doubly linked list library
+ * Copyright (C) 2004 Brian Hurt, Jesse Guardiani
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** A mutable, imperative, circular, doubly linked list library
+
+    This module implements a doubly linked list in a mutable or imperitive
+    style (changes to the list are visible to all copies of the list).
+*)
+
+
+type 'a node_t (* abstract *)
+
+exception Empty
+
+(** {6 node functions } *)
+
+(** Creates a node.  This is an O(1) operation. *)
+val create : 'a -> 'a node_t
+
+(** Copy the list attached to the given node and return the copy of the given
+    node.  This is an O(N) operation.
+*)
+val copy : 'a node_t -> 'a node_t
+
+(** Returns the length of the list.  This is an O(N) operation. *)
+val length : 'a node_t -> int
+
+(** List reversal.  This is an O(N) operation.
+*)
+val rev : 'a node_t -> unit
+
+(** [add n a] Creates a new node containing data [a] and inserts it into
+    the list after node [n].  This is an O(1) operation.
+*)
+val add : 'a node_t -> 'a -> unit
+
+(** [append n a] Creates a new node containing data [a] and inserts it into
+    the list after node [n]. Returns new node.  This is an O(1) operation.
+*)
+val append : 'a node_t -> 'a -> 'a node_t
+
+(** [prepend n a] Creates a new node containing data [a] and inserts it into
+    the list before node [n]. Returns new node.  This is an O(1) operation.
+*)
+val prepend : 'a node_t -> 'a -> 'a node_t
+
+(** [promote n] Swaps [n] with [next n].  This is an O(1) operation.
+*)
+val promote : 'a node_t -> unit
+
+(** [demote n] Swaps [n] with [prev n].  This is an O(1) operation.
+*)
+val demote : 'a node_t -> unit
+
+(** Remove node from the list no matter where it is.  This is an O(1) operation.
+*)
+val remove : 'a node_t -> unit
+
+(** Remove node from the list no matter where it is. Return next node.  This is
+    an O(1) operation.
+*)
+val drop : 'a node_t -> 'a node_t
+
+(** Remove node from the list no matter where it is. Return previous node.  This
+    is an O(1) operation.
+*)
+val rev_drop : 'a node_t -> 'a node_t
+
+(** [splice n1 n2] Connects [n1] and [n2] so that
+    [next n1 == n2 && prev n2 == n1]. This can be used to connect two discrete
+    lists, or, if used on two nodes within the same list, it can be used to
+    separate the nodes between [n1] and [n2] from the rest of the list. In this
+    case, those nodes become a discrete list by themselves.  This is an O(1)
+    operation.
+*)   
+val splice : 'a node_t -> 'a node_t -> unit
+
+(** Given a node, get the data associated with that node.  This is an
+    O(1) operation.
+*)
+val get : 'a node_t -> 'a
+
+(** Given a node, set the data associated with that node.  This is an O(1)
+    operation.
+*)
+val set : 'a node_t -> 'a -> unit
+
+(** Given a node, get the next element in the list after the node.  
+
+    The list is circular, so the last node of the list returns the first 
+    node of the list as it's next node.
+    
+    This is an O(1) operation.
+*)
+val next : 'a node_t -> 'a node_t
+
+(** Given a node, get the previous element in the list before the node.
+    The list is circular, so the first node of the list returns the
+    last element of the list as it's previous node.
+
+    This is an O(1) operation.
+*)
+val prev : 'a node_t -> 'a node_t
+
+(** [skip n i] Return the node that is [i] nodes after node [n] in the list.
+    If [i] is negative then return the node that is [i] nodes before node [n]
+    in the list.  This is an O(N) operation.
+*)
+val skip : 'a node_t -> int -> 'a node_t
+
+(** [iter f n] Apply [f] to every element in the list, starting at [n].  This
+    is an O(N) operation.
+*)
+val iter : ('a -> unit) -> 'a node_t -> unit
+
+(** Accumulate a value over the entire list.  
+    This works like List.fold_left. This is an O(N) operation.
+*)
+val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b node_t -> 'a
+
+(** Accumulate a value over the entire list.
+    This works like List.fold_right, but since the list is bidirectional,
+    it doesn't suffer the performance problems of List.fold_right.
+    This is an O(N) operation.
+*)
+val fold_right : ('a -> 'b -> 'b) -> 'a node_t -> 'b -> 'b
+
+(** Allocate a new list, with entirely new nodes, whose values are
+    the transforms of the values of the original list.  Note that this
+    does not modify the given list.  This is an O(N) operation.
+*)
+val map : ('a -> 'b) -> 'a node_t -> 'b node_t
+
+
+(** {6 list conversion } *)
+
+(** Converts a dllist to a normal list.  This is an O(N) operation. *)
+val to_list : 'a node_t -> 'a list
+
+(** Converts from a normal list to a Dllist and returns the first node. Raises
+    [Empty] if given list is empty.  This is an O(N) operation.
+*)
+val of_list : 'a list -> 'a node_t
+
+
+(** {6 enums } *)
+
+(** Create an enum of the list.
+    Note that modifying the list while the enum exists will have undefined
+    effects.  This is an O(1) operation.
+*)
+val enum : 'a node_t -> 'a Enum.t
+
+(** Create a reverse enum of the list.
+    Note that modifying the list while the enum exists will have undefined
+    effects.  This is an O(1) operation.
+*)
+val rev_enum : 'a node_t -> 'a Enum.t
+
+(** Create a dllist from an enum.
+    This consumes the enum, and allocates a whole new dllist. Raises
+    [Empty] if given enum is empty.  This is an O(N) operation.
+*)
+val of_enum : 'a Enum.t -> 'a node_t
diff --git a/bundles/extlib/extlib-1.5.2/dynArray.ml b/bundles/extlib/extlib-1.5.2/dynArray.ml
new file mode 100644 (file)
index 0000000..eedc888
--- /dev/null
@@ -0,0 +1,451 @@
+(*
+ * DynArray - Resizeable Ocaml arrays
+ * Copyright (C) 2003 Brian Hurt
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type resizer_t = currslots:int -> oldlength:int -> newlength:int -> int
+
+type 'a intern
+
+external ilen : 'a intern -> int = "%obj_size"
+let idup (x : 'a intern) = if ilen x = 0 then x else (Obj.magic (Obj.dup (Obj.repr x)) : 'a intern)
+let imake tag len = (Obj.magic (Obj.new_block tag len) : 'a intern)
+external iget : 'a intern -> int -> 'a = "%obj_field"
+external iset : 'a intern -> int -> 'a -> unit = "%obj_set_field"
+
+type 'a t = {
+       mutable arr : 'a intern;
+       mutable len : int;
+       mutable resize: resizer_t;
+}
+
+exception Invalid_arg of int * string * string
+
+let invalid_arg n f p = raise (Invalid_arg (n,f,p))
+
+let length d = d.len
+
+let exponential_resizer ~currslots ~oldlength ~newlength =
+       let rec doubler x = if x >= newlength then x else doubler (x * 2) in
+       let rec halfer x = if x / 2 < newlength then x else halfer (x / 2) in
+       if newlength = 1 then
+               1
+       else if currslots = 0 then
+               doubler 1
+       else if currslots < newlength then
+               doubler currslots
+       else
+               halfer currslots
+
+let step_resizer step =
+       if step <= 0 then invalid_arg step "step_resizer" "step";
+       (fun ~currslots ~oldlength ~newlength ->
+               if currslots < newlength || newlength < (currslots - step)
+               then
+                  (newlength + step - (newlength mod step))
+               else
+                       currslots)
+
+let conservative_exponential_resizer ~currslots ~oldlength ~newlength =
+       let rec doubler x = if x >= newlength then x else doubler (x * 2) in
+       let rec halfer x = if x / 2 < newlength then x else halfer (x / 2) in
+       if currslots < newlength then begin
+               if newlength = 1 then
+                       1
+               else if currslots = 0 then
+                       doubler 1
+               else
+                       doubler currslots
+       end else if oldlength < newlength then
+               halfer currslots
+       else
+               currslots
+
+let default_resizer = conservative_exponential_resizer
+
+let changelen (d : 'a t) newlen =
+       if newlen > Sys.max_array_length then invalid_arg newlen "changelen" "newlen";
+
+       let oldsize = ilen d.arr in
+       let r = d.resize
+                       ~currslots:oldsize
+                       ~oldlength:d.len
+                       ~newlength:newlen
+       in
+       (* We require the size to be at least large enough to hold the number
+        * of elements we know we need!
+        * Also be sure not to exceed max_array_length
+        *)
+       let newsize = if r < newlen then newlen else min Sys.max_array_length r in
+       if newsize <> oldsize then begin
+               let newarr = imake 0 newsize in
+               let cpylen = (if newlen < d.len then newlen else d.len) in
+               for i = 0 to cpylen - 1 do
+                       iset newarr i (iget d.arr i);
+               done;
+               d.arr <- newarr;
+       end;
+       d.len <- newlen
+
+let compact d =
+       if d.len <> ilen d.arr then begin
+               let newarr = imake 0 d.len in
+               for i = 0 to d.len - 1 do
+                       iset newarr i (iget d.arr i)
+               done;
+               d.arr <- newarr;
+       end
+
+let create() =
+       {
+               resize = default_resizer;
+               len = 0;
+               arr = imake 0 0;
+       }
+
+let make initsize =
+       if initsize < 0 then invalid_arg initsize "make" "size";
+       {
+               resize = default_resizer;
+               len = 0;
+               arr = imake 0 initsize;
+       }
+
+let init initlen f =
+       if initlen < 0 then invalid_arg initlen "init" "len";
+       let arr = imake 0 initlen in
+       for i = 0 to initlen-1 do
+               iset arr i (f i)
+       done;
+       {
+               resize = default_resizer;
+               len = initlen;
+               arr = arr;
+       }
+
+let set_resizer d resizer =
+       d.resize <- resizer
+
+let get_resizer d =
+       d.resize
+
+let empty d =
+       d.len = 0
+
+let get d idx =
+       if idx < 0 || idx >= d.len then invalid_arg idx "get" "index";
+       iget d.arr idx
+
+let last d =
+       if d.len = 0 then invalid_arg 0 "last" "<array len is 0>";
+       iget d.arr (d.len - 1)
+
+let set d idx v =
+       if idx < 0 || idx >= d.len then         invalid_arg idx "set" "index";
+       iset d.arr idx v
+
+let insert d idx v =
+       if idx < 0 || idx > d.len then invalid_arg idx "insert" "index";
+       if d.len = ilen d.arr then changelen d (d.len + 1) else d.len <- d.len + 1;
+       if idx < d.len - 1 then begin
+               for i = d.len - 2 downto idx do
+                       iset d.arr (i+1) (iget d.arr i)
+               done;
+       end;
+       iset d.arr idx v
+
+let add d v =
+       if d.len = ilen d.arr then changelen d (d.len + 1) else d.len <- d.len + 1;
+       iset d.arr (d.len - 1) v
+
+let delete d idx =
+       if idx < 0 || idx >= d.len then invalid_arg idx "delete" "index";
+       let oldsize = ilen d.arr in
+       (* we don't call changelen because we want to blit *)
+       let r = d.resize
+               ~currslots:oldsize
+               ~oldlength:d.len
+               ~newlength:(d.len - 1)
+       in
+       let newsize = (if r < d.len - 1 then d.len - 1 else r) in
+       if oldsize <> newsize then begin
+               let newarr = imake 0 newsize in
+               for i = 0 to idx - 1 do
+                       iset newarr i (iget d.arr i);
+               done;
+               for i = idx to d.len - 2 do
+                       iset newarr i (iget d.arr (i+1));
+               done;
+               d.arr <- newarr;
+       end else begin
+               for i = idx to d.len - 2 do
+                       iset d.arr i (iget d.arr (i+1));
+               done;
+               iset d.arr (d.len - 1) (Obj.magic 0)
+       end;
+       d.len <- d.len - 1
+
+
+let delete_range d idx len =
+       if len < 0 then invalid_arg len "delete_range" "length";
+       if idx < 0 || idx + len > d.len then invalid_arg idx "delete_range" "index";
+       let oldsize = ilen d.arr in
+       (* we don't call changelen because we want to blit *)
+       let r = d.resize
+               ~currslots:oldsize
+               ~oldlength:d.len
+               ~newlength:(d.len - len)
+       in
+       let newsize = (if r < d.len - len then d.len - len else r) in
+       if oldsize <> newsize then begin
+               let newarr = imake 0 newsize in
+               for i = 0 to idx - 1 do
+                       iset newarr i (iget d.arr i);
+               done;
+               for i = idx to d.len - len - 1 do
+                       iset newarr i (iget d.arr (i+len));
+               done;
+               d.arr <- newarr;
+       end else begin
+               for i = idx to d.len - len - 1 do
+                       iset d.arr i (iget d.arr (i+len));
+               done;
+               for i = d.len - len to d.len - 1 do
+                       iset d.arr i (Obj.magic 0)
+               done;
+       end;
+       d.len <- d.len - len
+
+let clear d =
+       d.len <- 0;
+       d.arr <- imake 0 0
+
+let delete_last d =
+       if d.len <= 0 then invalid_arg 0 "delete_last" "<array len is 0>";
+       (* erase for GC, in case changelen don't resize our array *)
+       iset d.arr (d.len - 1) (Obj.magic 0);
+       changelen d (d.len - 1)
+
+let rec blit src srcidx dst dstidx len =
+       if len < 0 then invalid_arg len "blit" "len";
+       if srcidx < 0 || srcidx + len > src.len then invalid_arg srcidx "blit" "source index";
+       if dstidx < 0 || dstidx > dst.len then invalid_arg dstidx "blit" "dest index";
+       let newlen = dstidx + len in
+       if newlen > ilen dst.arr then begin
+               (* this case could be inlined so we don't blit on just-copied elements *)
+               changelen dst newlen
+       end else begin
+               if newlen > dst.len then dst.len <- newlen;
+       end;
+       (* same array ! we need to copy in reverse order *)
+       if src.arr == dst.arr && dstidx > srcidx then
+               for i = len - 1 downto 0 do
+                       iset dst.arr (dstidx+i) (iget src.arr (srcidx+i));
+               done
+       else
+               for i = 0 to len - 1 do
+                       iset dst.arr (dstidx+i) (iget src.arr (srcidx+i));
+               done
+
+let append src dst =
+       blit src 0 dst dst.len src.len
+
+let to_list d =
+       let rec loop idx accum =
+               if idx < 0 then accum else loop (idx - 1) (iget d.arr idx :: accum)
+       in
+       loop (d.len - 1) []
+
+let to_array d =
+       if d.len = 0 then begin
+               (* since the empty array is an atom, we don't care if float or not *)
+               [||]
+       end else begin
+               let arr = Array.make d.len (iget d.arr 0) in
+               for i = 1 to d.len - 1 do
+                       Array.unsafe_set arr i (iget d.arr i)
+               done;
+               arr;
+       end
+
+let of_list lst =
+       let size = List.length lst in
+       let arr = imake 0 size in
+       let rec loop idx =  function
+               | h :: t -> iset arr idx h; loop (idx + 1) t
+               | [] -> ()
+       in
+       loop 0 lst;
+       {
+               resize = default_resizer;
+               len = size;
+               arr = arr;
+       }
+
+let of_array src =
+       let size = Array.length src in
+       let is_float = Obj.tag (Obj.repr src) = Obj.double_array_tag in
+       let arr = (if is_float then begin
+                       let arr = imake 0 size in
+                       for i = 0 to size - 1 do
+                               iset arr i (Array.unsafe_get src i);
+                       done;
+                       arr
+               end else
+                       (* copy the fields *)
+                       idup (Obj.magic src : 'a intern))
+       in
+       {
+               resize = default_resizer;
+               len = size;
+               arr = arr;
+       }
+
+let copy src =
+       {
+               resize = src.resize;
+               len = src.len;
+               arr = idup src.arr;
+       }
+
+let sub src start len =
+       if len < 0 then invalid_arg len "sub" "len";
+       if start < 0 || start + len > src.len then invalid_arg start "sub" "start";
+       let arr = imake 0 len in
+       for i = 0 to len - 1 do
+               iset arr i (iget src.arr (i+start));
+       done;
+       {
+               resize = src.resize;
+               len = len;
+               arr = arr;
+       }
+
+let iter f d =
+       for i = 0 to d.len - 1 do
+               f (iget d.arr i)
+       done
+
+let iteri f d =
+       for i = 0 to d.len - 1 do
+               f i (iget d.arr i)
+       done
+
+let filter f d =
+       let l = d.len in
+       let a = imake 0 l in
+       let a2 = d.arr in
+       let p = ref 0 in
+       for i = 0 to l - 1 do
+               let x = iget a2 i in
+               if f x then begin
+                       iset a !p x;
+                       incr p;
+               end;
+       done;
+       d.len <- !p;
+       d.arr <- a
+
+let index_of f d =
+       let rec loop i =
+               if i >= d.len then
+                       raise Not_found
+               else
+                       if f (iget d.arr i) then
+                               i
+                       else
+                               loop (i+1)
+       in
+       loop 0
+
+let map f src =
+       let arr = imake 0 src.len in
+       for i = 0 to src.len - 1 do
+               iset arr i (f (iget src.arr i))
+       done;
+       {
+               resize = src.resize;
+               len = src.len;
+               arr = arr;
+       }
+
+let mapi f src =
+       let arr = imake 0 src.len in
+       for i = 0 to src.len - 1 do
+               iset arr i (f i (iget src.arr i))
+       done;
+       {
+               resize = src.resize;
+               len = src.len;
+               arr = arr;
+       }
+
+let fold_left f x a =
+       let rec loop idx x =
+               if idx >= a.len then x else loop (idx + 1) (f x (iget a.arr idx))
+       in
+       loop 0 x
+
+let fold_right f a x =
+       let rec loop idx x =
+               if idx < 0 then x
+               else loop (idx - 1) (f (iget a.arr idx) x)
+       in
+       loop (a.len - 1) x
+
+let enum d =
+       let rec make start =
+               let idxref = ref 0 in
+               let next () =
+                       if !idxref >= d.len then
+                               raise Enum.No_more_elements
+                       else
+                               let retval = iget d.arr !idxref in
+                               incr idxref;
+                               retval
+               and count () =
+                       if !idxref >= d.len then 0
+                       else d.len - !idxref
+               and clone () =
+                       make !idxref
+               in
+               Enum.make ~next:next ~count:count ~clone:clone
+       in
+       make 0
+
+let of_enum e =
+       if Enum.fast_count e then begin
+               let c = Enum.count e in
+               let arr = imake 0 c in
+               Enum.iteri (fun i x -> iset arr i x) e;
+               {
+                       resize = default_resizer;
+                       len = c;
+                       arr = arr;
+               }
+       end else
+               let d = make 0 in
+               Enum.iter (add d) e;
+               d
+
+let unsafe_get a n =
+       iget a.arr n
+
+let unsafe_set a n x =
+       iset a.arr n x
diff --git a/bundles/extlib/extlib-1.5.2/dynArray.mli b/bundles/extlib/extlib-1.5.2/dynArray.mli
new file mode 100644 (file)
index 0000000..dbd1f6a
--- /dev/null
@@ -0,0 +1,281 @@
+(*
+ * DynArray - Resizeable Ocaml arrays
+ * Copyright (C) 2003 Brian Hurt
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Dynamic arrays.
+
+   A dynamic array is equivalent to a OCaml array that will resize itself
+   when elements are added or removed, except that floats are boxed and
+   that no initialization element is required.
+*)
+
+type 'a t
+
+exception Invalid_arg of int * string * string
+(** When an operation on an array fails, [Invalid_arg] is raised. The
+       integer is the value that made the operation fail, the first string
+       contains the function name that has been called and the second string
+       contains the parameter name that made the operation fail.
+*)
+
+(** {6 Array creation} *)
+
+val create : unit -> 'a t
+(** [create()] returns a new empty dynamic array. *)
+
+val make : int -> 'a t
+(** [make count] returns an array with some memory already allocated so
+       up to [count] elements can be stored into it without resizing. *)
+
+val init : int -> (int -> 'a) -> 'a t
+(** [init n f] returns an array of [n] elements filled with values
+       returned by [f 0 , f 1, ... f (n-1)]. *)
+
+(** {6 Array manipulation functions} *)
+
+val empty : 'a t -> bool
+(** Return true if the number of elements in the array is 0. *)
+
+val length : 'a t -> int
+(** Return the number of elements in the array. *)
+
+val get : 'a t -> int -> 'a
+(** [get darr idx] gets the element in [darr] at index [idx]. If [darr] has
+       [len] elements in it, then the valid indexes range from [0] to [len-1]. *)
+
+val last : 'a t -> 'a
+(** [last darr] returns the last element of [darr]. *)
+
+val set : 'a t -> int -> 'a -> unit
+(** [set darr idx v] sets the element of [darr] at index [idx] to value
+       [v].  The previous value is overwritten. *)
+
+val insert : 'a t -> int -> 'a -> unit
+(** [insert darr idx v] inserts [v] into [darr] at index [idx].  All elements
+       of [darr] with an index greater than or equal to [idx] have their
+       index incremented (are moved up one place) to make room for the new
+       element. *)
+
+val add : 'a t -> 'a -> unit
+(** [add darr v] appends [v] onto [darr].  [v] becomes the new
+       last element of [darr]. *)
+
+val append : 'a t -> 'a t -> unit
+(** [append src dst] adds all elements of [src] to the end of [dst]. *)
+
+val delete : 'a t -> int -> unit
+(** [delete darr idx] deletes the element of [darr] at [idx].  All elements
+       with an index greater than [idx] have their index decremented (are
+       moved down one place) to fill in the hole. *)
+
+val delete_last : 'a t -> unit
+(** [delete_last darr] deletes the last element of [darr]. This is equivalent
+       of doing [delete darr ((length darr) - 1)]. *)
+
+val delete_range : 'a t -> int -> int -> unit
+(** [delete_range darr p len] deletes [len] elements starting at index [p].
+       All elements with an index greater than [p+len] are moved to fill
+       in the hole. *)
+
+val clear : 'a t -> unit
+(** remove all elements from the array and resize it to 0. *)
+
+val blit : 'a t -> int -> 'a t -> int -> int -> unit
+(** [blit src srcidx dst dstidx len] copies [len] elements from [src]
+       starting with index [srcidx] to [dst] starting at [dstidx]. *)
+
+val compact : 'a t -> unit
+(** [compact darr] ensures that the space allocated by the array is minimal.*)
+
+(** {6 Array copy and conversion} *)
+
+val to_list : 'a t -> 'a list
+(** [to_list darr] returns the elements of [darr] in order as a list. *)
+
+val to_array : 'a t -> 'a array
+(** [to_array darr] returns the elements of [darr] in order as an array. *)
+
+val enum : 'a t -> 'a Enum.t
+(** [enum darr] returns the enumeration of [darr] elements. *)
+
+val of_list : 'a list -> 'a t
+(** [of_list lst] returns a dynamic array with the elements of [lst] in
+       it in order. *)
+
+val of_array : 'a array -> 'a t
+(** [of_array arr] returns an array with the elements of [arr] in it
+       in order. *)
+
+val of_enum : 'a Enum.t -> 'a t
+(** [of_enum e] returns an array that holds, in order, the elements of [e]. *)
+
+val copy : 'a t -> 'a t
+(** [copy src] returns a fresh copy of [src], such that no modification of
+       [src] affects the copy, or vice versa (all new memory is allocated for
+       the copy).   *)
+
+val sub : 'a t -> int -> int -> 'a t
+(** [sub darr start len] returns an array holding the subset of [len]
+       elements from [darr] starting with the element at index [idx]. *)
+
+(** {6 Array functional support} *)
+
+val iter : ('a -> unit) -> 'a t -> unit
+(** [iter f darr] calls the function [f] on every element of [darr].  It
+       is equivalent to [for i = 0 to length darr - 1 do f (get darr i) done;] *)
+
+val iteri : (int -> 'a -> unit) -> 'a t -> unit
+(** [iteri f darr] calls the function [f] on every element of [darr].  It
+       is equivalent to [for i = 0 to length darr - 1 do f i (get darr i) done;]
+       *)
+
+val map : ('a -> 'b) -> 'a t -> 'b t
+(** [map f darr] applies the function [f] to every element of [darr]
+       and creates a dynamic array from the results - similar to [List.map] or
+       [Array.map]. *)
+
+val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
+(** [mapi f darr] applies the function [f] to every element of [darr]
+       and creates a dynamic array from the results - similar to [List.mapi] or
+       [Array.mapi]. *)
+
+val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
+(** [fold_left f x darr] computes
+       [f ( ... ( f ( f (get darr 0) x) (get darr 1) ) ... ) (get darr n-1)],
+       similar to [Array.fold_left] or [List.fold_left]. *)
+
+val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+(** [fold_right f darr x] computes
+       [ f (get darr 0) (f (get darr 1) ( ... ( f (get darr n-1) x ) ... ) ) ]
+       similar to [Array.fold_right] or [List.fold_right]. *)
+
+val index_of : ('a -> bool) -> 'a t -> int
+(** [index_of f darr] returns the index of the first element [x] in darr such
+       as [f x] returns [true] or raise [Not_found] if not found. *)
+
+val filter : ('a -> bool) -> 'a t -> unit
+
+(** {6 Array resizers} *)
+
+type resizer_t = currslots:int -> oldlength:int -> newlength:int -> int
+(** The type of a resizer function.
+
+       Resizer functions are called whenever elements are added to
+       or removed from the dynamic array to determine what the current number of
+       storage spaces in the array should be.  The three named arguments
+       passed to a resizer are the current number of storage spaces in
+       the array, the length of the array before the elements are
+       added or removed, and the length the array will be after the
+       elements are added or removed.  If elements are being added, newlength
+       will be larger than oldlength, if elements are being removed,
+       newlength will be smaller than oldlength. If the resizer function
+       returns exactly oldlength, the size of the array is only changed when
+       adding an element while there is not enough space for it.
+
+       By default, all dynamic arrays are created with the [default_resizer].
+       When a dynamic array is created from another dynamic array (using [copy],
+       [map] , etc. ) the resizer of the copy will be the same as the original
+       dynamic array resizer. To change the resizer, use the [set_resizer]
+       function.
+*)
+
+val set_resizer : 'a t -> resizer_t -> unit
+(** Change the resizer for this array. *)
+
+val get_resizer : 'a t -> resizer_t
+(** Get the current resizer function for a given array *)
+
+val default_resizer : resizer_t
+(** The default resizer function the library is using - in this version
+       of DynArray, this is the [exponential_resizer] but should change in
+       next versions. *)
+
+val exponential_resizer : resizer_t
+(** The exponential resizer- The default resizer except when the resizer
+       is being copied from some other darray.
+
+       [exponential_resizer] works by doubling or halving the number of
+       slots until they "fit".  If the number of slots is less than the
+       new length, the number of slots is doubled until it is greater
+       than the new length (or Sys.max_array_size is reached).
+
+       If the number of slots is more than four times the new length,
+       the number of slots is halved until it is less than four times the
+       new length.
+
+       Allowing darrays to fall below 25% utilization before shrinking them
+       prevents "thrashing".  Consider the case where the caller is constantly
+       adding a few elements, and then removing a few elements, causing
+       the length to constantly cross above and below a power of two.
+       Shrinking the array when it falls below 50% would causing the
+       underlying array to be constantly allocated and deallocated.
+       A few elements would be added, causing the array to be reallocated
+       and have a usage of just above 50%.  Then a few elements would be
+       remove, and the array would fall below 50% utilization and be
+       reallocated yet again.  The bulk of the array, untouched, would be
+       copied and copied again.  By setting the threshold at 25% instead,
+       such "thrashing" only occurs with wild swings- adding and removing
+       huge numbers of elements (more than half of the elements in the array).
+
+       [exponential_resizer] is a good performing resizer for most
+       applications.  A list allocates 2 words for every element, while an
+       array (with large numbers of elements) allocates only 1 word per
+       element (ignoring unboxed floats).  On insert, [exponential_resizer]
+       keeps the amount of wasted "extra" array elements below 50%, meaning
+       that less than 2 words per element are used.  Even on removals
+       where the amount of wasted space is allowed to rise to 75%, that
+       only means that darray is using 4 words per element.  This is
+       generally not a significant overhead.
+
+       Furthermore, [exponential_resizer] minimizes the number of copies
+       needed- appending n elements into an empty darray with initial size
+       0 requires between n and 2n elements of the array be copied- O(n)
+       work, or O(1) work per element (on average).  A similar argument
+       can be made that deletes from the end of the array are O(1) as
+       well (obviously deletes from anywhere else are O(n) work- you
+       have to move the n or so elements above the deleted element down).
+
+*)
+
+val step_resizer : int -> resizer_t
+(** The stepwise resizer- another example of a resizer function, this
+       time of a parameterized resizer.
+
+       The resizer returned by [step_resizer step] returns the smallest
+       multiple of [step] larger than [newlength] if [currslots] is less
+       then [newlength]-[step] or greater than [newlength].
+
+       For example, to make an darray with a step of 10, a length
+       of len, and a null of null, you would do:
+       [make] ~resizer:([step_resizer] 10) len null
+*)
+
+val conservative_exponential_resizer : resizer_t
+(** [conservative_exponential_resizer] is an example resizer function
+       which uses the oldlength parameter.  It only shrinks the array
+       on inserts- no deletes shrink the array, only inserts.  It does
+       this by comparing the oldlength and newlength parameters.  Other
+       than that, it acts like [exponential_resizer].
+*)
+
+(** {6 Unsafe operations} **)
+
+val unsafe_get : 'a t -> int -> 'a
+val unsafe_set : 'a t -> int -> 'a -> unit
diff --git a/bundles/extlib/extlib-1.5.2/enum.ml b/bundles/extlib/extlib-1.5.2/enum.ml
new file mode 100644 (file)
index 0000000..3b7708d
--- /dev/null
@@ -0,0 +1,376 @@
+(* 
+ * Enum - Enumeration over abstract collection of elements.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type 'a t = {
+       mutable count : unit -> int;
+       mutable next : unit -> 'a;
+       mutable clone : unit -> 'a t;
+       mutable fast : bool;
+}
+
+(* raised by 'next' functions, should NOT go outside the API *)
+exception No_more_elements
+
+let _dummy () = assert false
+
+let make ~next ~count ~clone =
+       {
+               count = count;
+               next = next;
+               clone = clone;
+               fast = true;
+       }
+
+let rec init n f =
+       if n < 0 then invalid_arg "Enum.init";
+       let count = ref n in
+       {
+               count = (fun () -> !count);
+               next = (fun () ->
+                       match !count with
+                       | 0 -> raise No_more_elements
+                       | _ ->
+                               decr count;
+                               f (n - 1 - !count));
+               clone = (fun () -> init !count f);
+               fast = true;
+       }                       
+
+let rec empty () =
+       {
+               count = (fun () -> 0);
+               next = (fun () -> raise No_more_elements);
+               clone = (fun () -> empty());
+               fast = true;
+       }
+
+type 'a _mut_list = {
+       hd : 'a;
+       mutable tl : 'a _mut_list;
+}
+
+let force t =
+       let rec clone enum count =
+               let enum = ref !enum
+               and     count = ref !count in
+               {
+                       count = (fun () -> !count);
+                       next = (fun () ->
+                               match !enum with
+                               | [] -> raise No_more_elements
+                               | h :: t -> decr count; enum := t; h);
+                       clone = (fun () ->
+                               let enum = ref !enum
+                               and count = ref !count in
+                               clone enum count);
+                       fast = true;
+               }
+       in
+       let count = ref 0 in
+       let _empty = Obj.magic [] in
+       let rec loop dst =
+               let x = { hd = t.next(); tl = _empty } in
+               incr count;
+               dst.tl <- x;
+               loop x
+       in
+       let enum = ref _empty  in 
+       (try
+               enum := { hd = t.next(); tl = _empty };
+               incr count;
+               loop !enum;
+       with No_more_elements -> ());
+       let tc = clone (Obj.magic enum) count in
+       t.clone <- tc.clone;
+       t.next <- tc.next;
+       t.count <- tc.count;
+       t.fast <- true
+
+let from f =
+       let e = {
+               next = f;
+               count = _dummy;
+               clone = _dummy;
+               fast = false;
+       } in
+       e.count <- (fun () -> force e; e.count());
+       e.clone <- (fun () -> force e; e.clone());
+       e
+
+let from2 next clone =
+       let e = {
+               next = next;
+               count = _dummy;
+               clone = clone;
+               fast = false;
+       } in
+       e.count <- (fun () -> force e; e.count());
+       e
+
+let get t =
+       try
+               Some (t.next())
+       with
+               No_more_elements -> None
+
+let push t e =
+       let rec make t =
+               let fnext = t.next in
+               let fcount = t.count in
+               let fclone = t.clone in
+               let next_called = ref false in
+               t.next <- (fun () ->
+                       next_called := true;
+                       t.next <- fnext;
+                       t.count <- fcount;
+                       t.clone <- fclone;
+                       e);
+               t.count <- (fun () ->
+                       let n = fcount() in
+                       if !next_called then n else n+1);
+               t.clone <- (fun () ->
+                       let tc = fclone() in
+                       if not !next_called then make tc;
+                       tc);
+       in
+       make t
+
+let peek t =
+       match get t with
+       | None -> None
+       | Some x ->
+               push t x;
+               Some x
+
+let junk t =
+       try
+               ignore(t.next())
+       with
+               No_more_elements -> ()
+
+let is_empty t =
+       if t.fast then
+               t.count() = 0
+       else
+               peek t = None
+
+let count t =
+       t.count()
+
+let fast_count t =
+       t.fast
+
+let clone t =
+       t.clone()
+
+let iter f t =
+       let rec loop () =
+               f (t.next());
+               loop();
+       in
+       try
+               loop();
+       with
+               No_more_elements -> ()
+
+let iteri f t =
+       let rec loop idx =
+               f idx (t.next());
+               loop (idx+1);
+       in
+       try
+               loop 0;
+       with
+               No_more_elements -> ()
+
+let iter2 f t u =
+       let push_t = ref None in
+       let rec loop () =
+               push_t := None;
+               let e = t.next() in
+               push_t := Some e;
+               f e (u.next());
+               loop ()
+       in
+       try
+               loop ()
+       with
+               No_more_elements ->
+                       match !push_t with
+                       | None -> ()
+                       | Some e ->
+                               push t e
+
+let iter2i f t u =
+       let push_t = ref None in
+       let rec loop idx =
+               push_t := None;
+               let e = t.next() in
+               push_t := Some e;
+               f idx e (u.next());
+               loop (idx + 1)
+       in
+       try
+               loop 0
+       with
+               No_more_elements ->
+                       match !push_t with
+                       | None -> ()
+                       | Some e -> push t e
+
+let fold f init t =
+       let acc = ref init in
+       let rec loop() =
+               acc := f (t.next()) !acc;
+               loop()
+       in
+       try
+               loop()
+       with
+               No_more_elements -> !acc
+
+let foldi f init t =
+       let acc = ref init in
+       let rec loop idx =
+               acc := f idx (t.next()) !acc;
+               loop (idx + 1)
+       in
+       try
+               loop 0
+       with
+               No_more_elements -> !acc
+
+let fold2 f init t u =
+       let acc = ref init in
+       let push_t = ref None in
+       let rec loop() =
+               push_t := None;
+               let e = t.next() in
+               push_t := Some e;
+               acc := f e (u.next()) !acc;
+               loop()
+       in
+       try
+               loop()
+       with
+               No_more_elements ->
+                       match !push_t with
+                       | None -> !acc
+                       | Some e ->
+                               push t e;
+                               !acc
+
+let fold2i f init t u =
+       let acc = ref init in
+       let push_t = ref None in
+       let rec loop idx =
+               push_t := None;
+               let e = t.next() in
+               push_t := Some e;
+               acc := f idx e (u.next()) !acc;
+               loop (idx + 1)
+       in
+       try
+               loop 0
+       with
+               No_more_elements ->
+                       match !push_t with
+                       | None -> !acc
+                       | Some e ->
+                               push t e;
+                               !acc
+
+let find f t =
+       let rec loop () =
+               let x = t.next() in
+               if f x then x else loop()
+       in
+       try
+               loop()
+       with
+               No_more_elements -> raise Not_found
+
+let rec map f t =
+       {
+               count = t.count;
+               next = (fun () -> f (t.next()));
+               clone = (fun () -> map f (t.clone()));
+               fast = t.fast;
+       }
+
+let rec mapi f t =
+       let idx = ref (-1) in
+       {
+               count = t.count;
+               next = (fun () -> incr idx; f !idx (t.next()));
+               clone = (fun () -> mapi f (t.clone()));
+               fast = t.fast;
+       }
+
+let rec filter f t =
+       let rec next() =
+               let x = t.next() in
+               if f x then x else next()
+       in
+       from2 next (fun () -> filter f (t.clone()))
+
+let rec filter_map f t =
+    let rec next () =
+        match f (t.next()) with
+        | None -> next()
+        | Some x -> x
+    in
+       from2 next (fun () -> filter_map f (t.clone()))
+
+let rec append ta tb = 
+       let t = {
+               count = (fun () -> ta.count() + tb.count());
+               next = _dummy;
+               clone = (fun () -> append (ta.clone()) (tb.clone()));
+               fast = ta.fast && tb.fast;
+       } in
+       t.next <- (fun () ->
+               try
+                       ta.next()
+               with
+                       No_more_elements ->
+                               (* add one indirection because tb can mute *)
+                               t.next <- (fun () -> tb.next());
+                               t.count <- (fun () -> tb.count());
+                               t.clone <- (fun () -> tb.clone());
+                               t.fast <- tb.fast;
+                               t.next()
+       );
+       t
+
+let rec concat t =
+       let concat_ref = ref _dummy in
+       let rec concat_next() =
+               let tn = t.next() in
+               concat_ref := (fun () ->
+                       try
+                               tn.next()
+                       with
+                               No_more_elements ->
+                                       concat_next());
+               !concat_ref ()
+       in
+       concat_ref := concat_next;
+       from2 (fun () -> !concat_ref ()) (fun () -> concat (t.clone()))
diff --git a/bundles/extlib/extlib-1.5.2/enum.mli b/bundles/extlib/extlib-1.5.2/enum.mli
new file mode 100644 (file)
index 0000000..5ab6fbf
--- /dev/null
@@ -0,0 +1,201 @@
+(* 
+ * Enum - enumeration over abstract collection of elements.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Enumeration over abstract collection of elements.
+
+ Enumerations are entirely functional and most of the operations do not
+ actually require the allocation of data structures. Using enumerations
+ to manipulate data is therefore efficient and simple. All data structures in
+ ExtLib such as lists, arrays, etc. have support to convert from and to
+ enumerations.
+*)
+
+
+type 'a t
+
+(** {6 Final functions}
+
+ These functions consume the enumeration until
+ it ends or an exception is raised by the first
+ argument function.
+*)
+
+val iter : ('a -> unit) -> 'a t -> unit
+(** [iter f e] calls the function [f] with each elements of [e] in turn. *)
+
+val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit
+(** [iter2 f e1 e2] calls the function [f] with the next elements of [e] and
+ [e2] repeatedly until one of the two enumerations ends. *)
+
+val fold : ('a -> 'b -> 'b) -> 'b -> 'a t -> 'b
+(** [fold f v e] returns [v] if [e] is empty,
+  otherwise [f aN (... (f a2 (f a1 v)) ...)] where a1..N are
+  the elements of [e]. 
+*)
+
+val fold2 : ('a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c
+(** [fold2] is similar to [fold] but will fold over two enumerations at the
+ same time until one of the two enumerations ends. *)
+
+(** Indexed functions : these functions are similar to previous ones
+ except that they call the function with one additional argument which
+ is an index starting at 0 and incremented after each call to the function. *)
+
+val iteri : (int -> 'a -> unit) -> 'a t -> unit
+
+val iter2i : ( int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
+
+val foldi : (int -> 'a -> 'b -> 'b) -> 'b -> 'a t -> 'b
+
+val fold2i : (int -> 'a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c
+
+(** {6 Useful functions} *)
+
+val find : ('a -> bool) -> 'a t -> 'a
+(** [find f e] returns the first element [x] of [e] such that [f x] returns
+ [true], consuming the enumeration up to and including the
+ found element, or, raises [Not_found] if no such element exists
+ in the enumeration, consuming the whole enumeration in the search.
+
+ Since [find] consumes a prefix of the enumeration, it can be used several 
+ times on the same enumeration to find the next element. *)
+
+val is_empty : 'a t -> bool
+(** [is_empty e] returns true if [e] does not contains any element. *)
+
+val peek : 'a t -> 'a option
+(** [peek e] returns [None] if [e] is empty or [Some x] where [x] is
+ the next element of [e]. The element is not removed from the enumeration. *)
+
+val get : 'a t -> 'a option
+(** [get e] returns [None] if [e] is empty or [Some x] where [x] is
+  the next element of [e], in which case the element is removed from the enumeration. *)
+
+val push : 'a t -> 'a -> unit
+(** [push e x] will add [x] at the beginning of [e]. *)
+
+val junk : 'a t -> unit
+(** [junk e] removes the first element from the enumeration, if any. *)
+
+val clone : 'a t -> 'a t
+(** [clone e] creates a new enumeration that is copy of [e]. If [e]
+ is consumed by later operations, the clone will not get affected. *)
+
+val force : 'a t -> unit
+(** [force e] forces the application of all lazy functions and the
+ enumeration of all elements, exhausting the enumeration. 
+  An efficient intermediate data structure
+  of enumerated elements is constructed and [e] will now enumerate over
+  that data structure. *)
+
+(** {6 Lazy constructors}
+
+ These functions are lazy which means that they will create a new modified
+ enumeration without actually enumerating any element until they are asked
+ to do so by the programmer (using one of the functions above).
+ When the resulting enumerations of these functions are consumed, the
+ underlying enumerations they were created from are also consumed. *)
+
+val map : ('a -> 'b) -> 'a t -> 'b t
+(** [map f e] returns an enumeration over [(f a1, f a2, ... , f aN)] where
+ a1...N are the elements of [e]. *)
+
+val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
+(** [mapi] is similar to [map] except that [f] is passed one extra argument
+ which is the index of the element in the enumeration, starting from 0. *)
+
+val filter : ('a -> bool) -> 'a t -> 'a t
+(** [filter f e] returns an enumeration over all elements [x] of [e] such
+ as [f x] returns [true]. *)
+
+val filter_map : ('a -> 'b option) -> 'a t -> 'b t
+(** [filter_map f e] returns an enumeration over all elements [x] such as
+ [f y] returns [Some x] , where [y] is an element of [e]. *)
+
+val append : 'a t -> 'a t -> 'a t
+(** [append e1 e2] returns an enumeration that will enumerate over all
+ elements of [e1] followed by all elements of [e2]. *)
+
+val concat : 'a t t -> 'a t
+(** [concat e] returns an enumeration over all elements of all enumerations
+ of [e]. *)
+
+(** {6 Constructors} 
+
+ In this section the word {i shall} denotes a semantic
+ requirement. The correct operation
+ of the functions in this interface are conditional
+ on the client meeting these requirements.
+*)
+
+exception No_more_elements
+(** This exception {i shall} be raised by the [next] function of [make] 
+  or [from] when no more elements can be enumerated, it {i shall not}
+  be raised by any function which is an argument to any
+  other function specified in the interface.
+*)
+
+val empty : unit -> 'a t
+(** The empty enumeration : contains no element *)
+
+val make : next:(unit -> 'a) -> count:(unit -> int) -> clone:(unit -> 'a t) -> 'a t
+(** This function creates a fully defined enumeration.
+       {ul {li the [next] function {i shall} return the next element of the
+       enumeration or raise [No_more_elements] if the underlying data structure
+       does not have any more elements to enumerate.}
+       {li the [count] function {i shall} return the actual number of remaining
+       elements in the enumeration.}
+       {li the [clone] function {i shall} create a clone of the enumeration
+       such as operations on the original enumeration will not affect the
+       clone. }}
+       For some samples on how to correctly use [make], you can have a look
+               at implementation of [ExtList.enum]. 
+*)
+
+val from : (unit -> 'a) -> 'a t
+(** [from next] creates an enumeration from the [next] function.
+ [next] {i shall} return the next element of the enumeration or raise
+ [No_more_elements] when no more elements can be enumerated. Since the
+ enumeration definition is incomplete, a call to [clone] or [count] will
+ result in a call to [force] that will enumerate all elements in order to
+ return a correct value. *)
+
+val init : int -> (int -> 'a) -> 'a t
+(** [init n f] creates a new enumeration over elements
+  [f 0, f 1, ..., f (n-1)] *)
+
+(** {6 Counting} *)
+
+val count : 'a t -> int
+(** [count e] returns the number of remaining elements in [e] without
+  consuming the enumeration.
+
+Depending of the underlying data structure that is implementing the
+enumeration functions, the count operation can be costly, and even sometimes
+can cause a call to [force]. *)
+
+val fast_count : 'a t -> bool
+(** For users worried about the speed of [count] you can call the [fast_count]
+    function that will give an hint about [count] implementation. Basically, if
+    the enumeration has been created with [make] or [init] or if [force] has
+    been called on it, then [fast_count] will return true. *)
diff --git a/bundles/extlib/extlib-1.5.2/extArray.ml b/bundles/extlib/extlib-1.5.2/extArray.ml
new file mode 100644 (file)
index 0000000..6d5f4f5
--- /dev/null
@@ -0,0 +1,172 @@
+(*
+ * ExtList - additional and modified functions for lists.
+ * Copyright (C) 2005 Richard W.M. Jones (rich @ annexia.org)
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+module Array = struct
+
+include Array
+
+let rev_in_place xs =
+  let n = length xs in
+  let j = ref (n-1) in
+  for i = 0 to n/2-1 do
+    let c = xs.(i) in
+    xs.(i) <- xs.(!j);
+    xs.(!j) <- c;
+    decr j
+  done
+
+let rev xs =
+  let ys = Array.copy xs in
+  rev_in_place ys;
+  ys
+
+let for_all p xs =
+  let n = length xs in
+  let rec loop i =
+    if i = n then true
+    else if p xs.(i) then loop (succ i)
+    else false
+  in
+  loop 0
+
+let exists p xs =
+  let n = length xs in
+  let rec loop i =
+    if i = n then false
+    else if p xs.(i) then true
+    else loop (succ i)
+  in
+  loop 0
+
+let mem a xs =
+  let n = length xs in
+  let rec loop i =
+    if i = n then false
+    else if a = xs.(i) then true
+    else loop (succ i)
+  in
+  loop 0
+
+let memq a xs =
+  let n = length xs in
+  let rec loop i =
+    if i = n then false
+    else if a == xs.(i) then true
+    else loop (succ i)
+  in
+  loop 0
+
+let findi p xs =
+  let n = length xs in
+  let rec loop i =
+    if i = n then raise Not_found
+    else if p xs.(i) then i
+    else loop (succ i)
+  in
+  loop 0
+
+let find p xs = xs.(findi p xs)
+
+(* Use of BitSet suggested by Brian Hurt. *)
+let filter p xs =
+  let n = length xs in
+  (* Use a bitset to store which elements will be in the final array. *)
+  let bs = BitSet.create n in
+  for i = 0 to n-1 do
+    if p xs.(i) then BitSet.set bs i
+  done;
+  (* Allocate the final array and copy elements into it. *)
+  let n' = BitSet.count bs in
+  let j = ref 0 in
+  let xs' = init n'
+    (fun _ ->
+       (* Find the next set bit in the BitSet. *)
+       while not (BitSet.is_set bs !j) do incr j done;
+       let r = xs.(!j) in
+       incr j;
+       r) in
+  xs'
+
+let find_all = filter
+
+let partition p xs =
+  let n = length xs in
+  (* Use a bitset to store which elements will be in which final array. *)
+  let bs = BitSet.create n in
+  for i = 0 to n-1 do
+    if p xs.(i) then BitSet.set bs i
+  done;
+  (* Allocate the final arrays and copy elements into them. *)
+  let n1 = BitSet.count bs in
+  let n2 = n - n1 in
+  let j = ref 0 in
+  let xs1 = init n1
+    (fun _ ->
+       (* Find the next set bit in the BitSet. *)
+       while not (BitSet.is_set bs !j) do incr j done;
+       let r = xs.(!j) in
+       incr j;
+       r) in
+  let j = ref 0 in
+  let xs2 = init n2
+    (fun _ ->
+       (* Find the next clear bit in the BitSet. *)
+       while BitSet.is_set bs !j do incr j done;
+       let r = xs.(!j) in
+       incr j;
+       r) in
+  xs1, xs2
+
+let enum xs =
+  let rec make start xs =
+    let n = length xs in
+    Enum.make
+      ~next:(fun () ->
+              if !start < n then (
+                let r = xs.(!start) in
+                incr start;
+                r
+              ) else
+                raise Enum.No_more_elements)
+      ~count:(fun () ->
+               n - !start)
+      ~clone:(fun () ->
+               let xs' = Array.sub xs !start (n - !start) in
+               make (ref 0) xs')
+  in
+  make (ref 0) xs
+
+let of_enum e =
+  let n = Enum.count e in
+  (* This assumes, reasonably, that init traverses the array in order. *)
+  Array.init n
+    (fun i ->
+       match Enum.get e with
+       | Some x -> x
+       | None -> assert false)
+
+let iter2 f a1 a2 =
+     if Array.length a1 <> Array.length a2
+     then raise (Invalid_argument "Array.iter2");
+     for i = 0 to Array.length a1 - 1 do
+       f a1.(i) a2.(i);
+     done;;
+
+end
diff --git a/bundles/extlib/extlib-1.5.2/extArray.mli b/bundles/extlib/extlib-1.5.2/extArray.mli
new file mode 100644 (file)
index 0000000..ce5fc55
--- /dev/null
@@ -0,0 +1,136 @@
+(*
+ * ExtArray - additional and modified functions for arrays.
+ * Copyright (C) 2005 Richard W.M. Jones (rich @ annexia.org)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Additional and modified functions for arrays.
+
+       The OCaml standard library provides a module of array functions.
+       This ExtArray module can be used to override the Array module or
+       as a standalone module. It provides some additional functions.
+*)
+
+module Array :
+sig
+
+  (** {6 New functions} *)
+  val rev : 'a array -> 'a array
+    (** Array reversal. *)
+
+  val rev_in_place : 'a array -> unit
+    (** In-place array reversal.  The array argument is updated. *)
+
+  val iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit
+    (** [Array.iter2 f [|a1; ...; an|] [|b1; ...; bn|]] performs
+    calls [f a1 b1; ...; f an bn] in that order.
+    
+    @raise Invalid_argument if the length of [a1] does not equal the
+    length of [a2]. *)
+
+  val for_all : ('a -> bool) -> 'a array -> bool
+    (** [for_all p [a1; ...; an]] checks if all elements of the array
+       satisfy the predicate [p].  That is, it returns
+       [ (p a1) && (p a2) && ... && (p an)].
+    *)
+
+  val exists : ('a -> bool) -> 'a array -> bool
+    (** [exists p [a1; ...; an]] checks if at least one element of
+       the array satisfies the predicate [p].  That is, it returns
+       [ (p a1) || (p a2) || ... || (p an)].
+    *)
+
+  val mem : 'a -> 'a array -> bool
+    (** [mem m a] is true if and only if [m] is equal to an element of [a]. *)
+
+  val memq : 'a -> 'a array -> bool
+    (** Same as {!Array.mem} but uses physical equality instead of
+       structural equality to compare array elements.
+    *)
+
+  val find : ('a -> bool) -> 'a array -> 'a
+    (** [find p a] returns the first element of array [a]
+       that satisfies the predicate [p].
+       Raise [Not_found] if there is no value that satisfies [p] in the
+       array [a].
+    *)
+
+  val findi : ('a -> bool) -> 'a array -> int
+    (** [findi p a] returns the index of the first element of array [a]
+       that satisfies the predicate [p].
+       Raise [Not_found] if there is no value that satisfies [p] in the
+       array [a].
+    *)
+
+  val filter : ('a -> bool) -> 'a array -> 'a array
+    (** [filter p a] returns all the elements of the array [a]
+       that satisfy the predicate [p].  The order of the elements
+       in the input array is preserved.  *)
+
+  val find_all : ('a -> bool) -> 'a array -> 'a array
+    (** [find_all] is another name for {!Array.filter}. *)
+
+  val partition : ('a -> bool) -> 'a array -> 'a array * 'a array
+    (** [partition p a] returns a pair of arrays [(a1, a2)], where
+       [a1] is the array of all the elements of [a] that
+       satisfy the predicate [p], and [a2] is the array of all the
+       elements of [a] that do not satisfy [p].
+       The order of the elements in the input array is preserved. *)
+
+  (** {6 Enumerations} *)
+
+  val enum : 'a array -> 'a Enum.t
+    (** Returns an enumeration of the elements of an array. *)
+
+  val of_enum : 'a Enum.t -> 'a array
+    (** Build an array from an enumeration. *)
+
+  (** {6 Old functions} *)
+
+  (** These functions are already part of the Ocaml standard library
+      and have not been modified. Please refer to the Ocaml Manual for
+      documentation. *)
+
+  external length : 'a array -> int = "%array_length"
+  external get : 'a array -> int -> 'a = "%array_safe_get"
+  external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
+  external make : int -> 'a -> 'a array = "caml_make_vect"
+  external create : int -> 'a -> 'a array = "caml_make_vect"
+  val init : int -> (int -> 'a) -> 'a array
+  val make_matrix : int -> int -> 'a -> 'a array array
+  val create_matrix : int -> int -> 'a -> 'a array array
+  val append : 'a array -> 'a array -> 'a array
+  val concat : 'a array list -> 'a array
+  val sub : 'a array -> int -> int -> 'a array
+  val copy : 'a array -> 'a array
+  val fill : 'a array -> int -> int -> 'a -> unit
+  val blit : 'a array -> int -> 'a array -> int -> int -> unit
+  val to_list : 'a array -> 'a list
+  val of_list : 'a list -> 'a array
+  val iter : ('a -> unit) -> 'a array -> unit
+  val map : ('a -> 'b) -> 'a array -> 'b array
+  val iteri : (int -> 'a -> unit) -> 'a array -> unit
+  val mapi : (int -> 'a -> 'b) -> 'a array -> 'b array
+  val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b array -> 'a
+  val fold_right : ('b -> 'a -> 'a) -> 'b array -> 'a -> 'a
+  val sort : ('a -> 'a -> int) -> 'a array -> unit
+  val stable_sort : ('a -> 'a -> int) -> 'a array -> unit
+  val fast_sort : ('a -> 'a -> int) -> 'a array -> unit
+  external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get"
+  external unsafe_set : 'a array -> int -> 'a -> unit = "%array_unsafe_set"
+
+end
diff --git a/bundles/extlib/extlib-1.5.2/extHashtbl.ml b/bundles/extlib/extlib-1.5.2/extHashtbl.ml
new file mode 100644 (file)
index 0000000..f667dff
--- /dev/null
@@ -0,0 +1,134 @@
+(* 
+ * ExtHashtbl, extra functions over hashtables.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+module Hashtbl =
+  struct
+
+       type ('a, 'b) h_bucketlist =
+               | Empty
+               | Cons of 'a * 'b * ('a, 'b) h_bucketlist
+
+       type ('a, 'b) h_t = {
+               mutable size: int;
+               mutable data: ('a, 'b) h_bucketlist array
+       }
+
+       include Hashtbl
+
+       external h_conv : ('a, 'b) t -> ('a, 'b) h_t = "%identity"
+       external h_make : ('a, 'b) h_t -> ('a, 'b) t = "%identity"
+
+       let exists = mem
+
+       let enum h =
+               let rec make ipos ibuck idata icount =
+                       let pos = ref ipos in
+                       let buck = ref ibuck in
+                       let hdata = ref idata in
+                       let hcount = ref icount in
+                       let force() =
+                               (** this is a hack in order to keep an O(1) enum constructor **)
+                               if !hcount = -1 then begin
+                                       hcount := (h_conv h).size;
+                                       hdata := Array.copy (h_conv h).data;
+                               end;
+                       in
+                       let rec next() =
+                               force();
+                               match !buck with
+                               | Empty ->                                      
+                                       if !hcount = 0 then raise Enum.No_more_elements;
+                                       incr pos;
+                                       buck := Array.unsafe_get !hdata !pos;
+                                       next()
+                               | Cons (k,i,next_buck) ->
+                                       buck := next_buck;
+                                       decr hcount;
+                                       (k,i)
+                       in
+                       let count() =
+                               if !hcount = -1 then (h_conv h).size else !hcount
+                       in
+                       let clone() =
+                               force();
+                               make !pos !buck !hdata !hcount
+                       in
+                       Enum.make ~next ~count ~clone
+               in              
+               make (-1) Empty (Obj.magic()) (-1)
+
+       let keys h =
+               Enum.map (fun (k,_) -> k) (enum h)
+
+       let values h =
+               Enum.map (fun (_,v) -> v) (enum h)
+
+       let map f h =
+               let rec loop = function
+                       | Empty -> Empty
+                       | Cons (k,v,next) -> Cons (k,f v,loop next)
+               in
+               h_make {
+                       size = (h_conv h).size;
+                       data = Array.map loop (h_conv h).data; 
+               }
+
+       let remove_all h key =
+               let hc = h_conv h in
+               let rec loop = function
+                       | Empty -> Empty
+                       | Cons(k,v,next) ->
+                               if k = key then begin
+                                       hc.size <- pred hc.size;
+                                       loop next
+                               end else
+                                       Cons(k,v,loop next)
+               in
+               let pos = (hash key) mod (Array.length hc.data) in
+               Array.unsafe_set hc.data pos (loop (Array.unsafe_get hc.data pos))
+
+       let find_default h key defval =
+               let rec loop = function
+                       | Empty -> defval
+                       | Cons (k,v,next) ->
+                               if k = key then v else loop next
+               in
+               let pos = (hash key) mod (Array.length (h_conv h).data) in
+               loop (Array.unsafe_get (h_conv h).data pos)
+
+       let find_option h key =
+               let rec loop = function
+                       | Empty -> None
+                       | Cons (k,v,next) ->
+                               if k = key then Some v else loop next
+               in
+               let pos = (hash key) mod (Array.length (h_conv h).data) in
+               loop (Array.unsafe_get (h_conv h).data pos)
+
+       let of_enum e =
+               let h = create (if Enum.fast_count e then Enum.count e else 0) in
+               Enum.iter (fun (k,v) -> add h k v) e;
+               h
+       
+       let length h =
+               (h_conv h).size
+
+  end
diff --git a/bundles/extlib/extlib-1.5.2/extHashtbl.mli b/bundles/extlib/extlib-1.5.2/extHashtbl.mli
new file mode 100644 (file)
index 0000000..8df3f4f
--- /dev/null
@@ -0,0 +1,89 @@
+(* 
+ * ExtHashtbl - extra functions over hashtables.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+(** Extra functions over hashtables. *)
+
+module Hashtbl :
+  (** The wrapper module *)
+  sig
+
+       type ('a,'b) t = ('a,'b) Hashtbl.t
+       (** The type of a hashtable. *)
+
+       (** {6 New Functions} *)
+
+       val exists : ('a,'b) t -> 'a -> bool
+       (** [exists h k] returns true is at least one item with key [k] is
+               found in the hashtable. *)
+
+       val keys : ('a,'b) t -> 'a Enum.t
+       (** Return an enumeration of all the keys of a hashtable.
+           If the key is in the Hashtable multiple times, all occurrences
+           will be returned.  *)
+
+       val values : ('a,'b) t -> 'b Enum.t
+       (** Return an enumeration of all the values of a hashtable. *)
+
+       val enum : ('a, 'b) t -> ('a * 'b) Enum.t
+       (** Return an enumeration of (key,value) pairs of a hashtable. *)
+
+       val of_enum : ('a * 'b) Enum.t -> ('a, 'b) t
+       (** Create a hashtable from a (key,value) enumeration. *)
+
+       val find_default : ('a,'b) t -> 'a -> 'b -> 'b
+         (** Find a binding for the key, and return a default
+           value if not found *)
+
+       val find_option : ('a,'b) Hashtbl.t -> 'a -> 'b option
+       (** Find a binding for the key, or return [None] if no
+               value is found *)
+
+       val remove_all : ('a,'b) t -> 'a -> unit
+       (** Remove all bindings for the given key *)
+
+       val map : ('b -> 'c) -> ('a,'b) t -> ('a,'c) t
+       (** [map f x] creates a new hashtable with the same
+           keys as [x], but with the function [f] applied to
+               all the values *)
+
+       val length : ('a,'b) t -> int
+       (** Return the number of elements inserted into the Hashtbl 
+               (including duplicates) *)
+       
+       (** {6 Older Functions} *)
+
+       (** Please refer to the Ocaml Manual for documentation of these
+               functions. (note : functor support removed to avoid code
+               duplication). *)
+
+       val create : int -> ('a, 'b) t
+       val clear : ('a, 'b) t -> unit
+       val add : ('a, 'b) t -> 'a -> 'b -> unit
+       val copy : ('a, 'b) t -> ('a, 'b) t
+       val find : ('a, 'b) t -> 'a -> 'b
+       val find_all : ('a, 'b) t -> 'a -> 'b list
+       val mem : ('a, 'b) t -> 'a -> bool
+       val remove : ('a, 'b) t -> 'a -> unit
+       val replace : ('a, 'b) t -> 'a -> 'b -> unit
+       val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
+       val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
+       val hash : 'a -> int
+
+  end
diff --git a/bundles/extlib/extlib-1.5.2/extLib.ml b/bundles/extlib/extlib-1.5.2/extLib.ml
new file mode 100644 (file)
index 0000000..64a1ab7
--- /dev/null
@@ -0,0 +1,45 @@
+(* 
+ * ExtLib - use extensions as separate modules
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(* 
+       Note:
+       
+       Since ExtLib is provided for namespace convenience for
+       users who wants to keep the usage of the original
+       Ocaml Standard Library, no MLI CMI nor documentation will
+       be provided for this module.
+
+       Users can simply do an "open ExtLib" to import all Ext*
+       namespaces instead of doing "open ExtList" for example.
+
+       The trade-off is that they'll have to link all the modules
+       included below so the resulting binary is bigger.
+*)
+
+module List = ExtList.List
+module String = ExtString.String
+module Hashtbl = ExtHashtbl.Hashtbl
+module Array = ExtArray.Array
+
+exception Invalid_string = ExtString.Invalid_string
+
+let (@) = ExtList.(@)
+
+include Std
diff --git a/bundles/extlib/extlib-1.5.2/extList.ml b/bundles/extlib/extlib-1.5.2/extList.ml
new file mode 100644 (file)
index 0000000..e940782
--- /dev/null
@@ -0,0 +1,515 @@
+(*
+ * ExtList - additional and modified functions for lists.
+ * Copyright (C) 2003 Brian Hurt
+ * Copyright (C) 2003 Nicolas Cannasse
+ * Copyright (C) 2008 Red Hat Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+module List = struct
+
+exception Empty_list
+exception Invalid_index of int
+exception Different_list_size of string
+
+include List
+
+(* Thanks to Jacques Garrigue for suggesting the following structure *)
+type 'a mut_list =  {
+       hd: 'a; 
+       mutable tl: 'a list
+}
+external inj : 'a mut_list -> 'a list = "%identity"
+
+
+let dummy_node () = { hd = Obj.magic (); tl = [] }
+
+let hd = function
+       | [] -> raise Empty_list
+       | h :: t -> h
+
+let tl = function
+       | [] -> raise Empty_list
+       | h :: t -> t
+
+let nth l index =
+       if index < 0 then raise (Invalid_index index);
+       let rec loop n = function
+               | [] -> raise (Invalid_index index);
+               | h :: t -> 
+                       if n = 0 then h else loop (n - 1) t
+       in
+       loop index l
+
+let append l1 l2 =
+       match l1 with
+       | [] -> l2
+       | h :: t ->
+               let rec loop dst = function
+               | [] ->
+                       dst.tl <- l2
+               | h :: t ->
+                       let cell = { hd = h; tl = [] } in
+                       dst.tl <- inj cell;
+                       loop cell t
+               in
+               let r = { hd = h; tl = [] } in
+               loop r t;
+               inj r
+
+let rec flatten l =
+       let rec inner dst = function
+               | [] -> dst
+               | h :: t ->
+                       let r = { hd = h; tl = [] } in
+                       dst.tl <- inj r;
+                       inner r t
+       in
+       let rec outer dst = function
+               | [] -> ()
+               | h :: t -> outer (inner dst h) t
+       in
+       let r = dummy_node () in
+       outer r l;
+       r.tl
+
+let concat = flatten
+
+let map f = function
+       | [] -> []
+       | h :: t ->
+               let rec loop dst = function
+               | [] -> ()
+               | h :: t ->
+                       let r = { hd = f h; tl = [] } in
+                       dst.tl <- inj r;
+                       loop r t
+               in
+               let r = { hd = f h; tl = [] } in
+               loop r t;
+               inj r
+
+let rec drop n = function
+       | _ :: l when n > 0 -> drop (n-1) l
+       | l -> l
+
+let take n l =
+       let rec loop n dst = function
+               | h :: t when n > 0 ->
+                       let r = { hd = h; tl = [] } in
+                       dst.tl <- inj r;
+                       loop (n-1) r t
+               | _ ->
+                       ()
+       in
+       let dummy = dummy_node() in
+       loop n dummy l;
+       dummy.tl
+
+(* takewhile and dropwhile by Richard W.M. Jones. *)
+let rec takewhile f = function
+  | [] -> []
+  | x :: xs when f x -> x :: takewhile f xs
+  | _ -> []
+
+let rec dropwhile f = function
+  | [] -> []
+  | x :: xs when f x -> dropwhile f xs
+  | xs -> xs
+
+
+let rec unique ?(cmp = ( = )) l =
+       let rec loop dst = function
+               | [] -> ()
+               | h :: t ->
+                       match exists (cmp h) t with
+                       | true -> loop dst t
+                       | false ->
+                               let r = { hd =  h; tl = [] }  in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node() in
+       loop dummy l;
+       dummy.tl
+
+let filter_map f l =
+       let rec loop dst = function
+               | [] -> ()
+               | h :: t ->
+                       match f h with
+                       | None -> loop dst t
+                       | Some x ->
+                               let r = { hd = x; tl = [] }  in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node() in
+       loop dummy l;
+       dummy.tl
+
+let rec find_map f = function
+  | [] -> raise Not_found
+  | x :: xs ->
+      match f x with
+      | Some y -> y
+      | None -> find_map f xs
+
+let fold_right_max = 1000
+
+let fold_right f l init =
+       let rec tail_loop acc = function
+               | [] -> acc
+               | h :: t -> tail_loop (f h acc) t
+       in
+       let rec loop n = function
+               | [] -> init
+               | h :: t ->
+                       if n < fold_right_max then
+                               f h (loop (n+1) t)
+                       else
+                               f h (tail_loop init (rev t))
+       in
+       loop 0 l
+
+let map2 f l1 l2 =
+       let rec loop dst src1 src2 =
+               match src1, src2 with
+                       | [], [] -> ()
+                       | h1 :: t1, h2 :: t2 ->
+                               let r = { hd = f h1 h2; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r t1 t2
+                       | _ -> raise (Different_list_size "map2")
+       in
+       let dummy = dummy_node () in
+       loop dummy l1 l2;
+       dummy.tl
+
+let rec iter2 f l1 l2 =
+       match l1, l2 with
+       | [], [] -> ()
+       | h1 :: t1, h2 :: t2 -> f h1 h2; iter2 f t1 t2
+       | _ -> raise (Different_list_size "iter2")
+
+let rec fold_left2 f accum l1 l2 =
+       match l1, l2 with
+       | [], [] -> accum
+       | h1 :: t1, h2 :: t2 -> fold_left2 f (f accum h1 h2) t1 t2
+       | _ -> raise (Different_list_size "fold_left2")
+
+let fold_right2 f l1 l2 init =
+       let rec tail_loop acc l1 l2 =
+               match l1, l2 with
+               | [] , [] -> acc
+               | h1 :: t1 , h2 :: t2 -> tail_loop (f h1 h2 acc) t1 t2
+               | _ -> raise (Different_list_size "fold_right2")
+       in
+       let rec loop n l1 l2 =
+               match l1, l2 with
+               | [], [] -> init
+               | h1 :: t1, h2 :: t2 ->
+                       if n < fold_right_max then
+                               f h1 h2 (loop (n+1) t1 t2)
+                       else
+                               f h1 h2 (tail_loop init (rev t1) (rev t2))
+               | _ -> raise (Different_list_size "fold_right2")
+       in
+       loop 0 l1 l2
+
+let for_all2 p l1 l2 =
+       let rec loop l1 l2 =
+               match l1, l2 with
+               | [], [] -> true
+               | h1 :: t1, h2 :: t2 -> if p h1 h2 then loop t1 t2 else false
+               | _ -> raise (Different_list_size "for_all2")
+       in
+       loop l1 l2
+
+let exists2 p l1 l2 =
+       let rec loop l1 l2 =
+               match l1, l2 with
+                       | [], [] -> false
+                       | h1 :: t1, h2 :: t2 -> if p h1 h2 then true else loop t1 t2
+                       | _ -> raise (Different_list_size "exists2")
+       in
+       loop l1 l2
+
+let remove_assoc x lst = 
+       let rec loop dst = function
+               | [] -> ()
+               | (a, _ as pair) :: t ->
+                       if a = x then
+                               dst.tl <- t
+                       else
+                               let r = { hd = pair; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node () in
+       loop dummy lst;
+       dummy.tl
+
+let remove_assq x lst = 
+       let rec loop dst = function
+               | [] -> ()
+               | (a, _ as pair) :: t ->
+                       if a == x then
+                               dst.tl <- t
+                       else
+                               let r = { hd =  pair; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node() in
+       loop dummy lst;
+       dummy.tl
+
+let rfind p l = find p (rev l)
+
+let find_all p l = 
+       let rec findnext dst = function
+               | [] -> ()
+               | h :: t -> 
+                       if p h then
+                               let r = { hd = h; tl = [] } in
+                               dst.tl <- inj r;
+                               findnext r t
+                       else
+                               findnext dst t
+       in
+       let dummy = dummy_node () in
+       findnext dummy l;
+       dummy.tl
+
+let rec findi p l =
+       let rec loop n = function
+               | [] -> raise Not_found
+               | h :: t ->
+                       if p n h then (n,h) else loop (n+1) t
+       in
+       loop 0 l
+
+let filter = find_all
+
+let partition p lst = 
+       let rec loop yesdst nodst = function
+               | [] -> ()
+               | h :: t ->
+                       let r = { hd = h; tl = [] } in
+                       if p h then
+                               begin
+                                       yesdst.tl <- inj r;
+                                       loop r nodst t
+                               end
+                       else
+                               begin
+                                       nodst.tl <- inj r;
+                                       loop yesdst r t
+                               end
+       in
+       let yesdummy = dummy_node()
+       and nodummy = dummy_node()
+       in
+       loop yesdummy nodummy lst;
+       yesdummy.tl, nodummy.tl
+
+let split lst =
+       let rec loop adst bdst = function
+               | [] -> ()
+               | (a, b) :: t -> 
+                       let x = { hd = a; tl = [] } 
+                       and y = { hd = b; tl = [] } in
+                       adst.tl <- inj x;
+                       bdst.tl <- inj y;
+                       loop x y t
+       in
+       let adummy = dummy_node ()
+       and bdummy = dummy_node ()
+       in
+       loop adummy bdummy lst;
+       adummy.tl, bdummy.tl
+
+let combine l1 l2 =
+       let rec loop dst l1 l2 =
+               match l1, l2 with
+               | [], [] -> ()
+               | h1 :: t1, h2 :: t2 -> 
+                       let r = { hd = h1, h2; tl = [] } in
+                       dst.tl <- inj r;
+                       loop r t1 t2
+               | _, _ -> raise (Different_list_size "combine")
+       in
+       let dummy = dummy_node () in
+       loop dummy l1 l2;
+       dummy.tl
+
+let sort ?(cmp=compare) = List.sort cmp
+
+let rec init size f =
+       if size = 0 then [] 
+       else if size < 0 then invalid_arg "ExtList.init"
+       else
+               let rec loop dst n =
+                       if n < size then
+                               let r = { hd = f n; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r (n+1)
+               in
+               let r = { hd = f 0; tl = [] } in
+               loop r 1;
+               inj r
+
+let make i x =
+  if i < 0 then invalid_arg "ExtList.List.make";
+  let rec loop acc x = function
+  | 0 -> acc
+  | i -> loop (x::acc) x (i-1)
+  in
+  loop [] x i
+
+let mapi f = function
+       | [] -> []
+       | h :: t ->
+               let rec loop dst n = function
+                       | [] -> ()
+                       | h :: t -> 
+                               let r = { hd = f n h; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r (n+1) t
+               in      
+               let r = { hd = f 0 h; tl = [] } in
+               loop r 1 t;
+               inj r
+
+let iteri f l = 
+       let rec loop n = function
+               | [] -> ()
+               | h :: t ->
+                       f n h;
+                       loop (n+1) t
+       in
+       loop 0 l
+
+let first = hd
+
+let rec last = function
+       | [] -> raise Empty_list
+       | h :: [] -> h
+       | _ :: t -> last t
+
+let split_nth index = function
+       | [] -> if index = 0 then [],[] else raise (Invalid_index index)
+       | (h :: t as l) ->
+               if index = 0 then [],l
+               else if index < 0 then raise (Invalid_index index)
+               else
+                       let rec loop n dst l =
+                               if n = 0 then l else
+                               match l with
+                               | [] -> raise (Invalid_index index)
+                               | h :: t ->
+                                       let r = { hd =  h; tl = [] } in
+                                       dst.tl <- inj r;
+                                       loop (n-1) r t 
+                       in
+                       let r = { hd = h; tl = [] } in
+                       inj r, loop (index-1) r t
+
+let find_exc f e l =
+       try
+               find f l
+       with
+               Not_found -> raise e
+
+let remove l x =
+       let rec loop dst = function
+               | [] -> ()
+               | h :: t ->
+                       if x = h then 
+                               dst.tl <- t
+                       else
+                               let r = { hd = h; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node () in
+       loop dummy l;
+       dummy.tl
+
+let rec remove_if f lst =
+       let rec loop dst = function
+               | [] -> ()
+               | x :: l ->
+                       if f x then
+                               dst.tl <- l
+                       else
+                               let r = { hd = x; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r l
+       in
+       let dummy = dummy_node () in
+       loop dummy lst;
+       dummy.tl
+
+let rec remove_all l x =
+       let rec loop dst = function
+               | [] -> ()
+               | h :: t ->
+                       if x = h then
+                               loop dst t
+                       else
+                               let r = { hd = h; tl = [] } in
+                               dst.tl <- inj r;
+                               loop r t
+       in
+       let dummy = dummy_node () in
+       loop dummy l;
+       dummy.tl
+
+let enum l =
+       let rec make lr count =
+               Enum.make
+                       ~next:(fun () ->
+                               match !lr with
+                               | [] -> raise Enum.No_more_elements
+                               | h :: t ->
+                                       decr count;
+                                       lr := t;
+                                       h
+                       )
+                       ~count:(fun () ->
+                               if !count < 0 then count := length !lr;
+                               !count
+                       )
+                       ~clone:(fun () ->
+                               make (ref !lr) (ref !count)
+                       )
+       in
+       make (ref l) (ref (-1))
+
+let of_enum e =
+       let h = dummy_node() in
+       let _ = Enum.fold (fun x acc ->
+               let r = { hd = x; tl = [] }  in
+               acc.tl <- inj r;
+               r) h e in
+       h.tl
+
+end
+
+let ( @ ) = List.append
diff --git a/bundles/extlib/extlib-1.5.2/extList.mli b/bundles/extlib/extlib-1.5.2/extList.mli
new file mode 100644 (file)
index 0000000..58cc72e
--- /dev/null
@@ -0,0 +1,244 @@
+(*
+ * ExtList - additional and modified functions for lists.
+ * Copyright (C) 2003 Brian Hurt
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Additional and modified functions for lists.
+
+       The OCaml standard library provides a module for list functions.
+       This ExtList module can be used to override the List module or
+       as a standalone module. It provides new functions and modify
+       the behavior of some other ones (in particular all functions
+       are now {b tail-recursive}).
+*)
+
+module List :
+    sig
+
+       (** {6 New functions} *)
+
+       val init : int -> (int -> 'a) -> 'a list
+       (** Similar to [Array.init], [init n f] returns the list containing
+        the results of (f 0),(f 1).... (f (n-1)).
+        Raise [Invalid_arg "ExtList.init"] if n < 0.*)
+
+       val make : int -> 'a -> 'a list
+         (** Similar to [String.make], [make n x] returns a
+           * list containing [n] elements [x].
+           *)
+
+       val first : 'a list -> 'a
+       (** Returns the first element of the list, or raise [Empty_list] if
+        the list is empty (similar to [hd]). *)
+
+       val last : 'a list -> 'a
+       (** Returns the last element of the list, or raise [Empty_list] if
+        the list is empty. This function takes linear time. *)
+
+       val iteri : (int -> 'a -> 'b) -> 'a list -> unit
+       (** [iteri f l] will call [(f 0 a0);(f 1 a1) ... (f n an)] where
+        [a0..an] are the elements of the list [l]. *)
+
+       val mapi : (int -> 'a -> 'b) -> 'a list -> 'b list
+       (** [mapi f l] will build the list containing
+        [(f 0 a0);(f 1 a1) ... (f n an)] where [a0..an] are the elements of
+        the list [l]. *)
+
+       val rfind : ('a -> bool) -> 'a list -> 'a
+       (** [rfind p l] returns the last element [x] of [l] such as [p x] returns
+        [true] or raises [Not_found] if such element as not been found. *)
+
+       val find_exc : ('a -> bool) -> exn -> 'a list -> 'a
+       (** [find_exc p e l] returns the first element of [l] such as [p x]
+        returns [true] or raises [e] if such element as not been found. *)
+
+       val findi : (int -> 'a -> bool) -> 'a list -> (int * 'a)
+       (** [findi p e l] returns the first element [ai] of [l] along with its
+        index [i] such that [p i ai] is true, or raises [Not_found] if no
+        such element has been found. *)
+
+       val unique : ?cmp:('a -> 'a -> bool) -> 'a list -> 'a list
+       (** [unique cmp l] returns the list [l] without any duplicate element.
+        Default comparator ( = ) is used if no comparison function specified. *)
+
+       val filter_map : ('a -> 'b option) -> 'a list -> 'b list
+       (** [filter_map f l] call [(f a0) (f a1).... (f an)] where [a0..an] are
+        the elements of [l]. It returns the list of elements [bi] such as
+        [f ai = Some bi] (when [f] returns [None], the corresponding element of
+        [l] is discarded). *)
+
+       val find_map : ('a -> 'b option) -> 'a list -> 'b
+       (** [find_map pred list] finds the first element of [list] for which
+           [pred element] returns [Some r].  It returns [r] immediately
+           once found or raises [Not_found] if no element matches the
+           predicate.  See also {!filter_map}. *)
+
+       val split_nth : int -> 'a list -> 'a list * 'a list
+       (** [split_nth n l] returns two lists [l1] and [l2], [l1] containing the
+        first [n] elements of [l] and [l2] the others. Raise [Invalid_index] if
+        [n] is outside of [l] size bounds. *)
+
+       val remove : 'a list -> 'a -> 'a list
+       (** [remove l x] returns the list [l] without the first element [x] found
+        or returns  [l] if no element is equal to [x]. Elements are compared
+        using ( = ). *)
+
+       val remove_if : ('a -> bool) -> 'a list -> 'a list
+       (** [remove_if cmp l] is similar to [remove], but with [cmp] used
+        instead of ( = ). *)
+
+       val remove_all : 'a list -> 'a -> 'a list
+       (** [remove_all l x] is similar to [remove] but removes all elements that
+        are equal to [x] and not only the first one. *)
+
+       val take : int -> 'a list -> 'a list
+       (** [take n l] returns up to the [n] first elements from list [l], if
+        available. *)
+
+       val drop : int -> 'a list -> 'a list
+       (** [drop n l] returns [l] without the first [n] elements, or the empty
+        list if [l] have less than [n] elements. *)
+
+       val takewhile : ('a -> bool) -> 'a list -> 'a list
+         (** [takewhile f xs] returns the first elements of list [xs]
+             which satisfy the predicate [f]. *)
+
+       val dropwhile : ('a -> bool) -> 'a list -> 'a list
+         (** [dropwhile f xs] returns the list [xs] with the first
+             elements satisfying the predicate [f] dropped. *)
+
+       (** {6 Enum functions} *)
+
+       (** Enumerations are important in ExtLib, they are a good way to work with
+        abstract enumeration of elements, regardless if they are located in a list,
+        an array, or a file. *)
+
+       val enum : 'a list -> 'a Enum.t
+       (** Returns an enumeration of the elements of a list. *)
+
+       val of_enum : 'a Enum.t -> 'a list
+       (** Build a list from an enumeration. *)
+
+       (** {6 Modified functions} *)
+
+       (** Some minor modifications have been made to the specification of some
+        functions, especially concerning exceptions raised. *)
+
+       val hd : 'a list -> 'a
+       (** Returns the first element of the list or raise [Empty_list] if the
+        list is empty. *)
+
+       val tl : 'a list -> 'a list
+       (** Returns the list without its first elements or raise [Empty_list] if
+        the list is empty. *)
+
+       val nth : 'a list -> int -> 'a
+       (** [nth l n] returns the n-th element of the list [l] or raise
+        [Invalid_index] is the index is outside of [l] bounds. *)
+
+       val sort : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list
+       (** Sort the list using optional comparator (by default [compare]). *)
+
+       (** The following functions have been improved so all of them are
+        tail-recursive. They have also been modified so they no longer
+        raise [Invalid_arg] but [Different_list_size] when used on two
+        lists having a different number of elements. *)
+
+       val map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
+       val iter2 : ('a -> 'b -> unit) -> 'a list -> 'b list -> unit
+       val fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a
+       val fold_right2 : ('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
+       val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
+       val exists2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
+       val combine : 'a list -> 'b list -> ('a * 'b) list
+
+
+       (** {6 Improved functions} *)
+
+       (** The following functions have the same behavior as the [List]
+               module ones but are tail-recursive. That means they will not
+               cause a [Stack_overflow] when used on very long list.
+
+               The implementation might be a little more slow in bytecode,
+               but compiling in native code will not affect performances. *)
+
+       val map : ('a -> 'b) -> 'a list -> 'b list
+       val append : 'a list -> 'a list -> 'a list
+       val flatten : 'a list list -> 'a list
+       val concat : 'a list list -> 'a list
+       val fold_right : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
+       val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
+       val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
+       val split : ('a * 'b) list -> 'a list * 'b list
+
+       (** The following functions were already tail-recursive in the [List]
+               module but were using [List.rev] calls. The new implementations
+               have better performances. *)
+
+       val filter : ('a -> bool) -> 'a list -> 'a list
+       val find_all : ('a -> bool) -> 'a list -> 'a list
+       val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
+
+       (** {6 Older functions} *)
+
+       (** These functions are already part of the Ocaml standard library
+               and have not been modified. Please refer to the Ocaml Manual for
+               documentation. *)
+
+       val length : 'a list -> int
+       val rev_append : 'a list -> 'a list -> 'a list
+       val rev : 'a list -> 'a list
+       val rev_map : ('a -> 'b) -> 'a list -> 'b list
+       val iter : ('a -> unit) -> 'a list -> unit
+       val fold_left : ('b -> 'a -> 'b) -> 'b -> 'a list -> 'b
+       val for_all : ('a -> bool) -> 'a list -> bool
+       val exists : ('a -> bool) -> 'a list -> bool
+       val find : ('a -> bool) -> 'a list -> 'a
+
+       val mem : 'a -> 'a list -> bool
+       val memq : 'a -> 'a list -> bool
+       val assoc : 'a -> ('a * 'b) list -> 'b
+       val assq : 'a -> ('a * 'b) list -> 'b
+       val mem_assoc : 'a -> ('a * 'b) list -> bool
+       val mem_assq : 'a -> ('a * 'b) list -> bool
+
+
+       val stable_sort : ('a -> 'a -> int) -> 'a list -> 'a list
+       val fast_sort : ('a -> 'a -> int) -> 'a list -> 'a list
+       val merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
+
+       (** {6 Exceptions} *)
+
+       exception Empty_list
+       (** [Empty_list] is raised when an operation applied on an empty list
+               is invalid : [hd] for example. *)
+
+       exception Invalid_index of int
+       (** [Invalid_index] is raised when an indexed access on a list is
+               out of list bounds. *)
+
+       exception Different_list_size of string
+       (** [Different_list_size] is raised when applying functions such as
+               [iter2] on two lists having different size. *)
+
+
+end
+
+val ( @ ) : 'a list -> 'a list -> 'a list
+(** the new implementation for ( @ ) operator, see [List.append]. *)
diff --git a/bundles/extlib/extlib-1.5.2/extString.ml b/bundles/extlib/extlib-1.5.2/extString.ml
new file mode 100644 (file)
index 0000000..7cbd1c2
--- /dev/null
@@ -0,0 +1,251 @@
+(*
+ * ExtString - Additional functions for string manipulations.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+exception Invalid_string
+
+module String = struct
+
+include String
+
+let init len f =
+       let s = create len in
+       for i = 0 to len - 1 do
+               unsafe_set s i (f i)
+       done;
+       s
+
+let starts_with str p =
+       if length str < length p then 
+               false
+       else
+    let rec loop str p i =
+      if i = length p then true else
+      if unsafe_get str i <> unsafe_get p i then false
+      else loop str p (i+1)
+    in
+    loop str p 0
+
+let ends_with s e =
+       if length s < length e then
+               false
+       else
+    let rec loop s e i =
+      if i = length e then true else
+      if unsafe_get s (length s - length e + i) <> unsafe_get e i then false
+      else loop s e (i+1)
+    in
+    loop s e 0
+
+let find str sub =
+       let sublen = length sub in
+       if sublen = 0 then
+               0
+       else
+               let found = ref 0 in
+               let len = length str in
+               try
+                       for i = 0 to len - sublen do
+                               let j = ref 0 in
+                               while unsafe_get str (i + !j) = unsafe_get sub !j do
+                                       incr j;
+                                       if !j = sublen then begin found := i; raise Exit; end;
+                               done;
+                       done;
+                       raise Invalid_string
+               with
+                       Exit -> !found
+
+let exists str sub =
+       try
+               ignore(find str sub);
+               true
+       with
+               Invalid_string -> false
+
+let strip ?(chars=" \t\r\n") s =
+       let p = ref 0 in
+       let l = length s in
+       while !p < l && contains chars (unsafe_get s !p) do
+               incr p;
+       done;
+       let p = !p in
+       let l = ref (l - 1) in
+       while !l >= p && contains chars (unsafe_get s !l) do
+               decr l;
+       done;
+       sub s p (!l - p + 1)
+
+let split str sep =
+       let p = find str sep in
+       let len = length sep in
+       let slen = length str in
+       sub str 0 p, sub str (p + len) (slen - p - len)
+
+let nsplit str sep =
+       if str = "" then []
+       else if sep = "" then raise Invalid_string
+       else (
+               let rec nsplit str sep =
+                       try
+                               let s1 , s2 = split str sep in
+                               s1 :: nsplit s2 sep
+                       with
+                               Invalid_string -> [str]
+               in
+               nsplit str sep
+       )
+
+let join = concat
+
+let slice ?(first=0) ?(last=Sys.max_string_length) s =
+       let clip _min _max x = max _min (min _max x) in
+       let i = clip 0 (length s)
+               (if (first<0) then (length s) + first else first)
+       and j = clip 0 (length s)
+               (if (last<0) then (length s) + last else last)
+       in
+       if i>=j || i=length s then
+               create 0
+        else
+               sub s i (j-i)
+
+let lchop s =
+       if s = "" then "" else sub s 1 (length s - 1)
+
+let rchop s =
+       if s = "" then "" else sub s 0 (length s - 1)
+
+let of_int = string_of_int
+
+let of_float = string_of_float
+
+let of_char = make 1
+
+let to_int s =
+       try
+               int_of_string s
+       with
+               _ -> raise Invalid_string
+
+let to_float s =
+       try
+               float_of_string s
+       with
+               _ -> raise Invalid_string
+
+let enum s =
+       let l = length s in
+       let rec make i =
+               Enum.make 
+               ~next:(fun () ->
+                       if !i = l then
+                               raise Enum.No_more_elements
+                       else
+                               let p = !i in
+                               incr i;
+                               unsafe_get s p
+                       )
+               ~count:(fun () -> l - !i)
+               ~clone:(fun () -> make (ref !i))
+       in
+       make (ref 0)
+
+let of_enum e =
+       let l = Enum.count e in
+       let s = create l in
+       let i = ref 0 in
+       Enum.iter (fun c -> unsafe_set s !i c; incr i) e;
+       s
+
+let map f s =
+       let len = length s in
+       let sc = create len in
+       for i = 0 to len - 1 do
+               unsafe_set sc i (f (unsafe_get s i))
+       done;
+       sc
+
+(* fold_left and fold_right by Eric C. Cooper *)
+let fold_left f init str =
+  let n = String.length str in
+  let rec loop i result =
+    if i = n then result
+    else loop (i + 1) (f result str.[i])
+  in
+  loop 0 init
+
+let fold_right f str init =
+  let n = String.length str in
+  let rec loop i result =
+    if i = 0 then result
+    else
+      let i' = i - 1 in
+      loop i' (f str.[i'] result)
+  in
+  loop n init
+
+(* explode and implode from the OCaml Expert FAQ. *)
+let explode s =
+  let rec exp i l =
+    if i < 0 then l else exp (i - 1) (s.[i] :: l) in
+  exp (String.length s - 1) []
+
+let implode l =
+  let res = String.create (List.length l) in
+  let rec imp i = function
+  | [] -> res
+  | c :: l -> res.[i] <- c; imp (i + 1) l in
+  imp 0 l
+
+
+let replace_chars f s =
+       let len = String.length s in
+       let tlen = ref 0 in
+       let rec loop i acc =
+               if i = len then
+                       acc
+               else 
+                       let s = f (unsafe_get s i) in
+                       tlen := !tlen + length s;
+                       loop (i+1) (s :: acc)
+       in
+       let strs = loop 0 [] in
+       let sbuf = create !tlen in
+       let pos = ref !tlen in
+       let rec loop2 = function
+               | [] -> ()
+               | s :: acc ->
+                       let len = length s in
+                       pos := !pos - len;
+                       blit s 0 sbuf !pos len;
+                       loop2 acc
+       in
+       loop2 strs;
+       sbuf
+
+let replace ~str ~sub ~by =
+       try
+               let i = find str sub in
+               (true, (slice ~last:i str) ^ by ^ 
+                   (slice ~first:(i+(String.length sub)) str))
+        with
+               Invalid_string -> (false, String.copy str)
+
+end
diff --git a/bundles/extlib/extlib-1.5.2/extString.mli b/bundles/extlib/extlib-1.5.2/extString.mli
new file mode 100644 (file)
index 0000000..cc88f9b
--- /dev/null
@@ -0,0 +1,182 @@
+(*
+ * ExtString - Additional functions for string manipulations.
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Additional functions for string manipulations. *)
+
+exception Invalid_string
+
+module String :
+  sig
+
+       (** {6 New Functions} *)
+
+       val init : int -> (int -> char) -> string
+       (** [init l f] returns the string of length [l] with the chars
+               f 0 , f 1 , f 2 ... f (l-1). *)
+
+       val find : string -> string -> int
+       (** [find s x] returns the starting index of the string [x]
+           within the string [s] or raises [Invalid_string] if [x]
+           is not a substring of [s]. *)
+
+       val split : string -> string -> string * string
+       (** [split s sep] splits the string [s] between the first
+               occurrence of [sep].
+           raises [Invalid_string] if the separator is not found. *)
+
+       val nsplit : string -> string -> string list
+       (** [nsplit s sep] splits the string [s] into a list of strings
+               which are separated by [sep].
+                [nsplit "" _] returns the empty list.
+    @raise Invalid_string if [sep] is empty string.  *)
+
+       val join : string -> string list -> string
+       (** Same as [concat] *)
+
+        val slice : ?first:int -> ?last:int -> string -> string
+        (** [slice ?first ?last s] returns a "slice" of the string
+          which corresponds to the characters [s.[first]],
+          [s.[first+1]], ..., [s[last-1]]. Note that the character at
+          index [last] is {b not} included! If [first] is omitted it
+          defaults to the start of the string, i.e. index 0, and if
+          [last] is omitted is defaults to point just past the end of
+          [s], i.e. [length s].  Thus, [slice s] is equivalent to
+          [copy s].
+
+          Negative indexes are interpreted as counting from the end of
+          the string. For example, [slice ~last:-2 s] will return the
+          string [s], but without the last two characters.
+
+          This function {b never} raises any exceptions. If the
+          indexes are out of bounds they are automatically clipped.
+        *)
+
+       val lchop : string -> string
+       (** Returns the same string but without the first character.
+           does nothing if the string is empty. *)
+
+       val rchop : string -> string
+       (** Returns the same string but without the last character.
+          does nothing if the string is empty. *)
+
+       val of_int : int -> string
+       (** Returns the string representation of an int. *)
+
+       val of_float : float -> string
+       (** Returns the string representation of an float. *)
+
+       val of_char : char -> string
+       (** Returns a string containing one given character. *)
+
+       val to_int : string -> int
+       (** Returns the integer represented by the given string or
+           raises [Invalid_string] if the string does not represent an integer.*)
+
+       val to_float : string -> float
+       (** Returns the float represented by the given string or
+           raises Invalid_string if the string does not represent a float. *)
+
+       val ends_with : string -> string -> bool
+       (** [ends_with s x] returns true if the string [s] is ending with [x]. *)
+
+       val starts_with : string -> string -> bool
+       (** [starts_with s x] return true if [s] is starting with [x]. *)
+
+       val enum : string -> char Enum.t
+       (** Returns an enumeration of the characters of a string.*)
+
+       val of_enum : char Enum.t -> string
+       (** Creates a string from a character enumeration. *)
+       
+       val map : (char -> char) -> string -> string
+       (** [map f s] returns a string where all characters [c] in [s] have been
+               replaced by [f c]. **)
+
+       val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
+         (** [fold_left f a s] is
+             [f (... (f (f a s.[0]) s.[1]) ...) s.[n-1]] *)
+       val fold_right : (char -> 'a -> 'a) -> string -> 'a -> 'a
+         (** [fold_right f s b] is
+             [f s.[0] (f s.[1] (... (f s.[n-1] b) ...))] *)
+
+       val explode : string -> char list
+         (** [explode s] returns the list of characters in the string [s]. *)
+       val implode : char list -> string
+         (** [implode cs] returns a string resulting from concatenating
+             the characters in the list [cs]. *)
+
+       val strip : ?chars:string -> string -> string
+       (** Returns the string without the chars if they are at the beginning or
+               at the end of the string. By default chars are " \t\r\n". *)
+
+       val exists : string -> string -> bool
+       (** [exists str sub] returns true if [sub] is a substring of [str] or
+               false otherwise. *)
+
+       val replace_chars : (char -> string) -> string -> string
+       (** [replace_chars f s] returns a string where all chars [c] of [s] have been
+               replaced by the string returned by [f c]. *)
+
+        val replace : str:string -> sub:string -> by:string -> bool * string
+        (** [replace ~str ~sub ~by] returns a tuple constisting of a boolean
+               and a string where the first occurrence of the string [sub]
+               within [str] has been replaced by the string [by]. The boolean
+               is true if a subtitution has taken place. *)
+
+       (** {6 Older Functions} *)
+
+       (** Please refer to the Ocaml Manual for documentation of these
+               functions. *)
+
+       val length : string -> int
+       val get : string -> int -> char
+       val set : string -> int -> char -> unit
+       val create : int -> string
+       val make : int -> char -> string
+       val copy : string -> string
+       val sub : string -> int -> int -> string
+       val fill : string -> int -> int -> char -> unit
+       val blit : string -> int -> string -> int -> int -> unit
+       val concat : string -> string list -> string
+       val iter : (char -> unit) -> string -> unit
+       val escaped : string -> string
+       val index : string -> char -> int
+       val rindex : string -> char -> int
+       val index_from : string -> int -> char -> int
+       val rindex_from : string -> int -> char -> int
+       val contains : string -> char -> bool
+       val contains_from : string -> int -> char -> bool
+       val rcontains_from : string -> int -> char -> bool
+       val uppercase : string -> string
+       val lowercase : string -> string
+       val capitalize : string -> string
+       val uncapitalize : string -> string
+
+       type t = string
+       val compare : t -> t -> int
+
+       (**/**)
+
+       external unsafe_get : string -> int -> char = "%string_unsafe_get"
+       external unsafe_set : string -> int -> char -> unit = "%string_unsafe_set"
+       external unsafe_blit : string -> int -> string -> int -> int -> unit = "caml_blit_string" "noalloc"
+       external unsafe_fill : string -> int -> int -> char -> unit = "caml_fill_string" "noalloc"
+
+  end
diff --git a/bundles/extlib/extlib-1.5.2/global.ml b/bundles/extlib/extlib-1.5.2/global.ml
new file mode 100644 (file)
index 0000000..16d2af7
--- /dev/null
@@ -0,0 +1,40 @@
+(*
+ * Global - Mutable global variable
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+exception Global_not_initialized of string
+
+type 'a t = ('a option ref * string)
+
+let empty name = ref None,name
+
+let name = snd
+
+let set (r,_) v = r := Some v
+
+let get (r,name) =
+       match !r with
+       | None -> raise (Global_not_initialized name)
+       | Some v -> v
+
+let undef (r,_) = r := None
+
+let isdef (r,_) = !r <> None
+
+let opt (r,_) = !r
diff --git a/bundles/extlib/extlib-1.5.2/global.mli b/bundles/extlib/extlib-1.5.2/global.mli
new file mode 100644 (file)
index 0000000..904a7d4
--- /dev/null
@@ -0,0 +1,58 @@
+(*
+ * Global - Mutable global variable
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Mutable global variable.
+       Often in OCaml you want to have a global variable, which is mutable 
+    and uninitialized when declared. You can use a ['a option ref] but
+       this is not very convenient. The Global module provides functions
+       to easily create and manipulate such variables.
+*)
+
+type 'a t
+(** Abstract type of a global *)
+
+exception Global_not_initialized of string
+(** Raised when a global variable is accessed without first having been
+ assigned a value. The parameter contains the name of the global. *)
+
+val empty : string -> 'a t
+(** Returns an new named empty global. The name of the global can be any
+ string. It identifies the global and makes debugging easier. *)
+
+val name : 'a t -> string
+(** Retrieve the name of a global. *)
+
+val set : 'a t -> 'a -> unit
+(** Set the global value contents. *)
+
+val get : 'a t -> 'a
+(** Get the global value contents - raise Global_not_initialized if not
+ defined. *)
+
+val undef : 'a t -> unit 
+(** Reset the global value contents to undefined. *)
+
+val isdef : 'a t -> bool 
+  (** Return [true] if the global value has been set. *)
+
+val opt : 'a t -> 'a option 
+  (** Return [None] if the global is undefined, else [Some v] where v is the
+  current global value contents. *)
diff --git a/bundles/extlib/extlib-1.5.2/install.ml b/bundles/extlib/extlib-1.5.2/install.ml
new file mode 100644 (file)
index 0000000..193f683
--- /dev/null
@@ -0,0 +1,216 @@
+(*
+ * Install - ExtLib installation
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+open Printf
+
+type path =
+       | PathUnix
+       | PathDos
+
+let modules = [
+       "enum";
+       "bitSet";
+       "dynArray";
+       "extArray";
+       "extHashtbl";
+       "extList";
+       "extString";
+       "global";
+       "IO";
+       "option";
+       "pMap";
+       "std";
+       "uChar";
+       "uTF8";
+       "base64";
+       "unzip";
+       "refList";
+       "optParse";
+    "dllist";
+]
+
+let m_list suffix =
+       String.concat " " (List.map (fun m -> m ^ suffix) modules)
+
+let obj_ext , lib_ext , cp_cmd , path_type = match Sys.os_type with
+       | "Unix" | "Cygwin" | "MacOS" -> ".o" , ".a" , "cp", PathUnix
+       | "Win32" -> ".obj" , ".lib" , "copy", PathDos
+       | _ -> failwith "Unknown OS"
+
+let run cmd =
+       print_endline cmd;
+       let ecode = Sys.command cmd in
+       if ecode <> 0 then failwith (sprintf "Exit Code %d - Stopped" ecode)
+
+let copy file dest =
+       if dest <> "" && dest <> "." then begin
+               print_endline ("Installing " ^ file);
+               let path = dest ^ file in
+               (try Sys.remove path with _ -> ());
+               try
+                       Sys.rename file path;
+               with
+                       _ -> failwith "Aborted"
+       end
+
+let complete_path p =
+       if p = "" then
+               p
+       else
+               let c = p.[String.length p - 1] in
+               if c = '/' || c = '\\' then
+                       p
+               else
+                       p ^ (match path_type with PathUnix -> "/" | PathDos -> "\\")
+
+let remove file =
+       try
+               Sys.remove file
+       with
+               _ -> prerr_endline ("Warning : failed to delete " ^ file)
+
+let is_findlib() =
+       let findlib = Sys.command (if Sys.os_type = "Win32" then "ocamlfind printconf 2>NUL" else "ocamlfind printconf") = 0 in
+       if findlib then print_endline "Using Findlib";
+       findlib
+
+type install_dir = Findlib | Dir of string
+
+let install() =
+       let autodir = ref None in
+       let docflag = ref None in
+       let autodoc = ref false in
+       let autobyte = ref false in
+       let autonative = ref false in
+       let usage = "ExtLib installation program v1.3\n(c)2003,2004 Nicolas Cannasse" in
+       Arg.parse [
+               ("-d", Arg.String (fun s -> autodir := Some s) , "<dir> : install in target directory");
+               ("-b", Arg.Unit (fun () -> autobyte := true) , ": byte code installation");
+               ("-n", Arg.Unit (fun () -> autonative := true) , ": native code installation");
+               ("-doc", Arg.Unit (fun () -> docflag := Some true) , ": documentation installation");
+               ("-nodoc", Arg.Unit (fun () -> docflag := Some false) , ": documentation installation");
+       ] (fun s -> raise (Arg.Bad s)) usage;
+       let findlib = is_findlib () in
+       let install_dir = (
+               match !autodir with
+               | Some dir ->
+                       if not !autobyte && not !autonative && not !autodoc then failwith "Nothing to do.";
+                       Dir (complete_path dir)
+               | None ->
+                       let byte, native =
+                         if !autobyte || !autonative then
+                           (!autobyte, !autonative)
+                         else begin
+                       printf "Choose one of the following :\n1- Bytecode installation only\n2- Native installation only\n3- Both Native and Bytecode installation\n> ";
+                         (match read_line() with
+                               | "1" -> true, false
+                               | "2" -> false, true
+                               | "3" -> true, true
+                               | _ -> failwith "Invalid choice, exit.")
+                         end
+                       in
+                       let dest =
+                         if not findlib then begin
+                           printf "Choose installation directory :\n> ";
+                           let dest = complete_path (read_line()) in
+                           (try
+                             close_out (open_out (dest ^ "test.file"));
+                             Sys.remove (dest ^ "test.file");
+                           with
+                             _ -> failwith ("Directory " ^ dest ^ " does not exists or cannot be written."));
+                           Dir dest;
+                         end else Findlib in
+                       autobyte := byte;
+                       autonative := native;
+                       dest
+       ) in
+       let doc =
+               match !docflag with
+               Some doc -> doc
+               | None ->
+                       printf "Do you want to generate ocamldoc documentation (Y/N) ?\n> ";
+                       (match read_line() with
+                       | "y" | "Y" -> true
+                       | "n" | "N" -> false
+                       | _ -> failwith "Invalid choice, exit.")
+       in
+       autodoc := doc;
+       let doc_dir =
+         match install_dir with
+           Findlib -> "extlib-doc"
+         | Dir install_dir ->
+             sprintf "%sextlib-doc" install_dir in
+       if !autodoc && not (Sys.file_exists doc_dir) then run (sprintf "mkdir %s" doc_dir);
+       run (sprintf "ocamlc -c %s" (m_list ".mli"));
+       if !autobyte then begin
+               List.iter (fun m -> run (sprintf "ocamlc -c %s.ml" m)) modules;
+               run (sprintf "ocamlc -a -o extLib.cma %s extLib.ml" (m_list ".cmo"));
+               List.iter (fun m -> remove (m ^ ".cmo")) modules;
+               remove "extLib.cmo";
+       end;
+       if !autonative then begin
+               List.iter (fun m -> run (sprintf "ocamlopt -c %s.ml" m)) modules;
+               run (sprintf "ocamlopt -a -o extLib.cmxa %s extLib.ml" (m_list ".cmx"));
+               List.iter (fun m -> remove (m ^ obj_ext)) modules;
+               remove ("extLib" ^ obj_ext);
+       end;
+       if !autodoc then begin
+               run (sprintf "ocamldoc -sort -html -d %s %s" doc_dir (m_list ".mli"));
+               run ((match path_type with
+                               | PathDos -> sprintf "%s odoc_style.css %s\\style.css";
+                               | PathUnix -> sprintf "%s odoc_style.css %s/style.css") cp_cmd doc_dir);
+       end;
+       match install_dir with
+         Findlib ->
+           let files = Buffer.create 0 in
+           List.iter (fun m ->
+             Buffer.add_string files (m ^ ".cmi");
+             Buffer.add_char files ' ';
+             Buffer.add_string files (m ^ ".mli");
+             Buffer.add_char files ' ')
+             modules;
+           Buffer.add_string files "extLib.cmi ";
+           if !autobyte then Buffer.add_string files "extLib.cma ";
+           if !autonative then begin
+             Buffer.add_string files "extLib.cmxa ";
+             Buffer.add_string files ("extLib" ^ lib_ext^ " ");
+           end;
+           let files = Buffer.contents files in
+           run (sprintf "ocamlfind install extlib %s META" files);
+       | Dir install_dir ->
+           List.iter (fun m ->
+                       copy (m ^ ".cmi") install_dir;
+                       if !autonative then copy (m ^ ".cmx") install_dir
+               ) ("extLib" :: modules);
+           if !autobyte then copy "extLib.cma"  install_dir;
+           if !autonative then begin
+             copy "extLib.cmxa" install_dir;
+             copy ("extLib" ^ lib_ext) install_dir;
+           end;
+;;
+try
+       install();
+       printf "Done.";
+with
+       Failure msg ->
+               prerr_endline msg;
+               exit 1
+
+
diff --git a/bundles/extlib/extlib-1.5.2/odoc_style.css b/bundles/extlib/extlib-1.5.2/odoc_style.css
new file mode 100644 (file)
index 0000000..e1db9ad
--- /dev/null
@@ -0,0 +1,24 @@
+body { padding: 0px 20px 0px 26px; background: #ffffff; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; }
+h1 { padding : 5px 0px 5px 0px; font-size : 16pt; font-weight : normal; background-color : #E0E0FF }
+h6 { padding : 5px 0px 5px 20px; font-size : 16pt; font-weight : normal; background-color : #E0E0FF }
+a:link, a:visited, a:active { text-decoration: none; }
+a:link { color: #000077; }
+a:visited { color: #000077; }
+a:hover { color: #cc9900; }
+.keyword { font-weight : bold ; color : Blue }
+.keywordsign { color : #606060 }
+.superscript { font-size : 4 }
+.subscript { font-size : 4 }
+.comment { color : #606060 }
+.constructor { color : #808080; }
+.type { color : #606060 }
+.string { color : Red }
+.warning { color : Red ; font-weight : bold }
+.info { margin-left : 3em; margin-right : 3em }
+.code { color : #606060 ; }
+.title1 { font-size : 16pt ; background-color : #E0E0E0 }
+.title2 { font-size : 16pt ; background-color : #E0E0E0 }
+.title3 { font-size : 16pt ; background-color : #E0E0E0 }
+.title4 { font-size : 16pt ; background-color : #E0E0E0 }
+.title5 { font-size : 16pt ; background-color : #E0E0E0 }
+.title6 { font-size : 16pt ; background-color : #E0E0E0; }
\ No newline at end of file
diff --git a/bundles/extlib/extlib-1.5.2/optParse.ml b/bundles/extlib/extlib-1.5.2/optParse.ml
new file mode 100644 (file)
index 0000000..4ff4488
--- /dev/null
@@ -0,0 +1,720 @@
+(*
+ * optParse - Functions for parsing command line arguments.
+ * Copyright (C) 2004 Bardur Arantsson
+ *
+ * Heavily influenced by the optparse.py module from the Python
+ * standard library, but with lots of adaptation to the 'Ocaml Way'
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+open Printf
+open ExtString
+open ExtList
+
+
+let terminal_width =
+  try 
+    int_of_string (Sys.getenv "COLUMNS")    (* Might as well use it if it's there... *)
+  with
+    Failure _ -> 80
+  | Not_found -> 80
+
+module GetOpt =
+  struct
+
+    type action = string -> string list -> unit
+    type long_opt = string * int * action
+    type short_opt = char * int * action
+
+    exception Error of (string * string)
+
+    let split1 haystack needle =
+      try 
+        let (h, x) = String.split haystack needle in h, [x] 
+      with
+        Invalid_string -> haystack, []
+
+    let find_opt format_name options s =
+      let rec loop l =
+        match l with
+          (x, y, z) :: t -> if x = s then x, y, z else loop t
+        | [] -> raise (Error (format_name s, "no such option"))
+      in
+      loop options
+
+    let find_short_opt options = find_opt (fun c -> sprintf "-%c" c) options
+
+    let find_long_opt options = find_opt (fun s -> "--" ^ s) options
+
+    let parse other find_short_opt find_long_opt args =
+      let rec loop args =
+        let rec gather_args name n args =
+          try 
+            List.split_nth n args 
+          with
+            List.Invalid_index _ ->
+              raise (Error (name, "missing required arguments"))
+        in
+        let gather_long_opt s args =
+          let (h, t) = split1 s "=" in
+          let (_, nargs, action) = find_long_opt (String.slice ~first:2 h) in
+          let (accum, args') = gather_args h (nargs - List.length t) args in
+          action h (t @ accum); args'
+        in
+        let rec gather_short_opt_concat seen_args s k args =
+          if k < String.length s then
+            let ostr = sprintf "-%c" s.[k]
+            and (_, nargs, action) = find_short_opt s.[k] in
+            if nargs = 0 then
+              begin
+                action ostr [];
+                gather_short_opt_concat seen_args s (k + 1) args
+              end
+            else if not seen_args then
+              let (accum, args') = gather_args ostr nargs args in
+              action ostr accum; gather_short_opt_concat true s (k + 1) args'
+            else
+              raise
+                (Error
+                   (sprintf "-%c" s.[k],
+                    sprintf "option list '%s' already contains an option requiring an argument"
+                      s))
+          else args
+        in
+        let gather_short_opt s k args =
+          let ostr = sprintf "-%c" s.[k] in
+          let (_, nargs, action) = find_short_opt s.[k] in
+          if nargs = 0 then gather_short_opt_concat false s k args
+          else
+            let (accum, args') =
+              let h = String.slice ~first:(k+1) s in
+              if String.length h = 0 then gather_args ostr nargs args
+              else
+                let (t, args'') = gather_args ostr (nargs - 1) args in
+                h :: t, args''
+            in
+            action ostr accum; args'
+        in
+        match args with
+          [] -> []
+        | arg :: args' ->
+            if arg = "--" then args'
+            else if String.starts_with arg "--" then
+              loop (gather_long_opt arg args')
+            else if arg = "-" then begin other arg; loop args' end
+            else if String.starts_with arg "-" then
+              loop (gather_short_opt arg 1 args')
+            else begin other arg; loop args' end
+      in
+      let args' = loop args in List.iter other args'
+  end
+
+
+module Opt =
+  struct
+
+    exception No_value
+    exception Option_error of string * string
+    exception Option_help
+
+    type 'a t = { 
+      option_set : string -> string list -> unit;
+      option_set_value : 'a -> unit;
+      option_get : unit -> 'a option;
+      option_metavars : string list;
+      option_defhelp : string option 
+    }
+
+    let get opt =
+      match opt.option_get () with
+        Some x -> x
+      | None -> raise No_value
+
+    let set opt v =
+      opt.option_set_value v
+
+    let is_set opt = Option.is_some (opt.option_get ())
+
+    let opt opt = opt.option_get ()
+
+    let value_option metavar default coerce errfmt =
+      let data = ref default in
+      {
+        option_metavars = [metavar]; 
+        option_defhelp = None;
+        option_get = (fun _ -> !data);
+        option_set_value = (fun x -> data := Some x);
+        option_set =
+         (fun option args ->
+            let arg = List.hd args in
+              try 
+                data := Some (coerce arg)
+              with
+                  exn -> raise (Option_error (option, errfmt exn arg)))
+      }
+
+    let callback_option metavar coerce errfmt f =
+      {
+        option_metavars = [metavar]; 
+        option_defhelp = None;
+        option_get = (fun _ -> Some ());
+        option_set_value = (fun () -> ());
+        option_set =
+         (fun option args ->
+            let arg = List.hd args in
+            let datum = ref None in
+              begin 
+              try 
+                datum := Some (coerce arg)
+              with
+                  exn -> raise (Option_error (option, errfmt exn arg))
+              end;
+
+              Option.may f !datum)
+      }
+  end
+
+module StdOpt =
+  struct
+
+    open Opt
+
+    let store_const ?default const =
+      let data = ref default in
+      {
+        option_metavars = []; 
+        option_defhelp = None;
+        option_get = (fun _ -> !data);
+        option_set_value = (fun x -> data := Some x);
+        option_set = fun _ _ -> data := Some const
+      }
+
+    let store_true () = store_const ~default:false true
+
+    let store_false () = store_const ~default:true false
+
+    let int_option ?default ?(metavar = "INT") () =
+      value_option metavar default int_of_string
+        (fun _ s -> sprintf "invalid integer value '%s'" s)
+
+    let int_callback ?(metavar = "INT") =
+      callback_option metavar int_of_string
+        (fun _ s -> sprintf "invalid integer value '%s'" s)
+
+    let float_option ?default ?(metavar = "FLOAT") () =
+      value_option metavar default float_of_string
+        (fun _ s -> sprintf "invalid floating point value '%s'" s)
+
+    let float_callback ?(metavar = "FLOAT") =
+      callback_option metavar float_of_string
+        (fun _ s -> sprintf "invalid floating point value '%s'" s)
+
+    let str_option ?default ?(metavar = "STR") () =
+      value_option metavar default (fun s -> s) (fun _ _ -> "cannot happen")
+
+    let str_callback ?(metavar = "STR") =
+      callback_option metavar (fun s -> s) (fun _ _ -> "cannot happen")
+
+    let count_option ?(dest = ref 0) ?(increment = 1) () =
+      {
+        option_metavars = []; 
+        option_defhelp = None;
+        option_get = (fun _ -> Some !dest);
+        option_set_value = (fun x -> dest := x);
+        option_set = fun _ _ -> dest := !dest + increment
+      }
+
+    let incr_option ?(dest = ref 0) = 
+      count_option ~dest ~increment:1
+
+    let decr_option ?(dest = ref 0) = 
+      count_option ~dest ~increment:(-1)
+
+    let help_option () =
+      {
+        option_metavars = [];
+        option_defhelp = Some "show this help message and exit";
+        option_get = (fun _ -> raise No_value);
+        option_set_value = (fun _ -> ());
+        option_set = fun _ _ -> raise Option_help
+      }
+
+    let version_option vfunc =
+      {
+        option_metavars = [];
+        option_defhelp = Some "show program's version and exit";
+        option_get = (fun _ -> raise No_value);
+        option_set_value = (fun _ -> ());
+        option_set = fun _ _ -> print_endline (vfunc ()); exit 0
+      }
+  end
+
+
+
+
+module Formatter =
+  struct
+
+    (* Note that the whitespace regexps must NOT treat the non-breaking
+       space character as whitespace. *)
+    let whitespace = "\t\n\013\014\r "
+
+    let split_into_chunks s =
+      let buf = Buffer.create (String.length s) in
+      let flush () =
+        let s = Buffer.contents buf
+        in
+          Buffer.clear buf;
+          s
+      in
+      let rec loop state accum i =
+        if (i<String.length s) then
+          if ((state && not (String.contains whitespace s.[i])) || 
+              ((not state) && String.contains whitespace s.[i])) then
+            if Buffer.length buf > 0 then
+               loop (not state) (flush () :: accum) i 
+             else 
+               loop (not state) accum i
+          else
+            begin
+              Buffer.add_char buf s.[i];
+              loop state accum (i+1)
+            end
+        else
+          if Buffer.length buf > 0 then
+            flush () :: accum
+          else 
+            accum
+      in
+        List.rev (loop false [] 0)
+
+    let is_whitespace s =
+      let rec loop i =
+        if i<String.length s then
+          if String.contains whitespace s.[i] then
+            loop (i+1)
+          else 
+            false
+        else 
+          true
+      in
+        loop 0
+
+    let expand_tabs ?(tab_size = 8) s =
+      let len = String.length s in
+      let spaces n = String.make n ' '
+      and b = Buffer.create len in
+      let rec expand i col =
+        if i < len then
+          match s.[i] with
+            '\t' ->
+              let n = tab_size - col mod tab_size in
+              Buffer.add_string b (spaces n);
+              expand (i + 1) (col + n)
+          | '\n' -> 
+              Buffer.add_string b "\n";
+              expand (i + 1) 0
+          | c -> 
+              Buffer.add_char b c;
+              expand  (i + 1) (col + 1)
+      in
+      expand 0 0; 
+      Buffer.contents b
+
+    let wrap ?(initial_indent = 0) ?(subsequent_indent = 0) text _width =
+      let wrap_chunks_line width acc =
+        let rec wrap (chunks, cur_line, cur_len) =
+          match chunks with
+            [] -> [], cur_line, cur_len
+          | hd :: tl ->
+              let l = String.length hd in
+              if cur_len + l <= width then
+                wrap (tl, hd :: cur_line, cur_len + l)
+              else chunks, cur_line, cur_len
+        in
+        wrap acc
+      in
+      let wrap_long_last_word width (chunks, cur_line, cur_len) =
+        match chunks with
+          [] -> [], cur_line, cur_len
+        | hd :: tl ->
+            let l = String.length hd in
+            if l > width then
+              match cur_line with
+                [] -> tl, [hd], cur_len + l
+              | _ -> chunks, cur_line, cur_len
+            else chunks, cur_line, cur_len
+      in
+      let wrap_remove_last_ws (chunks, cur_line, cur_len) =
+        match cur_line with
+          [] -> chunks, cur_line, cur_len
+        | hd :: tl ->
+            if is_whitespace hd then chunks, tl, cur_len - String.length hd
+            else chunks, cur_line, cur_len
+      in
+      let rec wrap_chunks_lines chunks lines =
+        let indent =
+          match lines with
+            [] -> initial_indent
+          | _ -> subsequent_indent
+        in
+        let width = _width - indent in
+        match chunks with
+          hd :: tl ->
+            if is_whitespace hd && lines <> [] then wrap_chunks_lines tl lines
+            else (* skip *)
+              let (chunks', cur_line, _) =
+                wrap_remove_last_ws
+                  (wrap_long_last_word width
+                     (wrap_chunks_line width (chunks, [], 0)))
+              in
+              wrap_chunks_lines chunks'
+                ((String.make indent ' ' ^
+                    String.concat "" (List.rev cur_line)) ::
+                   lines)
+        | [] -> List.rev lines
+      in
+      let chunks = split_into_chunks (expand_tabs text) in
+      wrap_chunks_lines chunks []
+
+
+    let fill ?(initial_indent = 0) ?(subsequent_indent = 0) text width =
+      String.concat "\n" (wrap ~initial_indent ~subsequent_indent text width)
+
+
+
+    type t = { 
+      indent : unit -> unit;
+      dedent : unit -> unit;
+      format_usage : string -> string;
+      format_heading : string -> string;
+      format_description : string -> string;
+      format_option : char list * string list -> string list -> 
+                                             string option -> string
+    }
+
+    let format_option_strings short_first (snames, lnames) metavars =
+      let metavar = String.concat " " metavars in
+      let lopts =
+        List.map
+          (match metavar with
+             "" -> (fun z -> sprintf "--%s" z)
+           | _ -> fun z -> sprintf "--%s=%s" z metavar)
+          lnames
+      and sopts = List.map (fun x -> sprintf "-%c%s" x metavar) snames in
+      match short_first with
+        true -> String.concat ", " (sopts @ lopts)
+      | false -> String.concat ", " (lopts @ sopts)
+
+
+    let indented_formatter ?level:(extlevel = ref 0)
+      ?indent:(extindent = ref 0) ?(indent_increment = 2) 
+      ?(max_help_position = 24) ?(width = terminal_width - 1) 
+      ?(short_first = true) () =
+      let indent = ref 0
+      and level = ref 0 in
+      let help_position = ref max_help_position
+      and help_width = ref (width - max_help_position) in
+      {
+        indent =
+         (fun () ->
+            indent := !indent + indent_increment;
+            level := !level + 1;
+            extindent := !indent;
+            extlevel := !level);
+
+        dedent =
+         (fun () ->
+            indent := !indent - indent_increment;
+            level := !level - 1;
+            assert (!level >= 0);
+            extindent := !indent;
+            extlevel := !level);
+        
+        format_usage = (fun usage -> sprintf "usage: %s\n" usage);
+        
+        format_heading =
+         (fun heading -> sprintf "%*s%s:\n\n" !indent "" heading);
+        
+        format_description =
+         (fun description ->
+            let x =
+              fill ~initial_indent:(!indent) ~subsequent_indent:(!indent)
+                description (width - !indent)
+            in
+              if not (String.ends_with x "\n") then x ^ "\n\n" else x ^ "\n");
+        
+        format_option =
+         fun names metavars help ->
+           let opt_width = !help_position - !indent - 2 in
+           let opt_strings =
+             format_option_strings short_first names metavars
+           in
+           let buf = Buffer.create 256 in
+           let indent_first =
+             if String.length opt_strings > opt_width then
+               begin
+                 bprintf buf "%*s%s\n" !indent "" opt_strings; !help_position
+               end
+             else
+               begin
+                 bprintf buf "%*s%-*s  " !indent "" opt_width opt_strings; 0
+               end
+           in
+           Option.may
+             (fun option_help ->
+                let lines = wrap option_help !help_width in
+                match lines with
+                  h :: t ->
+                    bprintf buf "%*s%s\n" indent_first "" h;
+                    List.iter
+                      (fun x -> bprintf buf "%*s%s\n" !help_position "" x) t
+                | [] -> ())
+             help;
+
+           let contents =
+             Buffer.contents buf
+           in
+             if String.length contents > 0 && not (String.ends_with contents "\n") then
+               contents ^ "\n"
+             else
+               contents
+      }
+
+    let titled_formatter ?(level = ref 0) ?(indent = ref 0) 
+      ?(indent_increment = 0) ?(max_help_position = 24) 
+      ?(width = terminal_width - 1) ?(short_first = true) 
+      () =
+      let formatter =
+        indented_formatter ~level ~indent ~indent_increment ~max_help_position
+          ~width ~short_first ()
+      in
+      let format_heading h =
+        let c =
+          match !level with
+            0 -> '='
+          | 1 -> '-'
+          | _ -> failwith "titled_formatter: Too much indentation"
+        in
+        sprintf "%*s%s\n%*s%s\n\n" !indent "" (String.capitalize h) !indent ""
+          (String.make (String.length h) c)
+      in
+      let format_usage usage =
+        sprintf "%s  %s\n" (format_heading "Usage") usage
+      in
+      { formatter with 
+          format_usage = format_usage;
+          format_heading = format_heading
+      }
+  end
+
+
+
+open Opt
+open Formatter
+
+module OptParser =
+  struct
+
+    exception Option_conflict of string
+
+    type group = { 
+      og_heading : string;
+      og_description : string option;
+      og_options :
+        ((char list * string list) * string list * string option) RefList.t;
+      og_children : group RefList.t 
+    }
+
+    type t = { 
+      op_usage : string;
+      op_suppress_usage : bool;
+      op_prog : string;
+
+      op_formatter : Formatter.t;
+      
+      op_long_options : GetOpt.long_opt RefList.t;
+      op_short_options : GetOpt.short_opt RefList.t;
+      
+      op_groups : group 
+    }
+
+    let unprogify optparser s =
+      (snd (String.replace ~str:s ~sub:"%prog" ~by:optparser.op_prog))
+
+    let add optparser ?(group = optparser.op_groups) ?help ?(hide = false)
+      ?short_name ?(short_names = []) ?long_name ?(long_names = []) opt =
+      let lnames =
+        match long_name with
+            None -> long_names
+          | Some x -> x :: long_names
+      and snames =
+        match short_name with
+            None -> short_names
+          | Some x -> x :: short_names
+      in
+      if lnames = [] && snames = [] then
+        failwith "Options must have at least one name"
+      else
+        (* Checking for duplicates: *)
+        let snames' =
+          List.fold_left (fun r (x, _, _) -> x :: r) []
+            (RefList.to_list optparser.op_short_options)
+        and lnames' =
+          List.fold_left (fun r (x, _, _) -> x :: r) []
+            (RefList.to_list optparser.op_long_options)
+        in
+        let sconf =
+          List.filter (fun e -> List.exists (( = ) e) snames') snames
+        and lconf =
+          List.filter (fun e -> List.exists (( = ) e) lnames') lnames
+        in
+        if List.length sconf > 0 then
+          raise (Option_conflict (sprintf "-%c" (List.hd sconf)))
+        else if List.length lconf > 0 then
+          raise (Option_conflict (sprintf "--%s" (List.hd lconf)));
+          
+        (* Add to display list. *)
+        if not hide then
+          RefList.add group.og_options
+            ((snames, lnames), opt.option_metavars,
+             (match help with
+                  None -> opt.option_defhelp
+                | Some _ -> help));
+          
+        (* Getopt: *)
+        let nargs = List.length opt.option_metavars in
+          List.iter
+            (fun short ->
+               RefList.add optparser.op_short_options
+               (short, nargs, opt.option_set))
+            snames;
+          List.iter
+            (fun long ->
+               RefList.add optparser.op_long_options
+               (long, nargs, opt.option_set))
+            lnames
+            
+    let add_group optparser ?(parent = optparser.op_groups) ?description heading =
+      let g =
+        {
+          og_heading = heading; 
+          og_description = description;
+          og_options = RefList.empty (); 
+          og_children = RefList.empty ()
+        }
+      in
+      RefList.add parent.og_children g; g
+
+    let make ?(usage = "%prog [options]") ?description ?version
+      ?(suppress_usage = false) ?(suppress_help = false) ?prog 
+      ?(formatter = Formatter.indented_formatter ()) () =
+      let optparser =
+        {
+          op_usage = usage; 
+          op_suppress_usage = suppress_usage;
+          op_prog = Option.default (Filename.basename Sys.argv.(0)) prog;
+          op_formatter = formatter; 
+          op_short_options = RefList.empty ();
+          op_long_options = RefList.empty ();
+          op_groups = {
+            og_heading = "options"; 
+            og_options = RefList.empty ();
+            og_children = RefList.empty ();
+            og_description = description
+          }
+        }
+      in
+      Option.may                         (* Add version option? *)
+        (fun version ->
+           add optparser ~long_name:"version"
+             (StdOpt.version_option
+                (fun () -> unprogify optparser version)))
+        version;
+      if not suppress_help then              (* Add help option? *)
+        add optparser ~short_name:'h' ~long_name:"help"
+          (StdOpt.help_option ());
+
+      optparser
+
+    let format_usage optparser eol =
+      match optparser.op_suppress_usage with
+        true -> ""
+      | false ->
+          unprogify optparser
+            (optparser.op_formatter.format_usage optparser.op_usage) ^ eol
+
+    let error optparser ?(chn = stderr) ?(status = 1) message =
+      fprintf chn "%s%s: %s\n" (format_usage optparser "\n") optparser.op_prog
+        message;
+      flush chn;
+      exit status
+
+    let usage optparser ?(chn = stdout) () =
+      let rec loop g =
+        (* Heading: *)
+        output_string chn
+          (optparser.op_formatter.format_heading g.og_heading);
+
+        optparser.op_formatter.indent ();
+        (* Description: *)
+        Option.may
+          (fun x ->
+             output_string chn (optparser.op_formatter.format_description x))
+          g.og_description;
+        (* Options: *)
+        RefList.iter
+          (fun (names, metavars, help) ->
+             output_string chn
+               (optparser.op_formatter.format_option names metavars help))
+          g.og_options;
+        (* Child groups: *)
+        output_string chn "\n";
+        RefList.iter loop g.og_children;
+
+        optparser.op_formatter.dedent ()
+      in
+      output_string chn (format_usage optparser "\n");
+      loop optparser.op_groups;
+      flush chn
+
+    let parse optparser ?(first = 0) ?last argv =
+      let args = RefList.empty ()
+      and n =
+        match last with
+          None -> Array.length argv - first
+        | Some m -> m - first + 1
+      in
+      begin 
+        try
+          GetOpt.parse (RefList.push args)
+            (GetOpt.find_short_opt
+               (RefList.to_list optparser.op_short_options))
+            (GetOpt.find_long_opt (RefList.to_list optparser.op_long_options))
+            (Array.to_list (Array.sub argv first n))
+        with
+            GetOpt.Error (opt, errmsg) ->
+              error optparser (sprintf "option '%s': %s" opt errmsg)
+          | Option_error (opt, errmsg) ->
+              error optparser (sprintf "option '%s': %s" opt errmsg)
+          | Option_help -> usage optparser (); exit 0
+      end;
+      List.rev (RefList.to_list args)
+
+    let parse_argv optparser = 
+      parse optparser ~first:1 Sys.argv
+  end
diff --git a/bundles/extlib/extlib-1.5.2/optParse.mli b/bundles/extlib/extlib-1.5.2/optParse.mli
new file mode 100644 (file)
index 0000000..92b9f9c
--- /dev/null
@@ -0,0 +1,466 @@
+(*
+ * optParse - Functions for parsing command line arguments.
+ * Copyright (C) 2004 Bardur Arantsson
+ *
+ * Heavily influenced by the optparse.py module from the Python
+ * standard library, but with lots of adaptation to the 'Ocaml Way'
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Modules for GNU [getopt(3)]-style command line parsing. *)
+
+
+(** This module contains the basic functions and types for defining
+  new option types and accessing the values of options. *)
+module Opt :
+  sig
+
+    (** {6 Exceptions} *)
+
+    exception No_value
+    (** [No_value] gets raised by {!OptParse.Opt.get} when an option
+      value is not available. *)
+
+    exception Option_error of string * string
+    (** This exception signals that an option value is invalid. The
+      first string contains the option string ('-x' or '--long-name')
+      and the second string contains an error message.
+
+      This exception is only used when implementing custom option types
+      and can never "escape" the scope of a {!OptParse.OptParser.parse}.
+      The user should therefore not attempt to catch it.  *)
+
+    exception Option_help
+    (** When an option wants to display a usage message, this exception
+      may be raised.  It can never "escape" the scope of a
+      {!OptParse.OptParser.parse} call and the user should therefore not
+      attempt to catch it. *)
+
+
+    (** {6 Types} *)
+
+    type 'a t = {
+      option_set : string -> string list -> unit;
+      option_set_value : 'a -> unit;
+      option_get : unit -> 'a option;
+      option_metavars : string list;
+      option_defhelp : string option
+    }
+    (** Option type.
+
+      [option_set] is a closure which converts and records the value of
+      an option so that it can be retrieved with a later call to the
+      [option_get] closure. It is called with the option name which was
+      given on the command line and a list of strings, each representing
+      one of the argument values given on the command line. It may raise
+      [Option_error] if the value is invalid (for whatever reason).
+
+      [option_set_value] is a closure which sets the value of an option
+      to a particular value.
+
+      [option_get] is a closure which retrieves the recorded value
+      of the option. If the option value has not been set from the
+      command line, the default value is used.  If there is no default
+      value, then [None] should be returned.
+
+      [option_metavars] is a list of "meta-variables" (arguments)
+      which this option accepts. This is mainly for display purposes,
+      but the length of this list determines how many arguments the
+      option parser accepts for this option (currently only lists of
+      length 0 or 1 are supported).
+
+      [option_defhelp] is the default help string (if any).  It is
+      used for displaying help messages whenever the user does {b
+      not} specify a help string manually when adding this
+      option. Using a non-None value here only makes sense for
+      completely generic options like {!OptParse.StdOpt.help_option}.
+
+    *)
+
+
+    (** {6 Option value retrieval} *)
+
+    val get : 'a t -> 'a
+    (** Get the value of an option.
+
+      @return the value of the option. If the option has not been
+      encountered while parsing the command line, the default value is
+      returned.
+
+      @raise No_value if no default values has been given
+      and the option value has not been set from the command line.
+
+    *)
+
+    val set : 'a t -> 'a -> unit
+    (** Set the value of an option. *)
+
+    val opt : 'a t -> 'a option
+    (** Get the value of an option as an optional value.
+
+      @return [Some x] if the option has value [x] (either by default or
+      from the command line). If the option doesn't have a value [None]
+      is returned. *)
+
+    val is_set : 'a t -> bool
+    (** Find out if the option has a value (either by default or
+      from the command line).
+
+      @return [True] iff the option has a value.
+    *)
+
+
+
+    (** {6 Option creation} *)
+
+    val value_option :
+      string -> 'a option -> (string -> 'a) -> (exn -> string -> string) ->
+        'a t
+    (** Make an option which takes a single argument.
+
+      [value_option metavar default coerce errfmt] returns an option
+      which takes a single argument from the command line and calls
+      [coerce] to coerce it to the proper type. If [coerce] raises an
+      exception, [exn], then [errfmt exn argval] is called to generate
+      an error message for display. [metavar] is the name of the
+      metavariable of the option.
+
+      [default] is the default value of the option. If [None], the the
+      option has no default value.
+
+      @return the newly created option.
+
+    *)
+
+    val callback_option :
+      string -> (string -> 'a) -> (exn -> string -> string) -> ('a -> unit) ->
+        unit t
+    (** Make a callback option which takes a single argument.
+
+      [callback_option metavar coerce errfmt f] returns an option which
+      takes a single argument from the command line and calls [coerce]
+      to coerce it to the proper type. If [coerce] raises an exception
+      [errfmt exn argval] is called to format an error message for
+      display. If [coerce] succeeds, the callback function [f] is called
+      with the coerced value. Finally, [metavar] is the name of the
+      metavariable of the option.
+
+      @return the newly created option.
+    *)
+
+
+  end
+
+
+(** This module contains various standard options. *)
+module StdOpt :
+  sig
+
+    (** {6 Flag options} *)
+
+    val store_const : ?default: 'a -> 'a -> 'a Opt.t
+    (** [store_const ?default const] returns a flag option which
+      stores the constant value [const] when the option is
+      encountered on the command line. *)
+
+    val store_true : unit -> bool Opt.t
+    (** [store_true ()] returns an option which is set to true when
+      it is encountered on the command line. The default value is
+      false. *)
+
+    val store_false : unit -> bool Opt.t
+    (** [store_false ()] returns an option which is set to false when
+      it is encountered on the command line. The default value is
+      true. *)
+
+    val count_option : ?dest: int ref -> ?increment: int -> unit -> int Opt.t
+    (** Create a counting option which increments its value each time the
+      option is encountered on the command line.
+
+      @param increment Increment to add to the option value each
+      time the option is encountered.
+
+      @param dest Reference to the option value. Useful for making
+      options like '--quiet' and '--verbose' sharing a single value.
+
+      @return the newly created option.
+    *)
+
+    val incr_option : ?dest: int ref -> unit -> int Opt.t
+    (** Exactly identical to [count_option ~dest:dest ~increment:1 ()]. *)
+
+    val decr_option : ?dest: int ref -> unit -> int Opt.t
+    (** Exactly identical to [count_option ~dest:dest ~increment:(-1) ()]. *)
+
+
+    (** {6 Value options} *)
+
+    val int_option : ?default: int -> ?metavar: string -> unit -> int Opt.t
+    (** [int_option ?default ?metavar ()] returns an option which takes
+      a single integer argument. If [~default] is given it is the
+      default value returned when the option has not been encountered
+      on the command line. *)
+
+    val float_option :
+      ?default: float -> ?metavar: string -> unit -> float Opt.t
+    (** See {!OptParse.StdOpt.int_option}. *)
+
+    val str_option :
+      ?default: string -> ?metavar: string -> unit -> string Opt.t
+    (** See {!OptParse.StdOpt.int_option}. *)
+
+
+    (** {6 Callback options} *)
+
+    val int_callback : ?metavar: string -> (int -> unit) -> unit Opt.t
+    (** [int_callback ?metavar f] returns an option which takes a single
+      integer argument and calls [f] with that argument when encountered
+      on the command line. *)
+
+    val float_callback : ?metavar: string -> (float -> unit) -> unit Opt.t
+    (** See {!OptParse.StdOpt.int_callback}. *)
+
+    val str_callback : ?metavar: string -> (string -> unit) -> unit Opt.t
+    (** See {!OptParse.StdOpt.int_callback}. *)
+
+
+    (** {6 Special options} *)
+
+    val help_option : unit -> 'a Opt.t
+    (** [help_option ()] returns the standard help option which
+      displays a usage message and exits the program when encountered
+      on the command line. *)
+
+    val version_option : (unit -> string) -> 'a Opt.t
+    (** [version_option f] returns the standard version option which
+      displays the string returned by [f ()] (and nothing else) on
+      standard output and exits. *)
+
+  end
+
+
+(** This module contains the types and functions for implementing
+  custom usage message formatters. *)
+module Formatter :
+  sig
+    type t = {
+      indent : unit -> unit; (** Increase the indentation level. *)
+      dedent : unit -> unit; (** Decrease the indentation level. *)
+      format_usage : string -> string; (** Format usage string into style of this formatter. *)
+      format_heading : string -> string; (** Format heading into style of this formatter. *)
+      format_description : string -> string; (** Format description into style of this formatter. *)
+      format_option :
+        char list * string list -> string list -> string option -> string (** Format option into style of this formatter (see explanation below). *)
+    }
+
+    (** This is the type of a formatter. The [format_option] has
+      signature [format_option (snames,lnames) metavars help], where
+      [snames] is a list of the short option names, [lnames] is a
+      list of the long option names, [metavars] is a list of the
+      metavars the option takes as arguments, and [help] is the help
+      string supplied by the user.  *)
+
+
+    (** {6 Standard formatters} *)
+
+
+    val indented_formatter :
+      ?level: int ref -> ?indent: int ref -> ?indent_increment: int ->
+        ?max_help_position: int -> ?width: int -> ?short_first: bool ->
+        unit -> t
+    (** Create an "indented" formatter with the given options.
+
+      @param width Total with of the usage messages printed.
+
+      @param max_help_position Maximum starting column for the help
+      messages relating to each option.
+
+      @param short_first List all the short option names first?
+
+      @param indent_increment Number of columns to indent by when
+      more indentation is required.
+
+      @param indent Reference to the current indentation amount. Its
+      value reflects changes in indentation level.
+
+      @param level Reference to the current indentation level. Its
+      value reflects changes in indentation level.  *)
+
+    val titled_formatter : ?level: int ref -> ?indent: int ref ->
+      ?indent_increment: int -> ?max_help_position: int ->
+      ?width: int -> ?short_first: bool -> unit -> t
+    (** Creates a titled formatter which is quite similar to the
+      indented formatter. See
+      {!OptParse.Formatter.indented_formatter} for a description of
+      the options. *)
+
+
+    (** {6 Low-level formatting} *)
+
+
+    val wrap : ?initial_indent: int -> ?subsequent_indent: int ->
+      string -> int -> string list
+    (** [wrap text width] reflows the given text paragraph into lines
+      of width at most [width] (lines may exceed this if the are
+      single words that exceed this limit).
+
+      @param initial_indent Indentation of the first line.
+
+      @param subsequent_indent Indentation of the following lines.
+
+      @return a list of lines making up the reformatted paragraph. *)
+
+    val fill : ?initial_indent: int -> ?subsequent_indent: int ->
+      string -> int -> string
+    (** See {!OptParse.Formatter.wrap}.
+
+      @return a string containing the reformatted paragraph. *)
+
+  end
+
+
+
+(** This module contains the option parser itself.
+
+  It provides functions to create, populate and use option parsers to
+  parse command line arguments. *)
+module OptParser :
+  sig
+
+    (** {6 Exceptions} *)
+
+
+    exception Option_conflict of string
+    (** [Option_conflict name] is raised by {!OptParse.OptParser.add}
+      when two different options are added with identical
+      names. Usually this doesn't need to be caught since this error
+      is usually easily fixed permanently by removing/renaming the
+      conflicting option names. *)
+
+
+    (** {6 Types} *)
+
+
+    type t
+    (** The type of an option parser. *)
+
+    type group
+    (** The type of an option group. *)
+
+
+    (** {6 Option parser creation} *)
+
+    val make : ?usage: string -> ?description: string -> ?version: string ->
+      ?suppress_usage: bool -> ?suppress_help: bool -> ?prog: string ->
+      ?formatter: Formatter.t -> unit -> t
+    (** Creates a new option parser with the given options.
+
+      @param usage Usage message. The default is a reasonable usage
+      message for most programs. Any occurrence of the substring
+      ["%prog"] in [usage] is replaced with the name of the program
+      (see [prog]).
+
+      @param prog Program name. The default is the base name of the
+      executable.
+
+      @param suppress_usage Suppress the usage message if set.
+
+      @param suppress_help Suppress the 'help' option which is
+      otherwise added by default.
+
+      @param version Version string. If set, a '--version' option is
+      automatically added. When encountered on the command line it
+      causes [version] to be printed to the standard output and the
+      program to exit.
+
+      @param description: description of the main purpose of the
+      program.
+
+      @return the new option parser.
+
+    *)
+
+
+    val add : t -> ?group: group -> ?help: string -> ?hide: bool ->
+        ?short_name: char -> ?short_names: char list -> ?long_name: string ->
+        ?long_names: string list -> 'a Opt.t -> unit
+    (** Add an option to the option parser.
+
+      @raise Option_conflict if the short name(s) or long name(s)
+      have alread been used for some other option.
+
+      @param help Short help message describing the option (for the usage message).
+
+      @param hide If true, hide the option from the usage
+      message. This can be used to implement "secret" options which
+      are not shown, but work just the same as regular options in all
+      other respects.
+
+      @param short_name is the name for the short form of the option
+      (e.g. ['x'] means that the option is invoked with [-x] on the
+      command line).
+
+      @param short_names is a list of names for the short form of the
+      option (see [short_name]).
+
+      @param long_name is the name for the long form of the option
+      (e.g. ["xyzzy"] means that the option is invoked with [--xyzzy]
+      on the command line).
+
+      @param long_names is a list of names for the long form of the
+      option (see [long_name]).
+    *)
+
+
+    val add_group : t -> ?parent: group -> ?description: string ->
+      string -> group
+    (** Add a group to the option parser.
+
+      @param parent is the parent group (if any).
+
+      @param description is a description of the group.
+
+      @return the new group.
+
+    *)
+
+    (** {6 Output and error handling} *)
+
+    val error : t -> ?chn: out_channel -> ?status: int -> string -> unit
+    (** Display an error message and exit the program. The error
+      message is printed to the channel [chn] (default is
+      [Pervasives.stderr]) and the program exits with exit status
+      [status] (default is 1). *)
+
+    val usage : t -> ?chn: out_channel -> unit -> unit
+    (** Display the usage message to the channel [chn] (default is
+      [Pervasives.stdout]) and return. *)
+
+
+    (** {6 Option parsing} *)
+
+    val parse : t -> ?first: int -> ?last: int -> string array -> string list
+    (** Parse arguments as if the arguments [args.(first)],
+      [args.(first+1)], ..., [args.(last)] had been given on the
+      command line. By default [first] is 0 and [last] is the index
+      of the last element of the array. *)
+
+    val parse_argv : t -> string list
+    (** Parse all the arguments in [Sys.argv]. *)
+
+  end
diff --git a/bundles/extlib/extlib-1.5.2/option.ml b/bundles/extlib/extlib-1.5.2/option.ml
new file mode 100644 (file)
index 0000000..ab6fffd
--- /dev/null
@@ -0,0 +1,49 @@
+(*
+ * Option - functions for the option type
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+exception No_value
+
+let may f = function
+       | None -> ()
+       | Some v -> f v
+
+let map f = function
+       | None -> None
+       | Some v -> Some (f v)
+
+let default v = function
+       | None -> v
+       | Some v -> v
+
+let is_some = function
+       | None -> false
+       | _ -> true
+
+let is_none = function
+       | None -> true
+       | _ -> false
+
+let get = function
+       | None -> raise No_value
+       | Some v -> v
+
+let map_default f v = function
+       | None -> v
+       | Some v2 -> f v2
diff --git a/bundles/extlib/extlib-1.5.2/option.mli b/bundles/extlib/extlib-1.5.2/option.mli
new file mode 100644 (file)
index 0000000..0fba89e
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+ * Options - functions for the option type
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Functions for the option type.
+
+    Options are an Ocaml standard type that can be either [None] (undefined)
+       or [Some x] where x can be any value. Options are widely used in Ocaml
+       to represent undefined values (a little like NULL in C, but in a type
+       and memory safe way). This module adds some functions for working with
+       options.
+*)
+
+val may : ('a -> unit) -> 'a option -> unit
+(** [may f (Some x)] calls [f x] and [may f None] does nothing. *)
+
+val map : ('a -> 'b) -> 'a option -> 'b option
+(** [map f (Some x)] returns [Some (f x)] and [map None] returns [None]. *)
+
+val default : 'a -> 'a option -> 'a
+(** [default x (Some v)] returns [v] and [default x None] returns [x]. *)
+
+val map_default : ('a -> 'b) -> 'b -> 'a option -> 'b
+(** [map_default f x (Some v)] returns [f v] and [map_default f x None]
+       returns [x]. *)
+
+val is_none : 'a option -> bool
+(** [is_none None] returns [true] otherwise it returns [false]. *)
+
+val is_some : 'a option -> bool
+(** [is_some (Some x)] returns [true] otherwise it returns [false]. *)
+
+val get : 'a option -> 'a
+(** [get (Some x)] returns [x] and [get None] raises [No_value]. *)
+
+exception No_value
+(** Raised when calling [get None]. *)
diff --git a/bundles/extlib/extlib-1.5.2/pMap.ml b/bundles/extlib/extlib-1.5.2/pMap.ml
new file mode 100644 (file)
index 0000000..b63c64e
--- /dev/null
@@ -0,0 +1,197 @@
+(*
+ * PMap - Polymorphic maps
+ * Copyright (C) 1996-2003 Xavier Leroy, Nicolas Cannasse, Markus Mottl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type ('k, 'v) map =
+  | Empty
+  | Node of ('k, 'v) map * 'k * 'v * ('k, 'v) map * int
+
+type ('k, 'v) t =
+  {
+    cmp : 'k -> 'k -> int;
+    map : ('k, 'v) map;
+  }
+
+let height = function
+  | Node (_, _, _, _, h) -> h
+  | Empty -> 0
+
+let make l k v r = Node (l, k, v, r, max (height l) (height r) + 1)
+
+let bal l k v r =
+  let hl = height l in
+  let hr = height r in
+  if hl > hr + 2 then
+    match l with
+    | Node (ll, lk, lv, lr, _) ->
+        if height ll >= height lr then make ll lk lv (make lr k v r)
+        else
+          (match lr with
+          | Node (lrl, lrk, lrv, lrr, _) ->
+              make (make ll lk lv lrl) lrk lrv (make lrr k v r)
+          | Empty -> assert false)
+    | Empty -> assert false
+  else if hr > hl + 2 then
+    match r with
+    | Node (rl, rk, rv, rr, _) ->
+        if height rr >= height rl then make (make l k v rl) rk rv rr
+        else
+          (match rl with
+          | Node (rll, rlk, rlv, rlr, _) ->
+              make (make l k v rll) rlk rlv (make rlr rk rv rr)
+          | Empty -> assert false)
+    | Empty -> assert false
+  else Node (l, k, v, r, max hl hr + 1)
+
+let rec min_binding = function
+  | Node (Empty, k, v, _, _) -> k, v
+  | Node (l, _, _, _, _) -> min_binding l
+  | Empty -> raise Not_found
+
+let rec remove_min_binding = function
+  | Node (Empty, _, _, r, _) -> r
+  | Node (l, k, v, r, _) -> bal (remove_min_binding l) k v r
+  | Empty -> invalid_arg "PMap.remove_min_binding"
+
+let merge t1 t2 =
+  match t1, t2 with
+  | Empty, _ -> t2
+  | _, Empty -> t1
+  | _ ->
+      let k, v = min_binding t2 in
+      bal t1 k v (remove_min_binding t2)
+
+let create cmp = { cmp = cmp; map = Empty }
+let empty = { cmp = compare; map = Empty }
+
+let is_empty x = 
+       x.map = Empty
+
+let add x d { cmp = cmp; map = map } =
+  let rec loop = function
+    | Node (l, k, v, r, h) ->
+        let c = cmp x k in
+        if c = 0 then Node (l, x, d, r, h)
+        else if c < 0 then
+          let nl = loop l in
+          bal nl k v r
+        else
+          let nr = loop r in
+          bal l k v nr
+    | Empty -> Node (Empty, x, d, Empty, 1) in
+  { cmp = cmp; map = loop map }
+
+let find x { cmp = cmp; map = map } =
+  let rec loop = function
+    | Node (l, k, v, r, _) ->
+        let c = cmp x k in
+        if c < 0 then loop l
+        else if c > 0 then loop r
+        else v
+    | Empty -> raise Not_found in
+  loop map
+
+let remove x { cmp = cmp; map = map } =
+  let rec loop = function
+    | Node (l, k, v, r, _) ->
+        let c = cmp x k in
+        if c = 0 then merge l r else
+        if c < 0 then bal (loop l) k v r else bal l k v (loop r)
+    | Empty -> Empty in
+  { cmp = cmp; map = loop map }
+
+let mem x { cmp = cmp; map = map } =
+  let rec loop = function
+    | Node (l, k, v, r, _) ->
+        let c = cmp x k in
+        c = 0 || loop (if c < 0 then l else r)
+    | Empty -> false in
+  loop map
+
+let exists = mem
+
+let iter f { map = map } =
+  let rec loop = function
+    | Empty -> ()
+    | Node (l, k, v, r, _) -> loop l; f k v; loop r in
+  loop map
+
+let map f { cmp = cmp; map = map } =
+  let rec loop = function
+    | Empty -> Empty
+    | Node (l, k, v, r, h) -> 
+         let l = loop l in
+         let r = loop r in
+         Node (l, k, f v, r, h) in
+  { cmp = cmp; map = loop map }
+
+let mapi f { cmp = cmp; map = map } =
+  let rec loop = function
+    | Empty -> Empty
+    | Node (l, k, v, r, h) ->
+         let l = loop l in
+         let r = loop r in
+         Node (l, k, f k v, r, h) in
+  { cmp = cmp; map = loop map }
+
+let fold f { cmp = cmp; map = map } acc =
+  let rec loop acc = function
+    | Empty -> acc
+    | Node (l, k, v, r, _) ->
+         loop (f v (loop acc l)) r in
+  loop acc map
+
+let foldi f { cmp = cmp; map = map } acc =
+  let rec loop acc = function
+    | Empty -> acc
+       | Node (l, k, v, r, _) ->
+       loop (f k v (loop acc l)) r in
+  loop acc map
+
+let rec enum m =
+  let rec make l =
+    let l = ref l in
+    let rec next() =
+      match !l with
+      | [] -> raise Enum.No_more_elements
+      | Empty :: tl -> l := tl; next()
+      | Node (m1, key, data, m2, h) :: tl ->
+        l := m1 :: m2 :: tl;
+        (key, data)
+    in
+    let count() =
+      let n = ref 0 in
+      let r = !l in
+      try
+        while true do
+          ignore (next());
+          incr n
+        done;
+        assert false
+      with
+               Enum.No_more_elements -> l := r; !n
+    in
+    let clone() = make !l in
+       Enum.make ~next ~count ~clone
+  in
+  make [m.map]
+
+
+let uncurry_add (k, v) m = add k v m
+let of_enum ?(cmp = compare) e = Enum.fold uncurry_add (create cmp) e
diff --git a/bundles/extlib/extlib-1.5.2/pMap.mli b/bundles/extlib/extlib-1.5.2/pMap.mli
new file mode 100644 (file)
index 0000000..01f2c8c
--- /dev/null
@@ -0,0 +1,92 @@
+(*
+ * PMap - Polymorphic maps
+ * Copyright (C) 1996-2003 Xavier Leroy, Nicolas Cannasse, Markus Mottl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Polymorphic Map.
+
+       This is a polymorphic map, similar to standard library [Map] module
+       but in a defunctorized style.
+*)
+
+type ('a, 'b) t
+
+val empty : ('a, 'b) t
+(** The empty map, using [compare] as key comparison function. *)
+
+val is_empty : ('a, 'b) t -> bool
+(** returns true if the map is empty. *)
+
+val create : ('a -> 'a -> int) -> ('a, 'b) t
+(** creates a new empty map, using the provided function for key comparison.*)
+
+val add : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t
+(** [add x y m] returns a map containing the same bindings as
+    [m], plus a binding of [x] to [y]. If [x] was already bound
+    in [m], its previous binding disappears. *)
+
+val find : 'a -> ('a, 'b) t -> 'b
+(** [find x m] returns the current binding of [x] in [m],
+    or raises [Not_found] if no such binding exists. *)
+
+val remove : 'a -> ('a, 'b) t -> ('a, 'b) t
+(** [remove x m] returns a map containing the same bindings as
+    [m], except for [x] which is unbound in the returned map. *)
+
+val mem : 'a -> ('a, 'b) t -> bool
+(** [mem x m] returns [true] if [m] contains a binding for [x],
+    and [false] otherwise. *)
+
+val exists : 'a -> ('a, 'b) t -> bool
+(** same as [mem]. *)
+
+val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
+(** [iter f m] applies [f] to all bindings in map [m].
+    [f] receives the key as first argument, and the associated value
+    as second argument. The order in which the bindings are passed to
+    [f] is unspecified. Only current bindings are presented to [f]:
+    bindings hidden by more recent bindings are not passed to [f]. *)
+
+val map : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t
+(** [map f m] returns a map with same domain as [m], where the
+    associated value [a] of all bindings of [m] has been
+    replaced by the result of the application of [f] to [a].
+    The order in which the associated values are passed to [f]
+    is unspecified. *)
+
+val mapi : ('a -> 'b -> 'c) -> ('a, 'b) t -> ('a, 'c) t
+(** Same as [map], but the function receives as arguments both the
+    key and the associated value for each binding of the map. *)
+
+val fold : ('b -> 'c -> 'c) -> ('a , 'b) t -> 'c -> 'c
+(** [fold f m a] computes [(f kN dN ... (f k1 d1 a)...)],
+    where [k1 ... kN] are the keys of all bindings in [m],
+    and [d1 ... dN] are the associated data.
+    The order in which the bindings are presented to [f] is
+    unspecified. *)
+
+val foldi : ('a -> 'b -> 'c -> 'c) -> ('a , 'b) t -> 'c -> 'c
+(** Same as [fold], but the function receives as arguments both the
+    key and the associated value for each binding of the map. *)
+
+val enum : ('a, 'b) t -> ('a * 'b) Enum.t
+(** creates an enumeration for this map. *)
+
+val of_enum : ?cmp:('a -> 'a -> int) -> ('a * 'b) Enum.t -> ('a, 'b) t
+(** creates a map from an enumeration, using the specified function
+  for key comparison or [compare] by default. *)
diff --git a/bundles/extlib/extlib-1.5.2/refList.ml b/bundles/extlib/extlib-1.5.2/refList.ml
new file mode 100644 (file)
index 0000000..b16b6f2
--- /dev/null
@@ -0,0 +1,139 @@
+(*
+ * RefList - List reference
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+open ExtList
+
+exception Empty_list
+exception Invalid_index of int
+
+type 'a t = 'a list ref
+
+let empty () = ref []
+
+let is_empty x =
+       match !x with
+       | [] -> true
+       | _ -> false
+
+let of_list l = ref l
+let to_list rl = !rl
+let copy ~dst ~src = dst := !src
+let copy_list ~dst ~src = dst := src
+
+let add rl item = rl := List.append !rl [item]
+let push rl item = rl := item::!rl
+
+let clear rl = rl := []
+
+let length rl = List.length !rl
+let hd rl = try List.hd !rl with _ -> raise Empty_list
+let tl rl = try ref (List.tl !rl) with _ -> raise Empty_list
+let iter f rl = List.iter f !rl
+let for_all f rl = List.for_all f !rl
+let map f rl = ref (List.map f !rl)
+let transform f rl = rl := List.map f !rl
+let map_list f rl = List.map f !rl
+let find f rl = List.find f !rl
+let rev rl = rl := List.rev !rl
+let find_exc f exn rl = try List.find f !rl with _ -> raise exn
+let exists f rl = List.exists f !rl
+let sort ?(cmp=compare) rl = rl := List.sort ~cmp !rl
+
+let rfind f rl = List.rfind f !rl
+
+let first = hd
+
+let last rl = 
+       let rec loop = function
+               | x :: [] -> x
+               | x :: l -> loop l
+               | [] -> assert false
+       in
+       match !rl with
+       | [] -> raise Empty_list
+       | l -> loop l
+
+let remove rl item = rl := List.remove !rl item
+let remove_if pred rl = rl := List.remove_if pred !rl
+let remove_all rl item = rl := List.remove_all !rl item
+let filter pred rl = rl := List.filter pred !rl
+
+let add_sort ?(cmp=compare) rl item =
+       let rec add_aux = function
+               | x::lnext as l ->
+                       let r = cmp x item in
+                       if r < 0 then item::l else x::(add_aux lnext)
+               | [] -> [item]
+       in
+       rl := add_aux !rl
+
+let pop rl =
+       match !rl with
+       | [] -> raise Empty_list
+       | e::l -> rl := l; e
+
+let npop rl n =                
+       let rec pop_aux l n =
+               if n = 0 then begin
+                       rl := l;
+                       []
+               end else
+                       match l with
+                       | [] -> raise Empty_list
+                       | x::l -> x::(pop_aux l (n-1))
+       in
+       pop_aux !rl n
+
+let copy_enum ~dst ~src = dst := List.of_enum src
+let enum rl = List.enum !rl
+let of_enum e = ref (List.of_enum e)
+
+module Index = struct
+
+       let remove_at rl pos =
+               let p = ref (-1) in
+               let rec del_aux = function                      
+                       | x::l -> incr p; if !p = pos then l else x::(del_aux l)
+                       | [] -> raise (Invalid_index pos)
+               in
+               rl := del_aux !rl
+
+       let index pred rl =
+               let index = ref (-1) in
+               List.find (fun it -> incr index; pred it; ) !rl;
+               !index
+
+       let index_of rl item =
+               let index = ref (-1) in
+               List.find (fun it -> incr index; it = item; ) !rl;
+               !index
+
+       let at_index rl pos =
+               try
+                       List.nth !rl pos
+               with
+                       _ -> raise (Invalid_index pos)
+
+       let set rl pos newitem =
+               let p = ref (-1) in
+               rl := List.map (fun item -> incr p; if !p = pos then newitem else item) !rl;
+               if !p < pos || pos < 0 then raise (Invalid_index pos)
+
+
+end
diff --git a/bundles/extlib/extlib-1.5.2/refList.mli b/bundles/extlib/extlib-1.5.2/refList.mli
new file mode 100644 (file)
index 0000000..ea7bc06
--- /dev/null
@@ -0,0 +1,201 @@
+(*
+ * RefList - List reference
+ * Copyright (C) 2003 Nicolas Cannasse
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Reference on lists.
+
+  RefList is a extended set of functions that manipulate list
+  references.
+*)
+
+exception Empty_list
+exception Invalid_index of int
+
+type 'a t
+
+val empty : unit -> 'a t
+(** Returns a new empty ref list *)
+  
+val is_empty : 'a t -> bool
+(** Return [true] if a ref list is empty *)
+
+val clear : 'a t -> unit
+(** Removes all elements *)
+
+val length : 'a t -> int
+(** Returns the number of elements - O(n) *)
+
+val copy : dst:'a t -> src:'a t -> unit
+(** Makes a copy of a ref list - O(1) *)
+
+val copy_list : dst:'a t -> src:'a list -> unit
+(** Makes a copy of a list - O(1) *)
+
+val copy_enum : dst:'a t -> src:'a Enum.t -> unit
+(** Makes a copy of a enum *)
+
+val of_list : 'a list -> 'a t
+(** Creates a ref list from a list - O(1) *)
+
+val to_list : 'a t -> 'a list
+(** Returns the current elements as a list - O(1) *)
+
+val of_enum : 'a Enum.t -> 'a t
+(** Creates a ref list from an enumeration *)
+
+val enum : 'a t -> 'a Enum.t
+(** Returns an enumeration of current elements in the ref list *)
+
+val add : 'a t -> 'a -> unit
+(** Adds an element at the end - O(n) *)
+
+val push : 'a t -> 'a -> unit
+(** Adds an element at the head - O(1) *)
+
+val add_sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a -> unit
+(** Adds an element in a sorted list, using optional comparator
+    or 'compare' as default. *)
+
+val first : 'a t -> 'a
+(** Returns the first element or
+    raises [Empty_list] if the ref list is empty *)
+
+val last : 'a t -> 'a
+(** Returns the last element - O(n) or
+    raises Empty_list if the ref list is empty *)
+
+val pop : 'a t -> 'a
+(** Removes and returns the first element or
+   raises [Empty_list] if the ref list is empty *)
+
+val npop : 'a t -> int -> 'a list
+(** Removes and returns the n first elements or
+   raises [Empty_list] if the ref list does not
+   contain enough elements *)
+
+val hd : 'a t -> 'a
+(** same as [first] *)
+
+val tl : 'a t -> 'a t
+(** Returns a ref list containing the same elements
+    but without the first one or
+    raises [Empty_list] if the ref list is empty *)
+
+val rev : 'a t -> unit
+(** Reverses the ref list - O(n) *)
+
+(** {6 Functional Operations} *)
+
+val iter : ('a -> unit) -> 'a t -> unit
+(** Apply the given function to all elements of the
+    ref list, in respect with the order of the list *)
+
+val find : ('a -> bool) -> 'a t -> 'a
+(** Find the first element matching
+    the specified predicate
+    raise [Not_found] if no element is found *)
+
+val rfind : ('a -> bool) -> 'a t -> 'a
+(** Find the first element in the reversed ref list matching
+    the specified predicate
+    raise [Not_found] if no element is found *)
+
+val find_exc : ('a -> bool) -> exn -> 'a t -> 'a
+(** Same as find but takes an exception to be raised when
+    no element is found as additional parameter *)
+
+val exists : ('a -> bool) -> 'a t -> bool
+(** Return [true] if an element matches the specified
+    predicate *)
+
+val for_all : ('a -> bool) -> 'a t -> bool
+(** Return [true] if all elements match the specified
+    predicate *)
+
+val map : ('a -> 'b) -> 'a t -> 'b t
+(** Apply a function to all elements
+    and return the ref list constructed with
+    the function returned values *)
+
+val transform : ('a -> 'a) -> 'a t -> unit
+(** transform all elements in the ref list
+    using a function. *)
+
+val map_list : ('a -> 'b) -> 'a t -> 'b list
+(** Apply a function to all elements
+    and return the list constructed with
+    the function returned values *)
+
+val sort : ?cmp:('a -> 'a -> int) -> 'a t -> unit
+(** Sort elements using the specified comparator
+    or compare as default comparator *)
+
+val filter : ('a -> bool) -> 'a t -> unit
+(** Remove all elements that do not match the
+    specified predicate *)
+
+val remove : 'a t -> 'a -> unit
+(** Remove an element from the ref list
+    raise [Not_found] if the element is not found *)
+
+val remove_if : ('a -> bool) -> 'a t -> unit
+(** Remove the first element matching the
+    specified predicate
+    raise [Not_found] if no element has been removed *)
+
+val remove_all : 'a t -> 'a -> unit
+(** Remove all elements equal to the specified
+    element from the ref list *)
+
+
+
+(** Functions that operate on the [i]th element of a list.
+
+    While it is sometimes necessary to perform these
+    operations on lists (hence their inclusion here), the
+    functions were moved to an inner module to prevent
+    their overuse: all functions work in O(n) time. You
+       might prefer to use [Array] or [DynArray] for constant
+       time indexed element access.
+*)
+module Index : sig
+
+       val index_of : 'a t -> 'a -> int
+       (** Return the index (position : 0 starting) of an element in
+           a ref list, using ( = ) for testing element equality
+           raise [Not_found] if no element was found *)
+
+       val index : ('a -> bool) -> 'a t -> int
+       (** Return the index (position : 0 starting) of an element in
+           a ref list, using the specified comparator
+           raise [Not_found] if no element was found *)
+
+       val at_index : 'a t -> int -> 'a
+       (** Return the element of ref list at the specified index
+           raise [Invalid_index] if the index is outside [0 ; length-1] *)
+
+       val set : 'a t -> int -> 'a -> unit
+       (** Change the element at the specified index
+           raise [Invalid_index] if the index is outside [0 ; length-1] *)
+
+       val remove_at : 'a t -> int -> unit
+       (** Remove the element at the specified index
+           raise [Invalid_index] if the index is outside [0 ; length-1] *)
+
+end
diff --git a/bundles/extlib/extlib-1.5.2/std.ml b/bundles/extlib/extlib-1.5.2/std.ml
new file mode 100644 (file)
index 0000000..4903b82
--- /dev/null
@@ -0,0 +1,185 @@
+(*
+ * Std - Additional functions
+ * Copyright (C) 2003 Nicolas Cannasse and Markus Mottl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+let input_lines ch =
+  Enum.from (fun () ->
+    try input_line ch with End_of_file -> raise Enum.No_more_elements)
+
+let input_chars ch =
+  Enum.from (fun () ->
+    try input_char ch with End_of_file -> raise Enum.No_more_elements)
+
+type 'a _mut_list = {
+  hd : 'a;
+  mutable tl : 'a _mut_list;
+}
+
+let input_list ch =
+  let _empty = Obj.magic [] in
+  let rec loop dst =
+    let r = { hd = input_line ch; tl = _empty } in
+    dst.tl <- r;
+    loop r in
+  let r = { hd = Obj.magic(); tl = _empty } in
+  try loop r
+  with
+    End_of_file ->
+      Obj.magic r.tl
+
+let buf_len = 8192
+
+let input_all ic =
+  let rec loop acc total buf ofs =
+    let n = input ic buf ofs (buf_len - ofs) in
+    if n = 0 then
+      let res = String.create total in
+      let pos = total - ofs in
+      let _ = String.blit buf 0 res pos ofs in
+      let coll pos buf =
+        let new_pos = pos - buf_len in
+        String.blit buf 0 res new_pos buf_len;
+        new_pos in
+      let _ = List.fold_left coll pos acc in
+      res
+    else
+      let new_ofs = ofs + n in
+      let new_total = total + n in
+      if new_ofs = buf_len then
+        loop (buf :: acc) new_total (String.create buf_len) 0
+      else loop acc new_total buf new_ofs in
+  loop [] 0 (String.create buf_len) 0
+
+let input_file ?(bin=false) fname =
+  let ch = (if bin then open_in_bin else open_in) fname in
+  let str = input_all ch in
+  close_in ch;
+  str
+
+let output_file ~filename ~text =
+  let ch = open_out filename in
+  output_string ch text;
+  close_out ch
+
+let print_bool = function
+  | true -> print_string "true"
+  | false -> print_string "false"
+
+let prerr_bool = function
+  | true -> prerr_string "true"
+  | false -> prerr_string "false"
+
+let string_of_char c = String.make 1 c
+
+external identity : 'a -> 'a = "%identity"
+
+let rec dump r =
+       if Obj.is_int r then
+               string_of_int (Obj.magic r : int)
+       else (* Block. *)
+       let rec get_fields acc = function
+               | 0 -> acc
+               | n -> let n = n-1 in get_fields (Obj.field r n :: acc) n
+       in
+    let rec is_list r =
+               if Obj.is_int r then
+                       r = Obj.repr 0 (* [] *)
+               else
+                       let s = Obj.size r and t = Obj.tag r in
+                       t = 0 && s = 2 && is_list (Obj.field r 1) (* h :: t *)
+       in
+    let rec get_list r =
+               if Obj.is_int r then
+                       []
+               else 
+                       let h = Obj.field r 0 and t = get_list (Obj.field r 1) in
+                       h :: t
+    in
+    let opaque name =
+               (* XXX In future, print the address of value 'r'.  Not possible in
+               * pure OCaml at the moment.
+               *)
+               "<" ^ name ^ ">"
+    in
+    let s = Obj.size r and t = Obj.tag r in
+    (* From the tag, determine the type of block. *)
+       match t with 
+       | _ when is_list r ->
+               let fields = get_list r in
+               "[" ^ String.concat "; " (List.map dump fields) ^ "]"
+       | 0 ->
+               let fields = get_fields [] s in
+               "(" ^ String.concat ", " (List.map dump fields) ^ ")"
+       | x when x = Obj.lazy_tag ->
+               (* Note that [lazy_tag .. forward_tag] are < no_scan_tag.  Not
+               * clear if very large constructed values could have the same
+               * tag. XXX *)
+               opaque "lazy"
+       | x when x = Obj.closure_tag ->
+               opaque "closure"
+       | x when x = Obj.object_tag ->
+               let fields = get_fields [] s in
+               let clasz, id, slots =
+                       match fields with
+                       | h::h'::t -> h, h', t 
+                       | _ -> assert false
+               in
+               (* No information on decoding the class (first field).  So just print
+               * out the ID and the slots. *)
+               "Object #" ^ dump id ^ " (" ^ String.concat ", " (List.map dump slots) ^ ")"
+    | x when x = Obj.infix_tag ->
+               opaque "infix"
+    | x when x = Obj.forward_tag ->
+               opaque "forward"
+       | x when x < Obj.no_scan_tag ->
+               let fields = get_fields [] s in
+               "Tag" ^ string_of_int t ^
+               " (" ^ String.concat ", " (List.map dump fields) ^ ")"
+       | x when x = Obj.string_tag ->
+               "\"" ^ String.escaped (Obj.magic r : string) ^ "\""
+       | x when x = Obj.double_tag ->
+               string_of_float (Obj.magic r : float)
+       | x when x = Obj.abstract_tag ->
+               opaque "abstract"
+       | x when x = Obj.custom_tag ->
+               opaque "custom"
+       | x when x = Obj.final_tag ->
+               opaque "final"
+       | _ ->
+               failwith ("Std.dump: impossible tag (" ^ string_of_int t ^ ")")
+
+let dump v = dump (Obj.repr v)
+
+let print v = print_endline (dump v)
+
+let finally handler f x =
+       let r = (
+               try
+                       f x
+               with
+                       e -> handler(); raise e
+       ) in
+       handler();
+       r
+
+let __unique_counter = ref 0
+
+let unique() =
+  incr __unique_counter;
+  !__unique_counter
\ No newline at end of file
diff --git a/bundles/extlib/extlib-1.5.2/std.mli b/bundles/extlib/extlib-1.5.2/std.mli
new file mode 100644 (file)
index 0000000..5328380
--- /dev/null
@@ -0,0 +1,69 @@
+(*
+ * Std - Additional functions
+ * Copyright (C) 2003 Nicolas Cannasse
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Additional functions. *)
+
+val input_lines : in_channel -> string Enum.t
+(** Returns an enumeration over lines of an input channel, as read by the
+ [input_line] function. *)
+
+val input_chars : in_channel -> char Enum.t
+(** Returns an enumeration over characters of an input channel. *)
+
+val input_list : in_channel -> string list
+(** Returns the list of lines read from an input channel. *)
+
+val input_all : in_channel -> string
+(** Return the whole contents of an input channel as a single
+ string. *)
+
+val print_bool : bool -> unit
+(** Print a boolean to stdout. *)
+
+val prerr_bool : bool -> unit
+(** Print a boolean to stderr. *)
+
+val input_file : ?bin:bool -> string -> string
+(** returns the data of a given filename. *)
+
+val output_file : filename:string -> text:string -> unit
+(** creates a filename, write text into it and close it. *)
+
+val string_of_char : char -> string
+(** creates a string from a char. *)
+
+external identity : 'a -> 'a = "%identity"
+(** the identity function. *)
+
+val unique : unit -> int
+(** returns an unique identifier every time it is called. *)
+
+val dump : 'a -> string
+(** represent a runtime value as a string. Since types are lost at compile
+       time, the representation might not match your type. For example, None
+       will be printed 0 since they share the same runtime representation. *)
+
+val print : 'a -> unit
+(** print the representation of a runtime value on stdout.
+       See remarks for [dump]. *)
+
+val finally : (unit -> unit) -> ('a -> 'b) -> 'a -> 'b 
+(** [finally fend f x] calls [f x] and then [fend()] even if [f x] raised
+       an exception. *)
diff --git a/bundles/extlib/extlib-1.5.2/uChar.ml b/bundles/extlib/extlib-1.5.2/uChar.ml
new file mode 100644 (file)
index 0000000..194a753
--- /dev/null
@@ -0,0 +1,48 @@
+(* 
+ * UChar - Unicode (ISO-UCS) characters
+ * Copyright (C) 2002, 2003 Yamagata Yoriyuki
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type t = int
+
+exception Out_of_range
+
+external unsafe_chr_of_uint : int -> t = "%identity"
+external uint_code : t -> int = "%identity"
+
+let char_of c = 
+  if c >= 0 && c < 0x100 then Char.chr c else raise Out_of_range
+
+let of_char = Char.code
+
+let code c = if c >= 0 then c else raise Out_of_range
+
+let chr n =
+  if n >= 0 && n lsr 31 = 0 then n else invalid_arg "UChar.chr"
+
+let chr_of_uint n = if n lsr 31 = 0 then n else invalid_arg "UChar.uint_chr"
+  
+let eq (u1 : t) (u2 : t) = u1 = u2
+let compare u1 u2 =
+  let sgn = (u1 lsr 16) - (u2 lsr 16) in
+  if sgn = 0 then (u1 land 0xFFFF) -  (u2 land 0xFFFF) else sgn
+
+type uchar = t
+
+let int_of_uchar u = uint_code u
+let uchar_of_int n = chr_of_uint n
diff --git a/bundles/extlib/extlib-1.5.2/uChar.mli b/bundles/extlib/extlib-1.5.2/uChar.mli
new file mode 100644 (file)
index 0000000..2301505
--- /dev/null
@@ -0,0 +1,79 @@
+(* 
+ * UChar - Unicode (ISO-UCS) characters
+ * Copyright (C) 2002, 2003 Yamagata Yoriyuki
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Unicode (ISO-UCS) characters.
+
+   This module implements Unicode (actually ISO-UCS) characters.  All
+   31-bit code points are allowed.
+*)
+
+(** Unicode characters. All 31-bit code points are allowed.*) 
+type t
+
+exception Out_of_range
+
+(** [char_of u] returns the Latin-1 representation of [u].
+   If [u] can not be represented by Latin-1, raises Out_of_range *)
+val char_of : t -> char
+
+(** [of_char c] returns the Unicode character of the Latin-1 character [c] *)
+val of_char : char -> t
+
+(** [code u] returns the Unicode code number of [u].
+   If the value can not be represented by a positive integer,
+   raise Out_of_range *)
+val code : t -> int
+
+(** [code n] returns the Unicode character with the code number [n]. 
+   If n >= 2^32 or n < 0, raises [invalid_arg] *)
+val chr : int -> t
+
+(** [uint_code u] returns the Unicode code number of [u].
+   The returned int is unsigned, that is, on 32-bit platforms,
+   the sign bit is used for storing the 31-th bit of the code number. *)
+external uint_code : t -> int = "%identity"
+
+(** [chr_of_uint n] returns the Unicode character of the code number [n].
+   [n] is interpreted as unsigned, that is, on 32-bit platforms,
+   the sign bit is treated as the 31-th bit of the code number.
+   If n exceeds 31-bit values, then raise [Invalid_arg]. *)
+val chr_of_uint : int -> t
+
+(** Unsafe version of {!UChar.chr_of_uint}.
+   No check of its argument is performed. *)
+external unsafe_chr_of_uint : int -> t = "%identity"
+
+(** Equality by code point comparison *)
+val eq : t -> t -> bool
+
+(** [compare u1 u2] returns, 
+   a value > 0 if [u1] has a larger Unicode code number than [u2], 
+   0 if [u1] and [u2] are the same Unicode character,
+   a value < 0 if [u1] has a smaller Unicode code number than [u2]. *)
+val compare : t -> t -> int
+
+(** Aliases of [type t] *)
+type uchar = t
+
+(** Alias of [uint_code] *)
+val int_of_uchar : uchar -> int
+
+(** Alias of [chr_of_uint] *)
+val uchar_of_int : int -> uchar
diff --git a/bundles/extlib/extlib-1.5.2/uTF8.ml b/bundles/extlib/extlib-1.5.2/uTF8.ml
new file mode 100644 (file)
index 0000000..b7da7b9
--- /dev/null
@@ -0,0 +1,220 @@
+(* 
+ * UTF-8 - UTF-8 encoded Unicode string
+ * Copyright 2002, 2003 (C) Yamagata Yoriyuki. 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+open UChar
+
+type t = string
+type index = int
+  
+let look s i =
+  let n' =
+    let n = Char.code s.[i] in
+    if n < 0x80 then n else
+    if n <= 0xdf then
+      (n - 0xc0) lsl 6 lor (0x7f land (Char.code s.[i + 1]))
+    else if n <= 0xef then
+      let n' = n - 0xe0 in
+      let m0 = Char.code s.[i + 2] in
+      let m = Char.code (String.unsafe_get s (i + 1)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      n' lsl 6 lor (0x7f land m0)
+    else if n <= 0xf7 then
+      let n' = n - 0xf0 in
+      let m0 = Char.code s.[i + 3] in
+      let m = Char.code (String.unsafe_get s (i + 1)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 2)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      n' lsl 6 lor (0x7f land m0)     
+    else if n <= 0xfb then
+      let n' = n - 0xf8 in
+      let m0 = Char.code s.[i + 4] in
+      let m = Char.code (String.unsafe_get s (i + 1)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 2)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 3)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      n' lsl 6 lor (0x7f land m0)     
+    else if n <= 0xfd then
+      let n' = n - 0xfc in
+      let m0 = Char.code s.[i + 5] in
+      let m = Char.code (String.unsafe_get s (i + 1)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 2)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 3)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      let m = Char.code (String.unsafe_get s (i + 4)) in
+      let n' = n' lsl 6 lor (0x7f land m) in
+      n' lsl 6 lor (0x7f land m0)
+    else invalid_arg "UTF8.look"
+  in
+  Obj.magic n'
+
+let rec search_head s i =
+  if i >= String.length s then i else
+  let n = Char.code (String.unsafe_get s i) in
+  if n < 0x80 || n >= 0xc2 then i else
+  search_head s (i + 1)
+
+let next s i = 
+  let n = Char.code s.[i] in
+  if n < 0x80 then i + 1 else
+  if n < 0xc0 then search_head s (i + 1) else
+  if n <= 0xdf then i + 2
+  else if n <= 0xef then i + 3
+  else if n <= 0xf7 then i + 4
+  else if n <= 0xfb then i + 5
+  else if n <= 0xfd then i + 6
+  else invalid_arg "UTF8.next"
+
+let rec search_head_backward s i =
+  if i < 0 then -1 else
+  let n = Char.code s.[i] in
+  if n < 0x80 || n >= 0xc2 then i else
+  search_head_backward s (i - 1)
+
+let prev s i = search_head_backward s (i - 1)
+
+let move s i n =
+  if n >= 0 then
+    let rec loop i n = if n <= 0 then i else loop (next s i) (n - 1) in
+    loop i n
+  else
+    let rec loop i n = if n >= 0 then i else loop (prev s i) (n + 1) in
+    loop i n
+
+let rec nth_aux s i n =
+  if n = 0 then i else
+  nth_aux s (next s i) (n - 1)
+
+let nth s n = nth_aux s 0 n
+
+let last s = search_head_backward s (String.length s - 1)
+
+let out_of_range s i = i < 0 || i >= String.length s
+
+let compare_index _ i j = i - j
+
+let get s n = look s (nth s n)
+
+let add_uchar buf u =
+  let masq = 0b111111 in
+  let k = int_of_uchar u in
+  if k < 0 || k >= 0x4000000 then begin
+    Buffer.add_char buf (Char.chr (0xfc + (k lsr 30)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 24) land masq))); 
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 18) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 12) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 6) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor (k land masq)));
+  end else if k <= 0x7f then
+    Buffer.add_char buf (Char.unsafe_chr k)
+  else if k <= 0x7ff then begin
+    Buffer.add_char buf (Char.unsafe_chr (0xc0 lor (k lsr 6)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor (k land masq)))
+  end else if k <= 0xffff then begin
+    Buffer.add_char buf (Char.unsafe_chr (0xe0 lor (k lsr 12)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 6) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor (k land masq)));
+  end else if k <= 0x1fffff then begin
+    Buffer.add_char buf (Char.unsafe_chr (0xf0 + (k lsr 18)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 12) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 6) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor (k land masq)));
+  end else begin
+    Buffer.add_char buf (Char.unsafe_chr (0xf8 + (k lsr 24)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 18) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 12) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor ((k lsr 6) land masq)));
+    Buffer.add_char buf (Char.unsafe_chr (0x80 lor (k land masq)));
+  end 
+
+let init len f =
+  let buf = Buffer.create len in
+  for c = 0 to len - 1 do add_uchar buf (f c) done;
+  Buffer.contents buf
+
+let rec length_aux s c i =
+  if i >= String.length s then c else
+  let n = Char.code (String.unsafe_get s i) in
+  let k =
+    if n < 0x80 then 1 else
+    if n < 0xc0 then invalid_arg "UTF8.length" else
+    if n < 0xe0 then 2 else
+    if n < 0xf0 then 3 else
+    if n < 0xf8 then 4 else
+    if n < 0xfc then 5 else
+    if n < 0xfe then 6 else
+    invalid_arg "UTF8.length" in
+  length_aux s (c + 1) (i + k)
+
+let length s = length_aux s 0 0
+
+let rec iter_aux proc s i =
+  if i >= String.length s then () else
+  let u = look s i in
+  proc u;
+  iter_aux proc s (next s i)
+
+let iter proc s = iter_aux proc s 0
+
+let compare s1 s2 = Pervasives.compare s1 s2
+
+exception Malformed_code
+
+let validate s =
+  let rec trail c i a =
+    if c = 0 then a else
+    if i >= String.length s then raise Malformed_code else
+    let n = Char.code (String.unsafe_get s i) in
+    if n < 0x80 || n >= 0xc0 then raise Malformed_code else
+    trail (c - 1) (i + 1) (a lsl 6 lor (n - 0x80)) in
+  let rec main i =
+    if i >= String.length s then () else
+    let n = Char.code (String.unsafe_get s i) in
+    if n < 0x80 then main (i + 1) else
+    if n < 0xc2 then raise Malformed_code else
+    if n <= 0xdf then 
+      if trail 1 (i + 1) (n - 0xc0) < 0x80 then raise Malformed_code else 
+      main (i + 2)
+    else if n <= 0xef then 
+      if trail 2 (i + 1) (n - 0xe0) < 0x800 then raise Malformed_code else 
+      main (i + 3)
+    else if n <= 0xf7 then 
+      if trail 3 (i + 1) (n - 0xf0) < 0x10000 then raise Malformed_code else
+      main (i + 4)
+    else if n <= 0xfb then 
+      if trail 4 (i + 1) (n - 0xf8) < 0x200000 then raise Malformed_code else
+      main (i + 5)
+    else if n <= 0xfd then 
+      let n = trail 5 (i + 1) (n - 0xfc) in
+      if n lsr 16 < 0x400 then raise Malformed_code else
+      main (i + 6)
+    else raise Malformed_code in
+  main 0
+
+module Buf = 
+  struct
+    include Buffer
+    type buf = t
+    let add_char = add_uchar
+  end
diff --git a/bundles/extlib/extlib-1.5.2/uTF8.mli b/bundles/extlib/extlib-1.5.2/uTF8.mli
new file mode 100644 (file)
index 0000000..72d9a13
--- /dev/null
@@ -0,0 +1,144 @@
+(* 
+ * UTF-8 - UTF-8 encoded Unicode string
+ * Copyright 2002, 2003 (C) Yamagata Yoriyuki. 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** UTF-8 encoded Unicode strings. 
+
+   The Module for UTF-8 encoded Unicode strings.
+*)
+
+open UChar
+
+(** UTF-8 encoded Unicode strings. the type is normal string. *)
+type t = string
+
+exception Malformed_code
+
+(** [validate s]
+   Succeeds if s is valid UTF-8, otherwise raises Malformed_code.
+   Other functions assume strings are valid UTF-8, so it is prudent
+   to test their validity for strings from untrusted origins. *)
+val validate : t -> unit
+
+(* All functions below assume string are valid UTF-8.  If not,
+ * the result is unspecified. *)
+
+(** [get s n] returns [n]-th Unicode character of [s].
+   The call requires O(n)-time. *)
+val get : t -> int -> uchar
+
+(** [init len f] 
+   returns a new string which contains [len] Unicode characters.
+   The i-th Unicode character is initialized by [f i] *)
+val init : int -> (int -> uchar) -> t
+
+(** [length s] returns the number of Unicode characters contained in s *)
+val length : t -> int
+    
+(** Positions in the string represented by the number of bytes from the head.
+   The location of the first character is [0] *)
+type index = int
+
+(** [nth s n] returns the position of the [n]-th Unicode character. 
+   The call requires O(n)-time *)
+val nth : t -> int -> index
+
+(** The position of the head of the last Unicode character. *)
+val last : t -> index
+
+(** [look s i]
+   returns the Unicode character of the location [i] in the string [s]. *)
+val look : t -> index -> uchar
+
+(** [out_of_range s i]
+   tests whether [i] is a position inside of [s]. *)
+val out_of_range : t -> index -> bool
+
+(** [compare_index s i1 i2] returns
+   a value < 0 if [i1] is the position located before [i2], 
+   0 if [i1] and [i2] points the same location,
+   a value > 0 if [i1] is the position located after [i2]. *)
+val compare_index : t -> index -> index -> int
+
+(** [next s i]
+   returns the position of the head of the Unicode character
+   located immediately after [i]. 
+   If [i] is inside of [s], the function always successes.
+   If [i] is inside of [s] and there is no Unicode character after [i],
+   the position outside [s] is returned.  
+   If [i] is not inside of [s], the behaviour is unspecified. *)
+val next : t -> index -> index
+
+(** [prev s i]
+   returns the position of the head of the Unicode character
+   located immediately before [i]. 
+   If [i] is inside of [s], the function always successes.
+   If [i] is inside of [s] and there is no Unicode character before [i],
+   the position outside [s] is returned.  
+   If [i] is not inside of [s], the behaviour is unspecified. *)
+val prev : t -> index -> index
+
+(** [move s i n]
+   returns [n]-th Unicode character after [i] if n >= 0,
+   [n]-th Unicode character before [i] if n < 0.
+   If there is no such character, the result is unspecified. *)
+val move : t -> index -> int -> index
+    
+(** [iter f s]
+   applies [f] to all Unicode characters in [s].  
+   The order of application is same to the order 
+   of the Unicode characters in [s]. *)
+val iter : (uchar -> unit) -> t -> unit
+
+(** Code point comparison by the lexicographic order.
+   [compare s1 s2] returns
+   a positive integer if [s1] > [s2],
+   0 if [s1] = [s2],
+   a negative integer if [s1] < [s2]. *)
+val compare : t -> t -> int
+
+(** Buffer module for UTF-8 strings *)
+module Buf : sig
+  (** Buffers for UTF-8 strings. *) 
+  type buf
+
+  (** [create n] creates a buffer with the initial size [n]-bytes. *)   
+  val create : int -> buf
+
+  (* The rest of functions is similar to the ones of Buffer in stdlib. *)
+  (** [contents buf] returns the contents of the buffer. *)
+  val contents : buf -> t
+
+  (** Empty the buffer, 
+     but retains the internal storage which was holding the contents *)
+  val clear : buf -> unit
+
+  (** Empty the buffer and de-allocate the internal storage. *)
+  val reset : buf -> unit
+
+  (** Add one Unicode character to the buffer. *)
+  val add_char : buf -> uchar -> unit
+
+  (** Add the UTF-8 string to the buffer. *)
+  val add_string : buf -> t -> unit
+
+  (** [add_buffer b1 b2] adds the contents of [b2] to [b1].
+     The contents of [b2] is not changed. *)
+  val add_buffer : buf -> buf -> unit
+end
diff --git a/bundles/extlib/extlib-1.5.2/unzip.ml b/bundles/extlib/extlib-1.5.2/unzip.ml
new file mode 100644 (file)
index 0000000..c1b125c
--- /dev/null
@@ -0,0 +1,449 @@
+(*
+ * Unzip - inflate format decompression algorithm
+ * Copyright (C) 2004 Nicolas Cannasse
+ * Compliant with RFC 1950 and 1951
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+type huffman =
+       | Found of int
+       | NeedBit of huffman * huffman
+       | NeedBits of int * huffman array
+
+
+type adler32 = {
+       mutable a1 : int;
+       mutable a2 : int;
+}
+
+type window = {
+       mutable wbuffer : string;
+       mutable wpos : int;
+       wcrc : adler32;
+}
+
+type state =
+       | Head
+       | Block
+       | CData
+       | Flat
+       | Crc
+       | Dist
+       | DistOne
+       | Done
+
+type t = {
+       mutable znbits : int;
+       mutable zbits : int;
+       mutable zstate : state;
+       mutable zfinal : bool;
+       mutable zhuffman : huffman;
+       mutable zhuffdist : huffman option;
+       mutable zlen : int;
+       mutable zdist : int;
+       mutable zneeded : int;
+       mutable zoutput : string;
+       mutable zoutpos : int;
+       zinput : IO.input;
+       zlengths : int array;
+       zwindow : window;
+}
+
+type error_msg =
+       | Invalid_huffman
+       | Invalid_data
+       | Invalid_crc
+       | Truncated_data
+       | Unsupported_dictionary
+
+exception Error of error_msg
+
+let error msg = raise (Error msg)
+
+(* ************************************************************************ *)
+(* HUFFMAN TREES *)
+
+let rec tree_depth = function
+       | Found _ -> 0
+       | NeedBits _ -> assert false
+       | NeedBit (a,b) ->
+               1 + min (tree_depth a) (tree_depth b)
+
+let rec tree_compress t =
+       match tree_depth t with
+       | 0 -> t
+       | 1 ->
+               (match t with
+               | NeedBit (a,b) -> NeedBit (tree_compress a,tree_compress b)
+               | _ -> assert false)
+       | d ->
+               let size = 1 lsl d in
+               let tbl = Array.make size (Found (-1)) in
+               tree_walk tbl 0 0 d t;
+               NeedBits (d,tbl)
+
+and tree_walk tbl p cd d = function
+       | NeedBit (a,b) when d > 0 ->
+               tree_walk tbl p (cd + 1) (d-1) a;
+               tree_walk tbl (p lor (1 lsl cd)) (cd + 1) (d-1) b;
+       | t ->
+               Array.set tbl p (tree_compress t)
+
+let make_huffman lengths pos nlengths maxbits =
+       let counts = Array.make maxbits 0 in
+       for i = 0 to nlengths - 1 do
+               let p = Array.unsafe_get lengths (i + pos) in
+               if p >= maxbits then error Invalid_huffman;
+               Array.unsafe_set counts p (Array.unsafe_get counts p + 1);
+       done;
+       let code = ref 0 in
+       let tmp = Array.make maxbits 0 in
+       for i = 1 to maxbits - 2 do
+               code := (!code + Array.unsafe_get counts i) lsl 1;
+               Array.unsafe_set tmp i !code;
+       done;
+       let bits = Hashtbl.create 0 in
+       for i = 0 to nlengths - 1 do
+               let l = Array.unsafe_get lengths (i + pos) in
+               if l <> 0 then begin
+                       let n = Array.unsafe_get tmp (l - 1) in
+                       Array.unsafe_set tmp (l - 1) (n + 1);
+                       Hashtbl.add bits (n,l) i;
+               end;
+       done;
+       let rec tree_make v l =
+               if l > maxbits then error Invalid_huffman;
+               try
+                       Found (Hashtbl.find bits (v,l))
+               with
+                       Not_found ->
+                               NeedBit (tree_make (v lsl 1) (l + 1) , tree_make (v lsl 1 lor 1) (l + 1))
+       in
+       tree_compress (NeedBit (tree_make 0 1 , tree_make 1 1))
+
+(* ************************************************************************ *)
+(* ADLER32 (CRC) *)
+
+let adler32_create() = {
+       a1 = 1;
+       a2 = 0;
+}
+
+let adler32_update a s p l =
+       let p = ref p in
+       for i = 0 to l - 1 do
+               let c = int_of_char (String.unsafe_get s !p) in
+               a.a1 <- (a.a1 + c) mod 65521;
+               a.a2 <- (a.a2 + a.a1) mod 65521;
+               incr p;
+       done
+
+let adler32_read ch =
+       let a2a = IO.read_byte ch in
+       let a2b = IO.read_byte ch in
+       let a1a = IO.read_byte ch in
+       let a1b = IO.read_byte ch in
+       {
+               a1 = (a1a lsl 8) lor a1b;
+               a2 = (a2a lsl 8) lor a2b;
+       }
+
+(* ************************************************************************ *)
+(* WINDOW *)
+
+let window_size = 1 lsl 15
+let buffer_size = 1 lsl 16
+
+let window_create size = {
+               wbuffer = String.create buffer_size;
+               wpos = 0;
+               wcrc = adler32_create()
+       }
+
+let window_slide w = 
+       adler32_update w.wcrc w.wbuffer 0 window_size;
+       let b = String.create buffer_size in
+       w.wpos <- w.wpos - window_size;
+       String.unsafe_blit w.wbuffer window_size b 0 w.wpos;
+       w.wbuffer <- b
+
+let window_add_string w s p len =
+       if w.wpos + len > buffer_size then window_slide w;
+       String.unsafe_blit s p w.wbuffer w.wpos len;
+       w.wpos <- w.wpos + len
+
+let window_add_char w c =
+       if w.wpos = buffer_size then window_slide w;
+       String.unsafe_set w.wbuffer w.wpos c;
+       w.wpos <- w.wpos + 1
+
+let window_get_last_char w =
+       String.unsafe_get w.wbuffer (w.wpos - 1)
+
+let window_available w =
+       w.wpos
+
+let window_checksum w =
+       adler32_update w.wcrc w.wbuffer 0 w.wpos;
+       w.wcrc
+
+(* ************************************************************************ *)
+
+let len_extra_bits_tbl = [|0;0;0;0;0;0;0;0;1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4;5;5;5;5;0;-1;-1|]
+let len_base_val_tbl = [|3;4;5;6;7;8;9;10;11;13;15;17;19;23;27;31;35;43;51;59;67;83;99;115;131;163;195;227;258|]
+let dist_extra_bits_tbl = [|0;0;0;0;1;1;2;2;3;3;4;4;5;5;6;6;7;7;8;8;9;9;10;10;11;11;12;12;13;13;-1;-1|]
+let dist_base_val_tbl = [|1;2;3;4;5;7;9;13;17;25;33;49;65;97;129;193;257;385;513;769;1025;1537;2049;3073;4097;6145;8193;12289;16385;24577|]
+let code_lengths_pos = [|16;17;18;0;8;7;9;6;10;5;11;4;12;3;13;2;14;1;15|]
+
+let fixed_huffman = make_huffman (Array.init 288 (fun n ->
+                                                                       if n <= 143 then 8
+                                                                       else if n <= 255 then 9
+                                                                       else if n <= 279 then 7
+                                                                       else 8
+                                                               )) 0 288 10
+
+let get_bits z n =
+       while z.znbits < n do
+               z.zbits <- z.zbits lor ((IO.read_byte z.zinput) lsl z.znbits);
+               z.znbits <- z.znbits + 8;
+       done;
+       let b = z.zbits land (1 lsl n - 1) in
+       z.znbits <- z.znbits - n;
+       z.zbits <- z.zbits lsr n;
+       b
+
+let get_bit z =
+       if z.znbits = 0 then begin
+               z.znbits <- 8;
+               z.zbits <- IO.read_byte z.zinput;
+       end;
+       let b = z.zbits land 1 = 1 in
+       z.znbits <- z.znbits - 1;
+       z.zbits <- z.zbits lsr 1;
+       b
+
+let rec get_rev_bits z n =
+       if n = 0 then
+               0
+       else if get_bit z then
+               (1 lsl (n - 1)) lor (get_rev_bits z (n-1))
+       else
+               get_rev_bits z (n-1)
+
+let reset_bits z =
+       z.zbits <- 0;
+       z.znbits <- 0
+
+let add_string z s p l =
+       window_add_string z.zwindow s p l;
+       String.unsafe_blit s p z.zoutput z.zoutpos l;
+       z.zneeded <- z.zneeded - l;
+       z.zoutpos <- z.zoutpos + l
+
+let add_char z c =
+       window_add_char z.zwindow c;
+       String.unsafe_set z.zoutput z.zoutpos c;
+       z.zneeded <- z.zneeded - 1;
+       z.zoutpos <- z.zoutpos + 1
+
+let add_dist_one z n =
+       let c = window_get_last_char z.zwindow in
+       let s = String.make n c in
+       add_string z s 0 n
+
+let add_dist z d l =
+       add_string z z.zwindow.wbuffer (z.zwindow.wpos - d) l
+
+let rec apply_huffman z = function
+       | Found n -> n
+       | NeedBit (a,b) -> apply_huffman z (if get_bit z then b else a)
+       | NeedBits (n,t) -> apply_huffman z (Array.unsafe_get t (get_bits z n))
+
+let inflate_lengths z a max =
+       let i = ref 0 in
+       let prev = ref 0 in
+       while !i < max do
+               match apply_huffman z z.zhuffman with
+               | n when n <= 15 ->
+                       prev := n;
+                       Array.unsafe_set a !i n;
+                       incr i
+               | 16 ->
+                       let n = 3 + get_bits z 2 in
+                       if !i + n > max then error Invalid_data;
+                       for k = 0 to n - 1 do
+                               Array.unsafe_set a !i !prev;
+                               incr i;
+                       done;
+               | 17 ->
+                       let n = 3 + get_bits z 3 in
+                       i := !i + n;
+                       if !i > max then error Invalid_data;
+               | 18 ->
+                       let n = 11 + get_bits z 7 in
+                       i := !i + n;
+                       if !i > max then error Invalid_data;
+               | _ ->
+                       error Invalid_data
+       done
+
+let rec inflate_loop z =
+       match z.zstate with
+       | Head ->
+               let cmf = IO.read_byte z.zinput in
+               let cm = cmf land 15 in
+               let cinfo = cmf lsr 4 in
+               if cm <> 8 || cinfo <> 7 then error Invalid_data;
+               let flg = IO.read_byte z.zinput in
+               (*let fcheck = flg land 31 in*)
+               let fdict = flg land 32 <> 0 in
+               (*let flevel = flg lsr 6 in*)
+               if (cmf lsl 8 + flg) mod 31 <> 0 then error Invalid_data;
+               if fdict then error Unsupported_dictionary;
+               z.zstate <- Block;
+               inflate_loop z
+       | Crc ->
+               let calc = window_checksum z.zwindow in
+               let crc = adler32_read z.zinput in
+               if calc <> crc then error Invalid_crc;
+               z.zstate <- Done;
+               inflate_loop z
+       | Done ->
+               ()
+       | Block ->
+               z.zfinal <- get_bit z;
+               let btype = get_bits z 2 in
+               (match btype with
+               | 0 -> (* no compression *)
+                       z.zlen <- IO.read_ui16 z.zinput;
+                       let nlen = IO.read_ui16 z.zinput in
+                       if nlen <> 0xffff - z.zlen then error Invalid_data;
+                       z.zstate <- Flat;
+                       inflate_loop z;
+                       reset_bits z
+               | 1 -> (* fixed Huffman *)
+                       z.zhuffman <- fixed_huffman;
+                       z.zhuffdist <- None;
+                       z.zstate <- CData;
+                       inflate_loop z
+               | 2 -> (* dynamic Huffman *)
+                       let hlit = get_bits z 5 + 257 in
+                       let hdist = get_bits z 5 + 1 in
+                       let hclen = get_bits z 4 + 4 in
+                       for i = 0 to hclen - 1 do
+                               Array.unsafe_set z.zlengths (Array.unsafe_get code_lengths_pos i) (get_bits z 3);
+                       done;
+                       for i = hclen to 18 do
+                               Array.unsafe_set z.zlengths (Array.unsafe_get code_lengths_pos i) 0;
+                       done;
+                       z.zhuffman <- make_huffman z.zlengths 0 19 8;
+                       let lengths = Array.make (hlit + hdist) 0 in
+                       inflate_lengths z lengths (hlit + hdist);
+                       z.zhuffdist <- Some (make_huffman lengths hlit hdist 16);
+                       z.zhuffman <- make_huffman lengths 0 hlit 16;                   
+                       z.zstate <- CData;
+                       inflate_loop z
+               | _ ->
+                       error Invalid_data)
+       | Flat ->
+               let rlen = min z.zlen z.zneeded in
+               let str = IO.nread z.zinput rlen in
+               let len = String.length str in
+               z.zlen <- z.zlen - len;
+               add_string z str 0 len;
+               if z.zlen = 0 then z.zstate <- (if z.zfinal then Crc else Block);
+               if z.zneeded > 0 then inflate_loop z
+       | DistOne ->
+               let len = min z.zlen z.zneeded in
+               add_dist_one z len;
+               z.zlen <- z.zlen - len;
+               if z.zlen = 0 then z.zstate <- CData;
+               if z.zneeded > 0 then inflate_loop z
+       | Dist ->
+               while z.zlen > 0 && z.zneeded > 0 do
+                       let len = min z.zneeded (min z.zlen z.zdist) in
+                       add_dist z z.zdist len;
+                       z.zlen <- z.zlen - len;
+               done;
+               if z.zlen = 0 then z.zstate <- CData;
+               if z.zneeded > 0 then inflate_loop z
+       | CData ->
+               match apply_huffman z z.zhuffman with
+               | n when n < 256 ->
+                       add_char z (Char.unsafe_chr n);
+                       if z.zneeded > 0 then inflate_loop z
+               | 256 ->
+                       z.zstate <- if z.zfinal then Crc else Block;
+                       inflate_loop z
+               | n ->
+                       let n = n - 257 in
+                       let extra_bits = Array.unsafe_get len_extra_bits_tbl n in
+                       if extra_bits = -1 then error Invalid_data;
+                       z.zlen <- (Array.unsafe_get len_base_val_tbl n) + (get_bits z extra_bits);
+                       let dist_code = (match z.zhuffdist with None -> get_rev_bits z 5 | Some h -> apply_huffman z h) in
+                       let extra_bits = Array.unsafe_get dist_extra_bits_tbl dist_code in
+                       if extra_bits = -1 then error Invalid_data;
+                       z.zdist <- (Array.unsafe_get dist_base_val_tbl dist_code) + (get_bits z extra_bits);
+                       if z.zdist > window_available z.zwindow then error Invalid_data;
+                       z.zstate <- (if z.zdist = 1 then DistOne else Dist);
+                       inflate_loop z
+
+let inflate_data z s pos len =
+       if pos < 0 || len < 0 || pos + len > String.length s then invalid_arg "inflate_data";
+       z.zneeded <- len;
+       z.zoutpos <- pos;
+       z.zoutput <- s;
+       try
+               if len > 0 then inflate_loop z;
+               len - z.zneeded
+       with
+               IO.No_more_input -> error Truncated_data
+
+let inflate_init ?(header=true) ch = 
+       {
+               zfinal = false;
+               zhuffman = fixed_huffman;
+               zhuffdist = None;
+               zlen = 0;
+               zdist = 0;
+               zstate = (if header then Head else Block);
+               zinput = ch;
+               zbits = 0;
+               znbits = 0;
+               zneeded = 0;
+               zoutput = "";
+               zoutpos = 0;
+               zlengths = Array.make 19 (-1);
+               zwindow = window_create (1 lsl 15)
+       }
+
+let inflate ?(header=true) ch =
+       let z = inflate_init ~header ch in
+       let s = String.create 1 in
+       IO.create_in
+               ~read:(fun() ->
+                       let l = inflate_data z s 0 1 in
+                       if l = 1 then String.unsafe_get s 0 else raise IO.No_more_input
+               )
+               ~input:(fun s p l ->
+                       let n = inflate_data z s p l in
+                       if n = 0 then raise IO.No_more_input;
+                       n
+               )
+               ~close:(fun () ->
+                       IO.close_in ch
+               )
diff --git a/bundles/extlib/extlib-1.5.2/unzip.mli b/bundles/extlib/extlib-1.5.2/unzip.mli
new file mode 100644 (file)
index 0000000..5a21cfc
--- /dev/null
@@ -0,0 +1,45 @@
+(*
+ * Unzip - inflate format decompression algorithm
+ * Copyright (C) 2004 Nicolas Cannasse
+ * Compliant with RFC 1950 and 1951
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version,
+ * with the special exception on linking described in file LICENSE.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+(** Decompression algorithm.
+
+       Unzip decompression algorithm is compliant with RFC 1950 and 1951 which
+       are describing the "inflate" algorithm used in most popular file formats.
+       This format is also the one used by the popular ZLib library.   
+*)
+
+type error_msg =
+       | Invalid_huffman
+       | Invalid_data
+       | Invalid_crc
+       | Truncated_data
+       | Unsupported_dictionary
+
+exception Error of error_msg
+
+val inflate : ?header:bool -> IO.input -> IO.input
+(** wrap an input using "inflate" decompression algorithm. raises [Error] if
+  an error occurs (this can only be caused by malformed input data). *)
+
+type t
+
+val inflate_init : ?header:bool -> IO.input -> t
+val inflate_data : t -> string -> int -> int -> int
diff --git a/bundles/menhirLib/Makefile b/bundles/menhirLib/Makefile
new file mode 100644 (file)
index 0000000..cec0a36
--- /dev/null
@@ -0,0 +1,88 @@
+# Bundles the original menhirLib package without modifications.
+# This Makefile integrates its build process with coccinelle.
+
+# the build process is conventional build of the ml files, with
+# the exception that all modules are packed as a submodule of
+# a master module "MenhirLib" instead of an archive file.
+
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
+VERSION=20120123
+MENHIRDIR=menhir-$(VERSION)
+MENHIRLIB=$(MENHIRDIR)/src
+MENHIRMARKER=$(MENHIRLIB)/.marker
+
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) -I $(MENHIRLIB) -thread -custom
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) -I $(MENHIRLIB) -thread
+OCAMLDEP_CMD=$(OCAMLDEP) -I $(MENHIRLIB)
+
+all: menhirLib.cma META
+all.opt: menhirLib.cmxa META
+
+clean:
+       rm -f menhirLib.cma menhirLib.cmxa META \
+               $(MENHIRLIB)/*.cm[ioxa] \
+               $(MENHIRLIB)/*.o \
+               $(MENHIRLIB)/engineTypes.mli $(MENHIRLIB)/tableFormat.mli \
+               menhirLib.cm[ioxa] menhirLib.[oa] \
+               .depend
+
+distclean: clean
+       rm -rf $(MENHIRDIR)
+
+$(MENHIRMARKER): $(MENHIRDIR).tar.gz
+       $(TAR) xfvz $<
+       touch $@
+
+$(MENHIRDIR).tar.gz:
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
+
+.PHONEY: all all.opt clean distclean depend
+
+# Sources needed for coccinelle
+MODULES=infiniteArray packedIntArray rowDisplacement engineTypes \
+               engine tableFormat tableInterpreter convert
+
+MLI=$(MODULES:%=$(MENHIRLIB)/%.mli)
+SRC=$(MODULES:%=$(MENHIRLIB)/%.ml)
+
+# Link
+menhirLib.cma: .depend $(MLI:.mli=.cmi) $(SRC:.ml=.cmo)
+       $(OCAMLC_CMD) -pack -o menhirLib.cmo $(SRC:.ml=.cmo)
+       $(OCAMLC_CMD) -a -o menhirLib.cma menhirLib.cmo
+
+menhirLib.cmxa: .depend $(MLI:.mli=.cmi) $(SRC:.ml=.cmx)
+       $(OCAMLOPT) -pack -o menhirLib.cmx $(SRC:.ml=.cmx)
+       $(OCAMLOPT) -a -o menhirLib.cmxa menhirLib.cmx
+
+# Generic rules
+.SUFFIXES: .ml .mli .cmo .cmi .cmx
+.PRECIOUS: $(MLI)
+
+.ml.mli:
+       $(OCAMLC_CMD) -i $< > $@
+
+.mli.cmi:
+       $(OCAMLC_CMD) -for-pack MenhirLib -c $<
+
+.ml.cmo:
+       $(OCAMLC_CMD) -for-pack MenhirLib -c $<
+
+.ml.cmx:
+       $(OCAMLOPT_CMD) -for-pack MenhirLib -c $<
+
+META: $(MENHIRLIB)/META
+       cp $< $@
+
+# the 'depend' target
+.depend depend: $(MENHIRMARKER)
+       $(OCAMLDEP_CMD) $(MENHIRLIB)/*.mli $(MENHIRLIB)/*.ml > .depend
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+-include .depend
+endif
+endif
diff --git a/bundles/menhirLib/menhir-20120123.tar.gz b/bundles/menhirLib/menhir-20120123.tar.gz
new file mode 100644 (file)
index 0000000..c5fce1b
Binary files /dev/null and b/bundles/menhirLib/menhir-20120123.tar.gz differ
diff --git a/bundles/pcre/Makefile b/bundles/pcre/Makefile
new file mode 100644 (file)
index 0000000..88e8937
--- /dev/null
@@ -0,0 +1,66 @@
+# This Makefile serves as a wrapper to bundle the
+# extlib module without modifications.
+
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
+SHARE_FLAGS=-shared -fpic
+OCAMLC_CMD=$(OCAMLC) -thread -ccopt "${PCRE_CFLAGS}" -cclib "${PCRE_LIBS}" -cc "${CC} ${CFLAGS} ${SHARE_FLAGS}"
+OCAMLOPT_CMD=$(OCAMLOPT) -thread -ccopt "${PCRE_CFLAGS}" -cclib "${PCRE_LIBS}"
+OCAMLMKLIB_CMD=$(OCAMLMKLIB)
+
+PCRE_VERSION=6.2.5
+PCRE_DIR=pcre-ocaml-release-$(PCRE_VERSION)
+PCRE_LIB=$(PCRE_DIR)/lib
+PCRE_MARKER=$(PCRE_DIR)/.marker
+
+all: depend pcre.cma META
+all.opt: depend pcre.cmxa META
+
+clean:
+       rm -f dllpcre_stubs.so libpcre_stubs.a pcre_stubs.o \
+               pcre.cma pcre.cmi pcre.cmo META \
+               pcre.a pcre.cmx pcre.cmxa pcre.o
+
+distclean: clean
+       rm -rf $(PCRE_DIR)
+
+depend: $(PCRE_MARKER)
+
+.PHONEY: all all.opt clean distclean depend
+
+# prepare the pcre directory
+$(PCRE_MARKER): $(PCRE_DIR).tar.gz
+       $(TAR) xfvz $<
+       touch $@
+
+$(PCRE_DIR).tar.gz:
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
+
+# handle the building of pcre ourselves
+
+pcre.cmi: $(PCRE_LIB)/pcre.mli
+       $(OCAMLC_CMD) -c -o $@ $^
+
+pcre.cmo: $(PCRE_LIB)/pcre.ml pcre.cmi
+       $(OCAMLC_CMD) -c -o $@ $<
+
+pcre.cma: pcre.cmo dllpcre_stubs.so
+       $(OCAMLC_CMD) -a -custom -linkall -dllib -lpcre_stubs -o $@ $<
+
+pcre.cmx: $(PCRE_LIB)/pcre.ml pcre.cmi
+       $(OCAMLOPT_CMD) -c -o $@ $<
+
+pcre.cmxa: pcre.cmx dllpcre_stubs.so
+       $(OCAMLOPT_CMD) -a -cclib -lpcre_stubs -o pcre.cmxa $<
+
+pcre_stubs.o: $(PCRE_LIB)/pcre_stubs.c
+       $(OCAMLC_CMD) $<
+
+dllpcre_stubs.so: pcre_stubs.o
+       $(OCAMLMKLIB_CMD) -o pcre_stubs $<
+
+META: $(PCRE_LIB)/META
+       cp "${PCRE_LIB}/META" ./META
diff --git a/bundles/pcre/pcre-ocaml-release-6.2.5.tar.gz b/bundles/pcre/pcre-ocaml-release-6.2.5.tar.gz
new file mode 100644 (file)
index 0000000..eeb7c3a
Binary files /dev/null and b/bundles/pcre/pcre-ocaml-release-6.2.5.tar.gz differ
diff --git a/bundles/pycaml/Makefile b/bundles/pycaml/Makefile
new file mode 100644 (file)
index 0000000..a5c9a51
--- /dev/null
@@ -0,0 +1,78 @@
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
+PYCAMLFILE=pycaml_0.82.orig.tar.gz
+DEBIANFILE=pycaml_0.82-14.debian.tar.gz
+
+PYCAMLDIR=pycaml
+PYCAMLMARKER=$(PYCAMLDIR)/.marker
+DEBIANDIR=debian
+DEBIANMARKER=$(DEBIANDIR)/.marker
+
+SHARE_FLAGS=-shared -fpic
+OCAMLC_CMD=$(OCAMLC) -thread -ccopt "${PYTHON_CFLAGS}" -cclib "${PYTHON_LIBS}" -cc "${CC} ${CFLAGS} ${SHARE_FLAGS}" -I $(PYCAMLDIR)
+OCAMLOPT_CMD=$(OCAMLOPT) -thread -ccopt "${PYTHON_CFLAGS}" -cclib "${PYTHON_LIBS}" -I $(PYCAMLDIR)
+OCAMLMKLIB_CMD=$(OCAMLMKLIB)
+
+
+all: depend pycaml.cmi pycaml.cma
+
+$(PYCAMLDIR)/pycaml.mli: $(PYCAMLDIR)/pycaml.ml
+       $(OCAMLC_CMD) -i $< > $(PYCAMLDIR)/pycaml.mli
+
+$(PYCAMLDIR)/pycaml.cmo: $(PYCAMLDIR)/pycaml.ml $(PYCAMLDIR)/pycaml.cmi
+       $(OCAMLC_CMD) -c $< -o $@
+
+$(PYCAMLDIR)/pycaml.cmi: $(PYCAMLDIR)/pycaml.mli
+       $(OCAMLC_CMD) -c $< -o $@
+
+# local copy of the interface
+pycaml.cmi: $(PYCAMLDIR)/pycaml.cmi
+       cp $< $@
+
+pycaml_ml.o: $(PYCAMLDIR)/pycaml_ml.c
+       $(OCAMLC_CMD) $< -o $@
+
+dllpycaml_stubs.so: pycaml_ml.o
+       $(OCAMLMKLIB_CMD) -o pycaml_stubs $<
+
+pycaml.cma: dllpycaml_stubs.so pycaml.cmi $(PYCAMLDIR)/pycaml.cmo
+       $(OCAMLC_CMD) -a -custom -linkall -o pycaml.cma pycaml.cmo -dllib -lpycaml_stubs
+
+all.opt: depend pycaml.cmi pycaml.cmxa
+
+$(PYCAMLDIR)/pycaml.cmx: $(PYCAMLDIR)/pycaml.ml $(PYCAMLDIR)/pycaml.cmi
+       $(OCAMLOPT_CMD) -c $<
+
+pycaml.cmxa: dllpycaml_stubs.so $(PYCAMLDIR)/pycaml.cmx
+       $(OCAMLOPT_CMD) -a -o pycaml.cmxa pycaml.cmx -cclib -lpycaml_stubs
+
+clean:
+       rm -f $(PYCAMLDIR)/pycaml.mli pycaml.cm[aixo] $(PYCAMLDIR)/pycaml.cm[aixo] \
+               pycaml.[ao] libpycaml_stubs.a dllpycaml_stubs.o dllpycaml_stubs.so \
+               pycaml_ml.o pycaml.cmxa
+
+distclean: clean
+       rm -rf $(PYCAMLDIR) $(DEBIANDIR)
+
+
+# construct the directories
+depend: $(PYCAMLMARKER) $(DEBIANMARKER)
+
+$(PYCAMLMARKER): $(PYCAMLFILE) $(DEBIANMARKER)
+       $(TAR) xfvz $<
+       set -e; for PATCH in $(shell cat debian/patches/series); do $(PATCH) -d "${PYCAMLDIR}" -p1 < "./debian/patches/$${PATCH}"; done
+       touch $@
+
+$(PYCAMLFILE):
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
+
+$(DEBIANMARKER): $(DEBIANFILE)
+       $(TAR) xfvz $<
+       touch $@
+
+$(DEBIANFILE):
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
diff --git a/bundles/pycaml/pycaml_0.82-14.debian.tar.gz b/bundles/pycaml/pycaml_0.82-14.debian.tar.gz
new file mode 100644 (file)
index 0000000..0ad3bec
Binary files /dev/null and b/bundles/pycaml/pycaml_0.82-14.debian.tar.gz differ
diff --git a/bundles/pycaml/pycaml_0.82.orig.tar.gz b/bundles/pycaml/pycaml_0.82.orig.tar.gz
new file mode 100644 (file)
index 0000000..4d2d656
Binary files /dev/null and b/bundles/pycaml/pycaml_0.82.orig.tar.gz differ
diff --git a/bundles/readme.txt b/bundles/readme.txt
new file mode 100644 (file)
index 0000000..3480e3f
--- /dev/null
@@ -0,0 +1,16 @@
+This directory contains bundled ocaml packages that are shipped
+with coccinelle and can be used when the packages are not
+installed on the build system.
+
+By default, packages installed on the system are selected for
+coccinelle's build. This directory can actually be removed if these
+packages are already available.
+
+The packages are unmodified from a particular original version:
+we bundled the original tarballs and build the software from
+these.
+
+Note: the compilation of these libraries may be tied to
+linux platforms because the Makefiles make assumptions
+about file name convention.
+(dllXXX.so XXX.a etc)
diff --git a/bundles/sexplib/Makefile b/bundles/sexplib/Makefile
new file mode 100644 (file)
index 0000000..a288fe0
--- /dev/null
@@ -0,0 +1,102 @@
+# This Makefile serves as a wrapper to bundle the
+# sexplib package without modifications.
+
+# This is a standard build with:
+#  * all files marked with -for-pack Sexplib
+#  * required packages unix num bigarray
+#  * parser.mly requires ocamlyacc
+#  * lexer.mll requires ocamllex
+#  * pre_sexp.ml: use cpp -traditional -undef
+#      (but all other files can be processed with this one as well)
+
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
+VERSION=7.0.5
+SEXPDIR=sexplib-$(VERSION)
+SEXPLIB=$(SEXPDIR)/lib
+SEXPMARKER=$(SEXPDIR)/.marker
+
+PP_CMD=$(CPP) -x c -w -traditional -undef
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) -I $(SEXPLIB) -thread -custom -pp "${PP_CMD}"
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) -I $(SEXPLIB) -thread -pp "${PP_CMD}"
+OCAMLDEP_CMD=$(OCAMLDEP) -I $(SEXPLIB) -pp "${PP_CMD}"
+
+all: sexplib.cma META
+all.opt: sexplib.cmxa META
+
+clean:
+       rm -f sexplib.cma sexplib.cmxa META \
+               $(SEXPLIB)/*.cm[ioxa] \
+               $(SEXPLIB)/*.o \
+               $(SEXPLIB)/parser.ml $(SEXPLIB)/parser.mli \
+               $(SEXPLIB)/lexer.ml $(SEXPLIB)/lexer.mli \
+               sexplib.cm[ioxa] sexplib.[oa] \
+               .depend
+
+distclean: clean
+       rm -rf $(SEXPDIR)
+
+$(SEXPMARKER): $(SEXPDIR).tar.gz sexp-3.10-compat.patch
+       $(TAR) xfvz $<
+       $(PATCH) -d $(SEXPDIR) -p1 < ./sexp-3.10-compat.patch
+       touch $@
+
+$(SEXPDIR).tar.gz:
+       @echo "$@ not found. Please download it and drop it in this directory ($(pwd))."
+       @false
+
+.PHONEY: all all.opt clean distclean depend
+
+
+# Sources needed for coccinelle
+MODULES=type parser lexer pre_sexp sexp_intf \
+               sexp path conv conv_error
+
+MLI=$(MODULES:%=$(SEXPLIB)/%.mli)
+SRC=$(MODULES:%=$(SEXPLIB)/%.ml)
+
+# Link
+sexplib.cma: .depend $(MLI:.mli=.cmi) $(SRC:.ml=.cmo)
+       $(OCAMLC_CMD) -pack -o sexplib.cmo $(SRC:.ml=.cmo)
+       $(OCAMLC_CMD) -a -o sexplib.cma sexplib.cmo
+
+sexplib.cmxa: .depend $(MLI:.mli=.cmi) $(SRC:.ml=.cmx)
+       $(OCAMLOPT) -pack -o sexplib.cmx $(SRC:.ml=.cmx)
+       $(OCAMLOPT) -a -o sexplib.cmxa sexplib.cmx
+
+# Generic rules
+.SUFFIXES: .ml .mli .cmo .cmi .cmx .mly .mll
+.PRECIOUS: $(MLI) $(SRC)
+
+.mly.ml:
+       $(OCAMLYACC) $< > $@
+
+.mll.ml:
+       $(OCAMLLEX) -o $@ $<
+
+.ml.mli:
+       $(OCAMLC_CMD) -i $< > $@
+
+.mli.cmi:
+       $(OCAMLC_CMD) -for-pack Sexplib -c $<
+
+.ml.cmo:
+       $(OCAMLC_CMD) -for-pack Sexplib -c $<
+
+.ml.cmx:
+       $(OCAMLOPT_CMD) -for-pack Sexplib -c $<
+
+META: $(SEXPLIB)/META
+       cp $< $@
+
+# the 'depend' target
+.depend depend: $(SEXPMARKER) $(SRC)
+       $(OCAMLDEP_CMD) $(SEXPLIB)/*.mli $(SEXPLIB)/*.ml > .depend
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+-include .depend
+endif
+endif
diff --git a/bundles/sexplib/sexp-3.10-compat.patch b/bundles/sexplib/sexp-3.10-compat.patch
new file mode 100644 (file)
index 0000000..45e2abc
--- /dev/null
@@ -0,0 +1,167 @@
+diff -ur orig/sexplib-7.0.5/lib/conv.ml sexplib-7.0.5/lib/conv.ml
+--- orig/sexplib-7.0.5/lib/conv.ml     2012-03-20 17:41:54.000000000 +0100
++++ sexplib-7.0.5/lib/conv.ml  2012-03-26 20:04:58.128032729 +0200
+@@ -665,7 +665,7 @@
+         | Parse_error pe ->
+             let ppos =
+               match pe.parse_state with
+-              | `Sexp { parse_pos } | `Annot { parse_pos } -> parse_pos
++              | `Sexp { parse_pos = parse_pos } | `Annot { parse_pos = parse_pos } -> parse_pos
+             in
+             List [
+               Atom "Sexplib.Sexp.Parse_error";
+diff -ur orig/sexplib-7.0.5/lib/pre_sexp.ml sexplib-7.0.5/lib/pre_sexp.ml
+--- orig/sexplib-7.0.5/lib/pre_sexp.ml 2012-03-20 17:41:54.000000000 +0100
++++ sexplib-7.0.5/lib/pre_sexp.ml      2012-03-26 20:04:58.129032741 +0200
+@@ -172,13 +172,7 @@
+ (* Output of S-expressions to file *)
+ let save_of_output ?perm output_function file sexp =
+-  let tmp_name, oc =
+-    let temp_dir =
+-      if Filename.is_relative file then "."
+-      else Filename.dir_sep
+-    in
+-    Filename.open_temp_file ~temp_dir file "tmp"
+-  in
++  let tmp_name, oc = Filename.open_temp_file file "tmp" in
+   try
+     output_function oc sexp;
+     close_out oc;
+@@ -316,9 +310,9 @@
+     else if text_char < 0 then fail "text_char < 0"
+     else if global_offset < 0 then fail "global_offset < 0"
+     else if buf_pos < 0 then fail "buf_pos < 0"
+-    else { text_line; text_char; global_offset; buf_pos }
++    else { text_line = text_line; text_char = text_char; global_offset = global_offset; buf_pos = buf_pos }
+-  let with_buf_pos t buf_pos = { t with buf_pos }
++  let with_buf_pos t buf_pos = { t with buf_pos = buf_pos }
+ end
+ type ('a, 't) parse_result =
+@@ -347,11 +341,11 @@
+ exception Parse_error of parse_error
+-let bump_text_line { parse_pos } =
++let bump_text_line { parse_pos = parse_pos } =
+   parse_pos.Parse_pos.text_line <- parse_pos.Parse_pos.text_line + 1;
+   parse_pos.Parse_pos.text_char <- 0
+-let bump_text_pos { parse_pos } =
++let bump_text_pos { parse_pos = parse_pos } =
+   parse_pos.Parse_pos.text_char <- parse_pos.Parse_pos.text_char + 1
+ let bump_pos_cont state str ~max_pos ~pos cont =
+@@ -378,18 +372,18 @@
+   parse_pos.Parse_pos.buf_pos <- buf_pos;
+   parse_pos.Parse_pos.global_offset <- parse_pos.Parse_pos.global_offset + len
+-let mk_parse_pos { parse_pos } buf_pos =
++let mk_parse_pos { parse_pos = parse_pos } buf_pos =
+   set_parse_pos parse_pos buf_pos;
+   parse_pos
+ let raise_parse_error parse_state location buf_pos err_msg =
+   begin
+     match parse_state with
+-    | `Sexp { parse_pos } | `Annot { parse_pos } ->
++    | `Sexp { parse_pos = parse_pos } | `Annot { parse_pos = parse_pos } ->
+         set_parse_pos parse_pos buf_pos;
+         parse_pos.Parse_pos.text_char <- parse_pos.Parse_pos.text_char + 1;
+   end;
+-  let parse_error = { location; err_msg; parse_state } in
++  let parse_error = { location = location; err_msg = err_msg; parse_state = parse_state } in
+   raise (Parse_error parse_error)
+ let raise_unexpected_char parse_state location buf_pos c =
+@@ -657,7 +651,7 @@
+     let max_pos = check_str_bounds "parse" ~pos ~len str in \
+     let state = \
+       { \
+-        parse_pos; \
++        parse_pos = parse_pos; \
+         pstack = INIT_PSTACK; \
+         pbuf = Buffer.create 128; \
+       } \
+@@ -681,20 +675,20 @@
+ let mk_annot_pos
+       ({ Parse_pos.text_line = line; text_char = col } as parse_pos) pos =
+-  { Annot.line; col; offset = get_glob_ofs parse_pos pos }
++  { Annot.line = line; col = col; offset = get_glob_ofs parse_pos pos }
+ let mk_annot_pos1
+       ({ Parse_pos.text_line = line; text_char = col } as parse_pos) pos =
+-  { Annot.line; col = col + 1; offset = get_glob_ofs parse_pos pos }
++  { Annot.line = line; col = col + 1; offset = get_glob_ofs parse_pos pos }
+-let add_annot_pos { parse_pos; pstack } pos =
++let add_annot_pos { parse_pos = parse_pos; pstack = pstack } pos =
+   pstack.Annot.positions <- mk_annot_pos parse_pos pos :: pstack.Annot.positions
+-let add_annot_pos1 { parse_pos; pstack } pos =
++let add_annot_pos1 { parse_pos = parse_pos; pstack = pstack } pos =
+   pstack.Annot.positions <-
+     mk_annot_pos1 parse_pos pos :: pstack.Annot.positions
+-let get_annot_range { parse_pos; pstack } pos =
++let get_annot_range { parse_pos = parse_pos; pstack = pstack } pos =
+   let start_pos =
+     match pstack.Annot.positions with
+     | [] -> assert false  (* impossible *)
+@@ -708,7 +702,7 @@
+       offset = get_glob_ofs parse_pos pos;
+     }
+   in
+-  { Annot.start_pos; end_pos }
++  { Annot.start_pos = start_pos; end_pos = end_pos }
+ let mk_annot_atom parse_state str pos =
+   Annot.Atom (get_annot_range parse_state pos, Atom str)
+@@ -780,7 +774,7 @@
+   let rec loop this_parse ~pos ~len ~is_incomplete =
+     if len > 0 then
+       match this_parse ~pos ~len buf with
+-      | Done (sexp, ({ Parse_pos.buf_pos } as parse_pos)) ->
++      | Done (sexp, ({ Parse_pos.buf_pos = buf_pos } as parse_pos)) ->
+           rev_sexps_ref := sexp :: !rev_sexps_ref;
+           let n_parsed = buf_pos - pos in
+           let this_parse = mk_this_parse ~parse_pos my_parse in
+@@ -813,7 +807,7 @@
+ let of_string_bigstring loc this_parse ws_buf get_len get_sub str =
+   match this_parse str with
+-  | Done (_, { Parse_pos.buf_pos }) when buf_pos <> get_len str ->
++  | Done (_, { Parse_pos.buf_pos = buf_pos }) when buf_pos <> get_len str ->
+       let prefix_len = min (get_len str - buf_pos) 20 in
+       let prefix = get_sub str buf_pos prefix_len in
+       let msg =
+@@ -874,7 +868,7 @@
+       failwith (sprintf "Sexplib.Sexp.gen_load_sexp: end of file: %s" file)
+     else
+       match this_parse ~pos:0 ~len buf with
+-      | Done (sexp, ({ Parse_pos.buf_pos } as parse_pos))
++      | Done (sexp, ({ Parse_pos.buf_pos = buf_pos } as parse_pos))
+         when strict ->
+           let rec strict_loop this_parse ~pos ~len =
+             match this_parse ~pos ~len buf with
+@@ -938,7 +932,7 @@
+   let get_conv_exn ~file ~exc annot_sexp =
+     let range = get_range annot_sexp in
+-    let { start_pos = { line; col } } = range in
++    let { start_pos = { line = line; col = col } } = range in
+     let loc = sprintf "%s:%d:%d" file line col in
+     Of_sexp_error (Annot.Conv_exn (loc, exc), get_sexp annot_sexp)
+ end
+@@ -1003,7 +997,7 @@
+   let sexp = of_string str in
+   try f sexp
+   with Of_sexp_error (exc, sub_sexp) ->
+-    raise (Of_string_conv_exn.E { Of_string_conv_exn.exc; sexp; sub_sexp })
++    raise (Of_string_conv_exn.E { Of_string_conv_exn.exc = exc; sexp = sexp; sub_sexp = sub_sexp })
+ let of_string_conv_exn str f = gen_of_string_conv_exn of_string str f
+ let of_bigstring_conv_exn bstr f = gen_of_string_conv_exn of_bigstring bstr f
diff --git a/bundles/sexplib/sexplib-7.0.5.tar.gz b/bundles/sexplib/sexplib-7.0.5.tar.gz
new file mode 100644 (file)
index 0000000..9d2efa0
Binary files /dev/null and b/bundles/sexplib/sexplib-7.0.5.tar.gz differ
diff --git a/bundles/sexplib/sexplib-7.0.5/.hg_archival.txt b/bundles/sexplib/sexplib-7.0.5/.hg_archival.txt
new file mode 100644 (file)
index 0000000..ea0694d
--- /dev/null
@@ -0,0 +1,4 @@
+repo: 3f3ede295629c1705d0d9cacc5eb2987690a5e09
+node: 66fbcdf675878b902292050afc697ac5ed26bee0
+branch: default
+tag: forge-release-7.0.5
diff --git a/bundles/sexplib/sexplib-7.0.5/.marker b/bundles/sexplib/sexplib-7.0.5/.marker
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/bundles/sexplib/sexplib-7.0.5/Changelog b/bundles/sexplib/sexplib-7.0.5/Changelog
new file mode 100644 (file)
index 0000000..f18be0e
--- /dev/null
@@ -0,0 +1,254 @@
+2012-03-20:  Updated to latest Oasis release and a package dependency to
+             type_conv.
+
+2011-09-18:  Improved documentation.
+
+2011-09-15:  Fixes to improve package dependency resolution.
+
+2011-07-05:  Fixed a parser position bug.  Parser positions passed by the user
+             were not updated correctly.
+
+             Internal code beautification.
+
+2011-07-04:  Internal updates to sync with Jane Street.
+
+2011-01-30:  Fixed a code generation bug with toplevel entries.
+
+             Thanks to Yong Lu <lyongu@gmail.com> for the report!
+
+2010-12-27:  Added support for MoreLabels.Hashtbl and improved reporting of
+             error locations with preprocessor.
+
+2010-12-26:  Worked around a compiler bug that is expected to be fixed in
+             OCaml 3.12.1.  This workaround temporarily removes the interface
+             for module Conv (conv.mli), thus exposing the internals.
+             This should not cause any problems for end users as long as
+             they do not depend on the exported internal representations.
+             The interface will become constrained again as soon as the
+             fixed compiler is out.
+
+2010-12-22:  Major release.
+
+             Merged with Jane Street version.  This has caused an API-change
+             that requires "open Sexplib.Conv" at the top of files that use the
+             syntax extension.
+
+             Renamed functions:
+
+               * sexp_of_lazy -> sexp_of_lazy_t
+               * lazy_of_sexp -> lazy_t_of_sexp
+
+            Some standard library modules are now re-exported with predefined
+            S-expression converters in module Conv.
+
+2010-09-25:  Fixed inferred types of generated functions when dealing with arrow
+             types.
+
+2010-08-26:  Fixed a lexer bug when parsing comments.
+
+2010-05-21:  Added support for sexp_bool record field annotations.
+
+2010-05-18:  Improved performance of converting S-expressions to strings.
+
+2010-04-12:  Changed API of Of_sexp_error exception.
+
+2010-04-07:  Added of_(big)string_conv_exn functions.
+
+2010-04-01:  Merged with Jane Street version.
+
+             Major new features (various functions):
+
+               * Type-annotated parsing for better error messages
+               * Greatly improved performance of exception converters
+
+2009-12-21:  Improved saving of files.
+
+2009-10-12:  Added sexp_array record field extension.
+
+2009-09-19:  Added missing variant type cases.
+
+             Fixed handling of variance annotations.
+
+2009-09-15:  Internal cleanups.
+
+2009-07-28:  Added better support for conversion of exception types.
+
+2009-06-23:  Fixed build problem.
+
+             Thanks to Sylvain Le Gall <gildor@ocamlcore.org> for
+             the patch!
+
+2009-05-08:  Fixed build problems on Windows and OCamlMakefile issues.
+
+             Thanks to Sylvain Le Gall <gildor@ocamlcore.org> for
+             the patch!
+
+2009-04-22:  Added macro support for all types of vectors, matrices,
+             and for bigstrings.
+
+2009-04-21:  Merged with Jane Street version, no user-relevant changes.
+
+2009-03-09:  Merged with Jane Street version, no user-relevant changes.
+
+2009-03-01:  Fixed build problem on Mac OS X by updating OCamlMakefile.
+
+2009-01-20:  Automatically add S-expression pretty-printers to toplevels.
+
+2008-09-30:  Added a new feature: sexp_opaque.  It prevents the need for /
+             use of type converters for a given type in a particular
+             type context.
+
+             Removed abstract types to unify them with this new concept.
+
+2008-09-29:  Added a new feature: sexp_list.  This is similar to
+             the handling of sexp_option.  By default an empty list is
+             assumed for unspecified records using sexp_list as qualifier.
+             Such record fields bound to empty lists will also not be
+             printed anymore for better readability.
+
+2008-09-23:  Added missing Not_found-exception to standard exception
+             converters.
+
+2008-08-20:  Removed dependency on threads.  Fixed build problems.
+
+2008-08-08:  Nifty new feature: exceptions can now be converted to
+             S-expressions, too!  The "with sexp" syntax extension can be
+             used with exceptions, thus registering a conversion function.
+             A global exception conversion function can then be called
+             to convert an arbitrary exception into an S-expression,
+             which can then be printed out.  This should greatly
+             improve readability of uncaught exceptions while making
+             life extremely easy for the developer.
+
+             Renamed the ParseError exception to Parse_error to be more
+             compliant with Jane Street naming conventions.
+
+2008-07-25:  Added utilities for conversion error handling.  Minor fixes.
+
+2008-04-24:  Made Sexp-interface manifest.
+
+2008-03-20:  Fixed META-file (missing num dependency).
+
+2008-03-17:  Improved META-file.
+
+2008-03-13:  Fully allow function types in converters.  Raise runtime
+             exceptions on converting from S-expressions instead when
+             function type encountered.
+
+2008-02-11:  Fixed code generation problems with variance annotations
+             in signatures, and empty types.
+
+2007-12-17:  Added support for generating signature entries for
+             S-expression converters.  Thanks to Till Varoquaux
+             <till.varoquaux@gmail.com> for the patch!
+
+2007-11-29:  Added support for converting big_int, nat, num, and ratio.
+
+2007-11-26:  Added support for parsing from bigstrings (char bigarrays).
+
+2007-11-02:  Added syntax support for option types to use the ordinary
+             sum type syntax.  This should improve readability.
+             The old syntax will be accepted, too, if
+             Conv.read_old_option_format is set to true (this is
+             currently the default).  The old format will be used for
+             writing if Conv.write_old_option_format is true (currently
+             the default).  The old syntax is deprecated and will
+             probably not be supported by default in the near future.
+             Reading new-style option values will always succeed.
+
+2007-09-14:  Fixed bug in S-expression preprocessor concerning record
+             field names.
+
+2007-08-06:  Added support for converting functions to S-expressions.
+
+2007-07-20:  Fixed position information and improved speed of S-expression
+             parser.  Fixed S-expression macro bug concerning contained
+             polymorphic variants.
+
+2007-06-28:  Improved Sexplib code generation.
+
+2007-06-22:  Fixed escaping bug in S-expression parser.
+
+2007-06-01:  Added correct handling of recursive types + test case.
+
+2007-04-18:  Added missing conversion functions from S-expressions to
+             pairs and triples.
+
+2007-03-21:  Updated OCamlMakefile.
+
+2007-03-02:  Improved error messages when parsing illegal type definitions.
+
+2007-01-30:  Added triple conversions.
+
+2006-11-22:  Updated OCamlMakefile.
+
+2006-10-13:  Improved checking of records for extra or duplicate fields.
+
+2006-09-06:  Added support for polymorphic record fields.
+
+2006-09-05:  Added support for manifest types.
+
+2006-08-16:  Improved error messages.
+
+2006-07-28:  Added a new, hand-written S-expression parser that supports
+             partial parsing and should be approx. 10x faster than the
+             previous one.
+
+2006-06-20:  Fixed a code generation problem leading to compilation
+             errors concerning the use of type aliases within polymorphic
+             variant type definitions.
+
+             This fix also solves potential erroneous appearances of
+             backtracking exceptions in user code.
+
+2006-03-21:  Added -for-pack option to Makefile and cleaned up
+             distribution for a new public release.
+
+2006-03-13:  Sexplib now accepts capitalized booleans.
+
+2006-03-03:  Added customizable indentation levels.
+             Improved documentation.
+             Fixed API-problem concerning backward compatibility.
+
+2006-03-03:  Added customizable indentation levels.
+             Improved documentation.
+
+2006-03-01:  Added a missing flush for string conversions with a buffer.
+
+2006-02-08:  Eliminated unused variable warnings in Sexplib-generated code.
+
+2006-01-11:  Added functions for pretty-printing to buffers.  Improved
+             performance of outputting S-expressions to channels.
+
+2006-01-09:  Added functions load_sexp and load_sexps.
+
+2006-01-04:  Changed float conversion from %E to %G (more readable).
+
+2005-12-28:  Made machine representation for S-expressions more compact
+
+2005-12-15:  Fixed a problem appearing with OCaml-release 3.08.4:  CamlP4
+             obviously performs more strict checking on some constructs
+             now and crashed with an exception when generating
+             S-expression code for records containing only one field
+             ("singleton tuple problem").  This problem is fixed now.
+
+2005-11-25:  Fixed problem with type variables that could not be generalized.
+
+2005-11-23:  Added a missing case in type definitions (path alias)
+
+2005-11-17:  Major release: 2.0
+
+             Fixed a major design problem.  The user now has to pass lex
+             buffers instead of channels to input-functions.  Reason:
+             trailing characters in channels were lost due to ocamllex
+             buffering them in the non-exposed lex buffer.  This lex
+             buffer is now exposed.  The functions have been renamed
+             ("input_X" -> "scan_X") to reflect this change.
+
+2005-11-16:  Added label to conversion function "input_cnv_sexps".
+
+2005-11-11:  Fixed a bug in the pretty-printer: strings in atoms were
+             not escaped in the function "to_string_mach" (and therefore
+             also "to_string").
+
+2005-11-07:  Initial release.
diff --git a/bundles/sexplib/sexplib-7.0.5/INSTALL b/bundles/sexplib/sexplib-7.0.5/INSTALL
new file mode 100644 (file)
index 0000000..02dde66
--- /dev/null
@@ -0,0 +1,37 @@
+(* OASIS_START *)
+(* DO NOT EDIT (digest: b4b9b34e94dfc4c6914f87aae494ed32) *)
+This is the INSTALL file for the sexplib distribution.
+
+This package uses OASIS to generate its build system. See section OASIS for
+full information. 
+
+Dependencies
+============
+
+In order to compile this package, you will need:
+* ocaml (>= 3.12) for all, test conv, test sexp, doc sexplib
+* findlib
+* type_conv (>= 3.0.5) for library pa_sexp_conv
+
+Installing
+==========
+
+1. Uncompress the source archive and go to the root of the package
+2. Run 'ocaml setup.ml -configure'
+3. Run 'ocaml setup.ml -build'
+4. Run 'ocaml setup.ml -install'
+
+Uninstalling
+============
+
+1. Go to the root of the package 
+2. Run 'ocaml setup.ml -uninstall'
+
+OASIS
+=====
+
+OASIS is a program that generates a setup.ml file using a simple '_oasis'
+configuration file. The generated setup only depends on the standard OCaml
+installation: no additional library is required.
+
+(* OASIS_STOP *)
diff --git a/bundles/sexplib/sexplib-7.0.5/Makefile b/bundles/sexplib/sexplib-7.0.5/Makefile
new file mode 100644 (file)
index 0000000..68f2e0e
--- /dev/null
@@ -0,0 +1,38 @@
+# OASIS_START
+# DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb)
+
+SETUP = ocaml setup.ml
+
+build: setup.data
+       $(SETUP) -build $(BUILDFLAGS)
+
+doc: setup.data build
+       $(SETUP) -doc $(DOCFLAGS)
+
+test: setup.data build
+       $(SETUP) -test $(TESTFLAGS)
+
+all: 
+       $(SETUP) -all $(ALLFLAGS)
+
+install: setup.data
+       $(SETUP) -install $(INSTALLFLAGS)
+
+uninstall: setup.data
+       $(SETUP) -uninstall $(UNINSTALLFLAGS)
+
+reinstall: setup.data
+       $(SETUP) -reinstall $(REINSTALLFLAGS)
+
+clean: 
+       $(SETUP) -clean $(CLEANFLAGS)
+
+distclean: 
+       $(SETUP) -distclean $(DISTCLEANFLAGS)
+
+setup.data:
+       $(SETUP) -configure $(CONFIGUREFLAGS)
+
+.PHONY: build doc test all install uninstall reinstall clean distclean configure
+
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/README.txt b/bundles/sexplib/sexplib-7.0.5/README.txt
new file mode 100644 (file)
index 0000000..17c02c0
--- /dev/null
@@ -0,0 +1,457 @@
+    
+                                        
+                          README: library "Sexplib"
+                          *************************
+             Copyright   (C)   2012  Jane Street Holding, LLC (1)
+            =====================================================
+                             Author: Markus Mottl 
+                            ======================
+                             New York, 2012-03-20
+                             ====================
+  
+
+1  Directory contents
+*=*=*=*=*=*=*=*=*=*=*
+
+   
+                                        
+   ------------------------------------------------------------------------
+   |     CHANGES       |              History of code changes             |
+   ------------------------------------------------------------------------
+   |    COPYRIGHT      |                 Notes on copyright               |
+   ------------------------------------------------------------------------
+   |     INSTALL       |            Short notes on compiling and          |
+   |                   |               installing the library             |
+   ------------------------------------------------------------------------
+   |     LICENSE       |        "GNU LESSER GENERAL PUBLIC LICENSE"       |
+   ------------------------------------------------------------------------
+   |  LICENSE.Tywith   |  License of Tywith, from which Sexplib is derived|
+   ------------------------------------------------------------------------
+   |     Makefile      |                    Top Makefile                  |
+   ------------------------------------------------------------------------
+   |  OCamlMakefile    |        Generic Makefile for OCaml-projects       |
+   ------------------------------------------------------------------------
+   |    OMakefile      |                  Ignore this file                |
+   ------------------------------------------------------------------------
+   |    README.txt     |                     This file                    |
+   ------------------------------------------------------------------------
+   |       lib/        |     OCaml-library for S-expression conversions   |
+   ------------------------------------------------------------------------
+   |    lib_test/      |     Test applications for the Sexplib-library    |
+   ------------------------------------------------------------------------
+                                        
+  
+  
+
+2  What is "Sexplib"?
+*=*=*=*=*=*=*=*=*=*=*
+
+  
+  This library contains functionality for parsing and pretty-printing
+S-expressions. In addition to that it contains a preprocessing module for
+Camlp4, which can be used to automatically generate code from type definitions
+for efficiently converting OCaml-values to S-expressions and vice versa. In
+combination with the parsing and pretty-printing functionality this frees
+users from having to write their own I/O-routines for datastructures they
+define. Possible errors during automatic conversions from S-expressions to
+OCaml-values are reported in human-readable ways with exact location
+information. Another module in this library allows you to extract and replace
+sub-expressions in S-expressions.
+  
+
+3  How can you use it?
+*=*=*=*=*=*=*=*=*=*=*=
+
+  
+  Make sure you have installed the 'type_conv' package on your system, too. It
+should be obtainable at the same site as 'sexplib'.
+  
+  The API (.mli-files) in the 'sexplib' library directory is fully documented.
+Module 'Sexp' contains all I/O-functions for S-expressions, module 'Conv'
+helper functions for converting OCaml-values of standard types to
+S-expressions. Module 'Path' supports sub-expression extraction and
+substitution.
+  
+  Module 'pa_sexp_conv.ml' contains the extensions for the
+Camlp4-preprocessor. It adds the new construct 'with sexp' (and 'with sexp_of'
+and 'with of_sexp', which are implied by the first). When using this construct
+right after a type definition, function definitions will be generated
+automatically, which perform S-expression conversions.
+  
+  E.g. given the following type definition:
+<<  type t = A | B
+    with sexp
+>>
+  
+  The above will generate the functions 'sexp_of_t' and 't_of_sexp'. The
+preprocessor also supports automatic addition of conversion functions to
+signatures. Just add 'with sexp' to the type in a signature, and the
+appropriate function signatures will be generated.
+  
+  Converters for standard types (int, list, Hashtbl.t, etc.) become visible to
+the macro-generated code by opening the standard module before their first use
+in a type definition. Users will therefore usually want to place the following
+at the top of their files:
+<<  open Sexplib.Std
+>>
+  
+  See the file 'lib_test/conv_test.ml' for example usage. It also demonstrates
+how to extract and substitute sub-expressions.
+  
+
+3.1  Compiling and linking
+==========================
+  
+  To compile a file you will have to add a preprocessing flag to the compiler
+invocation, e.g. for foo.ml:
+<<  ocamlc -pp "camlp4o -I {path to type_conv} \
+      -I {path to sexplib} pa_type_conv.cmo pa_sexp_conv.cmo" \
+      -I {path to sexplib} foo.ml
+>>
+  
+  If you are using OCamlMakefile, just put the following line at the top of
+the file, assuming you have installed both 'type_conv' and 'sexplib' with
+ocamlfind. The comment must start at the beginning of the line, and you must
+not break lines (here broken for readability only):
+<<  (*pp camlp4o -I `ocamlfind query type_conv` \
+      -I `ocamlfind query sexplib` \
+      pa_type_conv.cmo pa_sexp_conv.cmo *)
+>>
+  
+  Don't forget to place the macro 'TYPE_CONV_PATH', which takes a string
+argument, at the top of the file to be preprocessed (see example
+'conv_test.ml'). It is supposed to set the module path to the given module
+file. This is necessary, because modules may get packed at a later stage, and
+error messages generated by Sexplib will refer to this location to help
+pinpointing the associated type.
+  
+  In the linking stage you will only have to link with 'sexplib'. E.g. when
+using OCamlMakefile just add it to the 'PACKS'-variable.
+  
+
+4  Syntax Specification of S-expressions
+*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
+
+  
+  
+
+4.1  Lexical conventions of S-expression
+========================================
+  
+  Whitespace, which consists of space, newline, carriage return, horizontal
+tab and form feed, is ignored unless within an OCaml-string, where it is
+treated according to OCaml-conventions. The semicolon introduces comments.
+Comments are ignored, and range up to the next newline character. The left
+parenthesis opens a new list, the right parenthesis closes it again. Lists can
+be empty. The double quote denotes the beginning and end of a string following
+the lexical conventions of OCaml (see OCaml-manual for details). All
+characters other than double quotes, left- and right parentheses, and
+whitespace are considered part of a contiguous string.
+  
+
+4.2  Grammar of S-expressions
+=============================
+  
+  S-expressions are either strings (= atoms) or lists. The lists can
+recursively contain further S-expressions or be empty, and must be balanced,
+i.e. parentheses must match.
+  
+
+4.3  Examples
+=============
+  
+<<  this_is_an_atom_123'&^%!  ; this is a comment
+    "another atom in an OCaml-string \"string in a string\" \123"
+  
+    ; empty list follows below
+    ()
+  
+    ; a more complex example
+    (
+      (
+        list in a list  ; comment within a list
+        (list in a list in a list)
+        42 is the answer to all questions
+      )
+    )
+>>
+  
+  
+
+4.4  Conversion of basic OCaml-values
+=====================================
+  
+  Basic OCaml-values like the unit-value, integers (in all representations),
+floats, strings, and booleans are represented in S-exp syntax in the same way
+as in OCaml. Strings may also appear without quotes if this does not clash
+with the lexical conventions for S-expressions.
+  
+
+4.5  Conversion of OCaml-tuples
+===============================
+  
+  OCaml-tuples are simple lists of values in the same order as in the tuple.
+E.g.:
+<<  (3.14, "foo", "bar bla", 27) <===> (3.14 foo "bar bla" 27)
+>>
+  
+  
+
+4.6  Conversion of OCaml-records
+================================
+  
+  OCaml-records are represented as lists of pairs in S-expression syntax. Each
+pair consists of the name of the record field (first element), and its value
+(second element). E.g.:
+<<  {
+      foo = 3;
+      bar = "some string";
+    }
+  
+    <===>
+  
+    (
+      (foo 3)
+      (bar "some string")
+    )
+>>
+  
+  Type specifications of records allow the use of a special type 'sexp_option'
+which indicates that a record field should be optional. E.g.:
+<<  type t =
+      {
+        x : int option;
+        y : int sexp_option;
+      }
+>>
+  
+  The type 'sexp_option' is equivalent to ordinary options, but is treated
+specially by the code generator. The above would lead to the following
+equivalences of values and S-expressions:
+<<  {
+      x = Some 1;
+      y = Some 2;
+    }
+  
+    <===>
+  
+    (
+      (x (some 1))
+      (y 2)
+    )
+>>
+  
+  And:
+<<  {
+      x = None;
+      y = None;
+    }
+  
+    <===>
+  
+    (
+      (x none)
+    )
+>>
+  
+  Note how 'sexp_option' allows you to leave away record fields that should
+default to 'None'. It is also unnecessary (and actually wrong) now to write
+down such a value as an option, i.e. the 'some'-tag must be dropped if the
+field should be defined.
+  
+  The types 'sexp_list', 'sexp_array', and 'sexp_bool' can be used in ways
+similar to the type 'sexp_option'. They assume the empty list, empty array,
+and false value respectively as default values.
+  
+
+4.7  Conversion of sum types
+============================
+  
+  Constant constructors in sum types are represented as strings. Constructors
+with arguments are represented as lists, the first element being the
+constructor name, the rest being its arguments. Constructors may also be
+started in lowercase in S-expressions, but will always be converted to
+uppercase when converting from OCaml-values.
+  
+  For example:
+<<  type t = A | B of int * float * t with sexp
+  
+    B (42, 3.14, B (-1, 2.72, A)) <===> (B 42 3.14 (B -1 2.72 A))
+>>
+  
+  The above example also demonstrates recursion in datastructures. 
+  
+
+4.8  Conversion of variant types
+================================
+  
+  The conversion of polymorphic variants is almost the same as with sum types.
+The notable difference is that variant constructors must always start with an
+either lower- or uppercase character, matching the way it was specified in the
+type definition. This is because OCaml also distinguishes between upper- and
+lowercase variant constructors. Note that type specifications containing
+unions of variant types are also supported by the S-expression converter.
+  
+
+4.9  Conversion of OCaml-lists and arrays
+=========================================
+  
+  OCaml-lists and arrays are straightforwardly represented as S-expression
+lists.
+  
+
+4.10  Conversion of option types
+================================
+  
+  The option type is converted like ordinary polymorphic sum types, i.e.:
+<<  None        <===>  none
+    Some value  <===>  (some value)
+>>
+  
+  There is a deprecated version of the syntax in which values of option type
+are represented as lists in S-expressions:
+<<  None        <===>  ()
+    Some value  <===>  (value)
+>>
+  
+  Reading of the old-style S-expression syntax for option values is only
+supported if the reference 'Conv.read_old_option_format' is set to 'true'
+(currently the default, which may change soon). A conversion exception is
+raised otherwise. The old format will be written only if
+'Conv.write_old_option_format' is true (also currently the default). Reading
+of the new format is always supported.
+  
+
+4.11  Conversion of polymorphic values
+======================================
+  
+  There is nothing special about polymorphic values as long as there are
+conversion functions for the type parameters. E.g.:
+<<  type 'a t = A | B of 'a with sexp
+    type foo = int t with sexp
+>>
+  
+  In the above case the conversion functions will behave as if 'foo' had been
+defined as a monomorphic version of 't' with ''a' replaced by 'int' on the
+right hand side.
+  
+  If a datastructure is indeed polymorphic, and you want to convert it, you
+will have to supply the conversion functions for the type parameters at
+runtime. E.g. in the above example, if you wanted to convert a value of type
+''a t', you would have to write something like this:
+<<  sexp_of_t sexp_of_a v
+>>
+  
+  where 'sexp_of_a', which may also be named differently in this particular
+case, is a function that converts values of type ''a' to an S-expression.
+Types with more than one parameter require passing conversion functions for
+those parameters in the order of their appearance on the left hand side of the
+type definition.
+  
+
+4.12  Conversion of abstract datatypes
+======================================
+  
+  Of course, if you want to convert an abstract datatype to an S-expression,
+you will have to roll your own conversion function, which should produce
+values of type 'Sexp.t' directly. If, however, you want to make use of your
+abstract type within definitions of other types, make sure that you call your
+conversion function appropriately: it should be in the same scope as the
+typename, and must be named 'sexp_of_{typename}'.
+  
+
+4.13  Conversion of hashtables
+==============================
+  
+  Hashtables, which are abstract values in OCaml, are represented as
+association lists, i.e. lists of key-value pairs, e.g.:
+<<  ((foo 42) (bar 3))
+>>
+  
+  Reading in the above S-expression as hashtable mapping strings to integers
+('(string, int) Hashtbl.t') will map '"foo"' to 42 and '"bar"' to 3.
+  
+  Note that the order of elements in the list may matter, because duplicates
+are kept: bindings will be inserted into the hashtable in order of appearence.
+Therefore, the last binding of a key will be the "visible" one, the others are
+"hidden". See the OCaml-documentation on hashtables for details.
+  
+  Note, too, that polymorphic equality may not hold between conversions. You
+will have to use a function implementing logical equality for that purpose.
+  
+
+4.14  Conversion of opaque values
+=================================
+  
+  Opaque values are ones for which we do not want to perform conversions. This
+may be, because we do not have S-expression converters for them, or because we
+do not want to apply them in a particular type context, e.g. if the resulting
+S-expression should be printed out but without superfluous information. To
+prevent the preprocessor from generating calls to converters, simply apply the
+qualifier 'sexp_opaque' as if it were a type constructor, e.g.:
+<<  type foo = int * stuff sexp_opaque with sexp
+>>
+  
+  Thus, there is no need to specify converters for type 'stuff', and if there
+are any, they will not be used in this particular context. Needless to say, it
+is not possible to convert such an S-expression back to the original value.
+Here is an example conversion:
+<<  (42, some_stuff) ===>  (42, <opaque>)
+>>
+  
+  
+
+4.15  Conversion of exceptions
+==============================
+  
+  S-expression converters for exceptions can be automatically registered using
+the 'with sexp' macro, e.g.:
+<<  module M = struct
+      exception Foo of int with sexp
+    end
+>>
+  
+  Such exceptions will be translated in a similar way as sum types, but their
+constructor will be prefixed with the fully qualified module path (here:
+'M.Foo') so as to be able to discriminate between them without problems.
+   The user can then easily convert an exception matching the above one to an
+S-expression using 'Sexplib.Conv.sexp_of_exn'. User-defined conversion
+functions can be registered, too, by calling 'Sexplib.Conv.add_exn_converter'.
+This should make it very convenient for users to catch arbitrary exceptions
+escaping their program and pretty-printing them, including all arguments, as
+S-expressions. The library already contains mappings for all known exceptions
+that can escape functions in the OCaml standard library.
+  
+
+5  I/O and type conversions
+*=*=*=*=*=*=*=*=*=*=*=*=*=*
+
+  
+  There are multiple ways of performing I/O with S-expressions. If exact error
+locations are required when type conversions fail, S-expressions need to be
+parsed with location annotations. In most cases users may want to use
+functions like e.g. 'load_sexp_conv' or 'load_sexp_conv_exn', which load
+S-expressions from files and convert them. Only when conversions fail, the
+file will be reparsed with annotations, which is slower, and type errors will
+be reported accurately with file, line number, column, and file position.
+  
+
+6  Contact information
+*=*=*=*=*=*=*=*=*=*=*=
+
+  
+  In the case of bugs, feature requests and similar, you can contact us here:
+     opensource@janestreet.com
+   Up-to-date information concerning this library should be available here:
+     http://www.janestreet.com/ocaml
+   Enjoy!!
+   
+-----------------------------------------------------------------------------
+  
+   This document was translated from LaTeX by HeVeA (2).
+--------------------------------------
+  
+  
+ (1) http://www.janestreet.com
+ (2) http://hevea.inria.fr/index.html
diff --git a/bundles/sexplib/sexplib-7.0.5/_oasis b/bundles/sexplib/sexplib-7.0.5/_oasis
new file mode 100644 (file)
index 0000000..b0a1400
--- /dev/null
@@ -0,0 +1,84 @@
+OASISFormat:  0.3
+OCamlVersion: >= 3.12
+Name:         sexplib
+Version:      7.0.5
+Synopsis:     automated S-expression conversion
+Authors:      Markus Mottl,
+              Martin Sandin
+Copyrights:   (C) 2005-2011 Jane Street Capital LLC
+License:      LGPL-2.1 with OCaml linking exception
+LicenseFile:  LICENSE
+Plugins:      StdFiles (0.3),
+              DevFiles (0.3),
+              META (0.3)
+BuildTools:   ocamlbuild, camlp4o
+XStdFilesAUTHORS: false
+XStdFilesINSTALLFilename: INSTALL
+XStdFilesREADME: false
+
+Library sexplib
+  Path:               lib
+  Pack:               true
+  Modules:            Type,
+                      Parser,
+                      Lexer,
+                      Pre_sexp,
+                      Sexp_intf,
+                      Sexp,
+                      Path,
+                      Conv,
+                      Conv_error,
+                      Exn_magic,
+                      Std
+  BuildDepends:       unix,bigarray,num
+  XMETARequires:      unix,bigarray,num
+
+Library pa_sexp_conv
+  Path:               syntax
+  FindlibName:        syntax
+  FindlibParent:      sexplib
+  Modules:            Pa_sexp_conv
+  BuildDepends:       camlp4.quotations,camlp4.extend,type_conv (>= 3.0.5)
+  CompiledObject:     byte
+  XMETAType:          syntax
+  XMETARequires:      type_conv,sexplib
+  XMETADescription:   Syntax extension for Sexplib
+
+Library sexplib_top
+  Path:               top
+  FindlibName:        top
+  FindlibParent:      sexplib
+  Modules:            Install_printers
+  XMETARequires:      sexplib
+  XMETADescription:   Toplevel printers for S-expressions
+
+Executable sexp_test
+  Path:               lib_test
+  MainIs:             sexp_test.ml
+  Build$:             flag(tests)
+  Install:            false
+  BuildDepends:       sexplib
+
+Executable conv_test
+  Path:               lib_test
+  MainIs:             conv_test.ml
+  Build$:             flag(tests)
+  Install:            false
+  BuildDepends:       sexplib, sexplib.syntax
+
+Test sexp
+  Run$:               flag(tests)
+  Command:            $sexp_test < test.sexp
+  WorkingDirectory:   lib_test
+
+Test conv
+  Run$:               flag(tests)
+  Command:            $conv_test
+  WorkingDirectory:   lib_test
+
+Document "sexplib"
+  Title:                API reference for sexplib
+  Type:                 ocamlbuild (0.3)
+  BuildTools+:          ocamldoc
+  XOCamlbuildPath:      lib
+  XOCamlbuildLibraries: sexplib
diff --git a/bundles/sexplib/sexplib-7.0.5/_tags b/bundles/sexplib/sexplib-7.0.5/_tags
new file mode 100644 (file)
index 0000000..0c03080
--- /dev/null
@@ -0,0 +1,68 @@
+# OASIS_START
+# DO NOT EDIT (digest: a1d81a7e4d410a35183ff1a62ca59486)
+# Ignore VCS directories, you can use the same kind of rule outside 
+# OASIS_START/STOP if you want to exclude directories that contains 
+# useless stuff for the build process
+<**/.svn>: -traverse
+<**/.svn>: not_hygienic
+".bzr": -traverse
+".bzr": not_hygienic
+".hg": -traverse
+".hg": not_hygienic
+".git": -traverse
+".git": not_hygienic
+"_darcs": -traverse
+"_darcs": not_hygienic
+# Library sexplib
+"lib": include
+"lib/type.cmx": for-pack(Sexplib)
+"lib/parser.cmx": for-pack(Sexplib)
+"lib/lexer.cmx": for-pack(Sexplib)
+"lib/pre_sexp.cmx": for-pack(Sexplib)
+"lib/sexp_intf.cmx": for-pack(Sexplib)
+"lib/sexp.cmx": for-pack(Sexplib)
+"lib/path.cmx": for-pack(Sexplib)
+"lib/conv.cmx": for-pack(Sexplib)
+"lib/conv_error.cmx": for-pack(Sexplib)
+"lib/exn_magic.cmx": for-pack(Sexplib)
+"lib/std.cmx": for-pack(Sexplib)
+<lib/*.ml{,i}>: pkg_unix
+<lib/*.ml{,i}>: pkg_num
+<lib/*.ml{,i}>: pkg_bigarray
+# Library pa_sexp_conv
+"syntax": include
+<syntax/*.ml{,i}>: pkg_type_conv
+<syntax/*.ml{,i}>: pkg_camlp4.quotations
+<syntax/*.ml{,i}>: pkg_camlp4.extend
+# Executable conv_test
+"lib_test/conv_test.byte": use_pa_sexp_conv
+"lib_test/conv_test.byte": use_sexplib
+"lib_test/conv_test.byte": pkg_unix
+"lib_test/conv_test.byte": pkg_type_conv
+"lib_test/conv_test.byte": pkg_num
+"lib_test/conv_test.byte": pkg_camlp4.quotations
+"lib_test/conv_test.byte": pkg_camlp4.extend
+"lib_test/conv_test.byte": pkg_bigarray
+<lib_test/*.ml{,i}>: use_pa_sexp_conv
+<lib_test/*.ml{,i}>: pkg_type_conv
+<lib_test/*.ml{,i}>: pkg_camlp4.quotations
+<lib_test/*.ml{,i}>: pkg_camlp4.extend
+# Library sexplib_top
+"top": include
+# Executable sexp_test
+"lib_test/sexp_test.byte": use_sexplib
+"lib_test/sexp_test.byte": pkg_unix
+"lib_test/sexp_test.byte": pkg_num
+"lib_test/sexp_test.byte": pkg_bigarray
+<lib_test/*.ml{,i}>: use_sexplib
+<lib_test/*.ml{,i}>: pkg_unix
+<lib_test/*.ml{,i}>: pkg_num
+<lib_test/*.ml{,i}>: pkg_bigarray
+# OASIS_STOP
+<syntax/pa_sexp_conv.ml>: syntax_camlp4o
+<lib/pre_sexp.ml>:pp(cpp -traditional -undef)
+
+"lib_test/conv_test.ml": syntax_camlp4o, pkg_type_conv.syntax
+# Remove this line, once BuildDepends: sexplib... will be taken
+# into account
+"lib_test/conv_test.byte": use_sexplib, pkg_unix, pkg_num, pkg_bigarray
diff --git a/bundles/sexplib/sexplib-7.0.5/configure b/bundles/sexplib/sexplib-7.0.5/configure
new file mode 100755 (executable)
index 0000000..97ed012
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# OASIS_START
+# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7)
+set -e
+
+FST=true
+for i in "$@"; do 
+  if $FST; then
+    set --
+    FST=false
+  fi
+
+  case $i in
+    --*=*)
+      ARG=${i%%=*}
+      VAL=${i##*=}
+      set -- "$@" "$ARG" "$VAL"
+      ;;
+    *)
+      set -- "$@" "$i"
+      ;;
+  esac
+done
+
+ocaml setup.ml -configure "$@"
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/doc/Makefile b/bundles/sexplib/sexplib-7.0.5/doc/Makefile
new file mode 100644 (file)
index 0000000..589be16
--- /dev/null
@@ -0,0 +1,9 @@
+NAME        := README
+HEVEAFLAGS  := -w 78 -fix -exec ~/bin/xxdate.exe custom.hva 
+
+all:   text pdf
+
+$(NAME).tex:
+       touch $@
+
+-include HeveaMakefile
diff --git a/bundles/sexplib/sexplib-7.0.5/doc/OMakefile b/bundles/sexplib/sexplib-7.0.5/doc/OMakefile
new file mode 100644 (file)
index 0000000..671931e
--- /dev/null
@@ -0,0 +1,8 @@
+USEPDFLATEX = true
+DOC = README
+
+LaTeXDocument($(DOC), $(DOC))
+
+doc: $(DOC).pdf
+
+.DEFAULT: $(DOC).pdf
diff --git a/bundles/sexplib/sexplib-7.0.5/doc/README.tex b/bundles/sexplib/sexplib-7.0.5/doc/README.tex
new file mode 100644 (file)
index 0000000..8a4db46
--- /dev/null
@@ -0,0 +1,473 @@
+\documentclass[a4paper]{article}
+
+\usepackage{hevea}
+
+%BEGIN LATEX
+\usepackage{natbib}
+%END LATEX
+
+\newcommand{\mail}{\mailto{opensource@janestreet.com}}
+\newcommand{\homeurl}{http://www.janestreet.com}
+\newcommand{\athome}[2]{\ahref{\homeurl/#1}{#2}}
+\newcommand{\www}{\athome{}{Markus Mottl}}
+
+\newcommand{\ocaml}{\ahref{http://www.ocaml.org}{OCaml}}
+
+\newcommand{\myhref}[1]{\ahref{#1}{#1}}
+\newcommand{\ocsrc}[2]{\athome{ocaml/#1}{#2}}
+\newcommand{\myocsrc}[1]{\athome{ocaml/#1}{#1}}
+
+\newcommand{\janeshort}
+  {\ahref{http://www.janestreet.com}{Jane Street Holding, LLC}}
+
+\newcommand{\trow}[2]{\quad #1 \quad&\quad #2 \quad\\}
+\newcommand{\trowl}[2]{\trow{#1}{#2}\hline}
+
+%BEGIN LATEX
+\newcommand{\theyear}{\number\year}
+%END LATEX
+
+\title{README: library ``Sexplib''}
+\author{
+  Copyright \quad (C) \quad \theyear \quad \janeshort \quad\\
+  Author: Markus Mottl
+}
+\date{New York, 2012-03-20}
+
+% DOCUMENT
+\begin{document}
+\maketitle
+\section{Directory contents}
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+\trowl{CHANGES}{History of code changes}
+\trowl{COPYRIGHT}{Notes on copyright}
+\trow{INSTALL}{Short notes on compiling and}
+\trowl{}{installing the library}
+\trowl{LICENSE}{``GNU LESSER GENERAL PUBLIC LICENSE''}
+\trowl{LICENSE.Tywith}{License of Tywith, from which Sexplib is derived}
+\trowl{Makefile}{Top Makefile}
+\trowl{OCamlMakefile}{Generic Makefile for OCaml-projects}
+\trowl{OMakefile}{Ignore this file}
+\trowl{README.txt}{This file}
+\trowl{lib/}{OCaml-library for S-expression conversions}
+\trowl{lib\_test/}{Test applications for the Sexplib-library}
+\end{tabular}
+\end{center}
+
+\section{What is ``Sexplib''?}
+
+This library contains functionality for parsing and pretty-printing
+S-expressions.  In addition to that it contains a preprocessing module for
+Camlp4, which can be used to automatically generate code from type definitions
+for efficiently converting OCaml-values to S-expressions and vice versa.
+In combination with the parsing and pretty-printing functionality this frees
+users from having to write their own I/O-routines for datastructures they
+define.  Possible errors during automatic conversions from S-expressions
+to OCaml-values are reported in human-readable ways with exact location
+information.  Another module in this library allows you to extract and
+replace sub-expressions in S-expressions.
+
+\section{How can you use it?}
+
+Make sure you have installed the \verb=type_conv= package on your system,
+too.  It should be obtainable at the same site as \verb=sexplib=.\\
+\\
+The API (.mli-files) in the \verb=sexplib= library directory is
+fully documented.  Module \verb=Sexp= contains all I/O-functions for
+S-expressions, module \verb=Conv= helper functions for converting
+OCaml-values of standard types to S-expressions.  Module \verb=Path=
+supports sub-expression extraction and substitution.\\
+\\
+Module \verb=pa_sexp_conv.ml= contains the extensions for the
+Camlp4-preprocessor.  It adds the new construct \verb=with sexp=
+(and \verb=with sexp_of= and \verb=with of_sexp=, which are implied by
+the first).  When using this construct right after a type definition,
+function definitions will be generated automatically, which perform
+S-expression conversions.\\
+\\
+E.g.\ given the following type definition:
+
+\begin{verbatim}
+  type t = A | B
+  with sexp
+\end{verbatim}
+
+The above will generate the functions \verb=sexp_of_t= and
+\verb=t_of_sexp=.  The preprocessor also supports automatic addition
+of conversion functions to signatures.  Just add \verb=with sexp= to
+the type in a signature, and the appropriate function signatures will
+be generated.\\
+\\
+Converters for standard types (int, list, Hashtbl.t, etc.) become visible to
+the macro-generated code by opening the standard module before their first
+use in a type definition.  Users will therefore usually want to place the
+following at the top of their files:
+
+\begin{verbatim}
+  open Sexplib.Std
+\end{verbatim}
+
+See the file \verb=lib_test/conv_test.ml= for example usage.  It also
+demonstrates how to extract and substitute sub-expressions.
+
+\subsection{Compiling and linking}
+
+To compile a file you will have to add a preprocessing flag to the
+compiler invocation, e.g. for foo.ml:
+
+\begin{verbatim}
+  ocamlc -pp "camlp4o -I {path to type_conv} \
+    -I {path to sexplib} pa_type_conv.cmo pa_sexp_conv.cmo" \
+    -I {path to sexplib} foo.ml
+\end{verbatim}
+
+If you are using OCamlMakefile, just put the following line at the
+top of the file, assuming you have installed both \verb=type_conv= and
+\verb=sexplib= with ocamlfind.  The comment must start at the beginning of
+the line, and you must not break lines (here broken for readability only):
+
+\begin{verbatim}
+  (*pp camlp4o -I `ocamlfind query type_conv` \
+    -I `ocamlfind query sexplib` \
+    pa_type_conv.cmo pa_sexp_conv.cmo *)
+\end{verbatim}
+
+Don't forget to place the macro \verb=TYPE_CONV_PATH=, which takes a
+string argument, at the top of the file to be preprocessed (see example
+\verb=conv_test.ml=).  It is supposed to set the module path to the given
+module file.  This is necessary, because modules may get packed at a later
+stage, and error messages generated by Sexplib will refer to this location
+to help pinpointing the associated type.\\
+\\
+In the linking stage you will only have to link with \verb=sexplib=.
+E.g.\ when using OCamlMakefile just add it to the \verb=PACKS=-variable.
+
+\section{Syntax Specification of S-expressions}
+
+\subsection{Lexical conventions of S-expression}
+
+Whitespace, which consists of space, newline, carriage return, horizontal
+tab and form feed, is ignored unless within an OCaml-string, where it
+is treated according to OCaml-conventions.  The semicolon introduces
+comments.  Comments are ignored, and range up to the next newline
+character.  The left parenthesis opens a new list, the right parenthesis
+closes it again.  Lists can be empty.  The double quote denotes the
+beginning and end of a string following the lexical conventions of OCaml
+(see OCaml-manual for details).  All characters other than double quotes,
+left- and right parentheses, and whitespace are considered part of a
+contiguous string.
+
+\subsection{Grammar of S-expressions}
+
+S-expressions are either strings (= atoms) or lists. The lists can
+recursively contain further S-expressions or be empty, and must be
+balanced, i.e.\ parentheses must match.
+
+\subsection{Examples}
+
+{\samepage
+\begin{verbatim}
+  this_is_an_atom_123'&^%!  ; this is a comment
+  "another atom in an OCaml-string \"string in a string\" \123"
+
+  ; empty list follows below
+  ()
+
+  ; a more complex example
+  (
+    (
+      list in a list  ; comment within a list
+      (list in a list in a list)
+      42 is the answer to all questions
+    )
+  )
+\end{verbatim}
+}
+
+\subsection{Conversion of basic OCaml-values}
+
+Basic OCaml-values like the unit-value, integers (in all representations),
+floats, strings, and booleans are represented in S-exp syntax in the
+same way as in OCaml.  Strings may also appear without quotes if this
+does not clash with the lexical conventions for S-expressions.
+
+\subsection{Conversion of OCaml-tuples}
+
+OCaml-tuples are simple lists of values in the same order as in the tuple.
+E.g.:
+
+\begin{verbatim}
+  (3.14, "foo", "bar bla", 27) <===> (3.14 foo "bar bla" 27)
+\end{verbatim}
+
+\subsection{Conversion of OCaml-records}
+
+OCaml-records are represented as lists of pairs in S-expression syntax.
+Each pair consists of the name of the record field (first element),
+and its value (second element).  E.g.:
+
+\begin{verbatim}
+  {
+    foo = 3;
+    bar = "some string";
+  }
+
+  <===>
+
+  (
+    (foo 3)
+    (bar "some string")
+  )
+\end{verbatim}
+
+Type specifications of records allow the use of a special type
+\verb=sexp_option= which indicates that a record field should be optional.
+E.g.:
+
+\begin{verbatim}
+  type t =
+    {
+      x : int option;
+      y : int sexp_option;
+    }
+\end{verbatim}
+
+The type \verb=sexp_option= is equivalent to ordinary options, but is
+treated specially by the code generator.  The above would lead to the
+following equivalences of values and S-expressions:
+
+\begin{verbatim}
+  {
+    x = Some 1;
+    y = Some 2;
+  }
+
+  <===>
+
+  (
+    (x (some 1))
+    (y 2)
+  )
+\end{verbatim}
+
+\noindent And:
+
+{\samepage
+\begin{verbatim}
+  {
+    x = None;
+    y = None;
+  }
+
+  <===>
+
+  (
+    (x none)
+  )
+\end{verbatim}
+}
+
+Note how \verb=sexp_option= allows you to leave away record fields
+that should default to \verb=None=.  It is also unnecessary (and
+actually wrong) now to write down such a value as an option, i.e.\
+the \verb=some=-tag must be dropped if the field should be defined.\\
+\\
+The types \verb=sexp_list=, \verb=sexp_array=, and \verb=sexp_bool= can be
+used in ways similar to the type \verb=sexp_option=.  They assume the empty
+list, empty array, and false value respectively as default values.
+
+\subsection{Conversion of sum types}
+
+Constant constructors in sum types are represented as strings.
+Constructors with arguments are represented as lists, the first element
+being the constructor name, the rest being its arguments.  Constructors
+may also be started in lowercase in S-expressions, but will always be
+converted to uppercase when converting from OCaml-values.\\
+\\
+{\samepage
+\noindent For example:
+
+\begin{verbatim}
+  type t = A | B of int * float * t with sexp
+
+  B (42, 3.14, B (-1, 2.72, A)) <===> (B 42 3.14 (B -1 2.72 A))
+\end{verbatim}
+
+\noindent The above example also demonstrates recursion in datastructures.
+}
+
+\subsection{Conversion of variant types}
+
+The conversion of polymorphic variants is almost the same as with
+sum types.  The notable difference is that variant constructors must
+always start with an either lower- or uppercase character, matching
+the way it was specified in the type definition.  This is because OCaml
+also distinguishes between upper- and lowercase variant constructors.
+Note that type specifications containing unions of variant types are
+also supported by the S-expression converter.
+
+\subsection{Conversion of OCaml-lists and arrays}
+
+OCaml-lists and arrays are straightforwardly represented as S-expression
+lists.
+
+\subsection{Conversion of option types}
+
+The option type is converted like ordinary polymorphic sum types, i.e.:
+
+\begin{verbatim}
+  None        <===>  none
+  Some value  <===>  (some value)
+\end{verbatim}
+
+There is a deprecated version of the syntax in which values of option
+type are represented as lists in S-expressions:
+
+\begin{verbatim}
+  None        <===>  ()
+  Some value  <===>  (value)
+\end{verbatim}
+
+Reading of the old-style S-expression syntax for option values is only
+supported if the reference \verb=Conv.read_old_option_format= is set to
+\verb=true= (currently the default, which may change soon).  A conversion
+exception is raised otherwise.  The old format will be written only if
+\verb=Conv.write_old_option_format= is true (also currently the default).
+Reading of the new format is always supported.
+
+\subsection{Conversion of polymorphic values}
+
+There is nothing special about polymorphic values as long as there are
+conversion functions for the type parameters.  E.g.:
+
+\begin{verbatim}
+  type 'a t = A | B of 'a with sexp
+  type foo = int t with sexp
+\end{verbatim}
+
+In the above case the conversion functions will behave as if \verb=foo=
+had been defined as a monomorphic version of \verb=t= with \verb='a=
+replaced by \verb=int= on the right hand side.\\
+\\
+If a datastructure is indeed polymorphic, and you want to convert it,
+you will have to supply the conversion functions for the type parameters
+at runtime.  E.g.\ in the above example, if you wanted to convert a value
+of type \verb='a t=, you would have to write something like this:
+
+\begin{verbatim}
+  sexp_of_t sexp_of_a v
+\end{verbatim}
+
+\noindent where \verb=sexp_of_a=, which may also be named differently in
+this particular case, is a function that converts values of type \verb='a=
+to an S-expression.  Types with more than one parameter require passing
+conversion functions for those parameters in the order of their appearance
+on the left hand side of the type definition.
+
+\subsection{Conversion of abstract datatypes}
+
+Of course, if you want to convert an abstract datatype to an S-expression,
+you will have to roll your own conversion function, which should produce
+values of type \verb=Sexp.t= directly.  If, however, you want to make
+use of your abstract type within definitions of other types, make sure
+that you call your conversion function appropriately: it should be in the
+same scope as the typename, and must be named \verb=sexp_of_{typename}=.
+
+\subsection{Conversion of hashtables}
+
+Hashtables, which are abstract values in OCaml, are represented as
+association lists, i.e.\ lists of key-value pairs, e.g.:
+
+\begin{verbatim}
+  ((foo 42) (bar 3))
+\end{verbatim}
+
+Reading in the above S-expression as hashtable mapping strings to
+integers (\verb=(string, int) Hashtbl.t=) will map \verb="foo"= to $42$
+and \verb="bar"= to $3$.\\
+\\
+Note that the order of elements in the list may matter, because
+duplicates are kept: bindings will be inserted into the hashtable in
+order of appearence.  Therefore, the last binding of a key will be the
+``visible'' one, the others are ``hidden''.  See the OCaml-documentation
+on hashtables for details.\\
+\\
+Note, too, that polymorphic equality may not hold between conversions.
+You will have to use a function implementing logical equality for that
+purpose.
+
+\subsection{Conversion of opaque values}
+
+Opaque values are ones for which we do not want to perform conversions.
+This may be, because we do not have S-expression converters for them,
+or because we do not want to apply them in a particular type context,
+e.g.\ if the resulting S-expression should be printed out but without
+superfluous information.  To prevent the preprocessor from generating
+calls to converters, simply apply the qualifier \verb=sexp_opaque=
+as if it were a type constructor, e.g.:
+
+\begin{verbatim}
+  type foo = int * stuff sexp_opaque with sexp
+\end{verbatim}
+
+Thus, there is no need to specify converters for type \verb=stuff=,
+and if there are any, they will not be used in this particular context.
+Needless to say, it is not possible to convert such an S-expression back
+to the original value.  Here is an example conversion:
+
+\begin{verbatim}
+  (42, some_stuff) ===>  (42, <opaque>)
+\end{verbatim}
+
+\subsection{Conversion of exceptions}
+
+S-expression converters for exceptions can be automatically registered
+using the \verb=with sexp= macro, e.g.:
+
+\begin{verbatim}
+  module M = struct
+    exception Foo of int with sexp
+  end
+\end{verbatim}
+
+Such exceptions will be translated in a similar way as sum types, but
+their constructor will be prefixed with the fully qualified module path
+(here: \verb=M.Foo=) so as to be able to discriminate between them
+without problems.\\
+
+The user can then easily convert an exception matching the above
+one to an S-expression using \verb=Sexplib.Conv.sexp_of_exn=.
+User-defined conversion functions can be registered, too, by calling
+\verb=Sexplib.Conv.add_exn_converter=.  This should make it very
+convenient for users to catch arbitrary exceptions escaping their program
+and pretty-printing them, including all arguments, as S-expressions.
+The library already contains mappings for all known exceptions that can
+escape functions in the OCaml standard library.
+
+\section{I/O and type conversions}
+
+There are multiple ways of performing I/O with S-expressions.  If exact
+error locations are required when type conversions fail, S-expressions need
+to be parsed with location annotations.  In most cases users may want to use
+functions like e.g.\ \verb=load_sexp_conv= or \verb=load_sexp_conv_exn=, which
+load S-expressions from files and convert them.  Only when conversions fail,
+the file will be reparsed with annotations, which is slower, and type errors
+will be reported accurately with file, line number, column, and file position.
+
+\section{Contact information}
+
+\noindent In the case of bugs, feature requests and similar, you can
+contact us here:\\
+
+\hspace{2ex}\mail\\
+
+\noindent Up-to-date information concerning this library should be
+available here:\\
+
+\hspace{2ex}\homeurl/ocaml\\
+
+Enjoy!!\\
+
+\end{document}
diff --git a/bundles/sexplib/sexplib-7.0.5/doc/custom.hva b/bundles/sexplib/sexplib-7.0.5/doc/custom.hva
new file mode 100644 (file)
index 0000000..81ecdb1
--- /dev/null
@@ -0,0 +1,9 @@
+% INPUT STYLE
+\input{article.hva}
+
+% FANCY SECTION HEADERS WITH NICE COLOURS
+\def\@color{194}
+\input{fancysection.hva}
+
+% FOREGROUND AND BACKGROUND COLOURS
+\renewcommand{\@bodyargs}{TEXT=black BGCOLOR=white}
diff --git a/bundles/sexplib/sexplib-7.0.5/doc/hevea.sty b/bundles/sexplib/sexplib-7.0.5/doc/hevea.sty
new file mode 100644 (file)
index 0000000..6d49aa8
--- /dev/null
@@ -0,0 +1,78 @@
+% hevea  : hevea.sty
+% This is a very basic style file for latex document to be processed
+% with hevea. It contains definitions of LaTeX environment which are
+% processed in a special way by the translator. 
+%  Mostly :
+%     - latexonly, not processed by hevea, processed by latex.
+%     - htmlonly , the reverse.
+%     - rawhtml,  to include raw HTML in hevea output.
+%     - toimage, to send text to the image file.
+% The package also provides hevea logos, html related commands (ahref
+% etc.), void cutting and image commands.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hevea}[2002/01/11]
+\RequirePackage{comment}
+\newif\ifhevea\heveafalse
+\@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse}
+\makeatletter%
+\newcommand{\heveasmup}[2]{%
+\raise #1\hbox{$\m@th$%
+  \csname S@\f@size\endcsname
+  \fontsize\sf@size 0%
+  \math@fontsfalse\selectfont
+#2%
+}}%
+\DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}%
+\DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}%
+\DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}}
+%%%%%%%%% Hyperlinks hevea style
+\newcommand{\ahref}[2]{{#2}}
+\newcommand{\ahrefloc}[2]{{#2}}
+\newcommand{\aname}[2]{{#2}}
+\newcommand{\ahrefurl}[1]{\texttt{#1}}
+\newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}}
+\newcommand{\mailto}[1]{\texttt{#1}}
+\newcommand{\imgsrc}[2][]{}
+\newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1}
+\AtBeginDocument
+{\@ifundefined{url}
+{%url package is not loaded
+\let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref}
+{}}
+%% Void cutting instructions
+\newcounter{cuttingdepth}
+\newcommand{\tocnumber}{}
+\newcommand{\notocnumber}{}
+\newcommand{\cuttingunit}{}
+\newcommand{\cutdef}[2][]{}
+\newcommand{\cuthere}[2]{}
+\newcommand{\cutend}{}
+\newcommand{\htmlhead}[1]{}
+\newcommand{\htmlfoot}[1]{}
+\newcommand{\htmlprefix}[1]{}
+\newenvironment{cutflow}[1]{}{}
+\newcommand{\cutname}[1]{}
+\newcommand{\toplinks}[3]{}
+%%%% Html only
+\excludecomment{rawhtml}
+\newcommand{\rawhtmlinput}[1]{}
+\excludecomment{htmlonly}
+%%%% Latex only
+\newenvironment{latexonly}{}{}
+\newenvironment{verblatex}{}{}
+%%%% Image file stuff
+\def\toimage{\endgroup}
+\def\endtoimage{\begingroup\def\@currenvir{toimage}}
+\def\verbimage{\endgroup}
+\def\endverbimage{\begingroup\def\@currenvir{verbimage}}
+\newcommand{\imageflush}[1][]{}
+%%% Bgcolor definition
+\newsavebox{\@bgcolorbin}
+\newenvironment{bgcolor}[2][]
+  {\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup}
+  {\egroup\end{lrbox}%
+   \begin{flushleft}%
+   \colorbox{\@mycolor}{\usebox{\@bgcolorbin}}%
+   \end{flushleft}}
+%%% Postlude
+\makeatother
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/META b/bundles/sexplib/sexplib-7.0.5/lib/META
new file mode 100644 (file)
index 0000000..3cef596
--- /dev/null
@@ -0,0 +1,26 @@
+# OASIS_START
+# DO NOT EDIT (digest: 753f7af494baaf733d5ff4e8d89ff68b)
+version = "7.0.5"
+description = "automated S-expression conversion"
+requires = "unix bigarray num"
+archive(byte) = "sexplib.cma"
+archive(native) = "sexplib.cmxa"
+exists_if = "sexplib.cma"
+package "top" (
+ version = "7.0.5"
+ description = "Toplevel printers for S-expressions"
+ requires = "sexplib"
+ archive(byte) = "sexplib_top.cma"
+ archive(native) = "sexplib_top.cmxa"
+ exists_if = "sexplib_top.cma"
+)
+
+package "syntax" (
+ version = "7.0.5"
+ description = "Syntax extension for Sexplib"
+ requires = "type_conv sexplib"
+ archive(syntax, preprocessor) = "pa_sexp_conv.cma"
+ archive(syntax, toploop) = "pa_sexp_conv.cma"
+ exists_if = "pa_sexp_conv.cma"
+)
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/conv.ml b/bundles/sexplib/sexplib-7.0.5/lib/conv.ml
new file mode 100644 (file)
index 0000000..0a040a5
--- /dev/null
@@ -0,0 +1,713 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(* Conv: Utility Module for S-expression Conversions *)
+
+open Printf
+open Bigarray
+open Sexp
+
+type sexp_bool = bool
+type 'a sexp_option = 'a option
+type 'a sexp_list = 'a list
+type 'a sexp_array = 'a array
+type 'a sexp_opaque = 'a
+
+type bigstring = Sexp.bigstring
+type float32_vec = (float, float32_elt, fortran_layout) Array1.t
+type float64_vec = (float, float64_elt, fortran_layout) Array1.t
+type vec = float64_vec
+type float32_mat = (float, float32_elt, fortran_layout) Array2.t
+type float64_mat = (float, float64_elt, fortran_layout) Array2.t
+type mat = float64_mat
+
+(* Conversion of OCaml-values to S-expressions *)
+
+(* Some basic experiments indicate that %.20G is enough to round-trip
+   a float through the sexp-converter, (although that was done long ago,
+   and there's no real guarantee) *)
+let default_string_of_float = ref (fun n -> sprintf "%.20G" n)
+let read_old_option_format = ref true
+let write_old_option_format = ref true
+
+let list_map f l = List.rev (List.rev_map f l)
+
+let sexp_of_unit () = List []
+let sexp_of_bool b = Atom (string_of_bool b)
+let sexp_of_string str = Atom str
+let sexp_of_char c = Atom (String.make 1 c)
+let sexp_of_int n = Atom (string_of_int n)
+let sexp_of_float n = Atom (!default_string_of_float n)
+let sexp_of_int32 n = Atom (Int32.to_string n)
+let sexp_of_int64 n = Atom (Int64.to_string n)
+let sexp_of_nativeint n = Atom (Nativeint.to_string n)
+let sexp_of_big_int n = Atom (Big_int.string_of_big_int n)
+let sexp_of_nat n = Atom (Nat.string_of_nat n)
+let sexp_of_num n = Atom (Num.string_of_num n)
+let sexp_of_ratio n = Atom (Ratio.string_of_ratio n)
+let sexp_of_ref sexp_of__a rf = sexp_of__a !rf
+let sexp_of_lazy_t sexp_of__a lv = sexp_of__a (Lazy.force lv)
+
+let sexp_of_option sexp_of__a = function
+  | Some x when !write_old_option_format -> List [sexp_of__a x]
+  | Some x -> List [Atom "some"; sexp_of__a x]
+  | None when !write_old_option_format -> List []
+  | None -> Atom "none"
+
+let sexp_of_pair sexp_of__a sexp_of__b (a, b) =
+  List [sexp_of__a a; sexp_of__b b]
+
+let sexp_of_triple sexp_of__a sexp_of__b sexp_of__c (a, b, c) =
+  List [sexp_of__a a; sexp_of__b b; sexp_of__c c]
+
+(* List.rev (List.rev_map ...) is tail recursive, the OCaml standard
+   library List.map is NOT. *)
+let sexp_of_list sexp_of__a lst = List (List.rev (List.rev_map sexp_of__a lst))
+
+let sexp_of_array sexp_of__a ar =
+  let lst_ref = ref [] in
+  for i = Array.length ar - 1 downto 0 do
+    lst_ref := sexp_of__a ar.(i) :: !lst_ref
+  done;
+  List !lst_ref
+
+let sexp_of_hashtbl sexp_of_key sexp_of_val htbl =
+  let coll k v acc = List [sexp_of_key k; sexp_of_val v] :: acc in
+  List (Hashtbl.fold coll htbl [])
+
+let sexp_of_float_vec vec =
+  let lst_ref = ref [] in
+  for i = Array1.dim vec downto 1 do
+    lst_ref := sexp_of_float vec.{i} :: !lst_ref
+  done;
+  List !lst_ref
+
+let sexp_of_bigstring (bstr : bigstring) =
+  let n = Array1.dim bstr in
+  let str = String.create n in
+  for i = 0 to n - 1 do str.[i] <- bstr.{i} done;
+  Atom str
+
+let sexp_of_float32_vec (vec : float32_vec) = sexp_of_float_vec vec
+let sexp_of_float64_vec (vec : float64_vec) = sexp_of_float_vec vec
+let sexp_of_vec (vec : vec) = sexp_of_float_vec vec
+
+let sexp_of_float_mat mat =
+  let m = Array2.dim1 mat in
+  let n = Array2.dim2 mat in
+  let lst_ref = ref [] in
+  for col = n downto 1 do
+    let vec = Array2.slice_right mat col in
+    for row = m downto 1 do
+      lst_ref := sexp_of_float vec.{row} :: !lst_ref
+    done
+  done;
+  List (sexp_of_int m :: sexp_of_int n :: !lst_ref)
+
+let sexp_of_float32_mat (mat : float32_mat) = sexp_of_float_mat mat
+let sexp_of_float64_mat (mat : float64_mat) = sexp_of_float_mat mat
+let sexp_of_mat (mat : mat) = sexp_of_float_mat mat
+
+let sexp_of_opaque _ = Atom "<opaque>"
+let sexp_of_fun _ = Atom "<fun>"
+
+let string_of__of__sexp_of to_sexp x = Sexp.to_string (to_sexp x)
+
+
+(* Exception converter registration and lookup *)
+
+module Exn_converter = struct
+  type t = int64
+
+  module Ids = Map.Make (Int64)
+
+  let exn_id_cnt = ref Int64.max_int
+  let exn_handlers : (exn -> Sexp.t option) Ids.t ref = ref Ids.empty
+
+  (* These exception registration functions assume that context-switches
+     cannot happen unless there is an allocation.  It is reasonable to expect
+     that this will remain true for the foreseeable future.  That way we
+     avoid using mutexes and thus a dependency on the threads library. *)
+
+  let rec add_slow sexp_of_exn =
+    let exn_id = !exn_id_cnt in
+    let new_exn_id = Int64.sub exn_id Int64.one in
+    let new_exn_handlers = Ids.add exn_id sexp_of_exn !exn_handlers in
+    (* This trick avoids mutexes and should be fairly efficient *)
+    if !exn_id_cnt != exn_id then add_slow sexp_of_exn
+    else begin
+      (* These two assignments should always be atomic *)
+      exn_id_cnt := new_exn_id;
+      exn_handlers := new_exn_handlers;
+      exn_id
+    end
+
+  let rec del_slow exn_id =
+    let old_exn_handlers = !exn_handlers in
+    let new_exn_handlers = Ids.remove exn_id old_exn_handlers in
+    (* This trick avoids mutexes and should be fairly efficient *)
+    if !exn_handlers != old_exn_handlers then del_slow exn_id
+    else exn_handlers := new_exn_handlers
+
+  exception Found_sexp_opt of Sexp.t option
+
+  let find_slow exn =
+    try
+      let act _id sexp_of_exn =
+        let sexp_opt = sexp_of_exn exn in
+        if sexp_opt <> None then raise (Found_sexp_opt sexp_opt)
+      in
+      Ids.iter act !exn_handlers;
+      None
+    with Found_sexp_opt sexp_opt -> sexp_opt
+
+
+  (* Fast and automatic exception registration *)
+
+  module Int = struct
+    type t = int
+
+    let compare t1 t2 = compare (t1 : int) t2
+  end
+
+  module Addrs = Map.Make (Int)
+
+  type weak_repr = (Obj.t Weak.t * (exn -> Sexp.t)) Ids.t
+
+  let exn_addr_map : (int * weak_repr) Addrs.t ref = ref Addrs.empty
+
+  let get_exn_tag (exn : exn) = Obj.field (Obj.repr exn) 0
+  let get_exn_tag_str_addr exn_tag = (Obj.magic (Obj.field exn_tag 0) : int)
+  let get_exn_str_addr exn = get_exn_tag_str_addr (get_exn_tag exn)
+
+  let rec clean_up_handler id exn_tag =
+    let old_exn_addr_map = !exn_addr_map in
+    let addr = get_exn_tag_str_addr exn_tag in
+    match
+      try Some (Addrs.find addr old_exn_addr_map)
+      with Not_found -> None
+    with
+    | Some (count, exn_handler_map) ->
+        let new_exn_handler_map = Ids.remove id exn_handler_map in
+        let new_exn_addr_map =
+          if Ids.is_empty new_exn_handler_map then
+            Addrs.remove addr old_exn_addr_map
+          else
+            Addrs.add addr (count - 1, new_exn_handler_map) old_exn_addr_map
+        in
+        (* This trick avoids mutexes and should be fairly efficient *)
+        if !exn_addr_map != old_exn_addr_map then clean_up_handler id exn_tag
+        else exn_addr_map := new_exn_addr_map
+    | None -> ()
+
+  let fast_id_cnt = ref Int64.max_int
+
+  exception Found_sexp of Sexp.t
+
+  let max_exn_tags = ref 20
+
+  let set_max_exn_tags n =
+    if n < 1 then
+      failwith "Sexplib.Conv.Exn_converter.set_max_exn_tags: n < 1"
+    else max_exn_tags := n
+
+  let get_max_exn_tags () = !max_exn_tags
+
+  let add_auto ?(finalise = true) exn sexp_of_exn =
+    let exn_tag = get_exn_tag exn in
+    let addr = get_exn_tag_str_addr exn_tag in
+    let weak_tbl = Weak.create 1 in
+    Weak.set weak_tbl 0 (Some exn_tag);
+    let new_handler = weak_tbl, sexp_of_exn in
+    let rec loop () =
+      let id = !fast_id_cnt in
+      let old_exn_addr_map = !exn_addr_map in
+      let new_id = Int64.sub id Int64.one in
+      let count, handler_map =
+        try Addrs.find addr old_exn_addr_map
+        with Not_found -> 0, Ids.empty
+      in
+      if count < !max_exn_tags then
+        let new_handler_map = Ids.add id new_handler handler_map in
+        let new_exn_handlers =
+          Addrs.add addr (count + 1, new_handler_map) old_exn_addr_map
+        in
+        (* This trick avoids mutexes and should be fairly efficient *)
+        if !fast_id_cnt != id || !exn_addr_map != old_exn_addr_map then loop ()
+        else begin
+          exn_addr_map := new_exn_handlers;
+          fast_id_cnt := new_id;
+          if finalise then Gc.finalise (clean_up_handler id) exn_tag
+        end
+    in
+    loop ()
+
+  let find_auto exn =
+    let addr = get_exn_str_addr exn in
+    match try Some (Addrs.find addr !exn_addr_map) with Not_found -> None with
+    | None -> None
+    | Some (_, exn_handler_map) ->
+        let exn_tag = get_exn_tag exn in
+        try
+          let act _id (weak_tbl, sexp_of_exn) =
+            match Weak.get weak_tbl 0 with
+            | Some map_exn_tag when map_exn_tag == exn_tag ->
+                raise (Found_sexp (sexp_of_exn exn))
+            | None | Some _ -> ()
+          in
+          Ids.iter act exn_handler_map;
+          None
+        with Found_sexp sexp -> Some sexp
+end
+
+let sexp_of_exn_opt exn =
+  let sexp_opt = Exn_converter.find_auto exn in
+  if sexp_opt = None then Exn_converter.find_slow exn
+  else sexp_opt
+
+let sexp_of_exn exn =
+  match sexp_of_exn_opt exn with
+  | None -> List [Atom (Printexc.to_string exn)]
+  | Some sexp -> sexp
+
+let exn_to_string e = Sexp.to_string_hum (sexp_of_exn e)
+
+
+(* Conversion of S-expressions to OCaml-values *)
+
+exception Of_sexp_error = Pre_sexp.Of_sexp_error
+
+let record_check_extra_fields = ref true
+
+let of_sexp_error_exn exc sexp = raise (Of_sexp_error (exc, sexp))
+
+let of_sexp_error what sexp = raise (Of_sexp_error (Failure what, sexp))
+
+let unit_of_sexp sexp = match sexp with
+  | List [] -> ()
+  | Atom _ | List _ -> of_sexp_error "unit_of_sexp: empty list needed" sexp
+
+let bool_of_sexp sexp = match sexp with
+  | Atom ("true" | "True") -> true
+  | Atom ("false" | "False") -> false
+  | Atom _ -> of_sexp_error "bool_of_sexp: unknown string" sexp
+  | List _ -> of_sexp_error "bool_of_sexp: atom needed" sexp
+
+let string_of_sexp sexp = match sexp with
+  | Atom str -> str
+  | List _ -> of_sexp_error "string_of_sexp: atom needed" sexp
+
+let char_of_sexp sexp = match sexp with
+  | Atom str ->
+      if String.length str <> 1 then
+        of_sexp_error
+          "char_of_sexp: atom string must contain one character only" sexp;
+      str.[0]
+  | List _ -> of_sexp_error "char_of_sexp: atom needed" sexp
+
+let int_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try int_of_string str
+      with exc -> of_sexp_error ("int_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "int_of_sexp: atom needed" sexp
+
+let float_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try float_of_string str
+      with exc ->
+        of_sexp_error ("float_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "float_of_sexp: atom needed" sexp
+
+let int32_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Int32.of_string str
+      with exc ->
+        of_sexp_error ("int32_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "int32_of_sexp: atom needed" sexp
+
+let int64_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Int64.of_string str
+      with exc ->
+        of_sexp_error ("int64_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "int64_of_sexp: atom needed" sexp
+
+let nativeint_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Nativeint.of_string str
+      with exc ->
+        of_sexp_error ("nativeint_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "nativeint_of_sexp: atom needed" sexp
+
+let big_int_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Big_int.big_int_of_string str
+      with exc ->
+        of_sexp_error ("big_int_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "big_int_of_sexp: atom needed" sexp
+
+let nat_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Nat.nat_of_string str
+      with exc ->
+        of_sexp_error ("nat_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "nat_of_sexp: atom needed" sexp
+
+let num_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Num.num_of_string str
+      with exc ->
+        of_sexp_error ("num_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "num_of_sexp: atom needed" sexp
+
+let ratio_of_sexp sexp = match sexp with
+  | Atom str ->
+      (try Ratio.ratio_of_string str
+      with exc ->
+        of_sexp_error ("ratio_of_sexp: " ^ exn_to_string exc) sexp)
+  | List _ -> of_sexp_error "ratio_of_sexp: atom needed" sexp
+
+let ref_of_sexp a__of_sexp sexp = ref (a__of_sexp sexp)
+let lazy_t_of_sexp a__of_sexp sexp = Lazy.lazy_from_val (a__of_sexp sexp)
+
+let option_of_sexp a__of_sexp sexp =
+  if !read_old_option_format then
+    match sexp with
+    | List [] | Atom ("none" | "None") -> None
+    | List [el] | List [Atom ("some" | "Some"); el] -> Some (a__of_sexp el)
+    | List _ ->
+        of_sexp_error "option_of_sexp: list must represent optional value" sexp
+    | Atom _ -> of_sexp_error "option_of_sexp: only none can be atom" sexp
+  else
+    match sexp with
+    | Atom ("none" | "None") -> None
+    | List [Atom ("some" | "Some"); el] -> Some (a__of_sexp el)
+    | Atom _ -> of_sexp_error "option_of_sexp: only none can be atom" sexp
+    | List _ -> of_sexp_error "option_of_sexp: list must be (some el)" sexp
+
+let pair_of_sexp a__of_sexp b__of_sexp sexp = match sexp with
+  | List [a_sexp; b_sexp] ->
+      let a = a__of_sexp a_sexp in
+      let b = b__of_sexp b_sexp in
+      a, b
+  | List _ ->
+      of_sexp_error
+        "pair_of_sexp: list must contain exactly two elements only" sexp
+  | Atom _ -> of_sexp_error "pair_of_sexp: list needed" sexp
+
+let triple_of_sexp a__of_sexp b__of_sexp c__of_sexp sexp = match sexp with
+  | List [a_sexp; b_sexp; c_sexp] ->
+      let a = a__of_sexp a_sexp in
+      let b = b__of_sexp b_sexp in
+      let c = c__of_sexp c_sexp in
+      a, b, c
+  | List _ ->
+      of_sexp_error
+        "triple_of_sexp: list must contain exactly three elements only" sexp
+  | Atom _ -> of_sexp_error "triple_of_sexp: list needed" sexp
+
+let list_of_sexp a__of_sexp sexp = match sexp with
+  | List lst ->
+      let rev_lst = List.rev_map a__of_sexp lst in
+      List.rev rev_lst
+  | Atom _ -> of_sexp_error "list_of_sexp: list needed" sexp
+
+let array_of_sexp a__of_sexp sexp = match sexp with
+  | List [] -> [||]
+  | List (h :: t) ->
+      let len = List.length t + 1 in
+      let res = Array.create len (a__of_sexp h) in
+      let rec loop i = function
+        | [] -> res
+        | h :: t -> res.(i) <- a__of_sexp h; loop (i + 1) t in
+      loop 1 t
+  | Atom _ -> of_sexp_error "array_of_sexp: list needed" sexp
+
+let hashtbl_of_sexp key_of_sexp val_of_sexp sexp = match sexp with
+  | List lst ->
+      let htbl = Hashtbl.create 0 in
+      let act = function
+        | List [k_sexp; v_sexp] ->
+            Hashtbl.add htbl (key_of_sexp k_sexp) (val_of_sexp v_sexp)
+        | List _ | Atom _ ->
+            of_sexp_error "hashtbl_of_sexp: tuple list needed" sexp
+      in
+      List.iter act lst;
+      htbl
+  | Atom _ -> of_sexp_error "hashtbl_of_sexp: list needed" sexp
+
+let bigstring_of_sexp sexp = match sexp with
+  | Atom str ->
+      let len = String.length str in
+      let bstr = Array1.create char c_layout len in
+      for i = 0 to len - 1 do bstr.{i} <- str.[i] done;
+      bstr
+  | List _ -> of_sexp_error "bigstring_of_sexp: atom needed" sexp
+
+let float_vec_of_sexp empty_float_vec create_float_vec sexp = match sexp with
+  | List [] -> empty_float_vec
+  | List lst ->
+      let len = List.length lst in
+      let res = create_float_vec len in
+      let rec loop i = function
+        | [] -> res
+        | h :: t -> res.{i} <- float_of_sexp h; loop (i + 1) t in
+      loop 1 lst
+  | Atom _ -> of_sexp_error "float_vec_of_sexp: list needed" sexp
+
+let create_float32_vec = Array1.create float32 fortran_layout
+let create_float64_vec = Array1.create float64 fortran_layout
+let empty_float32_vec = create_float32_vec 0
+let empty_float64_vec = create_float64_vec 0
+let float32_vec_of_sexp = float_vec_of_sexp empty_float32_vec create_float32_vec
+let float64_vec_of_sexp = float_vec_of_sexp empty_float64_vec create_float64_vec
+let vec_of_sexp = float_vec_of_sexp empty_float64_vec create_float64_vec
+
+let check_too_much_data sexp data res =
+  if data = [] then res
+  else of_sexp_error "float_mat_of_sexp: too much data" sexp
+
+let float_mat_of_sexp create_float_mat sexp = match sexp with
+  | List (sm :: sn :: data) ->
+      let m = int_of_sexp sm in
+      let n = int_of_sexp sn in
+      let res = create_float_mat m n in
+      if m = 0 || n = 0 then check_too_much_data sexp data res
+      else
+        let rec loop_cols col data =
+          let vec = Array2.slice_right res col in
+          let rec loop_rows row = function
+            | [] -> of_sexp_error "float_mat_of_sexp: not enough data" sexp
+            | h :: t ->
+                vec.{row} <- float_of_sexp h;
+                if row = m then
+                  if col = n then check_too_much_data sexp t res
+                  else loop_cols (col + 1) t
+                else loop_rows (row + 1) t in
+          loop_rows 1 data in
+        loop_cols 1 data
+  | List _ -> of_sexp_error "float_mat_of_sexp: list too short" sexp
+  | Atom _ -> of_sexp_error "float_mat_of_sexp: list needed" sexp
+
+let create_float32_mat = Array2.create float32 fortran_layout
+let create_float64_mat = Array2.create float64 fortran_layout
+
+let float32_mat_of_sexp = float_mat_of_sexp create_float32_mat
+let float64_mat_of_sexp = float_mat_of_sexp create_float64_mat
+let mat_of_sexp = float_mat_of_sexp create_float64_mat
+
+let opaque_of_sexp sexp =
+  of_sexp_error "opaque_of_sexp: cannot convert opaque values" sexp
+
+let fun_of_sexp sexp =
+  of_sexp_error "fun_of_sexp: cannot convert function values" sexp
+
+let of_string__of__of_sexp of_sexp s =
+  try
+    let sexp = Sexp.of_string s in
+    of_sexp sexp
+  with e ->
+    failwith (sprintf "of_string failed on %s with %s" s (exn_to_string e))
+
+(* Registering default exception printers *)
+
+let get_flc_error name (file, line, chr) =
+  List [Atom name; Atom file; sexp_of_int line; sexp_of_int chr]
+
+let () =
+  List.iter
+    (fun (exc, handler) -> Exn_converter.add_auto ~finalise:false exc handler)
+    [
+      (
+        Assert_failure ("", 0, 0),
+        (function
+        | Assert_failure arg -> get_flc_error "Assert_failure" arg
+        | _ -> assert false)
+      );(
+        Exit,
+        (function
+        | Exit -> Atom "Exit"
+        | _ -> assert false)
+      );(
+        End_of_file,
+        (function
+        | End_of_file -> Atom "End_of_file"
+        | _ -> assert false)
+      );(
+        Failure "",
+        (function
+        | Failure arg -> List [Atom "Failure"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Not_found,
+        (function
+        | Not_found -> Atom "Not_found"
+        | _ -> assert false)
+      );(
+        Invalid_argument "",
+        (function
+        | Invalid_argument arg -> List [Atom "Invalid_argument"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Match_failure ("", 0, 0),
+        (function
+        | Match_failure arg -> get_flc_error "Match_failure" arg
+        | _ -> assert false)
+      );(
+        Sys_error "",
+        (function
+        | Sys_error arg -> List [Atom "Sys_error"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Arg.Help "",
+        (function
+        | Arg.Help arg -> List [Atom "Arg.Help"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Arg.Bad "",
+        (function
+        | Arg.Bad arg -> List [Atom "Arg.Bad"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Lazy.Undefined,
+        (function
+        | Lazy.Undefined -> Atom "Lazy.Undefined"
+        | _ -> assert false)
+      );(
+        Parsing.Parse_error,
+        (function
+        | Parsing.Parse_error -> Atom "Parsing.Parse_error"
+        | _ -> assert false)
+      );(
+        Queue.Empty,
+        (function
+        | Queue.Empty -> Atom "Queue.Empty"
+        | _ -> assert false)
+      );(
+        Scanf.Scan_failure "",
+        (function
+        | Scanf.Scan_failure arg -> List [Atom "Scanf.Scan_failure"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Stack.Empty,
+        (function
+        | Stack.Empty -> Atom "Stack.Empty"
+        | _ -> assert false)
+      );(
+        Stream.Failure,
+        (function
+        | Stream.Failure -> Atom "Stream.Failure"
+        | _ -> assert false)
+      );(
+        Stream.Error "",
+        (function
+        | Stream.Error arg -> List [Atom "Stream.Error"; Atom arg ]
+        | _ -> assert false)
+      );(
+        Sys.Break,
+        (function
+        | Sys.Break -> Atom "Sys.Break"
+        | _ -> assert false)
+      );(
+        Unix.Unix_error (Unix.E2BIG, "", ""),
+        (function
+        | Unix.Unix_error (err, loc, arg) ->
+            let err_str = Unix.error_message err in
+            List [Atom "Unix.Unix_error"; Atom err_str; Atom loc; Atom arg]
+        | _ -> assert false)
+      );(
+        Of_sexp_error (Exit, Atom ""),
+        (function
+        | Of_sexp_error (exc, sexp) ->
+            List [Atom "Sexplib.Conv.Of_sexp_error"; sexp_of_exn exc; sexp]
+        | _ -> assert false)
+      );(
+        Parse_error {
+          Pre_sexp.
+          location = "";
+          err_msg = "";
+          parse_state =
+            `Sexp {
+              Pre_sexp.
+              parse_pos = {
+                Pre_sexp.Parse_pos.
+                text_line = 0;
+                text_char = 0;
+                global_offset = 0;
+                buf_pos = 0;
+              };
+              pstack = [];
+              pbuf = Buffer.create 0;
+            };
+        },
+        (function
+        | Parse_error pe ->
+            let ppos =
+              match pe.parse_state with
+              | `Sexp { parse_pos = parse_pos } | `Annot { parse_pos = parse_pos } -> parse_pos
+            in
+            List [
+              Atom "Sexplib.Sexp.Parse_error";
+              List [
+                List [Atom "location"; Atom pe.location];
+                List [Atom "err_msg"; Atom pe.err_msg];
+                List [Atom "text_line"; sexp_of_int ppos.Parse_pos.text_line];
+                List [Atom "text_char"; sexp_of_int ppos.Parse_pos.text_char];
+                List [
+                  Atom "global_offset"; sexp_of_int ppos.Parse_pos.global_offset
+                ];
+                List [Atom "buf_pos"; sexp_of_int ppos.Parse_pos.buf_pos];
+              ]
+            ]
+        | _ -> assert false)
+      );(
+        Of_string_conv_exn.E {
+          Of_string_conv_exn.
+          exc = Exit;
+          sexp = Atom "";
+          sub_sexp = Atom "";
+        },
+        (function
+        | Of_string_conv_exn.E osce ->
+            List [
+              Atom "Sexplib.Sexp.Of_string_conv_exn.E";
+              List [
+                List [Atom "exc"; sexp_of_exn osce.Of_string_conv_exn.exc];
+                List [Atom "sexp"; osce.Of_string_conv_exn.sexp];
+                List [Atom "sub_sexp"; osce.Of_string_conv_exn.sub_sexp];
+              ]
+            ]
+        | _ -> assert false)
+      );(
+        Sexp.Annotated.Conv_exn ("", Exit),
+        (function
+        | Sexp.Annotated.Conv_exn (loc, exn) ->
+            List [
+              Atom "Sexplib.Sexp.Annotated.Conv_exn";
+              Atom loc;
+              sexp_of_exn exn;
+            ]
+        | _ -> assert false)
+      );
+    ]
similarity index 56%
rename from ocamlsexp/conv.mli
rename to bundles/sexplib/sexplib-7.0.5/lib/conv.mli
index 60ab215..d44b481 100644 (file)
@@ -1,33 +1,48 @@
-(* File: conv.mli
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
 
 (** Conv: Utility Module for S-expression Conversions *)
 
 open Bigarray
 
-(** Dummy definition for "optional" options *)
+(** Dummy definitions for "optional" options, lists, and for opaque types *)
+type sexp_bool = bool
 type 'a sexp_option = 'a option
+type 'a sexp_list = 'a list
+type 'a sexp_array = 'a array
+type 'a sexp_opaque = 'a
+
+
+(** {6 Type aliases} *)
+
+type bigstring = Sexp.bigstring
+type float32_vec = (float, float32_elt, fortran_layout) Array1.t
+type float64_vec = (float, float64_elt, fortran_layout) Array1.t
+type vec = float64_vec
+type float32_mat = (float, float32_elt, fortran_layout) Array2.t
+type float64_mat = (float, float64_elt, fortran_layout) Array2.t
+type mat = float64_mat
 
 
 (** {6 Conversion of OCaml-values to S-expressions} *)
@@ -47,15 +62,23 @@ val write_old_option_format : bool ref
     Initially set to [true].
 *)
 
+
 val read_old_option_format : bool ref
 (** [read_old_option_format] reference for the default option format
-    used to read option values.  [Of_sexp_error] will be raised with
-    old-style option values if this reference is set to [false].
-    Reading new-style option values is always supported.
+    used to read option values.  [Of_sexp_error] will be raised
+    with old-style option values if this reference is set to [false].
+    Reading new-style option values is always supported.  Using a global
+    reference instead of changing the converter calling conventions is
+    the only way to avoid breaking old code with the standard macros.
 
     Initially set to [true].
 *)
 
+(** We re-export a tail recursive map function, because some modules
+    override the standard library functions (e.g. [StdLabels]) which
+    wrecks havoc with the camlp4 extension. *)
+val list_map : ('a -> 'b) -> 'a list -> 'b list
+
 val sexp_of_unit : unit -> Sexp.t
 (** [sexp_of_unit ()] converts a value of type [unit] to an S-expression. *)
 
@@ -107,13 +130,13 @@ val sexp_of_ratio : Ratio.ratio -> Sexp.t
 (** [sexp_of_ratio n] converts the value [n] of type [Ratio.ratio] to an
     S-expression. *)
 
-val sexp_of_ref : ('a -> 'b) -> 'a ref -> 'b
+val sexp_of_ref : ('a -> Sexp.t) -> 'a ref -> Sexp.t
 (** [sexp_of_ref conv r] converts the value [r] of type ['a ref] to
     an S-expression.  Uses [conv] to convert values of type ['a] to an
     S-expression. *)
 
-val sexp_of_lazy : ('a -> 'b) -> 'a lazy_t -> 'b
-(** [sexp_of_ref conv l] converts the value [l] of type ['a lazy_t] to
+val sexp_of_lazy_t : ('a -> Sexp.t) -> 'a lazy_t -> Sexp.t
+(** [sexp_of_lazy_t conv l] converts the value [l] of type ['a lazy_t] to
     an S-expression.  Uses [conv] to convert values of type ['a] to an
     S-expression. *)
 
@@ -150,49 +173,41 @@ val sexp_of_hashtbl :
     to convert the hashtable keys of type ['a], and [conv_value] to
     convert hashtable values of type ['b] to S-expressions. *)
 
-val sexp_of_float32_vec :
-  (float, float32_elt, fortran_layout) Array1.t -> Sexp.t
+val sexp_of_bigstring : bigstring -> Sexp.t
+(** [sexp_of_bigstring bstr] converts a bigstring (character bigarray
+    in C-layout) to an S-expression. *)
+
+val sexp_of_float32_vec : float32_vec -> Sexp.t
 (** [sexp_of_float32_vec vec] converts the one-dimensional bigarray
     [vec] of 32-bit floats in Fortran-layout to an S-expression. *)
 
-val sexp_of_float64_vec :
-  (float, float64_elt, fortran_layout) Array1.t -> Sexp.t
+val sexp_of_float64_vec : float64_vec -> Sexp.t
 (** [sexp_of_float64_vec vec] converts the one-dimensional bigarray
     [vec] of 64-bit floats in Fortran-layout to an S-expression. *)
 
-val sexp_of_vec : (float, float64_elt, fortran_layout) Array1.t -> Sexp.t
+val sexp_of_vec : vec -> Sexp.t
 (** [sexp_of_vec vec] same as {!Conv.sexp_of_float64_vec}. *)
 
-val sexp_of_float32_mat :
-  (float, float32_elt, fortran_layout) Array2.t -> Sexp.t
+val sexp_of_float32_mat : float32_mat -> Sexp.t
 (** [sexp_of_float32_mat mat] converts the two-dimensional bigarray
     [mat] of 32-bit floats in Fortran-layout to an S-expression. *)
 
-val sexp_of_float64_mat :
-  (float, float64_elt, fortran_layout) Array2.t -> Sexp.t
+val sexp_of_float64_mat : float64_mat -> Sexp.t
 (** [sexp_of_float64_mat mat] converts the two-dimensional bigarray
     [mat] of 64-bit floats in Fortran-layout to an S-expression. *)
 
-val sexp_of_mat : (float, float64_elt, fortran_layout) Array2.t -> Sexp.t
+val sexp_of_mat : mat -> Sexp.t
 (** [sexp_of_mat mat] same as {!Conv.sexp_of_float64_mat}. *)
 
-val sexp_of_abstr : 'a -> Sexp.t
-(** [sexp_of_abstr x] converts the value [x] of abstract type to an
-    S-expression. *)
+val sexp_of_opaque : 'a -> Sexp.t
+(** [sexp_of_opaque x] converts the value [x] of opaque type to an
+    S-expression.  This means the user need not provide converters,
+    but the result cannot be interpreted. *)
 
 val sexp_of_fun : ('a -> 'b) -> Sexp.t
-(** [sexp_of_fun f] converts the value [f] of function type to an
-    S-expression. *)
-
-(** Type used for declaring existing types as opaque to sexp converters,
-    i.e. even if there is a defined converter for ['a], it will not
-    be called.  This is useful to e.g. suppress printing of extremely
-    large sub-structures for purely informational, human-readable output.
-*)
-type 'a opaque = 'a
-
-val sexp_of_opaque : ('a -> Sexp.t) -> 'a opaque -> Sexp.t
-(** [sexp_of_opaque _ _] converts opaque OCaml-values to S-expressions. *)
+(** [sexp_of_fun f] converts the value [f] of function type to a
+    dummy S-expression.  Functions cannot be serialized as S-expressions,
+    but at least a placeholder can be generated for pretty-printing. *)
 
 val string_of__of__sexp_of : ('a -> Sexp.t) -> 'a -> string
 (** [string_of__of__sexp_of conv x] converts the OCaml-value [x] to
@@ -202,17 +217,19 @@ val string_of__of__sexp_of : ('a -> Sexp.t) -> 'a -> string
 
 (** {6 Conversion of S-expressions to OCaml-values} *)
 
-exception Of_sexp_error of string * Sexp.t
-(** [Of_sexp_error (reason, sexp)] the exception raised when an
-    S-expression could not be successfully converted to an OCaml-value. *)
+exception Of_sexp_error of exn * Sexp.t
+(** [Of_sexp_error (exn, sexp)] the exception raised when an S-expression
+    could not be successfully converted to an OCaml-value. *)
 
 val record_check_extra_fields : bool ref
 (** [record_check_extra_fields] checks for extra (= unknown) fields
     in record S-expressions. *)
 
 val of_sexp_error : string -> Sexp.t -> 'a
-(** [of_sexp_error reason sexp] @raise the exception [Of_sexp_error
-    (reason, sexp)]. *)
+(** [of_sexp_error reason sexp] @raise Of_sexp_error (Failure reason, sexp). *)
+
+val of_sexp_error_exn : exn -> Sexp.t -> 'a
+(** [of_sexp_error exc sexp] @raise Of_sexp_error (exc, sexp). *)
 
 val unit_of_sexp : Sexp.t -> unit
 (** [unit_of_sexp sexp] converts S-expression [sexp] to a value of type
@@ -271,8 +288,8 @@ val ref_of_sexp : (Sexp.t -> 'a) -> Sexp.t -> 'a ref
     of type ['a ref] using conversion function [conv], which converts
     an S-expression to a value of type ['a]. *)
 
-val lazy_of_sexp : (Sexp.t -> 'a) -> Sexp.t -> 'a lazy_t
-(** [lazy_of_sexp conv sexp] converts S-expression [sexp] to a value
+val lazy_t_of_sexp : (Sexp.t -> 'a) -> Sexp.t -> 'a lazy_t
+(** [lazy_t_of_sexp conv sexp] converts S-expression [sexp] to a value
     of type ['a lazy_t] using conversion function [conv], which converts
     an S-expression to a value of type ['a]. *)
 
@@ -312,37 +329,103 @@ val hashtbl_of_sexp :
     key of type ['a], and function [conv_value], which converts an
     S-expression to hashtable value of type ['b]. *)
 
-val float32_vec_of_sexp :
-  Sexp.t -> (float, float32_elt, fortran_layout) Array1.t
+val float32_vec_of_sexp : Sexp.t -> float32_vec
 (** [float32_vec_of_sexp sexp] converts S-expression [sexp] to a
     one-dimensional bigarray of 32-bit floats in Fortran-layout. *)
 
-val float64_vec_of_sexp :
-  Sexp.t -> (float, float64_elt, fortran_layout) Array1.t
+val float64_vec_of_sexp : Sexp.t -> float64_vec
 (** [float64_vec_of_sexp sexp] converts S-expression [sexp] to a
     one-dimensional bigarray of 64-bit floats in Fortran-layout. *)
 
-val vec_of_sexp : Sexp.t -> (float, float64_elt, fortran_layout) Array1.t
+val vec_of_sexp : Sexp.t -> vec
 (** [vec_of_sexp sexp] same as {!float64_vec_of_sexp}. *)
 
-val float32_mat_of_sexp :
-  Sexp.t -> (float, float32_elt, fortran_layout) Array2.t
+val float32_mat_of_sexp : Sexp.t -> float32_mat
 (** [float32_mat_of_sexp sexp] converts S-expression [sexp] to a
     two-dimensional bigarray of 32-bit floats in Fortran-layout. *)
 
-val float64_mat_of_sexp :
-  Sexp.t -> (float, float64_elt, fortran_layout) Array2.t
+val float64_mat_of_sexp : Sexp.t -> float64_mat
 (** [float64_mat_of_sexp sexp] converts S-expression [sexp] to a
     two-dimensional bigarray of 64-bit floats in Fortran-layout. *)
 
-val mat_of_sexp : Sexp.t -> (float, float64_elt, fortran_layout) Array2.t
+val mat_of_sexp : Sexp.t -> mat
 (** [mat_of_sexp sexp] same as {!Conv.float64_mat_of_sexp}. *)
 
+val opaque_of_sexp : Sexp.t -> 'a
+(** [opaque_of_sexp sexp] @raise Of_sexp_error when attempting to
+    convert an S-expression to an opaque value. *)
+
 val fun_of_sexp : Sexp.t -> ('a -> 'b)
-(** [fun_of_sexp sexp] @raise a conversion error when attempting to
+(** [fun_of_sexp sexp] @raise Of_sexp_error when attempting to
     convert an S-expression to a function. *)
 
 val of_string__of__of_sexp : (Sexp.t -> 'a) -> string -> 'a
 (** [of_string__of__of_sexp conv str] converts the S-expression [str]
     represented as a string to an OCaml-value by using conversion function
     [conv]. *)
+
+
+(** Exception converters *)
+
+val sexp_of_exn : exn -> Sexp.t
+(** [sexp_of_exn exc] converts exception [exc] to an S-expression.
+    If no suitable converter is found, the standard converter in
+    [Printexc] will be used to generate an atomic S-expression. *)
+
+val sexp_of_exn_opt : exn -> Sexp.t option
+(** [sexp_of_exn_opt exc] converts exception [exc] to [Some sexp].
+    If no suitable converter is found, [None] is returned instead. *)
+
+module Exn_converter : sig
+  type t  (** Type of handles for exception S-expression converters *)
+
+  val set_max_exn_tags : int -> unit
+  (** [set_max_exn_tags n] sets the maximum number of converters for exceptions
+      with the same template to [n].  If already existing handlers exceed
+      this number, they will remain at their current number until this number
+      is reduced due to garbage collection.  New handlers will not be added
+      until [n] will not be exceeded. *)
+
+  val get_max_exn_tags : unit -> int
+  (** [set_max_exn_tags ()] return the maximum number of converters for
+      exceptions with the same template. *)
+
+  val add_auto : ?finalise : bool -> exn -> (exn -> Sexp.t) -> unit
+  (** [add_auto ?finalise templ sexp_of_exn] registers exception S-expression
+      converter [sexp_of_exn] for exceptions having same constructor as
+      template [templ], unless the number of stored handlers for the given
+      template exceeds [get_max_exn_tags ()], in which case the handler will
+      never be called.  When [sexp_of_exn] is called, the passed exception
+      is guaranteed to match the template.
+
+      NOTE: if the exception belongs to a transient module, e.g. local modules
+      (including functor instantiations), first-class modules, etc., a manually
+      written [sexp_of_exn] must use [Obj.magic] internally to avoid matching
+      or creating the exception, otherwise the handler can never be reclaimed
+      once the exception ceases to exist.  If [finalise] is [true], then
+      the exception will be automatically registered for removal with the GC
+      (default).  Finalisation will not work with exceptions that have been
+      allocated outside the heap, which is the case for some standard ones
+      e.g. [Sys_error].
+
+      NOTE: Use with great caution, this function is primarily intended for
+      automated use!  If unsure, use [add_slow] instead.
+
+      @param finalise default = [true]
+  *)
+
+  val add_slow : (exn -> Sexp.t option) -> t
+  (** [add_slow sexp_of_exn] registers exception S-expression converter
+      [sexp_of_exn] and returns a handle.  Exception converters registered this
+      way are much slower than with [add], but this function does not require
+      an exception template.  NOTE: if you call this function explicitly,
+      or the "sexp"-macro for exceptions from within local modules, you will
+      eventually have to unregister it manually with {!del}, otherwise there
+      is a space leak! *)
+
+  val del_slow : t -> unit
+  (** [del_slow handle] unregisters exception S-expression converter with
+      handle [handle].  In multi-threaded contexts it is not guaranteed
+      that the unregistered converter will not be called after this function
+      returns. *)
+end
similarity index 64%
rename from ocamlsexp/conv_error.ml
rename to bundles/sexplib/sexplib-7.0.5/lib/conv_error.ml
index caf25d9..cac10e0 100644 (file)
@@ -1,26 +1,26 @@
-(* File: conv_error.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
 
 (* Conv_error: Module for Handling Errors during Automated S-expression
    Conversions *)
@@ -111,6 +111,9 @@ exception No_variant_match of string * Sexp.t
 let no_variant_match loc sexp =
   raise (No_variant_match (loc ^ "_of_sexp", sexp))
 
+let no_matching_variant_found loc sexp =
+  of_sexp_error (loc ^ ": no matching variant found") sexp
+
 let ptag_no_args loc sexp =
   of_sexp_error (
     loc ^ "_of_sexp: polymorphic variant does not take arguments") sexp
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/exn_magic.ml b/bundles/sexplib/sexplib-7.0.5/lib/exn_magic.ml
new file mode 100644 (file)
index 0000000..1bc0195
--- /dev/null
@@ -0,0 +1,223 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+let register exc exc_name =
+  Conv.Exn_converter.add_auto exc (fun _exc -> Sexp.Atom exc_name)
+
+let magic_field repr n = Obj.magic (Obj.field repr n)
+
+let register1 make_exc exc_name
+      sexp_of_arg1 =
+  let exc =
+    make_exc
+      (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1;
+    ])
+
+let register2 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2;
+    ])
+
+let register3 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3;
+    ])
+
+let register4 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4;
+    ])
+
+let register5 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5;
+    ])
+
+let register6 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5
+      sexp_of_arg6 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+      (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    let sexp6 = sexp_of_arg6 (magic_field repr 6) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5; sexp6;
+    ])
+
+let register7 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5
+      sexp_of_arg6 sexp_of_arg7 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+      (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    let sexp6 = sexp_of_arg6 (magic_field repr 6) in
+    let sexp7 = sexp_of_arg7 (magic_field repr 7) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5; sexp6; sexp7;
+    ])
+
+let register8 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5
+      sexp_of_arg6 sexp_of_arg7 sexp_of_arg8 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    let sexp6 = sexp_of_arg6 (magic_field repr 6) in
+    let sexp7 = sexp_of_arg7 (magic_field repr 7) in
+    let sexp8 = sexp_of_arg8 (magic_field repr 8) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5; sexp6; sexp7; sexp8;
+    ])
+
+let register9 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5
+      sexp_of_arg6 sexp_of_arg7 sexp_of_arg8 sexp_of_arg9 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    let sexp6 = sexp_of_arg6 (magic_field repr 6) in
+    let sexp7 = sexp_of_arg7 (magic_field repr 7) in
+    let sexp8 = sexp_of_arg8 (magic_field repr 8) in
+    let sexp9 = sexp_of_arg9 (magic_field repr 9) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5; sexp6; sexp7; sexp8; sexp9;
+    ])
+
+let register10 make_exc exc_name
+      sexp_of_arg1 sexp_of_arg2 sexp_of_arg3 sexp_of_arg4 sexp_of_arg5
+      sexp_of_arg6 sexp_of_arg7 sexp_of_arg8 sexp_of_arg9 sexp_of_arg10 =
+  let exc =
+    make_exc
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+      (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0) (Obj.magic 0)
+  in
+  Conv.Exn_converter.add_auto exc (fun exc ->
+    let repr = Obj.repr exc in
+    let sexp1 = sexp_of_arg1 (magic_field repr 1) in
+    let sexp2 = sexp_of_arg2 (magic_field repr 2) in
+    let sexp3 = sexp_of_arg3 (magic_field repr 3) in
+    let sexp4 = sexp_of_arg4 (magic_field repr 4) in
+    let sexp5 = sexp_of_arg5 (magic_field repr 5) in
+    let sexp6 = sexp_of_arg6 (magic_field repr 6) in
+    let sexp7 = sexp_of_arg7 (magic_field repr 7) in
+    let sexp8 = sexp_of_arg8 (magic_field repr 8) in
+    let sexp9 = sexp_of_arg9 (magic_field repr 9) in
+    let sexp10 = sexp_of_arg10 (magic_field repr 10) in
+    Sexp.List [
+      Sexp.Atom exc_name;
+      sexp1; sexp2; sexp3; sexp4; sexp5; sexp6; sexp7; sexp8; sexp9; sexp10;
+    ])
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/exn_magic.mli b/bundles/sexplib/sexplib-7.0.5/lib/exn_magic.mli
new file mode 100644 (file)
index 0000000..d5d65c9
--- /dev/null
@@ -0,0 +1,130 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+val register : exn -> string -> unit
+
+val register1 :
+  ('a -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> unit
+
+val register2 :
+  ('a -> 'b -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> unit
+
+val register3 :
+  ('a -> 'b -> 'c -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> unit
+
+val register4 :
+  ('a -> 'b -> 'c -> 'd -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> unit
+
+val register5 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> unit
+
+val register6 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> ('f -> Sexp.t)
+  -> unit
+
+val register7 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> ('f -> Sexp.t)
+  -> ('g -> Sexp.t)
+  -> unit
+
+val register8 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> ('f -> Sexp.t)
+  -> ('g -> Sexp.t)
+  -> ('h -> Sexp.t)
+  -> unit
+
+val register9 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> ('f -> Sexp.t)
+  -> ('g -> Sexp.t)
+  -> ('h -> Sexp.t)
+  -> ('i -> Sexp.t)
+  -> unit
+
+val register10 :
+  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> exn)
+  -> string
+  -> ('a -> Sexp.t)
+  -> ('b -> Sexp.t)
+  -> ('c -> Sexp.t)
+  -> ('d -> Sexp.t)
+  -> ('e -> Sexp.t)
+  -> ('f -> Sexp.t)
+  -> ('g -> Sexp.t)
+  -> ('h -> Sexp.t)
+  -> ('i -> Sexp.t)
+  -> ('j -> Sexp.t)
+  -> unit
similarity index 67%
rename from ocamlsexp/lexer.mll
rename to bundles/sexplib/sexplib-7.0.5/lib/lexer.mll
index f4fcc61..22e208e 100644 (file)
@@ -1,27 +1,27 @@
 {
-  (* File: lexer.mll
-
-      Copyright (C) 2005-
-
-        Jane Street Holding, LLC
-        Author: Markus Mottl
-        email: mmottl@janestcapital.com
-        WWW: http://www.janestcapital.com/ocaml
-
-     This library is free software; you can redistribute it and/or
-     modify it under the terms of the GNU Lesser General Public
-     License as published by the Free Software Foundation; either
-     version 2 of the License, or (at your option) any later version.
-
-     This library is distributed in the hope that it will be useful,
-     but WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     Lesser General Public License for more details.
-
-     You should have received a copy of the GNU Lesser General Public
-     License along with this library; if not, write to the Free Software
-     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  *)
+ (*****************************************************************************
+  *                             Sexplib                                       *
+  *                                                                           *
+  * Copyright (C) 2005- Jane Street Holding, LLC                              *
+  *    Contact: opensource@janestreet.com                                     *
+  *    WWW: http://www.janestreet.com/ocaml                                   *
+  *    Author: Markus Mottl                                                   *
+  *                                                                           *
+  * This library is free software; you can redistribute it and/or             *
+  * modify it under the terms of the GNU Lesser General Public                *
+  * License as published by the Free Software Foundation; either              *
+  * version 2 of the License, or (at your option) any later version.          *
+  *                                                                           *
+  * This library is distributed in the hope that it will be useful,           *
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+  * Lesser General Public License for more details.                           *
+  *                                                                           *
+  * You should have received a copy of the GNU Lesser General Public          *
+  * License along with this library; if not, write to the Free Software       *
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
+  *                                                                           *
+  *****************************************************************************)
 
   (** Lexer: Lexer Specification for S-expressions *)
 
@@ -73,8 +73,7 @@ let backslash_escapes = ['\\' '"' '\'' 'n' 't' 'b' 'r']
 
 rule main buf = parse
   | newline { found_newline lexbuf 1; main buf lexbuf }
-  | space+ { main buf lexbuf }
-  | ';' [^ '\n' '\r']+ { main buf lexbuf }
+  | space+ | ';' [^ '\n' '\r']* { main buf lexbuf }
   | '(' { LPAREN }
   | ')' { RPAREN }
   | '"'
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/parser.mly b/bundles/sexplib/sexplib-7.0.5/lib/parser.mly
new file mode 100644 (file)
index 0000000..6d7fc43
--- /dev/null
@@ -0,0 +1,75 @@
+%{
+ (*****************************************************************************
+  *                             Sexplib                                       *
+  *                                                                           *
+  * Copyright (C) 2005- Jane Street Holding, LLC                              *
+  *    Contact: opensource@janestreet.com                                     *
+  *    WWW: http://www.janestreet.com/ocaml                                   *
+  *    Author: Markus Mottl                                                   *
+  *                                                                           *
+  * This library is free software; you can redistribute it and/or             *
+  * modify it under the terms of the GNU Lesser General Public                *
+  * License as published by the Free Software Foundation; either              *
+  * version 2 of the License, or (at your option) any later version.          *
+  *                                                                           *
+  * This library is distributed in the hope that it will be useful,           *
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+  * Lesser General Public License for more details.                           *
+  *                                                                           *
+  * You should have received a copy of the GNU Lesser General Public          *
+  * License along with this library; if not, write to the Free Software       *
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
+  *                                                                           *
+  *****************************************************************************)
+
+  (** Parser: Grammar Specification for Parsing S-expressions *)
+
+  open Lexing
+
+  let parse_failure what =
+    let pos = symbol_start_pos () in
+    let msg =
+      Printf.sprintf "Sexplib.Parser: failed to parse line %d char %d: %s"
+        pos.pos_lnum (pos.pos_cnum - pos.pos_bol) what in
+    failwith msg
+%}
+
+%token <string> STRING
+%token LPAREN RPAREN EOF
+
+%start sexp
+%type <Type.t> sexp
+
+%start sexp_opt
+%type <Type.t option> sexp_opt
+
+%start sexps
+%type <Type.t list> sexps
+
+%start rev_sexps
+%type <Type.t list> rev_sexps
+
+%%
+
+sexp
+  : STRING { Type.Atom $1 }
+  | LPAREN RPAREN { Type.List [] }
+  | LPAREN rev_sexps_aux RPAREN { Type.List (List.rev $2) }
+  | error { parse_failure "sexp" }
+
+sexp_opt
+  : sexp { Some $1 }
+  | EOF { None }
+
+rev_sexps_aux
+  : sexp { [$1] }
+  | rev_sexps_aux sexp { $2 :: $1 }
+
+rev_sexps
+  : rev_sexps_aux { $1 }
+  | EOF { [] }
+
+sexps
+  : rev_sexps_aux { List.rev $1 }
+  | EOF { [] }
similarity index 75%
rename from ocamlsexp/path.ml
rename to bundles/sexplib/sexplib-7.0.5/lib/path.ml
index f6eafa8..e529a5b 100644 (file)
@@ -1,26 +1,26 @@
-(* File: path.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
 
 (* Path: Module for Substitutions within S-expressions *)
 
similarity index 54%
rename from ocamlsexp/path.mli
rename to bundles/sexplib/sexplib-7.0.5/lib/path.mli
index 7375885..352ea01 100644 (file)
@@ -1,29 +1,26 @@
-(* File: path.mli
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(* WL YM for MM: Some other functions that would be useful: get_opt, insert_record_field,
-   remove_record_field *)
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
 
 (** Path: Module for Substitutions within S-expressions *)
 
@@ -63,28 +60,46 @@ val parse : string -> t
 
       ".t.x.B[1]" -> choose record field with name [t], then subfield
       [x].  Match this value against [B], and denote its first argument.
+
+    @raise Failure if the path is syntactically invalid.
 *)
 
 val get : ?path : t -> ?str : string -> Sexp.t -> Sexp.t
 (** [get ?path ?str sexp] if [path] is provided, use it as path.
     Otherwise, if [str] is provided, parse it as a path.  If neither
     is provided, assume an empty path.  @return the sub-expression from
-    S-expression [sexp] denoted by the path. *)
+    S-expression [sexp] denoted by the path.
+
+    @raise Failure if path is syntactically invalid or if the path
+    structure clashes with the structure of the data.
+*)
 
 val replace : ?path : t -> ?str : string -> Sexp.t -> subst : Sexp.t -> Sexp.t
 (** [replace ?path ?str sexp ~subst] like [get], but does not extract
     a sub-expression but substitutes it with [subst].  @return resulting
-    S-expression.  *)
+    S-expression.
+
+    @raise Failure if path is syntactically invalid or if the path
+    structure clashes with the structure of the data.
+*)
 
 val replace_no_path : str : string -> Sexp.t -> subst : Sexp.t -> Sexp.t
 (** [replace_no_path ~str sexp ~subst] like [replace], but does not take
-    optional arguments.  [str] must be specified. *)
+    optional arguments.  [str] must be specified.
+
+    @raise Failure if path is syntactically invalid or if the path
+    structure clashes with the structure of the data.
+*)
 
 val subst_path : Sexp.t -> t -> (Sexp.t -> Sexp.t) * Sexp.t
 (** [subst_path sexp path] @return the tuple [(subst, sub)], where [subst]
     is a function that returns an S-expression in which the subexpression
     denoted by [path] in [sexp] has been substituted by its argument.
-    [sub] is the denoted subexpression.  Note that [subst sub = sexp]. *)
+    [sub] is the denoted subexpression.  Note that [subst sub = sexp].
+
+    @raise Failure if path is syntactically invalid or if the path
+    structure clashes with the structure of the data.
+*)
 
 
 (** {6 Low-level functions} *)
@@ -96,7 +111,11 @@ val extract_pos : int -> Sexp.t -> (Sexp.t option -> Sexp.t) * Sexp.t
     substituted by [value] if the optional argument is [Some value], or
     removes the denoted subexpression if the optional argument is [None].
     [sub] is the denoted subexpression.  Note that [subst (Some sub) =
-    sexp]. *)
+    sexp].
+
+    @raise Failure if the position cannot be resolved within the given
+    S-expression.
+*)
 
 val extract_match :
   string -> int -> Sexp.t -> (Sexp.t option -> Sexp.t) * Sexp.t
@@ -106,11 +125,17 @@ val extract_match :
     in [sexp] has been substituted by [value] if the argument is [Some
     value], or removes the denoted subexpression if the optional argument
     is [None].  [sub] is the denoted subexpression.  Note that [subst
-    (Some sub) = sexp]. *)
+    (Some sub) = sexp].
+
+    @raise Failure if the S-expression does not represent a sum tag.
+*)
 
 val extract_rec : string -> Sexp.t -> (Sexp.t -> Sexp.t) * Sexp.t
 (** [extract_rec name sexp] @return the tuple [(subst, sub)], where
     [subst] is a function that returns an S-expression in which the
     subexpression denoted by matching field name [name] in [sexp] has
     been substituted by its argument.  [sub] is the denoted subexpression.
-    Note that [subst (Some sub) = sexp]. *)
+    Note that [subst (Some sub) = sexp].
+
+    @raise Failure if the S-expression does not represent a record.
+*)
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/pre_sexp.ml b/bundles/sexplib/sexplib-7.0.5/lib/pre_sexp.ml
new file mode 100644 (file)
index 0000000..b711ccd
--- /dev/null
@@ -0,0 +1,1052 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(* Sexp: Module for handling S-expressions (I/O, etc.) *)
+
+open Format
+open Bigarray
+
+include Type
+
+exception Of_sexp_error of exn * t
+
+type bigstring = (char, int8_unsigned_elt, c_layout) Array1.t
+
+
+(* Default indentation level for human-readable conversions *)
+
+let default_indent = ref 1
+
+
+(* Escaping of strings used as atoms in S-expressions *)
+
+let is_special_char c =
+  c <= ' ' || c = '"' || c = '(' || c = ')' || c = ';' || c = '\\'
+
+let must_escape str =
+  let len = String.length str in
+  len = 0 ||
+    let rec loop ix = is_special_char str.[ix] || ix > 0 && loop (ix - 1) in
+    loop (len - 1)
+
+let maybe_esc_str str =
+  if must_escape str then
+    let estr = String.escaped str in
+    let elen = String.length estr in
+    let res = String.create (elen + 2) in
+    String.blit estr 0 res 1 elen;
+    res.[0] <- '"';
+    res.[elen + 1] <- '"';
+    res
+  else str
+
+let pp_maybe_esc_str ppf str = pp_print_string ppf (maybe_esc_str str)
+
+
+(* Output of S-expressions to formatters *)
+
+let rec pp_hum_indent indent ppf = function
+  | Atom str -> pp_maybe_esc_str ppf str
+  | List (h :: t) ->
+      pp_open_box ppf indent;
+      pp_print_string ppf "(";
+      pp_hum_indent indent ppf h;
+      pp_hum_rest indent ppf t
+  | List [] -> pp_print_string ppf "()"
+
+and pp_hum_rest indent ppf = function
+  | h :: t ->
+      pp_print_space ppf ();
+      pp_hum_indent indent ppf h;
+      pp_hum_rest indent ppf t
+  | [] ->
+      pp_print_string ppf ")";
+      pp_close_box ppf ()
+
+let rec pp_mach_internal may_need_space ppf = function
+  | Atom str ->
+      let str' = maybe_esc_str str in
+      let new_may_need_space = str' == str in
+      if may_need_space && new_may_need_space then pp_print_string ppf " ";
+      pp_print_string ppf str';
+      new_may_need_space
+  | List (h :: t) ->
+      pp_print_string ppf "(";
+      let may_need_space = pp_mach_internal false ppf h in
+      pp_mach_rest may_need_space ppf t;
+      false
+  | List [] -> pp_print_string ppf "()"; false
+
+and pp_mach_rest may_need_space ppf = function
+  | h :: t ->
+      let may_need_space = pp_mach_internal may_need_space ppf h in
+      pp_mach_rest may_need_space ppf t
+  | [] -> pp_print_string ppf ")"
+
+let pp_hum ppf sexp = pp_hum_indent !default_indent ppf sexp
+
+let pp_mach ppf sexp = ignore (pp_mach_internal false ppf sexp)
+let pp = pp_mach
+
+
+(* Sexp size *)
+
+let rec size_loop (v, c as acc) = function
+  | Atom str -> v + 1, c + String.length str
+  | List lst -> List.fold_left size_loop acc lst
+
+let size sexp = size_loop (0, 0) sexp
+
+
+(* Buffer conversions *)
+
+let to_buffer_hum ~buf ?(indent = !default_indent) sexp =
+  Format.bprintf buf "%a@?" (pp_hum_indent indent) sexp
+
+let to_buffer_mach ~buf sexp =
+  let rec loop may_need_space = function
+    | Atom str ->
+        let str' = maybe_esc_str str in
+        let new_may_need_space = str' == str in
+        if may_need_space && new_may_need_space then Buffer.add_char buf ' ';
+        Buffer.add_string buf str';
+        new_may_need_space
+    | List (h :: t) ->
+        Buffer.add_char buf '(';
+        let may_need_space = loop false h in
+        loop_rest may_need_space t;
+        false
+    | List [] -> Buffer.add_string buf "()"; false
+  and loop_rest may_need_space = function
+    | h :: t ->
+        let may_need_space = loop may_need_space h in
+        loop_rest may_need_space t
+    | [] -> Buffer.add_char buf ')' in
+  ignore (loop false sexp)
+
+let to_buffer = to_buffer_mach
+
+
+(* Output of S-expressions to I/O-channels *)
+
+let buffer () = Buffer.create 4096
+
+let with_new_buffer oc f =
+  let buf = buffer () in
+  f buf;
+  Buffer.output_buffer oc buf
+
+let output_hum oc sexp =
+  with_new_buffer oc (fun buf -> to_buffer_hum sexp ~buf)
+
+let output_hum_indent indent oc sexp =
+  with_new_buffer oc (fun buf -> to_buffer_hum ~indent sexp ~buf)
+
+let output_mach oc sexp =
+  with_new_buffer oc (fun buf -> to_buffer_mach sexp ~buf)
+
+let output = output_mach
+
+
+(* Output of S-expressions to file *)
+
+let save_of_output ?perm output_function file sexp =
+  let tmp_name, oc = Filename.open_temp_file file "tmp" in
+  try
+    output_function oc sexp;
+    close_out oc;
+    let perm =
+      match perm with
+      | Some perm -> perm
+      | None ->
+          let umask = Unix.umask 0 in
+          ignore (Unix.umask umask);
+          umask lxor 0o666
+    in
+    if perm <> 0o600 then Unix.chmod tmp_name perm;
+    Sys.rename tmp_name file
+  with
+    e ->
+      close_out_noerr oc;
+      raise e
+
+let output_sexp_nl do_output oc sexp =
+  do_output oc sexp;
+  output_string oc "\n"
+
+let save_hum ?perm file sexp =
+  save_of_output ?perm (output_sexp_nl output_hum) file sexp
+
+let save_mach ?perm file sexp = save_of_output ?perm output_mach file sexp
+let save = save_mach
+
+let output_sexps_nl do_output oc sexps =
+  List.iter (output_sexp_nl do_output oc) sexps
+
+let save_sexps_hum ?perm file sexps =
+  save_of_output ?perm (output_sexps_nl output_hum) file sexps
+
+let save_sexps_mach ?perm file sexps =
+  save_of_output ?perm (output_sexps_nl output_mach) file sexps
+
+let save_sexps = save_sexps_mach
+
+
+(* String conversions *)
+
+let to_string_hum ?indent = function
+  | Atom str -> maybe_esc_str str
+  | sexp ->
+      let buf = buffer () in
+      to_buffer_hum ?indent sexp ~buf;
+      Buffer.contents buf
+
+let to_string_mach = function
+  | Atom str -> maybe_esc_str str
+  | sexp ->
+      let buf = buffer () in
+      to_buffer_mach sexp ~buf;
+      Buffer.contents buf
+
+let to_string = to_string_mach
+
+
+(* Scan functions *)
+
+let scan_sexp ?buf lexbuf = Parser.sexp (Lexer.main ?buf) lexbuf
+let scan_sexps ?buf lexbuf = Parser.sexps (Lexer.main ?buf) lexbuf
+
+let get_main_buf buf =
+  let buf =
+    match buf with
+    | None -> Buffer.create 64
+    | Some buf -> buf in
+  Lexer.main ~buf
+
+let scan_fold_sexps ?buf ~f ~init lexbuf =
+  let main = get_main_buf buf in
+  let rec loop acc =
+    match Parser.sexp_opt main lexbuf with
+    | None -> acc
+    | Some sexp -> loop (f acc sexp) in
+  loop init
+
+let scan_iter_sexps ?buf ~f lexbuf =
+  scan_fold_sexps ?buf lexbuf ~init:() ~f:(fun () sexp -> f sexp)
+
+let scan_sexps_conv ?buf ~f lexbuf =
+  let coll acc sexp = f sexp :: acc in
+  List.rev (scan_fold_sexps ?buf ~f:coll ~init:[] lexbuf)
+
+
+(* Partial parsing *)
+
+module Annot = struct
+  type pos = { line : int; col : int; offset : int }
+  type range = { start_pos : pos; end_pos : pos }
+  type t = Atom of range * Type.t | List of range * t list * Type.t
+  type 'a conv = [ `Result of 'a | `Error of exn * t ]
+
+  exception Conv_exn of string * exn
+
+  type stack = {
+    mutable positions : pos list;
+    mutable stack : t list list;
+  }
+
+  let get_sexp = function Atom (_, sexp) | List (_, _, sexp) -> sexp
+  let get_range = function Atom (range, _) | List (range, _, _) -> range
+
+  exception Annot_sexp of t
+
+  let find_sexp annot_sexp sexp =
+    let rec loop annot_sexp =
+      match annot_sexp with
+      | Atom (_, sub_sexp)
+      | List (_, _, sub_sexp) when sexp == sub_sexp ->
+          raise (Annot_sexp annot_sexp)
+      | List (_, annots, _) -> List.iter loop annots
+      | Atom _ -> ()
+    in
+    try loop annot_sexp; None
+    with Annot_sexp res -> Some res
+end
+
+module Parse_pos = struct
+  type t =
+    {
+      mutable text_line : int;
+      mutable text_char : int;
+      mutable global_offset : int;
+      mutable buf_pos : int;
+    }
+
+  let create
+        ?(text_line = 1) ?(text_char = 0)
+        ?(buf_pos = 0) ?(global_offset = 0) () =
+    let fail msg = failwith ("Sexplib.Sexp.Parse_pos.create: " ^ msg) in
+    if text_line < 1 then fail "text_line < 1"
+    else if text_char < 0 then fail "text_char < 0"
+    else if global_offset < 0 then fail "global_offset < 0"
+    else if buf_pos < 0 then fail "buf_pos < 0"
+    else { text_line = text_line; text_char = text_char; global_offset = global_offset; buf_pos = buf_pos }
+
+  let with_buf_pos t buf_pos = { t with buf_pos = buf_pos }
+end
+
+type ('a, 't) parse_result =
+  | Done of 't * Parse_pos.t
+  | Cont of bool * ('a, 't) parse_fun
+
+and ('a, 't) parse_fun = pos : int -> len : int -> 'a -> ('a, 't) parse_result
+
+type 't parse_state =
+  {
+    parse_pos : Parse_pos.t;
+    mutable pstack : 't;
+    pbuf : Buffer.t;
+  }
+
+type parse_error =
+  {
+    location : string;
+    err_msg : string;
+    parse_state :
+      [
+      | `Sexp of t list list parse_state
+      | `Annot of Annot.stack parse_state
+      ]
+  }
+
+exception Parse_error of parse_error
+
+let bump_text_line { parse_pos = parse_pos } =
+  parse_pos.Parse_pos.text_line <- parse_pos.Parse_pos.text_line + 1;
+  parse_pos.Parse_pos.text_char <- 0
+
+let bump_text_pos { parse_pos = parse_pos } =
+  parse_pos.Parse_pos.text_char <- parse_pos.Parse_pos.text_char + 1
+
+let bump_pos_cont state str ~max_pos ~pos cont =
+  bump_text_pos state;
+  cont state str ~max_pos ~pos:(pos + 1)
+
+let bump_line_cont state str ~max_pos ~pos cont =
+  bump_text_line state;
+  cont state str ~max_pos ~pos:(pos + 1)
+
+let add_bump bump state str ~max_pos ~pos c cont =
+  Buffer.add_char state.pbuf c;
+  bump state;
+  cont state str ~max_pos ~pos:(pos + 1)
+
+let add_bump_pos state str ~max_pos ~pos c cont =
+  add_bump bump_text_pos state str ~max_pos ~pos c cont
+
+let add_bump_line state str ~max_pos ~pos c cont =
+  add_bump bump_text_line state str ~max_pos ~pos c cont
+
+let set_parse_pos parse_pos buf_pos =
+  let len = buf_pos - parse_pos.Parse_pos.buf_pos in
+  parse_pos.Parse_pos.buf_pos <- buf_pos;
+  parse_pos.Parse_pos.global_offset <- parse_pos.Parse_pos.global_offset + len
+
+let mk_parse_pos { parse_pos = parse_pos } buf_pos =
+  set_parse_pos parse_pos buf_pos;
+  parse_pos
+
+let raise_parse_error parse_state location buf_pos err_msg =
+  begin
+    match parse_state with
+    | `Sexp { parse_pos = parse_pos } | `Annot { parse_pos = parse_pos } ->
+        set_parse_pos parse_pos buf_pos;
+        parse_pos.Parse_pos.text_char <- parse_pos.Parse_pos.text_char + 1;
+  end;
+  let parse_error = { location = location; err_msg = err_msg; parse_state = parse_state } in
+  raise (Parse_error parse_error)
+
+let raise_unexpected_char parse_state location buf_pos c =
+  let err_msg = sprintf "unexpected character: '%c'" c in
+  raise_parse_error parse_state location buf_pos err_msg
+
+(* The code below is derived from lexer.mll in the OCaml distribution,
+   which also uses ASCII codes instead of escape sequences to denote
+   special characters. *)
+
+(* Macro for generating parsers *)
+#define MK_PARSER( \
+    TYPE, GET_LEN, PARSE, GET_CHAR, \
+    GET_PSTACK, SET_PSTACK, \
+    REGISTER_POS, REGISTER_POS1, \
+    MK_ATOM, MK_LIST, INIT_PSTACK, MK_PARSE_STATE) \
+  let bump_found_atom bump state str ~max_pos ~pos cont = \
+    let pbuf = state.pbuf in \
+    let pbuf_str = Buffer.contents pbuf in \
+    let atom = MK_ATOM in \
+    match GET_PSTACK with \
+    | [] -> Done (atom, mk_parse_pos state pos) \
+    | rev_sexp_lst :: sexp_stack -> \
+        Buffer.clear pbuf; \
+        let pstack = (atom :: rev_sexp_lst) :: sexp_stack in \
+        SET_PSTACK; \
+        bump state; \
+        cont state str ~max_pos ~pos:(pos + 1) \
+  \
+  let check_str_bounds loc ~pos ~len (str : TYPE) = \
+    if pos < 0 then invalid_arg (loc ^ ": pos < 0"); \
+    if len < 0 then invalid_arg (loc ^ ": len < 0"); \
+    let str_len = GET_LEN str in \
+    let pos_len = pos + len in \
+    if pos_len > str_len then invalid_arg (loc ^ ": pos + len > str_len"); \
+    pos_len - 1 \
+  \
+  let mk_cont name cont state = \
+    let ws_only = GET_PSTACK = [] && Buffer.length state.pbuf = 0 in \
+    let parse_fun = \
+      let used_ref = ref false in \
+      fun ~pos ~len str -> \
+        if !used_ref then \
+          failwith "Sexplib.Sexp: parser continuation called twice" \
+        else begin \
+          used_ref := true; \
+          let max_pos = check_str_bounds name ~pos ~len str in \
+          cont state str ~max_pos ~pos \
+        end \
+    in \
+    Cont (ws_only, parse_fun) \
+  \
+  let rec PARSE state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse" PARSE state \
+    else \
+      match GET_CHAR with \
+      | '(' -> \
+          REGISTER_POS \
+          let pstack = [] :: GET_PSTACK in \
+          SET_PSTACK; \
+          bump_pos_cont state str ~max_pos ~pos PARSE \
+      | ')' as c -> \
+          (match GET_PSTACK with \
+          | [] -> raise_unexpected_char (MK_PARSE_STATE state) "parse" pos c \
+          | rev_sexp_lst :: sexp_stack -> \
+              let sexp_lst = List.rev rev_sexp_lst in \
+              let sexp = MK_LIST in \
+              match sexp_stack with \
+              | [] -> Done (sexp, mk_parse_pos state (pos + 1)) \
+              | higher_rev_sexp_lst :: higher_sexp_stack -> \
+                  let pstack = \
+                    (sexp :: higher_rev_sexp_lst) :: higher_sexp_stack \
+                  in \
+                  SET_PSTACK; \
+                  bump_pos_cont state str ~max_pos ~pos PARSE) \
+      | ' ' | '\009' | '\012' -> bump_pos_cont state str ~max_pos ~pos PARSE \
+      | '\010' -> bump_line_cont state str ~max_pos ~pos PARSE \
+      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_nl \
+      | ';' -> bump_pos_cont state str ~max_pos ~pos parse_comment \
+      | '"' -> \
+          REGISTER_POS1 \
+          bump_pos_cont state str ~max_pos ~pos parse_quoted \
+      | c -> \
+          REGISTER_POS \
+          add_bump_pos state str ~max_pos ~pos c parse_atom \
+  \
+  and parse_nl state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_nl" parse_nl state \
+    else \
+      let pos = if GET_CHAR = '\010' then pos + 1 else pos in \
+      PARSE state str ~max_pos ~pos \
+  \
+  and parse_comment state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_comment" parse_comment state \
+    else \
+      match GET_CHAR with \
+      | '\010' -> bump_line_cont state str ~max_pos ~pos PARSE \
+      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_nl \
+      | _ -> bump_pos_cont state str ~max_pos ~pos parse_comment \
+  \
+  and parse_atom state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_atom" parse_atom state \
+    else \
+      match GET_CHAR with \
+      | ' ' | '\009' | '\012' -> \
+          bump_found_atom bump_text_pos state str ~max_pos ~pos PARSE \
+      | '(' -> \
+          let pbuf = state.pbuf in \
+          let pbuf_str = Buffer.contents pbuf in \
+          let atom = MK_ATOM in \
+          (match GET_PSTACK with \
+          | [] -> Done (atom, mk_parse_pos state pos) \
+          | rev_sexp_lst :: sexp_stack -> \
+              REGISTER_POS \
+              Buffer.clear pbuf; \
+              let pstack = [] :: (atom :: rev_sexp_lst) :: sexp_stack in \
+              SET_PSTACK; \
+              bump_pos_cont state str ~max_pos ~pos PARSE) \
+      | ')' -> \
+          let pbuf = state.pbuf in \
+          let pbuf_str = Buffer.contents pbuf in \
+          let atom = MK_ATOM in \
+          (match GET_PSTACK with \
+          | [] -> Done (atom, mk_parse_pos state pos) \
+          | rev_sexp_lst :: sexp_stack -> \
+              let sexp_lst = List.rev_append rev_sexp_lst [atom] in \
+              let sexp = MK_LIST in \
+              match sexp_stack with \
+              | [] -> Done (sexp, mk_parse_pos state (pos + 1)) \
+              | higher_rev_sexp_lst :: higher_sexp_stack -> \
+                  Buffer.clear pbuf; \
+                  let pstack = \
+                    (sexp :: higher_rev_sexp_lst) :: higher_sexp_stack \
+                  in \
+                  SET_PSTACK; \
+                  bump_pos_cont state str ~max_pos ~pos PARSE) \
+      | '\010' -> bump_found_atom bump_text_line state str ~max_pos ~pos PARSE \
+      | '\013' -> \
+          bump_found_atom bump_text_line state str ~max_pos ~pos parse_nl \
+      | ';' -> \
+          bump_found_atom bump_text_pos state str ~max_pos ~pos parse_comment \
+      | '"' -> \
+          bump_found_atom \
+            bump_text_pos state str ~max_pos ~pos reg_parse_quoted \
+      | c -> add_bump_pos state str ~max_pos ~pos c parse_atom \
+  \
+  and reg_parse_quoted state str ~max_pos ~pos = \
+    REGISTER_POS \
+    parse_quoted state str ~max_pos ~pos \
+  and parse_quoted state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_quoted" parse_quoted state \
+    else \
+      match GET_CHAR with \
+      | '"' -> \
+          let pbuf = state.pbuf in \
+          let pbuf_str = Buffer.contents pbuf in \
+          let atom = MK_ATOM in \
+          (match GET_PSTACK with \
+          | [] -> Done (atom, mk_parse_pos state (pos + 1)) \
+          | rev_sexp_lst :: sexp_stack -> \
+              Buffer.clear pbuf; \
+              let pstack = (atom :: rev_sexp_lst) :: sexp_stack in \
+              SET_PSTACK; \
+              bump_pos_cont state str ~max_pos ~pos PARSE) \
+      | '\\' -> bump_pos_cont state str ~max_pos ~pos parse_escaped \
+      | '\010' as c -> add_bump_line state str ~max_pos ~pos c parse_quoted \
+      | '\013' as c -> add_bump_line state str ~max_pos ~pos c parse_quoted_nl \
+      | c -> add_bump_pos state str ~max_pos ~pos c parse_quoted \
+  \
+  and parse_quoted_nl state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_quoted_nl" parse_quoted_nl state \
+    else \
+      let pos = \
+        let c = '\010' in \
+        if GET_CHAR = c then ( \
+          Buffer.add_char state.pbuf c; \
+          pos + 1 \
+        ) \
+        else pos \
+      in \
+      parse_quoted state str ~max_pos ~pos \
+  \
+  and parse_escaped state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_escaped" parse_escaped state \
+    else \
+      match GET_CHAR with \
+      | '\010' -> bump_line_cont state str ~max_pos ~pos parse_skip_ws \
+      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_skip_ws_nl \
+      | '0' .. '9' as c -> \
+          bump_text_pos state; \
+          let d = Char.code c - 48 in \
+          parse_dec state str ~max_pos ~pos:(pos + 1) ~count:2 ~d \
+      | 'x' -> \
+          bump_text_pos state; \
+          parse_hex state str ~max_pos ~pos:(pos + 1) ~count:2 ~d:0 \
+      | ('\\' | '"' | '\'' ) as c -> \
+          add_bump_pos state str ~max_pos ~pos c parse_quoted \
+      | 'n' -> add_bump_pos state str ~max_pos ~pos '\n' parse_quoted \
+      | 't' -> add_bump_pos state str ~max_pos ~pos '\t' parse_quoted \
+      | 'b' -> add_bump_pos state str ~max_pos ~pos '\b' parse_quoted \
+      | 'r' -> add_bump_pos state str ~max_pos ~pos '\r' parse_quoted \
+      | c -> \
+          Buffer.add_char state.pbuf '\\'; \
+          add_bump_pos state str ~max_pos ~pos c parse_quoted \
+  \
+  and parse_skip_ws state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_skip_ws" parse_skip_ws state \
+    else \
+      match GET_CHAR with \
+      | ' ' | '\009' -> bump_pos_cont state str ~max_pos ~pos parse_skip_ws \
+      | _ -> parse_quoted state str ~max_pos ~pos \
+  \
+  and parse_skip_ws_nl state str ~max_pos ~pos = \
+    if pos > max_pos then mk_cont "parse_skip_ws_nl" parse_skip_ws_nl state \
+    else \
+      let pos = if GET_CHAR = '\010' then pos + 1 else pos in \
+      parse_skip_ws state str ~max_pos ~pos \
+  \
+  and parse_dec state str ~max_pos ~pos ~count ~d = \
+    if pos > max_pos then mk_cont "parse_dec" (parse_dec ~count ~d) state \
+    else \
+      match GET_CHAR with \
+      | '0' .. '9' as c -> \
+          let d = 10 * d + Char.code c - 48 in \
+          if count = 1 then \
+            if d > 255 then \
+              let err_msg = sprintf "illegal decimal escape: \\%d" d in \
+              raise_parse_error (MK_PARSE_STATE state) "parse_dec" pos err_msg \
+            else \
+              add_bump_pos state str ~max_pos ~pos (Char.chr d) parse_quoted \
+          else ( \
+            bump_text_pos state; \
+            parse_dec state str ~max_pos ~pos:(pos + 1) ~count:(count - 1) ~d) \
+      | c -> raise_unexpected_char (MK_PARSE_STATE state) "parse_dec" pos c \
+  \
+  and parse_hex state str ~max_pos ~pos ~count ~d = \
+    if pos > max_pos then mk_cont "parse_hex" (parse_hex ~count ~d) state \
+    else \
+      match GET_CHAR with \
+      | '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' as c -> \
+          let corr = \
+            if c >= 'a' then 87 \
+            else if c >= 'A' then 55 \
+            else 48 \
+          in \
+          let d = 16 * d + Char.code c - corr in \
+          if count = 1 then \
+            if d > 255 then \
+              let err_msg = sprintf "illegal hexadecimal escape: \\%x" d in \
+              raise_parse_error (MK_PARSE_STATE state) "parse_hex" pos err_msg \
+            else \
+              add_bump_pos state str ~max_pos ~pos (Char.chr d) parse_quoted \
+          else ( \
+            bump_text_pos state; \
+            parse_hex state str ~max_pos ~pos:(pos + 1) ~count:(count - 1) ~d) \
+      | c -> raise_unexpected_char (MK_PARSE_STATE state) "parse_hex" pos c \
+  \
+  let PARSE ?(parse_pos = Parse_pos.create ()) ?len str = \
+    let pos = parse_pos.Parse_pos.buf_pos in \
+    let len = \
+      match len with \
+      | Some len -> len \
+      | None -> GET_LEN str - pos \
+    in \
+    let max_pos = check_str_bounds "parse" ~pos ~len str in \
+    let state = \
+      { \
+        parse_pos = parse_pos; \
+        pstack = INIT_PSTACK; \
+        pbuf = Buffer.create 128; \
+      } \
+    in \
+    PARSE state str ~max_pos ~pos
+
+MK_PARSER(
+  string, String.length, parse_str, str.[pos],
+  state.pstack, state.pstack <- pstack,
+  ,,
+  Atom pbuf_str, List sexp_lst, [], `Sexp
+)
+
+let parse = parse_str
+
+
+(* Annot parsers *)
+
+let get_glob_ofs parse_pos pos =
+  parse_pos.Parse_pos.global_offset + pos - parse_pos.Parse_pos.buf_pos
+
+let mk_annot_pos
+      ({ Parse_pos.text_line = line; text_char = col } as parse_pos) pos =
+  { Annot.line = line; col = col; offset = get_glob_ofs parse_pos pos }
+
+let mk_annot_pos1
+      ({ Parse_pos.text_line = line; text_char = col } as parse_pos) pos =
+  { Annot.line = line; col = col + 1; offset = get_glob_ofs parse_pos pos }
+
+let add_annot_pos { parse_pos = parse_pos; pstack = pstack } pos =
+  pstack.Annot.positions <- mk_annot_pos parse_pos pos :: pstack.Annot.positions
+
+let add_annot_pos1 { parse_pos = parse_pos; pstack = pstack } pos =
+  pstack.Annot.positions <-
+    mk_annot_pos1 parse_pos pos :: pstack.Annot.positions
+
+let get_annot_range { parse_pos = parse_pos; pstack = pstack } pos =
+  let start_pos =
+    match pstack.Annot.positions with
+    | [] -> assert false  (* impossible *)
+    | h :: t -> pstack.Annot.positions <- t; h
+  in
+  let end_pos =
+    {
+      Annot.
+      line = parse_pos.Parse_pos.text_line;
+      col = parse_pos.Parse_pos.text_char;
+      offset = get_glob_ofs parse_pos pos;
+    }
+  in
+  { Annot.start_pos = start_pos; end_pos = end_pos }
+
+let mk_annot_atom parse_state str pos =
+  Annot.Atom (get_annot_range parse_state pos, Atom str)
+
+let mk_annot_list parse_state annot_lst pos =
+  let range = get_annot_range parse_state pos in
+  let sexp = List (List.rev (List.rev_map Annot.get_sexp annot_lst)) in
+  Annot.List (range, annot_lst, sexp)
+
+let init_annot_pstate () = { Annot.positions = []; stack = [] }
+
+MK_PARSER(
+  string, String.length, parse_str_annot, str.[pos],
+  state.pstack.Annot.stack, state.pstack.Annot.stack <- pstack,
+  add_annot_pos state pos;,add_annot_pos1 state pos;,
+  mk_annot_atom state pbuf_str pos, mk_annot_list state sexp_lst pos,
+  init_annot_pstate (), `Annot
+)
+
+
+(* Partial parsing from bigstrings *)
+
+(* NOTE: this is really an awful duplication of the code for parsing
+   strings, but since OCaml does not inline higher-order functions known
+   at compile, other solutions would sacrifice a lot of efficiency. *)
+
+MK_PARSER(
+  bigstring, Array1.dim, parse_bigstring, str.{pos},
+  state.pstack, state.pstack <- pstack,
+  ,,
+  Atom pbuf_str, List sexp_lst, [], `Sexp
+)
+
+MK_PARSER(
+  bigstring, Array1.dim, parse_bigstring_annot, str.{pos},
+  state.pstack.Annot.stack, state.pstack.Annot.stack <- pstack,
+  add_annot_pos state pos;,add_annot_pos1 state pos;,
+  mk_annot_atom state pbuf_str pos, mk_annot_list state sexp_lst pos,
+  init_annot_pstate (), `Annot
+)
+
+
+(* Input functions *)
+
+let mk_this_parse ?parse_pos my_parse = (); fun ~pos ~len str ->
+  let parse_pos =
+    match parse_pos with
+    | None -> Parse_pos.create ~buf_pos:pos ()
+    | Some parse_pos -> parse_pos.Parse_pos.buf_pos <- pos; parse_pos
+  in
+  my_parse ?parse_pos:(Some parse_pos) ?len:(Some len) str
+
+let gen_input_sexp my_parse ?parse_pos ic =
+  let buf = String.create 1 in
+  let rec loop this_parse =
+    let c = input_char ic in
+    buf.[0] <- c;
+    match this_parse ~pos:0 ~len:1 buf with
+    | Done (sexp, _) -> sexp
+    | Cont (_, this_parse) -> loop this_parse
+  in
+  loop (mk_this_parse ?parse_pos my_parse)
+
+let input_sexp ?parse_pos ic = gen_input_sexp parse ?parse_pos ic
+
+let gen_input_rev_sexps my_parse ?parse_pos ?(buf = String.create 8192) ic =
+  let rev_sexps_ref = ref [] in
+  let buf_len = String.length buf in
+  let rec loop this_parse ~pos ~len ~is_incomplete =
+    if len > 0 then
+      match this_parse ~pos ~len buf with
+      | Done (sexp, ({ Parse_pos.buf_pos = buf_pos } as parse_pos)) ->
+          rev_sexps_ref := sexp :: !rev_sexps_ref;
+          let n_parsed = buf_pos - pos in
+          let this_parse = mk_this_parse ~parse_pos my_parse in
+          if n_parsed = len then
+            let new_len = input ic buf 0 buf_len in
+            loop this_parse ~pos:0 ~len:new_len ~is_incomplete:false
+          else
+            loop this_parse
+              ~pos:buf_pos ~len:(len - n_parsed) ~is_incomplete:false
+      | Cont (ws_only, this_parse) ->
+          loop this_parse
+            ~pos:0 ~len:(input ic buf 0 buf_len) ~is_incomplete:(not ws_only)
+    else if is_incomplete then
+      failwith
+        "Sexplib.Sexp.input_rev_sexps: reached EOF with incomplete S-expression"
+    else !rev_sexps_ref
+  in
+  let len = input ic buf 0 buf_len in
+  let this_parse = mk_this_parse ?parse_pos my_parse in
+  loop this_parse ~pos:0 ~len ~is_incomplete:false
+
+let input_rev_sexps ?parse_pos ?buf ic =
+  gen_input_rev_sexps parse ?parse_pos ?buf ic
+
+let input_sexps ?parse_pos ?buf ic =
+  List.rev (input_rev_sexps ?parse_pos ?buf ic)
+
+
+(* of_string and of_bigstring *)
+
+let of_string_bigstring loc this_parse ws_buf get_len get_sub str =
+  match this_parse str with
+  | Done (_, { Parse_pos.buf_pos = buf_pos }) when buf_pos <> get_len str ->
+      let prefix_len = min (get_len str - buf_pos) 20 in
+      let prefix = get_sub str buf_pos prefix_len in
+      let msg =
+        sprintf
+          "Sexplib.Sexp.%s: S-expression followed by data at position %d: %S..."
+          loc buf_pos prefix
+      in
+      failwith msg
+  | Done (sexp, _) -> sexp
+  | Cont (ws_only, this_parse) ->
+      if ws_only then failwith (sprintf "Sexplib.Sexp.%s: whitespace only" loc);
+      (* When parsing atoms, the incremental parser cannot tell whether
+         it is at the end until it hits whitespace.  We therefore feed
+         it one space to determine whether it is finished. *)
+      match this_parse ~pos:0 ~len:1 ws_buf with
+      | Done (sexp, _) -> sexp
+      | Cont _ ->
+          failwith (
+            sprintf "Sexplib.Sexp.%s: got incomplete S-expression: %s"
+              loc (get_sub str 0 (get_len str)))
+
+let of_string str =
+  of_string_bigstring "of_string" parse " " String.length String.sub str
+
+let get_bstr_sub_str bstr pos len =
+  let str = String.create len in
+  for i = 0 to len - 1 do str.[i] <- bstr.{pos + i} done;
+  str
+
+let bstr_ws_buf = Array1.create char c_layout 1
+let () = bstr_ws_buf.{0} <- ' '
+
+let of_bigstring bstr =
+  of_string_bigstring
+    "of_bigstring" parse_bigstring bstr_ws_buf Array1.dim get_bstr_sub_str bstr
+
+
+(* Loading *)
+
+let gen_load_rev_sexps input_rev_sexps ?buf file =
+  let ic = open_in file in
+  try
+    let sexps = input_rev_sexps ?parse_pos:None ?buf ic in
+    close_in ic;
+    sexps
+  with exc -> close_in_noerr ic; raise exc
+
+let load_rev_sexps ?buf file = gen_load_rev_sexps input_rev_sexps ?buf file
+
+let load_sexps ?buf file = List.rev (load_rev_sexps ?buf file)
+
+let gen_load_sexp my_parse ?(strict = true) ?(buf = String.create 8192) file =
+  let buf_len = String.length buf in
+  let ic = open_in file in
+  let rec loop this_parse =
+    let len = input ic buf 0 buf_len in
+    if len = 0 then
+      failwith (sprintf "Sexplib.Sexp.gen_load_sexp: end of file: %s" file)
+    else
+      match this_parse ~pos:0 ~len buf with
+      | Done (sexp, ({ Parse_pos.buf_pos = buf_pos } as parse_pos))
+        when strict ->
+          let rec strict_loop this_parse ~pos ~len =
+            match this_parse ~pos ~len buf with
+            | Done _ | Cont (false, _) ->
+                failwith (
+                  sprintf
+                    "Sexplib.Sexp.gen_load_sexp: more than one S-expression: %s"
+                      file)
+            | Cont (true, this_parse) ->
+                let len = input ic buf 0 buf_len in
+                if len = 0 then sexp
+                else strict_loop this_parse ~pos:0 ~len
+          in
+          let this_parse = mk_this_parse ~parse_pos my_parse in
+          strict_loop this_parse ~pos:buf_pos ~len:(len - buf_pos)
+      | Done (sexp, _) -> sexp
+      | Cont (_, this_parse) -> loop this_parse
+  in
+  try
+    let sexp = loop (mk_this_parse my_parse) in
+    close_in ic;
+    sexp
+  with exc -> close_in_noerr ic; raise exc
+
+let load_sexp ?strict ?buf file = gen_load_sexp parse ?strict ?buf file
+
+module Annotated = struct
+  include Annot
+
+  let parse = parse_str_annot
+  let parse_bigstring = parse_bigstring_annot
+
+  let input_rev_sexps ?parse_pos ?buf ic =
+    gen_input_rev_sexps parse ?parse_pos ?buf ic
+
+  let input_sexp ?parse_pos ic = gen_input_sexp parse ?parse_pos ic
+
+  let input_sexps ?parse_pos ?buf ic =
+    List.rev (input_rev_sexps ?parse_pos ?buf ic)
+
+  let of_string str =
+    of_string_bigstring
+      "Annotated.of_string" parse " " String.length String.sub str
+
+  let of_bigstring bstr =
+    of_string_bigstring
+      "Annotated.of_bigstring"
+      parse_bigstring bstr_ws_buf Array1.dim get_bstr_sub_str bstr
+
+  let load_rev_sexps ?buf file = gen_load_rev_sexps input_rev_sexps ?buf file
+  let load_sexps ?buf file = List.rev (load_rev_sexps ?buf file)
+  let load_sexp ?strict ?buf file = gen_load_sexp parse ?strict ?buf file
+
+  let conv f annot_sexp =
+    let sexp = get_sexp annot_sexp in
+    try `Result (f sexp)
+    with Of_sexp_error (exc, bad_sexp) as e ->
+      match find_sexp annot_sexp bad_sexp with
+      | None -> raise e
+      | Some bad_annot_sexp -> `Error (exc, bad_annot_sexp)
+
+  let get_conv_exn ~file ~exc annot_sexp =
+    let range = get_range annot_sexp in
+    let { start_pos = { line = line; col = col } } = range in
+    let loc = sprintf "%s:%d:%d" file line col in
+    Of_sexp_error (Annot.Conv_exn (loc, exc), get_sexp annot_sexp)
+end
+
+let load_sexp_conv ?(strict = true) ?(buf = String.create 8192) file f =
+  let sexp = load_sexp ~strict ~buf file in
+  try `Result (f sexp)
+  with Of_sexp_error _ ->
+    Annotated.conv f (Annotated.load_sexp ~strict ~buf file)
+
+let raise_conv_exn ~file = function
+  | `Result res -> res
+  | `Error (exc, annot_sexp) ->
+      raise (Annotated.get_conv_exn ~file ~exc annot_sexp)
+
+let load_sexp_conv_exn ?strict ?buf file f =
+  raise_conv_exn ~file (load_sexp_conv ?strict ?buf file f)
+
+let load_sexps_conv ?(buf = String.create 8192) file f =
+  let rev_sexps = load_rev_sexps ~buf file in
+  try List.rev_map (fun sexp -> `Result (f sexp)) rev_sexps
+  with Of_sexp_error _ as e ->
+    match Annotated.load_rev_sexps ~buf file with
+    | [] ->
+        (* File is now empty - perhaps it was a temporary file handle? *)
+        raise e
+    | rev_annot_sexps ->
+        List.rev_map (fun annot_sexp -> Annotated.conv f annot_sexp)
+          rev_annot_sexps
+
+let load_sexps_conv_exn ?(buf = String.create 8192) file f =
+  let rev_sexps = load_rev_sexps ~buf file in
+  try List.rev_map f rev_sexps
+  with Of_sexp_error _ as e ->
+    match Annotated.load_rev_sexps ~buf file with
+    | [] ->
+        (* File is now empty - perhaps it was a temporary file handle? *)
+        raise e
+    | rev_annot_sexps ->
+        List.rev_map
+          (fun annot_sexp -> raise_conv_exn ~file (Annotated.conv f annot_sexp))
+          rev_annot_sexps
+
+let gen_of_string_conv of_string annot_of_string str f =
+  let sexp = of_string str in
+  try `Result (f sexp)
+  with Of_sexp_error _ -> Annotated.conv f (annot_of_string str)
+
+let of_string_conv str f =
+  gen_of_string_conv of_string Annotated.of_string str f
+
+let of_bigstring_conv bstr f =
+  gen_of_string_conv of_bigstring Annotated.of_bigstring bstr f
+
+module Of_string_conv_exn = struct
+  type t = { exc : exn; sexp : Type.t; sub_sexp : Type.t }
+
+  exception E of t
+end
+
+let gen_of_string_conv_exn of_string str f =
+  let sexp = of_string str in
+  try f sexp
+  with Of_sexp_error (exc, sub_sexp) ->
+    raise (Of_string_conv_exn.E { Of_string_conv_exn.exc = exc; sexp = sexp; sub_sexp = sub_sexp })
+
+let of_string_conv_exn str f = gen_of_string_conv_exn of_string str f
+let of_bigstring_conv_exn bstr f = gen_of_string_conv_exn of_bigstring bstr f
+
+
+(* Utilities for automated type conversions *)
+
+let unit = List []
+
+external sexp_of_t : t -> t = "%identity"
+external t_of_sexp : t -> t = "%identity"
+
+
+(* Utilities for conversion error handling *)
+
+type found = [ `Found | `Pos of int * found ]
+type search_result = [ `Not_found | found ]
+
+let rec search_physical sexp ~contained =
+  if sexp == contained then `Found
+  else
+    match sexp with
+    | Atom _ -> `Not_found
+    | List lst ->
+        let rec loop i = function
+          | [] -> `Not_found
+          | h :: t ->
+              let res = search_physical h ~contained in
+              match res with
+              | `Not_found -> loop (i + 1) t
+              | #found as found -> `Pos (i, found)
+        in
+        loop 0 lst
+
+let rec subst_found sexp ~subst = function
+  | `Found -> subst
+  | `Pos (pos, found) ->
+      match sexp with
+      | Atom _ ->
+          failwith
+            "Sexplib.Sexp.subst_search_result: atom when position requested"
+      | List lst ->
+          let rec loop acc pos = function
+            | [] ->
+                failwith
+                  "Sexplib.Sexp.subst_search_result: \
+                  short list when position requested"
+            | h :: t when pos <> 0 -> loop (h :: acc) (pos - 1) t
+            | h :: t ->
+                List (List.rev_append acc (subst_found h ~subst found :: t))
+          in
+          loop [] pos lst
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/sexp.ml b/bundles/sexplib/sexplib-7.0.5/lib/sexp.ml
new file mode 100644 (file)
index 0000000..6fa4a7c
--- /dev/null
@@ -0,0 +1,25 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+include Pre_sexp
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/sexp.mli b/bundles/sexplib/sexplib-7.0.5/lib/sexp.mli
new file mode 100644 (file)
index 0000000..3376f1b
--- /dev/null
@@ -0,0 +1,27 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Sexp: Module for handling S-expressions (I/O, etc.) *)
+
+include Sexp_intf.S
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/sexp_intf.ml b/bundles/sexplib/sexplib-7.0.5/lib/sexp_intf.ml
new file mode 100644 (file)
index 0000000..2606cc7
--- /dev/null
@@ -0,0 +1,594 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Sexp_intf: interface specification for handling S-expressions (I/O, etc.) *)
+
+open Format
+open Bigarray
+
+module type S = sig
+
+  (** Type of S-expressions *)
+  type t = Type.t = Atom of string | List of t list
+
+  (** Type of bigstrings *)
+  type bigstring = (char, int8_unsigned_elt, c_layout) Array1.t
+
+
+  (** {6 Defaults} *)
+
+  val default_indent : int ref
+  (** [default_indent] reference to default indentation level for
+      human-readable conversions.  Initialisation value: 2. *)
+
+
+  (** {6 S-expression size} *)
+
+  val size : t -> int * int
+  (** [size sexp] @return [(n_atoms, n_chars)], where [n_atoms] is
+      the number of atoms in S-expression [sexp], and [n_chars] is the
+      number of characters in the atoms of the S-expression. *)
+
+
+  (** {6 Scan functions} *)
+
+  val scan_sexp : ?buf : Buffer.t -> Lexing.lexbuf -> t
+  (** [scan_sexp ?buf lexbuf] scans an S-expression from lex buffer
+      [lexbuf] using the optional string buffer [buf] for storing
+      intermediate strings. *)
+
+  val scan_sexps : ?buf : Buffer.t -> Lexing.lexbuf -> t list
+  (** [scan_sexps ?buf lexbuf] reads a list of whitespace separated
+      S-expressions from lex buffer [lexbuf] using the optional string
+      buffer [buf] for storing intermediate strings. *)
+
+  val scan_iter_sexps :
+    ?buf : Buffer.t -> f : (t -> unit) -> Lexing.lexbuf -> unit
+  (** [scan_iter_sexps ?buf ~f lexbuf] iterates over all whitespace
+      separated S-expressions scanned from lex buffer [lexbuf] using
+      function [f], and the optional string buffer [buf] for storing
+      intermediate strings. *)
+
+  val scan_fold_sexps :
+    ?buf : Buffer.t -> f : ('a -> t -> 'a) -> init : 'a -> Lexing.lexbuf -> 'a
+  (** [scan_fold_sexps ?buf ~f ~init lexbuf] folds over all whitespace
+      separated S-expressions scanned from lex buffer [lexbuf] using
+      function [f], initial state [init], and the optional string buffer
+      [buf] for storing intermediate strings. *)
+
+  val scan_sexps_conv :
+    ?buf : Buffer.t -> f : (t -> 'a) -> Lexing.lexbuf -> 'a list
+  (** [scan_sexps_conv ?buf ~f lexbuf] maps all whitespace separated
+      S-expressions scanned from lex buffer [lexbuf] to some list using
+      function [f], and the optional string buffer [buf] for storing
+      intermediate strings. *)
+
+
+  (** {6 Type and exception definitions for (partial) parsing} *)
+
+  module Parse_pos : sig
+    (** Position information after complete parse *)
+    type t = Pre_sexp.Parse_pos.t =
+      private
+        {
+          mutable text_line : int;  (** Line position in parsed text *)
+          mutable text_char : int;  (** Character position in parsed text *)
+          mutable global_offset : int;  (** Global/logical offset *)
+          mutable buf_pos : int;  (** Read position in string buffer *)
+        }
+
+    val create :
+      ?text_line : int -> ?text_char : int ->
+      ?buf_pos : int -> ?global_offset : int -> unit -> t
+    (** [create ?text_line ?text_char ?buf_pos ?global_offset ()] @return
+        a parse position with the given parameters.
+
+        @param text_line default = [1]
+        @param text_char default = [0]
+        @param global_offset default = [0]
+        @param buf_pos default = [0]
+    *)
+
+    val with_buf_pos : t -> int -> t
+    (** [with_buf_pos t pos] @return a copy of the parse position [t] where
+        [buf_pos] is set to [pos]. *)
+  end
+
+  (** Type of result from calling {!Sexp.parse}. *)
+  type ('a, 't) parse_result = ('a, 't) Pre_sexp.parse_result =
+    | Done of 't * Parse_pos.t  (** [Done (t, parse_pos)] finished parsing
+                                    an S-expression.  Current parse position
+                                    is [parse_pos]. *)
+    | Cont of bool * ('a, 't) parse_fun
+      (** [Cont (ws_only, parse_fun)] met the end of input before completely
+          parsing an S-expression.  The user has to call [parse_fun] to
+          continue parsing the S-expression in another buffer.  If [ws_only]
+          is true, only whitespace has been parsed so far (or comments!).
+          NOTE: the continuation may only be called once and will raise
+          [Failure] otherwise! *)
+
+  (** Type of parsing functions with given offsets and lengths. *)
+  and ('a, 't) parse_fun = pos : int -> len : int -> 'a -> ('a, 't) parse_result
+
+  (** Module for parsing S-expressions annotated with location information *)
+  module Annotated : sig
+    (** Position information for annotated S-expressions *)
+    type pos = Pre_sexp.Annotated.pos = {
+      line : int;
+      col : int;
+      offset : int;
+    }
+
+    (** Range information for annotated S-expressions *)
+    type range = Pre_sexp.Annotated.range = { start_pos : pos; end_pos : pos }
+
+    (** S-expression annotated with location information *)
+    type t = Pre_sexp.Annotated.t =
+      | Atom of range * Type.t
+      | List of range * t list * Type.t
+
+    (** Type of conversion results of annotated S-expressions. *)
+    type 'a conv = [ `Result of 'a | `Error of exn * t ]
+
+    (** Exception associated with conversion errors.  First argument describes
+        the location, the second the reason. *)
+    exception Conv_exn of string * exn
+
+    (** Stack used by annotation parsers *)
+    type stack = Pre_sexp.Annotated.stack = {
+      mutable positions : pos list;
+      mutable stack : t list list;
+    }
+
+    val get_sexp : t -> Type.t
+    (** [get_sexp annot_sexp] @return S-expression associated with annotated
+        S-expression [annot_sexp]. *)
+
+    val get_range : t -> range
+    (** [get_range annot_sexp] @return the range associated with annotated
+        S-expression [annot_sexp]. *)
+
+    val find_sexp : t -> Type.t -> t option
+    (** [find_sexp annot_sexp sexp] @return [Some res] where [res] is the
+        annotated S-expression that is physically equivalent to [sexp] in
+        [annot_sexp], or [None] if there is no such S-expression. *)
+
+
+    (** {6 Annotated (partial) parsing} *)
+
+    val parse :
+      ?parse_pos : Parse_pos.t -> ?len : int -> string
+      -> (string, t) parse_result
+    (** [parse ?parse_pos ?len str] same as {!parse}, but returns an
+        S-expression annotated with location information. *)
+
+    val parse_bigstring :
+      ?parse_pos : Parse_pos.t -> ?len : int -> bigstring
+      -> (bigstring, t) parse_result
+    (** [parse_bigstring ?parse_pos ?len str] same as {!parse_bigstring},
+        but returns an S-expression annotated with location information. *)
+
+    val input_sexp : ?parse_pos : Parse_pos.t -> in_channel -> t
+    (** [input_sexp ?parse_pos ic] like {!input_sexp}, but returns an
+        annotated S-expression instead. *)
+
+    val input_sexps :
+      ?parse_pos : Parse_pos.t -> ?buf : string -> in_channel -> t list
+    (** [input_sexps ?parse_pos ?buf ic] like {!input_sexps}, but returns
+        a list of annotated S-expressions. *)
+
+    val input_rev_sexps :
+      ?parse_pos : Parse_pos.t -> ?buf : string -> in_channel -> t list
+    (** [input_sexps ?parse_pos ?buf ic] like {!input_rev_sexps}, but
+        returns a list of annotated S-expressions. *)
+
+
+    (** {6 Loading of annotated S-expressions} *)
+
+    (** NOTE: these functions should only be used if an annotated S-expression
+        is required. *)
+
+    val load_sexp : ?strict : bool -> ?buf : string -> string -> t
+    (** [load_sexp ?strict ?buf file] like {!load_sexp}, but returns an
+        annotated S-expression. *)
+
+    val load_sexps : ?buf : string -> string -> t list
+    (** [load_sexps ?buf file] like {!load_sexps}, but returns a list of
+        annotated S-expressions. *)
+
+    val load_rev_sexps : ?buf : string -> string -> t list
+    (** [load_rev_sexps ?buf file] like {!load_rev_sexps}, but returns a
+        list of annotated S-expressions. *)
+
+
+    (** {6 String and bigstring conversions} *)
+
+    val of_string : string -> t
+    (** [of_string str] same as {!of_string}, but returns an annotated
+        S-expression. *)
+
+    val of_bigstring : bigstring -> t
+    (** [of_bigstring bstr] same as {!of_string}, but operates on bigstrings. *)
+
+
+    (** Converters using annotations for determining error locations *)
+
+    val conv : (Type.t -> 'a) -> t -> 'a conv
+    (** [conv f annot_sexp] converts the S-expression associated with
+        annotated S-expression [annot_sexp] using [f].  @return [`Result
+        res] on success, or [`Error (exn, sub_annot_sexp)] otherwise, where
+        [exn] is the exception associated with the conversion error, and
+        [sub_annot_sexp] is the annotated S-expression on which conversion
+        failed. *)
+
+    val get_conv_exn : file : string -> exc : exn -> t -> exn
+    (** [get_conv_exn ~file ~exc annot_sexp] @return the exception that
+        would be raised for a given [file] and exception [exc]
+        if conversion had failed on annotated S-expression [annot_sexp].
+        The format of the exception message is "file:line:col" *)
+  end
+
+  (** Type of state maintained during parsing *)
+  type 't parse_state = 't Pre_sexp.parse_state =
+    private
+      {
+        parse_pos : Parse_pos.t;  (** Current parse position *)
+        mutable pstack : 't;  (** Stack of found S-expression lists *)
+        pbuf : Buffer.t;  (** Current atom buffer *)
+      }
+
+  (** Type of parse errors *)
+  type parse_error = Pre_sexp.parse_error =
+    {
+      location : string;  (** Function in which the parse failed *)
+      err_msg : string;  (** Reason why parsing failed *)
+      parse_state :
+        [
+        | `Sexp of t list list parse_state
+        | `Annot of Annotated.stack parse_state
+        ]
+        (** State of parser *)
+    }
+
+  (** Exception raised during partial parsing *)
+  exception Parse_error of parse_error
+
+
+  (** {6 Unannotated (partial) parsing} *)
+
+  val parse :
+    ?parse_pos : Parse_pos.t -> ?len : int -> string -> (string, t) parse_result
+  (** [parse ?parse_pos ?len str] (partially) parses an S-expression in
+      string buffer [str] starting out with position information provided in
+      [parse_pos] and reading at most [len] characters.  To parse a single
+      atom that is not delimited by whitespace it is necessary to call this
+      function a second time with the returned continuation, and a dummy
+      buffer that contains whitespace.
+
+      @param parse_pos default = [Parse_pos.create ()]
+      @param len default = [String.length str - parse_pos.Parse_pos.buf_pos]
+  *)
+
+  val parse_bigstring :
+    ?parse_pos : Parse_pos.t -> ?len : int -> bigstring
+    -> (bigstring, t) parse_result
+  (** [parse_bigstring ?parse_pos ?len str] same as {!parse}, but operates on
+      bigstrings. *)
+
+  val input_sexp : ?parse_pos : Parse_pos.t -> in_channel -> t
+  (** [input_sexp ?parse_pos ic] parses an S-expression from input channel
+      [ic] using initial position information in [parse_pos].  NOTE: this
+      function is not as fast on files as {!Sexp.load_sexp}, and is also
+      slightly slower than the scan-functions.  But it is guaranteed that
+      [input_sexp] is only going to read data parseable as an S-expression.
+      Thus, subsequent input functions will see the data immediately
+      following it.
+
+      @param parse_pos default = [Parse_pos.create ()]
+  *)
+
+  val input_sexps :
+    ?parse_pos : Parse_pos.t -> ?buf : string -> in_channel -> t list
+  (** [input_sexps ?parse_pos ?buf ic] parses whitespace separated
+      S-expressions from input channel [ic] until EOF is reached.  Faster than
+      the scan-functions.
+
+      @param parse_pos default = [Parse_pos.create ()]
+  *)
+
+  val input_rev_sexps :
+    ?parse_pos : Parse_pos.t -> ?buf : string -> in_channel -> t list
+  (** [input_rev_sexps ?parse_pos ?buf ic] same as {!Sexp.input_sexps},
+      but returns a reversed list of S-expressions, which is slightly more
+      efficient. *)
+
+
+  (** {6 Loading of (converted) S-expressions} *)
+
+  val load_sexp : ?strict : bool -> ?buf : string -> string -> t
+  (** [load_sexp ?strict ?buf file] reads one S-expression from [file] using
+      buffer [buf] for storing intermediate data.  Faster than the
+      scan-functions.
+
+      @raise Parse_error if the S-expression is unparseable.
+
+      @raise Failure if parsing reached the end of file before one S-expression
+      could be read.
+
+      @raise Failure if [strict] is true and there is more than one
+      S-expression in the file.
+
+      @param strict default = [true]
+  *)
+
+  val load_sexps : ?buf : string -> string -> t list
+  (** [load_sexps ?buf file] reads a list of whitespace separated S-expressions
+      from [file] using buffer [buf] for storing intermediate data.
+      Faster than the scan-functions.
+
+      @raise Parse_error if there is unparseable data in the file.
+
+      @raise Failure if parsing reached the end of file before the last
+      S-expression could be fully read.
+  *)
+
+  val load_rev_sexps : ?buf : string -> string -> t list
+  (** [load_rev_sexps ?buf file] same as {!Sexp.load_sexps}, but returns a
+      reversed list of S-expressions, which is slightly more efficient. *)
+
+  val load_sexp_conv :
+    ?strict : bool -> ?buf : string -> string -> (t -> 'a) -> 'a Annotated.conv
+  (** [load_sexp_conv ?strict ?buf file f] like {!Sexp.load_sexp}, but
+      performs a conversion on the fly using [f].  Performance is equivalent
+      to executing {!Sexp.load_sexp} and performing conversion when there
+      are no errors.  In contrast to the plain S-expression loader, this
+      function not only performs the conversion, it will give exact error
+      ranges for conversion errors.
+
+      @raise Parse_error if there is unparseable data in the file.
+
+      @raise Failure if parsing reached the end of file before the last
+      S-expression could be fully read.
+  *)
+
+  val load_sexp_conv_exn :
+    ?strict : bool -> ?buf : string -> string -> (t -> 'a) -> 'a
+  (** [load_sexp_conv_exn ?strict ?buf file f] like {!load_sexp_conv},
+      but returns the converted value or raises [Of_sexp_error] with exact
+      location information in the case of a conversion error. *)
+
+  val load_sexps_conv :
+    ?buf : string -> string -> (t -> 'a) -> 'a Annotated.conv list
+  (** [load_sexps_conv ?buf file f] like {!Sexp.load_sexps}, but performs
+      a conversion on the fly using [f].  Performance is equivalent to
+      executing {!Sexp.load_sexps} and performing conversion when there
+      are no errors.  In contrast to the plain S-expression loader, this
+      function not only performs the conversion, it will give exact error
+      ranges for conversion errors.
+
+      @raise Parse_error if there is unparseable data in the file.
+
+      @raise Failure if parsing reached the end of file before the last
+      S-expression could be fully read.
+  *)
+
+  val load_sexps_conv_exn : ?buf : string -> string -> (t -> 'a) -> 'a list
+  (** [load_sexps_conv_exn ?buf file f] like {!load_sexps_conv}, but returns
+      the converted value or raises [Of_sexp_error] with exact location
+      information in the case of a conversion error. *)
+
+
+  (** {6 Output of S-expressions to I/O-channels} *)
+
+  (** NOTE: for performance reasons these output functions may need to
+      allocate large strings to write out huge S-expressions.  This may
+      cause problems on 32-bit platforms.  If you think that you may need to
+      write huge S-expressions on such platforms, you might want to use the
+      pretty-printers that write to formatters instead (see further below). *)
+
+  val output_hum : out_channel -> t -> unit
+  (** [output_hum oc sexp] outputs S-expression [sexp] to output channel
+      [oc] in human readable form. *)
+
+  val output_hum_indent : int -> out_channel -> t -> unit
+  (** [output_hum_indent indent oc sexp] outputs S-expression [sexp]
+      to output channel [oc] in human readable form using indentation level
+      [indent].
+  *)
+
+  val output_mach : out_channel -> t -> unit
+  (** [output_mach oc sexp] outputs S-expression [sexp] to output channel
+      [oc] in machine readable (i.e. most compact) form. *)
+
+  val output : out_channel -> t -> unit
+  (** [output oc sexp] same as [output_mach]. *)
+
+
+  (** {6 Output of S-expressions to file} *)
+
+  (** All save-functions write to a temporary file before moving it into
+      place to avoid intermittent garbling of existing files, which may
+      cause problems for other processes that try to read. *)
+
+  val save_hum : ?perm : int -> string -> t -> unit
+  (** [save_hum ?perm file sexp] outputs S-expression [sexp] to [file] in human
+      readable form.
+
+      @param perm default = umask
+  *)
+
+  val save_mach : ?perm : int -> string -> t -> unit
+  (** [save_mach ?perm file sexp] outputs S-expression [sexp] to [file]
+      in machine readable (i.e. most compact) form.
+
+      @param perm default = umask
+  *)
+
+  val save : ?perm : int -> string -> t -> unit
+  (** [save ?perm file sexp] same as {!save_mach}. *)
+
+  val save_sexps_hum : ?perm : int -> string -> t list -> unit
+  (** [save_sexps_hum ?perm file sexps] outputs S-expression list [sexps] to
+      [file] in human readable form, each sexp being followed by a newline.
+
+      @param perm default = umask
+  *)
+
+  val save_sexps_mach : ?perm : int -> string -> t list -> unit
+  (** [save_sexps_mach ?perm file sexps] outputs S-expression list [sexps] to
+      [file] in machine readable form, each sexp being followed by a
+      newline.
+
+      @param perm default = umask
+  *)
+
+  val save_sexps : ?perm : int -> string -> t list -> unit
+  (** [save_sexps ?perm file sexp] same as {!save_sexps_mach}. *)
+
+
+  (** {6 Output of S-expressions to formatters} *)
+
+  val pp_hum : formatter -> t -> unit
+  (** [pp_hum ppf sexp] outputs S-expression [sexp] to formatter [ppf]
+      in human readable form. *)
+
+  val pp_hum_indent : int -> formatter -> t -> unit
+  (** [pp_hum_indent n ppf sexp] outputs S-expression [sexp] to formatter
+      [ppf] in human readable form and indentation level [n]. *)
+
+  val pp_mach : formatter -> t -> unit
+  (** [pp_mach ppf sexp] outputs S-expression [sexp] to formatter [ppf]
+      in machine readable (i.e. most compact) form. *)
+
+  val pp : formatter -> t -> unit
+  (** [pp ppf sexp] same as [pp_mach]. *)
+
+
+  (** {6 String and bigstring conversions} *)
+
+  (** Module encapsulating the exception raised by string converters when
+      type conversions fail. *)
+  module Of_string_conv_exn : sig
+    type t = { exc : exn; sexp : Type.t; sub_sexp : Type.t }
+
+    exception E of t
+  end
+
+  val of_string : string -> t
+  (** [of_string str] converts string [str] to an S-expression.  NOTE:
+      trailing whitespace is considered an error, which may be overly
+      strict for some applications.  Either strip the string of trailing
+      whitespace first, or, even cheaper, use {!parse} instead. *)
+
+  val of_string_conv : string -> (t -> 'a) -> 'a Annotated.conv
+  (** [of_string_conv str conv] like {!of_string}, but performs type conversion
+      with [conv].  @return conversion result. *)
+
+  val of_string_conv_exn : string -> (t -> 'a) -> 'a
+  (** [of_string_conv_exn str conv] like {!of_string_conv}, but raises
+      {!Of_string_conv_exn.E} if type conversion fails.  @return converted
+      value. *)
+
+  val of_bigstring : bigstring -> t
+  (** [of_bigstring bstr] same as {!of_string}, but operates on bigstrings. *)
+
+  val of_bigstring_conv : bigstring -> (t -> 'a) -> 'a Annotated.conv
+  (** [of_bigstring_conv bstr conv] like {!of_bigstring}, but performs
+      type conversion with [conv].  @return conversion result. *)
+
+  val of_bigstring_conv_exn : bigstring -> (t -> 'a) -> 'a
+  (** [of_bigstring_conv_exn bstr conv] like {!of_bigstring_conv}, but raises
+      {!Of_string_conv_exn.E} if type conversion fails.  @return converted
+      value. *)
+
+  val to_string_hum : ?indent : int -> t -> string
+  (** [to_string_hum ?indent sexp] converts S-expression [sexp] to a
+      string in human readable form with indentation level [indent].
+
+      @param indent default = [!default_indent]
+  *)
+
+  val to_string_mach : t -> string
+  (** [to_string_mach sexp] converts S-expression [sexp] to a string in
+      machine readable (i.e. most compact) form. *)
+
+  val to_string : t -> string
+  (** [to_string sexp] same as [to_string_mach]. *)
+
+
+  (** {6 Buffer conversions} *)
+
+  val to_buffer_hum : buf : Buffer.t -> ?indent : int -> t -> unit
+  (** [to_buffer_hum ~buf ?indent sexp] outputs the S-expression [sexp]
+      converted to a string in human readable form to buffer [buf].
+
+      @param indent default = [!default_indent]
+  *)
+
+  val to_buffer_mach : buf : Buffer.t -> t -> unit
+  (** [to_buffer_mach ~buf sexp] outputs the S-expression [sexp] converted
+      to a string in machine readable (i.e. most compact) form to buffer [buf].
+  *)
+
+  val to_buffer : buf : Buffer.t -> t -> unit
+  (** [to_buffer ~buf sexp] same as {!to_buffer_mach}. *)
+
+
+  (** {6 Utilities for automated type conversions} *)
+
+  val unit : t
+  (** [unit] the unit-value as expressed by an S-expression. *)
+
+  external sexp_of_t : t -> t = "%identity"
+  (** [sexp_of_t sexp] maps S-expressions which are part of a type with
+      automated S-expression conversion to themselves. *)
+
+  external t_of_sexp : t -> t = "%identity"
+  (** [t_of_sexp sexp] maps S-expressions which are part of a type with
+      automated S-expression conversion to themselves. *)
+
+
+  (** {6 Utilities for conversion error handling} *)
+
+  type found = [ `Found | `Pos of int * found ]
+  (** Type of successful search results.  [`Found] means that an
+      S-expression was found at the immediate position, and [`Pos (pos,
+      found)] indicates that it was found at position [pos] within a
+      structure (= S-expression list) where [found] describes recursively
+      where it was found in that structure. *)
+
+  type search_result = [ `Not_found | found ]
+  (** Type of search results.  [`Not_found] means that an
+      S-expression was not found within another S-expression. *)
+
+  val search_physical : t -> contained : t -> search_result
+  (** [search_physical sexp ~contained] @return the search result
+      indicating whether, and if, where the S-expression [contained]
+      was found within S-expression [sexp]. *)
+
+  val subst_found : t -> subst : t -> found -> t
+  (** [subst_found sexp ~subst found] @return the S-expression that
+      results from substituting [subst] within S-expression [sexp]
+      at the location described by [found]. *)
+end
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/sexplib.mlpack b/bundles/sexplib/sexplib-7.0.5/lib/sexplib.mlpack
new file mode 100644 (file)
index 0000000..fdd87c2
--- /dev/null
@@ -0,0 +1,14 @@
+# OASIS_START
+# DO NOT EDIT (digest: 407448bac4af757fbf386dc9e6e95264)
+Type
+Parser
+Lexer
+Pre_sexp
+Sexp_intf
+Sexp
+Path
+Conv
+Conv_error
+Exn_magic
+Std
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/sexplib.odocl b/bundles/sexplib/sexplib-7.0.5/lib/sexplib.odocl
new file mode 100644 (file)
index 0000000..4940393
--- /dev/null
@@ -0,0 +1,14 @@
+# OASIS_START
+# DO NOT EDIT (digest: b651711e3df0db633d7b7a99717aabde)
+Type
+Parser
+Lexer
+Pre_sexp
+Sexp_intf
+Sexp
+Path
+Conv
+Conv_error
+Exn_magic
+Std
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/std.ml b/bundles/sexplib/sexplib-7.0.5/lib/std.ml
new file mode 100644 (file)
index 0000000..76b531d
--- /dev/null
@@ -0,0 +1,109 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+module Hashtbl = struct
+  include Hashtbl
+
+  let sexp_of_t = Conv.sexp_of_hashtbl
+  let t_of_sexp = Conv.hashtbl_of_sexp
+end
+
+module Big_int = struct
+  include Big_int
+
+  let sexp_of_big_int = Conv.sexp_of_big_int
+  let big_int_of_sexp = Conv.big_int_of_sexp
+end
+
+module Nat = struct
+  include Nat
+
+  let sexp_of_nat = Conv.sexp_of_nat
+  let nat_of_sexp = Conv.nat_of_sexp
+end
+
+module Num = struct
+  include Num
+
+  let sexp_of_num = Conv.sexp_of_num
+  let num_of_sexp = Conv.num_of_sexp
+end
+
+module Ratio = struct
+  include Ratio
+
+  let sexp_of_ratio = Conv.sexp_of_ratio
+  let ratio_of_sexp = Conv.ratio_of_sexp
+end
+
+module Lazy = struct
+  include Lazy
+
+  let t_of_sexp = Conv.lazy_t_of_sexp
+  let sexp_of_t = Conv.sexp_of_lazy_t
+end
+
+let sexp_of_unit = Conv.sexp_of_unit
+let unit_of_sexp = Conv.unit_of_sexp
+
+let bool_of_sexp = Conv.bool_of_sexp
+let sexp_of_bool = Conv.sexp_of_bool
+
+let string_of_sexp = Conv.string_of_sexp
+let sexp_of_string = Conv.sexp_of_string
+
+let char_of_sexp = Conv.char_of_sexp
+let sexp_of_char = Conv.sexp_of_char
+
+let int_of_sexp = Conv.int_of_sexp
+let sexp_of_int = Conv.sexp_of_int
+
+let float_of_sexp = Conv.float_of_sexp
+let sexp_of_float = Conv.sexp_of_float
+
+let int32_of_sexp = Conv.int32_of_sexp
+let sexp_of_int32 = Conv.sexp_of_int32
+
+let int64_of_sexp = Conv.int64_of_sexp
+let sexp_of_int64 = Conv.sexp_of_int64
+
+let nativeint_of_sexp = Conv.nativeint_of_sexp
+let sexp_of_nativeint = Conv.sexp_of_nativeint
+
+let sexp_of_ref = Conv.sexp_of_ref
+let ref_of_sexp = Conv.ref_of_sexp
+
+let sexp_of_lazy_t = Conv.sexp_of_lazy_t
+let lazy_t_of_sexp = Conv.lazy_t_of_sexp
+
+let option_of_sexp = Conv.option_of_sexp
+let sexp_of_option = Conv.sexp_of_option
+
+let list_of_sexp = Conv.list_of_sexp
+let sexp_of_list = Conv.sexp_of_list
+
+let array_of_sexp = Conv.array_of_sexp
+let sexp_of_array = Conv.sexp_of_array
+
+let sexp_of_exn = Conv.sexp_of_exn
diff --git a/bundles/sexplib/sexplib-7.0.5/lib/type.ml b/bundles/sexplib/sexplib-7.0.5/lib/type.ml
new file mode 100644 (file)
index 0000000..4a64b3b
--- /dev/null
@@ -0,0 +1,26 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Type of S-expressions *)
+type t = Atom of string | List of t list
diff --git a/bundles/sexplib/sexplib-7.0.5/lib_test/Makefile b/bundles/sexplib/sexplib-7.0.5/lib_test/Makefile
new file mode 100644 (file)
index 0000000..693bc70
--- /dev/null
@@ -0,0 +1,27 @@
+export OCAMLMAKEFILE = ../OCamlMakefile
+
+export INCDIRS = ../lib
+export LIBDIRS = ../lib
+export LIBS = sexplib
+export PACKS = unix bigarray num
+
+define PROJ_sub1
+  SOURCES = conv_test.ml
+  RESULT = conv_test
+endef
+export PROJ_sub1
+
+define PROJ_sub2
+  SOURCES = sexp_test.ml
+  RESULT = sexp_test
+endef
+export PROJ_sub2
+
+ifndef SUBPROJS
+  export SUBPROJS = sub1 sub2
+endif
+
+all:   bc
+
+%:
+       @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@
diff --git a/bundles/sexplib/sexplib-7.0.5/lib_test/OMakefile b/bundles/sexplib/sexplib-7.0.5/lib_test/OMakefile
new file mode 100644 (file)
index 0000000..65baa82
--- /dev/null
@@ -0,0 +1,7 @@
+OCAML_LIBRARIES = sexplib
+
+OCamlMakePPDeps($(PA_SEXP_CONV), conv_test)
+
+OCamlMakeProjDefaults(conv_test.exe sexp_test.exe)
+
+InstantiateOCamlEnv()
diff --git a/bundles/sexplib/sexplib-7.0.5/lib_test/conv_test.ml b/bundles/sexplib/sexplib-7.0.5/lib_test/conv_test.ml
new file mode 100644 (file)
index 0000000..508cc49
--- /dev/null
@@ -0,0 +1,194 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Conv_test: module for testing automated S-expression conversions and
+    path substitutions *)
+
+open Format
+
+open Sexplib
+open Sexp
+open Conv
+
+module Exc_test : sig
+  exception Test_exc of (string * int) with sexp
+end = struct
+  exception Test_exc of (string * int) with sexp
+end
+
+(* Test each character. *)
+let check_string s =
+  let s' =
+    match (Sexp.of_string (Sexp.to_string (Sexp.Atom s))) with
+    | Sexp.Atom s -> s
+    | _ -> assert false
+  in
+  assert (s = s')
+
+let () =
+  for i = 0 to 255 do
+    check_string (String.make 1 (Char.chr i))
+  done
+
+(* Test user specified conversion *)
+
+type my_float = float
+
+let sexp_of_my_float n = Atom (sprintf "%.4f" n)
+
+let my_float_of_sexp = function
+  | Atom str -> float_of_string str
+  | _ -> failwith "my_float_of_sexp: atom expected"
+
+
+(* Test simple sum of products *)
+
+type foo = A | B of int * float
+with sexp
+
+
+(* Test polymorphic variants and deep module paths *)
+
+module M = struct
+  module N = struct
+    type ('a, 'b) variant = [ `X of ('a, 'b) variant | `Y of 'a * 'b ]
+    with sexp
+    type test = [ `Test ]
+    with sexp
+  end
+end
+
+type 'a variant =
+  [ M.N.test | `V1 of [ `Z | ('a, string) M.N.variant ] option | `V2 ]
+with sexp
+
+(* Test empty types *)
+
+type empty with sexp
+
+(* Test variance annotations *)
+
+module type S = sig
+  type +'a t with sexp
+end
+
+(* Test labeled arguments in functions *)
+
+type labeled = string -> foo : unit -> ?bar : int -> float -> float with sexp
+
+let f str ~foo ?(bar = 3) n = float_of_string str +. n +. float bar
+
+let labeled_sexp : Sexp.t = sexp_of_labeled f
+let labeled : labeled lazy_t = lazy (labeled_of_sexp (labeled_sexp : Sexp.t))
+
+type rec_labeled = { a : (foo : unit -> unit) } with sexp_of
+
+(* Test recursive types *)
+
+(* Test polymorphic record fields *)
+
+type 'x poly =
+  {
+    p : 'a 'b. 'a list;
+    maybe_t : 'x t option;
+  }
+
+(* Test records *)
+
+and 'a t =
+  {
+    x : foo;
+    a : 'a variant;
+    foo : int;
+    bar : (my_float * string) list option;
+    sexp_option : int sexp_option;
+    sexp_list : int sexp_list;
+    sexp_bool : sexp_bool;
+    poly : 'a poly;
+  }
+with sexp
+
+type v = { t : int t }
+
+(* Test manifest types *)
+type u = v = { t : int t }
+with sexp
+
+(* Test types involving exceptions *)
+type exn_test = int * exn
+with sexp_of
+
+(* Test function types *)
+type fun_test = int -> unit with sexp_of
+
+open Path
+
+let main () =
+  let make_t a =
+    {
+      x = B (42, 3.1);
+      a = a;
+      foo = 3;
+      bar = Some [(3.1, "foo")];
+      sexp_option = None;
+      sexp_list = [];
+      sexp_bool = true;
+      poly =
+        {
+          p = [];
+          maybe_t = None;
+        };
+    }
+  in
+  let v = `B (5, 5) in
+  let v_sexp = <:sexp_of<[ `A | `B of int * int ] >> v in
+  assert (<:of_sexp< [ `A | `B of int * int ] >> v_sexp = v);
+  let u = { t = make_t (`V1 (Some (`X (`Y (7, "bla"))))) } in
+  let u_sexp = sexp_of_u u in
+  printf "Original:      %a@\n@." pp u_sexp;
+  let u' = u_of_sexp u_sexp in
+  assert (u = u');
+  let foo_sexp = Sexp.of_string "A" in
+  let _foo = foo_of_sexp foo_sexp in
+
+  let path_str = ".[0].[1]" in
+  let path = Path.parse path_str in
+  let subst, el = subst_path u_sexp path in
+  printf "Pos(%s):       %a -> SUBST1@\n" path_str pp el;
+  let dumb_sexp = subst (Atom "SUBST1") in
+  printf "Pos(%s):    %a@\n@\n" path_str pp dumb_sexp;
+
+  let path_str = ".t.x.B[1]" in
+  let path = Path.parse path_str in
+  let subst, el = subst_path u_sexp path in
+  printf "Record(%s):    %a -> SUBST2@\n" path_str pp el;
+
+  let u_sexp = subst (Atom "SUBST2") in
+  printf "Record(%s): %a@\n@\n" path_str pp u_sexp;
+
+  printf "SUCCESS!!!@."
+
+let () =
+  try main (); raise (Exc_test.Test_exc ("expected exception", 42)) with
+  | exc -> eprintf "Exception: %s@." (Sexp.to_string_hum (sexp_of_exn exc))
diff --git a/bundles/sexplib/sexplib-7.0.5/lib_test/sexp_test.ml b/bundles/sexplib/sexplib-7.0.5/lib_test/sexp_test.ml
new file mode 100644 (file)
index 0000000..81cb20a
--- /dev/null
@@ -0,0 +1,71 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Sexp_test: Module for Testing S-expression I/O.
+
+    Example invocation: "sexp_test < test.sexp"
+*)
+
+open Format
+open Sexplib
+open Sexp
+
+(*
+let input_sexps ic =
+  let lexbuf = Lexing.from_channel ic in
+  scan_sexps lexbuf
+*)
+
+let () =
+  let orig_sexps = input_sexps stdin in
+
+  let hum_file = "/tmp/__hum.sexp" in
+  let hum_oc = open_out hum_file in
+  let hum_ppf = formatter_of_out_channel hum_oc in
+  List.iter
+    (fun sexp -> fprintf hum_ppf "%a@\n" Sexp.pp_hum sexp)
+    orig_sexps;
+  pp_print_flush hum_ppf ();
+  close_out hum_oc;
+
+  let mach_file = "/tmp/__mach.sexp" in
+  let mach_oc = open_out mach_file in
+  List.iter
+    (fun sexp -> Printf.fprintf mach_oc "%a\n" Sexp.output_mach sexp)
+    orig_sexps;
+  close_out mach_oc;
+
+  let hum_ic = open_in hum_file in
+  let hum_sexps = input_sexps hum_ic in
+  close_in hum_ic;
+  assert (hum_sexps = orig_sexps);
+  Sys.remove hum_file;
+
+  let mach_ic = open_in mach_file in
+  let mach_sexps = input_sexps mach_ic in
+  close_in mach_ic;
+  assert (mach_sexps = orig_sexps);
+  Sys.remove mach_file;
+
+  printf "Parsing S-expressions: SUCCESS!!!@."
diff --git a/bundles/sexplib/sexplib-7.0.5/lib_test/test.sexp b/bundles/sexplib/sexplib-7.0.5/lib_test/test.sexp
new file mode 100644 (file)
index 0000000..2d3a6f0
--- /dev/null
@@ -0,0 +1,14 @@
+(this is a list)
+
+(this is another list and (this is a nested list))
+
+(
+  "\
+    This is a multi-line \
+    string with embedded
+
+    newlines."
+
+  "This string contains decimal \255, hex \xff codes, \
+   and other \\ \n escapes."
+)
diff --git a/bundles/sexplib/sexplib-7.0.5/myocamlbuild.ml b/bundles/sexplib/sexplib-7.0.5/myocamlbuild.ml
new file mode 100644 (file)
index 0000000..205d79b
--- /dev/null
@@ -0,0 +1,489 @@
+(* OASIS_START *)
+(* DO NOT EDIT (digest: 6a36af2626fc8bc901ff0b729583bf22) *)
+module OASISGettext = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISGettext.ml"
+  
+  let ns_ str =
+    str
+  
+  let s_ str =
+    str
+  
+  let f_ (str : ('a, 'b, 'c, 'd) format4) =
+    str
+  
+  let fn_ fmt1 fmt2 n =
+    if n = 1 then
+      fmt1^^""
+    else
+      fmt2^^""
+  
+  let init =
+    []
+  
+end
+
+module OASISExpr = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExpr.ml"
+  
+  
+  
+  open OASISGettext
+  
+  type test = string 
+  
+  type flag = string 
+  
+  type t =
+    | EBool of bool
+    | ENot of t
+    | EAnd of t * t
+    | EOr of t * t
+    | EFlag of flag
+    | ETest of test * string
+    
+  
+  type 'a choices = (t * 'a) list 
+  
+  let eval var_get t =
+    let rec eval' =
+      function
+        | EBool b ->
+            b
+  
+        | ENot e ->
+            not (eval' e)
+  
+        | EAnd (e1, e2) ->
+            (eval' e1) && (eval' e2)
+  
+        | EOr (e1, e2) ->
+            (eval' e1) || (eval' e2)
+  
+        | EFlag nm ->
+            let v =
+              var_get nm
+            in
+              assert(v = "true" || v = "false");
+              (v = "true")
+  
+        | ETest (nm, vl) ->
+            let v =
+              var_get nm
+            in
+              (v = vl)
+    in
+      eval' t
+  
+  let choose ?printer ?name var_get lst =
+    let rec choose_aux =
+      function
+        | (cond, vl) :: tl ->
+            if eval var_get cond then
+              vl
+            else
+              choose_aux tl
+        | [] ->
+            let str_lst =
+              if lst = [] then
+                s_ "<empty>"
+              else
+                String.concat
+                  (s_ ", ")
+                  (List.map
+                     (fun (cond, vl) ->
+                        match printer with
+                          | Some p -> p vl
+                          | None -> s_ "<no printer>")
+                     lst)
+            in
+              match name with
+                | Some nm ->
+                    failwith
+                      (Printf.sprintf
+                         (f_ "No result for the choice list '%s': %s")
+                         nm str_lst)
+                | None ->
+                    failwith
+                      (Printf.sprintf
+                         (f_ "No result for a choice list: %s")
+                         str_lst)
+    in
+      choose_aux (List.rev lst)
+  
+end
+
+
+module BaseEnvLight = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnvLight.ml"
+  
+  module MapString = Map.Make(String)
+  
+  type t = string MapString.t
+  
+  let default_filename =
+    Filename.concat
+      (Sys.getcwd ())
+      "setup.data"
+  
+  let load ?(allow_empty=false) ?(filename=default_filename) () =
+    if Sys.file_exists filename then
+      begin
+        let chn =
+          open_in_bin filename
+        in
+        let st =
+          Stream.of_channel chn
+        in
+        let line =
+          ref 1
+        in
+        let st_line =
+          Stream.from
+            (fun _ ->
+               try
+                 match Stream.next st with
+                   | '\n' -> incr line; Some '\n'
+                   | c -> Some c
+               with Stream.Failure -> None)
+        in
+        let lexer =
+          Genlex.make_lexer ["="] st_line
+        in
+        let rec read_file mp =
+          match Stream.npeek 3 lexer with
+            | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] ->
+                Stream.junk lexer;
+                Stream.junk lexer;
+                Stream.junk lexer;
+                read_file (MapString.add nm value mp)
+            | [] ->
+                mp
+            | _ ->
+                failwith
+                  (Printf.sprintf
+                     "Malformed data file '%s' line %d"
+                     filename !line)
+        in
+        let mp =
+          read_file MapString.empty
+        in
+          close_in chn;
+          mp
+      end
+    else if allow_empty then
+      begin
+        MapString.empty
+      end
+    else
+      begin
+        failwith
+          (Printf.sprintf
+             "Unable to load environment, the file '%s' doesn't exist."
+             filename)
+      end
+  
+  let var_get name env =
+    let rec var_expand str =
+      let buff =
+        Buffer.create ((String.length str) * 2)
+      in
+        Buffer.add_substitute
+          buff
+          (fun var ->
+             try
+               var_expand (MapString.find var env)
+             with Not_found ->
+               failwith
+                 (Printf.sprintf
+                    "No variable %s defined when trying to expand %S."
+                    var
+                    str))
+          str;
+        Buffer.contents buff
+    in
+      var_expand (MapString.find name env)
+  
+  let var_choose lst env =
+    OASISExpr.choose
+      (fun nm -> var_get nm env)
+      lst
+end
+
+
+module MyOCamlbuildFindlib = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
+  
+  (** OCamlbuild extension, copied from 
+    * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
+    * by N. Pouillard and others
+    *
+    * Updated on 2009/02/28
+    *
+    * Modified by Sylvain Le Gall 
+    *)
+  open Ocamlbuild_plugin
+  
+  (* these functions are not really officially exported *)
+  let run_and_read = 
+    Ocamlbuild_pack.My_unix.run_and_read
+  
+  let blank_sep_strings = 
+    Ocamlbuild_pack.Lexers.blank_sep_strings
+  
+  let split s ch =
+    let x = 
+      ref [] 
+    in
+    let rec go s =
+      let pos = 
+        String.index s ch 
+      in
+        x := (String.before s pos)::!x;
+        go (String.after s (pos + 1))
+    in
+      try
+        go s
+      with Not_found -> !x
+  
+  let split_nl s = split s '\n'
+  
+  let before_space s =
+    try
+      String.before s (String.index s ' ')
+    with Not_found -> s
+  
+  (* this lists all supported packages *)
+  let find_packages () =
+    List.map before_space (split_nl & run_and_read "ocamlfind list")
+  
+  (* this is supposed to list available syntaxes, but I don't know how to do it. *)
+  let find_syntaxes () = ["camlp4o"; "camlp4r"]
+  
+  (* ocamlfind command *)
+  let ocamlfind x = S[A"ocamlfind"; x]
+  
+  let dispatch =
+    function
+      | Before_options ->
+          (* by using Before_options one let command line options have an higher priority *)
+          (* on the contrary using After_options will guarantee to have the higher priority *)
+          (* override default commands by ocamlfind ones *)
+          Options.ocamlc     := ocamlfind & A"ocamlc";
+          Options.ocamlopt   := ocamlfind & A"ocamlopt";
+          Options.ocamldep   := ocamlfind & A"ocamldep";
+          Options.ocamldoc   := ocamlfind & A"ocamldoc";
+          Options.ocamlmktop := ocamlfind & A"ocamlmktop"
+                                  
+      | After_rules ->
+          
+          (* When one link an OCaml library/binary/package, one should use -linkpkg *)
+          flag ["ocaml"; "link"; "program"] & A"-linkpkg";
+          
+          (* For each ocamlfind package one inject the -package option when
+           * compiling, computing dependencies, generating documentation and
+           * linking. *)
+          List.iter 
+            begin fun pkg ->
+              flag ["ocaml"; "compile";  "pkg_"^pkg] & S[A"-package"; A pkg];
+              flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
+              flag ["ocaml"; "doc";      "pkg_"^pkg] & S[A"-package"; A pkg];
+              flag ["ocaml"; "link";     "pkg_"^pkg] & S[A"-package"; A pkg];
+              flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg];
+            end 
+            (find_packages ());
+  
+          (* Like -package but for extensions syntax. Morover -syntax is useless
+           * when linking. *)
+          List.iter begin fun syntax ->
+          flag ["ocaml"; "compile";  "syntax_"^syntax] & S[A"-syntax"; A syntax];
+          flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
+          flag ["ocaml"; "doc";      "syntax_"^syntax] & S[A"-syntax"; A syntax];
+          flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
+          end (find_syntaxes ());
+  
+          (* The default "thread" tag is not compatible with ocamlfind.
+           * Indeed, the default rules add the "threads.cma" or "threads.cmxa"
+           * options when using this tag. When using the "-linkpkg" option with
+           * ocamlfind, this module will then be added twice on the command line.
+           *                        
+           * To solve this, one approach is to add the "-thread" option when using
+           * the "threads" package using the previous plugin.
+           *)
+          flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
+          flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
+          flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
+          flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
+  
+      | _ -> 
+          ()
+  
+end
+
+module MyOCamlbuildBase = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
+  
+  (** Base functions for writing myocamlbuild.ml
+      @author Sylvain Le Gall
+    *)
+  
+  
+  
+  open Ocamlbuild_plugin
+  
+  type dir = string 
+  type file = string 
+  type name = string 
+  type tag = string 
+  
+# 55 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
+  
+  type t =
+      {
+        lib_ocaml: (name * dir list) list;
+        lib_c:     (name * dir * file list) list; 
+        flags:     (tag list * (spec OASISExpr.choices)) list;
+      } 
+  
+  let env_filename =
+    Pathname.basename 
+      BaseEnvLight.default_filename
+  
+  let dispatch_combine lst =
+    fun e ->
+      List.iter 
+        (fun dispatch -> dispatch e)
+        lst 
+  
+  let dispatch t e = 
+    let env = 
+      BaseEnvLight.load 
+        ~filename:env_filename 
+        ~allow_empty:true
+        ()
+    in
+      match e with 
+        | Before_options ->
+            let no_trailing_dot s =
+              if String.length s >= 1 && s.[0] = '.' then
+                String.sub s 1 ((String.length s) - 1)
+              else
+                s
+            in
+              List.iter
+                (fun (opt, var) ->
+                   try 
+                     opt := no_trailing_dot (BaseEnvLight.var_get var env)
+                   with Not_found ->
+                     Printf.eprintf "W: Cannot get variable %s" var)
+                [
+                  Options.ext_obj, "ext_obj";
+                  Options.ext_lib, "ext_lib";
+                  Options.ext_dll, "ext_dll";
+                ]
+  
+        | After_rules -> 
+            (* Declare OCaml libraries *)
+            List.iter 
+              (function
+                 | lib, [] ->
+                     ocaml_lib lib;
+                 | lib, dir :: tl ->
+                     ocaml_lib ~dir:dir lib;
+                     List.iter 
+                       (fun dir -> 
+                          flag 
+                            ["ocaml"; "use_"^lib; "compile"] 
+                            (S[A"-I"; P dir]))
+                       tl)
+              t.lib_ocaml;
+  
+            (* Declare C libraries *)
+            List.iter
+              (fun (lib, dir, headers) ->
+                   (* Handle C part of library *)
+                   flag ["link"; "library"; "ocaml"; "byte"; "use_lib"^lib]
+                     (S[A"-dllib"; A("-l"^lib); A"-cclib"; A("-l"^lib)]);
+  
+                   flag ["link"; "library"; "ocaml"; "native"; "use_lib"^lib]
+                     (S[A"-cclib"; A("-l"^lib)]);
+                        
+                   flag ["link"; "program"; "ocaml"; "byte"; "use_lib"^lib]
+                     (S[A"-dllib"; A("dll"^lib)]);
+  
+                   (* When ocaml link something that use the C library, then one
+                      need that file to be up to date.
+                    *)
+                   dep  ["link"; "ocaml"; "program"; "use_lib"^lib]
+                     [dir/"lib"^lib^"."^(!Options.ext_lib)];
+  
+                   dep  ["compile"; "ocaml"; "program"; "use_lib"^lib]
+                     [dir/"lib"^lib^"."^(!Options.ext_lib)];
+  
+                   (* TODO: be more specific about what depends on headers *)
+                   (* Depends on .h files *)
+                   dep ["compile"; "c"] 
+                     headers;
+  
+                   (* Setup search path for lib *)
+                   flag ["link"; "ocaml"; "use_"^lib] 
+                     (S[A"-I"; P(dir)]);
+              )
+              t.lib_c;
+  
+              (* Add flags *)
+              List.iter
+              (fun (tags, cond_specs) ->
+                 let spec = 
+                   BaseEnvLight.var_choose cond_specs env
+                 in
+                   flag tags & spec)
+              t.flags
+        | _ -> 
+            ()
+  
+  let dispatch_default t =
+    dispatch_combine 
+      [
+        dispatch t;
+        MyOCamlbuildFindlib.dispatch;
+      ]
+  
+end
+
+
+open Ocamlbuild_plugin;;
+let package_default =
+  {
+     MyOCamlbuildBase.lib_ocaml =
+       [
+          ("lib/sexplib", ["lib"]);
+          ("syntax/pa_sexp_conv", ["syntax"]);
+          ("top/sexplib_top", ["top"])
+       ];
+     lib_c = [];
+     flags = [];
+     }
+  ;;
+
+let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
+
+# 472 "myocamlbuild.ml"
+(* OASIS_STOP *)
+
+Ocamlbuild_plugin.dispatch 
+  begin
+    function
+      | After_rules as e ->
+
+          flag ["ocamldep"; "ocaml"; "use_pa_sexp_conv"]
+            (S[A"-ppopt"; P"syntax/pa_sexp_conv.cma"]);
+
+          flag ["compile"; "ocaml"; "use_pa_sexp_conv"]
+            (S[A"-ppopt"; P"syntax/pa_sexp_conv.cma"]);
+
+          dispatch_default e
+      | e ->
+          dispatch_default e 
+  end
+;;
diff --git a/bundles/sexplib/sexplib-7.0.5/setup.ml b/bundles/sexplib/sexplib-7.0.5/setup.ml
new file mode 100644 (file)
index 0000000..7623a34
--- /dev/null
@@ -0,0 +1,5597 @@
+(* setup.ml generated for the first time by OASIS v0.2.0 *)
+
+(* OASIS_START *)
+(* DO NOT EDIT (digest: 45e10b84ce2d3eaf3fd842c91210e92a) *)
+(*
+   Regenerated by OASIS v0.3.0~rc2
+   Visit http://oasis.forge.ocamlcore.org for more information and
+   documentation about functions used in this file.
+*)
+module OASISGettext = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISGettext.ml"
+  
+  let ns_ str =
+    str
+  
+  let s_ str =
+    str
+  
+  let f_ (str : ('a, 'b, 'c, 'd) format4) =
+    str
+  
+  let fn_ fmt1 fmt2 n =
+    if n = 1 then
+      fmt1^^""
+    else
+      fmt2^^""
+  
+  let init =
+    []
+  
+end
+
+module OASISContext = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISContext.ml"
+  
+  open OASISGettext
+  
+  type level =
+    [ `Debug
+    | `Info
+    | `Warning
+    | `Error]
+  
+  type t =
+    {
+      verbose:               bool;
+      debug:                 bool;
+      ignore_plugins:        bool;
+      ignore_unknown_fields: bool;
+      printf:                level -> string -> unit;
+    }
+  
+  let printf lvl str =
+    let beg =
+      match lvl with
+        | `Error -> s_ "E: "
+        | `Warning -> s_ "W: "
+        | `Info  -> s_ "I: "
+        | `Debug -> s_ "D: "
+    in
+      prerr_endline (beg^str)
+  
+  let default =
+    ref
+      {
+        verbose               = true;
+        debug                 = false;
+        ignore_plugins        = false;
+        ignore_unknown_fields = false;
+        printf                = printf;
+      }
+  
+  let quiet =
+    {!default with
+         verbose = false;
+         debug   = false;
+    }
+  
+  
+  let args () =
+    ["-quiet",
+     Arg.Unit (fun () -> default := {!default with verbose = false}),
+     (s_ " Run quietly");
+  
+     "-debug",
+     Arg.Unit (fun () -> default := {!default with debug = true}),
+     (s_ " Output debug message")]
+end
+
+module OASISUtils = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISUtils.ml"
+  
+  open OASISGettext
+  
+  module MapString = Map.Make(String)
+  
+  let map_string_of_assoc assoc =
+    List.fold_left
+      (fun acc (k, v) -> MapString.add k v acc)
+      MapString.empty
+      assoc
+  
+  module SetString = Set.Make(String)
+  
+  let set_string_add_list st lst =
+    List.fold_left
+      (fun acc e -> SetString.add e acc)
+      st
+      lst
+  
+  let set_string_of_list =
+    set_string_add_list
+      SetString.empty
+  
+  
+  let compare_csl s1 s2 =
+    String.compare (String.lowercase s1) (String.lowercase s2)
+  
+  module HashStringCsl =
+    Hashtbl.Make
+      (struct
+         type t = string
+  
+         let equal s1 s2 =
+             (String.lowercase s1) = (String.lowercase s2)
+  
+         let hash s =
+           Hashtbl.hash (String.lowercase s)
+       end)
+  
+  let split sep str =
+    let str_len =
+      String.length str
+    in
+    let rec split_aux acc pos =
+      if pos < str_len then
+        (
+          let pos_sep =
+            try
+              String.index_from str pos sep
+            with Not_found ->
+              str_len
+          in
+          let part =
+            String.sub str pos (pos_sep - pos)
+          in
+          let acc =
+            part :: acc
+          in
+            if pos_sep >= str_len then
+              (
+                (* Nothing more in the string *)
+                List.rev acc
+              )
+            else if pos_sep = (str_len - 1) then
+              (
+                (* String end with a separator *)
+                List.rev ("" :: acc)
+              )
+            else
+              (
+                split_aux acc (pos_sep + 1)
+              )
+        )
+      else
+        (
+          List.rev acc
+        )
+    in
+      split_aux [] 0
+  
+  
+  let varname_of_string ?(hyphen='_') s =
+    if String.length s = 0 then
+      begin
+        invalid_arg "varname_of_string"
+      end
+    else
+      begin
+        let buff =
+          Buffer.create (String.length s)
+        in
+          (* Start with a _ if digit *)
+          if '0' <= s.[0] && s.[0] <= '9' then
+            Buffer.add_char buff hyphen;
+  
+          String.iter
+            (fun c ->
+               if ('a' <= c && c <= 'z')
+                 ||
+                  ('A' <= c && c <= 'Z')
+                 ||
+                  ('0' <= c && c <= '9') then
+                 Buffer.add_char buff c
+               else
+                 Buffer.add_char buff hyphen)
+            s;
+  
+          String.lowercase (Buffer.contents buff)
+      end
+  
+  let varname_concat ?(hyphen='_') p s =
+    let p =
+      let p_len =
+        String.length p
+      in
+        if p_len > 0 && p.[p_len - 1] = hyphen then
+          String.sub p 0 (p_len - 1)
+        else
+          p
+    in
+    let s =
+      let s_len =
+        String.length s
+      in
+        if s_len > 0 && s.[0] = hyphen then
+          String.sub s 1 (s_len - 1)
+        else
+          s
+    in
+      Printf.sprintf "%s%c%s" p hyphen s
+  
+  
+  let is_varname str =
+    str = varname_of_string str
+  
+  let failwithf fmt = Printf.ksprintf failwith fmt
+  
+end
+
+module PropList = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/PropList.ml"
+  
+  open OASISGettext
+  
+  type name = string
+  
+  exception Not_set of name * string option
+  exception No_printer of name
+  exception Unknown_field of name * name
+  
+  let () =
+    Printexc.register_printer
+      (function
+         | Not_set (nm, Some rsn) ->
+             Some 
+               (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn)
+         | Not_set (nm, None) ->
+             Some 
+               (Printf.sprintf (f_ "Field '%s' is not set") nm)
+         | No_printer nm ->
+             Some
+               (Printf.sprintf (f_ "No default printer for value %s") nm)
+         | Unknown_field (nm, schm) ->
+             Some 
+               (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm)
+         | _ ->
+             None)
+  
+  module Data =
+  struct
+  
+    type t =
+        (name, unit -> unit) Hashtbl.t
+  
+    let create () =
+      Hashtbl.create 13
+  
+    let clear t =
+      Hashtbl.clear t
+  
+# 71 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/PropList.ml"
+  end
+  
+  module Schema =
+  struct
+  
+    type ('ctxt, 'extra) value =
+        {
+          get:   Data.t -> string;
+          set:   Data.t -> ?context:'ctxt -> string -> unit;
+          help:  (unit -> string) option;
+          extra: 'extra;
+        }
+  
+    type ('ctxt, 'extra) t =
+        {
+          name:      name;
+          fields:    (name, ('ctxt, 'extra) value) Hashtbl.t;
+          order:     name Queue.t;
+          name_norm: string -> string;
+        }
+  
+    let create ?(case_insensitive=false) nm =
+      {
+        name      = nm;
+        fields    = Hashtbl.create 13;
+        order     = Queue.create ();
+        name_norm =
+          (if case_insensitive then
+             String.lowercase
+           else
+             fun s -> s);
+      }
+  
+    let add t nm set get extra help =
+      let key =
+        t.name_norm nm
+      in
+  
+        if Hashtbl.mem t.fields key then
+          failwith
+            (Printf.sprintf
+               (f_ "Field '%s' is already defined in schema '%s'")
+               nm t.name);
+        Hashtbl.add
+          t.fields
+          key
+          {
+            set   = set;
+            get   = get;
+            help  = help;
+            extra = extra;
+          };
+        Queue.add nm t.order
+  
+    let mem t nm =
+      Hashtbl.mem t.fields nm
+  
+    let find t nm =
+      try
+        Hashtbl.find t.fields (t.name_norm nm)
+      with Not_found ->
+        raise (Unknown_field (nm, t.name))
+  
+    let get t data nm =
+      (find t nm).get data
+  
+    let set t data nm ?context x =
+      (find t nm).set
+        data
+        ?context
+        x
+  
+    let fold f acc t =
+      Queue.fold
+        (fun acc k ->
+           let v =
+             find t k
+           in
+             f acc k v.extra v.help)
+        acc
+        t.order
+  
+    let iter f t =
+      fold
+        (fun () -> f)
+        ()
+        t
+  
+    let name t =
+      t.name
+  end
+  
+  module Field =
+  struct
+  
+    type ('ctxt, 'value, 'extra) t =
+        {
+          set:    Data.t -> ?context:'ctxt -> 'value -> unit;
+          get:    Data.t -> 'value;
+          sets:   Data.t -> ?context:'ctxt -> string -> unit;
+          gets:   Data.t -> string;
+          help:   (unit -> string) option;
+          extra:  'extra;
+        }
+  
+    let new_id =
+      let last_id =
+        ref 0
+      in
+        fun () -> incr last_id; !last_id
+  
+    let create ?schema ?name ?parse ?print ?default ?update ?help extra =
+      (* Default value container *)
+      let v =
+        ref None
+      in
+  
+      (* If name is not given, create unique one *)
+      let nm =
+        match name with
+          | Some s -> s
+          | None -> Printf.sprintf "_anon_%d" (new_id ())
+      in
+  
+      (* Last chance to get a value: the default *)
+      let default () =
+        match default with
+          | Some d -> d
+          | None -> raise (Not_set (nm, Some (s_ "no default value")))
+      in
+  
+      (* Get data *)
+      let get data =
+        (* Get value *)
+        try
+          (Hashtbl.find data nm) ();
+          match !v with
+            | Some x -> x
+            | None -> default ()
+        with Not_found ->
+          default ()
+      in
+  
+      (* Set data *)
+      let set data ?context x =
+        let x =
+          match update with
+            | Some f ->
+                begin
+                  try
+                    f ?context (get data) x
+                  with Not_set _ ->
+                    x
+                end
+            | None ->
+                x
+        in
+          Hashtbl.replace
+            data
+            nm
+            (fun () -> v := Some x)
+      in
+  
+      (* Parse string value, if possible *)
+      let parse =
+        match parse with
+          | Some f ->
+              f
+          | None ->
+              fun ?context s ->
+                failwith
+                  (Printf.sprintf
+                     (f_ "Cannot parse field '%s' when setting value %S")
+                     nm
+                     s)
+      in
+  
+      (* Set data, from string *)
+      let sets data ?context s =
+        set ?context data (parse ?context s)
+      in
+  
+      (* Output value as string, if possible *)
+      let print =
+        match print with
+          | Some f ->
+              f
+          | None ->
+              fun _ -> raise (No_printer nm)
+      in
+  
+      (* Get data, as a string *)
+      let gets data =
+        print (get data)
+      in
+  
+        begin
+          match schema with
+            | Some t ->
+                Schema.add t nm sets gets extra help
+            | None ->
+                ()
+        end;
+  
+        {
+          set   = set;
+          get   = get;
+          sets  = sets;
+          gets  = gets;
+          help  = help;
+          extra = extra;
+        }
+  
+    let fset data t ?context x =
+      t.set data ?context x
+  
+    let fget data t =
+      t.get data
+  
+    let fsets data t ?context s =
+      t.sets data ?context s
+  
+    let fgets data t =
+      t.gets data
+  
+  end
+  
+  module FieldRO =
+  struct
+  
+    let create ?schema ?name ?parse ?print ?default ?update ?help extra =
+      let fld =
+        Field.create ?schema ?name ?parse ?print ?default ?update ?help extra
+      in
+        fun data -> Field.fget data fld
+  
+  end
+end
+
+module OASISMessage = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISMessage.ml"
+  
+  
+  open OASISGettext
+  open OASISContext
+  
+  let generic_message ~ctxt lvl fmt =
+    let cond =
+      match lvl with
+        | `Debug -> ctxt.debug
+        | _ -> ctxt.verbose
+    in
+      Printf.ksprintf
+        (fun str ->
+           if cond then
+             begin
+               ctxt.printf lvl str
+             end)
+        fmt
+  
+  let debug ~ctxt fmt =
+    generic_message ~ctxt `Debug fmt
+  
+  let info ~ctxt fmt =
+    generic_message ~ctxt `Info fmt
+  
+  let warning ~ctxt fmt =
+    generic_message ~ctxt `Warning fmt
+  
+  let error ~ctxt fmt =
+    generic_message ~ctxt `Error fmt
+  
+end
+
+module OASISVersion = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISVersion.ml"
+  
+  open OASISGettext
+  
+  
+  
+  type s = string
+  
+  type t = string 
+  
+  type comparator =
+    | VGreater of t
+    | VGreaterEqual of t
+    | VEqual of t
+    | VLesser of t
+    | VLesserEqual of t
+    | VOr of  comparator * comparator
+    | VAnd of comparator * comparator
+    
+  
+  (* Range of allowed characters *)
+  let is_digit c =
+    '0' <= c && c <= '9'
+  
+  let is_alpha c =
+    ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')
+  
+  let is_special =
+    function
+      | '.' | '+' | '-' | '~' -> true
+      | _ -> false
+  
+  let rec version_compare v1 v2 =
+    if v1 <> "" || v2 <> "" then
+      begin
+        (* Compare ascii string, using special meaning for version
+         * related char
+         *)
+        let val_ascii c =
+          if c = '~' then -1
+          else if is_digit c then 0
+          else if c = '\000' then 0
+          else if is_alpha c then Char.code c
+          else (Char.code c) + 256
+        in
+  
+        let len1 = String.length v1 in
+        let len2 = String.length v2 in
+  
+        let p = ref 0 in
+  
+        (** Compare ascii part *)
+        let compare_vascii () =
+          let cmp = ref 0 in
+          while !cmp = 0 &&
+                !p < len1 && !p < len2 &&
+                not (is_digit v1.[!p] && is_digit v2.[!p]) do
+            cmp := (val_ascii v1.[!p]) - (val_ascii v2.[!p]);
+            incr p
+          done;
+          if !cmp = 0 && !p < len1 && !p = len2 then
+            val_ascii v1.[!p]
+          else if !cmp = 0 && !p = len1 && !p < len2 then
+            - (val_ascii v2.[!p])
+          else
+            !cmp
+        in
+  
+        (** Compare digit part *)
+        let compare_digit () =
+          let extract_int v p =
+            let start_p = !p in
+              while !p < String.length v && is_digit v.[!p] do
+                incr p
+              done;
+              let substr = 
+                String.sub v !p ((String.length v) - !p)
+              in 
+              let res = 
+                match String.sub v start_p (!p - start_p) with 
+                  | "" -> 0
+                  | s -> int_of_string s
+              in
+                res, substr
+          in
+          let i1, tl1 = extract_int v1 (ref !p) in
+          let i2, tl2 = extract_int v2 (ref !p) in
+            i1 - i2, tl1, tl2
+        in
+  
+          match compare_vascii () with
+            | 0 ->
+                begin
+                  match compare_digit () with
+                    | 0, tl1, tl2 ->
+                        if tl1 <> "" && is_digit tl1.[0] then
+                          1
+                        else if tl2 <> "" && is_digit tl2.[0] then
+                          -1
+                        else
+                          version_compare tl1 tl2
+                    | n, _, _ ->
+                        n
+                end
+            | n ->
+                n
+      end
+    else
+      begin
+        0
+      end
+  
+  
+  let version_of_string str =
+    String.iter
+      (fun c ->
+         if is_alpha c || is_digit c || is_special c then
+           ()
+         else
+           failwith
+             (Printf.sprintf
+                (f_ "Char %C is not allowed in version '%s'")
+                c str))
+      str;
+    str
+  
+  let string_of_version t =
+    t
+  
+  let chop t =
+    try
+      let pos =
+        String.rindex t '.'
+      in
+        String.sub t 0 pos
+    with Not_found ->
+      t
+  
+  let rec comparator_apply v op =
+    match op with
+      | VGreater cv ->
+          (version_compare v cv) > 0
+      | VGreaterEqual cv ->
+          (version_compare v cv) >= 0
+      | VLesser cv ->
+          (version_compare v cv) < 0
+      | VLesserEqual cv ->
+          (version_compare v cv) <= 0
+      | VEqual cv ->
+          (version_compare v cv) = 0
+      | VOr (op1, op2) ->
+          (comparator_apply v op1) || (comparator_apply v op2)
+      | VAnd (op1, op2) ->
+          (comparator_apply v op1) && (comparator_apply v op2)
+  
+  let rec string_of_comparator =
+    function
+      | VGreater v  -> "> "^(string_of_version v)
+      | VEqual v    -> "= "^(string_of_version v)
+      | VLesser v   -> "< "^(string_of_version v)
+      | VGreaterEqual v -> ">= "^(string_of_version v)
+      | VLesserEqual v  -> "<= "^(string_of_version v)
+      | VOr (c1, c2)  ->
+          (string_of_comparator c1)^" || "^(string_of_comparator c2)
+      | VAnd (c1, c2) ->
+          (string_of_comparator c1)^" && "^(string_of_comparator c2)
+  
+  let rec varname_of_comparator =
+    let concat p v =
+      OASISUtils.varname_concat
+        p
+        (OASISUtils.varname_of_string
+           (string_of_version v))
+    in
+      function
+        | VGreater v -> concat "gt" v
+        | VLesser v  -> concat "lt" v
+        | VEqual v   -> concat "eq" v
+        | VGreaterEqual v -> concat "ge" v
+        | VLesserEqual v  -> concat "le" v
+        | VOr (c1, c2) ->
+            (varname_of_comparator c1)^"_or_"^(varname_of_comparator c2)
+        | VAnd (c1, c2) ->
+            (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2)
+  
+end
+
+module OASISLicense = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISLicense.ml"
+  
+  (** License for _oasis fields
+      @author Sylvain Le Gall
+    *)
+  
+  
+  
+  type license = string 
+  
+  type license_exception = string 
+  
+  type license_version =
+    | Version of OASISVersion.t
+    | VersionOrLater of OASISVersion.t
+    | NoVersion
+    
+  
+  type license_dep_5 =
+      {
+        license:    license;
+        exceptions: license_exception list;
+        version:    license_version;
+      } 
+  
+  type t =
+    | DEP5License of license_dep_5
+    | OtherLicense of string (* URL *)
+    
+  
+end
+
+module OASISExpr = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExpr.ml"
+  
+  
+  
+  open OASISGettext
+  
+  type test = string 
+  
+  type flag = string 
+  
+  type t =
+    | EBool of bool
+    | ENot of t
+    | EAnd of t * t
+    | EOr of t * t
+    | EFlag of flag
+    | ETest of test * string
+    
+  
+  type 'a choices = (t * 'a) list 
+  
+  let eval var_get t =
+    let rec eval' =
+      function
+        | EBool b ->
+            b
+  
+        | ENot e ->
+            not (eval' e)
+  
+        | EAnd (e1, e2) ->
+            (eval' e1) && (eval' e2)
+  
+        | EOr (e1, e2) ->
+            (eval' e1) || (eval' e2)
+  
+        | EFlag nm ->
+            let v =
+              var_get nm
+            in
+              assert(v = "true" || v = "false");
+              (v = "true")
+  
+        | ETest (nm, vl) ->
+            let v =
+              var_get nm
+            in
+              (v = vl)
+    in
+      eval' t
+  
+  let choose ?printer ?name var_get lst =
+    let rec choose_aux =
+      function
+        | (cond, vl) :: tl ->
+            if eval var_get cond then
+              vl
+            else
+              choose_aux tl
+        | [] ->
+            let str_lst =
+              if lst = [] then
+                s_ "<empty>"
+              else
+                String.concat
+                  (s_ ", ")
+                  (List.map
+                     (fun (cond, vl) ->
+                        match printer with
+                          | Some p -> p vl
+                          | None -> s_ "<no printer>")
+                     lst)
+            in
+              match name with
+                | Some nm ->
+                    failwith
+                      (Printf.sprintf
+                         (f_ "No result for the choice list '%s': %s")
+                         nm str_lst)
+                | None ->
+                    failwith
+                      (Printf.sprintf
+                         (f_ "No result for a choice list: %s")
+                         str_lst)
+    in
+      choose_aux (List.rev lst)
+  
+end
+
+module OASISTypes = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTypes.ml"
+  
+  
+  
+  
+  type name          = string 
+  type package_name  = string 
+  type url           = string 
+  type unix_dirname  = string 
+  type unix_filename = string 
+  type host_dirname  = string 
+  type host_filename = string 
+  type prog          = string 
+  type arg           = string 
+  type args          = string list 
+  type command_line  = (prog * arg list) 
+  
+  type findlib_name = string 
+  type findlib_full = string 
+  
+  type compiled_object =
+    | Byte
+    | Native
+    | Best
+    
+  
+  type dependency =
+    | FindlibPackage of findlib_full * OASISVersion.comparator option
+    | InternalLibrary of name
+    
+  
+  type tool =
+    | ExternalTool of name
+    | InternalExecutable of name
+    
+  
+  type vcs =
+    | Darcs
+    | Git
+    | Svn
+    | Cvs
+    | Hg
+    | Bzr
+    | Arch
+    | Monotone
+    | OtherVCS of url
+    
+  
+  type plugin_kind =
+      [  `Configure
+       | `Build
+       | `Doc
+       | `Test
+       | `Install
+       | `Extra
+      ]
+  
+  type plugin_data_purpose =
+      [  `Configure
+       | `Build
+       | `Install
+       | `Clean
+       | `Distclean
+       | `Install
+       | `Uninstall
+       | `Test
+       | `Doc
+       | `Extra
+       | `Other of string
+      ]
+  
+  type 'a plugin = 'a * name * OASISVersion.t option 
+  
+  type all_plugin = plugin_kind plugin
+  
+  type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list
+  
+# 102 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTypes.ml"
+  
+  type 'a conditional = 'a OASISExpr.choices 
+  
+  type custom =
+      {
+        pre_command:  (command_line option) conditional;
+        post_command: (command_line option) conditional;
+      }
+      
+  
+  type common_section =
+      {
+        cs_name: name;
+        cs_data: PropList.Data.t;
+        cs_plugin_data: plugin_data;
+      }
+      
+  
+  type build_section =
+      {
+        bs_build:           bool conditional;
+        bs_install:         bool conditional;
+        bs_path:            unix_dirname;
+        bs_compiled_object: compiled_object;
+        bs_build_depends:   dependency list;
+        bs_build_tools:     tool list;
+        bs_c_sources:       unix_filename list;
+        bs_data_files:      (unix_filename * unix_filename option) list;
+        bs_ccopt:           args conditional;
+        bs_cclib:           args conditional;
+        bs_dlllib:          args conditional;
+        bs_dllpath:         args conditional;
+        bs_byteopt:         args conditional;
+        bs_nativeopt:       args conditional;
+      }
+      
+  
+  type library =
+      {
+        lib_modules:            string list;
+        lib_pack:               bool;
+        lib_internal_modules:   string list;
+        lib_findlib_parent:     findlib_name option;
+        lib_findlib_name:       findlib_name option;
+        lib_findlib_containers: findlib_name list;
+      } 
+  
+  type executable =
+      {
+        exec_custom:          bool;
+        exec_main_is:         unix_filename;
+      } 
+  
+  type flag =
+      {
+        flag_description:  string option;
+        flag_default:      bool conditional;
+      } 
+  
+  type source_repository =
+      {
+        src_repo_type:        vcs;
+        src_repo_location:    url;
+        src_repo_browser:     url option;
+        src_repo_module:      string option;
+        src_repo_branch:      string option;
+        src_repo_tag:         string option;
+        src_repo_subdir:      unix_filename option;
+      } 
+  
+  type test =
+      {
+        test_type:               [`Test] plugin;
+        test_command:            command_line conditional;
+        test_custom:             custom;
+        test_working_directory:  unix_filename option;
+        test_run:                bool conditional;
+        test_tools:              tool list;
+      } 
+  
+  type doc_format =
+    | HTML of unix_filename
+    | DocText
+    | PDF
+    | PostScript
+    | Info of unix_filename
+    | DVI
+    | OtherDoc
+    
+  
+  type doc =
+      {
+        doc_type:        [`Doc] plugin;
+        doc_custom:      custom;
+        doc_build:       bool conditional;
+        doc_install:     bool conditional;
+        doc_install_dir: unix_filename;
+        doc_title:       string;
+        doc_authors:     string list;
+        doc_abstract:    string option;
+        doc_format:      doc_format;
+        doc_data_files:  (unix_filename * unix_filename option) list;
+        doc_build_tools: tool list;
+      } 
+  
+  type section =
+    | Library    of common_section * build_section * library
+    | Executable of common_section * build_section * executable
+    | Flag       of common_section * flag
+    | SrcRepo    of common_section * source_repository
+    | Test       of common_section * test
+    | Doc        of common_section * doc
+    
+  
+  type section_kind =
+      [ `Library | `Executable | `Flag | `SrcRepo | `Test | `Doc ]
+  
+  type package = 
+      {
+        oasis_version:    OASISVersion.t;
+        ocaml_version:    OASISVersion.comparator option;
+        findlib_version:  OASISVersion.comparator option;
+        name:             package_name;
+        version:          OASISVersion.t;
+        license:          OASISLicense.t;
+        license_file:     unix_filename option;
+        copyrights:       string list;
+        maintainers:      string list;
+        authors:          string list;
+        homepage:         url option;
+        synopsis:         string;
+        description:      string option;
+        categories:       url list;
+  
+        conf_type:        [`Configure] plugin;
+        conf_custom:      custom;
+  
+        build_type:       [`Build] plugin;
+        build_custom:     custom;
+  
+        install_type:     [`Install] plugin;
+        install_custom:   custom;
+        uninstall_custom: custom;
+  
+        clean_custom:     custom;
+        distclean_custom: custom;
+  
+        files_ab:         unix_filename list;
+        sections:         section list;
+        plugins:          [`Extra] plugin list;
+        schema_data:      PropList.Data.t;
+        plugin_data:      plugin_data;
+      } 
+  
+end
+
+module OASISUnixPath = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISUnixPath.ml"
+  
+  type unix_filename = string
+  type unix_dirname = string
+  
+  type host_filename = string
+  type host_dirname = string
+  
+  let current_dir_name = "."
+  
+  let parent_dir_name = ".."
+  
+  let concat f1 f2 =
+    if f1 = current_dir_name then
+      f2
+    else if f2 = current_dir_name then
+      f1
+    else
+      f1^"/"^f2
+  
+  let make =
+    function
+      | hd :: tl ->
+          List.fold_left
+            (fun f p -> concat f p)
+            hd
+            tl
+      | [] ->
+          invalid_arg "OASISUnixPath.make"
+  
+  let dirname f =
+    try
+      String.sub f 0 (String.rindex f '/')
+    with Not_found ->
+      current_dir_name
+  
+  let basename f =
+    try
+      let pos_start =
+        (String.rindex f '/') + 1
+      in
+        String.sub f pos_start ((String.length f) - pos_start)
+    with Not_found ->
+      f
+  
+  let chop_extension f =
+    try
+      let last_dot =
+        String.rindex f '.'
+      in
+      let sub =
+        String.sub f 0 last_dot
+      in
+        try
+          let last_slash =
+            String.rindex f '/'
+          in
+            if last_slash < last_dot then
+              sub
+            else
+              f
+        with Not_found ->
+          sub
+  
+    with Not_found ->
+      f
+  
+  let capitalize_file f =
+    let dir = dirname f in
+    let base = basename f in
+    concat dir (String.capitalize base)
+  
+  let uncapitalize_file f =
+    let dir = dirname f in
+    let base = basename f in
+    concat dir (String.uncapitalize base)
+end
+
+module OASISSection = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISSection.ml"
+  
+  open OASISTypes
+  
+  let section_kind_common = 
+    function
+      | Library (cs, _, _) -> 
+          `Library, cs
+      | Executable (cs, _, _) ->
+          `Executable, cs
+      | Flag (cs, _) ->
+          `Flag, cs
+      | SrcRepo (cs, _) ->
+          `SrcRepo, cs
+      | Test (cs, _) ->
+          `Test, cs
+      | Doc (cs, _) ->
+          `Doc, cs
+  
+  let section_common sct =
+    snd (section_kind_common sct)
+  
+  let section_common_set cs =
+    function
+      | Library (_, bs, lib)     -> Library (cs, bs, lib)
+      | Executable (_, bs, exec) -> Executable (cs, bs, exec)
+      | Flag (_, flg)            -> Flag (cs, flg)
+      | SrcRepo (_, src_repo)    -> SrcRepo (cs, src_repo)
+      | Test (_, tst)            -> Test (cs, tst)
+      | Doc (_, doc)             -> Doc (cs, doc)
+  
+  (** Key used to identify section
+    *)
+  let section_id sct = 
+    let k, cs = 
+      section_kind_common sct
+    in
+      k, cs.cs_name
+  
+  let string_of_section sct =
+    let k, nm =
+      section_id sct
+    in
+      (match k with
+         | `Library    -> "library" 
+         | `Executable -> "executable"
+         | `Flag       -> "flag"
+         | `SrcRepo    -> "src repository"
+         | `Test       -> "test"
+         | `Doc        -> "doc")
+      ^" "^nm
+  
+end
+
+module OASISBuildSection = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISBuildSection.ml"
+  
+end
+
+module OASISExecutable = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExecutable.ml"
+  
+  open OASISTypes
+  
+  let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program = 
+    let dir = 
+      OASISUnixPath.concat
+        bs.bs_path
+        (OASISUnixPath.dirname exec.exec_main_is)
+    in
+    let is_native_exec = 
+      match bs.bs_compiled_object with
+        | Native -> true
+        | Best -> is_native ()
+        | Byte -> false
+    in
+  
+      OASISUnixPath.concat
+        dir
+        (cs.cs_name^(suffix_program ())),
+  
+      if not is_native_exec && 
+         not exec.exec_custom && 
+         bs.bs_c_sources <> [] then
+        Some (dir^"/dll"^cs.cs_name^(ext_dll ()))
+      else
+        None
+  
+end
+
+module OASISLibrary = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISLibrary.ml"
+  
+  open OASISTypes
+  open OASISUtils
+  open OASISGettext
+  
+  type library_name = name
+  
+  (* Look for a module file, considering capitalization or not. *)
+  let find_module source_file_exists (cs, bs, lib) modul =
+    let possible_base_fn =
+      List.map
+        (OASISUnixPath.concat bs.bs_path)
+        [modul;
+         OASISUnixPath.uncapitalize_file modul;
+         OASISUnixPath.capitalize_file modul]
+    in
+      (* TODO: we should be able to be able to determine the source for every
+       * files. Hence we should introduce a Module(source: fn) for the fields
+       * Modules and InternalModules
+       *)
+      List.fold_left
+        (fun acc base_fn ->
+           match acc with
+             | `No_sources _ ->
+                 begin
+                   let file_found =
+                     List.fold_left
+                       (fun acc ext ->
+                          if source_file_exists (base_fn^ext) then
+                            (base_fn^ext) :: acc
+                          else
+                            acc)
+                       []
+                       [".ml"; ".mli"; ".mll"; ".mly"]
+                   in
+                     match file_found with
+                       | [] ->
+                           acc
+                       | lst ->
+                           `Sources (base_fn, lst)
+                 end
+             | `Sources _ ->
+                 acc)
+        (`No_sources possible_base_fn)
+        possible_base_fn
+  
+  let source_unix_files ~ctxt (cs, bs, lib) source_file_exists =
+    List.fold_left
+      (fun acc modul ->
+         match find_module source_file_exists (cs, bs, lib) modul with
+           | `Sources (base_fn, lst) ->
+               (base_fn, lst) :: acc
+           | `No_sources _ ->
+               OASISMessage.warning
+                 ~ctxt
+                 (f_ "Cannot find source file matching \
+                      module '%s' in library %s")
+                 modul cs.cs_name;
+               acc)
+      []
+      (lib.lib_modules @ lib.lib_internal_modules)
+  
+  let generated_unix_files ~ctxt (cs, bs, lib)
+        source_file_exists is_native ext_lib ext_dll =
+  
+    let find_modules lst ext = 
+      let find_module modul =
+        match find_module source_file_exists (cs, bs, lib) modul with
+          | `Sources (base_fn, _) ->
+              [base_fn]
+          | `No_sources lst ->
+              OASISMessage.warning
+                ~ctxt
+                (f_ "Cannot find source file matching \
+                     module '%s' in library %s")
+                modul cs.cs_name;
+              lst
+      in
+      List.map 
+        (fun nm -> 
+           List.map 
+             (fun base_fn -> base_fn ^"."^ext)
+             (find_module nm))
+        lst
+    in
+  
+    (* The headers that should be compiled along *)
+    let headers =
+      if lib.lib_pack then
+        []
+      else
+        find_modules
+          lib.lib_modules
+          "cmi"
+    in
+  
+    (* The .cmx that be compiled along *)
+    let cmxs =
+      let should_be_built =
+        (not lib.lib_pack) && (* Do not install .cmx packed submodules *)
+        match bs.bs_compiled_object with
+          | Native -> true
+          | Best -> is_native ()
+          | Byte -> false
+      in
+        if should_be_built then
+          find_modules
+            (lib.lib_modules @ lib.lib_internal_modules)
+            "cmx"
+        else
+          []
+    in
+  
+    let acc_nopath =
+      []
+    in
+  
+    (* Compute what libraries should be built *)
+    let acc_nopath =
+      (* Add the packed header file if required *)
+      let add_pack_header acc =
+        if lib.lib_pack then
+          [cs.cs_name^".cmi"] :: acc
+        else
+          acc
+      in
+      let byte acc =
+        add_pack_header ([cs.cs_name^".cma"] :: acc)
+      in
+      let native acc =
+        add_pack_header ([cs.cs_name^".cmxa"] :: [cs.cs_name^(ext_lib ())] :: acc)
+      in
+        match bs.bs_compiled_object with
+          | Native ->
+              byte (native acc_nopath)
+          | Best when is_native () ->
+              byte (native acc_nopath)
+          | Byte | Best ->
+              byte acc_nopath
+    in
+  
+    (* Add C library to be built *)
+    let acc_nopath =
+      if bs.bs_c_sources <> [] then
+        begin
+          ["lib"^cs.cs_name^(ext_lib ())]
+          ::
+          ["dll"^cs.cs_name^(ext_dll ())]
+          ::
+          acc_nopath
+        end
+      else
+        acc_nopath
+    in
+  
+      (* All the files generated *)
+      List.rev_append
+        (List.rev_map
+           (List.rev_map
+              (OASISUnixPath.concat bs.bs_path))
+           acc_nopath)
+        (headers @ cmxs)
+  
+  
+  type group_t =
+    | Container of findlib_name * (group_t list)
+    | Package of (findlib_name *
+                  common_section *
+                  build_section *
+                  library *
+                  (group_t list))
+  
+  let group_libs pkg =
+    (** Associate a name with its children *)
+    let children =
+      List.fold_left
+        (fun mp ->
+           function
+             | Library (cs, bs, lib) ->
+                 begin
+                   match lib.lib_findlib_parent with
+                     | Some p_nm ->
+                         begin
+                           let children =
+                             try
+                               MapString.find p_nm mp
+                             with Not_found ->
+                               []
+                           in
+                             MapString.add p_nm ((cs, bs, lib) :: children) mp
+                         end
+                     | None ->
+                         mp
+                 end
+             | _ ->
+                 mp)
+        MapString.empty
+        pkg.sections
+    in
+  
+    (* Compute findlib name of a single node *)
+    let findlib_name (cs, _, lib) =
+      match lib.lib_findlib_name with
+        | Some nm -> nm
+        | None -> cs.cs_name
+    in
+  
+    (** Build a package tree *)
+    let rec tree_of_library containers ((cs, bs, lib) as acc) =
+      match containers with
+        | hd :: tl ->
+            Container (hd, [tree_of_library tl acc])
+        | [] ->
+            Package 
+              (findlib_name acc, cs, bs, lib,
+               (try
+                  List.rev_map
+                    (fun ((_, _, child_lib) as child_acc) ->
+                       tree_of_library
+                         child_lib.lib_findlib_containers
+                         child_acc)
+                    (MapString.find cs.cs_name children)
+                with Not_found ->
+                  []))
+    in
+  
+    (** Merge containers with the same name *)
+    let rec merge_containers groups =
+      (* Collect packages and create the map "container name -> merged children" *)
+      let packages, containers =
+        List.fold_left
+          (fun (packages, containers) group ->
+             match group with
+               | Container(name, children) ->
+                   let children' =
+                     try
+                       MapString.find name containers
+                     with Not_found ->
+                       []
+                   in
+                   (packages,
+                    MapString.add name (children' @ children) containers)
+               | Package(name, cs, bs, lib, children) ->
+                   (Package(name, cs, bs, lib, merge_containers children) :: packages,
+                    containers))
+          ([], MapString.empty)
+          groups
+      in
+      (* Recreate the list of groups *)
+      packages @
+        (MapString.fold
+           (fun name children acc ->
+              Container(name, merge_containers children) :: acc)
+           containers [])
+    in
+  
+      (* TODO: check that libraries are unique *)
+      merge_containers
+        (List.fold_left
+           (fun acc ->
+              function
+                | Library (cs, bs, lib) when lib.lib_findlib_parent = None -> 
+                    (tree_of_library lib.lib_findlib_containers (cs, bs, lib)) :: acc
+                | _ ->
+                    acc)
+           []
+           pkg.sections)
+  
+  (** Compute internal to findlib library matchings, including subpackage
+      and return a map of it.
+    *)
+  let findlib_name_map pkg =
+  
+    (* Compute names in a tree *)
+    let rec findlib_names_aux path mp grp =
+      let fndlb_nm, children, mp =
+        match grp with
+          | Container (fndlb_nm, children) ->
+              fndlb_nm, children, mp
+  
+          | Package (fndlb_nm, {cs_name = nm}, _, _, children) ->
+              fndlb_nm, children, (MapString.add nm (path, fndlb_nm) mp)
+      in
+      let fndlb_nm_full =
+        (match path with
+           | Some pth -> pth^"."
+           | None -> "")^
+        fndlb_nm
+      in
+        List.fold_left
+          (findlib_names_aux (Some fndlb_nm_full))
+          mp
+          children
+    in
+  
+      List.fold_left
+        (findlib_names_aux None)
+        MapString.empty
+        (group_libs pkg)
+  
+  
+  let findlib_of_name ?(recurse=false) map nm =
+    try
+      let (path, fndlb_nm) =
+        MapString.find nm map
+      in
+        match path with
+          | Some pth when recurse -> pth^"."^fndlb_nm
+          | _ -> fndlb_nm
+  
+    with Not_found ->
+      failwithf
+        (f_ "Unable to translate internal library '%s' to findlib name")
+        nm
+  
+  let name_findlib_map pkg =
+    let mp =
+      findlib_name_map pkg
+    in
+      MapString.fold
+        (fun nm _ acc ->
+           let fndlb_nm_full =
+             findlib_of_name
+               ~recurse:true
+               mp
+               nm
+           in
+             MapString.add fndlb_nm_full nm acc)
+        mp
+        MapString.empty
+  
+  let findlib_of_group =
+    function
+      | Container (fndlb_nm, _)
+      | Package (fndlb_nm, _, _, _, _) -> fndlb_nm
+  
+  let root_of_group grp =
+    let rec root_lib_aux =
+      function
+        | Container (_, children) ->
+            root_lib_lst children
+        | Package (_, cs, bs, lib, children) ->
+            if lib.lib_findlib_parent = None then
+              cs, bs, lib
+            else
+              root_lib_lst children
+    and root_lib_lst =
+      function
+        | [] ->
+            raise Not_found
+        | hd :: tl ->
+            try
+              root_lib_aux hd
+            with Not_found ->
+              root_lib_lst tl
+    in
+      try
+        root_lib_aux grp
+      with Not_found ->
+        failwithf
+          (f_ "Unable to determine root library of findlib library '%s'")
+          (findlib_of_group grp)
+  
+  
+end
+
+module OASISFlag = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISFlag.ml"
+  
+end
+
+module OASISPackage = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISPackage.ml"
+  
+end
+
+module OASISSourceRepository = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISSourceRepository.ml"
+  
+end
+
+module OASISTest = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTest.ml"
+  
+end
+
+module OASISDocument = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISDocument.ml"
+  
+end
+
+
+module BaseEnvLight = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnvLight.ml"
+  
+  module MapString = Map.Make(String)
+  
+  type t = string MapString.t
+  
+  let default_filename =
+    Filename.concat
+      (Sys.getcwd ())
+      "setup.data"
+  
+  let load ?(allow_empty=false) ?(filename=default_filename) () =
+    if Sys.file_exists filename then
+      begin
+        let chn =
+          open_in_bin filename
+        in
+        let st =
+          Stream.of_channel chn
+        in
+        let line =
+          ref 1
+        in
+        let st_line =
+          Stream.from
+            (fun _ ->
+               try
+                 match Stream.next st with
+                   | '\n' -> incr line; Some '\n'
+                   | c -> Some c
+               with Stream.Failure -> None)
+        in
+        let lexer =
+          Genlex.make_lexer ["="] st_line
+        in
+        let rec read_file mp =
+          match Stream.npeek 3 lexer with
+            | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] ->
+                Stream.junk lexer;
+                Stream.junk lexer;
+                Stream.junk lexer;
+                read_file (MapString.add nm value mp)
+            | [] ->
+                mp
+            | _ ->
+                failwith
+                  (Printf.sprintf
+                     "Malformed data file '%s' line %d"
+                     filename !line)
+        in
+        let mp =
+          read_file MapString.empty
+        in
+          close_in chn;
+          mp
+      end
+    else if allow_empty then
+      begin
+        MapString.empty
+      end
+    else
+      begin
+        failwith
+          (Printf.sprintf
+             "Unable to load environment, the file '%s' doesn't exist."
+             filename)
+      end
+  
+  let var_get name env =
+    let rec var_expand str =
+      let buff =
+        Buffer.create ((String.length str) * 2)
+      in
+        Buffer.add_substitute
+          buff
+          (fun var ->
+             try
+               var_expand (MapString.find var env)
+             with Not_found ->
+               failwith
+                 (Printf.sprintf
+                    "No variable %s defined when trying to expand %S."
+                    var
+                    str))
+          str;
+        Buffer.contents buff
+    in
+      var_expand (MapString.find name env)
+  
+  let var_choose lst env =
+    OASISExpr.choose
+      (fun nm -> var_get nm env)
+      lst
+end
+
+
+module BaseContext = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseContext.ml"
+  
+  open OASISContext
+  
+  let args = args
+  
+  let default = default
+  
+end
+
+module BaseMessage = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseMessage.ml"
+  
+  (** Message to user, overrid for Base
+      @author Sylvain Le Gall
+    *)
+  open OASISMessage
+  open BaseContext
+  
+  let debug fmt   = debug ~ctxt:!default fmt
+  
+  let info fmt    = info ~ctxt:!default fmt
+  
+  let warning fmt = warning ~ctxt:!default fmt
+  
+  let error fmt = error ~ctxt:!default fmt
+  
+end
+
+module BaseFilePath = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFilePath.ml"
+  
+  
+  open Filename
+  
+  module Unix = OASISUnixPath
+  
+  let make =
+    function
+      | [] ->
+          invalid_arg "BaseFilename.make"
+      | hd :: tl ->
+          List.fold_left Filename.concat hd tl
+  
+  let of_unix ufn =
+    if Sys.os_type = "Unix" then
+      ufn
+    else
+      make
+        (List.map
+           (fun p ->
+              if p = Unix.current_dir_name then
+                current_dir_name
+              else if p = Unix.parent_dir_name then
+                parent_dir_name
+              else
+                p)
+           (OASISUtils.split '/' ufn))
+  
+end
+
+module BaseEnv = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnv.ml"
+  
+  open OASISGettext
+  open OASISUtils
+  open PropList
+  
+  module MapString = BaseEnvLight.MapString
+  
+  type origin_t =
+    | ODefault
+    | OGetEnv
+    | OFileLoad
+    | OCommandLine
+  
+  type cli_handle_t =
+    | CLINone
+    | CLIAuto
+    | CLIWith
+    | CLIEnable
+    | CLIUser of (Arg.key * Arg.spec * Arg.doc) list
+  
+  type definition_t =
+      {
+        hide:       bool;
+        dump:       bool;
+        cli:        cli_handle_t;
+        arg_help:   string option;
+        group:      string option;
+      }
+  
+  let schema =
+    Schema.create "environment"
+  
+  (* Environment data *)
+  let env =
+    Data.create ()
+  
+  (* Environment data from file *)
+  let env_from_file =
+    ref MapString.empty
+  
+  (* Lexer for var *)
+  let var_lxr =
+    Genlex.make_lexer []
+  
+  let rec var_expand str =
+    let buff =
+      Buffer.create ((String.length str) * 2)
+    in
+      Buffer.add_substitute
+        buff
+        (fun var ->
+           try
+             (* TODO: this is a quick hack to allow calling Test.Command
+              * without defining executable name really. I.e. if there is
+              * an exec Executable toto, then $(toto) should be replace
+              * by its real name. It is however useful to have this function
+              * for other variable that depend on the host and should be
+              * written better than that.
+              *)
+             let st =
+               var_lxr (Stream.of_string var)
+             in
+               match Stream.npeek 3 st with
+                 | [Genlex.Ident "utoh"; Genlex.Ident nm] ->
+                     BaseFilePath.of_unix (var_get nm)
+                 | [Genlex.Ident "utoh"; Genlex.String s] ->
+                     BaseFilePath.of_unix s
+                 | [Genlex.Ident "ocaml_escaped"; Genlex.Ident nm] ->
+                     String.escaped (var_get nm)
+                 | [Genlex.Ident "ocaml_escaped"; Genlex.String s] ->
+                     String.escaped s
+                 | [Genlex.Ident nm] ->
+                     var_get nm
+                 | _ ->
+                     failwithf
+                       (f_ "Unknown expression '%s' in variable expansion of %s.")
+                       var
+                       str
+           with
+             | Unknown_field (_, _) ->
+                 failwithf
+                   (f_ "No variable %s defined when trying to expand %S.")
+                   var
+                   str
+             | Stream.Error e ->
+                 failwithf
+                   (f_ "Syntax error when parsing '%s' when trying to \
+                        expand %S: %s")
+                   var
+                   str
+                   e)
+        str;
+      Buffer.contents buff
+  
+  and var_get name =
+    let vl =
+      try
+        Schema.get schema env name
+      with Unknown_field _ as e ->
+        begin
+          try
+            MapString.find name !env_from_file
+          with Not_found ->
+            raise e
+        end
+    in
+      var_expand vl
+  
+  let var_choose ?printer ?name lst =
+    OASISExpr.choose
+      ?printer
+      ?name
+      var_get
+      lst
+  
+  let var_protect vl =
+    let buff =
+      Buffer.create (String.length vl)
+    in
+      String.iter
+        (function
+           | '$' -> Buffer.add_string buff "\\$"
+           | c   -> Buffer.add_char   buff c)
+        vl;
+      Buffer.contents buff
+  
+  let var_define
+        ?(hide=false)
+        ?(dump=true)
+        ?short_desc
+        ?(cli=CLINone)
+        ?arg_help
+        ?group
+        name (* TODO: type constraint on the fact that name must be a valid OCaml
+                  id *)
+        dflt =
+  
+    let default =
+      [
+        OFileLoad, (fun () -> MapString.find name !env_from_file);
+        ODefault,  dflt;
+        OGetEnv,   (fun () -> Sys.getenv name);
+      ]
+    in
+  
+    let extra =
+      {
+        hide     = hide;
+        dump     = dump;
+        cli      = cli;
+        arg_help = arg_help;
+        group    = group;
+      }
+    in
+  
+    (* Try to find a value that can be defined
+     *)
+    let var_get_low lst =
+      let errors, res =
+        List.fold_left
+          (fun (errors, res) (o, v) ->
+             if res = None then
+               begin
+                 try
+                   errors, Some (v ())
+                 with
+                   | Not_found ->
+                        errors, res
+                   | Failure rsn ->
+                       (rsn :: errors), res
+                   | e ->
+                       (Printexc.to_string e) :: errors, res
+               end
+             else
+               errors, res)
+          ([], None)
+          (List.sort
+             (fun (o1, _) (o2, _) ->
+                Pervasives.compare o2 o1)
+             lst)
+      in
+        match res, errors with
+          | Some v, _ ->
+              v
+          | None, [] ->
+              raise (Not_set (name, None))
+          | None, lst ->
+              raise (Not_set (name, Some (String.concat (s_ ", ") lst)))
+    in
+  
+    let help =
+      match short_desc with
+        | Some fs -> Some fs
+        | None -> None
+    in
+  
+    let var_get_lst =
+      FieldRO.create
+        ~schema
+        ~name
+        ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s])
+        ~print:var_get_low
+        ~default
+        ~update:(fun ?context x old_x -> x @ old_x)
+        ?help
+        extra
+    in
+  
+      fun () ->
+        var_expand (var_get_low (var_get_lst env))
+  
+  let var_redefine
+        ?hide
+        ?dump
+        ?short_desc
+        ?cli
+        ?arg_help
+        ?group
+        name
+        dflt =
+    if Schema.mem schema name then
+      begin
+        (* TODO: look suspsicious, we want to memorize dflt not dflt () *)
+        Schema.set schema env ~context:ODefault name (dflt ());
+        fun () -> var_get name
+      end
+    else
+      begin
+        var_define
+          ?hide
+          ?dump
+          ?short_desc
+          ?cli
+          ?arg_help
+          ?group
+          name
+          dflt
+      end
+  
+  let var_ignore (e : unit -> string) =
+    ()
+  
+  let print_hidden =
+    var_define
+      ~hide:true
+      ~dump:false
+      ~cli:CLIAuto
+      ~arg_help:"Print even non-printable variable. (debug)"
+      "print_hidden"
+      (fun () -> "false")
+  
+  let var_all () =
+    List.rev
+      (Schema.fold
+         (fun acc nm def _ ->
+            if not def.hide || bool_of_string (print_hidden ()) then
+              nm :: acc
+            else
+              acc)
+         []
+         schema)
+  
+  let default_filename =
+    BaseEnvLight.default_filename
+  
+  let load ?allow_empty ?filename () =
+    env_from_file := BaseEnvLight.load ?allow_empty ?filename ()
+  
+  let unload () =
+    env_from_file := MapString.empty;
+    Data.clear env
+  
+  let dump ?(filename=default_filename) () =
+    let chn =
+      open_out_bin filename
+    in
+    let output nm value = 
+      Printf.fprintf chn "%s=%S\n" nm value
+    in
+    let mp_todo = 
+      (* Dump data from schema *)
+      Schema.fold
+        (fun mp_todo nm def _ ->
+           if def.dump then
+             begin
+               try
+                 let value =
+                   Schema.get
+                     schema
+                     env
+                     nm
+                 in
+                   output nm value
+               with Not_set _ ->
+                 ()
+             end;
+           MapString.remove nm mp_todo)
+        !env_from_file
+        schema
+    in
+      (* Dump data defined outside of schema *)
+      MapString.iter output mp_todo;
+  
+      (* End of the dump *)
+      close_out chn
+  
+  let print () =
+    let printable_vars =
+      Schema.fold
+        (fun acc nm def short_descr_opt ->
+           if not def.hide || bool_of_string (print_hidden ()) then
+             begin
+               try
+                 let value =
+                   Schema.get
+                     schema
+                     env
+                     nm
+                 in
+                 let txt =
+                   match short_descr_opt with
+                     | Some s -> s ()
+                     | None -> nm
+                 in
+                   (txt, value) :: acc
+               with Not_set _ ->
+                   acc
+             end
+           else
+             acc)
+        []
+        schema
+    in
+    let max_length =
+      List.fold_left max 0
+        (List.rev_map String.length
+           (List.rev_map fst printable_vars))
+    in
+    let dot_pad str =
+      String.make ((max_length - (String.length str)) + 3) '.'
+    in
+  
+    Printf.printf "\nConfiguration: \n";
+    List.iter
+      (fun (name,value) ->
+        Printf.printf "%s: %s %s\n" name (dot_pad name) value)
+      (List.rev printable_vars);
+    Printf.printf "\n%!"
+  
+  let args () =
+    let arg_concat =
+      OASISUtils.varname_concat ~hyphen:'-'
+    in
+      [
+        "--override",
+         Arg.Tuple
+           (
+             let rvr = ref ""
+             in
+             let rvl = ref ""
+             in
+               [
+                 Arg.Set_string rvr;
+                 Arg.Set_string rvl;
+                 Arg.Unit
+                   (fun () ->
+                      Schema.set
+                        schema
+                        env
+                        ~context:OCommandLine
+                        !rvr
+                        !rvl)
+               ]
+           ),
+        "var+val  Override any configuration variable.";
+  
+      ]
+      @
+      List.flatten
+        (Schema.fold
+          (fun acc name def short_descr_opt ->
+             let var_set s =
+               Schema.set
+                 schema
+                 env
+                 ~context:OCommandLine
+                 name
+                 s
+             in
+  
+             let arg_name =
+               OASISUtils.varname_of_string ~hyphen:'-' name
+             in
+  
+             let hlp =
+               match short_descr_opt with
+                 | Some txt -> txt ()
+                 | None -> ""
+             in
+  
+             let arg_hlp =
+               match def.arg_help with
+                 | Some s -> s
+                 | None   -> "str"
+             in
+  
+             let default_value =
+               try
+                 Printf.sprintf
+                   (f_ " [%s]")
+                   (Schema.get
+                      schema
+                      env
+                      name)
+               with Not_set _ ->
+                 ""
+             in
+  
+             let args =
+               match def.cli with
+                 | CLINone ->
+                     []
+                 | CLIAuto ->
+                     [
+                       arg_concat "--" arg_name,
+                       Arg.String var_set,
+                       Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value
+                     ]
+                 | CLIWith ->
+                     [
+                       arg_concat "--with-" arg_name,
+                       Arg.String var_set,
+                       Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value
+                     ]
+                 | CLIEnable ->
+                     let dflt =
+                       if default_value = " [true]" then
+                         s_ " [default: enabled]"
+                       else
+                         s_ " [default: disabled]"
+                     in
+                       [
+                         arg_concat "--enable-" arg_name,
+                         Arg.Unit (fun () -> var_set "true"),
+                         Printf.sprintf (f_ " %s%s") hlp dflt;
+  
+                         arg_concat "--disable-" arg_name,
+                         Arg.Unit (fun () -> var_set "false"),
+                         Printf.sprintf (f_ " %s%s") hlp dflt
+                       ]
+                 | CLIUser lst ->
+                     lst
+             in
+               args :: acc)
+           []
+           schema)
+end
+
+module BaseExec = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseExec.ml"
+  
+  open OASISGettext
+  open OASISUtils
+  open BaseMessage
+  
+  let run ?f_exit_code cmd args =
+    let cmdline =
+      String.concat " " (cmd :: args)
+    in
+      info (f_ "Running command '%s'") cmdline;
+      match f_exit_code, Sys.command cmdline with
+        | None, 0 -> ()
+        | None, i ->
+            failwithf
+              (f_ "Command '%s' terminated with error code %d")
+              cmdline i
+        | Some f, i ->
+            f i
+  
+  let run_read_output ?f_exit_code cmd args =
+    let fn =
+      Filename.temp_file "oasis-" ".txt"
+    in
+    let () =
+      try
+        run ?f_exit_code cmd (args @ [">"; Filename.quote fn])
+      with e ->
+        Sys.remove fn;
+        raise e
+    in
+    let chn =
+      open_in fn
+    in
+    let routput =
+      ref []
+    in
+      (
+        try
+          while true do
+            routput := (input_line chn) :: !routput
+          done
+        with End_of_file ->
+          ()
+      );
+      close_in chn;
+      Sys.remove fn;
+      List.rev !routput
+  
+  let run_read_one_line ?f_exit_code cmd args =
+    match run_read_output ?f_exit_code cmd args with
+      | [fst] ->
+          fst
+      | lst ->
+          failwithf
+            (f_ "Command return unexpected output %S")
+            (String.concat "\n" lst)
+end
+
+module BaseFileUtil = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFileUtil.ml"
+  
+  open OASISGettext
+  
+  let find_file paths exts =
+  
+    (* Cardinal product of two list *)
+    let ( * ) lst1 lst2 =
+      List.flatten
+        (List.map
+           (fun a ->
+              List.map
+                (fun b -> a,b)
+                lst2)
+           lst1)
+    in
+  
+    let rec combined_paths lst =
+      match lst with
+        | p1 :: p2 :: tl ->
+            let acc =
+              (List.map
+                 (fun (a,b) -> Filename.concat a b)
+                 (p1 * p2))
+            in
+              combined_paths (acc :: tl)
+        | [e] ->
+            e
+        | [] ->
+            []
+    in
+  
+    let alternatives =
+      List.map
+        (fun (p,e) ->
+           if String.length e > 0 && e.[0] <> '.' then
+             p ^ "." ^ e
+           else
+             p ^ e)
+        ((combined_paths paths) * exts)
+    in
+      List.find
+        Sys.file_exists
+        alternatives
+  
+  let which prg =
+    let path_sep =
+      match Sys.os_type with
+        | "Win32" ->
+            ';'
+        | _ ->
+            ':'
+    in
+    let path_lst =
+      OASISUtils.split
+        path_sep
+        (Sys.getenv "PATH")
+    in
+    let exec_ext =
+      match Sys.os_type with
+        | "Win32" ->
+            ""
+            ::
+            (OASISUtils.split
+               path_sep
+               (Sys.getenv "PATHEXT"))
+        | _ ->
+            [""]
+    in
+      find_file [path_lst; [prg]] exec_ext
+  
+  (**/**)
+  let rec fix_dir dn =
+    (* Windows hack because Sys.file_exists "src\\" = false when
+     * Sys.file_exists "src" = true
+     *)
+    let ln =
+      String.length dn
+    in
+      if Sys.os_type = "Win32" && ln > 0 && dn.[ln - 1] = '\\' then
+        fix_dir (String.sub dn 0 (ln - 1))
+      else
+        dn
+  
+  let q = Filename.quote
+  (**/**)
+  
+  let cp src tgt =
+    BaseExec.run
+      (match Sys.os_type with
+       | "Win32" -> "copy"
+       | _ -> "cp")
+      [q src; q tgt]
+  
+  let mkdir tgt =
+    BaseExec.run
+      (match Sys.os_type with
+         | "Win32" -> "md"
+         | _ -> "mkdir")
+      [q tgt]
+  
+  let rec mkdir_parent f tgt =
+    let tgt =
+      fix_dir tgt
+    in
+      if Sys.file_exists tgt then
+        begin
+          if not (Sys.is_directory tgt) then
+            OASISUtils.failwithf
+              (f_ "Cannot create directory '%s', a file of the same name already \
+                   exists")
+              tgt
+        end
+      else
+        begin
+          mkdir_parent f (Filename.dirname tgt);
+          if not (Sys.file_exists tgt) then
+            begin
+              f tgt;
+              mkdir tgt
+            end
+        end
+  
+  let rmdir tgt =
+    if Sys.readdir tgt = [||] then
+      begin
+        match Sys.os_type with
+          | "Win32" ->
+              BaseExec.run "rd" [q tgt]
+          | _ ->
+              BaseExec.run "rm" ["-r"; q tgt]
+      end
+  
+  let glob fn =
+   let basename =
+     Filename.basename fn
+   in
+     if String.length basename >= 2 &&
+        basename.[0] = '*' &&
+        basename.[1] = '.' then
+       begin
+         let ext_len =
+           (String.length basename) - 2
+         in
+         let ext =
+           String.sub basename 2 ext_len
+         in
+         let dirname =
+           Filename.dirname fn
+         in
+           Array.fold_left
+             (fun acc fn ->
+                try
+                  let fn_ext =
+                    String.sub
+                      fn
+                      ((String.length fn) - ext_len)
+                      ext_len
+                  in
+                    if fn_ext = ext then
+                      (Filename.concat dirname fn) :: acc
+                    else
+                      acc
+                with Invalid_argument _ ->
+                  acc)
+             []
+             (Sys.readdir dirname)
+       end
+     else
+       begin
+         if Sys.file_exists fn then
+           [fn]
+         else
+           []
+       end
+end
+
+module BaseArgExt = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseArgExt.ml"
+  
+  open OASISUtils
+  open OASISGettext
+  
+  let parse argv args =
+      (* Simulate command line for Arg *)
+      let current =
+        ref 0
+      in
+  
+        try
+          Arg.parse_argv
+            ~current:current
+            (Array.concat [[|"none"|]; argv])
+            (Arg.align args)
+            (failwithf (f_ "Don't know what to do with arguments: '%s'"))
+            (s_ "configure options:")
+        with
+          | Arg.Help txt ->
+              print_endline txt;
+              exit 0
+          | Arg.Bad txt ->
+              prerr_endline txt;
+              exit 1
+end
+
+module BaseCheck = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseCheck.ml"
+  
+  open BaseEnv
+  open BaseMessage
+  open OASISUtils
+  open OASISGettext
+  
+  let prog_best prg prg_lst =
+    var_redefine
+      prg
+      (fun () ->
+         let alternate =
+           List.fold_left
+             (fun res e ->
+                match res with
+                  | Some _ ->
+                      res
+                  | None ->
+                      try
+                        Some (BaseFileUtil.which e)
+                      with Not_found ->
+                        None)
+             None
+             prg_lst
+         in
+           match alternate with
+             | Some prg -> prg
+             | None -> raise Not_found)
+  
+  let prog prg =
+    prog_best prg [prg]
+  
+  let prog_opt prg =
+    prog_best prg [prg^".opt"; prg]
+  
+  let ocamlfind =
+    prog "ocamlfind"
+  
+  let version
+        var_prefix
+        cmp
+        fversion
+        () =
+    (* Really compare version provided *)
+    let var =
+      var_prefix^"_version_"^(OASISVersion.varname_of_comparator cmp)
+    in
+      var_redefine
+        ~hide:true
+        var
+        (fun () ->
+           let version_str =
+             match fversion () with
+               | "[Distributed with OCaml]" ->
+                   begin
+                     try
+                       (var_get "ocaml_version")
+                     with Not_found ->
+                       warning
+                         (f_ "Variable ocaml_version not defined, fallback \
+                              to default");
+                       Sys.ocaml_version
+                   end
+               | res ->
+                   res
+           in
+           let version =
+             OASISVersion.version_of_string version_str
+           in
+             if OASISVersion.comparator_apply version cmp then
+               version_str
+             else
+               failwithf
+                 (f_ "Cannot satisfy version constraint on %s: %s (version: %s)")
+                 var_prefix
+                 (OASISVersion.string_of_comparator cmp)
+                 version_str)
+        ()
+  
+  let package_version pkg =
+    BaseExec.run_read_one_line
+      (ocamlfind ())
+      ["query"; "-format"; "%v"; pkg]
+  
+  let package ?version_comparator pkg () =
+    let var =
+      OASISUtils.varname_concat
+        "pkg_"
+        (OASISUtils.varname_of_string pkg)
+    in
+    let findlib_dir pkg =
+      let dir =
+        BaseExec.run_read_one_line
+          (ocamlfind ())
+          ["query"; "-format"; "%d"; pkg]
+      in
+        if Sys.file_exists dir && Sys.is_directory dir then
+          dir
+        else
+          failwithf
+            (f_ "When looking for findlib package %s, \
+                 directory %s return doesn't exist")
+            pkg dir
+    in
+    let vl =
+      var_redefine
+        var
+        (fun () -> findlib_dir pkg)
+        ()
+    in
+      (
+        match version_comparator with
+          | Some ver_cmp ->
+              ignore
+                (version
+                   var
+                   ver_cmp
+                   (fun _ -> package_version pkg)
+                   ())
+          | None ->
+              ()
+      );
+      vl
+end
+
+module BaseOCamlcConfig = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseOCamlcConfig.ml"
+  
+  
+  open BaseEnv
+  open OASISUtils
+  open OASISGettext
+  
+  module SMap = Map.Make(String)
+  
+  let ocamlc =
+    BaseCheck.prog_opt "ocamlc"
+  
+  let ocamlc_config_map =
+    (* Map name to value for ocamlc -config output
+       (name ^": "^value)
+     *)
+    let rec split_field mp lst =
+      match lst with
+        | line :: tl ->
+            let mp =
+              try
+                let pos_semicolon =
+                  String.index line ':'
+                in
+                  if pos_semicolon > 1 then
+                    (
+                      let name =
+                        String.sub line 0 pos_semicolon
+                      in
+                      let linelen =
+                        String.length line
+                      in
+                      let value =
+                        if linelen > pos_semicolon + 2 then
+                          String.sub
+                            line
+                            (pos_semicolon + 2)
+                            (linelen - pos_semicolon - 2)
+                        else
+                          ""
+                      in
+                        SMap.add name value mp
+                    )
+                  else
+                    (
+                      mp
+                    )
+              with Not_found ->
+                (
+                  mp
+                )
+            in
+              split_field mp tl
+        | [] ->
+            mp
+    in
+  
+    let cache = 
+      lazy
+        (var_protect
+           (Marshal.to_string
+              (split_field
+                 SMap.empty
+                 (BaseExec.run_read_output
+                    (ocamlc ()) ["-config"]))
+              []))
+    in
+      var_redefine
+        "ocamlc_config_map"
+        ~hide:true
+        ~dump:false
+        (fun () ->
+           (* TODO: update if ocamlc change !!! *)
+           Lazy.force cache)
+  
+  let var_define nm =
+    (* Extract data from ocamlc -config *)
+    let avlbl_config_get () =
+      Marshal.from_string
+        (ocamlc_config_map ())
+        0
+    in
+    let chop_version_suffix s =
+      try 
+        String.sub s 0 (String.index s '+')
+      with _ -> 
+        s
+     in
+  
+    let nm_config, value_config =
+      match nm with
+        | "ocaml_version" -> 
+            "version", chop_version_suffix
+        | _ -> nm, (fun x -> x)
+    in
+      var_redefine
+        nm
+        (fun () ->
+          try
+             let map =
+               avlbl_config_get ()
+             in
+             let value =
+               SMap.find nm_config map
+             in
+               value_config value
+           with Not_found ->
+             failwithf
+               (f_ "Cannot find field '%s' in '%s -config' output")
+               nm
+               (ocamlc ()))
+  
+end
+
+module BaseStandardVar = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseStandardVar.ml"
+  
+  
+  open OASISGettext
+  open OASISTypes
+  open OASISExpr
+  open BaseCheck
+  open BaseEnv
+  
+  let ocamlfind  = BaseCheck.ocamlfind
+  let ocamlc     = BaseOCamlcConfig.ocamlc
+  let ocamlopt   = prog_opt "ocamlopt"
+  let ocamlbuild = prog "ocamlbuild"
+  
+  
+  (**/**)
+  let rpkg =
+    ref None
+  
+  let pkg_get () =
+    match !rpkg with
+      | Some pkg -> pkg
+      | None -> failwith (s_ "OASIS Package is not set")
+  (**/**)
+  
+  let pkg_name =
+    var_define
+      ~short_desc:(fun () -> s_ "Package name")
+      "pkg_name"
+      (fun () -> (pkg_get ()).name)
+  
+  let pkg_version =
+    var_define
+      ~short_desc:(fun () -> s_ "Package version")
+      "pkg_version"
+      (fun () ->
+         (OASISVersion.string_of_version (pkg_get ()).version))
+  
+  let c = BaseOCamlcConfig.var_define
+  
+  let os_type        = c "os_type"
+  let system         = c "system"
+  let architecture   = c "architecture"
+  let ccomp_type     = c "ccomp_type"
+  let ocaml_version  = c "ocaml_version"
+  
+  (* TODO: Check standard variable presence at runtime *)
+  
+  let standard_library_default = c "standard_library_default"
+  let standard_library         = c "standard_library"
+  let standard_runtime         = c "standard_runtime"
+  let bytecomp_c_compiler      = c "bytecomp_c_compiler"
+  let native_c_compiler        = c "native_c_compiler"
+  let model                    = c "model"
+  let ext_obj                  = c "ext_obj"
+  let ext_asm                  = c "ext_asm"
+  let ext_lib                  = c "ext_lib"
+  let ext_dll                  = c "ext_dll"
+  let default_executable_name  = c "default_executable_name"
+  let systhread_supported      = c "systhread_supported"
+  
+  
+  (**/**)
+  let p name hlp dflt =
+    var_define
+      ~short_desc:hlp
+      ~cli:CLIAuto
+      ~arg_help:"dir"
+      name
+      dflt
+  
+  let (/) a b =
+    if os_type () = Sys.os_type then
+      Filename.concat a b
+    else if os_type () = "Unix" then
+      BaseFilePath.Unix.concat a b
+    else
+      OASISUtils.failwithf (f_ "Cannot handle os_type %s filename concat")
+        (os_type ())
+  (**/**)
+  
+  let prefix =
+    p "prefix"
+      (fun () -> s_ "Install architecture-independent files dir")
+      (fun () ->
+         match os_type () with
+           | "Win32" ->
+               let program_files =
+                 Sys.getenv "PROGRAMFILES"
+               in
+                 program_files/(pkg_name ())
+           | _ ->
+               "/usr/local")
+  
+  let exec_prefix =
+    p "exec_prefix"
+      (fun () -> s_ "Install architecture-dependent files in dir")
+      (fun () -> "$prefix")
+  
+  let bindir =
+    p "bindir"
+      (fun () -> s_ "User executables")
+      (fun () -> "$exec_prefix"/"bin")
+  
+  let sbindir =
+    p "sbindir"
+      (fun () -> s_ "System admin executables")
+      (fun () -> "$exec_prefix"/"sbin")
+  
+  let libexecdir =
+    p "libexecdir"
+      (fun () -> s_ "Program executables")
+      (fun () -> "$exec_prefix"/"libexec")
+  
+  let sysconfdir =
+    p "sysconfdir"
+      (fun () -> s_ "Read-only single-machine data")
+      (fun () -> "$prefix"/"etc")
+  
+  let sharedstatedir =
+    p "sharedstatedir"
+      (fun () -> s_ "Modifiable architecture-independent data")
+      (fun () -> "$prefix"/"com")
+  
+  let localstatedir =
+    p "localstatedir"
+      (fun () -> s_ "Modifiable single-machine data")
+      (fun () -> "$prefix"/"var")
+  
+  let libdir =
+    p "libdir"
+      (fun () -> s_ "Object code libraries")
+      (fun () -> "$exec_prefix"/"lib")
+  
+  let datarootdir =
+    p "datarootdir"
+      (fun () -> s_ "Read-only arch-independent data root")
+      (fun () -> "$prefix"/"share")
+  
+  let datadir =
+    p "datadir"
+      (fun () -> s_ "Read-only architecture-independent data")
+      (fun () -> "$datarootdir")
+  
+  let infodir =
+    p "infodir"
+      (fun () -> s_ "Info documentation")
+      (fun () -> "$datarootdir"/"info")
+  
+  let localedir =
+    p "localedir"
+      (fun () -> s_ "Locale-dependent data")
+      (fun () -> "$datarootdir"/"locale")
+  
+  let mandir =
+    p "mandir"
+      (fun () -> s_ "Man documentation")
+      (fun () -> "$datarootdir"/"man")
+  
+  let docdir =
+    p "docdir"
+      (fun () -> s_ "Documentation root")
+      (fun () -> "$datarootdir"/"doc"/"$pkg_name")
+  
+  let htmldir =
+    p "htmldir"
+      (fun () -> s_ "HTML documentation")
+      (fun () -> "$docdir")
+  
+  let dvidir =
+    p "dvidir"
+      (fun () -> s_ "DVI documentation")
+      (fun () -> "$docdir")
+  
+  let pdfdir =
+    p "pdfdir"
+      (fun () -> s_ "PDF documentation")
+      (fun () -> "$docdir")
+  
+  let psdir =
+    p "psdir"
+      (fun () -> s_ "PS documentation")
+      (fun () -> "$docdir")
+  
+  let destdir =
+    p "destdir"
+      (fun () -> s_ "Prepend a path when installing package")
+      (fun () ->
+         raise
+           (PropList.Not_set
+              ("destdir",
+               Some (s_ "undefined by construct"))))
+  
+  let findlib_version =
+    var_define
+      "findlib_version"
+      (fun () ->
+         BaseCheck.package_version "findlib")
+  
+  let is_native =
+    var_define
+      "is_native"
+      (fun () ->
+         try
+           let _s : string =
+             ocamlopt ()
+           in
+             "true"
+         with PropList.Not_set _ ->
+           let _s : string =
+             ocamlc ()
+           in
+             "false")
+  
+  let ext_program =
+    var_define
+      "suffix_program"
+      (fun () ->
+         match os_type () with
+           | "Win32" -> ".exe"
+           | _ -> "")
+  
+  let rm =
+    var_define
+      ~short_desc:(fun () -> s_ "Remove a file.")
+      "rm"
+      (fun () ->
+         match os_type () with
+           | "Win32" -> "del"
+           | _ -> "rm -f")
+  
+  let rmdir =
+    var_define
+      ~short_desc:(fun () -> s_ "Remove a directory.")
+      "rmdir"
+      (fun () ->
+         match os_type () with
+           | "Win32" -> "rd"
+           | _ -> "rm -rf")
+  
+  let debug =
+    var_define
+      ~short_desc:(fun () -> s_ "Turn ocaml debug flag on")
+      ~cli:CLIEnable
+      "debug"
+      (fun () -> "true")
+  
+  let profile =
+    var_define
+      ~short_desc:(fun () -> s_ "Turn ocaml profile flag on")
+      ~cli:CLIEnable
+      "profile"
+      (fun () -> "false")
+  
+  let tests =
+    var_define
+      ~short_desc:(fun () ->
+                     s_ "Compile tests executable and library and run them")
+      ~cli:CLIEnable
+      "tests"
+      (fun () -> "false")
+  
+  let docs =
+    var_define
+      ~short_desc:(fun () -> s_ "Create documentations")
+      ~cli:CLIEnable
+      "docs"
+      (fun () -> "true")
+  
+  let init pkg =
+    rpkg := Some pkg
+  
+end
+
+module BaseFileAB = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFileAB.ml"
+  
+  open BaseEnv
+  open OASISGettext
+  open BaseMessage
+  
+  let to_filename fn =
+    let fn =
+      BaseFilePath.of_unix fn
+    in
+      if not (Filename.check_suffix fn ".ab") then
+        warning
+          (f_ "File '%s' doesn't have '.ab' extension")
+          fn;
+      Filename.chop_extension fn
+  
+  let replace fn_lst =
+    let buff =
+      Buffer.create 13
+    in
+      List.iter
+        (fun fn ->
+           let fn =
+             BaseFilePath.of_unix fn
+           in
+           let chn_in =
+             open_in fn
+           in
+           let chn_out =
+             open_out (to_filename fn)
+           in
+             (
+               try
+                 while true do
+                  Buffer.add_string buff (var_expand (input_line chn_in));
+                  Buffer.add_char buff '\n'
+                 done
+               with End_of_file ->
+                 ()
+             );
+             Buffer.output_buffer chn_out buff;
+             Buffer.clear buff;
+             close_in chn_in;
+             close_out chn_out)
+        fn_lst
+end
+
+module BaseLog = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseLog.ml"
+  
+  open OASISUtils
+  
+  let default_filename =
+    Filename.concat
+      (Filename.dirname BaseEnv.default_filename)
+      "setup.log"
+  
+  module SetTupleString =
+    Set.Make
+      (struct
+         type t = string * string
+         let compare (s11, s12) (s21, s22) =
+           match String.compare s11 s21 with
+             | 0 -> String.compare s12 s22
+             | n -> n
+       end)
+  
+  let load () =
+    if Sys.file_exists default_filename then
+      begin
+        let chn =
+          open_in default_filename
+        in
+        let scbuf =
+          Scanf.Scanning.from_file default_filename
+        in
+        let rec read_aux (st, lst) =
+          if not (Scanf.Scanning.end_of_input scbuf) then
+            begin
+              let acc =
+                try
+                  Scanf.bscanf scbuf "%S %S\n"
+                    (fun e d ->
+                       let t =
+                         e, d
+                       in
+                         if SetTupleString.mem t st then
+                           st, lst
+                         else
+                           SetTupleString.add t st,
+                           t :: lst)
+                with Scanf.Scan_failure _ ->
+                  failwith
+                    (Scanf.bscanf scbuf
+                       "%l"
+                       (fun line ->
+                          Printf.sprintf
+                            "Malformed log file '%s' at line %d"
+                            default_filename
+                            line))
+              in
+                read_aux acc
+            end
+          else
+            begin
+              close_in chn;
+              List.rev lst
+            end
+        in
+          read_aux (SetTupleString.empty, [])
+      end
+    else
+      begin
+        []
+      end
+  
+  let register event data =
+    let chn_out =
+      open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename
+    in
+      Printf.fprintf chn_out "%S %S\n" event data;
+      close_out chn_out
+  
+  let unregister event data =
+    if Sys.file_exists default_filename then
+      begin
+        let lst =
+          load ()
+        in
+        let chn_out =
+          open_out default_filename
+        in
+        let write_something =
+          ref false
+        in
+          List.iter
+            (fun (e, d) ->
+               if e <> event || d <> data then
+                 begin
+                   write_something := true;
+                   Printf.fprintf chn_out "%S %S\n" e d
+                 end)
+            lst;
+          close_out chn_out;
+          if not !write_something then
+            Sys.remove default_filename
+      end
+  
+  let filter events =
+    let st_events =
+      List.fold_left
+        (fun st e ->
+           SetString.add e st)
+        SetString.empty
+        events
+    in
+      List.filter
+        (fun (e, _) -> SetString.mem e st_events)
+        (load ())
+  
+  let exists event data =
+    List.exists
+      (fun v -> (event, data) = v)
+      (load ())
+end
+
+module BaseBuilt = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseBuilt.ml"
+  
+  open OASISTypes
+  open OASISGettext
+  open BaseStandardVar
+  open BaseMessage
+  
+  type t =
+    | BExec    (* Executable *)
+    | BExecLib (* Library coming with executable *)
+    | BLib     (* Library *)
+    | BDoc     (* Document *)
+  
+  let to_log_event_file t nm =
+    "built_"^
+    (match t with
+       | BExec -> "exec"
+       | BExecLib -> "exec_lib"
+       | BLib -> "lib"
+       | BDoc -> "doc")^
+    "_"^nm
+  
+  let to_log_event_done t nm =
+    "is_"^(to_log_event_file t nm)
+  
+  let register t nm lst =
+    BaseLog.register
+      (to_log_event_done t nm)
+      "true";
+    List.iter
+      (fun alt ->
+         let registered =
+           List.fold_left
+             (fun registered fn ->
+                if Sys.file_exists fn then
+                  begin
+                    BaseLog.register
+                      (to_log_event_file t nm)
+                      (if Filename.is_relative fn then
+                         Filename.concat (Sys.getcwd ()) fn
+                       else
+                         fn);
+                    true
+                  end
+                else
+                  registered)
+             false
+             alt
+         in
+           if not registered then
+             warning
+               (f_ "Cannot find an existing alternative files among: %s")
+               (String.concat (s_ ", ") alt))
+      lst
+  
+  let unregister t nm =
+    List.iter
+      (fun (e, d) ->
+         BaseLog.unregister e d)
+      (BaseLog.filter
+         [to_log_event_file t nm;
+          to_log_event_done t nm])
+  
+  let fold t nm f acc =
+    List.fold_left
+      (fun acc (_, fn) ->
+         if Sys.file_exists fn then
+           begin
+             f acc fn
+           end
+         else
+           begin
+             warning
+               (f_ "File '%s' has been marked as built \
+                  for %s but doesn't exist")
+               fn
+               (Printf.sprintf
+                  (match t with
+                     | BExec | BExecLib ->
+                         (f_ "executable %s")
+                     | BLib ->
+                         (f_ "library %s")
+                     | BDoc ->
+                         (f_ "documentation %s"))
+                  nm);
+             acc
+           end)
+      acc
+      (BaseLog.filter
+         [to_log_event_file t nm])
+  
+  let is_built t nm =
+    List.fold_left
+      (fun is_built (_, d) ->
+         (try
+            bool_of_string d
+          with _ ->
+            false))
+      false
+      (BaseLog.filter
+         [to_log_event_done t nm])
+  
+  let of_executable ffn (cs, bs, exec) =
+    let unix_exec_is, unix_dll_opt =
+      OASISExecutable.unix_exec_is
+        (cs, bs, exec)
+        (fun () ->
+           bool_of_string
+             (is_native ()))
+        ext_dll
+        ext_program
+    in
+    let evs =
+      (BExec, cs.cs_name, [[ffn unix_exec_is]])
+      ::
+      (match unix_dll_opt with
+         | Some fn ->
+             [BExecLib, cs.cs_name, [[ffn fn]]]
+         | None ->
+             [])
+    in
+      evs,
+      unix_exec_is,
+      unix_dll_opt
+  
+  let of_library ffn (cs, bs, lib) =
+    let unix_lst =
+      OASISLibrary.generated_unix_files
+        ~ctxt:!BaseContext.default
+        (cs, bs, lib)
+        (fun fn ->
+           Sys.file_exists (BaseFilePath.of_unix fn))
+        (fun () ->
+           bool_of_string (is_native ()))
+        ext_lib
+        ext_dll
+    in
+    let evs =
+      [BLib,
+       cs.cs_name,
+       List.map (List.map ffn) unix_lst]
+    in
+      evs, unix_lst
+  
+end
+
+module BaseCustom = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseCustom.ml"
+  
+  open BaseEnv
+  open BaseMessage
+  open OASISTypes
+  open OASISGettext
+  
+  let run cmd args extra_args =
+    BaseExec.run
+      (var_expand cmd)
+      (List.map
+         var_expand
+         (args @ (Array.to_list extra_args)))
+  
+  let hook ?(failsafe=false) cstm f e =
+    let optional_command lst =
+      let printer =
+        function
+          | Some (cmd, args) -> String.concat " " (cmd :: args)
+          | None -> s_ "No command"
+      in
+        match
+          var_choose
+            ~name:(s_ "Pre/Post Command")
+            ~printer
+            lst with
+          | Some (cmd, args) ->
+              begin
+                try
+                  run cmd args [||]
+                with e when failsafe ->
+                  warning
+                    (f_ "Command '%s' fail with error: %s")
+                    (String.concat " " (cmd :: args))
+                    (match e with
+                       | Failure msg -> msg
+                       | e -> Printexc.to_string e)
+              end
+          | None ->
+              ()
+    in
+    let res =
+      optional_command cstm.pre_command;
+      f e
+    in
+      optional_command cstm.post_command;
+      res
+end
+
+module BaseDynVar = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDynVar.ml"
+  
+  
+  open OASISTypes
+  open OASISGettext
+  open BaseEnv
+  open BaseBuilt
+  
+  let init pkg =
+    List.iter
+      (function
+         | Executable (cs, bs, exec) ->
+             if var_choose bs.bs_build then
+               var_ignore
+                 (var_redefine
+                    (* We don't save this variable *)
+                    ~dump:false
+                    ~short_desc:(fun () ->
+                                   Printf.sprintf
+                                     (f_ "Filename of executable '%s'")
+                                     cs.cs_name)
+                    cs.cs_name
+                    (fun () ->
+                       let fn_opt =
+                         fold
+                           BExec cs.cs_name
+                           (fun _ fn -> Some fn)
+                           None
+                       in
+                         match fn_opt with
+                           | Some fn -> fn
+                           | None ->
+                               raise
+                                 (PropList.Not_set
+                                    (cs.cs_name,
+                                     Some (Printf.sprintf
+                                             (f_ "Executable '%s' not yet built.")
+                                             cs.cs_name)))))
+  
+         | Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ ->
+             ())
+      pkg.sections
+end
+
+module BaseTest = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseTest.ml"
+  
+  open BaseEnv
+  open BaseMessage
+  open OASISTypes
+  open OASISExpr
+  open OASISGettext
+  
+  let test lst pkg extra_args =
+  
+    let one_test (failure, n) (test_plugin, cs, test) =
+      if var_choose
+           ~name:(Printf.sprintf
+                    (f_ "test %s run")
+                    cs.cs_name)
+           ~printer:string_of_bool
+           test.test_run then
+        begin
+          let () =
+            info (f_ "Running test '%s'") cs.cs_name
+          in
+          let back_cwd =
+            match test.test_working_directory with
+              | Some dir ->
+                  let cwd =
+                    Sys.getcwd ()
+                  in
+                  let chdir d =
+                    info (f_ "Changing directory to '%s'") d;
+                    Sys.chdir d
+                  in
+                    chdir dir;
+                    fun () -> chdir cwd
+  
+              | None ->
+                  fun () -> ()
+          in
+            try
+              let failure_percent =
+                BaseCustom.hook
+                  test.test_custom
+                  (test_plugin pkg (cs, test))
+                  extra_args
+              in
+                back_cwd ();
+                (failure_percent +. failure, n + 1)
+            with e ->
+              begin
+                back_cwd ();
+                raise e
+              end
+        end
+      else
+        begin
+          info (f_ "Skipping test '%s'") cs.cs_name;
+          (failure, n)
+        end
+    in
+    let (failed, n) =
+      List.fold_left
+        one_test
+        (0.0, 0)
+        lst
+    in
+    let failure_percent =
+      if n = 0 then
+        0.0
+      else
+        failed /. (float_of_int n)
+    in
+    let msg =
+      Printf.sprintf
+        (f_ "Tests had a %.2f%% failure rate")
+        (100. *. failure_percent)
+    in
+      if failure_percent > 0.0 then
+        failwith msg
+      else
+        info "%s" msg
+end
+
+module BaseDoc = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDoc.ml"
+  
+  open BaseEnv
+  open BaseMessage
+  open OASISTypes
+  open OASISGettext
+  
+  let doc lst pkg extra_args =
+  
+    let one_doc (doc_plugin, cs, doc) =
+      if var_choose
+           ~name:(Printf.sprintf
+                   (f_ "documentation %s build")
+                   cs.cs_name)
+           ~printer:string_of_bool
+           doc.doc_build then
+        begin
+          info (f_ "Building documentation '%s'") cs.cs_name;
+          BaseCustom.hook
+            doc.doc_custom
+            (doc_plugin pkg (cs, doc))
+            extra_args
+        end
+    in
+      List.iter
+        one_doc
+        lst
+end
+
+module BaseSetup = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseSetup.ml"
+  
+  open BaseEnv
+  open BaseMessage
+  open OASISTypes
+  open OASISSection
+  open OASISGettext
+  open OASISUtils
+  
+  type std_args_fun =
+      package -> string array -> unit
+  
+  type ('a, 'b) section_args_fun =
+      name * (package -> (common_section * 'a) -> string array -> 'b)
+  
+  type t =
+      {
+        configure:       std_args_fun;
+        build:           std_args_fun;
+        doc:             ((doc, unit)  section_args_fun) list;
+        test:            ((test, float) section_args_fun) list;
+        install:         std_args_fun;
+        uninstall:       std_args_fun;
+        clean:           std_args_fun list;
+        clean_doc:       (doc, unit) section_args_fun list;
+        clean_test:      (test, unit) section_args_fun list;
+        distclean:       std_args_fun list;
+        distclean_doc:   (doc, unit) section_args_fun list;
+        distclean_test:  (test, unit) section_args_fun list;
+        package:         package;
+        version:         string;
+      }
+  
+  (* Associate a plugin function with data from package *)
+  let join_plugin_sections filter_map lst =
+    List.rev
+      (List.fold_left
+         (fun acc sct ->
+            match filter_map sct with
+              | Some e ->
+                  e :: acc
+              | None ->
+                  acc)
+         []
+         lst)
+  
+  (* Search for plugin data associated with a section name *)
+  let lookup_plugin_section plugin action nm lst =
+    try
+      List.assoc nm lst
+    with Not_found ->
+      failwithf
+        (f_ "Cannot find plugin %s matching section %s for %s action")
+        plugin
+        nm
+        action
+  
+  let configure t args =
+    (* Run configure *)
+    BaseCustom.hook
+      t.package.conf_custom
+      (fun () -> 
+         (* Reload if preconf has changed it *)
+         begin
+           try
+             unload ();
+             load ();
+           with _ ->
+             ()
+         end;
+  
+         (* Run plugin's configure *)
+         t.configure t.package args;
+  
+         (* Dump to allow postconf to change it *)
+         dump ())
+      ();
+  
+    (* Reload environment *)
+    unload ();
+    load ();
+  
+    (* Save environment *)
+    print ();
+  
+    (* Replace data in file *)
+    BaseFileAB.replace t.package.files_ab
+  
+  let build t args =
+    BaseCustom.hook
+      t.package.build_custom
+      (t.build t.package)
+      args
+  
+  let doc t args =
+    if bool_of_string (BaseStandardVar.docs ()) then
+      BaseDoc.doc
+        (join_plugin_sections
+           (function
+              | Doc (cs, e) ->
+                  Some
+                    (lookup_plugin_section
+                       "documentation"
+                       (s_ "build")
+                       cs.cs_name
+                       t.doc,
+                     cs,
+                     e)
+              | _ ->
+                  None)
+           t.package.sections)
+        t.package
+        args
+    else
+      BaseMessage.warning
+        "Docs are turned off, consider enabling with \
+         'ocaml setup.ml -configure --enable-docs'"
+  
+  let test t args =
+    if bool_of_string (BaseStandardVar.tests ()) then
+      BaseTest.test
+        (join_plugin_sections
+           (function
+              | Test (cs, e) ->
+                  Some
+                    (lookup_plugin_section
+                       "test"
+                       (s_ "run")
+                       cs.cs_name
+                       t.test,
+                     cs,
+                     e)
+              | _ ->
+                  None)
+           t.package.sections)
+        t.package
+        args
+    else
+      BaseMessage.warning
+        "Tests are turned off, consider enabling with \
+         'ocaml setup.ml -configure --enable-tests'"
+  
+  let all t args =
+    let rno_doc =
+      ref false
+    in
+    let rno_test =
+      ref false
+    in
+      Arg.parse_argv
+        ~current:(ref 0)
+        (Array.of_list
+           ((Sys.executable_name^" all") ::
+            (Array.to_list args)))
+        [
+          "-no-doc",
+          Arg.Set rno_doc,
+          s_ "Don't run doc target";
+  
+          "-no-test",
+          Arg.Set rno_test,
+          s_ "Don't run test target";
+        ]
+        (failwithf (f_ "Don't know what to do with '%s'"))
+        "";
+  
+      info "Running configure step";
+      configure t [||];
+  
+      info "Running build step";
+      build     t [||];
+  
+      (* Load setup.log dynamic variables *)
+      BaseDynVar.init t.package;
+  
+      if not !rno_doc then
+        begin
+          info "Running doc step";
+          doc t [||];
+        end
+      else
+        begin
+          info "Skipping doc step"
+        end;
+  
+      if not !rno_test then
+        begin
+          info "Running test step";
+          test t [||]
+        end
+      else
+        begin
+          info "Skipping test step"
+        end
+  
+  let install t args =
+    BaseCustom.hook
+      t.package.install_custom
+      (t.install t.package)
+      args
+  
+  let uninstall t args =
+    BaseCustom.hook
+      t.package.uninstall_custom
+      (t.uninstall t.package)
+      args
+  
+  let reinstall t args =
+    uninstall t args;
+    install t args
+  
+  let clean, distclean =
+    let failsafe f a =
+      try
+        f a
+      with e ->
+        warning
+          (f_ "Action fail with error: %s")
+          (match e with
+             | Failure msg -> msg
+             | e -> Printexc.to_string e)
+    in
+  
+    let generic_clean t cstm mains docs tests args =
+      BaseCustom.hook
+        ~failsafe:true
+        cstm
+        (fun () ->
+           (* Clean section *)
+           List.iter
+             (function
+                | Test (cs, test) ->
+                    let f =
+                      try
+                        List.assoc cs.cs_name tests
+                      with Not_found ->
+                        fun _ _ _ -> ()
+                    in
+                      failsafe
+                        (f t.package (cs, test))
+                        args
+                | Doc (cs, doc) ->
+                    let f =
+                      try
+                        List.assoc cs.cs_name docs
+                      with Not_found ->
+                        fun _ _ _ -> ()
+                    in
+                      failsafe
+                        (f t.package (cs, doc))
+                        args
+                | Library _
+                | Executable _
+                | Flag _
+                | SrcRepo _ ->
+                    ())
+             t.package.sections;
+           (* Clean whole package *)
+           List.iter
+             (fun f ->
+                failsafe
+                  (f t.package)
+                  args)
+             mains)
+        ()
+    in
+  
+    let clean t args =
+      generic_clean
+        t
+        t.package.clean_custom
+        t.clean
+        t.clean_doc
+        t.clean_test
+        args
+    in
+  
+    let distclean t args =
+      (* Call clean *)
+      clean t args;
+  
+      (* Remove generated file *)
+      List.iter
+        (fun fn ->
+           if Sys.file_exists fn then
+             begin
+               info (f_ "Remove '%s'") fn;
+               Sys.remove fn
+             end)
+        (BaseEnv.default_filename
+         ::
+         BaseLog.default_filename
+         ::
+         (List.rev_map BaseFileAB.to_filename t.package.files_ab));
+  
+      (* Call distclean code *)
+      generic_clean
+        t
+        t.package.distclean_custom
+        t.distclean
+        t.distclean_doc
+        t.distclean_test
+        args
+    in
+  
+      clean, distclean
+  
+  let version t _ =
+    print_endline t.version
+  
+  let setup t =
+    let catch_exn =
+      ref true
+    in
+      try
+        let act_ref =
+          ref (fun _ ->
+                 failwithf
+                   (f_ "No action defined, run '%s %s -help'")
+                   Sys.executable_name
+                   Sys.argv.(0))
+  
+        in
+        let extra_args_ref =
+          ref []
+        in
+        let allow_empty_env_ref =
+          ref false
+        in
+        let arg_handle ?(allow_empty_env=false) act =
+          Arg.Tuple
+            [
+              Arg.Rest (fun str -> extra_args_ref := str :: !extra_args_ref);
+  
+              Arg.Unit
+                (fun () ->
+                   allow_empty_env_ref := allow_empty_env;
+                   act_ref := act);
+            ]
+        in
+  
+          Arg.parse
+            (Arg.align
+               [
+                 "-configure",
+                 arg_handle ~allow_empty_env:true configure,
+                 s_ "[options*] Configure the whole build process.";
+  
+                 "-build",
+                 arg_handle build,
+                 s_ "[options*] Build executables and libraries.";
+  
+                 "-doc",
+                 arg_handle doc,
+                 s_ "[options*] Build documents.";
+  
+                 "-test",
+                 arg_handle test,
+                 s_ "[options*] Run tests.";
+  
+                 "-all",
+                 arg_handle ~allow_empty_env:true all,
+                 s_ "[options*] Run configure, build, doc and test targets.";
+  
+                 "-install",
+                 arg_handle install,
+                 s_ "[options*] Install libraries, data, executables \
+                                and documents.";
+  
+                 "-uninstall",
+                 arg_handle uninstall,
+                 s_ "[options*] Uninstall libraries, data, executables \
+                                and documents.";
+  
+                 "-reinstall",
+                 arg_handle reinstall,
+                 s_ "[options*] Uninstall and install libraries, data, \
+                                executables and documents.";
+  
+                 "-clean",
+                 arg_handle ~allow_empty_env:true clean,
+                 s_ "[options*] Clean files generated by a build.";
+  
+                 "-distclean",
+                 arg_handle ~allow_empty_env:true distclean,
+                 s_ "[options*] Clean files generated by a build and configure.";
+  
+                 "-version",
+                 arg_handle ~allow_empty_env:true version,
+                 s_ " Display version of OASIS used to generate this setup.ml.";
+  
+                 "-no-catch-exn",
+                 Arg.Clear catch_exn,
+                 s_ " Don't catch exception, useful for debugging.";
+               ]
+             @ (BaseContext.args ()))
+            (failwithf (f_ "Don't know what to do with '%s'"))
+            (s_ "Setup and run build process current package\n");
+  
+          (* Build initial environment *)
+          load ~allow_empty:!allow_empty_env_ref ();
+  
+          (** Initialize flags *)
+          List.iter
+            (function
+               | Flag (cs, {flag_description = hlp;
+                            flag_default = choices}) ->
+                   begin
+                     let apply ?short_desc () =
+                       var_ignore
+                         (var_define
+                            ~cli:CLIEnable
+                            ?short_desc
+                            (OASISUtils.varname_of_string cs.cs_name)
+                            (fun () ->
+                               string_of_bool
+                                 (var_choose
+                                    ~name:(Printf.sprintf
+                                             (f_ "default value of flag %s")
+                                             cs.cs_name)
+                                    ~printer:string_of_bool
+                                             choices)))
+                     in
+                       match hlp with
+                         | Some hlp ->
+                             apply ~short_desc:(fun () -> hlp) ()
+                         | None ->
+                             apply ()
+                   end
+               | _ ->
+                   ())
+            t.package.sections;
+  
+          BaseStandardVar.init t.package;
+  
+          BaseDynVar.init t.package;
+  
+          !act_ref t (Array.of_list (List.rev !extra_args_ref))
+  
+      with e when !catch_exn ->
+        error "%s" (Printexc.to_string e);
+        exit 1
+  
+end
+
+module BaseDev = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDev.ml"
+  
+  
+  
+  open OASISGettext
+  open BaseMessage
+  
+  type t =
+      {
+        oasis_cmd:  string;
+      } 
+  
+  let update_and_run t =
+    (* Command line to run setup-dev *)
+    let oasis_args =
+      "setup-dev" :: "-run" ::
+      Sys.executable_name ::
+      (Array.to_list Sys.argv)
+    in
+  
+    let exit_on_child_error =
+      function
+        | 0 -> ()
+        | 2 ->
+            (* Bad CLI arguments *)
+            error
+              (f_ "The command '%s %s' exit with code 2. It often means that we \
+                   don't use the right command-line arguments, rerun \
+                   'oasis setup-dev'.")
+              t.oasis_cmd
+              (String.concat " " oasis_args)
+  
+        | 127 ->
+            (* Cannot find OASIS *)
+            error
+              (f_ "Cannot find executable '%s', check where 'oasis' is located \
+                   and rerun 'oasis setup-dev'")
+              t.oasis_cmd
+  
+        | i ->
+            exit i
+    in
+  
+    let () =
+      (* Run OASIS to generate a temporary setup.ml
+       *)
+      BaseExec.run
+        ~f_exit_code:exit_on_child_error
+        t.oasis_cmd
+        oasis_args
+    in
+  
+      ()
+  
+end
+
+
+module InternalConfigurePlugin = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/internal/InternalConfigurePlugin.ml"
+  
+  (** Configure using internal scheme
+      @author Sylvain Le Gall
+    *)
+  
+  open BaseEnv
+  open OASISTypes
+  open OASISUtils
+  open OASISGettext
+  open BaseMessage
+  
+  (** Configure build using provided series of check to be done
+    * and then output corresponding file.
+    *)
+  let configure pkg argv =
+    let var_ignore_eval var =
+      let _s : string =
+        var ()
+      in
+        ()
+    in
+  
+    let errors =
+      ref SetString.empty
+    in
+  
+    let buff =
+      Buffer.create 13
+    in
+  
+    let add_errors fmt =
+      Printf.kbprintf
+        (fun b ->
+           errors := SetString.add (Buffer.contents b) !errors;
+           Buffer.clear b)
+        buff
+        fmt
+    in
+  
+    let warn_exception e =
+      warning "%s" (Printexc.to_string e)
+    in
+  
+    (* Check tools *)
+    let check_tools lst =
+      List.iter
+        (function
+           | ExternalTool tool ->
+               begin
+                 try
+                   var_ignore_eval (BaseCheck.prog tool)
+                 with e ->
+                   warn_exception e;
+                   add_errors (f_ "Cannot find external tool '%s'") tool
+               end
+           | InternalExecutable nm1 ->
+               (* Check that matching tool is built *)
+               List.iter
+                 (function
+                    | Executable ({cs_name = nm2},
+                                  {bs_build = build},
+                                  _) when nm1 = nm2 ->
+                         if not (var_choose build) then
+                           add_errors
+                             (f_ "Cannot find buildable internal executable \
+                                  '%s' when checking build depends")
+                             nm1
+                    | _ ->
+                        ())
+                 pkg.sections)
+        lst
+    in
+  
+    let build_checks sct bs =
+      if var_choose bs.bs_build then
+        begin
+          if bs.bs_compiled_object = Native then
+            begin
+              try
+                var_ignore_eval BaseStandardVar.ocamlopt
+              with e ->
+                warn_exception e;
+                add_errors
+                  (f_ "Section %s requires native compilation")
+                  (OASISSection.string_of_section sct)
+            end;
+  
+          (* Check tools *)
+          check_tools bs.bs_build_tools;
+  
+          (* Check depends *)
+          List.iter
+            (function
+               | FindlibPackage (findlib_pkg, version_comparator) ->
+                   begin
+                     try
+                       var_ignore_eval
+                         (BaseCheck.package ?version_comparator findlib_pkg)
+                     with e ->
+                       warn_exception e;
+                       match version_comparator with
+                         | None ->
+                             add_errors
+                               (f_ "Cannot find findlib package %s")
+                               findlib_pkg
+                         | Some ver_cmp ->
+                             add_errors
+                               (f_ "Cannot find findlib package %s (%s)")
+                               findlib_pkg
+                               (OASISVersion.string_of_comparator ver_cmp)
+                   end
+               | InternalLibrary nm1 ->
+                   (* Check that matching library is built *)
+                   List.iter
+                     (function
+                        | Library ({cs_name = nm2},
+                                   {bs_build = build},
+                                   _) when nm1 = nm2 ->
+                             if not (var_choose build) then
+                               add_errors
+                                 (f_ "Cannot find buildable internal library \
+                                      '%s' when checking build depends")
+                                 nm1
+                        | _ ->
+                            ())
+                     pkg.sections)
+            bs.bs_build_depends
+        end
+    in
+  
+    (* Parse command line *)
+    BaseArgExt.parse argv (BaseEnv.args ());
+  
+    (* OCaml version *)
+    begin
+      match pkg.ocaml_version with
+        | Some ver_cmp ->
+            begin
+              try
+                var_ignore_eval
+                  (BaseCheck.version
+                     "ocaml"
+                     ver_cmp
+                     BaseStandardVar.ocaml_version)
+              with e ->
+                warn_exception e;
+                add_errors
+                  (f_ "OCaml version %s doesn't match version constraint %s")
+                  (BaseStandardVar.ocaml_version ())
+                  (OASISVersion.string_of_comparator ver_cmp)
+            end
+        | None ->
+            ()
+    end;
+  
+    (* Findlib version *)
+    begin
+      match pkg.findlib_version with
+        | Some ver_cmp ->
+            begin
+              try
+                var_ignore_eval
+                  (BaseCheck.version
+                     "findlib"
+                     ver_cmp
+                     BaseStandardVar.findlib_version)
+              with e ->
+                warn_exception e;
+                add_errors
+                  (f_ "Findlib version %s doesn't match version constraint %s")
+                  (BaseStandardVar.findlib_version ())
+                  (OASISVersion.string_of_comparator ver_cmp)
+            end
+        | None ->
+            ()
+    end;
+  
+    (* Check build depends *)
+    List.iter
+      (function
+         | Executable (_, bs, _)
+         | Library (_, bs, _) as sct ->
+             build_checks sct bs
+         | Doc (_, doc) ->
+             if var_choose doc.doc_build then
+               check_tools doc.doc_build_tools
+         | Test (_, test) ->
+             if var_choose test.test_run then
+               check_tools test.test_tools
+         | _ ->
+             ())
+      pkg.sections;
+  
+    (* Check errors *)
+    if SetString.empty != !errors then
+      begin
+        List.iter
+          (fun e -> error "%s" e)
+          (SetString.elements !errors);
+        failwithf
+          (fn_
+             "%d configuration error"
+             "%d configuration errors"
+             (SetString.cardinal !errors))
+          (SetString.cardinal !errors)
+      end
+  
+end
+
+module InternalInstallPlugin = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/internal/InternalInstallPlugin.ml"
+  
+  (** Install using internal scheme
+      @author Sylvain Le Gall
+    *)
+  
+  open BaseEnv
+  open BaseStandardVar
+  open BaseMessage
+  open OASISTypes
+  open OASISLibrary
+  open OASISGettext
+  open OASISUtils
+  
+  let exec_hook =
+    ref (fun (cs, bs, exec) -> cs, bs, exec)
+  
+  let lib_hook =
+    ref (fun (cs, bs, lib) -> cs, bs, lib, [])
+  
+  let doc_hook =
+    ref (fun (cs, doc) -> cs, doc)
+  
+  let install_file_ev =
+    "install-file"
+  
+  let install_dir_ev =
+    "install-dir"
+  
+  let install_findlib_ev =
+    "install-findlib"
+  
+  let install pkg argv =
+  
+    let in_destdir =
+      try
+        let destdir =
+          destdir ()
+        in
+          (* Practically speaking destdir is prepended
+           * at the beginning of the target filename
+           *)
+          fun fn -> destdir^fn
+      with PropList.Not_set _ ->
+        fun fn -> fn
+    in
+  
+    let install_file ?tgt_fn src_file envdir =
+      let tgt_dir =
+        in_destdir (envdir ())
+      in
+      let tgt_file =
+        Filename.concat
+          tgt_dir
+          (match tgt_fn with
+             | Some fn ->
+                 fn
+             | None ->
+                 Filename.basename src_file)
+      in
+        (* Create target directory if needed *)
+        BaseFileUtil.mkdir_parent
+          (fun dn ->
+             info (f_ "Creating directory '%s'") dn;
+             BaseLog.register install_dir_ev dn)
+          tgt_dir;
+  
+        (* Really install files *)
+        info (f_ "Copying file '%s' to '%s'") src_file tgt_file;
+        BaseFileUtil.cp src_file tgt_file;
+        BaseLog.register install_file_ev tgt_file
+    in
+  
+    (* Install data into defined directory *)
+    let install_data srcdir lst tgtdir =
+      let tgtdir =
+        BaseFilePath.of_unix (var_expand tgtdir)
+      in
+        List.iter
+          (fun (src, tgt_opt) ->
+             let real_srcs =
+               BaseFileUtil.glob
+                 (Filename.concat srcdir src)
+             in
+               if real_srcs = [] then
+                 failwithf
+                   (f_ "Wildcard '%s' doesn't match any files")
+                   src;
+               List.iter
+                 (fun fn ->
+                    install_file
+                      fn
+                      (fun () ->
+                         match tgt_opt with
+                           | Some s ->
+                               BaseFilePath.of_unix (var_expand s)
+                           | None ->
+                               tgtdir))
+                 real_srcs)
+          lst
+    in
+  
+    (** Install all libraries *)
+    let install_libs pkg =
+  
+      let files_of_library (f_data, acc) data_lib =
+        let cs, bs, lib, lib_extra =
+          !lib_hook data_lib
+        in
+          if var_choose bs.bs_install &&
+             BaseBuilt.is_built BaseBuilt.BLib cs.cs_name then
+            begin
+              let acc =
+                (* Start with acc + lib_extra *)
+                List.rev_append lib_extra acc
+              in
+              let acc =
+                (* Add uncompiled header from the source tree *)
+                let path =
+                  BaseFilePath.of_unix bs.bs_path
+                in
+                  List.fold_left
+                    (fun acc modul ->
+                       try
+                         List.find
+                           Sys.file_exists
+                           (List.map
+                              (Filename.concat path)
+                              [modul^".mli";
+                               modul^".ml";
+                               String.uncapitalize modul^".mli";
+                               String.capitalize   modul^".mli";
+                               String.uncapitalize modul^".ml";
+                               String.capitalize   modul^".ml"])
+                         :: acc
+                       with Not_found ->
+                         begin
+                           warning
+                             (f_ "Cannot find source header for module %s \
+                                  in library %s")
+                             modul cs.cs_name;
+                           acc
+                         end)
+                    acc
+                    lib.lib_modules
+              in
+  
+              let acc =
+               (* Get generated files *)
+               BaseBuilt.fold
+                 BaseBuilt.BLib
+                 cs.cs_name
+                 (fun acc fn -> fn :: acc)
+                 acc
+              in
+  
+              let f_data () =
+                (* Install data associated with the library *)
+                install_data
+                  bs.bs_path
+                  bs.bs_data_files
+                  (Filename.concat
+                     (datarootdir ())
+                     pkg.name);
+                f_data ()
+              in
+  
+                (f_data, acc)
+            end
+           else
+            begin
+              (f_data, acc)
+            end
+      in
+  
+      (* Install one group of library *)
+      let install_group_lib grp =
+        (* Iterate through all group nodes *)
+        let rec install_group_lib_aux data_and_files grp =
+          let data_and_files, children =
+            match grp with
+              | Container (_, children) ->
+                  data_and_files, children
+              | Package (_, cs, bs, lib, children) ->
+                  files_of_library data_and_files (cs, bs, lib), children
+          in
+            List.fold_left
+              install_group_lib_aux
+              data_and_files
+              children
+        in
+  
+        (* Findlib name of the root library *)
+        let findlib_name =
+          findlib_of_group grp
+        in
+  
+        (* Determine root library *)
+        let root_lib =
+          root_of_group grp
+        in
+  
+        (* All files to install for this library *)
+        let f_data, files =
+          install_group_lib_aux (ignore, []) grp
+        in
+  
+          (* Really install, if there is something to install *)
+          if files = [] then
+            begin
+              warning
+                (f_ "Nothing to install for findlib library '%s'")
+                findlib_name
+            end
+          else
+            begin
+              let meta =
+                (* Search META file *)
+                let (_, bs, _) =
+                  root_lib
+                in
+                let res =
+                  Filename.concat bs.bs_path "META"
+                in
+                  if not (Sys.file_exists res) then
+                    failwithf
+                      (f_ "Cannot find file '%s' for findlib library %s")
+                      res
+                      findlib_name;
+                  res
+              in
+              let files = 
+                (* Make filename shorter to avoid hitting command max line length
+                 * too early, esp. on Windows.
+                 *)
+                let remove_prefix p n =
+                  let plen = String.length p in
+                  let nlen = String.length n in
+                    if plen <= nlen && String.sub n 0 plen = p then
+                      begin
+                        let fn_sep = 
+                          if Sys.os_type = "Win32" then
+                            '\\'
+                          else
+                            '/'
+                        in
+                        let cutpoint = plen +
+                          (if plen < nlen && n.[plen] = fn_sep then 
+                             1
+                           else 
+                             0)
+                        in
+                          String.sub n cutpoint (nlen - cutpoint)
+                      end
+                    else 
+                      n
+                in
+                  List.map (remove_prefix (Sys.getcwd ())) files 
+              in
+                info
+                  (f_ "Installing findlib library '%s'")
+                  findlib_name;
+                BaseExec.run
+                  (ocamlfind ())
+                  ("install" :: findlib_name :: meta :: files);
+                BaseLog.register install_findlib_ev findlib_name
+            end;
+  
+          (* Install data files *)
+          f_data ();
+  
+      in
+  
+        (* We install libraries in groups *)
+        List.iter
+          install_group_lib
+          (group_libs pkg)
+    in
+  
+    let install_execs pkg =
+      let install_exec data_exec =
+        let (cs, bs, exec) =
+          !exec_hook data_exec
+        in
+          if var_choose bs.bs_install &&
+             BaseBuilt.is_built BaseBuilt.BExec cs.cs_name then
+            begin
+              let exec_libdir () =
+                Filename.concat
+                  (libdir ())
+                  pkg.name
+              in
+                BaseBuilt.fold
+                  BaseBuilt.BExec
+                  cs.cs_name
+                  (fun () fn ->
+                     install_file
+                       ~tgt_fn:cs.cs_name
+                       fn
+                       bindir)
+                  ();
+                BaseBuilt.fold
+                  BaseBuilt.BExecLib
+                  cs.cs_name
+                  (fun () fn ->
+                     install_file
+                       fn
+                       exec_libdir)
+                  ();
+                install_data
+                  bs.bs_path
+                  bs.bs_data_files
+                  (Filename.concat
+                     (datarootdir ())
+                     pkg.name)
+            end
+      in
+        List.iter
+          (function
+             | Executable (cs, bs, exec)->
+                 install_exec (cs, bs, exec)
+             | _ ->
+                 ())
+          pkg.sections
+    in
+  
+    let install_docs pkg =
+      let install_doc data =
+        let (cs, doc) =
+          !doc_hook data
+        in
+          if var_choose doc.doc_install &&
+             BaseBuilt.is_built BaseBuilt.BDoc cs.cs_name then
+            begin
+              let tgt_dir =
+                BaseFilePath.of_unix (var_expand doc.doc_install_dir)
+              in
+                BaseBuilt.fold
+                  BaseBuilt.BDoc
+                  cs.cs_name
+                  (fun () fn ->
+                     install_file
+                       fn
+                       (fun () -> tgt_dir))
+                ();
+                install_data
+                  Filename.current_dir_name
+                  doc.doc_data_files
+                  doc.doc_install_dir
+            end
+      in
+        List.iter
+          (function
+             | Doc (cs, doc) ->
+                 install_doc (cs, doc)
+             | _ ->
+                 ())
+          pkg.sections
+    in
+  
+      install_libs  pkg;
+      install_execs pkg;
+      install_docs  pkg
+  
+  (* Uninstall already installed data *)
+  let uninstall _ argv =
+    List.iter
+      (fun (ev, data) ->
+         if ev = install_file_ev then
+           begin
+             if Sys.file_exists data then
+               begin
+                 info
+                   (f_ "Removing file '%s'")
+                   data;
+                 Sys.remove data
+               end
+             else
+               begin
+                 warning
+                   (f_ "File '%s' doesn't exist anymore")
+                   data
+               end
+           end
+         else if ev = install_dir_ev then
+           begin
+             if Sys.file_exists data && Sys.is_directory data then
+               begin
+                 if Sys.readdir data = [||] then
+                   begin
+                     info
+                       (f_ "Removing directory '%s'")
+                       data;
+                     BaseFileUtil.rmdir data
+                   end
+                 else
+                   begin
+                     warning
+                       (f_ "Directory '%s' is not empty (%s)")
+                       data
+                       (String.concat
+                          ", "
+                          (Array.to_list
+                             (Sys.readdir data)))
+                   end
+               end
+             else
+               begin
+                 warning
+                   (f_ "Directory '%s' doesn't exist anymore")
+                   data
+               end
+           end
+         else if ev = install_findlib_ev then
+           begin
+             info (f_ "Removing findlib library '%s'") data;
+             BaseExec.run (ocamlfind ()) ["remove"; data]
+           end
+         else
+           failwithf (f_ "Unknown log event '%s'") ev;
+         BaseLog.unregister ev data)
+      (* We process event in reverse order *)
+      (List.rev
+         (BaseLog.filter
+            [install_file_ev;
+             install_dir_ev;
+             install_findlib_ev;]))
+  
+end
+
+
+module OCamlbuildCommon = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildCommon.ml"
+  
+  (** Functions common to OCamlbuild build and doc plugin
+    *)
+  
+  open OASISGettext
+  open BaseEnv
+  open BaseStandardVar
+  
+  let ocamlbuild_clean_ev =
+    "ocamlbuild-clean"
+  
+  let ocamlbuildflags =
+    var_define
+      ~short_desc:(fun () -> "OCamlbuild additional flags")
+      "ocamlbuildflags"
+      (fun () -> "")
+  
+  (** Fix special arguments depending on environment *)
+  let fix_args args extra_argv =
+    List.flatten
+      [
+        if (os_type ()) = "Win32" then
+          [
+            "-classic-display";
+            "-no-log";
+            "-no-links";
+            "-install-lib-dir";
+            (Filename.concat (standard_library ()) "ocamlbuild")
+          ]
+        else
+          [];
+  
+        if not (bool_of_string (is_native ())) || (os_type ()) = "Win32" then
+          [
+            "-byte-plugin"
+          ]
+        else
+          [];
+        args;
+  
+        if bool_of_string (debug ()) then
+          ["-tag"; "debug"]
+        else
+          [];
+  
+        if bool_of_string (profile ()) then
+          ["-tag"; "profile"]
+        else
+          [];
+  
+        OASISUtils.split ' ' (ocamlbuildflags ());
+  
+        Array.to_list extra_argv;
+      ]
+  
+  (** Run 'ocamlbuild -clean' if not already done *)
+  let run_clean extra_argv =
+    let extra_cli =
+      String.concat " " (Array.to_list extra_argv)
+    in
+      (* Run if never called with these args *)
+      if not (BaseLog.exists ocamlbuild_clean_ev extra_cli) then
+        begin
+          BaseExec.run (ocamlbuild ()) (fix_args ["-clean"] extra_argv);
+          BaseLog.register ocamlbuild_clean_ev extra_cli;
+          at_exit
+            (fun () ->
+               try
+                 BaseLog.unregister ocamlbuild_clean_ev extra_cli
+               with _ ->
+                 ())
+        end
+  
+  (** Run ocamlbuild, unregister all clean events *)
+  let run_ocamlbuild args extra_argv =
+    (* TODO: enforce that target in args must be UNIX encoded i.e. toto/index.html
+     *)
+    BaseExec.run (ocamlbuild ()) (fix_args args extra_argv);
+    (* Remove any clean event, we must run it again *)
+    List.iter
+      (fun (e, d) -> BaseLog.unregister e d)
+      (BaseLog.filter [ocamlbuild_clean_ev])
+  
+  (** Determine real build directory *)
+  let build_dir extra_argv =
+    let rec search_args dir =
+      function
+        | "-build-dir" :: dir :: tl ->
+            search_args dir tl
+        | _ :: tl ->
+            search_args dir tl
+        | [] ->
+            dir
+    in
+      search_args "_build" (fix_args [] extra_argv)
+  
+end
+
+module OCamlbuildPlugin = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildPlugin.ml"
+  
+  (** Build using ocamlbuild
+      @author Sylvain Le Gall
+    *)
+  
+  open OASISTypes
+  open OASISGettext
+  open OASISUtils
+  open BaseEnv
+  open OCamlbuildCommon
+  open BaseStandardVar
+  open BaseMessage
+  
+  let cond_targets_hook =
+    ref (fun lst -> lst)
+  
+  let build pkg argv =
+  
+    (* Return the filename in build directory *)
+    let in_build_dir fn =
+      Filename.concat
+        (build_dir argv)
+        fn
+    in
+  
+    (* Return the unix filename in host build directory *)
+    let in_build_dir_of_unix fn =
+      in_build_dir (BaseFilePath.of_unix fn)
+    in
+  
+    let cond_targets =
+      List.fold_left
+        (fun acc ->
+           function
+             | Library (cs, bs, lib) when var_choose bs.bs_build ->
+                 begin
+                   let evs, unix_files =
+                     BaseBuilt.of_library
+                       in_build_dir_of_unix
+                       (cs, bs, lib)
+                   in
+  
+                   let ends_with nd fn =
+                     let nd_len =
+                       String.length nd
+                     in
+                       (String.length fn >= nd_len)
+                       &&
+                       (String.sub
+                          fn
+                          (String.length fn - nd_len)
+                          nd_len) = nd
+                   in
+  
+                   let tgts =
+                     List.flatten
+                       (List.filter
+                          (fun l -> l <> [])
+                          (List.map
+                             (List.filter
+                                (fun fn ->
+                                   ends_with ".cma" fn ||
+                                   ends_with ".cmxa" fn ||
+                                   ends_with (ext_lib ()) fn ||
+                                   ends_with (ext_dll ()) fn))
+                             unix_files))
+                   in
+  
+                     match tgts with
+                       | _ :: _ ->
+                           (evs, tgts) :: acc
+                       | [] ->
+                           failwithf
+                             (f_ "No possible ocamlbuild targets for library %s")
+                             cs.cs_name
+                 end
+  
+             | Executable (cs, bs, exec) when var_choose bs.bs_build ->
+                 begin
+                   let evs, unix_exec_is, unix_dll_opt =
+                     BaseBuilt.of_executable
+                       in_build_dir_of_unix
+                       (cs, bs, exec)
+                   in
+  
+                   let target ext =
+                     let unix_tgt =
+                       (BaseFilePath.Unix.concat
+                          bs.bs_path
+                          (BaseFilePath.Unix.chop_extension
+                             exec.exec_main_is))^ext
+                     in
+                     let evs = 
+                       (* Fix evs, we want to use the unix_tgt, without copying *)
+                       List.map
+                         (function
+                            | BaseBuilt.BExec, nm, lst when nm = cs.cs_name ->
+                                BaseBuilt.BExec, nm, [[in_build_dir_of_unix unix_tgt]]
+                            | ev ->
+                                ev)
+                         evs
+                     in
+                       evs, [unix_tgt]
+                   in
+  
+                   (* Add executable *)
+                   let acc =
+                     match bs.bs_compiled_object with
+                       | Native ->
+                           (target ".native") :: acc
+                       | Best when bool_of_string (is_native ()) ->
+                           (target ".native") :: acc
+                       | Byte
+                       | Best ->
+                           (target ".byte") :: acc
+                   in
+                     acc
+                 end
+  
+             | Library _ | Executable _ | Test _
+             | SrcRepo _ | Flag _ | Doc _ ->
+                 acc)
+        []
+        (* Keep the pkg.sections ordered *)
+        (List.rev pkg.sections);
+    in
+  
+    (* Check and register built files *)
+    let check_and_register (bt, bnm, lst) =
+      List.iter
+        (fun fns ->
+           if not (List.exists Sys.file_exists fns) then
+             failwithf
+               (f_ "No one of expected built files %s exists")
+               (String.concat (s_ ", ") (List.map (Printf.sprintf "'%s'") fns)))
+        lst;
+        (BaseBuilt.register bt bnm lst)
+    in
+  
+    let cond_targets =
+      (* Run the hook *)
+      !cond_targets_hook cond_targets
+    in
+  
+      (* Run a list of target... *)
+      run_ocamlbuild 
+        (List.flatten 
+           (List.map snd cond_targets))
+        argv;
+      (* ... and register events *)
+      List.iter
+        check_and_register
+        (List.flatten (List.map fst cond_targets))
+  
+  
+  let clean pkg extra_args  =
+    run_clean extra_args;
+    List.iter
+      (function
+         | Library (cs, _, _) ->
+             BaseBuilt.unregister BaseBuilt.BLib cs.cs_name
+         | Executable (cs, _, _) ->
+             BaseBuilt.unregister BaseBuilt.BExec cs.cs_name;
+             BaseBuilt.unregister BaseBuilt.BExecLib cs.cs_name
+         | _ ->
+             ())
+      pkg.sections
+  
+end
+
+module OCamlbuildDocPlugin = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml"
+  
+  (* Create documentation using ocamlbuild .odocl files
+     @author Sylvain Le Gall
+   *)
+  
+  open OASISTypes
+  open OASISGettext
+  open OASISMessage
+  open OCamlbuildCommon
+  open BaseStandardVar
+  
+  
+  
+  let doc_build path pkg (cs, doc) argv =
+    let index_html =
+      BaseFilePath.Unix.make
+        [
+          path;
+          cs.cs_name^".docdir";
+          "index.html";
+        ]
+    in
+    let tgt_dir =
+      BaseFilePath.make
+        [
+          build_dir argv;
+          BaseFilePath.of_unix path;
+          cs.cs_name^".docdir";
+        ]
+    in
+      run_ocamlbuild [index_html] argv;
+      List.iter
+        (fun glb ->
+           BaseBuilt.register
+             BaseBuilt.BDoc
+             cs.cs_name
+             [BaseFileUtil.glob
+                (Filename.concat tgt_dir glb)])
+        ["*.html"; "*.css"]
+  
+  let doc_clean t pkg (cs, doc) argv =
+    run_clean argv;
+    BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name
+  
+end
+
+
+module CustomPlugin = struct
+# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/custom/CustomPlugin.ml"
+  
+  (** Generate custom configure/build/doc/test/install system
+      @author
+    *)
+  
+  open BaseEnv
+  open OASISGettext
+  open OASISTypes
+  
+  
+  
+  type t =
+      {
+        cmd_main:      command_line conditional;
+        cmd_clean:     (command_line option) conditional;
+        cmd_distclean: (command_line option) conditional;
+      } 
+  
+  let run  = BaseCustom.run 
+  
+  let main t _ extra_args =
+    let cmd, args =
+      var_choose 
+        ~name:(s_ "main command") 
+        t.cmd_main
+    in
+      run cmd args extra_args 
+  
+  let clean t pkg extra_args =
+    match var_choose t.cmd_clean with
+      | Some (cmd, args) ->
+          run cmd args extra_args
+      | _ ->
+          ()
+  
+  let distclean t pkg extra_args =
+    match var_choose t.cmd_distclean with
+      | Some (cmd, args) ->
+          run cmd args extra_args
+      | _ ->
+          ()
+  
+  module Build =
+  struct 
+    let main t pkg extra_args =
+      main t pkg extra_args;
+      List.iter
+        (fun sct ->
+           let evs =
+             match sct with 
+               | Library (cs, bs, lib) when var_choose bs.bs_build ->
+                   begin
+                     let evs, _ = 
+                       BaseBuilt.of_library 
+                         BaseFilePath.of_unix
+                         (cs, bs, lib) 
+                     in
+                       evs
+                   end
+               | Executable (cs, bs, exec) when var_choose bs.bs_build ->
+                   begin
+                     let evs, _, _ =
+                       BaseBuilt.of_executable
+                         BaseFilePath.of_unix
+                         (cs, bs, exec)
+                     in
+                       evs
+                   end
+               | _ ->
+                   []
+           in
+             List.iter
+               (fun (bt, bnm, lst) -> BaseBuilt.register bt bnm lst)
+               evs)
+        pkg.sections
+  
+    let clean t pkg extra_args =
+      clean t pkg extra_args;
+      (* TODO: this seems to be pretty generic (at least wrt to ocamlbuild
+       * considering moving this to BaseSetup?
+       *)
+      List.iter
+        (function
+           | Library (cs, _, _) ->
+               BaseBuilt.unregister BaseBuilt.BLib cs.cs_name
+           | Executable (cs, _, _) ->
+               BaseBuilt.unregister BaseBuilt.BExec cs.cs_name;
+               BaseBuilt.unregister BaseBuilt.BExecLib cs.cs_name
+           | _ ->
+               ())
+        pkg.sections
+  
+    let distclean t pkg extra_args =
+      distclean t pkg extra_args
+  end
+  
+  module Test =
+  struct
+    let main t pkg (cs, test) extra_args =
+      try
+        main t pkg extra_args;
+        0.0
+      with Failure s ->
+        BaseMessage.warning 
+          (f_ "Test '%s' fails: %s")
+          cs.cs_name
+          s;
+        1.0
+  
+    let clean t pkg (cs, test) extra_args =
+      clean t pkg extra_args
+  
+    let distclean t pkg (cs, test) extra_args =
+      distclean t pkg extra_args 
+  end
+  
+  module Doc =
+  struct
+    let main t pkg (cs, _) extra_args =
+      main t pkg extra_args;
+      BaseBuilt.register BaseBuilt.BDoc cs.cs_name []
+  
+    let clean t pkg (cs, _) extra_args =
+      clean t pkg extra_args;
+      BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name
+  
+    let distclean t pkg (cs, _) extra_args =
+      distclean t pkg extra_args
+  end
+  
+end
+
+
+open OASISTypes;;
+
+let setup_t =
+  {
+     BaseSetup.configure = InternalConfigurePlugin.configure;
+     build = OCamlbuildPlugin.build;
+     test =
+       [
+          ("sexp",
+            CustomPlugin.Test.main
+              {
+                 CustomPlugin.cmd_main =
+                   [
+                      (OASISExpr.EBool true,
+                        ("$sexp_test", ["<"; "test.sexp"]))
+                   ];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 });
+          ("conv",
+            CustomPlugin.Test.main
+              {
+                 CustomPlugin.cmd_main =
+                   [(OASISExpr.EBool true, ("$conv_test", []))];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 })
+       ];
+     doc = [("sexplib", OCamlbuildDocPlugin.doc_build "lib")];
+     install = InternalInstallPlugin.install;
+     uninstall = InternalInstallPlugin.uninstall;
+     clean = [OCamlbuildPlugin.clean];
+     clean_test =
+       [
+          ("sexp",
+            CustomPlugin.Test.clean
+              {
+                 CustomPlugin.cmd_main =
+                   [
+                      (OASISExpr.EBool true,
+                        ("$sexp_test", ["<"; "test.sexp"]))
+                   ];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 });
+          ("conv",
+            CustomPlugin.Test.clean
+              {
+                 CustomPlugin.cmd_main =
+                   [(OASISExpr.EBool true, ("$conv_test", []))];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 })
+       ];
+     clean_doc = [("sexplib", OCamlbuildDocPlugin.doc_clean "lib")];
+     distclean = [];
+     distclean_test =
+       [
+          ("sexp",
+            CustomPlugin.Test.distclean
+              {
+                 CustomPlugin.cmd_main =
+                   [
+                      (OASISExpr.EBool true,
+                        ("$sexp_test", ["<"; "test.sexp"]))
+                   ];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 });
+          ("conv",
+            CustomPlugin.Test.distclean
+              {
+                 CustomPlugin.cmd_main =
+                   [(OASISExpr.EBool true, ("$conv_test", []))];
+                 cmd_clean = [(OASISExpr.EBool true, None)];
+                 cmd_distclean = [(OASISExpr.EBool true, None)];
+                 })
+       ];
+     distclean_doc = [];
+     package =
+       {
+          oasis_version = "0.3";
+          ocaml_version = Some (OASISVersion.VGreaterEqual "3.12");
+          findlib_version = None;
+          name = "sexplib";
+          version = "7.0.5";
+          license =
+            OASISLicense.DEP5License
+              {
+                 OASISLicense.license = "LGPL";
+                 exceptions = ["OCaml linking"];
+                 version = OASISLicense.Version "2.1";
+                 };
+          license_file = Some "LICENSE";
+          copyrights = ["(C) 2005-2011 Jane Street Capital LLC"];
+          maintainers = [];
+          authors = ["Markus Mottl"; "Martin Sandin"];
+          homepage = None;
+          synopsis = "automated S-expression conversion";
+          description = None;
+          categories = [];
+          conf_type = (`Configure, "internal", Some "0.3");
+          conf_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          build_type = (`Build, "ocamlbuild", Some "0.3");
+          build_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          install_type = (`Install, "internal", Some "0.3");
+          install_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          uninstall_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          clean_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          distclean_custom =
+            {
+               pre_command = [(OASISExpr.EBool true, None)];
+               post_command = [(OASISExpr.EBool true, None)];
+               };
+          files_ab = [];
+          sections =
+            [
+               Library
+                 ({
+                     cs_name = "sexplib";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      bs_build = [(OASISExpr.EBool true, true)];
+                      bs_install = [(OASISExpr.EBool true, true)];
+                      bs_path = "lib";
+                      bs_compiled_object = Best;
+                      bs_build_depends =
+                        [
+                           FindlibPackage ("unix", None);
+                           FindlibPackage ("bigarray", None);
+                           FindlibPackage ("num", None)
+                        ];
+                      bs_build_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      bs_c_sources = [];
+                      bs_data_files = [];
+                      bs_ccopt = [(OASISExpr.EBool true, [])];
+                      bs_cclib = [(OASISExpr.EBool true, [])];
+                      bs_dlllib = [(OASISExpr.EBool true, [])];
+                      bs_dllpath = [(OASISExpr.EBool true, [])];
+                      bs_byteopt = [(OASISExpr.EBool true, [])];
+                      bs_nativeopt = [(OASISExpr.EBool true, [])];
+                      },
+                   {
+                      lib_modules =
+                        [
+                           "Type";
+                           "Parser";
+                           "Lexer";
+                           "Pre_sexp";
+                           "Sexp_intf";
+                           "Sexp";
+                           "Path";
+                           "Conv";
+                           "Conv_error";
+                           "Exn_magic";
+                           "Std"
+                        ];
+                      lib_pack = true;
+                      lib_internal_modules = [];
+                      lib_findlib_parent = None;
+                      lib_findlib_name = None;
+                      lib_findlib_containers = [];
+                      });
+               Library
+                 ({
+                     cs_name = "pa_sexp_conv";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      bs_build = [(OASISExpr.EBool true, true)];
+                      bs_install = [(OASISExpr.EBool true, true)];
+                      bs_path = "syntax";
+                      bs_compiled_object = Byte;
+                      bs_build_depends =
+                        [
+                           FindlibPackage ("camlp4.quotations", None);
+                           FindlibPackage ("camlp4.extend", None);
+                           FindlibPackage
+                             ("type_conv",
+                               Some (OASISVersion.VGreaterEqual "3.0.5"))
+                        ];
+                      bs_build_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      bs_c_sources = [];
+                      bs_data_files = [];
+                      bs_ccopt = [(OASISExpr.EBool true, [])];
+                      bs_cclib = [(OASISExpr.EBool true, [])];
+                      bs_dlllib = [(OASISExpr.EBool true, [])];
+                      bs_dllpath = [(OASISExpr.EBool true, [])];
+                      bs_byteopt = [(OASISExpr.EBool true, [])];
+                      bs_nativeopt = [(OASISExpr.EBool true, [])];
+                      },
+                   {
+                      lib_modules = ["Pa_sexp_conv"];
+                      lib_pack = false;
+                      lib_internal_modules = [];
+                      lib_findlib_parent = Some "sexplib";
+                      lib_findlib_name = Some "syntax";
+                      lib_findlib_containers = [];
+                      });
+               Executable
+                 ({
+                     cs_name = "conv_test";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      bs_build =
+                        [
+                           (OASISExpr.EBool true, false);
+                           (OASISExpr.EFlag "tests", true)
+                        ];
+                      bs_install = [(OASISExpr.EBool true, false)];
+                      bs_path = "lib_test";
+                      bs_compiled_object = Byte;
+                      bs_build_depends =
+                        [
+                           InternalLibrary "sexplib";
+                           InternalLibrary "pa_sexp_conv"
+                        ];
+                      bs_build_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      bs_c_sources = [];
+                      bs_data_files = [];
+                      bs_ccopt = [(OASISExpr.EBool true, [])];
+                      bs_cclib = [(OASISExpr.EBool true, [])];
+                      bs_dlllib = [(OASISExpr.EBool true, [])];
+                      bs_dllpath = [(OASISExpr.EBool true, [])];
+                      bs_byteopt = [(OASISExpr.EBool true, [])];
+                      bs_nativeopt = [(OASISExpr.EBool true, [])];
+                      },
+                   {exec_custom = false; exec_main_is = "conv_test.ml"; });
+               Library
+                 ({
+                     cs_name = "sexplib_top";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      bs_build = [(OASISExpr.EBool true, true)];
+                      bs_install = [(OASISExpr.EBool true, true)];
+                      bs_path = "top";
+                      bs_compiled_object = Best;
+                      bs_build_depends = [];
+                      bs_build_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      bs_c_sources = [];
+                      bs_data_files = [];
+                      bs_ccopt = [(OASISExpr.EBool true, [])];
+                      bs_cclib = [(OASISExpr.EBool true, [])];
+                      bs_dlllib = [(OASISExpr.EBool true, [])];
+                      bs_dllpath = [(OASISExpr.EBool true, [])];
+                      bs_byteopt = [(OASISExpr.EBool true, [])];
+                      bs_nativeopt = [(OASISExpr.EBool true, [])];
+                      },
+                   {
+                      lib_modules = ["Install_printers"];
+                      lib_pack = false;
+                      lib_internal_modules = [];
+                      lib_findlib_parent = Some "sexplib";
+                      lib_findlib_name = Some "top";
+                      lib_findlib_containers = [];
+                      });
+               Test
+                 ({
+                     cs_name = "sexp";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      test_type = (`Test, "custom", Some "0.3");
+                      test_command =
+                        [
+                           (OASISExpr.EBool true,
+                             ("$sexp_test", ["<"; "test.sexp"]))
+                        ];
+                      test_custom =
+                        {
+                           pre_command = [(OASISExpr.EBool true, None)];
+                           post_command = [(OASISExpr.EBool true, None)];
+                           };
+                      test_working_directory = Some "lib_test";
+                      test_run =
+                        [
+                           (OASISExpr.EBool true, false);
+                           (OASISExpr.EFlag "tests", true)
+                        ];
+                      test_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      });
+               Test
+                 ({
+                     cs_name = "conv";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      test_type = (`Test, "custom", Some "0.3");
+                      test_command =
+                        [(OASISExpr.EBool true, ("$conv_test", []))];
+                      test_custom =
+                        {
+                           pre_command = [(OASISExpr.EBool true, None)];
+                           post_command = [(OASISExpr.EBool true, None)];
+                           };
+                      test_working_directory = Some "lib_test";
+                      test_run =
+                        [
+                           (OASISExpr.EBool true, false);
+                           (OASISExpr.EFlag "tests", true)
+                        ];
+                      test_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      });
+               Executable
+                 ({
+                     cs_name = "sexp_test";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      bs_build =
+                        [
+                           (OASISExpr.EBool true, false);
+                           (OASISExpr.EFlag "tests", true)
+                        ];
+                      bs_install = [(OASISExpr.EBool true, false)];
+                      bs_path = "lib_test";
+                      bs_compiled_object = Byte;
+                      bs_build_depends = [InternalLibrary "sexplib"];
+                      bs_build_tools =
+                        [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
+                      bs_c_sources = [];
+                      bs_data_files = [];
+                      bs_ccopt = [(OASISExpr.EBool true, [])];
+                      bs_cclib = [(OASISExpr.EBool true, [])];
+                      bs_dlllib = [(OASISExpr.EBool true, [])];
+                      bs_dllpath = [(OASISExpr.EBool true, [])];
+                      bs_byteopt = [(OASISExpr.EBool true, [])];
+                      bs_nativeopt = [(OASISExpr.EBool true, [])];
+                      },
+                   {exec_custom = false; exec_main_is = "sexp_test.ml"; });
+               Doc
+                 ({
+                     cs_name = "sexplib";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = [];
+                     },
+                   {
+                      doc_type = (`Doc, "ocamlbuild", Some "0.3");
+                      doc_custom =
+                        {
+                           pre_command = [(OASISExpr.EBool true, None)];
+                           post_command = [(OASISExpr.EBool true, None)];
+                           };
+                      doc_build =
+                        [
+                           (OASISExpr.EBool true, false);
+                           (OASISExpr.EFlag "docs", true)
+                        ];
+                      doc_install = [(OASISExpr.EBool true, true)];
+                      doc_install_dir = "$docdir";
+                      doc_title = "API reference for sexplib";
+                      doc_authors = [];
+                      doc_abstract = None;
+                      doc_format = OtherDoc;
+                      doc_data_files = [];
+                      doc_build_tools =
+                        [
+                           ExternalTool "ocamlbuild";
+                           ExternalTool "camlp4o";
+                           ExternalTool "ocamldoc"
+                        ];
+                      })
+            ];
+          plugins =
+            [
+               (`Extra, "StdFiles", Some "0.3");
+               (`Extra, "DevFiles", Some "0.3");
+               (`Extra, "META", Some "0.3")
+            ];
+          schema_data = PropList.Data.create ();
+          plugin_data = [];
+          };
+     version = "0.3.0~rc2";
+     };;
+
+let setup () = BaseSetup.setup setup_t;;
+
+# 5596 "setup.ml"
+(* OASIS_STOP *)
+let () = setup ();;
diff --git a/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.ml b/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.ml
new file mode 100644 (file)
index 0000000..ba066db
--- /dev/null
@@ -0,0 +1,1383 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This file is derived from file "pa_tywith.ml" of version 0.45 of the       *
+ * library "Tywith".                                                          *
+ *                                                                            *
+ * Tywith is Copyright (C) 2004, 2005 by                                      *
+ *                                                                            *
+ *    Martin Sandin  <msandin@hotmail.com>                                    *
+ *                                                                            *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(* Pa_sexp_conv: Preprocessing Module for Automated S-expression Conversions *)
+
+open StdLabels
+open MoreLabels
+
+open Printf
+
+open Camlp4
+open PreCast
+
+module Gen = Pa_type_conv.Gen
+
+(* Utility functions *)
+
+let mk_rev_bindings loc fps =
+  let coll (i, bindings, patts, vars) fp =
+    let name = "v" ^ string_of_int i in
+    let var_expr = <:expr@loc< $lid:name$ >> in
+    let expr =
+      match fp with
+      | `Fun fun_expr -> <:expr@loc< $fun_expr$ $var_expr$ >>
+      | `Match matchings -> <:expr@loc< match $var_expr$ with [ $matchings$ ] >>
+    in
+    let patt = <:patt@loc< $lid:name$ >> in
+    let bindings = <:binding@loc< $patt$ = $expr$ and $bindings$ >> in
+    i - 1, bindings, patt :: patts, var_expr :: vars
+  in
+  let n = List.length fps in
+  let _, bindings, patts, expr =
+    List.fold_left ~f:coll ~init:(n, Ast.BiNil loc, [], []) fps
+  in
+  bindings, patts, expr
+
+let mk_bindings loc fps = mk_rev_bindings loc (List.rev fps)
+
+let unroll_cnv_fp loc var = function
+  | `Fun fun_expr -> <:expr@loc< $fun_expr$ $var$ >>
+  | `Match matchings -> <:expr@loc< match $var$ with [ $matchings$ ] >>
+
+let unroll_fun_matches loc fp1 fp2 =
+  match fp1, fp2 with
+  | `Fun fun_expr1, `Fun fun_expr2 ->
+      <:expr@loc< $fun_expr1$ $fun_expr2$ >>
+  | `Fun fun_expr, `Match matching ->
+      <:expr@loc< $fun_expr$ (fun [ $matching$ ]) >>
+  | _ -> assert false  (* impossible *)
+
+let rec sig_of_tds cnv = function
+  | Ast.TyDcl (loc, type_name, tps, rhs, cl) -> cnv loc type_name tps rhs cl
+  | Ast.TyAnd (loc, tp1, tp2) ->
+      <:sig_item@loc< $sig_of_tds cnv tp1$; $sig_of_tds cnv tp2$ >>
+  | _ -> assert false  (* impossible *)
+
+
+(* Generators for S-expressions *)
+
+(* Generates the signature for type conversion to S-expressions *)
+module Sig_generate_sexp_of = struct
+
+  let rec sig_of_td__loop acc = function
+    | [] ->
+        let loc = Ast.loc_of_ctyp acc in
+        <:ctyp@loc< $acc$ -> Sexplib.Sexp.t >>
+    | tp :: tps ->
+        let tp = Gen.drop_variance_annotations tp in
+        let loc = Ast.loc_of_ctyp tp in
+        let sexp_of = sig_of_td__loop <:ctyp@loc< $acc$ $tp$ >> tps in
+        <:ctyp@loc< ( $tp$ -> Sexplib.Sexp.t ) -> $sexp_of$ >>
+
+  let sig_of_td loc type_name tps _rhs _cl =
+    let sexp_of = sig_of_td__loop <:ctyp@loc< $lid:type_name$ >> tps in
+    <:sig_item@loc< value $lid: "sexp_of_" ^ type_name$ : $sexp_of$ >>
+
+  let mk_sig tds = <:sig_item< $sig_of_tds sig_of_td tds$ >>
+
+  let () = Pa_type_conv.add_sig_generator "sexp_of" mk_sig
+
+  let mk_sig_exn = function
+    | <:ctyp@loc< $uid:_$ >> | <:ctyp@loc< $uid:_$ of $_$ >> ->
+        <:sig_item@loc< >>
+    | tp -> Gen.error tp ~fn:"mk_sig_exn" ~msg:"unknown type"
+
+  let () = Pa_type_conv.add_sig_generator ~is_exn:true "sexp" mk_sig_exn
+end
+
+
+(* Generates the signature for type conversion from S-expressions *)
+module Sig_generate_of_sexp = struct
+
+  let rec is_polymorphic_variant = function
+    | <:ctyp< private $tp$ >> -> is_polymorphic_variant tp
+    | <:ctyp< ( $tup:_$ ) >>
+    | <:ctyp< $_$ -> $_$ >>
+    | <:ctyp< { $_$ } >>
+    | <:ctyp< [ $_$ ] >> -> `Surely_not
+    | <:ctyp< [< $_$ ] >> | <:ctyp< [> $_$ ] >>
+    | <:ctyp< [= $_$ ] >> -> `Definitely
+    | <:ctyp< '$_$ >>
+    | <:ctyp< $_$ $_$ >>
+    | <:ctyp< $id:_$ >>
+    | <:ctyp< >> -> `Maybe
+    | <:ctyp< $tp1$ == $tp2$ >> ->
+        begin match is_polymorphic_variant tp1 with
+        | (`Surely_not | `Definitely) as res -> res
+        | `Maybe -> is_polymorphic_variant tp2 end
+    | tp -> Gen.unknown_type tp "Sig_generate_of_sexp.is_polymorphic_variant"
+
+  let rec sig_of_td__loop acc = function
+    | [] ->
+        let loc = Ast.loc_of_ctyp acc in
+        <:ctyp@loc< Sexplib.Sexp.t -> $acc$ >>
+    | tp :: tps ->
+        let tp = Gen.drop_variance_annotations tp in
+        let loc = Ast.loc_of_ctyp tp in
+        let of_sexp = sig_of_td__loop <:ctyp@loc< $acc$ $tp$ >> tps in
+        <:ctyp@loc< ( Sexplib.Sexp.t -> $tp$ ) -> $of_sexp$ >>
+
+  let sig_of_td with_poly loc type_name tps rhs _cl =
+    let of_sexp = sig_of_td__loop <:ctyp@loc< $lid:type_name$ >> tps in
+    let of_sexp_item =
+      <:sig_item@loc< value $lid: type_name ^ "_of_sexp"$ : $of_sexp$; >>
+    in
+    match with_poly, is_polymorphic_variant rhs with
+    | true, `Surely_not ->
+        Gen.error rhs ~fn:"Sig_generate_of_sexp.sig_of_td"
+          ~msg:"sexp_poly annotation \
+            but type is surely not a polymorphic variant"
+    | false, (`Surely_not | `Maybe) -> of_sexp_item
+    | (true | false), `Definitely | true, `Maybe ->
+        <:sig_item@loc<
+          $of_sexp_item$;
+          value $lid: type_name ^ "_of_sexp__"$ : $of_sexp$;
+        >>
+
+  let mk_sig with_poly tds =
+    <:sig_item< $sig_of_tds (sig_of_td with_poly) tds$ >>
+
+  let () = Pa_type_conv.add_sig_generator "of_sexp" (mk_sig false)
+  let () = Pa_type_conv.add_sig_generator "of_sexp_poly" (mk_sig true)
+end
+
+
+(* Generates the signature for type conversion to S-expressions *)
+module Sig_generate = struct
+  let () =
+    Pa_type_conv.add_sig_generator "sexp" (fun tds ->
+      let loc = Ast.loc_of_ctyp tds in
+      <:sig_item@loc<
+        $Sig_generate_sexp_of.mk_sig tds$;
+        $Sig_generate_of_sexp.mk_sig false tds$
+      >>)
+
+  let () =
+    Pa_type_conv.add_sig_generator "sexp_poly" (fun tds ->
+      let loc = Ast.loc_of_ctyp tds in
+      <:sig_item@loc<
+        $Sig_generate_sexp_of.mk_sig tds$;
+        $Sig_generate_of_sexp.mk_sig true tds$
+      >>)
+end
+
+
+(* Generator for converters of OCaml-values to S-expressions *)
+module Generate_sexp_of = struct
+  let mk_abst_call loc tn rev_path =
+    <:expr@loc<
+      $id:Gen.ident_of_rev_path loc (("sexp_of_" ^ tn) :: rev_path)$
+    >>
+
+  (* Conversion of type paths *)
+  let sexp_of_path_fun loc id =
+    match Gen.get_rev_id_path id [] with
+    | tn :: rev_path -> mk_abst_call loc tn rev_path
+    | [] -> assert false  (* impossible *)
+
+  (* Conversion of types *)
+  let rec sexp_of_type = function
+    | <:ctyp@loc< sexp_opaque $_$ >> ->
+        `Fun <:expr@loc< Sexplib.Conv.sexp_of_opaque >>
+    | <:ctyp@loc< $tp1$ $tp2$ >> -> `Fun (sexp_of_appl_fun loc tp1 tp2)
+    | <:ctyp< ( $tup:tp$ ) >> -> sexp_of_tuple tp
+    | <:ctyp@loc< '$parm$ >> -> `Fun <:expr@loc< $lid:"_of_" ^ parm$ >>
+    | <:ctyp@loc< $id:id$ >> -> `Fun (sexp_of_path_fun loc id)
+    | <:ctyp@loc< $_$ -> $_$ >> as arrow ->
+        `Fun <:expr@loc< fun (_f : $arrow$) ->
+          Sexplib.Conv.sexp_of_fun Pervasives.ignore >>
+    | <:ctyp< [< $row_fields$ ] >> | <:ctyp< [> $row_fields$ ] >>
+    | <:ctyp< [= $row_fields$ ] >> -> sexp_of_variant row_fields
+    | <:ctyp< ! $parms$ . $poly_tp$ >> -> sexp_of_poly parms poly_tp
+    | tp -> Gen.unknown_type tp "sexp_of_type"
+
+  (* Conversion of polymorphic types *)
+  and sexp_of_appl_fun loc tp1 tp2 =
+    match sexp_of_type tp1, sexp_of_type tp2 with
+    | `Fun fun_expr1, `Fun fun_expr2 -> <:expr@loc< $fun_expr1$ $fun_expr2$ >>
+    | `Fun fun_expr, `Match matching ->
+        <:expr@loc< $fun_expr$ (fun [ $matching$ ]) >>
+    | _ -> assert false  (* impossible *)
+
+
+  (* Conversion of tuples *)
+  and sexp_of_tuple tp =
+    let loc = Ast.loc_of_ctyp tp in
+    let fps = List.map ~f:sexp_of_type (Ast.list_of_ctyp tp []) in
+    let bindings, patts, vars = mk_bindings loc fps in
+    let in_expr = <:expr@loc< Sexplib.Sexp.List $Gen.mk_expr_lst loc vars$ >> in
+    let expr = <:expr@loc< let $bindings$ in $in_expr$ >> in
+    `Match <:match_case@loc< ( $tup:Ast.paCom_of_list patts$ ) -> $expr$ >>
+
+
+  (* Conversion of variant types *)
+
+  and mk_cnv_expr tp =
+    let loc = Ast.loc_of_ctyp tp in
+    match sexp_of_type tp with
+    | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+    | `Match matchings -> <:expr@loc< fun [ $matchings$ ] >>
+
+  and sexp_of_variant row_fields =
+    let rec loop = function
+      | <:ctyp@loc< $tp1$ | $tp2$ >> ->
+          <:match_case@loc< $loop tp1$ | $loop tp2$ >>
+      | <:ctyp@loc< `$cnstr$ >> ->
+          <:match_case@loc< `$cnstr$ -> Sexplib.Sexp.Atom $str:cnstr$ >>
+      | <:ctyp@loc< `$cnstr$ of sexp_list $tp$>> ->
+        let cnv_expr =
+          match sexp_of_type tp with
+          | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+          | `Match matchings ->
+              <:expr@loc< fun el -> match el with [ $matchings$ ] >>
+        in
+        <:match_case@loc<
+          `$cnstr$ l ->
+             Sexplib.Sexp.List
+               [ Sexplib.Sexp.Atom $str:cnstr$ ::
+                   Sexplib.Conv.list_map $cnv_expr$ l]
+        >>
+      | <:ctyp@loc< `$cnstr$ of $tps$ >> ->
+          let fps = List.map ~f:sexp_of_type (Ast.list_of_ctyp tps []) in
+          let bindings, patts, vars = mk_bindings loc fps in
+          let cnstr_expr = <:expr@loc< Sexplib.Sexp.Atom $str:cnstr$ >> in
+          let expr =
+            <:expr@loc<
+              let $bindings$ in
+              Sexplib.Sexp.List $Gen.mk_expr_lst loc (cnstr_expr :: vars)$
+            >>
+          in
+          <:match_case@loc< `$cnstr$ $Ast.paSem_of_list patts$ -> $expr$ >>
+      | <:ctyp< [< $row_fields$ ] >> | <:ctyp< [> $row_fields$ ] >>
+      | <:ctyp< [= $row_fields$ ] >> -> loop row_fields
+      | <:ctyp@loc< $tp1$ $tp2$ >> ->
+          let id_path = Gen.get_appl_path loc tp1 in
+          let call = sexp_of_appl_fun loc tp1 tp2 in
+          <:match_case@loc< #$id_path$ as v -> $call$ v >>
+      | <:ctyp@loc< $id:id$ >> | <:ctyp@loc< #$id:id$ >> ->
+          let call =
+            match Gen.get_rev_id_path id [] with
+            | tn :: rev_path -> mk_abst_call loc tn rev_path
+            | [] -> assert false  (* impossible *)
+          in
+          <:match_case@loc< #$id$ as v -> $call$ v >>
+      | tp -> Gen.unknown_type tp "sexp_of_variant"
+    in
+    `Match (loop row_fields)
+
+
+  (* Polymorphic record fields *)
+
+  and sexp_of_poly parms tp =
+    let loc = Ast.loc_of_ctyp tp in
+    let bindings =
+      let mk_binding parm =
+        <:binding@loc< $lid:"_of_" ^ parm$ = Sexplib.Conv.sexp_of_opaque >>
+      in
+      List.map ~f:mk_binding (Gen.ty_var_list_of_ctyp parms [])
+    in
+    match sexp_of_type tp with
+    | `Fun fun_expr -> `Fun <:expr@loc< let $list:bindings$ in $fun_expr$ >>
+    | `Match matchings ->
+        `Match
+          <:match_case@loc<
+            arg ->
+              let $list:bindings$ in
+              match arg with
+              [ $matchings$ ]
+          >>
+
+
+  (* Conversion of sum types *)
+
+  let rec branch_sum = function
+    | <:ctyp@loc< $tp1$ | $tp2$ >> ->
+        <:match_case@loc< $branch_sum tp1$ | $branch_sum tp2$ >>
+    | <:ctyp@loc< $uid:cnstr$ >> ->
+        <:match_case@loc< $uid:cnstr$ -> Sexplib.Sexp.Atom $str:cnstr$ >>
+    | <:ctyp@loc< $uid:cnstr$ of sexp_list $tp$>> ->
+        let cnv_expr =
+          match sexp_of_type tp with
+          | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+          | `Match matchings ->
+              <:expr@loc< fun el -> match el with [ $matchings$ ] >>
+        in
+        <:match_case@loc<
+          $uid:cnstr$ l ->
+             Sexplib.Sexp.List
+               [Sexplib.Sexp.Atom $str:cnstr$ ::
+                   Sexplib.Conv.list_map $cnv_expr$ l]
+        >>
+    | <:ctyp@loc< $uid:cnstr$ of $tps$ >> ->
+        let fps = List.map ~f:sexp_of_type (Ast.list_of_ctyp tps []) in
+        let cnstr_expr = <:expr@loc< Sexplib.Sexp.Atom $str:cnstr$ >> in
+        let bindings, patts, vars = mk_bindings loc fps in
+        let patt =
+          match patts with
+          | [patt] -> patt
+          | _ -> <:patt@loc< ( $tup:Ast.paCom_of_list patts$ ) >>
+        in
+        <:match_case@loc<
+          $uid:cnstr$ $patt$ ->
+            let $bindings$ in
+            Sexplib.Sexp.List $Gen.mk_expr_lst loc (cnstr_expr :: vars)$
+        >>
+    | tp -> Gen.unknown_type tp "branch_sum"
+
+  let sexp_of_sum alts = `Match (branch_sum alts)
+
+
+  (* Conversion of record types *)
+
+  let mk_rec_patt loc patt name =
+    let p = <:patt@loc< $lid:name$ = $lid:"v_" ^ name$ >> in
+    <:patt@loc< $patt$; $p$ >>
+
+  let sexp_of_default_field patt expr name tp sexp_of empty =
+    let loc = Ast.loc_of_ctyp tp in
+    let patt = mk_rec_patt loc patt name in
+    let cnv_expr =
+      match sexp_of_type tp with
+      | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+      | `Match matchings ->
+          <:expr@loc< fun el -> match el with [ $matchings$ ] >>
+    in
+    let expr =
+      let v_name = <:expr@loc< $lid: "v_" ^ name$ >> in
+      <:expr@loc<
+        let bnds =
+          if $v_name$ = $empty$ then bnds
+          else
+            let arg = $sexp_of$ $cnv_expr$ $v_name$ in
+            let bnd =
+              Sexplib.Sexp.List [Sexplib.Sexp.Atom $str:name$; arg]
+            in
+            [ bnd :: bnds ]
+        in
+        $expr$
+      >>
+    in
+    patt, expr
+
+  let sexp_of_record flds_ctyp =
+    let flds = Ast.list_of_ctyp flds_ctyp [] in
+    let rec coll (patt, expr) = function
+      | <:ctyp@loc< $lid:name$ : mutable sexp_option $tp$ >>
+      | <:ctyp@loc< $lid:name$ : sexp_option $tp$ >> ->
+          let patt = mk_rec_patt loc patt name in
+          let vname = <:expr@loc< v >> in
+          let cnv_expr = unroll_cnv_fp loc vname (sexp_of_type tp) in
+          let expr =
+            <:expr@loc<
+              let bnds =
+                match $lid:"v_" ^ name$ with
+                [ None -> bnds
+                | Some v ->
+                    let arg = $cnv_expr$ in
+                    let bnd =
+                      Sexplib.Sexp.List [Sexplib.Sexp.Atom $str:name$; arg]
+                    in
+                    [ bnd :: bnds ] ]
+              in
+              $expr$
+            >>
+          in
+          patt, expr
+      | <:ctyp@loc< $lid:name$ : mutable sexp_bool >>
+      | <:ctyp@loc< $lid:name$ : sexp_bool >> ->
+          let patt = mk_rec_patt loc patt name in
+          let expr =
+            <:expr@loc<
+              let bnds =
+                if $lid:"v_" ^ name$ then
+                  let bnd = Sexplib.Sexp.List [Sexplib.Sexp.Atom $str:name$] in
+                  [ bnd :: bnds ]
+                else bnds
+              in
+              $expr$
+            >>
+          in
+          patt, expr
+      | <:ctyp@loc< $lid:name$ : mutable sexp_list $tp$ >>
+      | <:ctyp@loc< $lid:name$ : sexp_list $tp$ >> ->
+          sexp_of_default_field
+            patt expr name tp <:expr@loc< sexp_of_list >> <:expr@loc< [] >>
+      | <:ctyp@loc< $lid:name$ : mutable sexp_array $tp$ >>
+      | <:ctyp@loc< $lid:name$ : sexp_array $tp$ >> ->
+          sexp_of_default_field
+            patt expr name tp <:expr@loc< sexp_of_array >> <:expr@loc< [||] >>
+      | <:ctyp@loc< $lid:name$ : mutable $tp$ >>
+      | <:ctyp@loc< $lid:name$ : $tp$ >> ->
+          let patt = mk_rec_patt loc patt name in
+          let vname = <:expr@loc< $lid:"v_" ^ name$ >> in
+          let cnv_expr = unroll_cnv_fp loc vname  (sexp_of_type tp) in
+          let expr =
+            <:expr@loc<
+              let arg = $cnv_expr$ in
+              let bnd = Sexplib.Sexp.List [Sexplib.Sexp.Atom $str:name$; arg] in
+              let bnds = [ bnd :: bnds ] in
+              $expr$
+            >>
+          in
+          patt, expr
+      | _ -> assert false  (* impossible *)
+    in
+    let loc = Ast.loc_of_ctyp flds_ctyp in
+    let init_expr = <:expr@loc< Sexplib.Sexp.List bnds >> in
+    let patt, expr =
+      List.fold_left ~f:coll ~init:(<:patt@loc<>>, init_expr) flds
+    in
+    `Match
+      <:match_case@loc<
+        { $patt$ } ->
+          let bnds = [] in
+          $expr$
+      >>
+
+
+  (* Empty type *)
+  let sexp_of_nil loc = `Fun <:expr@loc< fun _v -> assert False >>
+
+
+  (* Generate code from type definitions *)
+
+  let sexp_of_td loc type_name tps rhs =
+    let body =
+      let rec loop tp =
+        Gen.switch_tp_def tp
+          ~alias:(fun (_ : Loc.t) tp -> sexp_of_type tp)
+          ~sum:(fun (_ : Loc.t) tp -> sexp_of_sum tp)
+          ~record:(fun (_ : Loc.t) tp -> sexp_of_record tp)
+          ~variants:(fun (_ : Loc.t) tp -> sexp_of_variant tp)
+          ~mani:(fun (_ : Loc.t) _tp1 tp2 -> loop tp2)
+          ~nil:sexp_of_nil
+      in
+      match loop rhs with
+      | `Fun fun_expr ->
+          (* Prevent violation of value restriction and problems with
+             recursive types by eta-expanding function definitions *)
+          <:expr@loc< fun [ v -> $fun_expr$ v ] >>
+      | `Match matchings -> <:expr@loc< fun [ $matchings$ ] >>
+    in
+    let mk_pat id = <:patt@loc< $lid:id$ >> in
+    let patts =
+      List.map tps
+        ~f:(fun ty -> <:patt@loc< $lid:"_of_" ^ Gen.get_tparam_id ty$>>)
+    in
+    let bnd = mk_pat ("sexp_of_" ^ type_name) in
+    <:binding@loc< $bnd$ = $Gen.abstract loc patts body$ >>
+
+  let rec sexp_of_tds = function
+    | Ast.TyDcl (loc, type_name, tps, rhs, _cl) ->
+        sexp_of_td loc type_name tps rhs
+    | Ast.TyAnd (loc, tp1, tp2) ->
+        <:binding@loc< $sexp_of_tds tp1$ and $sexp_of_tds tp2$ >>
+    | _ -> assert false  (* impossible *)
+
+  let sexp_of tds =
+    let binding, recursive, loc =
+      match tds with
+      | Ast.TyDcl (loc, type_name, tps, rhs, _cl) ->
+          sexp_of_td loc type_name tps rhs,
+          Gen.type_is_recursive type_name rhs, loc
+      | Ast.TyAnd (loc, _, _) as tds -> sexp_of_tds tds, true, loc
+      | _ -> assert false  (* impossible *)
+    in
+    if recursive then <:str_item@loc< value rec $binding$ >>
+    else <:str_item@loc< value $binding$ >>
+
+  (* Add code generator to the set of known generators *)
+  let () = Pa_type_conv.add_generator "sexp_of" sexp_of
+
+  let string_of_ident id =
+    let str_lst = Gen.get_rev_id_path id [] in
+    String.concat ~sep:"." str_lst
+
+  let sexp_of_exn tp =
+    let get_full_cnstr cnstr = Pa_type_conv.get_conv_path () ^ "." ^ cnstr in
+    let expr =
+      match tp with
+      | <:ctyp@loc< $uid:cnstr$ >> ->
+          <:expr@loc<
+            Sexplib.Exn_magic.register $uid:cnstr$ $str:get_full_cnstr cnstr$
+          >>
+      | <:ctyp@loc< $uid:cnstr$ of $tps$ >> ->
+          let ctyps = Ast.list_of_ctyp tps [] in
+          let fps = List.map ~f:sexp_of_type ctyps in
+          let sexp_converters =
+            List.map fps ~f:(function
+            | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+            | `Match matchings -> <:expr@loc< fun [ $matchings$ ] >>)
+          in
+          let _, patts, vars = mk_bindings loc fps in
+          let register_name = sprintf "register%d" (List.length fps) in
+          let make_exc =
+            let var_args =
+              match vars with
+              | [var] -> var
+              | _ -> <:expr@loc< $tup:Ast.exCom_of_list vars$ >>
+            in
+            Gen.abstract loc patts <:expr@loc< $uid:cnstr$ $var_args$ >>
+          in
+          let call =
+            let partial =
+              <:expr@loc<
+                Sexplib.Exn_magic.$lid:register_name$
+                  $make_exc$ $str:get_full_cnstr cnstr$
+              >>
+            in
+            Gen.apply loc partial sexp_converters
+          in
+          <:expr@loc< $call$ >>
+      | tp -> Gen.unknown_type tp "sexp_of_exn"
+    in
+    let loc = Ast.loc_of_ctyp tp in
+    <:str_item@loc< value () = $expr$ >>
+
+  let () = Pa_type_conv.add_generator ~is_exn:true "sexp" sexp_of_exn
+end
+
+
+(* Generator for converters of S-expressions to OCaml-values *)
+module Generate_of_sexp = struct
+  let mk_abst_call loc tn ?(internal = false) rev_path =
+    let tns = tn ^ "_of_sexp" in
+    let tns_suff = if internal then tns ^ "__" else tns in
+    <:expr@loc< $id:Gen.ident_of_rev_path loc (tns_suff :: rev_path)$ >>
+
+  (* Utility functions for polymorphic variants *)
+
+  (* Handle backtracking when variants do not match *)
+  let handle_no_variant_match loc expr =
+    <:match_case@loc< Sexplib.Conv_error.No_variant_match _ -> $expr$ >>
+
+  let is_wildcard = function [_] -> true | _ -> false
+
+  (* Generate code depending on whether to generate a match for the last
+     case of matching a variant *)
+  let handle_variant_match_last loc match_last matches =
+    if match_last || is_wildcard matches then
+      match matches with
+      | <:match_case< $_$ -> $expr$ >> :: _ -> expr
+      | _ -> assert false  (* impossible *)
+    else <:expr@loc< match atom with [ $list:matches$ ] >>
+
+  (* Generate code for matching malformed S-expressions *)
+  let mk_variant_other_matches loc rev_els call =
+    let coll_structs acc (loc, cnstr) =
+      <:match_case@loc<
+        $str:cnstr$ -> Sexplib.Conv_error.$lid:call$ _tp_loc _sexp
+      >> :: acc
+    in
+    let exc_no_variant_match =
+      <:match_case@loc<
+        _ -> Sexplib.Conv_error.no_variant_match _tp_loc _sexp
+      >>
+    in
+    List.fold_left ~f:coll_structs ~init:[exc_no_variant_match] rev_els
+
+  (* Split the row fields of a variant type into lists of atomic variants,
+     structured variants, atomic variants + included variant types,
+     and structured variants + included variant types. *)
+  let rec split_row_field (atoms, structs, ainhs, sinhs as acc) = function
+    | <:ctyp@loc< `$cnstr$ >> ->
+        let tpl = loc, cnstr in
+        (
+          tpl :: atoms,
+          structs,
+          `A tpl :: ainhs,
+          sinhs
+        )
+    | <:ctyp@loc< `$cnstr$ of $tps$ >> ->
+        (
+          atoms,
+          (loc, cnstr) :: structs,
+          ainhs,
+          `S (loc, cnstr, tps) :: sinhs
+        )
+    | <:ctyp< [< $row_fields$ ] >> | <:ctyp< [> $row_fields$ ] >>
+    | <:ctyp< [= $row_fields$ ] >> ->
+        List.fold_left ~f:split_row_field
+          ~init:acc (Ast.list_of_ctyp row_fields [])
+    | <:ctyp< $_$ $_$ >>
+    | (<:ctyp< $id:_$ >> | <:ctyp< #$id:_$ >>) as inh ->
+        let iinh = `I inh in
+        (
+          atoms,
+          structs,
+          iinh :: ainhs,
+          iinh :: sinhs
+        )
+    | tp -> Gen.unknown_type tp "split_row_field"
+
+  (* Conversion of type paths *)
+  let path_of_sexp_fun loc id =
+    match Gen.get_rev_id_path id [] with
+    | tn :: rev_path -> mk_abst_call loc tn rev_path
+    | [] -> assert false  (* no empty paths *)
+
+  (* Conversion of types *)
+  let rec type_of_sexp = function
+    | <:ctyp@loc< sexp_opaque $_$ >> ->
+        `Fun <:expr@loc< Sexplib.Conv.opaque_of_sexp >>
+    | <:ctyp@loc< sexp_option >> ->
+        `Fun <:expr@loc< fun a_of_sexp v -> Some (a_of_sexp v) >>
+    | <:ctyp@loc< sexp_list >> ->
+        `Fun <:expr@loc< fun a_of_sexp v ->
+          Sexplib.Conv.list_of_sexp a_of_sexp v >>
+    | <:ctyp@loc< sexp_array >> ->
+        `Fun <:expr@loc< fun a_of_sexp v ->
+          Sexplib.Conv.array_of_sexp a_of_sexp v >>
+    | <:ctyp@loc< $tp1$ $tp2$ >> ->
+        let fp1 = type_of_sexp tp1 in
+        let fp2 = type_of_sexp tp2 in
+        `Fun (unroll_fun_matches loc fp1 fp2)
+    | <:ctyp< ( $tup:tp$ ) >> -> tuple_of_sexp tp
+    | <:ctyp@loc< '$parm$ >> -> `Fun <:expr@loc< $lid:"_of_" ^ parm$ >>
+    | <:ctyp@loc< $id:id$ >> -> `Fun (path_of_sexp_fun loc id)
+    | <:ctyp@loc< $_$ -> $_$ >> as arrow ->
+        `Fun <:expr@loc< fun sexp ->
+          (Sexplib.Conv.fun_of_sexp sexp : $arrow$) >>
+    | <:ctyp< [< $row_fields$ ] >> | <:ctyp< [> $row_fields$ ] >>
+    | <:ctyp< [= $row_fields$ ] >> ->
+        variant_of_sexp ?full_type:None row_fields
+    | <:ctyp< ! $parms$ . $poly_tp$ >> -> poly_of_sexp parms poly_tp
+    | tp -> Gen.unknown_type tp "type_of_sexp"
+
+  (* Conversion of tuples *)
+  and tuple_of_sexp tps =
+    let fps = List.map ~f:type_of_sexp (Ast.list_of_ctyp tps []) in
+    let loc = Ast.loc_of_ctyp tps in
+    let bindings, patts, vars = mk_bindings loc fps in
+    let n = string_of_int (List.length fps) in
+    `Match
+      <:match_case@loc<
+          Sexplib.Sexp.List $Gen.mk_patt_lst loc patts$ ->
+            let $bindings$ in
+            ( $tup:Ast.exCom_of_list vars$ )
+        | sexp ->
+            Sexplib.Conv_error.tuple_of_size_n_expected _tp_loc $int:n$ sexp
+      >>
+
+  (* Generate internal call *)
+  and mk_internal_call = function
+    | <:ctyp@loc< $id:id$ >> | <:ctyp@loc< #$id:id$ >> ->
+        let call =
+          match Gen.get_rev_id_path id [] with
+          | tn :: rev_path -> mk_abst_call loc tn ~internal:true rev_path
+          | [] -> assert false  (* impossible *)
+        in
+        call
+    | <:ctyp@loc< $tp1$ $tp2$ >> ->
+        let fp1 = `Fun (mk_internal_call tp1) in
+        let fp2 = type_of_sexp tp2 in
+        unroll_fun_matches loc fp1 fp2
+    | _ -> assert false  (* impossible *)
+
+  (* Generate code for matching included variant types *)
+  and handle_variant_inh full_type match_last other_matches inh =
+    let loc = Ast.loc_of_ctyp inh in
+    let fun_expr = mk_internal_call inh in
+    let match_exc =
+      handle_no_variant_match loc (
+        handle_variant_match_last loc match_last other_matches) in
+    let new_other_matches =
+      [
+        <:match_case@loc<
+          _ -> try ($fun_expr$ _sexp :> $full_type$) with [ $match_exc$ ]
+        >>
+      ]
+    in
+    new_other_matches, true
+
+  (* Generate code for matching atomic variants *)
+  and mk_variant_match_atom loc full_type rev_atoms_inhs rev_structs =
+    let coll (other_matches, match_last) = function
+      | `A (loc, cnstr) ->
+          let new_match = <:match_case@loc< $str:cnstr$ -> `$cnstr$ >> in
+          new_match :: other_matches, false
+      | `I inh ->
+          handle_variant_inh full_type match_last other_matches inh
+    in
+    let other_matches =
+      mk_variant_other_matches loc rev_structs "ptag_no_args"
+    in
+    let match_atoms_inhs, match_last =
+      List.fold_left ~f:coll ~init:(other_matches, false) rev_atoms_inhs in
+    handle_variant_match_last loc match_last match_atoms_inhs
+
+
+  (* Variant conversions *)
+
+  (* Match arguments of constructors (variants or sum types) *)
+  and mk_cnstr_args_match ~is_variant cnstr tps =
+    let loc = Ast.loc_of_ctyp tps in
+    let cnstr vars_expr =
+      if is_variant then <:expr@loc< `$cnstr$ $vars_expr$ >>
+      else <:expr@loc< $uid:cnstr$ $vars_expr$ >>
+    in
+    match tps with
+    | <:ctyp@loc< sexp_list $tp$ >> ->
+      let cnv =
+        match type_of_sexp tp with
+        | `Fun fun_expr -> <:expr@loc< $fun_expr$ >>
+        | `Match matchings ->
+            <:expr@loc< fun el -> match el with [ $matchings$ ] >>
+      in
+      cnstr <:expr@loc< Sexplib.Conv.list_map ($cnv$) sexp_args >>
+    | _ ->
+        let fps = List.map ~f:type_of_sexp (Ast.list_of_ctyp tps []) in
+        let bindings, patts, vars = mk_bindings loc fps in
+        let good_arg_match =
+          let vars_expr =
+            match vars with
+            | [var_expr] -> var_expr
+            | _ -> <:expr@loc< ( $tup:Ast.exCom_of_list vars$ ) >>
+          in
+          cnstr vars_expr
+        in
+        let handle_exc =
+          if is_variant then "ptag_incorrect_n_args"
+          else "stag_incorrect_n_args"
+        in
+        <:expr@loc<
+          match sexp_args with
+            [ $Gen.mk_patt_lst loc patts$ -> let $bindings$ in $good_arg_match$
+            | _ -> Sexplib.Conv_error.$lid:handle_exc$ _tp_loc _tag _sexp ]
+        >>
+
+  (* Generate code for matching structured variants *)
+  and mk_variant_match_struct loc full_type rev_structs_inhs rev_atoms =
+    let has_structs_ref = ref false in
+    let coll (other_matches, match_last) = function
+      | `S (loc, cnstr, tps) ->
+          has_structs_ref := true;
+          let expr = mk_cnstr_args_match ~is_variant:true cnstr tps in
+          let new_match =
+            <:match_case@loc< ($str:cnstr$ as _tag) -> $expr$ >>
+          in
+          new_match :: other_matches, false
+      | `I inh ->
+          handle_variant_inh full_type match_last other_matches inh
+    in
+    let other_matches =
+      mk_variant_other_matches loc rev_atoms "ptag_no_args"
+    in
+    let match_structs_inhs, match_last =
+      List.fold_left ~f:coll ~init:(other_matches, false) rev_structs_inhs
+    in
+    (
+      handle_variant_match_last loc match_last match_structs_inhs,
+      !has_structs_ref
+    )
+
+  (* Generate code for handling atomic and structured variants (i.e. not
+     included variant types) *)
+  and handle_variant_tag loc full_type row_fields =
+    let rev_atoms, rev_structs, rev_atoms_inhs, rev_structs_inhs =
+      List.fold_left ~f:split_row_field ~init:([], [], [], []) row_fields
+    in
+    let match_struct, has_structs =
+      mk_variant_match_struct loc full_type rev_structs_inhs rev_atoms in
+    let maybe_sexp_args_patt =
+      if has_structs then <:patt@loc< sexp_args >>
+      else <:patt@loc< _ >>
+    in
+    <:match_case@loc<
+        Sexplib.Sexp.Atom atom as _sexp ->
+          $mk_variant_match_atom loc full_type rev_atoms_inhs rev_structs$
+      | Sexplib.Sexp.List
+          [Sexplib.Sexp.Atom atom :: $maybe_sexp_args_patt$] as _sexp ->
+            $match_struct$
+      | Sexplib.Sexp.List [Sexplib.Sexp.List _ :: _] as sexp ->
+          Sexplib.Conv_error.nested_list_invalid_poly_var _tp_loc sexp
+      | Sexplib.Sexp.List [] as sexp ->
+          Sexplib.Conv_error.empty_list_invalid_poly_var _tp_loc sexp
+    >>
+
+  (* Generate matching code for variants *)
+  and variant_of_sexp ?full_type row_tp =
+    let loc = Ast.loc_of_ctyp row_tp in
+    let row_fields = Ast.list_of_ctyp row_tp [] in
+    let is_contained, full_type =
+      match full_type with
+      | None -> true, <:ctyp@loc< [= $row_tp$ ] >>
+      | Some full_type -> false, full_type
+    in
+    let top_match =
+      match row_fields with
+      | (<:ctyp< $id:_$ >> | <:ctyp< $_$ $_$ >>) as inh :: rest ->
+          let rec loop inh row_fields =
+            let call =
+              <:expr@loc< ( $mk_internal_call inh$ sexp :> $full_type$ ) >>
+            in
+            match row_fields with
+            | [] -> call
+            | h :: t ->
+                let expr =
+                  match h with
+                  | <:ctyp< $id:_$ >> | <:ctyp< $_$ $_$ >> -> loop h t
+                  | _ ->
+                     let rftag_matches =
+                       handle_variant_tag loc full_type row_fields
+                     in
+                     <:expr@loc< match sexp with [ $rftag_matches$ ] >>
+                in
+                <:expr@loc<
+                  try $call$ with
+                  [ $handle_no_variant_match loc expr$ ]
+                >>
+          in
+          <:match_case@loc< sexp -> $loop inh rest$ >>
+      | _ :: _ -> handle_variant_tag loc full_type row_fields
+      | [] -> assert false  (* impossible *)
+    in
+    if is_contained then
+      `Fun
+        <:expr@loc<
+          fun sexp ->
+            try match sexp with [ $top_match$ ]
+            with
+            [ Sexplib.Conv_error.No_variant_match (_tp_loc, sexp) ->
+                Sexplib.Conv_error.no_matching_variant_found _tp_loc sexp
+            ]
+        >>
+    else `Match top_match
+
+  and poly_of_sexp parms tp =
+    let loc = Ast.loc_of_ctyp tp in
+    let bindings =
+      let mk_binding parm =
+        <:binding@loc<
+          $lid:"_of_" ^ parm$ =
+            fun sexp -> Sexplib.Conv_error.record_poly_field_value _tp_loc sexp
+        >>
+      in
+      List.map ~f:mk_binding (Gen.ty_var_list_of_ctyp parms [])
+    in
+    match type_of_sexp tp with
+    | `Fun fun_expr -> `Fun <:expr@loc< let $list:bindings$ in $fun_expr$ >>
+    | `Match matchings ->
+        `Match
+          <:match_case@loc<
+            arg ->
+              let $list:bindings$ in
+              match arg with
+              [ $matchings$ ]
+          >>
+
+
+  (* Sum type conversions *)
+
+  (* Generate matching code for well-formed S-expressions wrt. sum types *)
+  let rec mk_good_sum_matches = function
+    | <:ctyp@loc< $uid:cnstr$ >> ->
+        let lccnstr = String.uncapitalize cnstr in
+        <:match_case@loc<
+          Sexplib.Sexp.Atom ($str:lccnstr$ | $str:cnstr$) -> $uid:cnstr$
+        >>
+    | <:ctyp@loc< $uid:cnstr$ of $tps$ >> ->
+        let lccnstr = String.uncapitalize cnstr in
+        <:match_case@loc<
+          (Sexplib.Sexp.List
+            [Sexplib.Sexp.Atom ($str:lccnstr$ | $str:cnstr$ as _tag) ::
+              sexp_args] as _sexp) ->
+                $mk_cnstr_args_match ~is_variant:false cnstr tps$
+        >>
+    | <:ctyp@loc< $tp1$ | $tp2$ >> ->
+        <:match_case@loc<
+            $mk_good_sum_matches tp1$
+          | $mk_good_sum_matches tp2$
+        >>
+    | _ -> assert false  (* impossible *)
+
+  (* Generate matching code for malformed S-expressions with good tags
+     wrt. sum types *)
+  let rec mk_bad_sum_matches = function
+    | <:ctyp@loc< $uid:cnstr$ >> ->
+        let lccnstr = String.uncapitalize cnstr in
+        <:match_case@loc<
+          Sexplib.Sexp.List
+            [Sexplib.Sexp.Atom ($str:lccnstr$ | $str:cnstr$) :: _] as sexp ->
+              Sexplib.Conv_error.stag_no_args _tp_loc sexp
+        >>
+    | <:ctyp@loc< $uid:cnstr$ of $_$ >> ->
+        let lccnstr = String.uncapitalize cnstr in
+        <:match_case@loc<
+          Sexplib.Sexp.Atom ($str:lccnstr$ | $str:cnstr$) as sexp ->
+            Sexplib.Conv_error.stag_takes_args _tp_loc sexp
+        >>
+    | <:ctyp@loc< $tp1$ | $tp2$ >> ->
+        <:match_case@loc<
+            $mk_bad_sum_matches tp1$
+          | $mk_bad_sum_matches tp2$
+        >>
+    | _ -> assert false  (* impossible *)
+
+  (* Generate matching code for sum types *)
+  let sum_of_sexp alts =
+    let loc = Ast.loc_of_ctyp alts in
+    `Match
+      <:match_case@loc<
+          $mk_good_sum_matches alts$
+        | $mk_bad_sum_matches alts$
+        | Sexplib.Sexp.List [Sexplib.Sexp.List _ :: _] as sexp ->
+            Sexplib.Conv_error.nested_list_invalid_sum _tp_loc sexp
+        | Sexplib.Sexp.List [] as sexp ->
+            Sexplib.Conv_error.empty_list_invalid_sum _tp_loc sexp
+        | sexp -> Sexplib.Conv_error.unexpected_stag _tp_loc sexp
+      >>
+
+
+  (* Record conversions *)
+
+  (* Generate code for extracting record fields *)
+  let mk_extract_fields tp =
+    let rec loop no_args args = function
+      | <:ctyp< $tp1$; $tp2$ >> ->
+          let no_args, args = loop no_args args tp2 in
+          loop no_args args tp1
+      | <:ctyp@loc< $lid:nm$ : mutable sexp_bool >>
+      | <:ctyp@loc< $lid:nm$ : sexp_bool>> ->
+          let no_args =
+            <:match_case@loc<
+                $str:nm$ ->
+                  if $lid:nm ^ "_field"$.val then
+                    duplicates.val := [ field_name :: duplicates.val ]
+                  else $lid:nm ^ "_field"$.val := True
+              | $no_args$
+            >>
+          in
+          no_args, args
+      | <:ctyp@loc< $lid:nm$ : mutable sexp_option $tp$ >>
+      | <:ctyp@loc< $lid:nm$ : sexp_option $tp$ >>
+      | <:ctyp@loc< $lid:nm$ : mutable $tp$ >>
+      | <:ctyp@loc< $lid:nm$ : $tp$ >> ->
+          let unrolled =
+            unroll_cnv_fp loc <:expr@loc< _field_sexp >> (type_of_sexp tp)
+          in
+          let args =
+            <:match_case@loc<
+                $str:nm$ ->
+                  match $lid:nm ^ "_field"$.val with
+                  [ None ->
+                      let fvalue = $unrolled$ in
+                      $lid:nm ^ "_field"$.val := Some fvalue
+                  | Some _ ->
+                      duplicates.val := [ field_name :: duplicates.val ] ]
+              | $args$
+            >>
+          in
+          no_args, args
+        | _ -> assert false  (* impossible *)
+    in
+    let handle_extra =
+      let loc = Ast.loc_of_ctyp tp in
+      <:match_case@loc<
+        _ ->
+          if Sexplib.Conv.record_check_extra_fields.val then
+            extra.val := [ field_name :: extra.val ]
+          else ()
+      >>
+    in
+    loop handle_extra handle_extra tp
+
+  (* Generate code for handling the result of matching record fields *)
+  let mk_handle_record_match_result has_poly flds =
+    let has_nonopt_fields = ref false in
+    let res_tpls, bi_lst, good_patts =
+      let rec loop (res_tpls, bi_lst, good_patts as acc) = function
+        | <:ctyp@loc< $lid:nm$ : $tp$ >> ->
+            let fld = <:expr@loc< $lid:nm ^ "_field"$.val >> in
+            let new_bi_lst, new_good_patts =
+              match tp with
+              | <:ctyp@loc< sexp_bool >> |  <:ctyp@loc< mutable sexp_bool >>
+              | <:ctyp@loc< sexp_option $_$ >>
+              | <:ctyp@loc< mutable sexp_option $_$ >>
+              | <:ctyp@loc< sexp_list $_$ >>
+              | <:ctyp@loc< mutable sexp_list $_$ >>
+              | <:ctyp@loc< sexp_array $_$ >>
+              | <:ctyp@loc< mutable sexp_array $_$ >> ->
+                  bi_lst, <:patt@loc< $lid:nm ^ "_value"$ >> :: good_patts
+              | _ ->
+                  let loc = Ast.loc_of_ctyp tp in
+                  has_nonopt_fields := true;
+                  (
+                    <:expr@loc<
+                      (Pervasives.(=) $fld$ None, $str:nm$) >> :: bi_lst,
+                    <:patt@loc< Some $lid:nm ^ "_value"$ >> :: good_patts
+                  )
+            in
+            (
+              <:expr@loc< $fld$ >> :: res_tpls,
+              new_bi_lst,
+              new_good_patts
+            )
+        | <:ctyp< $tp1$; $tp2$ >> -> loop (loop acc tp2) tp1
+        | _ -> assert false  (* impossible *)
+      in
+      loop ([], [], []) flds
+    in
+    let loc = Ast.loc_of_ctyp flds in
+    let match_good_expr =
+      if has_poly then
+        let rec loop acc = function
+          | <:ctyp< $tp1$; $tp2$ >> -> loop (loop acc tp2) tp1
+          | <:ctyp@loc< $lid:nm$ : $_$ >> ->
+              <:expr@loc< $lid:nm ^ "_value"$ >> :: acc
+          | _ -> assert false  (* impossible *)
+        in
+        match loop [] flds with
+        | [match_good_expr] -> match_good_expr
+        | match_good_exprs ->
+            <:expr@loc< $tup:Ast.exCom_of_list match_good_exprs$ >>
+      else
+        let rec loop = function
+          | <:ctyp@loc< $tp1$; $tp2$ >> ->
+              <:rec_binding@loc< $loop tp1$; $loop tp2$ >>
+          | <:ctyp@loc< $lid:nm$ : sexp_list $_$ >> ->
+              <:rec_binding@loc<
+                $lid:nm$ =
+                  match $lid:nm ^ "_value"$ with
+                  [ None -> [] | Some v -> v ]
+              >>
+          | <:ctyp@loc< $lid:nm$ : sexp_array $_$ >> ->
+              <:rec_binding@loc<
+                $lid:nm$ =
+                  match $lid:nm ^ "_value"$ with
+                  [ None -> [||] | Some v -> v ]
+              >>
+          | <:ctyp@loc< $lid:nm$ : $_$ >> ->
+              <:rec_binding@loc< $lid:nm$ = $lid:nm ^ "_value"$ >>
+          | _ -> assert false  (* impossible *)
+        in
+        <:expr@loc< { $loop flds$ } >>
+    in
+    let expr, patt =
+      match res_tpls, good_patts with
+      | [res_expr], [res_patt] -> res_expr, res_patt
+      | _ ->
+          <:expr@loc< $tup:Ast.exCom_of_list res_tpls$ >>,
+          <:patt@loc< $tup:Ast.paCom_of_list good_patts$ >>
+    in
+    if !has_nonopt_fields then
+      <:expr@loc<
+        match $expr$ with
+        [ $patt$ -> $match_good_expr$
+        | _ ->
+            Sexplib.Conv_error.record_undefined_elements _tp_loc sexp
+              $Gen.mk_expr_lst loc bi_lst$
+        ]
+      >>
+    else <:expr@loc< match $expr$ with [ $patt$ -> $match_good_expr$ ] >>
+
+  (* Generate code for converting record fields *)
+  let mk_cnv_fields has_poly flds =
+    let field_refs =
+      let rec loop = function
+        | <:ctyp@loc< $tp1$; $tp2$ >> ->
+            <:binding@loc< $loop tp1$ and $loop tp2$ >>
+        | <:ctyp@loc< $lid:nm$ : sexp_bool >> ->
+            <:binding@loc< $lid:nm ^ "_field"$ = ref False >>
+        | <:ctyp@loc< $lid:nm$ : $_$ >> ->
+            <:binding@loc< $lid:nm ^ "_field"$ = ref None >>
+        | _ -> assert false  (* impossible *)
+      in
+      loop flds
+    in
+    let mc_no_args_fields, mc_fields_with_args = mk_extract_fields flds in
+    let loc = Ast.loc_of_ctyp flds in
+    <:expr@loc<
+      let $field_refs$ and duplicates = ref [] and extra = ref [] in
+      let rec iter = fun
+        [ [
+            Sexplib.Sexp.List
+              [(Sexplib.Sexp.Atom field_name); _field_sexp] ::
+            tail
+          ] ->
+            do {
+              match field_name with
+              [ $mc_fields_with_args$ ];
+              iter tail }
+        | [Sexplib.Sexp.List [(Sexplib.Sexp.Atom field_name)] :: tail] ->
+            do {
+              match field_name with
+              [ $mc_no_args_fields$ ];
+              iter tail }
+        | [sexp :: _] ->
+            Sexplib.Conv_error.record_only_pairs_expected _tp_loc sexp
+        | [] -> () ]
+      in
+      do {
+        iter field_sexps;
+        if Pervasives.(<>) duplicates.val [] then
+          Sexplib.Conv_error.record_duplicate_fields
+            _tp_loc duplicates.val sexp
+        else if Pervasives.(<>) extra.val [] then
+          Sexplib.Conv_error.record_extra_fields _tp_loc extra.val sexp
+        else $mk_handle_record_match_result has_poly flds$
+      }
+    >>
+
+  let rec is_poly = function
+    | <:ctyp< $_$ : ! $_$ . $_$ >> -> true
+    | <:ctyp< $flds1$; $flds2$ >> -> is_poly flds1 || is_poly flds2
+    | _ -> false
+
+  (* Generate matching code for records *)
+  let record_of_sexp flds =
+    let loc = Ast.loc_of_ctyp flds in
+    let handle_fields =
+      let has_poly = is_poly flds in
+      let cnv_fields = mk_cnv_fields has_poly flds in
+      if has_poly then
+        let is_singleton_ref = ref true in
+        let patt =
+          let rec loop = function
+            | <:ctyp@loc< $tp1$; $tp2$ >> ->
+                is_singleton_ref := false;
+                <:patt@loc< $loop tp1$, $loop tp2$ >>
+            | <:ctyp@loc< $lid:nm$ : $_$ >> -> <:patt@loc< $lid:nm$ >>
+            | _ -> assert false  (* impossible *)
+          in
+          let patt = loop flds in
+          if !is_singleton_ref then patt
+          else <:patt@loc< $tup:patt$ >>
+        in
+        let record_def =
+          let rec loop = function
+            | <:ctyp@loc< $tp1$; $tp2$ >> ->
+                <:rec_binding@loc< $loop tp1$; $loop tp2$ >>
+            | <:ctyp@loc< $lid:nm$ : $_$ >> ->
+                <:rec_binding@loc< $lid:nm$ = $lid:nm$ >>
+            | _ -> assert false  (* impossible *)
+          in
+          loop flds
+        in
+        <:expr@loc<
+          let $patt$ = $cnv_fields$ in
+          { $record_def$ }
+        >>
+      else cnv_fields
+    in
+    `Match
+      <:match_case@loc<
+          Sexplib.Sexp.List field_sexps as sexp -> $handle_fields$
+        | Sexplib.Sexp.Atom _ as sexp ->
+            Sexplib.Conv_error.record_list_instead_atom _tp_loc sexp
+      >>
+
+
+  (* Empty type *)
+  let nil_of_sexp loc =
+    `Fun <:expr@loc< fun sexp -> Sexplib.Conv_error.empty_type _tp_loc sexp >>
+
+
+  (* Generate code from type definitions *)
+
+  let rec is_poly_call = function
+    | <:expr< $f$ $_$ >> -> is_poly_call f
+    | <:expr< $lid:name$ >> -> name.[0] = '_' && name.[1] = 'o'
+    | _ -> false
+
+  let td_of_sexp loc type_name tps rhs =
+    let is_alias_ref = ref false in
+    let handle_alias tp =
+      is_alias_ref := true;
+      type_of_sexp tp
+    in
+    let coll_args tp param =
+      <:ctyp@loc< $tp$ $Gen.drop_variance_annotations param$ >>
+    in
+    let full_type =
+      List.fold_left ~f:coll_args ~init:<:ctyp@loc< $lid:type_name$ >> tps
+    in
+    let is_variant_ref = ref false in
+    let handle_variant row_fields =
+      is_variant_ref := true;
+      variant_of_sexp ~full_type row_fields
+    in
+    let body =
+      let rec loop tp =
+        Gen.switch_tp_def tp
+          ~alias:(fun (_ : Loc.t) tp -> handle_alias tp)
+          ~sum:(fun (_ : Loc.t) tp -> sum_of_sexp tp)
+          ~record:(fun (_ : Loc.t) tp -> record_of_sexp tp)
+          ~variants:(fun (_ : Loc.t) tp -> handle_variant tp)
+          ~mani:(fun (_ : Loc.t) _tp1 tp2 -> loop tp2)
+          ~nil:nil_of_sexp
+      in
+      match loop rhs with
+      | `Fun fun_expr ->
+          (* Prevent violation of value restriction and problems with
+             recursive types by eta-expanding function definitions *)
+          <:expr@loc< fun [ t -> $fun_expr$ t ] >>
+      | `Match matchings -> <:expr@loc< fun [ $matchings$ ] >>
+    in
+    let internal_name = type_name ^ "_of_sexp__" in
+    let arg_patts, arg_exprs =
+      List.split (
+        List.map ~f:(function tp ->
+            let name = "_of_" ^ Gen.get_tparam_id tp in
+            <:patt@loc< $lid:name$ >>, <:expr@loc< $lid:name$ >>
+          )
+          tps)
+    in
+    let with_poly_call = !is_alias_ref && is_poly_call body in
+    let internal_fun_body =
+      let full_type_name =
+        sprintf "%s.%s" (Pa_type_conv.get_conv_path ()) type_name
+      in
+      if with_poly_call then
+        Gen.abstract loc arg_patts
+          <:expr@loc<
+            fun sexp ->
+              Sexplib.Conv_error.silly_type $str:full_type_name$ sexp
+          >>
+      else
+        <:expr@loc<
+          let _tp_loc = $str:full_type_name$ in
+          $Gen.abstract loc arg_patts body$
+        >>
+    in
+    let pre_external_fun_body =
+      let internal_call =
+        let internal_expr = <:expr@loc< $lid:internal_name$ >> in
+        <:expr@loc< $Gen.apply loc internal_expr arg_exprs$ sexp >>
+      in
+      let no_variant_match_mc =
+        <:match_case@loc<
+          Sexplib.Conv_error.No_variant_match (_tp_loc, sexp) ->
+            Sexplib.Conv_error.no_matching_variant_found _tp_loc sexp
+        >>
+      in
+      if with_poly_call then
+        <:expr@loc< try $body$ sexp with [ $no_variant_match_mc$ ] >>
+      (* Type alias may refer to variant, therefore same handling here! *)
+      else if !is_variant_ref || !is_alias_ref then
+        <:expr@loc< try $internal_call$ with [ $no_variant_match_mc$ ] >>
+      else internal_call
+    in
+    let internal_binding =
+      <:binding@loc< $lid:internal_name$ = $internal_fun_body$ >>
+    in
+    let external_fun_patt = <:patt@loc< $lid:type_name ^ "_of_sexp"$ >> in
+    let external_fun_body =
+      Gen.abstract loc arg_patts
+        <:expr@loc< fun sexp -> $pre_external_fun_body$ >>
+    in
+    let external_binding =
+      <:binding@loc< $external_fun_patt$ = $external_fun_body$ >>
+    in
+    internal_binding, external_binding
+
+  let rec tds_of_sexp acc = function
+    | Ast.TyDcl (loc, type_name, tps, rhs, _cl) ->
+        td_of_sexp loc type_name tps rhs :: acc
+    | Ast.TyAnd (_, tp1, tp2) -> tds_of_sexp (tds_of_sexp acc tp2) tp1
+    | _ -> assert false  (* impossible *)
+
+  (* Generate code from type definitions *)
+  let of_sexp = function
+    | Ast.TyDcl (loc, type_name, tps, rhs, _cl) ->
+        let internal_binding, external_binding =
+          td_of_sexp loc type_name tps rhs
+        in
+        let recursive = Gen.type_is_recursive type_name rhs in
+        if recursive then
+          <:str_item@loc<
+            value rec $internal_binding$
+            and $external_binding$
+          >>
+        else
+          <:str_item@loc<
+            value $internal_binding$;
+            value $external_binding$
+          >>
+    | Ast.TyAnd (loc, _, _) as tds ->
+        let two_bindings = tds_of_sexp [] tds in
+        let bindings =
+          List.map ~f:(fun (b1, b2) -> <:binding@loc< $b1$ and $b2$ >>)
+            two_bindings
+        in
+        <:str_item@loc< value rec $list:bindings$ >>
+    | _ -> assert false  (* impossible *)
+
+  (* Add code generator to the set of known generators *)
+  let () = Pa_type_conv.add_generator "of_sexp" of_sexp
+end
+
+module Quotations = struct
+  let of_sexp_quote loc _loc_name_opt cnt_str =
+    Pa_type_conv.set_conv_path_if_not_set loc;
+    let ctyp = Gram.parse_string Syntax.ctyp_quot loc cnt_str in
+    let fp = Generate_of_sexp.type_of_sexp ctyp in
+    let body =
+      match fp with
+      | `Fun fun_expr -> <:expr@loc< $fun_expr$ sexp >>
+      | `Match matchings -> <:expr@loc< match sexp with [$matchings$]  >>
+    in
+    let full_type_name =
+      sprintf "%s line %i: %s"
+        (Pa_type_conv.get_conv_path ()) (Loc.start_line loc) cnt_str
+    in
+    <:expr@loc<
+      fun [ sexp ->
+        let _tp_loc = $str:full_type_name$ in
+        $body$ ]
+      >>
+
+  let () =
+    Syntax.Quotation.add "of_sexp" Syntax.Quotation.DynAst.expr_tag
+      of_sexp_quote
+
+ let sexp_of_quote loc _loc_name_opt cnt_str =
+   Pa_type_conv.set_conv_path_if_not_set loc;
+   let ctyp = Gram.parse_string Syntax.ctyp_quot loc cnt_str in
+   Generate_sexp_of.mk_cnv_expr ctyp
+
+  let () =
+    Syntax.Quotation.add "sexp_of" Syntax.Quotation.DynAst.expr_tag
+      sexp_of_quote
+end
+
+(* Add "of_sexp" and "sexp_of" as "sexp" to the set of generators *)
+let () =
+  Pa_type_conv.add_generator
+    "sexp"
+    (fun tds ->
+      let loc = Ast.loc_of_ctyp tds in
+      <:str_item@loc<
+        $Generate_of_sexp.of_sexp tds$; $Generate_sexp_of.sexp_of tds$
+      >>
+    )
diff --git a/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mli b/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mli
new file mode 100644 (file)
index 0000000..b669f70
--- /dev/null
@@ -0,0 +1,33 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This file is derived from file "pa_tywith.ml" of version 0.45 of the       *
+ * library "Tywith".                                                          *
+ *                                                                            *
+ * Tywith is Copyright (C) 2004, 2005 by                                      *
+ *                                                                            *
+ *    Martin Sandin  <msandin@hotmail.com>                                    *
+ *                                                                            *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+(** Pa_sexp_conv: Preprocessing Module for Automated S-expression Conversions *)
diff --git a/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mllib b/bundles/sexplib/sexplib-7.0.5/syntax/pa_sexp_conv.mllib
new file mode 100644 (file)
index 0000000..91fac15
--- /dev/null
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: 5969c59e3896ac685b501cdfd34e8ea3)
+Pa_sexp_conv
+# OASIS_STOP
diff --git a/bundles/sexplib/sexplib-7.0.5/top/install_printers.ml b/bundles/sexplib/sexplib-7.0.5/top/install_printers.ml
new file mode 100644 (file)
index 0000000..3a00be9
--- /dev/null
@@ -0,0 +1,41 @@
+(******************************************************************************
+ *                             Sexplib                                        *
+ *                                                                            *
+ * Copyright (C) 2005- Jane Street Holding, LLC                               *
+ *    Contact: opensource@janestreet.com                                      *
+ *    WWW: http://www.janestreet.com/ocaml                                    *
+ *    Author: Markus Mottl                                                    *
+ *                                                                            *
+ * This library is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU Lesser General Public                 *
+ * License as published by the Free Software Foundation; either               *
+ * version 2 of the License, or (at your option) any later version.           *
+ *                                                                            *
+ * This library is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this library; if not, write to the Free Software        *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
+ *                                                                            *
+ ******************************************************************************)
+
+let printers = [ "Sexplib.Sexp.pp_hum" ]
+
+let eval_string
+      ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str =
+  let lexbuf = Lexing.from_string str in
+  let phrase = !Toploop.parse_toplevel_phrase lexbuf in
+  Toploop.execute_phrase print_outcome err_formatter phrase
+
+let rec install_printers = function
+  | [] -> true
+  | printer :: printers ->
+      let cmd = Printf.sprintf "#install_printer %s;;" printer in
+      eval_string cmd && install_printers printers
+
+let () =
+  if not (install_printers printers) then
+    Format.eprintf "Problem installing Sexplib-printers@."
diff --git a/bundles/sexplib/sexplib-7.0.5/top/sexplib_top.mllib b/bundles/sexplib/sexplib-7.0.5/top/sexplib_top.mllib
new file mode 100644 (file)
index 0000000..e5dd683
--- /dev/null
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: c726c3185ff615847530490542668c8b)
+Install_printers
+# OASIS_STOP
index be84db4..691ac4b 100644 (file)
@@ -94,6 +94,7 @@
 - Slightly more efficient handling of lists.
 - Slightly better error message in the case of inconsistent paths
 - Improve limited size caching
+- Remove #ifdefs when everything else is removed
 
 ** Bugfix:
 - Corrected parsing of script strings delimited by a single quote.  Thanks
 - Allow matching on nameless structs.  Thanks to Ron Minnich for reporting
   the problem.
 - Pretty printing of const/volatile arrays in smpl code.
+- Don't allow just dropping an exp or type
+- Avoid removing #endif when surrounded by - code
 
 * 0.2.5
 ** Language:
index f469888..9929076 100644 (file)
--- a/cocci.ml
+++ b/cocci.ml
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./cocci.ml"
 open Common
 
 module CCI = Ctlcocci_integration
index 2a06dc6..c736745 100644 (file)
--- a/cocci.mli
+++ b/cocci.mli
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./cocci.mli"
 open Common
 
 (* full_engine takes (coccifile, isofile) and cfiles in parameters and
index 7ae56b0..f4654f8 100644 (file)
@@ -3,12 +3,15 @@
 ##############################################################################
 
 # The main library
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET=commons
 
 # note: if you add a file (a .mli or .ml), dont forget to redo a 'make depend'
-MYSRC= common.ml common_extra.ml                \
+MYSRC= commands.ml                              \
+       common.ml common_extra.ml                \
        interfaces.ml objet.ml                   \
        ocollection.ml                           \
        seti.ml                                  \
@@ -75,14 +78,7 @@ MPISYSLIBS=mpi.cma
 
 #sexplib
 MYSEXPSRC=sexp_common.ml
-ifeq ("$(SEXPDIR)","ocamlsexp")
-SEXPDIRUSED=../$(SEXPDIR)
-else
-SEXPDIRUSED=$(SEXPDIR)
-endif # Use local ocamlsexp
-SEXPINCLUDES=-I $(SEXPDIRUSED)        \
-       -I ../ocamltarzan/lib-sexp    \
-       -I ../../ocamltarzan/lib-sexp
+SEXPINCLUDES=-I $(SEXPDIR)
 
 #binprot
 MYBINSRC=bin_common.ml
@@ -121,16 +117,10 @@ OPTBIN ?= #.opt
 OCAMLCFLAGS ?= -g -dtypes
 
 # The OCaml tools.
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLLEX = ocamllex$(OPTBIN)
-OCAMLYACC= ocamlyacc -v
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
-# if need C code
-OCAMLMKLIB=ocamlmklib
-CC=gcc
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 ##############################################################################
 # Top rules
@@ -148,13 +138,13 @@ opt: all.opt
 top: $(TARGET).top
 
 $(LIB): $(OBJS)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 $(OPTLIB): $(OPTOBJS)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 $(TARGET).top: $(OBJS)
-       $(OCAMLMKTOP) -o $@ $(SYSLIBS) $^
+       $(OCAMLMKTOP_CMD) -o $@ $(SYSLIBS) $^
 
 clean::
        rm -f $(TARGET).top
@@ -170,10 +160,10 @@ gdbm: commons_gdbm.cma
 gdbm.opt: commons_gdbm.cmxa
 
 commons_gdbm.cma: $(MYGDBMSRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_gdbm.cmxa: $(MYGDBMSRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 
 #-----------------------------------------------------------------------------
@@ -183,10 +173,10 @@ bdb.opt:
        $(MAKE) INCLUDESEXTRA="$(BDBINCLUDES)" commons_bdb.cmxa
 
 commons_bdb.cma: $(MYBDBSRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_bdb.cmxa: $(MYBDBSRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 
 
@@ -197,10 +187,10 @@ gui.opt:
        $(MAKE) INCLUDESEXTRA="$(GUIINCLUDES)" commons_gui.cmxa
 
 commons_gui.cma: $(MYGUISRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_gui.cmxa: $(MYGUISRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 
 
@@ -211,10 +201,10 @@ mpi.opt:
        $(MAKE) INCLUDESEXTRA="$(MPIINCLUDES)" commons_mpi.cmxa
 
 commons_mpi.cma: $(MYMPISRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_mpi.cmxa: $(MYMPISRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 #alias
 distribution: mpi
@@ -230,10 +220,10 @@ python.opt:
 
 
 commons_python.cma: $(MYPYSRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_python.cmxa: $(MYPYSRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 #-----------------------------------------------------------------------------
 backtrace: commons_backtrace.cma
@@ -254,16 +244,17 @@ clean::
 
 
 #-----------------------------------------------------------------------------
-sexp:
+.PHONEY: sexp.all sexp.opt
+sexp.all:
        $(MAKE) INCLUDESEXTRA="$(SEXPINCLUDES)" commons_sexp.cma
 sexp.opt:
        $(MAKE) INCLUDESEXTRA="$(SEXPINCLUDES)" commons_sexp.cmxa
 
 commons_sexp.cma: $(MYSEXPSRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_sexp.cmxa: $(MYSEXPSRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 binprot:
        $(MAKE) INCLUDESEXTRA="$(BININCLUDES)" commons_bin.cma
@@ -271,10 +262,10 @@ binprot.opt:
        $(MAKE) INCLUDESEXTRA="$(BININCLUDES)" commons_bin.cmxa
 
 commons_bin.cma: $(MYBINSRC:.ml=.cmo)
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_bin.cmxa: $(MYBINSRC:.ml=.cmx)
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 ##############################################################################
 # The global "features" lib wrapper
@@ -284,10 +275,10 @@ features: commons_features.cma
 features.opt: commons_features.cmxa
 
 commons_features.cma: features.cmo
-       $(OCAMLC) -a -o $@ $^
+       $(OCAMLC_CMD) -a -o $@ $^
 
 commons_features.cmxa: features.cmx
-       $(OCAMLOPT) -a -o $@ $^
+       $(OCAMLOPT_CMD) -a -o $@ $^
 
 
 ##############################################################################
@@ -321,11 +312,11 @@ dependencygraph2:
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC)  -c $<
+       $(OCAMLC_CMD)  -c $<
 .mli.cmi:
-       $(OCAMLC)  -c $<
+       $(OCAMLC_CMD)  -c $<
 .ml.cmx:
-       $(OCAMLOPT)  -c $<
+       $(OCAMLOPT_CMD)  -c $<
 
 clean::
        rm -f *.cm[iox] *.o *.a *.cma *.cmxa *.annot
@@ -336,12 +327,18 @@ clean::
         rm -f *.cm[iox] *.o *.a *.cma *.cmxa *.annot *~ .*~ ; \
         cd ..; ) \
        done
+       rm -f .depend
 
-depend:
-       $(OCAMLDEP) *.mli *.ml  > .depend
-       for i in $(SUBDIRS); do $(OCAMLDEP) $$i/*.ml $$i/*.mli >> .depend; done
+distclean: clean
+       rm -f commands.ml
 
-distclean::
-       rm -f .depend
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml  > .depend
+       for i in $(SUBDIRS); do $(OCAMLDEP_CMD) $$i/*.ml $$i/*.mli >> .depend; done
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
diff --git a/commons/commands.ml.in b/commons/commands.ml.in
new file mode 100644 (file)
index 0000000..925b508
--- /dev/null
@@ -0,0 +1,8 @@
+(* configured default commands *)
+
+let ocamlfind_cmd = "@RUNTIME_OCAMLFIND_CMD@"
+let ocamlc_cmd = "@RUNTIME_OCAMLC_CMD@"
+let ocamlopt_cmd = "@RUNTIME_OCAMLOPT_CMD@"
+let ocamldep_cmd = "@RUNTIME_OCAMLDEP_CMD@"
+let camlp4_cmd = "@RUNTIME_CAMLP4_CMD@"
+let camlp4o_cmd = "@RUNTIME_CAMLP4O_CMD@"
index 3ed8ba0..30fff0a 100644 (file)
@@ -1155,10 +1155,10 @@ let macro_expand s =
   let c = open_out "/tmp/ttttt.ml" in
   begin
     output_string c s; close_out c;
-    command2 ("ocamlc -c -pp 'camlp4o pa_extend.cmo q_MLast.cmo -impl' " ^
-             "-I +camlp4 -impl macro.ml4");
-    command2 "camlp4o ./macro.cmo pr_o.cmo /tmp/ttttt.ml";
-    command2 "rm -f /tmp/ttttt.ml";
+    command2 (Commands.ocamlc_cmd ^ " -c -pp '" ^ Commands.camlp4o_cmd ^" pa_extend.cmo q_MLast.cmo -impl' " ^
+             "-I +" ^ Commands.camlp4_cmd ^ " -impl macro.ml4");
+    command2 (Commands.camlp4o_cmd ^" ./macro.cmo pr_o.cmo /tmp/ttttt.ml");
+    Unix.unlink "/tmp/ttttt.ml";
   end
 
 (*
@@ -3581,6 +3581,11 @@ let timeout_function_opt timeoutvalopt f =
   | Some x -> timeout_function x f
 
 
+(* removes only if the file does not exists *)
+let remove_file path =
+  if Sys.file_exists path
+  then Sys.remove path
+  else ()
 
 (* creation of tmp files, a la gcc *)
 
@@ -3599,7 +3604,7 @@ let erase_temp_files () =
   if not !save_tmp_files then begin
     !_temp_files_created +> List.iter (fun s ->
       (* pr2 ("erasing: " ^ s); *)
-      command2 ("rm -f " ^ s)
+      remove_file s
     );
     _temp_files_created := []
   end
@@ -3608,7 +3613,7 @@ let erase_this_temp_file f =
   if not !save_tmp_files then begin
     _temp_files_created :=
       List.filter (function x -> not (x =$= f)) !_temp_files_created;
-    command2 ("rm -f " ^ f)
+    remove_file f
   end
 
 
index 8d56e01..b665162 100644 (file)
@@ -1145,6 +1145,7 @@ val timeout_function : int -> (unit -> 'a) -> 'a
 
 val timeout_function_opt : int option -> (unit -> 'a) -> 'a
 
+val remove_file : string -> unit
 
 (* creation of /tmp files, a la gcc
  * ex: new_temp_file "cocci" ".c" will give "/tmp/cocci-3252-434465.c"
dissimilarity index 93%
index 2e46817..1700302 100755 (executable)
--- a/configure
+++ b/configure
-#!/usr/bin/perl
-
-# Author: Yoann Padioleau
-
-######################################################################
-# Prelude
-######################################################################
-
-# Yes I know about autoconf ... and autoconf sux.
-
-# assume standard: diff
-# assume standard: perl
-
-#TODO check python 2.5 ?
-
-# need latex and hevea if want to compile the documentation
-
-#old: --with-menhir=/path/to/menhirLib or `ocamlfind query menhirLib`
-
-my $project =
-    "coccinelle";
-my $projectcmdline =
-    "spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c";
-
-######################################################################
-# Options
-######################################################################
-
-my $prefix="/usr/local";
-my $python=1;
-my $pcre=1;
-my $noocamlscripting=0;
-my $opt=".opt";
-my $tarzan=1;
-my $pydir="pycaml";
-my $menhirdir="menhirlib";
-my $sexpdir="ocamlsexp";
-my $python_cmd="python";
-
-# generic ocaml libraries (set entries to 0 to disable by default)
-# 0: disabled, 1: use global library, >1: use local library
-my %libs=
-  ( "pycaml"    => 1
-  , "menhirLib" => 1
-  , "sexplib"   => 1
-  , "pcre"      => 1
-  , "dynlink"   => 0
-  , "extlib"    => 0
-  );
-
-# add additional dependencies that some of these libraries may have
-# these will then be added automatically
-# (we don't really make use of this here)
-my %deps=
-  ( # "pycaml" => ["str"]    # example
-    # "sexplib" => ["unix", "bigarray", "num"]
-  );
-
-local $_ = join ' ', @ARGV;
-
-# Parse options
-/-h/ || /--help/ and die "usage: $0 [--prefix=path] [--without-FEATURE] [--no-opt]\n
-\t--without-python\tDisable scripting in Python
-\t--without-ocaml\t\tDisable scripting in Ocaml
-\t--without-pcre\t\tDisable regexp with PCRE
-\t--with-pyton=PATH\t\tSpecify path to python executable
-\t--no-opt\t\tDo not use the optimimized version of OCaml
-\t--opt\t\t\tUse the optimimized version of OCaml\n\n";
-/--prefix=([^ ]*)/ and $prefix = $1;
-/--without-pcre/ and $pcre = 0;
-/--without-python/ and $python = 0;
-/--without-ocaml/ and $noocamlscripting = 1;
-/--no-opt/ and $opt = "";
-/--opt/ and $opt = ".opt";
-/--with-python=([^ ]*)/ and $python_cmd = $1;
-
-# todo: also print these options as part of the help message...
-foreach my $lib (keys %libs) {
-  /--with-$lib/ and $libs{$lib} = 1;
-  /--with-local-$lib/ and $libs{$lib} = 2;
-  /--without-$lib/ and $libs{$lib} = 0;
-}
-
-#tarzan by default (used by score file parsing and now also for sexp_ast_c.ml)
-
-
-# extend the feature set based on their dependencies
-my $changedLibs = 1;
-while($changedLibs) {
-  $changedLibs = 0;
-  foreach $dep (keys %deps) {
-    if ($libs{$dep}) {
-      my $reqs = $deps{$dep};
-      foreach $req (@$reqs) {
-        if (!$libs{$req}) {
-         $libs{$req}  = 1;
-         $changedLibs = 1;
-       }
-      }
-    }
-  }
-}
-
-if (!$python) {
-  $libs{'pycaml'} = 0;
-}
-
-#if($ARGV[0] =~ "--prefix=(.*)") {
-#    $prefix = $1;
-#}
-#if($ARGV[1] =~ "--without-python") {
-#    $python = 0;
-#}
-
-my $src="$prefix/share/$project";
-
-######################################################################
-# Side effects
-######################################################################
-
-
-######################################################################
-# Helpers
-######################################################################
-#BEGIN { die "need Perl 5 or greater" if $] < 5 ; }
-
-#use Common;
-sub pr2 { print STDERR "@_\n" }
-sub cat {
-    my ($what) = @_;
-    my @list;
-    open(TMP, $what);
-    while(<TMP>) { push @list, "$_"; }
-    \@list;
-}
-sub notb   { !$_[0] }
-sub mapf   { my ($f, $xs) = @_; [ map { &$f($_) } @{$xs} ] }
-sub plural { my ($e) = @_; if ($e > 1) { "s" } else { "" } }
-
-sub check_config { my ($command, $expect, $msggood, $msgbad) = @_;
-    my $error = 0;
-
-    my $full = cat($command);
-    my $res = join(" ", @{$full});
-#             pr2 $res;
-    if(notb($res =~ $expect)) { $error++; pr2 "!!!! $msgbad !!!!"; }
-    else { pr2 $msggood }
-    return $error;
-}
-
-######################################################################
-# Let's go
-######################################################################
-pr2 "Checking your configuration.\n";
-
-my $error = 0;
-
-#---------------------------------------------------------------------
-# Compilers and runtimes
-#---------------------------------------------------------------------
-
-$error +=
-    check_config("echo \"1;;\\n\" | ocaml |",
-                 "Objective(.*) 3.\(09|1[0-9]\)",
-                 "OCaml (the wonderful language) is present.",
-                 "The program ocaml is missing or is not a good version. We need at least 3.09",
-                 );
-
-unless ($noocamlscripting) {
-$noocamlscripting = check_config("echo \"1;;\\n\" | ocaml |",
-                 "Objective(.*) 3.1[1-9]",
-                 "OCaml >= 3.11 is present. OCaml scripting activated.",
-                 "OCaml scripting disabled. We need at least OCaml 3.11",
-                 );
-}
-my $ocamlprefix = $noocamlscripting ? "no" : "yes";
-
-if ($opt eq ".opt") {
-   my $opt_check1 = `ocamlc.opt -version 2>/dev/null`;
-   if($opt_check1 =~ /[0-9\.]+/) {
-       pr2 "ocamlc.opt is present.";
-   }
-   else {
-       $opt="";
-       pr2 "ocamlc.opt not found";
-   }
-
-   my $opt_check2 = `ocamlopt.opt -version 2>/dev/null`;
-   if($opt_check2 =~ /[0-9\.]+/) {
-       pr2 "ocamlopt.opt is present.";
-   }
-   else {
-       $opt="";
-       pr2 "ocamlopt.opt not found";
-   }
-
-   my $opt_check3 = `ocamldep.opt -version 2>/dev/null`;
-   if($opt_check3 =~ /[0-9\.]+/) {
-       pr2 "ocamldep.opt is present.";
-   }
-   else {
-       $opt="";
-       pr2 "ocamldep.opt not found";
-   }
-
-   my $opt_check4 = `ocamllex.opt -version 2>/dev/null`;
-   if($opt_check4 =~ /[0-9\.]+/) {
-       pr2 "ocamllex.opt is present.";
-   }
-   else {
-       $opt="";
-       pr2 "ocamllex.opt not found";
-   }
-
-   if($opt eq "") {
-       pr2 "At least one native OCaml tool have not been found.";
-       pr2 "Desactivation of all native OCaml tools for compilation.";
-   }
-}
-
-#we have cached the result of menhir in the tgz we build.
-
-#$error +=
-#    check_config("menhir --version |",
-#                 "menhir, version 20071212",
-##                 "menhir, version 2006.*",
-#                 "Menhir (the parser generator) is present.",
-#                 "The program menhir is missing or is not a good version.",
-#                 );
-
-
-#---------------------------------------------------------------
-# Developers tools
-#---------------------------------------------------------------
-
-pr2 "";
-
-$error += check_config(
-  "make -v 2>&1 |grep Make|",
-  "GNU Make [^0-9]*3\.[0-9]+.*", #version 3.79.1, 3.81
-  "make (gnu version) is present.",
-  "The program gnu make is missing or is not a good version.
-We need  3.XX",
-);
-
-#---------------------------------------------------------------------
-# More developers tools
-#---------------------------------------------------------------------
-
-#---------------------------------------------------------------------
-# Librairies
-#---------------------------------------------------------------------
-
-# Python dev
-my $PY_VERSION;
-if($python) {
-    if(check_config(
-       "$python_cmd --version 2>&1 |",
-       '^Python [23]\.',
-       "$python_cmd is present",
-       "$python_cmd is missing or is not a good version."
-       ))
-    {
-       $python=0;
-    }
-    if($python) {
-       my $PY_PREFIX = `$python_cmd pycaml/getprefix.py | tr -d '\n'`;
-       $PY_VERSION = `$python_cmd pycaml/getversion.py | tr -d '\n'`;
-       my $python_hdr = "$PY_PREFIX/include/python$PY_VERSION/Python.h";
-       if(check_config(
-           "ls $python_hdr 2> /dev/null | ",
-           $python_hdr,
-           "Python.h found",
-           "Python.h missing - You need to install python-dev"
-           ))
-       {
-           $python=0
-       }
-    }
-}
-
-my $ocamlfind=!check_config(
-       "ocamlfind ocamlc -version 2> /dev/null | ",
-       '^[0-9\.]+',
-       "ocamlfind is present",
-       "ocamlfind is missing -- Switch to local library copies."
-    );
-
-# pycaml. Binding between Python and OCaml
-my $syspydir=`ocamlfind query pycaml 2> /dev/null | xargs echo -n`;
-
-if($syspydir) {
-    pr2 "'pycaml' library is present in $syspydir";
-    if ($libs{'pycaml'} > 1) {
-        pr2 "... but a local copy of 'pycaml' will be used.";
-    }
-    else {
-        $pydir=$syspydir;
-    }
-} else {
-    pr2 "'pycaml' library is not present. A local copy will be used.";
-}
-
-# menhirLib. Runtime system for the parsers generated with menhir
-my $sysmenhirdir=`ocamlfind query menhirLib 2> /dev/null | xargs echo -n`;
-
-if($sysmenhirdir) {
-    $menhirdir=$sysmenhirdir;
-    pr2 "'menhirLib' library is present in $menhirdir";
-} else {
-    pr2 "'menhirLib' library is not present. A local copy will be used.";
-}
-
-# sexplib.
-my $syssexpdir=`ocamlfind query sexplib 2> /dev/null | xargs echo -n`;
-
-if($syssexpdir) {
-    $sexpdir=$syssexpdir;
-    pr2 "'sexplib' library is present in $sexpdir";
-} else {
-    pr2 "'sexplib' library is not present. A local copy will be used.";
-}
-
-# Check if libpcre-ocaml is available
-# when pcre feature is enabled.
-my $pcredir="";
-if($pcre) {
-    $pcredir=`ocamlfind query pcre 2> /dev/null | xargs echo -n `;
-    if(check_config(
-          "echo -n $pcredir | ",
-          '^/.*$',
-          "'pcre-ocaml' library is present in $pcredir",
-          "'pcre-ocaml' library is not present - You need to install libpcre-ocaml-dev"
-       ))
-    {
-       $pcre=0
-    }
-}
-
-######################################################################
-# Printing of library selection
-######################################################################
-
-
-pr2 "----------------------------------------------------------------------";
-pr2 "Library configuration:";
-
-my %libPaths;
-foreach my $lib (keys %libs) {
-  my $isSelected = $libs{$lib};
-  if ($isSelected) {
-    my $libdir = `ocamlfind query $lib 2> /dev/null | xargs echo -n`;
-    if ($libdir && $libs{$lib} <= 1) {
-      $libs{$lib} = 1;
-      $libPaths{$lib} = $libdir;
-    }
-    else {
-      if (-d $lib) {      # test if local directory exists
-        $libs{$lib} = 2;  # use local version
-       $libPaths{$lib} = $lib;
-      } else {
-        $libs{$lib} = 0;  # disable the feature
-       $libPaths{$lib} = "";
-      }
-    }
-  }
-
-  my $choice = $libs{$lib};
-  if ($choice == 0) {
-    pr2 "$lib: disabled";
-  } elsif ($choice == 1) {
-    pr2 "$lib: global version in $libPaths{$lib}";
-  } else {
-    pr2 "$lib: local version selected";
-  }
-}
-
-######################################################################
-# Generate config files (platform/portability issues)
-######################################################################
-
-
-######################################################################
-# Generate globals files (features issues)
-######################################################################
-
-######################################################################
-# Diagnostic
-######################################################################
-
-if($error) {
-    pr2 "
-----------------------------------------------------------------------
-!!!! There seems to have problem, we have found $error missing package" .
-plural($error) . ".
-" . (($error > 1) ? "Some of those packages" : "This package") .
-    " may be installed by picking " . ($error > 1 ? "them" : "it") .
-    " in $project-dependencies.tgz available
-on the $project website. !!!!
-----------------------------------------------------------------------
-";
-} else {
-
-    pr2
-"----------------------------------------------------------------------
-
-All seems fine for $project.
-
-To compile $project type:
-  \$ make depend
-  \$ make all
-
-Or alternatively, for the optimized version:
-  \$ make all.opt
-If you want both, you could use:
-  \$ make world
-
-
-To install type:
-  \$ make install
-
-Then, to test $project simply type:
-  \$ $projectcmdline
-
-";
-
-    if($python) {
-       pr2
-"To use the python SmPL feature you may have to set some environment variables.
-However, they are automatically set by the front-end installed in $prefix/bin.
-For bash do:
-export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$prefix/lib
-export PYTHONPATH=\$PYTHONPATH:$src/python"
-    }
-
-    pr2 "----------------------------------------------------------------------";
-}
-
-######################################################################
-# Generating the configuration
-######################################################################
-
-pr2 "  Compilation configuration\n";
-
-pr2 "$project target prefix: $prefix (you can use --prefix to override it)";
-pr2 "Generating Makefile.config";
-open(CONFIG, ">Makefile.config");
-print CONFIG "# autogenerated by configure
-
-#
-INSTALL_PROGRAM?=install -c -m 755
-INSTALL_LIB?=    install -c -m 755
-INSTALL_DATA?=   install -c -m 644
-
-# Where to install the binary
-BINDIR=$prefix/bin
-
-# Where to install the man pages
-MANDIR=$prefix/man
-
-# Where to install the lib
-LIBDIR=$prefix/lib
-
-# Where to install the configuration files
-SHAREDIR=$src
-
-BASH_COMPLETION_DIR=/etc/bash_completion.d
-
-# Features
-FEATURE_PYTHON=$python
-FEATURE_TARZAN=$tarzan
-";
-
-if ($python) {
-print CONFIG "PYVER=$PY_VERSION\n";
-print CONFIG "PYCMD=$python_cmd\n";
-}
-
-if($pcre) {
-print CONFIG "
-PCREDIR=$pcredir"
-}
-
-print CONFIG "
-PYCAMLDIR=$pydir
-MENHIRDIR=$menhirdir
-SEXPDIR=$sexpdir
-DYNLINK=$ocamlprefix
-
-# The OPTBIN variable is here to allow to use ocamlc.opt instead of
-# ocaml, when it is available, which speeds up compilation. So
-# if you want the fast version of the ocaml chain tools, set this var
-# or setenv it to \".opt\" in your startup script.
-OPTBIN=$opt
-";
-
-#
-# Generate variables for handling the ocaml libraries
-#
-
-my @sellibs     = ();
-my @makelibs    = ();
-my @cleanlibs   = ();
-my @deplibs     = ();
-my @lnklibs     = ();
-my @optlnklibs  = ();
-my @inclibs     = ();
-my @flagslibs   = ();
-my @featurelibs = ();
-my @pathlibs    = ();
-
-sub strVar {
-  return "\$(" . $_[0] . "_" . $_[1] . ")";
-}
-
-foreach $lib (keys %libs) {
-  my $sel     = $libs{$lib};
-  my $path    = $libPaths{$lib};
-  my $pathvar = strVar("PATH", $lib);
-
-  if ($sel == 1) {              # global version
-    push(@lnklibs,    strVar("GLOBAL", $lib));
-    push(@optlnklibs, strVar("GLOBALOPT", $lib));
-  } elsif ($sel > 1) {         # local version
-    push(@lnklibs,    strVar("LOCAL", $lib));
-    push(@optlnklibs, strVar("LOCALOPT", $lib));
-    if (-e "$path/Makefile") {  # does it have a Makefile?
-      push(@makelibs,  $pathvar);
-      push(@cleanlibs, $pathvar);
-      push(@deplibs,   $pathvar);
-    }
-  }
-
-  if ($sel >= 1) {  # indifferent of global/local
-    push(@sellibs,     $lib);
-    push(@inclibs,     $pathvar);
-    push(@flagslibs,   strVar("FLAGS", $lib));
-    
-    push(@featurelibs, "FEATURE_$lib=1");
-    push(@pathlibs,    "PATH_$lib=$path");
-  }
-}
-
-my $strSellibs    = join(" ", @sellibs);
-my $strMakelibs   = join(" ", @makelibs);
-my $strCleanlibs  = join(" ", @cleanlibs);
-my $strDeplibs    = join(" ", @deplibs);
-my $strLnklibs    = join(" ", @lnklibs);
-my $strOptlnklibs = join(" ", @optlnklibs);
-my $strInclibs    = join(" ", @inclibs);
-my $strFlagslibs  = join(" ", @flagslibs);
-my $strFeatures   = join("\n", @featurelibs);
-my $strPaths      = join("\n", @pathlibs);
-
-print CONFIG "
-# selected libraries
-$strFeatures
-
-# library paths
-$strPaths
-
-# collected config vars
-SELLIBS=$strSellibs
-MAKELIBS=$strMakelibs
-CLEANLIBS=$strCleanlibs
-DEPLIBS=$strDeplibs
-LNKLIBS=$strLnklibs
-OPTLNKLIBS=$strOptlnklibs
-INCLIBS=$strInclibs
-FLAGSLIBS=$strFlagslibs
-
-# selected ocaml modules
-";
-
-sub repl {
-    my $src = $_[0];
-    my $dest = $_[1];
-    my $key = $_[2];
-    my $val = ucfirst($_[3]);
-    my $cmd = "sed -e 's|${key}|${val}|g' ${src} > ${dest}";
-    if (-e $dest) {
-       unlink($dest);
-    }
-    `$cmd`;
-}
-
-my $pythonprefix = $python ? "yes" : "no";
-pr2 "Support for python scripting: $pythonprefix";
-repl('python/pycocci.ml.in', 'python/pycocci.ml', '@PYCOCCI_FILE@', "${pythonprefix}_pycocci");
-print CONFIG "PYCOCCI_FILE=${pythonprefix}_pycocci.ml\n";
-# `cd python; ln -sf ${pythonprefix}_pycocci.ml pycocci.ml; `;
-`cd python; make depend`;
-
-pr2 "Support for ocaml scripting: $ocamlprefix";
-repl('ocaml/prepare_ocamlcocci.ml.in', 'ocaml/prepare_ocamlcocci.ml', '@OCAMLCOCCI_FILE@', "${ocamlprefix}_prepare_ocamlcocci");
-print CONFIG "OCAMLCOCCI_FILE=${ocamlprefix}_prepare_ocamlcocci.ml\n";
-# `cd ocaml; ln -sf ${ocamlprefix}_prepare_ocamlcocci.ml prepare_ocamlcocci.ml;`;
-`cd ocaml; make depend`;
-
-my $pcresuffix = $pcre ? "pcre" : "str";
-pr2 "Support for regexp: $pcresuffix";
-repl('globals/regexp.ml.in', 'globals/regexp.ml', '@REGEXP_FILE@', "Regexp_${pcresuffix}");
-print CONFIG "REGEXP_FILE=regexp_${pcresuffix}.ml";
-# `cd globals; ln -sf regexp_${pcresuffix}.ml regexp.ml; touch regexp.ml;`;
-`cd globals; make depend`;
-
-pr2 "Modifying globals/config.ml";
-my $version = `cat ./version | tr -d '\n'`;
-`echo -n "$version" > ./version`; # make sure that there are no newlines after version
-my $command1 = "sed -i -e 's|^let version = \".*\"\$|let version = \"$version\"|g' globals/config.ml.in"; # substitute version
-my $command2 = "perl -p -e 's#Not_found.\*#Not_found->\\\"$src\\\"#' globals/config.ml.in > globals/config.ml";
-`$command1`;
-`$command2`;
-
-pr2 "----------------------------------------------------------------------";
-pr2 "  Runtime dependency\n";
-
-if ($ocamlfind) {
-pr2 "Support for external ocaml library in ocaml scripting: yes (ocamlfind found)";
-}
-else {
-pr2 "Support for external ocaml library in ocaml scripting: no";
-pr2 "!!!!!!! WARNING !!!!!!! ocamlfind may be required at runtime";
-}
-
-pr2 "";
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for coccinelle `cat ./version`.
+#
+# Report bugs to <cocci@diku.dk>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and cocci@diku.dk
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+as_awk_strverscmp='
+  # Use only awk features that work with 7th edition Unix awk (1978).
+  # My, what an old awk you have, Mr. Solaris!
+  END {
+    while (length(v1) && length(v2)) {
+      # Set d1 to be the next thing to compare from v1, and likewise for d2.
+      # Normally this is a single character, but if v1 and v2 contain digits,
+      # compare them as integers and fractions as strverscmp does.
+      if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) {
+       # Split v1 and v2 into their leading digit string components d1 and d2,
+       # and advance v1 and v2 past the leading digit strings.
+       for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue
+       for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue
+       d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1)
+       d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1)
+       if (d1 ~ /^0/) {
+         if (d2 ~ /^0/) {
+           # Compare two fractions.
+           while (d1 ~ /^0/ && d2 ~ /^0/) {
+             d1 = substr(d1, 2); len1--
+             d2 = substr(d2, 2); len2--
+           }
+           if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) {
+             # The two components differ in length, and the common prefix
+             # contains only leading zeros.  Consider the longer to be less.
+             d1 = -len1
+             d2 = -len2
+           } else {
+             # Otherwise, compare as strings.
+             d1 = "x" d1
+             d2 = "x" d2
+           }
+         } else {
+           # A fraction is less than an integer.
+           exit 1
+         }
+       } else {
+         if (d2 ~ /^0/) {
+           # An integer is greater than a fraction.
+           exit 2
+         } else {
+           # Compare two integers.
+           d1 += 0
+           d2 += 0
+         }
+       }
+      } else {
+       # The normal case, without worrying about digits.
+       d1 = substr(v1, 1, 1); v1 = substr(v1, 2)
+       d2 = substr(v2, 1, 1); v2 = substr(v2, 2)
+      }
+      if (d1 < d2) exit 1
+      if (d1 > d2) exit 2
+    }
+    # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10),
+    # which mishandles some comparisons of empty strings to integers.
+    if (length(v2)) exit 1
+    if (length(v1)) exit 2
+  }
+'
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='coccinelle'
+PACKAGE_TARNAME='coccinelle'
+PACKAGE_VERSION='`cat ./version`'
+PACKAGE_STRING='coccinelle `cat ./version`'
+PACKAGE_BUGREPORT='cocci@diku.dk'
+PACKAGE_URL='http://coccinelle.lip6.fr/'
+
+ac_unique_file="cocci.ml"
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+MAKETARGET_ALL
+enable_release
+SUBSTITUTED_PDFLATEX
+with_PDFLATEX
+PDFLATEX
+DYNLINK_IS_NATIVE
+FEATURE_OCAML
+FEATURE_PYTHON
+SHAREDIR
+REGEXP_FILE
+REGEXP_MODULE
+MAKE_pcre
+enable_pcre
+GLOBAL_pcre
+OCAML_PKG_pcre
+enable_pcre_syntax
+HAVE_PCRE
+PCRE_LIBS
+PCRE_CFLAGS
+PYCOCCI_FILE
+PYCOCCI_MODULE
+MAKE_pycaml
+GLOBAL_pycaml
+OCAML_PKG_pycaml
+enable_python
+HAVE_PYTHON
+PYTHON_LIBS
+PYTHON_CFLAGS
+SUBSTITUTED_PYTHON
+with_PYTHON
+enable_pycaml
+PYTHON
+OCAMLCOCCI_FILE
+OCAMLCOCCI_MODULE
+enable_ocaml
+SUBSTITUTED_MENHIR
+with_MENHIR
+MENHIR
+MAKE_extlib
+enable_extlib
+GLOBAL_extlib
+OCAML_PKG_extlib
+MAKE_menhirLib
+enable_menhirLib
+GLOBAL_menhirLib
+OCAML_PKG_menhirLib
+MAKE_sexplib
+enable_sexplib
+GLOBAL_sexplib
+OCAML_PKG_sexplib
+MAKE_camlp4
+enable_camlp4
+GLOBAL_camlp4
+OCAML_PKG_camlp4
+MAKE_dynlink
+enable_dynlink
+GLOBAL_dynlink
+OCAML_PKG_dynlink
+PATH_threads
+OCAML_PKG_threads
+PATH_str
+OCAML_PKG_str
+PATH_num
+OCAML_PKG_num
+PATH_bigarray
+OCAML_PKG_bigarray
+PATH_unix
+OCAML_PKG_unix
+PATH_camlp4
+MODULESOPT_camlp4
+MODULES_camlp4
+FLAGS_camlp4
+LOCALLIB_camlp4
+FEATURE_camlp4
+PATH_pycaml
+MODULESOPT_pycaml
+MODULES_pycaml
+FLAGS_pycaml
+LOCALLIB_pycaml
+FEATURE_pycaml
+PATH_pcre
+MODULESOPT_pcre
+MODULES_pcre
+FLAGS_pcre
+LOCALLIB_pcre
+FEATURE_pcre
+PATH_dynlink
+MODULESOPT_dynlink
+MODULES_dynlink
+FLAGS_dynlink
+LOCALLIB_dynlink
+FEATURE_dynlink
+PATH_extlib
+MODULESOPT_extlib
+MODULES_extlib
+FLAGS_extlib
+LOCALLIB_extlib
+FEATURE_extlib
+PATH_menhirLib
+MODULESOPT_menhirLib
+MODULES_menhirLib
+FLAGS_menhirLib
+LOCALLIB_menhirLib
+FEATURE_menhirLib
+PATH_sexplib
+MODULESOPT_sexplib
+MODULES_sexplib
+FLAGS_sexplib
+LOCALLIB_sexplib
+FEATURE_sexplib
+COCCI_OCAML_EXTERNAL
+RUNTIME_CAMLP4O_CMD
+RUNTIME_CAMLP4_CMD
+RUNTIME_OCAMLDEP_CMD
+RUNTIME_OCAMLOPT_CMD
+RUNTIME_OCAMLC_CMD
+RUNTIME_OCAMLFIND_CMD
+SUBSTITUTED_OCAMLFIND
+with_OCAMLFIND
+OCAMLFIND
+SUBSTITUTED_OCAMLYACC
+with_OCAMLYACC
+SUBSTITUTED_OCAMLLEX
+with_OCAMLLEX
+CAMLP4RF
+CAMLP4R
+CAMLP4PROF
+CAMLP4ORF
+CAMLP4OOF
+CAMLP4OF
+CAMLP4O
+CAMLP4BOOT
+CAMLP4
+OCAMLATLEAST311
+OCAMLATLEAST310
+OCAMLBUILD
+OCAMLDOC
+OCAMLMKLIB
+OCAMLMKTOP
+OCAMLDEP
+OCAML
+OCAMLOPTDOTOPT
+OCAMLCDOTOPT
+OCAMLBEST
+OCAMLOPT
+OCAMLLIB
+OCAMLVERSION
+OCAMLC
+SUBSTITUTED_PKG_CONFIG
+OCAMLYACC
+OCAMLLEXDOTOPT
+OCAMLLEX
+with_PKG_CONFIG
+PKG_CONFIG
+PATCH
+TAR
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MKDIR_P
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+DATE
+GIT
+CONFVERSION
+COCCI_SRCDIR
+COCCI_VERSION
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+PYVER'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_pkg_config
+with_ocamllex
+with_ocamlyacc
+with_ocamlfind
+with_runtime_ocamlfind
+with_runtime_ocamlc
+with_runtime_ocamlopt
+with_runtime_ocamldep
+with_runtime_camlp4
+with_runtime_camlp4o
+enable_dynlink
+enable_camlp4
+enable_sexplib
+enable_menhirLib
+enable_extlib
+with_menhir
+enable_ocaml
+enable_python
+with_python
+enable_pycaml
+enable_pcre_syntax
+enable_pcre
+with_pdflatex
+enable_release
+'
+      ac_precious_vars='PYVER
+build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+OCAMLLEX
+OCAMLYACC
+OCAMLFIND
+RUNTIME_OCAMLFIND_CMD
+RUNTIME_OCAMLC_CMD
+RUNTIME_OCAMLOPT_CMD
+RUNTIME_OCAMLDEP_CMD
+RUNTIME_CAMLP4_CMD
+RUNTIME_CAMLP4O_CMD
+COCCI_OCAML_EXTERNAL
+MENHIR
+PYTHON
+PYTHON_CFLAGS
+PYTHON_LIBS
+PCRE_CFLAGS
+PCRE_LIBS
+PDFLATEX'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures coccinelle `cat ./version` to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/coccinelle]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of coccinelle `cat ./version`:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-dynlink        enable global package dynlink (yes,no) (default:
+                          auto)
+  --enable-camlp4         enable global package camlp4 (yes,no) (default:
+                          auto)
+  --enable-sexplib        enable global package sexplib (yes,no) (default:
+                          auto)
+  --enable-menhirLib      enable global package menhirLib (yes,no) (default:
+                          auto)
+  --enable-extlib         enable global package extlib (yes,no) (default:
+                          auto)
+  --enable-ocaml          enable ocaml scripting (default: auto)
+  --enable-python         enable python scripting (yes/no) (default: auto)
+  --enable-pycaml         enable global package pycaml (yes,no) (default:
+                          auto)
+  --enable-pcre-syntax    enable pcre regular expression syntax (default:
+                          auto)
+  --enable-pcre           enable global package pcre (yes,no) (default: auto)
+  --enable-release        build with a release configuration (yes,no, default:
+                          no)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pkg-config       whether/which pkg-config to use (default: auto)
+  --with-ocamllex         whether/which ocamllex to use (default: auto)
+  --with-ocamlyacc        whether/which ocamlyacc to use (default: auto)
+  --with-ocamlfind        whether/which ocamlfind to use (default: auto)
+  --with-runtime-ocamlfind
+                          override the runtime cmd for ocamlfind
+  --with-runtime-ocamlc   override the runtime cmd for ocamlc
+  --with-runtime-ocamlopt override the runtime cmd for ocamlopt
+  --with-runtime-ocamldep override the runtime cmd for ocamldep
+  --with-runtime-camlp4   override the runtime cmd for camlp4
+  --with-runtime-camlp4o  override the runtime cmd for camlp4o
+  --with-menhir           whether/which menhir to use (default: auto)
+  --with-python           whether/which python to use (default: auto)
+  --with-pdflatex         whether/which pdflatex to use (default: auto)
+
+Some influential environment variables:
+  PYVER       python version
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config
+  OCAMLLEX    path to ocamllex
+  OCAMLYACC   path to ocamlyacc
+  OCAMLFIND   path to ocamlfind
+  RUNTIME_OCAMLFIND_CMD
+              path to ocamlfind
+  RUNTIME_OCAMLC_CMD
+              path to ocamlc
+  RUNTIME_OCAMLOPT_CMD
+              path to ocamlopt
+  RUNTIME_OCAMLDEP_CMD
+              path to ocamldep
+  RUNTIME_CAMLP4_CMD
+              path to camlp4
+  RUNTIME_CAMLP4O_CMD
+              path to camlp4o
+  COCCI_OCAML_EXTERNAL
+              path to extra ocaml packages (default: $COCCI_SRCDIR/bundles)
+  MENHIR      path to menhir
+  PYTHON      path to python when the version is determined automatically
+  PYTHON_CFLAGS
+              C compiler flags for PYTHON, overriding pkg-config
+  PYTHON_LIBS linker flags for PYTHON, overriding pkg-config
+  PCRE_CFLAGS C compiler flags for PCRE, overriding pkg-config
+  PCRE_LIBS   linker flags for PCRE, overriding pkg-config
+  PDFLATEX    path to pdflatex
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <cocci@diku.dk>.
+coccinelle home page: <http://coccinelle.lip6.fr/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+coccinelle configure `cat ./version`
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by coccinelle $as_me `cat ./version`, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+COCCI_VERSION=$(cat ./version)
+
+COCCI_SRCDIR=$(pwd)
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: configuring coccinelle $COCCI_VERSION in $COCCI_SRCDIR" >&5
+$as_echo "$as_me: configuring coccinelle $COCCI_VERSION in $COCCI_SRCDIR" >&6;}
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: determining version suffix" >&5
+$as_echo "$as_me: determining version suffix" >&6;}
+
+  if test -z "$CONFVERSION" -a -d "./.git"; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: building a version from a git repository" >&5
+$as_echo "$as_me: building a version from a git repository" >&6;}
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}git", so it can be a program name with args.
+set dummy ${ac_tool_prefix}git; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GIT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GIT="$GIT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GIT=$ac_cv_path_GIT
+if test -n "$GIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5
+$as_echo "$GIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_GIT"; then
+  ac_pt_GIT=$GIT
+  # Extract the first word of "git", so it can be a program name with args.
+set dummy git; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_GIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_GIT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_GIT="$ac_pt_GIT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_GIT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_GIT=$ac_cv_path_ac_pt_GIT
+if test -n "$ac_pt_GIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_GIT" >&5
+$as_echo "$ac_pt_GIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_GIT" = x; then
+    GIT=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    GIT=$ac_pt_GIT
+  fi
+else
+  GIT="$ac_cv_path_GIT"
+fi
+
+    if test -n "$GIT"; then :
+        CONFVERSION=`$GIT log -1 --date-order --date=rfc --pretty="format:%cd"`
+
+fi
+
+fi
+
+  if test -z "$CONFVERSION"; then :
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}date", so it can be a program name with args.
+set dummy ${ac_tool_prefix}date; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DATE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $DATE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DATE="$DATE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DATE=$ac_cv_path_DATE
+if test -n "$DATE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5
+$as_echo "$DATE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_DATE"; then
+  ac_pt_DATE=$DATE
+  # Extract the first word of "date", so it can be a program name with args.
+set dummy date; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_DATE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_DATE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_DATE="$ac_pt_DATE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_DATE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_DATE=$ac_cv_path_ac_pt_DATE
+if test -n "$ac_pt_DATE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DATE" >&5
+$as_echo "$ac_pt_DATE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_DATE" = x; then
+    DATE=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DATE=$ac_pt_DATE
+  fi
+else
+  DATE="$ac_cv_path_DATE"
+fi
+
+    if test -n "$DATE"; then :
+        CONFVERSION=`$DATE "+%a, %d %b %Y %H:%M:%S %z"`
+
+fi
+
+fi
+
+  if test -z "$CONFVERSION"; then :
+      CONFVERSION=unknown
+
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: version suffix set to $CONFVERSION" >&5
+$as_echo "$as_me: version suffix set to $CONFVERSION" >&6;}
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: this configure program uses pkg-config m4 macros" >&5
+$as_echo "$as_me: this configure program uses pkg-config m4 macros" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: this configure program uses ocaml m4 macros (see setup/ocaml.m4)" >&5
+$as_echo "$as_me: this configure program uses ocaml m4 macros (see setup/ocaml.m4)" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: this configure program uses custom m4 macros (see setup/cocci.m4)" >&5
+$as_echo "$as_me: this configure program uses custom m4 macros (see setup/cocci.m4)" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: some fake substitutions for required but unavailable programs may be used (see setup/fake*)" >&5
+$as_echo "$as_me: some fake substitutions for required but unavailable programs may be used (see setup/fake*)" >&6;}
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: verifying basic tools" >&5
+$as_echo "$as_me: verifying basic tools" >&6;}
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Extract the first word of "tar", so it can be a program name with args.
+set dummy tar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_TAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $TAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+TAR=$ac_cv_path_TAR
+if test -n "$TAR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
+$as_echo "$TAR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "patch", so it can be a program name with args.
+set dummy patch; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATCH+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PATCH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PATCH=$ac_cv_path_PATCH
+if test -n "$PATCH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5
+$as_echo "$PATCH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+# Check whether --with-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then :
+  withval=$with_pkg_config;
+fi
+
+  with_PKG_CONFIG="$with_pkg_config"
+
+
+    if test -n "$with_PKG_CONFIG" -a "x$with_PKG_CONFIG" != xno -a "x$with_PKG_CONFIG" != xyes; then :
+      PKG_CONFIG="$with_PKG_CONFIG"
+
+
+fi
+
+    if test "x$with_PKG_CONFIG" != xno; then :
+        if test "xpkg-config" = xpkg-config -a "xPKG_CONFIG" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpkg-config" = xocamllex -a "xPKG_CONFIG" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpkg-config" = xocamlyacc -a "xPKG_CONFIG" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$PKG_CONFIG" -o "x$PKG_CONFIG" = xno; then :
+      if test "x$with_PKG_CONFIG" = xyes; then :
+        as_fn_error $? "--with=pkg-config is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n "$COCCI_SRCDIR/setup/fake-subst.sh pkg-config"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config not found. Trying substitute $COCCI_SRCDIR/setup/fake-subst.sh pkg-config." >&5
+$as_echo "$as_me: pkg-config not found. Trying substitute $COCCI_SRCDIR/setup/fake-subst.sh pkg-config." >&6;}
+      PKG_CONFIG="$COCCI_SRCDIR/setup/fake-subst.sh pkg-config"
+
+        if test "xpkg-config" = xpkg-config -a "xPKG_CONFIG" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpkg-config" = xocamllex -a "xPKG_CONFIG" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpkg-config" = xocamlyacc -a "xPKG_CONFIG" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+
+fi
+
+      SUBSTITUTED_PKG_CONFIG=yes
+
+
+fi
+
+fi
+
+    if test -z "$PKG_CONFIG"; then :
+  PKG_CONFIG=no
+
+fi
+
+if test "x$PKG_CONFIG" = xno; then :
+    as_fn_error $? "A suitable pkg-config could not be found." "$LINENO" 5
+
+fi
+
+  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLC="$OCAMLC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLC=$ac_cv_path_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLC"; then
+  ac_pt_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLC="$ac_pt_OCAMLC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLC=$ac_cv_path_ac_pt_OCAMLC
+if test -n "$ac_pt_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLC" >&5
+$as_echo "$ac_pt_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_pt_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_path_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLOPT=$ac_cv_path_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLOPT"; then
+  ac_pt_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLOPT="$ac_pt_OCAMLOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLOPT=$ac_cv_path_ac_pt_OCAMLOPT
+if test -n "$ac_pt_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLOPT" >&5
+$as_echo "$ac_pt_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_pt_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_path_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+       TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+       if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+           OCAMLOPT=no
+       else
+           OCAMLBEST=opt
+       fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLCDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLCDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLCDOTOPT=$ac_cv_path_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLCDOTOPT"; then
+  ac_pt_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLCDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLCDOTOPT="$ac_pt_OCAMLCDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLCDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLCDOTOPT=$ac_cv_path_ac_pt_OCAMLCDOTOPT
+if test -n "$ac_pt_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLCDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_pt_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_path_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+       TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+       if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+       else
+           OCAMLC=$OCAMLCDOTOPT
+       fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLOPTDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLOPTDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLOPTDOTOPT=$ac_cv_path_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLOPTDOTOPT"; then
+  ac_pt_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLOPTDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLOPTDOTOPT="$ac_pt_OCAMLOPTDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLOPTDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLOPTDOTOPT=$ac_cv_path_ac_pt_OCAMLOPTDOTOPT
+if test -n "$ac_pt_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_pt_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_path_OCAMLOPTDOTOPT"
+fi
+
+       if test "$OCAMLOPTDOTOPT" != "no"; then
+          TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+          if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+          else
+             OCAMLOPT=$OCAMLOPTDOTOPT
+          fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAML in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAML="$OCAML" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAML="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAML=$ac_cv_path_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAML"; then
+  ac_pt_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAML in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAML="$ac_pt_OCAML" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAML="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAML=$ac_cv_path_ac_pt_OCAML
+if test -n "$ac_pt_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAML" >&5
+$as_echo "$ac_pt_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_pt_OCAML
+  fi
+else
+  OCAML="$ac_cv_path_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLDEP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLDEP="$OCAMLDEP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLDEP=$ac_cv_path_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLDEP"; then
+  ac_pt_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLDEP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLDEP="$ac_pt_OCAMLDEP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLDEP=$ac_cv_path_ac_pt_OCAMLDEP
+if test -n "$ac_pt_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLDEP" >&5
+$as_echo "$ac_pt_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_pt_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_path_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLMKTOP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLMKTOP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLMKTOP=$ac_cv_path_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLMKTOP"; then
+  ac_pt_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLMKTOP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLMKTOP="$ac_pt_OCAMLMKTOP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLMKTOP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLMKTOP=$ac_cv_path_ac_pt_OCAMLMKTOP
+if test -n "$ac_pt_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLMKTOP" >&5
+$as_echo "$ac_pt_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_pt_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_path_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLMKLIB in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLMKLIB="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLMKLIB=$ac_cv_path_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLMKLIB"; then
+  ac_pt_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLMKLIB in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLMKLIB="$ac_pt_OCAMLMKLIB" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLMKLIB="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLMKLIB=$ac_cv_path_ac_pt_OCAMLMKLIB
+if test -n "$ac_pt_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLMKLIB" >&5
+$as_echo "$ac_pt_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_pt_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_path_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLDOC="$OCAMLDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLDOC=$ac_cv_path_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLDOC"; then
+  ac_pt_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLDOC="$ac_pt_OCAMLDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLDOC=$ac_cv_path_ac_pt_OCAMLDOC
+if test -n "$ac_pt_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLDOC" >&5
+$as_echo "$ac_pt_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_pt_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_path_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLBUILD in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLBUILD="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLBUILD=$ac_cv_path_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLBUILD"; then
+  ac_pt_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLBUILD in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLBUILD="$ac_pt_OCAMLBUILD" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLBUILD="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLBUILD=$ac_cv_path_ac_pt_OCAMLBUILD
+if test -n "$ac_pt_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLBUILD" >&5
+$as_echo "$ac_pt_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_pt_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_path_OCAMLBUILD"
+fi
+
+
+  { versioncheck=; unset versioncheck;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking that the OCaml version is at least 3.10" >&5
+$as_echo_n "checking that the OCaml version is at least 3.10... " >&6; }
+  as_arg_v1=$OCAMLVERSION
+as_arg_v2=3.10
+awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null
+case $? in #(
+  1) :
+    versioncheck=no ;; #(
+  0) :
+    versioncheck=yes ;; #(
+  2) :
+    versioncheck=yes ;; #(
+  *) :
+     ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $versioncheck" >&5
+$as_echo "$versioncheck" >&6; }
+  OCAMLATLEAST310=$versioncheck
+
+
+  { versioncheck=; unset versioncheck;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking that the OCaml version is at least 3.11" >&5
+$as_echo_n "checking that the OCaml version is at least 3.11... " >&6; }
+  as_arg_v1=$OCAMLVERSION
+as_arg_v2=3.11
+awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null
+case $? in #(
+  1) :
+    versioncheck=no ;; #(
+  0) :
+    versioncheck=yes ;; #(
+  2) :
+    versioncheck=yes ;; #(
+  *) :
+     ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $versioncheck" >&5
+$as_echo "$versioncheck" >&6; }
+  OCAMLATLEAST311=$versioncheck
+
+
+
+if test "x$OCAMLC" = xno -o "x$OCAMLDEP" = xno -o "x$OCAMLDOC" = xno -o "x$OCAMLMKLIB" = xno; then :
+    as_fn_error $? "You must install the OCaml compiler" "$LINENO" 5
+
+fi
+if test "x$OCAMLATLEAST310" = xno; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: a more recent OCaml installation may be required" >&5
+$as_echo "$as_me: a more recent OCaml installation may be required" >&6;}
+fi
+
+
+  # checking for camlp4
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4="$CAMLP4" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4=$ac_cv_path_CAMLP4
+if test -n "$CAMLP4"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4" >&5
+$as_echo "$CAMLP4" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4"; then
+  ac_pt_CAMLP4=$CAMLP4
+  # Extract the first word of "camlp4", so it can be a program name with args.
+set dummy camlp4; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4="$ac_pt_CAMLP4" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4=$ac_cv_path_ac_pt_CAMLP4
+if test -n "$ac_pt_CAMLP4"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4" >&5
+$as_echo "$ac_pt_CAMLP4" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4" = x; then
+    CAMLP4="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4=$ac_pt_CAMLP4
+  fi
+else
+  CAMLP4="$ac_cv_path_CAMLP4"
+fi
+
+  if test "$CAMLP4" != "no"; then
+     TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
+     if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc" >&5
+$as_echo "versions differs from ocamlc" >&6; }
+        CAMLP4=no
+     fi
+  fi
+
+
+  # checking for companion tools
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4boot", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4boot; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4BOOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4BOOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4BOOT="$CAMLP4BOOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4BOOT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4BOOT=$ac_cv_path_CAMLP4BOOT
+if test -n "$CAMLP4BOOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4BOOT" >&5
+$as_echo "$CAMLP4BOOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4BOOT"; then
+  ac_pt_CAMLP4BOOT=$CAMLP4BOOT
+  # Extract the first word of "camlp4boot", so it can be a program name with args.
+set dummy camlp4boot; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4BOOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4BOOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4BOOT="$ac_pt_CAMLP4BOOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4BOOT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4BOOT=$ac_cv_path_ac_pt_CAMLP4BOOT
+if test -n "$ac_pt_CAMLP4BOOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4BOOT" >&5
+$as_echo "$ac_pt_CAMLP4BOOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4BOOT" = x; then
+    CAMLP4BOOT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4BOOT=$ac_pt_CAMLP4BOOT
+  fi
+else
+  CAMLP4BOOT="$ac_cv_path_CAMLP4BOOT"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4o", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4o; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4O+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4O in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4O="$CAMLP4O" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4O="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4O=$ac_cv_path_CAMLP4O
+if test -n "$CAMLP4O"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4O" >&5
+$as_echo "$CAMLP4O" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4O"; then
+  ac_pt_CAMLP4O=$CAMLP4O
+  # Extract the first word of "camlp4o", so it can be a program name with args.
+set dummy camlp4o; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4O+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4O in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4O="$ac_pt_CAMLP4O" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4O="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4O=$ac_cv_path_ac_pt_CAMLP4O
+if test -n "$ac_pt_CAMLP4O"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4O" >&5
+$as_echo "$ac_pt_CAMLP4O" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4O" = x; then
+    CAMLP4O="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4O=$ac_pt_CAMLP4O
+  fi
+else
+  CAMLP4O="$ac_cv_path_CAMLP4O"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4of", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4of; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4OF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4OF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4OF="$CAMLP4OF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4OF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4OF=$ac_cv_path_CAMLP4OF
+if test -n "$CAMLP4OF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4OF" >&5
+$as_echo "$CAMLP4OF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4OF"; then
+  ac_pt_CAMLP4OF=$CAMLP4OF
+  # Extract the first word of "camlp4of", so it can be a program name with args.
+set dummy camlp4of; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4OF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4OF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4OF="$ac_pt_CAMLP4OF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4OF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4OF=$ac_cv_path_ac_pt_CAMLP4OF
+if test -n "$ac_pt_CAMLP4OF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4OF" >&5
+$as_echo "$ac_pt_CAMLP4OF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4OF" = x; then
+    CAMLP4OF="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4OF=$ac_pt_CAMLP4OF
+  fi
+else
+  CAMLP4OF="$ac_cv_path_CAMLP4OF"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4oof", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4oof; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4OOF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4OOF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4OOF="$CAMLP4OOF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4OOF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4OOF=$ac_cv_path_CAMLP4OOF
+if test -n "$CAMLP4OOF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4OOF" >&5
+$as_echo "$CAMLP4OOF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4OOF"; then
+  ac_pt_CAMLP4OOF=$CAMLP4OOF
+  # Extract the first word of "camlp4oof", so it can be a program name with args.
+set dummy camlp4oof; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4OOF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4OOF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4OOF="$ac_pt_CAMLP4OOF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4OOF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4OOF=$ac_cv_path_ac_pt_CAMLP4OOF
+if test -n "$ac_pt_CAMLP4OOF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4OOF" >&5
+$as_echo "$ac_pt_CAMLP4OOF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4OOF" = x; then
+    CAMLP4OOF="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4OOF=$ac_pt_CAMLP4OOF
+  fi
+else
+  CAMLP4OOF="$ac_cv_path_CAMLP4OOF"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4orf", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4orf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4ORF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4ORF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4ORF="$CAMLP4ORF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4ORF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4ORF=$ac_cv_path_CAMLP4ORF
+if test -n "$CAMLP4ORF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4ORF" >&5
+$as_echo "$CAMLP4ORF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4ORF"; then
+  ac_pt_CAMLP4ORF=$CAMLP4ORF
+  # Extract the first word of "camlp4orf", so it can be a program name with args.
+set dummy camlp4orf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4ORF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4ORF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4ORF="$ac_pt_CAMLP4ORF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4ORF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4ORF=$ac_cv_path_ac_pt_CAMLP4ORF
+if test -n "$ac_pt_CAMLP4ORF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4ORF" >&5
+$as_echo "$ac_pt_CAMLP4ORF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4ORF" = x; then
+    CAMLP4ORF="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4ORF=$ac_pt_CAMLP4ORF
+  fi
+else
+  CAMLP4ORF="$ac_cv_path_CAMLP4ORF"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4prof", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4prof; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4PROF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4PROF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4PROF="$CAMLP4PROF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4PROF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4PROF=$ac_cv_path_CAMLP4PROF
+if test -n "$CAMLP4PROF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4PROF" >&5
+$as_echo "$CAMLP4PROF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4PROF"; then
+  ac_pt_CAMLP4PROF=$CAMLP4PROF
+  # Extract the first word of "camlp4prof", so it can be a program name with args.
+set dummy camlp4prof; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4PROF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4PROF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4PROF="$ac_pt_CAMLP4PROF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4PROF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4PROF=$ac_cv_path_ac_pt_CAMLP4PROF
+if test -n "$ac_pt_CAMLP4PROF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4PROF" >&5
+$as_echo "$ac_pt_CAMLP4PROF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4PROF" = x; then
+    CAMLP4PROF="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4PROF=$ac_pt_CAMLP4PROF
+  fi
+else
+  CAMLP4PROF="$ac_cv_path_CAMLP4PROF"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4r", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4r; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4R+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4R in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4R="$CAMLP4R" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4R="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4R=$ac_cv_path_CAMLP4R
+if test -n "$CAMLP4R"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4R" >&5
+$as_echo "$CAMLP4R" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4R"; then
+  ac_pt_CAMLP4R=$CAMLP4R
+  # Extract the first word of "camlp4r", so it can be a program name with args.
+set dummy camlp4r; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4R+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4R in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4R="$ac_pt_CAMLP4R" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4R="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4R=$ac_cv_path_ac_pt_CAMLP4R
+if test -n "$ac_pt_CAMLP4R"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4R" >&5
+$as_echo "$ac_pt_CAMLP4R" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4R" = x; then
+    CAMLP4R="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4R=$ac_pt_CAMLP4R
+  fi
+else
+  CAMLP4R="$ac_cv_path_CAMLP4R"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}camlp4rf", so it can be a program name with args.
+set dummy ${ac_tool_prefix}camlp4rf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAMLP4RF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAMLP4RF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAMLP4RF="$CAMLP4RF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAMLP4RF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CAMLP4RF=$ac_cv_path_CAMLP4RF
+if test -n "$CAMLP4RF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAMLP4RF" >&5
+$as_echo "$CAMLP4RF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CAMLP4RF"; then
+  ac_pt_CAMLP4RF=$CAMLP4RF
+  # Extract the first word of "camlp4rf", so it can be a program name with args.
+set dummy camlp4rf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_CAMLP4RF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_CAMLP4RF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CAMLP4RF="$ac_pt_CAMLP4RF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CAMLP4RF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CAMLP4RF=$ac_cv_path_ac_pt_CAMLP4RF
+if test -n "$ac_pt_CAMLP4RF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CAMLP4RF" >&5
+$as_echo "$ac_pt_CAMLP4RF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_CAMLP4RF" = x; then
+    CAMLP4RF="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CAMLP4RF=$ac_pt_CAMLP4RF
+  fi
+else
+  CAMLP4RF="$ac_cv_path_CAMLP4RF"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-ocamllex was given.
+if test "${with_ocamllex+set}" = set; then :
+  withval=$with_ocamllex;
+fi
+
+  with_OCAMLLEX="$with_ocamllex"
+
+
+    if test -n "$with_OCAMLLEX" -a "x$with_OCAMLLEX" != xno -a "x$with_OCAMLLEX" != xyes; then :
+      OCAMLLEX="$with_OCAMLLEX"
+
+
+fi
+
+    if test "x$with_OCAMLLEX" != xno; then :
+        if test "xocamllex" = xpkg-config -a "xOCAMLLEX" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamllex" = xocamllex -a "xOCAMLLEX" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamllex" = xocamlyacc -a "xOCAMLLEX" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$OCAMLLEX" -o "x$OCAMLLEX" = xno; then :
+      if test "x$with_OCAMLLEX" = xyes; then :
+        as_fn_error $? "--with=ocamllex is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n ""; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: ocamllex not found. Trying substitute ." >&5
+$as_echo "$as_me: ocamllex not found. Trying substitute ." >&6;}
+      OCAMLLEX=""
+
+        if test "xocamllex" = xpkg-config -a "xOCAMLLEX" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamllex" = xocamllex -a "xOCAMLLEX" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamllex" = xocamlyacc -a "xOCAMLLEX" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+
+fi
+
+      SUBSTITUTED_OCAMLLEX=yes
+
+
+fi
+
+fi
+
+    if test -z "$OCAMLLEX"; then :
+  OCAMLLEX=no
+
+fi
+
+
+
+# Check whether --with-ocamlyacc was given.
+if test "${with_ocamlyacc+set}" = set; then :
+  withval=$with_ocamlyacc;
+fi
+
+  with_OCAMLYACC="$with_ocamlyacc"
+
+
+    if test -n "$with_OCAMLYACC" -a "x$with_OCAMLYACC" != xno -a "x$with_OCAMLYACC" != xyes; then :
+      OCAMLYACC="$with_OCAMLYACC"
+
+
+fi
+
+    if test "x$with_OCAMLYACC" != xno; then :
+        if test "xocamlyacc" = xpkg-config -a "xOCAMLYACC" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamlyacc" = xocamllex -a "xOCAMLYACC" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamlyacc" = xocamlyacc -a "xOCAMLYACC" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$OCAMLYACC" -o "x$OCAMLYACC" = xno; then :
+      if test "x$with_OCAMLYACC" = xyes; then :
+        as_fn_error $? "--with=ocamlyacc is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n ""; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: ocamlyacc not found. Trying substitute ." >&5
+$as_echo "$as_me: ocamlyacc not found. Trying substitute ." >&6;}
+      OCAMLYACC=""
+
+        if test "xocamlyacc" = xpkg-config -a "xOCAMLYACC" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamlyacc" = xocamllex -a "xOCAMLYACC" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamlyacc" = xocamlyacc -a "xOCAMLYACC" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+fi
+
+      SUBSTITUTED_OCAMLYACC=yes
+
+
+fi
+
+fi
+
+    if test -z "$OCAMLYACC"; then :
+  OCAMLYACC=no
+
+fi
+
+
+
+# Check whether --with-ocamlfind was given.
+if test "${with_ocamlfind+set}" = set; then :
+  withval=$with_ocamlfind;
+fi
+
+  with_OCAMLFIND="$with_ocamlfind"
+
+
+    if test -n "$with_OCAMLFIND" -a "x$with_OCAMLFIND" != xno -a "x$with_OCAMLFIND" != xyes; then :
+      OCAMLFIND="$with_OCAMLFIND"
+
+
+fi
+
+    if test "x$with_OCAMLFIND" != xno; then :
+        if test "xocamlfind" = xpkg-config -a "xOCAMLFIND" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamlfind" = xocamllex -a "xOCAMLFIND" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamlfind" = xocamlyacc -a "xOCAMLFIND" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLFIND in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLFIND="$OCAMLFIND" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLFIND=$ac_cv_path_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLFIND"; then
+  ac_pt_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLFIND in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLFIND="$ac_pt_OCAMLFIND" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLFIND=$ac_cv_path_ac_pt_OCAMLFIND
+if test -n "$ac_pt_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLFIND" >&5
+$as_echo "$ac_pt_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLFIND" = x; then
+    OCAMLFIND=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_pt_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_path_OCAMLFIND"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$OCAMLFIND" -o "x$OCAMLFIND" = xno; then :
+      if test "x$with_OCAMLFIND" = xyes; then :
+        as_fn_error $? "--with=ocamlfind is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n "$COCCI_SRCDIR/setup/fake-subst.sh ocamlfind"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: ocamlfind not found. Trying substitute $COCCI_SRCDIR/setup/fake-subst.sh ocamlfind." >&5
+$as_echo "$as_me: ocamlfind not found. Trying substitute $COCCI_SRCDIR/setup/fake-subst.sh ocamlfind." >&6;}
+      OCAMLFIND="$COCCI_SRCDIR/setup/fake-subst.sh ocamlfind"
+
+        if test "xocamlfind" = xpkg-config -a "xOCAMLFIND" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xocamlfind" = xocamllex -a "xOCAMLFIND" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xocamlfind" = xocamlyacc -a "xOCAMLFIND" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLFIND in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLFIND="$OCAMLFIND" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLFIND=$ac_cv_path_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLFIND"; then
+  ac_pt_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLFIND in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLFIND="$ac_pt_OCAMLFIND" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLFIND=$ac_cv_path_ac_pt_OCAMLFIND
+if test -n "$ac_pt_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLFIND" >&5
+$as_echo "$ac_pt_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLFIND" = x; then
+    OCAMLFIND=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_pt_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_path_OCAMLFIND"
+fi
+
+
+fi
+
+      SUBSTITUTED_OCAMLFIND=yes
+
+
+fi
+
+fi
+
+    if test -z "$OCAMLFIND"; then :
+  OCAMLFIND=no
+
+fi
+
+
+if test "x$OCAMLLEX" = xno; then :
+    as_fn_error $? "the OCaml Lexer needs to be installed (the ocamllex command). It should be part of your OCaml distribution." "$LINENO" 5
+
+fi
+
+if test "x$OCAMLYACC" = xno; then :
+    as_fn_error $? "The OCaml parser generated needs to be installed (the ocamlyacc command). It should be part of your OCaml distribution." "$LINENO" 5
+
+fi
+
+if test "x$OCAMLFIND" = xno; then :
+    as_fn_error $? "A suitable OCaml findlib (the ocamlfind command) could not be found." "$LINENO" 5
+
+fi
+
+
+
+# Check whether --with-runtime-ocamlfind was given.
+if test "${with_runtime_ocamlfind+set}" = set; then :
+  withval=$with_runtime_ocamlfind;
+fi
+
+
+  if test -z "$RUNTIME_OCAMLFIND_CMD"; then :
+      if test "x$with_runtime_ocamlfind" = xno; then :
+        RUNTIME_OCAMLFIND_CMD=$OCAMLFIND
+
+
+elif test -n "$with_runtime_ocamlfind" -a "x$with_runtime_ocamlfind" != xyes; then :
+        RUNTIME_OCAMLFIND_CMD="$with_runtime_ocamlfind"
+
+
+else
+        RUNTIME_OCAMLFIND_CMD="ocamlfind"
+
+
+fi
+
+fi
+
+
+
+# Check whether --with-runtime-ocamlc was given.
+if test "${with_runtime_ocamlc+set}" = set; then :
+  withval=$with_runtime_ocamlc;
+fi
+
+
+  if test -z "$RUNTIME_OCAMLC_CMD"; then :
+      if test "x$with_runtime_ocamlc" = xno; then :
+        RUNTIME_OCAMLC_CMD=$OCAMLC
+
+
+elif test -n "$with_runtime_ocamlc" -a "x$with_runtime_ocamlc" != xyes; then :
+        RUNTIME_OCAMLC_CMD="$with_runtime_ocamlc"
+
+
+else
+        RUNTIME_OCAMLC_CMD="ocamlc"
+
+
+fi
+
+fi
+
+
+
+# Check whether --with-runtime-ocamlopt was given.
+if test "${with_runtime_ocamlopt+set}" = set; then :
+  withval=$with_runtime_ocamlopt;
+fi
+
+
+  if test -z "$RUNTIME_OCAMLOPT_CMD"; then :
+      if test "x$with_runtime_ocamlopt" = xno; then :
+        RUNTIME_OCAMLOPT_CMD=$OCAMLOPT
+
+
+elif test -n "$with_runtime_ocamlopt" -a "x$with_runtime_ocamlopt" != xyes; then :
+        RUNTIME_OCAMLOPT_CMD="$with_runtime_ocamlopt"
+
+
+else
+        RUNTIME_OCAMLOPT_CMD="ocamlopt"
+
+
+fi
+
+fi
+
+
+
+# Check whether --with-runtime-ocamldep was given.
+if test "${with_runtime_ocamldep+set}" = set; then :
+  withval=$with_runtime_ocamldep;
+fi
+
+
+  if test -z "$RUNTIME_OCAMLDEP_CMD"; then :
+      if test "x$with_runtime_ocamldep" = xno; then :
+        RUNTIME_OCAMLDEP_CMD=$OCAMLDEP
+
+
+elif test -n "$with_runtime_ocamldep" -a "x$with_runtime_ocamldep" != xyes; then :
+        RUNTIME_OCAMLDEP_CMD="$with_runtime_ocamldep"
+
+
+else
+        RUNTIME_OCAMLDEP_CMD="ocamldep"
+
+
+fi
+
+fi
+
+
+
+# Check whether --with-runtime-camlp4 was given.
+if test "${with_runtime_camlp4+set}" = set; then :
+  withval=$with_runtime_camlp4;
+fi
+
+
+  if test -z "$RUNTIME_CAMLP4_CMD"; then :
+      if test "x$with_runtime_camlp4" = xno; then :
+        RUNTIME_CAMLP4_CMD=$CAMLP4
+
+
+elif test -n "$with_runtime_camlp4" -a "x$with_runtime_camlp4" != xyes; then :
+        RUNTIME_CAMLP4_CMD="$with_runtime_camlp4"
+
+
+else
+        RUNTIME_CAMLP4_CMD="camlp4"
+
+
+fi
+
+fi
+
+
+
+# Check whether --with-runtime-camlp4o was given.
+if test "${with_runtime_camlp4o+set}" = set; then :
+  withval=$with_runtime_camlp4o;
+fi
+
+
+  if test -z "$RUNTIME_CAMLP4O_CMD"; then :
+      if test "x$with_runtime_camlp4o" = xno; then :
+        RUNTIME_CAMLP4O_CMD=$CAMLP4O
+
+
+elif test -n "$with_runtime_camlp4o" -a "x$with_runtime_camlp4o" != xyes; then :
+        RUNTIME_CAMLP4O_CMD="$with_runtime_camlp4o"
+
+
+else
+        RUNTIME_CAMLP4O_CMD="camlp4o"
+
+
+fi
+
+fi
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: verifying basic ocaml modules" >&5
+$as_echo "$as_me: verifying basic ocaml modules" >&6;}
+
+
+  COCCI_OCAML_EXTERNAL="$COCCI_SRCDIR/bundles"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: coccinelle may use external ocaml libraries in $COCCI_OCAML_EXTERNAL" >&5
+$as_echo "$as_me: coccinelle may use external ocaml libraries in $COCCI_OCAML_EXTERNAL" >&6;}
+
+
+  FEATURE_sexplib=0
+
+  LOCALLIB_sexplib=0
+
+  FLAGS_sexplib=
+
+  MODULES_sexplib=
+
+  MODULESOPT_sexplib=
+
+  PATH_sexplib=
+
+
+  FEATURE_menhirLib=0
+
+  LOCALLIB_menhirLib=0
+
+  FLAGS_menhirLib=
+
+  MODULES_menhirLib=
+
+  MODULESOPT_menhirLib=
+
+  PATH_menhirLib=
+
+
+  FEATURE_extlib=0
+
+  LOCALLIB_extlib=0
+
+  FLAGS_extlib=
+
+  MODULES_extlib=
+
+  MODULESOPT_extlib=
+
+  PATH_extlib=
+
+
+  FEATURE_dynlink=0
+
+  LOCALLIB_dynlink=0
+
+  FLAGS_dynlink=
+
+  MODULES_dynlink=
+
+  MODULESOPT_dynlink=
+
+  PATH_dynlink=
+
+
+  FEATURE_pcre=0
+
+  LOCALLIB_pcre=0
+
+  FLAGS_pcre=
+
+  MODULES_pcre=
+
+  MODULESOPT_pcre=
+
+  PATH_pcre=
+
+
+  FEATURE_pycaml=0
+
+  LOCALLIB_pycaml=0
+
+  FLAGS_pycaml=
+
+  MODULES_pycaml=
+
+  MODULESOPT_pycaml=
+
+  PATH_pycaml=
+
+
+  FEATURE_camlp4=0
+
+  LOCALLIB_camlp4=0
+
+  FLAGS_camlp4=
+
+  MODULES_camlp4=
+
+  MODULESOPT_camlp4=
+
+  PATH_camlp4=
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: the following OCaml packages should be provided by your ocaml installation" >&5
+$as_echo "$as_me: the following OCaml packages should be provided by your ocaml installation" >&6;}
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package unix" >&5
+$as_echo_n "checking for OCaml findlib package unix... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in unix  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_unix=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_unix=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_unix" != xno; then :
+    PATH_unix=`$OCAMLFIND query unix 2>/dev/null`
+
+
+fi
+
+  if test "x$OCAML_PKG_unix" = xno; then :
+      as_fn_error $? "package unix is required. It should be part of your ocaml installation." "$LINENO" 5
+
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package bigarray" >&5
+$as_echo_n "checking for OCaml findlib package bigarray... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in bigarray  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_bigarray=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_bigarray=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_bigarray" != xno; then :
+    PATH_bigarray=`$OCAMLFIND query bigarray 2>/dev/null`
+
+
+fi
+
+  if test "x$OCAML_PKG_bigarray" = xno; then :
+      as_fn_error $? "package bigarray is required. It should be part of your ocaml installation." "$LINENO" 5
+
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package num" >&5
+$as_echo_n "checking for OCaml findlib package num... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in num  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_num=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_num=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_num" != xno; then :
+    PATH_num=`$OCAMLFIND query num 2>/dev/null`
+
+
+fi
+
+  if test "x$OCAML_PKG_num" = xno; then :
+      as_fn_error $? "package num is required. It should be part of your ocaml installation." "$LINENO" 5
+
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package str" >&5
+$as_echo_n "checking for OCaml findlib package str... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in str  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_str=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_str=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_str" != xno; then :
+    PATH_str=`$OCAMLFIND query str 2>/dev/null`
+
+
+fi
+
+  if test "x$OCAML_PKG_str" = xno; then :
+      as_fn_error $? "package str is required. It should be part of your ocaml installation." "$LINENO" 5
+
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package threads" >&5
+$as_echo_n "checking for OCaml findlib package threads... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in threads  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_threads=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_threads=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_threads" != xno; then :
+    PATH_threads=`$OCAMLFIND query threads 2>/dev/null`
+
+
+fi
+
+  if test "x$OCAML_PKG_threads" = xno; then :
+      as_fn_error $? "package threads is required. It should be part of your ocaml installation." "$LINENO" 5
+
+fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package dynlink" >&5
+$as_echo "$as_me: configuring package dynlink" >&6;}
+  # Check whether --enable-dynlink was given.
+if test "${enable_dynlink+set}" = set; then :
+  enableval=$enable_dynlink;
+fi
+
+
+      if test "x$enable_dynlink" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dynlink" >&5
+$as_echo_n "checking for OCaml findlib package dynlink... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in dynlink  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_dynlink=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_dynlink=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_dynlink" != xno; then :
+    PATH_dynlink=`$OCAMLFIND query dynlink 2>/dev/null`
+
+
+fi
+
+    GLOBAL_dynlink=$OCAML_PKG_dynlink
+
+
+    if test "x$GLOBAL_dynlink" != xno; then :
+        enable_dynlink=yes
+
+
+else
+        if test "x$enable_dynlink" = xyes; then :
+          as_fn_error $? "OCaml package dynlink is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_dynlink=no
+
+
+fi
+
+fi
+
+    if test "x$enable_dynlink" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/dynlink/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of dynlink" >&5
+$as_echo_n "checking for a bundled substitute of dynlink... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for dynlink in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for dynlink in $pkgdir" >&6;}
+      enable_dynlink=local
+
+      PATH_dynlink="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_dynlink" != xno; then :
+      FEATURE_dynlink=1
+
+    FLAGS_dynlink='$(FLAGS_dynlink)'
+
+
+        if test "x$enable_dynlink" = xlocal; then :
+        LOCALLIB_dynlink=1
+
+      MODULES_dynlink='$(LOCAL_dynlink)'
+
+      MODULESOPT_dynlink='$(LOCALOPT_dynlink)'
+
+
+            if test -f "$PATH_dynlink/Makefile"; then :
+          MAKE_dynlink=$PATH_dynlink
+
+
+else
+          MAKE_dynlink=
+
+
+fi
+
+else
+        MODULES_dynlink='$(GLOBAL_dynlink)'
+
+      MODULESOPT_dynlink='$(GLOBALOPT_dynlink)'
+
+
+fi
+
+fi
+
+  if test "x$enable_dynlink" = xno; then :
+      as_fn_error $? "OCaml package dynlink is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package camlp4" >&5
+$as_echo "$as_me: configuring package camlp4" >&6;}
+  # Check whether --enable-camlp4 was given.
+if test "${enable_camlp4+set}" = set; then :
+  enableval=$enable_camlp4;
+fi
+
+
+      if test "x$enable_camlp4" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package camlp4" >&5
+$as_echo_n "checking for OCaml findlib package camlp4... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in camlp4  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_camlp4=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_camlp4=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_camlp4" != xno; then :
+    PATH_camlp4=`$OCAMLFIND query camlp4 2>/dev/null`
+
+
+fi
+
+    GLOBAL_camlp4=$OCAML_PKG_camlp4
+
+
+    if test "x$GLOBAL_camlp4" != xno; then :
+        enable_camlp4=yes
+
+
+else
+        if test "x$enable_camlp4" = xyes; then :
+          as_fn_error $? "OCaml package camlp4 is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_camlp4=no
+
+
+fi
+
+fi
+
+    if test "x$enable_camlp4" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/camlp4/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of camlp4" >&5
+$as_echo_n "checking for a bundled substitute of camlp4... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for camlp4 in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for camlp4 in $pkgdir" >&6;}
+      enable_camlp4=local
+
+      PATH_camlp4="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_camlp4" != xno; then :
+      FEATURE_camlp4=1
+
+    FLAGS_camlp4='$(FLAGS_camlp4)'
+
+
+        if test "x$enable_camlp4" = xlocal; then :
+        LOCALLIB_camlp4=1
+
+      MODULES_camlp4='$(LOCAL_camlp4)'
+
+      MODULESOPT_camlp4='$(LOCALOPT_camlp4)'
+
+
+            if test -f "$PATH_camlp4/Makefile"; then :
+          MAKE_camlp4=$PATH_camlp4
+
+
+else
+          MAKE_camlp4=
+
+
+fi
+
+else
+        MODULES_camlp4='$(GLOBAL_camlp4)'
+
+      MODULESOPT_camlp4='$(GLOBALOPT_camlp4)'
+
+
+fi
+
+fi
+
+  if test "x$enable_camlp4" = xno; then :
+      as_fn_error $? "OCaml package camlp4 is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package sexplib" >&5
+$as_echo "$as_me: configuring package sexplib" >&6;}
+  # Check whether --enable-sexplib was given.
+if test "${enable_sexplib+set}" = set; then :
+  enableval=$enable_sexplib;
+fi
+
+
+      if test "x$enable_sexplib" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package sexplib" >&5
+$as_echo_n "checking for OCaml findlib package sexplib... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in sexplib  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_sexplib=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_sexplib=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_sexplib" != xno; then :
+    PATH_sexplib=`$OCAMLFIND query sexplib 2>/dev/null`
+
+
+fi
+
+    GLOBAL_sexplib=$OCAML_PKG_sexplib
+
+
+    if test "x$GLOBAL_sexplib" != xno; then :
+        enable_sexplib=yes
+
+
+else
+        if test "x$enable_sexplib" = xyes; then :
+          as_fn_error $? "OCaml package sexplib is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_sexplib=no
+
+
+fi
+
+fi
+
+    if test "x$enable_sexplib" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/sexplib/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of sexplib" >&5
+$as_echo_n "checking for a bundled substitute of sexplib... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for sexplib in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for sexplib in $pkgdir" >&6;}
+      enable_sexplib=local
+
+      PATH_sexplib="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_sexplib" != xno; then :
+      FEATURE_sexplib=1
+
+    FLAGS_sexplib='$(FLAGS_sexplib)'
+
+
+        if test "x$enable_sexplib" = xlocal; then :
+        LOCALLIB_sexplib=1
+
+      MODULES_sexplib='$(LOCAL_sexplib)'
+
+      MODULESOPT_sexplib='$(LOCALOPT_sexplib)'
+
+
+            if test -f "$PATH_sexplib/Makefile"; then :
+          MAKE_sexplib=$PATH_sexplib
+
+
+else
+          MAKE_sexplib=
+
+
+fi
+
+else
+        MODULES_sexplib='$(GLOBAL_sexplib)'
+
+      MODULESOPT_sexplib='$(GLOBALOPT_sexplib)'
+
+
+fi
+
+fi
+
+  if test "x$enable_sexplib" = xno; then :
+      as_fn_error $? "OCaml package sexplib is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package menhirLib" >&5
+$as_echo "$as_me: configuring package menhirLib" >&6;}
+  # Check whether --enable-menhirLib was given.
+if test "${enable_menhirLib+set}" = set; then :
+  enableval=$enable_menhirLib;
+fi
+
+
+      if test "x$enable_menhirLib" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package menhirLib" >&5
+$as_echo_n "checking for OCaml findlib package menhirLib... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in menhirLib  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_menhirLib=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_menhirLib=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_menhirLib" != xno; then :
+    PATH_menhirLib=`$OCAMLFIND query menhirLib 2>/dev/null`
+
+
+fi
+
+    GLOBAL_menhirLib=$OCAML_PKG_menhirLib
+
+
+    if test "x$GLOBAL_menhirLib" != xno; then :
+        enable_menhirLib=yes
+
+
+else
+        if test "x$enable_menhirLib" = xyes; then :
+          as_fn_error $? "OCaml package menhirLib is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_menhirLib=no
+
+
+fi
+
+fi
+
+    if test "x$enable_menhirLib" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/menhirLib/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of menhirLib" >&5
+$as_echo_n "checking for a bundled substitute of menhirLib... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for menhirLib in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for menhirLib in $pkgdir" >&6;}
+      enable_menhirLib=local
+
+      PATH_menhirLib="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_menhirLib" != xno; then :
+      FEATURE_menhirLib=1
+
+    FLAGS_menhirLib='$(FLAGS_menhirLib)'
+
+
+        if test "x$enable_menhirLib" = xlocal; then :
+        LOCALLIB_menhirLib=1
+
+      MODULES_menhirLib='$(LOCAL_menhirLib)'
+
+      MODULESOPT_menhirLib='$(LOCALOPT_menhirLib)'
+
+
+            if test -f "$PATH_menhirLib/Makefile"; then :
+          MAKE_menhirLib=$PATH_menhirLib
+
+
+else
+          MAKE_menhirLib=
+
+
+fi
+
+else
+        MODULES_menhirLib='$(GLOBAL_menhirLib)'
+
+      MODULESOPT_menhirLib='$(GLOBALOPT_menhirLib)'
+
+
+fi
+
+fi
+
+  if test "x$enable_menhirLib" = xno; then :
+      as_fn_error $? "OCaml package menhirLib is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package extlib" >&5
+$as_echo "$as_me: configuring package extlib" >&6;}
+  # Check whether --enable-extlib was given.
+if test "${enable_extlib+set}" = set; then :
+  enableval=$enable_extlib;
+fi
+
+
+      if test "x$enable_extlib" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package extlib" >&5
+$as_echo_n "checking for OCaml findlib package extlib... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in extlib  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_extlib=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_extlib=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_extlib" != xno; then :
+    PATH_extlib=`$OCAMLFIND query extlib 2>/dev/null`
+
+
+fi
+
+    GLOBAL_extlib=$OCAML_PKG_extlib
+
+
+    if test "x$GLOBAL_extlib" != xno; then :
+        enable_extlib=yes
+
+
+else
+        if test "x$enable_extlib" = xyes; then :
+          as_fn_error $? "OCaml package extlib is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_extlib=no
+
+
+fi
+
+fi
+
+    if test "x$enable_extlib" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/extlib/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of extlib" >&5
+$as_echo_n "checking for a bundled substitute of extlib... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for extlib in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for extlib in $pkgdir" >&6;}
+      enable_extlib=local
+
+      PATH_extlib="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_extlib" != xno; then :
+      FEATURE_extlib=1
+
+    FLAGS_extlib='$(FLAGS_extlib)'
+
+
+        if test "x$enable_extlib" = xlocal; then :
+        LOCALLIB_extlib=1
+
+      MODULES_extlib='$(LOCAL_extlib)'
+
+      MODULESOPT_extlib='$(LOCALOPT_extlib)'
+
+
+            if test -f "$PATH_extlib/Makefile"; then :
+          MAKE_extlib=$PATH_extlib
+
+
+else
+          MAKE_extlib=
+
+
+fi
+
+else
+        MODULES_extlib='$(GLOBAL_extlib)'
+
+      MODULESOPT_extlib='$(GLOBALOPT_extlib)'
+
+
+fi
+
+fi
+
+  if test "x$enable_extlib" = xno; then :
+      as_fn_error $? "OCaml package extlib is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: verifying optional features" >&5
+$as_echo "$as_me: verifying optional features" >&6;}
+
+
+
+
+# Check whether --with-menhir was given.
+if test "${with_menhir+set}" = set; then :
+  withval=$with_menhir;
+fi
+
+  with_MENHIR="$with_menhir"
+
+
+    if test -n "$with_MENHIR" -a "x$with_MENHIR" != xno -a "x$with_MENHIR" != xyes; then :
+      MENHIR="$with_MENHIR"
+
+
+fi
+
+    if test "x$with_MENHIR" != xno; then :
+        if test "xmenhir" = xpkg-config -a "xMENHIR" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xmenhir" = xocamllex -a "xMENHIR" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xmenhir" = xocamlyacc -a "xMENHIR" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}menhir", so it can be a program name with args.
+set dummy ${ac_tool_prefix}menhir; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MENHIR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MENHIR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MENHIR="$MENHIR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MENHIR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MENHIR=$ac_cv_path_MENHIR
+if test -n "$MENHIR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MENHIR" >&5
+$as_echo "$MENHIR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_MENHIR"; then
+  ac_pt_MENHIR=$MENHIR
+  # Extract the first word of "menhir", so it can be a program name with args.
+set dummy menhir; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_MENHIR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_MENHIR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_MENHIR="$ac_pt_MENHIR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_MENHIR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_MENHIR=$ac_cv_path_ac_pt_MENHIR
+if test -n "$ac_pt_MENHIR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MENHIR" >&5
+$as_echo "$ac_pt_MENHIR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_MENHIR" = x; then
+    MENHIR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MENHIR=$ac_pt_MENHIR
+  fi
+else
+  MENHIR="$ac_cv_path_MENHIR"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$MENHIR" -o "x$MENHIR" = xno; then :
+      if test "x$with_MENHIR" = xyes; then :
+        as_fn_error $? "--with=menhir is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n "$COCCI_SRCDIR/setup/fake-menhir.sh menhir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: menhir not found. Trying substitute $COCCI_SRCDIR/setup/fake-menhir.sh menhir." >&5
+$as_echo "$as_me: menhir not found. Trying substitute $COCCI_SRCDIR/setup/fake-menhir.sh menhir." >&6;}
+      MENHIR="$COCCI_SRCDIR/setup/fake-menhir.sh menhir"
+
+        if test "xmenhir" = xpkg-config -a "xMENHIR" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xmenhir" = xocamllex -a "xMENHIR" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xmenhir" = xocamlyacc -a "xMENHIR" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}menhir", so it can be a program name with args.
+set dummy ${ac_tool_prefix}menhir; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MENHIR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MENHIR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MENHIR="$MENHIR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MENHIR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MENHIR=$ac_cv_path_MENHIR
+if test -n "$MENHIR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MENHIR" >&5
+$as_echo "$MENHIR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_MENHIR"; then
+  ac_pt_MENHIR=$MENHIR
+  # Extract the first word of "menhir", so it can be a program name with args.
+set dummy menhir; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_MENHIR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_MENHIR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_MENHIR="$ac_pt_MENHIR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_MENHIR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_MENHIR=$ac_cv_path_ac_pt_MENHIR
+if test -n "$ac_pt_MENHIR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MENHIR" >&5
+$as_echo "$ac_pt_MENHIR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_MENHIR" = x; then
+    MENHIR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MENHIR=$ac_pt_MENHIR
+  fi
+else
+  MENHIR="$ac_cv_path_MENHIR"
+fi
+
+
+fi
+
+      SUBSTITUTED_MENHIR=yes
+
+
+fi
+
+fi
+
+    if test -z "$MENHIR"; then :
+  MENHIR=no
+
+fi
+
+if test "x$SUBSTITUTED_MENHIR" = xyes; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: pregenerated parsers will be required as substitute for Menhir" >&5
+$as_echo "$as_me: pregenerated parsers will be required as substitute for Menhir" >&6;}
+
+fi
+
+
+# Check whether --enable-ocaml was given.
+if test "${enable_ocaml+set}" = set; then :
+  enableval=$enable_ocaml;
+fi
+
+if test "x$OCAML_PKG_dynlink" = xno; then :
+    if test -z "$enable_ocaml"; then :
+      enable_ocaml=no
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: ocaml scripting is disabled because the 'dynlink' package is not installed" >&5
+$as_echo "$as_me: ocaml scripting is disabled because the 'dynlink' package is not installed" >&6;}
+
+elif test "x$enable_ocaml" != xno; then :
+      as_fn_error $? "the OCaml package dynlink is required for ocaml scripting" "$LINENO" 5
+
+fi
+
+fi
+
+if test "x$OCAMLATLEAST311" = xno; then :
+    enable_ocaml=no
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: ocaml scripting has been disabled because your OCaml version may not support dynamic linking properly" >&5
+$as_echo "$as_me: ocaml scripting has been disabled because your OCaml version may not support dynamic linking properly" >&6;}
+
+fi
+
+if test -n "$SUBSTITUTED_OCAMLFIND"; then :
+    if test -z "$enable_ocaml"; then :
+      enable_ocaml=no
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: ocaml scripting is disabled because it depends on ocamlfind" >&5
+$as_echo "$as_me: ocaml scripting is disabled because it depends on ocamlfind" >&6;}
+
+elif test "x$enable_ocaml" != xno; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ocamlfind is not found but may be required if ocaml scripts are used" >&5
+$as_echo "$as_me: warning: ocamlfind is not found but may be required if ocaml scripts are used" >&6;}
+
+fi
+
+fi
+
+if test "x$CAMLP4" = xno; then :
+    if test -z "$enable_ocaml"; then :
+      enable_ocaml=no
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: ocaml scripting is disabled because it depends on camlp4" >&5
+$as_echo "$as_me: ocaml scripting is disabled because it depends on camlp4" >&6;}
+
+elif test "x$enable_ocaml" != xno; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: warning: camlp4 is not found but may be required if ocaml scripts are used" >&5
+$as_echo "$as_me: warning: camlp4 is not found but may be required if ocaml scripts are used" >&6;}
+
+fi
+
+fi
+
+if test "x$enable_ocaml" = xno; then :
+      FEATURE_dynlink=0
+
+  LOCALLIB_dynlink=0
+
+  FLAGS_dynlink=
+
+  MODULES_dynlink=
+
+  MODULESOPT_dynlink=
+
+  PATH_dynlink=
+
+      OCAMLCOCCI_MODULE=No_prepare_ocamlcocci
+
+  OCAMLCOCCI_FILE=no_prepare_ocamlcocci.ml
+
+
+else
+    enable_ocaml=yes
+
+  OCAMLCOCCI_MODULE=Yes_prepare_ocamlcocci
+
+  OCAMLCOCCI_FILE=yes_prepare_ocamlcocci.ml
+
+
+fi
+
+
+
+# Check whether --enable-python was given.
+if test "${enable_python+set}" = set; then :
+  enableval=$enable_python;
+fi
+
+if test "x$enable_python" != xno; then :
+      if test -n "$enable_python" -a -z "$enable_pycaml"; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: skipped the selection of a global pycaml module because --enable-python is given explicitly but --enable-pycaml is not." >&5
+$as_echo "$as_me: skipped the selection of a global pycaml module because --enable-python is given explicitly but --enable-pycaml is not." >&6;}
+    enable_pycaml=no
+
+
+fi
+
+      if test -z "$PYVER"; then :
+
+
+# Check whether --with-python was given.
+if test "${with_python+set}" = set; then :
+  withval=$with_python;
+fi
+
+  with_PYTHON="$with_python"
+
+
+    if test -n "$with_PYTHON" -a "x$with_PYTHON" != xno -a "x$with_PYTHON" != xyes; then :
+      PYTHON="$with_PYTHON"
+
+
+fi
+
+    if test "x$with_PYTHON" != xno; then :
+        if test "xpython" = xpkg-config -a "xPYTHON" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpython" = xocamllex -a "xPYTHON" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpython" = xocamlyacc -a "xPYTHON" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}python", so it can be a program name with args.
+set dummy ${ac_tool_prefix}python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PYTHON"; then
+  ac_pt_PYTHON=$PYTHON
+  # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PYTHON="$ac_pt_PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PYTHON=$ac_cv_path_ac_pt_PYTHON
+if test -n "$ac_pt_PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PYTHON" >&5
+$as_echo "$ac_pt_PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PYTHON" = x; then
+    PYTHON=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PYTHON=$ac_pt_PYTHON
+  fi
+else
+  PYTHON="$ac_cv_path_PYTHON"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$PYTHON" -o "x$PYTHON" = xno; then :
+      if test "x$with_PYTHON" = xyes; then :
+        as_fn_error $? "--with=python is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n ""; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: python not found. Trying substitute ." >&5
+$as_echo "$as_me: python not found. Trying substitute ." >&6;}
+      PYTHON=""
+
+        if test "xpython" = xpkg-config -a "xPYTHON" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpython" = xocamllex -a "xPYTHON" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpython" = xocamlyacc -a "xPYTHON" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}python", so it can be a program name with args.
+set dummy ${ac_tool_prefix}python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PYTHON"; then
+  ac_pt_PYTHON=$PYTHON
+  # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PYTHON="$ac_pt_PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PYTHON=$ac_cv_path_ac_pt_PYTHON
+if test -n "$ac_pt_PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PYTHON" >&5
+$as_echo "$ac_pt_PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PYTHON" = x; then
+    PYTHON=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PYTHON=$ac_pt_PYTHON
+  fi
+else
+  PYTHON="$ac_cv_path_PYTHON"
+fi
+
+
+fi
+
+      SUBSTITUTED_PYTHON=yes
+
+
+fi
+
+fi
+
+    if test -z "$PYTHON"; then :
+  PYTHON=no
+
+fi
+
+
+    if test "x$PYTHON" = xno -a -n "$with_python" -a "x$with_python" != xyes; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}:  is not a found as tool, therefore interpreted as version" >&5
+$as_echo "$as_me:  is not a found as tool, therefore interpreted as version" >&6;}
+      PYVER=""
+
+
+fi
+
+    if test "x$PYTHON" != xno; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking python version" >&5
+$as_echo_n "checking python version... " >&6; }
+      PYVER=`$PYTHON -c "import sys; print(sys.version[:3])"`
+      if test -n "$PYVER"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYVER found" >&5
+$as_echo "$PYVER found" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+fi
+
+
+fi
+
+else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: python version assumed to be $PYVER" >&5
+$as_echo "$as_me: python version assumed to be $PYVER" >&6;}
+
+fi
+
+
+  if test -z "$PYVER"; then :
+      if test "x$enable_python" = xyes; then :
+        as_fn_error $? "python scripting is enabled explicitly but the version of python could not be determined" "$LINENO" 5
+
+fi
+
+else
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHON" >&5
+$as_echo_n "checking for PYTHON... " >&6; }
+
+if test -n "$PYTHON_CFLAGS"; then
+    pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYVER\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "python-$PYVER") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python-$PYVER" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$PYTHON_LIBS"; then
+    pkg_cv_PYTHON_LIBS="$PYTHON_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYVER\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "python-$PYVER") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python-$PYVER" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "python-$PYVER" 2>&1`
+        else
+               PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors "python-$PYVER" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$PYTHON_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                HAVE_PYTHON=no
+
+elif test $pkg_failed = untried; then
+       HAVE_PYTHON=no
+
+else
+       PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS
+       PYTHON_LIBS=$pkg_cv_PYTHON_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       HAVE_PYTHON=yes
+
+fi
+
+    if test "x$HAVE_PYTHON" != xyes -a "x$enable_python" != xyes; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: trying the default python version as fallback" >&5
+$as_echo "$as_me: trying the default python version as fallback" >&6;}
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHON" >&5
+$as_echo_n "checking for PYTHON... " >&6; }
+
+if test -n "$PYTHON_CFLAGS"; then
+    pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "python") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$PYTHON_LIBS"; then
+    pkg_cv_PYTHON_LIBS="$PYTHON_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "python") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "python" 2>&1`
+        else
+               PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors "python" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$PYTHON_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                HAVE_PYTHON=no
+
+elif test $pkg_failed = untried; then
+       HAVE_PYTHON=no
+
+else
+       PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS
+       PYTHON_LIBS=$pkg_cv_PYTHON_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       HAVE_PYTHON=yes
+
+fi
+
+fi
+
+fi
+
+fi
+
+if test -z "$enable_python"; then :
+    if test "x$HAVE_PYTHON" = xyes; then :
+      enable_python=yes
+
+
+else
+      enable_python=no
+
+
+fi
+
+fi
+
+if test "x$enable_python" != xno; then :
+    if test "x$HAVE_PYTHON" = xyes; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: support for python scripts is enabled" >&5
+$as_echo "$as_me: support for python scripts is enabled" >&6;}
+
+else
+      as_fn_error $? "the python scripts feature is enabled but the pkg-config python library is not found" "$LINENO" 5
+
+fi
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package pycaml" >&5
+$as_echo "$as_me: configuring package pycaml" >&6;}
+  # Check whether --enable-pycaml was given.
+if test "${enable_pycaml+set}" = set; then :
+  enableval=$enable_pycaml;
+fi
+
+
+      if test "x$enable_pycaml" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package pycaml" >&5
+$as_echo_n "checking for OCaml findlib package pycaml... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in pycaml  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_pycaml=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_pycaml=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_pycaml" != xno; then :
+    PATH_pycaml=`$OCAMLFIND query pycaml 2>/dev/null`
+
+
+fi
+
+    GLOBAL_pycaml=$OCAML_PKG_pycaml
+
+
+    if test "x$GLOBAL_pycaml" != xno; then :
+        enable_pycaml=yes
+
+
+else
+        if test "x$enable_pycaml" = xyes; then :
+          as_fn_error $? "OCaml package pycaml is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_pycaml=no
+
+
+fi
+
+fi
+
+    if test "x$enable_pycaml" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/pycaml/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of pycaml" >&5
+$as_echo_n "checking for a bundled substitute of pycaml... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for pycaml in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for pycaml in $pkgdir" >&6;}
+      enable_pycaml=local
+
+      PATH_pycaml="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_pycaml" != xno; then :
+      FEATURE_pycaml=1
+
+    FLAGS_pycaml='$(FLAGS_pycaml)'
+
+
+        if test "x$enable_pycaml" = xlocal; then :
+        LOCALLIB_pycaml=1
+
+      MODULES_pycaml='$(LOCAL_pycaml)'
+
+      MODULESOPT_pycaml='$(LOCALOPT_pycaml)'
+
+
+            if test -f "$PATH_pycaml/Makefile"; then :
+          MAKE_pycaml=$PATH_pycaml
+
+
+else
+          MAKE_pycaml=
+
+
+fi
+
+else
+        MODULES_pycaml='$(GLOBAL_pycaml)'
+
+      MODULESOPT_pycaml='$(GLOBALOPT_pycaml)'
+
+
+fi
+
+fi
+
+  if test "x$enable_pycaml" = xno; then :
+      as_fn_error $? "OCaml package pycaml is required. Please make sure it is available." "$LINENO" 5
+
+fi
+
+  PYCOCCI_MODULE=Yes_pycocci
+
+  PYCOCCI_FILE=yes_pycocci.ml
+
+
+else
+      FEATURE_pycaml=0
+
+  LOCALLIB_pycaml=0
+
+  FLAGS_pycaml=
+
+  MODULES_pycaml=
+
+  MODULESOPT_pycaml=
+
+  PATH_pycaml=
+
+
+  PYCOCCI_MODULE=No_pycocci
+
+  PYCOCCI_FILE=no_pycocci.ml
+
+
+fi
+
+
+# Check whether --enable-pcre-syntax was given.
+if test "${enable_pcre_syntax+set}" = set; then :
+  enableval=$enable_pcre_syntax;
+fi
+
+if test "x$enable_pcre_syntax" != "xno"; then :
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5
+$as_echo_n "checking for PCRE... " >&6; }
+
+if test -n "$PCRE_CFLAGS"; then
+    pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PCRE_CFLAGS=`$PKG_CONFIG --cflags "libpcre" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$PCRE_LIBS"; then
+    pkg_cv_PCRE_LIBS="$PCRE_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PCRE_LIBS=`$PKG_CONFIG --libs "libpcre" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               PCRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpcre" 2>&1`
+        else
+               PCRE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpcre" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$PCRE_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                HAVE_PCRE=no
+
+elif test $pkg_failed = untried; then
+       HAVE_PCRE=no
+
+else
+       PCRE_CFLAGS=$pkg_cv_PCRE_CFLAGS
+       PCRE_LIBS=$pkg_cv_PCRE_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       HAVE_PCRE=yes
+
+fi
+  if test -z "$enable_pcre_syntax" -a "x$HAVE_PCRE" != xyes; then :
+      enable_pcre_syntax=no
+
+
+else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: configuring package pcre" >&5
+$as_echo "$as_me: configuring package pcre" >&6;}
+  # Check whether --enable-pcre was given.
+if test "${enable_pcre+set}" = set; then :
+  enableval=$enable_pcre;
+fi
+
+
+      if test "x$enable_pcre" != xno; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package pcre" >&5
+$as_echo_n "checking for OCaml findlib package pcre... " >&6; }
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in pcre  ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+      OCAML_PKG_pcre=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    OCAML_PKG_pcre=no
+  fi
+
+
+
+  if test "x$OCAML_PKG_pcre" != xno; then :
+    PATH_pcre=`$OCAMLFIND query pcre 2>/dev/null`
+
+
+fi
+
+    GLOBAL_pcre=$OCAML_PKG_pcre
+
+
+    if test "x$GLOBAL_pcre" != xno; then :
+        enable_pcre=yes
+
+
+else
+        if test "x$enable_pcre" = xyes; then :
+          as_fn_error $? "OCaml package pcre is not available but requested explicitly" "$LINENO" 5
+
+fi
+      enable_pcre=no
+
+
+fi
+
+fi
+
+    if test "x$enable_pcre" = xno; then :
+      { pkgdir=; unset pkgdir;}
+    pkgdir="$COCCI_OCAML_EXTERNAL/pcre/"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a bundled substitute of pcre" >&5
+$as_echo_n "checking for a bundled substitute of pcre... " >&6; }
+    if test -d "$pkgdir"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled substitute for pcre in $pkgdir" >&5
+$as_echo "$as_me: using bundled substitute for pcre in $pkgdir" >&6;}
+      enable_pcre=local
+
+      PATH_pcre="$pkgdir"
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5
+$as_echo "not available" >&6; }
+fi
+
+fi
+
+    if test "x$enable_pcre" != xno; then :
+      FEATURE_pcre=1
+
+    FLAGS_pcre='$(FLAGS_pcre)'
+
+
+        if test "x$enable_pcre" = xlocal; then :
+        LOCALLIB_pcre=1
+
+      MODULES_pcre='$(LOCAL_pcre)'
+
+      MODULESOPT_pcre='$(LOCALOPT_pcre)'
+
+
+            if test -f "$PATH_pcre/Makefile"; then :
+          MAKE_pcre=$PATH_pcre
+
+
+else
+          MAKE_pcre=
+
+
+fi
+
+else
+        MODULES_pcre='$(GLOBAL_pcre)'
+
+      MODULESOPT_pcre='$(GLOBALOPT_pcre)'
+
+
+fi
+
+fi
+      enable_pcre_syntax=$enable_pcre
+
+fi
+
+fi
+
+if test "x$enable_pcre_syntax" != xno; then :
+    if test "x$HAVE_PCRE" = xyes; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: support for pcre syntax is enabled" >&5
+$as_echo "$as_me: support for pcre syntax is enabled" >&6;}
+
+else
+      as_fn_error $? "the pcre feature is enabled but the pkg-config libpcre library is not found" "$LINENO" 5
+
+fi
+
+  REGEXP_MODULE=Regexp_pcre
+
+  REGEXP_FILE=regexp_pcre.ml
+
+
+else
+      FEATURE_pcre=0
+
+  LOCALLIB_pcre=0
+
+  FLAGS_pcre=
+
+  MODULES_pcre=
+
+  MODULESOPT_pcre=
+
+  PATH_pcre=
+
+
+  REGEXP_MODULE=Regexp_str
+
+  REGEXP_FILE=regexp_str.ml
+
+
+fi
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+
+if test "$prefix" = "NONE"; then :
+  prefix=$ac_default_prefix
+fi
+
+
+
+SHAREDIR="${prefix}/share/coccinelle"
+
+
+if test "x$enable_python" != xno; then :
+    FEATURE_PYTHON=1
+
+
+else
+    FEATURE_PYTHON=0
+
+
+fi
+
+if test "x$enable_ocaml" != xno; then :
+    FEATURE_OCAML=1
+
+
+else
+    FEATURE_OCAML=0
+
+
+fi
+
+if test "x$OCAMLATLEAST311" = xyes -a "x$enable_ocaml" = xyes; then :
+    DYNLINK_IS_NATIVE=Dynlink.is_native
+
+
+else
+    DYNLINK_IS_NATIVE=false
+
+
+fi
+
+
+
+# Check whether --with-pdflatex was given.
+if test "${with_pdflatex+set}" = set; then :
+  withval=$with_pdflatex;
+fi
+
+  with_PDFLATEX="$with_pdflatex"
+
+
+    if test -n "$with_PDFLATEX" -a "x$with_PDFLATEX" != xno -a "x$with_PDFLATEX" != xyes; then :
+      PDFLATEX="$with_PDFLATEX"
+
+
+fi
+
+    if test "x$with_PDFLATEX" != xno; then :
+        if test "xpdflatex" = xpkg-config -a "xPDFLATEX" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpdflatex" = xocamllex -a "xPDFLATEX" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpdflatex" = xocamlyacc -a "xPDFLATEX" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pdflatex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PDFLATEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PDFLATEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PDFLATEX="$PDFLATEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PDFLATEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PDFLATEX=$ac_cv_path_PDFLATEX
+if test -n "$PDFLATEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5
+$as_echo "$PDFLATEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PDFLATEX"; then
+  ac_pt_PDFLATEX=$PDFLATEX
+  # Extract the first word of "pdflatex", so it can be a program name with args.
+set dummy pdflatex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PDFLATEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PDFLATEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PDFLATEX="$ac_pt_PDFLATEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PDFLATEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PDFLATEX=$ac_cv_path_ac_pt_PDFLATEX
+if test -n "$ac_pt_PDFLATEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PDFLATEX" >&5
+$as_echo "$ac_pt_PDFLATEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PDFLATEX" = x; then
+    PDFLATEX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PDFLATEX=$ac_pt_PDFLATEX
+  fi
+else
+  PDFLATEX="$ac_cv_path_PDFLATEX"
+fi
+
+
+fi
+
+
+fi
+
+  if test -z "$PDFLATEX" -o "x$PDFLATEX" = xno; then :
+      if test "x$with_PDFLATEX" = xyes; then :
+        as_fn_error $? "--with=pdflatex is given explicitly but not found" "$LINENO" 5
+
+fi
+
+    if test -n "$COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: pdflatex not found. Trying substitute $COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex." >&5
+$as_echo "$as_me: pdflatex not found. Trying substitute $COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex." >&6;}
+      PDFLATEX="$COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex"
+
+        if test "xpdflatex" = xpkg-config -a "xPDFLATEX" = xPKG_CONFIG; then :
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+elif test "xpdflatex" = xocamllex -a "xPDFLATEX" = xOCAMLLEX; then :
+        # checking for ocamllex
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEX=$ac_cv_path_OCAMLLEX
+if test -n "$OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5
+$as_echo "$OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEX"; then
+  ac_pt_OCAMLLEX=$OCAMLLEX
+  # Extract the first word of "ocamllex", so it can be a program name with args.
+set dummy ocamllex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEX="$ac_pt_OCAMLLEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEX=$ac_cv_path_ac_pt_OCAMLLEX
+if test -n "$ac_pt_OCAMLLEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEX" >&5
+$as_echo "$ac_pt_OCAMLLEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEX" = x; then
+    OCAMLLEX="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEX=$ac_pt_OCAMLLEX
+  fi
+else
+  OCAMLLEX="$ac_cv_path_OCAMLLEX"
+fi
+
+  if test "$OCAMLLEX" != "no"; then
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLLEXDOTOPT=$ac_cv_path_OCAMLLEXDOTOPT
+if test -n "$OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5
+$as_echo "$OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLLEXDOTOPT"; then
+  ac_pt_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT
+  # Extract the first word of "ocamllex.opt", so it can be a program name with args.
+set dummy ocamllex.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLLEXDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLLEXDOTOPT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$ac_pt_OCAMLLEXDOTOPT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLLEXDOTOPT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLLEXDOTOPT=$ac_cv_path_ac_pt_OCAMLLEXDOTOPT
+if test -n "$ac_pt_OCAMLLEXDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLLEXDOTOPT" >&5
+$as_echo "$ac_pt_OCAMLLEXDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLLEXDOTOPT" = x; then
+    OCAMLLEXDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLLEXDOTOPT=$ac_pt_OCAMLLEXDOTOPT
+  fi
+else
+  OCAMLLEXDOTOPT="$ac_cv_path_OCAMLLEXDOTOPT"
+fi
+
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+
+
+
+elif test "xpdflatex" = xocamlyacc -a "xPDFLATEX" = xOCAMLYACC; then :
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OCAMLYACC=$ac_cv_path_OCAMLYACC
+if test -n "$OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5
+$as_echo "$OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OCAMLYACC"; then
+  ac_pt_OCAMLYACC=$OCAMLYACC
+  # Extract the first word of "ocamlyacc", so it can be a program name with args.
+set dummy ocamlyacc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_OCAMLYACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_OCAMLYACC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_OCAMLYACC="$ac_pt_OCAMLYACC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_OCAMLYACC=$ac_cv_path_ac_pt_OCAMLYACC
+if test -n "$ac_pt_OCAMLYACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OCAMLYACC" >&5
+$as_echo "$ac_pt_OCAMLYACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_OCAMLYACC" = x; then
+    OCAMLYACC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLYACC=$ac_pt_OCAMLYACC
+  fi
+else
+  OCAMLYACC="$ac_cv_path_OCAMLYACC"
+fi
+
+
+
+
+else
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pdflatex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PDFLATEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PDFLATEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PDFLATEX="$PDFLATEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PDFLATEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PDFLATEX=$ac_cv_path_PDFLATEX
+if test -n "$PDFLATEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5
+$as_echo "$PDFLATEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PDFLATEX"; then
+  ac_pt_PDFLATEX=$PDFLATEX
+  # Extract the first word of "pdflatex", so it can be a program name with args.
+set dummy pdflatex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PDFLATEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PDFLATEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PDFLATEX="$ac_pt_PDFLATEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PDFLATEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PDFLATEX=$ac_cv_path_ac_pt_PDFLATEX
+if test -n "$ac_pt_PDFLATEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PDFLATEX" >&5
+$as_echo "$ac_pt_PDFLATEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PDFLATEX" = x; then
+    PDFLATEX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PDFLATEX=$ac_pt_PDFLATEX
+  fi
+else
+  PDFLATEX="$ac_cv_path_PDFLATEX"
+fi
+
+
+fi
+
+      SUBSTITUTED_PDFLATEX=yes
+
+
+fi
+
+fi
+
+    if test -z "$PDFLATEX"; then :
+  PDFLATEX=no
+
+fi
+
+
+
+
+# Check whether --enable-release was given.
+if test "${enable_release+set}" = set; then :
+  enableval=$enable_release;
+fi
+
+
+if test "x$OCAMLOPT" = xno; then :
+    if test "x$enable_release" = xyes; then :
+      as_fn_error $? "a release build is requested, but ocamlopt is not available" "$LINENO" 5
+
+fi
+
+  enable_release=no
+
+
+fi
+
+if test "x$OCAMLVERSION" = x3.11.2 -a "x$enable_release" != xyes; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: the optimized version of coccinelle will not be build by default due to OCaml version $OCAMLVERSION and --enable-build-all is not given to override this decision" >&5
+$as_echo "$as_me: the optimized version of coccinelle will not be build by default due to OCaml version $OCAMLVERSION and --enable-build-all is not given to override this decision" >&6;}
+  enable_release=no
+
+
+fi
+
+if test -z "$enable_release"; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: choosing the development Makefile configuration because the release configuration is not explicitly requested." >&5
+$as_echo "$as_me: choosing the development Makefile configuration because the release configuration is not explicitly requested." >&6;}
+  enable_release=no
+
+
+fi
+
+if test "x$enable_release" = xyes; then :
+    MAKETARGET_ALL=all-release
+
+
+elif test "x$enable_release" = xno; then :
+    MAKETARGET_ALL=all-dev
+
+
+else
+    MAKETARGET_ALL="$enable_release"
+
+
+fi
+
+if test "x$enable_release" != xno; then :
+  SPATCHNAME=spatch.opt
+else
+  SPATCHNAME=spatch
+fi
+
+
+
+ac_config_files="$ac_config_files Makefile.config"
+
+ac_config_files="$ac_config_files version.ml"
+
+ac_config_files="$ac_config_files commons/commands.ml"
+
+ac_config_files="$ac_config_files globals/config.ml"
+
+ac_config_files="$ac_config_files globals/regexp.ml"
+
+ac_config_files="$ac_config_files python/pycocci.ml"
+
+ac_config_files="$ac_config_files ocaml/prepare_ocamlcocci.ml"
+
+ac_config_files="$ac_config_files scripts/spatch.sh"
+
+ac_config_files="$ac_config_files docs/spatch.1"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[     `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+       g
+       s/^\n//
+       s/\n/ /g
+       p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by coccinelle $as_me `cat ./version`, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <cocci@diku.dk>.
+coccinelle home page: <http://coccinelle.lip6.fr/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+coccinelle config.status `cat ./version`
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
+    "version.ml") CONFIG_FILES="$CONFIG_FILES version.ml" ;;
+    "commons/commands.ml") CONFIG_FILES="$CONFIG_FILES commons/commands.ml" ;;
+    "globals/config.ml") CONFIG_FILES="$CONFIG_FILES globals/config.ml" ;;
+    "globals/regexp.ml") CONFIG_FILES="$CONFIG_FILES globals/regexp.ml" ;;
+    "python/pycocci.ml") CONFIG_FILES="$CONFIG_FILES python/pycocci.ml" ;;
+    "ocaml/prepare_ocamlcocci.ml") CONFIG_FILES="$CONFIG_FILES ocaml/prepare_ocamlcocci.ml" ;;
+    "scripts/spatch.sh") CONFIG_FILES="$CONFIG_FILES scripts/spatch.sh" ;;
+    "docs/spatch.1") CONFIG_FILES="$CONFIG_FILES docs/spatch.1" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+  esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: configuration completed" >&5
+$as_echo "$as_me: configuration completed" >&6;}
+
+cat << EOF
+------------------------------------------------------------------------------
+Summary
+
+findlib:          $OCAMLFIND
+menhir:           $MENHIR
+menhirLib module: $OCAML_PKG_menhirLib
+
+ocaml scripting:  $enable_ocaml
+python scripting: $enable_python
+pycaml module:    $enable_pycaml
+
+pcre regexes:     $enable_pcre_syntax
+pcre module:      $enable_pcre
+pcre library:     $HAVE_PCRE
+
+release config:   $enable_release
+
+EOF
+
+cat << EOF
+------------------------------------------------------------------------------
+Coccinelle can now be compiled and installed.
+
+
+If you compile coccinelle again after source code changes or
+configuration changes, you may need to run first:
+  \$ make clean
+
+To compile coccinelle, run:
+  \$ make all
+
+To install coccinelle, run:
+  \$ make install
+
+Then, to test coccinelle run for example:
+  \$ $SPATCHNAME -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
+EOF
+
+if test "x$enable_python" != "xno"; then
+cat << EOF
+------------------------------------------------------------------------------
+You may need to set some environment variables so that the python
+libraries are found. The frontend 'spatch' sets the following variables:
+
+  \$ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$prefix/lib
+  \$ export PYTHONPATH=\$PYTHONPATH:$prefix/share/coccinelle/python
+
+EOF
+fi
+
+cat << EOF
+------------------------------------------------------------------------------
+EOF
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..47fb518
--- /dev/null
@@ -0,0 +1,473 @@
+dnl  standard initialization (we only use autoconf not automake)
+AC_INIT([coccinelle], [`cat ./version`], [cocci@diku.dk], [], [http://coccinelle.lip6.fr/])
+AC_SUBST([COCCI_VERSION], [$(cat ./version)])
+AC_SUBST([COCCI_SRCDIR], [$(pwd)])
+AC_MSG_NOTICE([configuring coccinelle $COCCI_VERSION in $COCCI_SRCDIR])
+
+AC_CONFIG_SRCDIR([cocci.ml])    dnl  this file must be present in our src directory
+AC_COCCI_CONFVERSION
+
+dnl  reminder that this configure depends on macros generated by aclocal
+AC_MSG_NOTICE([this configure program uses pkg-config m4 macros])
+AC_MSG_NOTICE([this configure program uses ocaml m4 macros (see setup/ocaml.m4)])
+AC_MSG_NOTICE([this configure program uses custom m4 macros (see setup/cocci.m4)])
+AC_MSG_NOTICE([some fake substitutions for required but unavailable programs may be used (see setup/fake*)])
+
+
+dnl
+dnl  Note: the conditionals in this configure script are tricky.
+dnl  The approach taken here is that many tools can be enabled/disabled
+dnl  and paths can be given explicitly via commandline parameters or
+dnl  environment variables.
+dnl
+
+
+dnl
+dnl  Basic tools
+dnl
+
+AC_MSG_NOTICE([verifying basic tools])
+
+AC_PROG_INSTALL
+AC_PROG_MKDIR_P
+AC_PROG_CPP
+AC_PATH_PROG([TAR],[tar])
+AC_PATH_PROG([PATCH],[patch])
+
+dnl  pkg config is required
+AC_COCCI_TOOL([PKG_CONFIG],[pkg-config],[$COCCI_SRCDIR/setup/fake-subst.sh pkg-config])
+AS_IF([test "x$PKG_CONFIG" = xno],
+[dnl
+  AC_MSG_ERROR([A suitable pkg-config could not be found.])
+])
+
+dnl  ocaml compile
+AC_PROG_OCAML
+AC_CHECK_OCAMLVERSION([OCAMLATLEAST310],[3.10])
+AC_CHECK_OCAMLVERSION([OCAMLATLEAST311],[3.11])
+
+AS_IF([test "x$OCAMLC" = xno -o "x$OCAMLDEP" = xno -o "x$OCAMLDOC" = xno -o "x$OCAMLMKLIB" = xno],
+[dnl
+  AC_MSG_ERROR([You must install the OCaml compiler])
+])
+AS_IF([test "x$OCAMLATLEAST310" = xno],[AC_MSG_NOTICE([a more recent OCaml installation may be required])])
+
+dnl  ocaml tools
+AC_PROG_CAMLP4
+AC_COCCI_TOOL([OCAMLLEX],[ocamllex],[])
+AC_COCCI_TOOL([OCAMLYACC],[ocamlyacc],[])
+AC_COCCI_TOOL([OCAMLFIND],[ocamlfind],[$COCCI_SRCDIR/setup/fake-subst.sh ocamlfind])
+
+dnl  enforce ocaml tool requirements
+AS_IF([test "x$OCAMLLEX" = xno],
+[dnl
+  AC_MSG_ERROR([the OCaml Lexer needs to be installed (the ocamllex command). It should be part of your OCaml distribution.])
+])
+
+AS_IF([test "x$OCAMLYACC" = xno],
+[dnl
+  AC_MSG_ERROR([The OCaml parser generated needs to be installed (the ocamlyacc command). It should be part of your OCaml distribution.])
+])
+
+AS_IF([test "x$OCAMLFIND" = xno],
+[dnl
+  AC_MSG_ERROR([A suitable OCaml findlib (the ocamlfind command) could not be found.])
+])
+
+dnl  these variables are substituted for in the code: this guarantees a default for them.
+AC_COCCI_RUNTIME_CMD([OCAMLFIND],[ocamlfind])
+AC_COCCI_RUNTIME_CMD([OCAMLC],[ocamlc])
+AC_COCCI_RUNTIME_CMD([OCAMLOPT],[ocamlopt])
+AC_COCCI_RUNTIME_CMD([OCAMLDEP],[ocamldep])
+AC_COCCI_RUNTIME_CMD([CAMLP4],[camlp4])
+AC_COCCI_RUNTIME_CMD([CAMLP4O],[camlp4o])
+
+AC_CACHE_SAVE
+
+
+dnl
+dnl  Basic ocaml modules
+dnl
+
+AC_MSG_NOTICE([verifying basic ocaml modules])
+
+dnl  default dir with the bundled ocaml packages
+AC_COCCI_SET_EXTERNAL_DIR([$COCCI_SRCDIR/bundles])
+
+dnl  set some defaults
+dnl  add a line for each package that is
+dnl  configured via AC_CHECK_COCCI_EXTPKG
+dnl  or AC_REQ_COCCI_EXTPKG
+AC_COCCI_INIT_PKG_EMPTY([sexplib])
+AC_COCCI_INIT_PKG_EMPTY([menhirLib])
+AC_COCCI_INIT_PKG_EMPTY([extlib])
+AC_COCCI_INIT_PKG_EMPTY([dynlink])
+AC_COCCI_INIT_PKG_EMPTY([pcre])
+AC_COCCI_INIT_PKG_EMPTY([pycaml])
+AC_COCCI_INIT_PKG_EMPTY([camlp4])
+
+dnl  required ocaml packages
+AC_MSG_NOTICE([the following OCaml packages should be provided by your ocaml installation])
+AC_REQ_COCCI_STDPKG([unix])
+AC_REQ_COCCI_STDPKG([bigarray])
+AC_REQ_COCCI_STDPKG([num])
+AC_REQ_COCCI_STDPKG([str])
+AC_REQ_COCCI_STDPKG([threads])
+
+dnl  required modules (Some are available locally too)
+AC_REQ_COCCI_EXTPKG([dynlink])
+AC_REQ_COCCI_EXTPKG([camlp4])
+AC_REQ_COCCI_EXTPKG([sexplib])
+AC_REQ_COCCI_EXTPKG([menhirLib])
+AC_REQ_COCCI_EXTPKG([extlib])
+
+
+AC_CACHE_SAVE
+
+
+dnl
+dnl  Handling of optional features
+dnl
+
+AC_MSG_NOTICE([verifying optional features])
+
+
+dnl  menhir handling
+dnl  variables:
+dnl    with_menhir: whether or not menhir must be used
+AC_COCCI_TOOL([MENHIR],[menhir],[$COCCI_SRCDIR/setup/fake-menhir.sh menhir])
+AS_IF([test "x$SUBSTITUTED_MENHIR" = xyes],
+[dnl
+  AC_MSG_NOTICE([pregenerated parsers will be required as substitute for Menhir])
+])
+
+
+dnl  ocaml script handling
+dnl  variables:
+dnl    enable_ocaml: whether to enable ocaml scripts
+AC_ARG_ENABLE([ocaml], AS_HELP_STRING([--enable-ocaml], [enable ocaml scripting (default: auto)]))
+AS_IF([test "x$OCAML_PKG_dynlink" = xno],
+[dnl
+  AS_IF([test -z "$enable_ocaml"],
+  [dnl
+    AC_SUBST([enable_ocaml],[no])
+    AC_MSG_NOTICE([ocaml scripting is disabled because the 'dynlink' package is not installed])
+  ], [test "x$enable_ocaml" != xno],
+  [dnl
+    AC_MSG_ERROR([the OCaml package dynlink is required for ocaml scripting])
+  ])
+])
+
+dnl  too old ocaml version, disable dynlink by default
+AS_IF([test "x$OCAMLATLEAST311" = xno],
+[dnl
+  AC_SUBST([enable_ocaml],[no])
+  AC_MSG_NOTICE([ocaml scripting has been disabled because your OCaml version may not support dynamic linking properly])
+])
+
+dnl  scripting requirement on ocamlfind
+AS_IF([test -n "$SUBSTITUTED_OCAMLFIND"],
+[dnl
+  AS_IF([test -z "$enable_ocaml"],
+  [dnl  this is perhaps a bit too strict
+    AC_SUBST([enable_ocaml],[no])
+    AC_MSG_NOTICE([ocaml scripting is disabled because it depends on ocamlfind])
+  ], [test "x$enable_ocaml" != xno],
+  [dnl
+    AC_MSG_NOTICE([warning: ocamlfind is not found but may be required if ocaml scripts are used])
+  ])
+])
+
+dnl  scripting requirement on camlp4
+AS_IF([test "x$CAMLP4" = xno],
+[dnl
+  AS_IF([test -z "$enable_ocaml"],
+  [dnl  this is perhaps a bit too strict
+    AC_SUBST([enable_ocaml],no)
+    AC_MSG_NOTICE([ocaml scripting is disabled because it depends on camlp4])
+  ], [test "x$enable_ocaml" != xno],
+  [dnl
+    AC_MSG_NOTICE([warning: camlp4 is not found but may be required if ocaml scripts are used])
+  ])
+])
+
+AS_IF([test "x$enable_ocaml" = xno],
+[dnl
+  AC_COCCI_INIT_PKG_EMPTY([dynlink])    dnl  prevent linking with it
+  AC_SUBST(OCAMLCOCCI_MODULE,[No_prepare_ocamlcocci])
+  AC_SUBST(OCAMLCOCCI_FILE,[no_prepare_ocamlcocci.ml])
+],
+[dnl
+  AC_SUBST([enable_ocaml],[yes])
+  AC_SUBST(OCAMLCOCCI_MODULE,[Yes_prepare_ocamlcocci])
+  AC_SUBST(OCAMLCOCCI_FILE,[yes_prepare_ocamlcocci.ml])
+])
+
+
+dnl  python handling
+dnl  variables:
+dnl    with_python: whether to enable the python feature (and what version)
+dnl    OCAML_PKG_pycaml: if "local" use local pycaml package
+AC_ARG_VAR([PYTHON], [path to python when the version is determined automatically])
+AC_ARG_ENABLE([python], [AS_HELP_STRING([--enable-python], [enable python scripting (yes/no) (default: auto)])])
+AS_IF([test "x$enable_python" != xno],
+[dnl
+  dnl  an explicitly set --with-python disablees by default the global pycaml
+  AS_IF([test -n "$enable_python" -a -z "$enable_pycaml"],
+  [dnl  if explicit python given: 
+    AC_MSG_NOTICE([skipped the selection of a global pycaml module because --enable-python is given explicitly but --enable-pycaml is not.])
+    AC_SUBST([enable_pycaml],[no])
+  ])
+
+  dnl  sets "$PYVER" if python is available
+  AC_COCCI_PYVER
+
+  AS_IF([test -z "$PYVER"],
+  [dnl  PYVER undetermined
+    AS_IF([test "x$enable_python" = xyes],
+    [dnl
+      AC_MSG_ERROR([python scripting is enabled explicitly but the version of python could not be determined])
+    ])
+  ],
+  [dnl
+    PKG_CHECK_MODULES([PYTHON], [python-$PYVER],[AC_SUBST(HAVE_PYTHON,[yes])],[AC_SUBST(HAVE_PYTHON,[no])])
+
+    AS_IF([test "x$HAVE_PYTHON" != xyes -a "x$enable_python" != xyes],
+    [dnl  fallback if the above failed
+      AC_MSG_NOTICE([trying the default python version as fallback])
+      PKG_CHECK_MODULES([PYTHON], [python],[AC_SUBST(HAVE_PYTHON,[yes])],[AC_SUBST(HAVE_PYTHON,[no])])
+    ])
+  ])
+])
+
+AS_IF([test -z "$enable_python"],
+[dnl
+  AS_IF([test "x$HAVE_PYTHON" = xyes],
+  [dnl
+    AC_SUBST([enable_python],[yes])
+  ],
+  [dnl
+    AC_SUBST([enable_python],[no])
+  ])
+])
+
+AS_IF([test "x$enable_python" != xno],
+[dnl
+  AS_IF([test "x$HAVE_PYTHON" = xyes],
+  [dnl
+    AC_MSG_NOTICE([support for python scripts is enabled])
+  ],
+  [dnl
+    AC_MSG_ERROR([the python scripts feature is enabled but the pkg-config python library is not found])
+  ])
+
+  AC_REQ_COCCI_EXTPKG([pycaml])
+  AC_SUBST([PYCOCCI_MODULE], [Yes_pycocci])
+  AC_SUBST([PYCOCCI_FILE],[yes_pycocci.ml])
+],
+[dnl
+  AC_COCCI_INIT_PKG_EMPTY([pycaml])
+  AC_SUBST([PYCOCCI_MODULE], [No_pycocci])
+  AC_SUBST([PYCOCCI_FILE],[no_pycocci.ml])
+])
+
+
+dnl  pcre handling
+dnl  variables:
+dnl    enable_pcre: whether to enable the pcre feature
+dnl    OCAML_PKG_pcre: if "local" use str package
+AC_ARG_ENABLE([pcre-syntax], AS_HELP_STRING([--enable-pcre-syntax], [enable pcre regular expression syntax (default: auto)]))
+AS_IF([test "x$enable_pcre_syntax" != "xno"],
+[dnl
+  PKG_CHECK_MODULES([PCRE], [libpcre],[AC_SUBST([HAVE_PCRE],[yes])],[AC_SUBST([HAVE_PCRE],[no])])
+  AS_IF([test -z "$enable_pcre_syntax" -a "x$HAVE_PCRE" != xyes],
+  [dnl
+    AC_SUBST([enable_pcre_syntax],[no])
+  ],
+  [dnl
+    AC_CHECK_COCCI_EXTPKG([pcre])  dnl  will set $enable_pcre to 'yes', 'no', or 'local'
+    enable_pcre_syntax=$enable_pcre
+  ])
+])
+
+AS_IF([test "x$enable_pcre_syntax" != xno],
+[dnl
+  AS_IF([test "x$HAVE_PCRE" = xyes],
+  [dnl
+    AC_MSG_NOTICE([support for pcre syntax is enabled])
+  ],
+  [dnl
+    AC_MSG_ERROR([the pcre feature is enabled but the pkg-config libpcre library is not found])
+  ])
+
+  AC_SUBST([REGEXP_MODULE], [Regexp_pcre])
+  AC_SUBST([REGEXP_FILE], [regexp_pcre.ml])
+],
+[dnl
+  AC_COCCI_INIT_PKG_EMPTY([pcre])
+  AC_SUBST([REGEXP_MODULE], [Regexp_str])
+  AC_SUBST([REGEXP_FILE], [regexp_str.ml])
+])
+
+
+AC_CACHE_SAVE
+
+
+dnl  obtain the value of $prefix
+AS_IF([test "$prefix" = "NONE"],[prefix=$ac_default_prefix])
+
+
+dnl
+dnl  backwards compatibility
+dnl
+
+dnl  defines some variables needed by the Make infrastructure
+AC_SUBST(SHAREDIR,["${prefix}/share/coccinelle"])
+
+AS_IF([test "x$enable_python" != xno],
+[dnl
+  AC_SUBST(FEATURE_PYTHON,[1])
+],
+[dnl
+  AC_SUBST(FEATURE_PYTHON,[0])
+])
+
+AS_IF([test "x$enable_ocaml" != xno],
+[dnl
+  AC_SUBST(FEATURE_OCAML,[1])
+],
+[dnl
+  AC_SUBST(FEATURE_OCAML,[0])
+])
+
+dnl  dynlink stuff depending on the OCaml version and whether it is enabled
+AS_IF([test "x$OCAMLATLEAST311" = xyes -a "x$enable_ocaml" = xyes],
+[dnl
+  AC_SUBST([DYNLINK_IS_NATIVE],[Dynlink.is_native])
+],
+[dnl
+  AC_SUBST([DYNLINK_IS_NATIVE],[false])
+])
+
+dnl  in case of the compilation of the manual
+AC_COCCI_TOOL([PDFLATEX],[pdflatex],[$COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex])
+
+
+dnl
+dnl  determine the default make target
+dnl  if ocamlopt is availabe, the default is both
+dnl  the bytecode version and the optimized version
+dnl  of coccinelle.
+dnl
+
+AC_ARG_ENABLE([release], [AS_HELP_STRING([--enable-release], [build with a release configuration (yes,no, default: no)])])
+
+AS_IF([test "x$OCAMLOPT" = xno],
+[dnl
+  AS_IF([test "x$enable_release" = xyes],
+  [dnl
+    AC_MSG_ERROR([a release build is requested, but ocamlopt is not available])
+  ])
+
+  AC_SUBST([enable_release],[no])
+])
+
+AS_IF([test "x$OCAMLVERSION" = x3.11.2 -a "x$enable_release" != xyes],
+[dnl  the optimized version may not be buildable with ocaml 3.11.2 (know bug), hence disable it by default
+  AC_MSG_NOTICE([the optimized version of coccinelle will not be build by default due to OCaml version $OCAMLVERSION and --enable-build-all is not given to override this decision])
+  AC_SUBST([enable_release],[no])
+])
+
+AS_IF([test -z "$enable_release"],
+[dnl
+  AC_MSG_NOTICE([choosing the development Makefile configuration because the release configuration is not explicitly requested.])
+  AC_SUBST([enable_release], [no])
+])
+
+AS_IF([test "x$enable_release" = xyes],
+[dnl  include the optimized version by default
+  AC_SUBST([MAKETARGET_ALL], [all-release])
+], [test "x$enable_release" = xno],
+[dnl  otherwise, exclude the optimized version
+  AC_SUBST([MAKETARGET_ALL], [all-dev])
+],
+[dnl  custom target given
+  AC_SUBST([MAKETARGET_ALL], ["$enable_release"])
+])
+
+dnl  which spatch will be constructed
+AS_IF([test "x$enable_release" != xno],[SPATCHNAME=spatch.opt],[SPATCHNAME=spatch])
+
+
+dnl
+dnl  generating configuration
+dnl
+
+AC_CONFIG_FILES([Makefile.config])
+AC_CONFIG_FILES([version.ml])
+AC_CONFIG_FILES([commons/commands.ml])
+AC_CONFIG_FILES([globals/config.ml])
+AC_CONFIG_FILES([globals/regexp.ml])
+AC_CONFIG_FILES([python/pycocci.ml])
+AC_CONFIG_FILES([ocaml/prepare_ocamlcocci.ml])
+AC_CONFIG_FILES([scripts/spatch.sh])
+AC_CONFIG_FILES([docs/spatch.1])
+
+AC_OUTPUT
+
+AC_MSG_NOTICE([configuration completed])
+
+cat << EOF
+------------------------------------------------------------------------------
+Summary
+
+findlib:          $OCAMLFIND
+menhir:           $MENHIR
+menhirLib module: $OCAML_PKG_menhirLib
+
+ocaml scripting:  $enable_ocaml
+python scripting: $enable_python
+pycaml module:    $enable_pycaml
+
+pcre regexes:     $enable_pcre_syntax
+pcre module:      $enable_pcre
+pcre library:     $HAVE_PCRE
+
+release config:   $enable_release
+
+EOF
+
+cat << EOF
+------------------------------------------------------------------------------
+Coccinelle can now be compiled and installed.
+
+
+If you compile coccinelle again after source code changes or
+configuration changes, you may need to run first:
+  \$ make clean
+
+To compile coccinelle, run:
+  \$ make all
+
+To install coccinelle, run:
+  \$ make install
+
+Then, to test coccinelle run for example:
+  \$ $SPATCHNAME -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
+EOF
+
+if test "x$enable_python" != "xno"; then
+cat << EOF
+------------------------------------------------------------------------------
+You may need to set some environment variables so that the python
+libraries are found. The frontend 'spatch' sets the following variables:
+
+  \$ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$prefix/lib
+  \$ export PYTHONPATH=\$PYTHONPATH:$prefix/share/coccinelle/python
+
+EOF
+fi
+
+cat << EOF
+------------------------------------------------------------------------------
+EOF
index e087b66..9f99a5a 100644 (file)
@@ -22,9 +22,9 @@
 # Coccinelle under other licenses.
 
 
-#note: if you add a file (a .mli or .ml), dont forget to do a   make depend
-
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET=ctl
 
@@ -40,12 +40,10 @@ INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals
 #for warning:  -w A
 #for profiling:  -p -inline 0   with OCAMLOPT
 OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 LIB=$(TARGET).cma
 OPTLIB=$(LIB:.cma=.cmxa)
@@ -57,13 +55,13 @@ all: $(LIB)
 all.opt: $(OPTLIB)
 
 $(TARGET).top: $(LIB) test_ctl.cmo
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo
 
 $(LIB):  $(OBJS)
-       $(OCAMLC) -a -o $(LIB) $(OBJS)
+       $(OCAMLC_CMD) -a -o $(LIB) $(OBJS)
 
 $(OPTLIB): $(OPTOBJS)
-       $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS)
 
 clean::
        rm -f $(LIB)  $(OPTLIB) $(LIB:.cma=.a) $(TARGET).top
@@ -73,29 +71,29 @@ clean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .ml.cmx:
-       $(OCAMLOPT) -c $<
-
+       $(OCAMLOPT_CMD) -c $<
 
 
-
-# clean rule for others files
+# clean rule for other files
 clean::
        rm -f *.cm[iox] *.o *.annot
        rm -f *~ .*~ #*#
-
-depend:
-       $(OCAMLDEP) *.mli *.ml > .depend
-
-distclean::
        rm -f .depend
 
-.depend:
-       $(OCAMLDEP) *.mli *.ml > .depend
+distclean: clean
+
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 191dace..80dc4c8 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast_ctl.ml"
 
 (* ---------------------------------------------------------------------- *)
 (* Types                                                                  *)
index c2b274c..6f329b5 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctl_engine.ml"
 (*external c_counter : unit -> int = "c_counter"*)
 let timeout = 800
 (* Optimize triples_conj by first extracting the intersection of the two sets,
index dca8b6e..797223d 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctl_engine.mli"
 open Ast_ctl
 
 module type SUBST =
index 2704ee8..62a0144 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag_ctl.ml"
 (* option -verbose_ctl_engine *)
 let verbose_ctl_engine = ref false
 
index 4eb36bb..1a394ee 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_ctl.ml"
 open Common
 open Format
 
index 0755993..d2cea7a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_ctl.mli"
 
 val pp_ctl:
  ('pred -> unit) * ('mvar -> unit) -> bool (* inline_let_def *) ->
index aafb47b..d57f4e8 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./test_ctl.ml"
 
 (* ********************************************************************** *)
 (* Module: EXAMPLE_ENGINE (instance of CTL_ENGINE)                        *)
index 067317c..b85115a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./wrapper_ctl.ml"
 (* **********************************************************************
  *
  * Wrapping for FUNCTORS and MODULES
index b33021a..b6ad3ab 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./wrapper_ctl.mli"
 type info = int
 
 type ('pred, 'mvar) wrapped_ctl =
index 8bbcd1f..233871f 100644 (file)
@@ -2,15 +2,18 @@ SUBDIR=manual
 
 .PHONY: all clean distclean spatch.1
 
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
-all:: spatch.1
+all: spatch.1
+       $(MAKE) -C $(SUBDIR) $@
 
-spatch.1: spatch.1.in
-       sed "s|SHAREDIR|$(SHAREDIR)|g" $^ > $@
-
-clean distclean::
+distclean:
+       $(MAKE) -C manual distclean
        rm -f spatch.1
+       rm -rf ./html
+       rm -rf ./man
 
-all clean distclean::
-       make -C $(SUBDIR) $@
+clean:
+       $(MAKE) -C $(SUBDIR) $@
index f367e06..189ecef 100644 (file)
@@ -2,8 +2,13 @@
 # Variables
 ##############################################################################
 
+ifneq ($(MAKECMDGOALS),distclean)
+include ../../Makefile.config
+endif
+
 MAINSRC=main.tex
 SRC=$(wildcard *.tex)
+PDFLATEX_CMD=$(PDFLATEX) -halt-on-error
 
 #tools:
 # latex, pdflatex
@@ -21,20 +26,16 @@ SRC=$(wildcard *.tex)
 all: manual.pdf main_grammar.pdf options.pdf
 
 manual.pdf: $(SRC)
-       pdflatex main.tex
-       pdflatex main.tex
-       mv main.pdf manual.pdf
+       $(PDFLATEX_CMD) manual.tex
+       $(PDFLATEX_CMD) manual.tex
 
 main_grammar.pdf: main_grammar.tex cocci_syntax.tex  macros_listing_cocci.tex macros_grammar.tex macros_common.tex examples.tex tips.tex
-       pdflatex main_grammar.tex
-       pdflatex main_grammar.tex
-
-main_options.pdf: main_options.tex spatch_options.tex   macros_options.tex
-       pdflatex main_options.tex
-       pdflatex main_options.tex
+       $(PDFLATEX_CMD) main_grammar.tex
+       $(PDFLATEX_CMD) main_grammar.tex
 
-options.pdf: main_options.pdf
-       mv main_options.pdf options.pdf
+options.pdf: main_options.tex spatch_options.tex   macros_options.tex
+       $(PDFLATEX_CMD) options.tex
+       $(PDFLATEX_CMD) options.tex
 
 distclean:: clean
        rm -f manual.pdf cocci_syntax.pdf options.pdf
@@ -124,7 +125,7 @@ LATEXDIFFOPT=--type=CTRADITIONAL
 #if multi files ? sed sur les \input{} ? ou create in another dir ?
 latexdiff:
        latexdiff $(LATEXDIFFOPT) main-old.tex main.tex > main-diff.tex
-       make MAINSRC=main-diff
+       $(MAKE) MAINSRC=main-diff
        rm -f main-diff.aux
 
 replacediff:
index 3879ee5..a9ca1b9 100644 (file)
@@ -4,5 +4,5 @@
 \newcommand{\cpp}{\texttt{cpp}\xspace}
 
 
-\newcommand{\cocciversion}{1.0.0-rc9\xspace}
+\newcommand{\cocciversion}{\input{../../version}\xspace}
 
index 3a529fd..657fd00 100644 (file)
Binary files a/docs/manual/main_grammar.pdf and b/docs/manual/main_grammar.pdf differ
index 56aefab..109adb0 100644 (file)
Binary files a/docs/manual/manual.pdf and b/docs/manual/manual.pdf differ
diff --git a/docs/manual/manual.tex b/docs/manual/manual.tex
new file mode 100644 (file)
index 0000000..482072c
--- /dev/null
@@ -0,0 +1,4 @@
+\input{main.tex}
+
+% Thisis just a placeholder for the actual contents of the manual.
+% Todo: replace this file with 'main.tex'?
index 5f0afc3..a362825 100644 (file)
Binary files a/docs/manual/options.pdf and b/docs/manual/options.pdf differ
diff --git a/docs/manual/options.tex b/docs/manual/options.tex
new file mode 100644 (file)
index 0000000..3b66c06
--- /dev/null
@@ -0,0 +1,4 @@
+\input{main_options.tex}
+
+% This is just a placeholder for 'main_options.tex'
+% Todo: actually replace this file with 'main_options.tex'?
index d06b882..7d5340f 100644 (file)
@@ -61,10 +61,10 @@ the semantic patch file
 process all files in directory recursively
 .TP
 .B -iso_file            \fI<file>\fP
-(default=SHAREDIR/standard.iso)
+(default=@SHAREDIR@/standard.iso)
 .TP
 .B -macro_file          \fI<file>\fP
-(default=SHAREDIR/standard.h)
+(default=@SHAREDIR@/standard.h)
 .TP
 .B -debug        
 print some information to help debug the matching process
@@ -118,7 +118,7 @@ show summary of options.
 Apply the semantic patch foo.cocci to the C file foo.c.  The semantic patch
 is applied modulo a set of isomorphisms contained in standard.iso
 (standard.iso is by default located in
-SHAREDIR/standard.iso).  A patch showing the effect of
+@SHAREDIR@/standard.iso).  A patch showing the effect of
 the application, if any, will be generated on the standard output.
 
   ./spatch -sp_file foo.cocci foo.c -o /tmp/newfoo.c
@@ -136,18 +136,18 @@ shows selection of information about the application of
 a semantic patch to a file or directory.
 
 .SH FILES
-.I SHAREDIR/standard.iso
+.I @SHAREDIR@/standard.iso
 .RS
 This file contains the default set of isomorphisms.
 .RE
-.I SHAREDIR/standard.h
+.I @SHAREDIR@/standard.h
 .RS
 This file contains the default set of macro hints.
 
 .SH ENVIRONMENT
 .IP COCCINELLE_HOME
 The path to the Coccinelle share directory. Default is 
-.I SHAREDIR
+.I @SHAREDIR@
 
 .SH REFERENCES
 Y. Padioleau, J.L. Lawall, R.R Hansen, G. Muller
index fe3ac10..9ff6b58 100644 (file)
@@ -26,7 +26,9 @@
 # Variables
 ##############################################################################
 #TARGET=matcher
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET=cocciengine
 CTLTARGET=engine
@@ -39,14 +41,6 @@ SRC= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \
       asttomember.ml asttoctl2.ml ctltotex.ml \
       postprocess_transinfo.ml ctlcocci_integration.ml
 
-#c_vs_c.ml
-#SRC= flag_matcher.ml \
-#  c_vs_c.ml cocci_vs_c.ml \
-#  lib_engine.ml \
-#  pattern_c.ml transformation_c.ml
-
-#LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma
-#INCLUDES= -I ../commons -I ../parsing_c
 INCLUDES = -I ../commons -I ../commons/ocamlextra -I ../globals \
               -I ../ctl -I ../parsing_cocci -I ../parsing_c
 LIBS=../commons/commons.cma ../globals/globals.cma \
@@ -67,13 +61,10 @@ SYSLIBS= str.cma unix.cma
 #for profiling:  -p -inline 0   with OCAMLOPT
 OCAMLCFLAGS ?= -g -dtypes
 
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLLEX=ocamllex$(OPTBIN) #-ml
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDESDEP)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 OBJS = $(SRC:.ml=.cmo)
 OPTOBJS = $(SRC:.ml=.cmx)
@@ -86,13 +77,13 @@ all: $(TARGET).cma
 all.opt: $(TARGET).cmxa
 
 $(TARGET).cma: $(OBJS)
-       $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
+       $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
 
 $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
 
 $(TARGET).top: $(OBJS) $(LIBS)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 clean::
        rm -f $(TARGET).top
@@ -110,25 +101,28 @@ clean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
 clean::
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
        rm -f *~ .*~ gmon.out #*#
-
-distclean::
        rm -f .depend
 
-beforedepend::
+distclean: clean
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index a885e0e..d9431e3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttoctl.ml"
 (* true = don't see all matched nodes, only modified ones *)
 let onlyModif = ref true(*false*)
 (* set to true for line numbers in the output of ctl_engine *)
index 8a1b7a6..00859ab 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttoctl.mli"
 type cocci_predicate = Lib_engine.predicate * string Ast_ctl.modif
 type formula =
     (cocci_predicate,string, Wrapper_ctl.info) Ast_ctl.generic_ctl
index 8d85543..e4fe229 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttoctl2.ml"
 (* for MINUS and CONTEXT, pos is always None in this file *)
 (*search for require*)
 (* true = don't see all matched nodes, only modified ones *)
index 56c353b..f869d67 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttoctl2.mli"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type top_formula = NONDECL of Lib_engine.ctlcocci | CODE of Lib_engine.ctlcocci
 
index 739b4b7..0de4df3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttomember.ml"
 (* on the first pass, onlyModif is true, so we don't see all matched nodes,
 only modified ones *)
 
index 0683f90..0e66eaa 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./asttomember.mli"
 val asttomember : Ast_cocci.rule -> Ast_cocci.meta_name list list ->
   (Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif) list list list
index e82e717..e4d6581 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./c_vs_c.ml"
 open Common
 
 open Ast_c
index 84151cf..8712216 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./c_vs_c.mli"
 val eq_type : Ast_c.fullType -> Ast_c.fullType -> bool
 val merge_type : Ast_c.fullType -> Ast_c.fullType -> Ast_c.fullType
 
index 260397d..3a209d6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./check_exhaustive_pattern.ml"
 
 (* Just to warn me when there is some news in the types in
  * ast_cocci.ml or even ast_c.ml, so that I can then adjust my code in
index 9dfe82e..20ee731 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./check_reachability.ml"
 (* ---------------------------------------------------------------- *)
 (* code to check for ambiguities *)
 
index 3fc241e..d5aa86c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./check_reachability.mli"
 type witness =
     (Ograph_extended.nodei, unit,
      (Ograph_extended.nodei, unit, unit) Ast_ctl.generic_ctl list)
index 8dae6dc..e8786c0 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./cocci_vs_c.ml"
 open Common
 
 module A = Ast_cocci
index 8f3d482..c63c50c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./cocci_vs_c.mli"
 (*****************************************************************************)
 (* Cocci vs C *)
 (*****************************************************************************)
index 54b6f60..e363c86 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctlcocci_integration.ml"
 open Common
 
 open Ograph_extended
@@ -149,8 +150,8 @@ let (labels_for_ctl: string list (* dropped isos *) ->
          (* cases where it it not safe to put something on the outer side
             of braces *)
          (match node with
-           F.FunHeader _ | F.DoHeader _ | F.TrueNode | F.Else _
-         | F.InLoopNode (* while, for *) | F.SwitchHeader _ ->
+           F.FunHeader _ | F.DoHeader _ | F.TrueNode | F.Else _
+         | F.InLoopNode (* while, for *) | F.SwitchHeader _ ->
              [nodei, (p,[])]
          | _ -> [])
 
index a3aaac2..9c75cf3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctlcocci_integration.mli"
 open Ograph_extended
 
 val labels_for_ctl :
index d2f453d..4e6410b 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctltotex.ml"
 module CTL = Ast_ctl
 
 let prelude =
index e22a3ad..3150fd4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ctltotex.mli"
 val totex :
   string ->
     Ast_cocci.rule list ->
index 6e94c93..6053bd9 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag_engine.ml"
 let debug_engine = ref false
 
 (* false = simpler formulas, only for debugging *)
index e02011b..b622d92 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag_matcher.ml"
 let debug_engine = ref false
 let verbose_matcher = ref true
 
index 22aced1..e154c82 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./isomorphisms_c_c.ml"
 open Common
 
 (* When in a semantic patch there is f(X) ... f(X) we want to force
index 0d12801..42473b1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./lib_engine.ml"
 open Ograph_extended
 
 (*****************************************************************************)
index f85ac5b..609dbef 100644 (file)
@@ -24,3 +24,4 @@
  *)
 
 
+# 0 "./lib_matcher_c.ml"
index f85ac5b..c0c34ea 100644 (file)
@@ -24,3 +24,4 @@
  *)
 
 
+# 0 "./lib_matcher_c.mli"
index c2c759f..bfb3eed 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./main.ml"
 (* ----------------------------------------------------------------------- *)
 (* Entry point *)
 
index 3757dc8..1bd8773 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pattern_c.ml"
 open Common
 
 module Flag_engine = Flag_matcher
index 0289a17..22c67de 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pattern_c.mli"
 
 val match_re_node :
   string list (* dropped isos *) ->
index 049b785..85cfd97 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./postprocess_transinfo.ml"
 (* two goals: first drop from the environments things that are not used,
    and second prompt for the names of fresh variables that are used *)
 
index a63b44b..e5ea495 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./postprocess_transinfo.mli"
 val process :
     Ast_cocci.meta_name list (* used after *) ->
       (Ast_cocci.meta_name * Lib_engine.metavar_binding_kind2) list
index cc73a50..93ce733 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_engine.ml"
 open Common.Infix
 
 open Lib_engine
index 437d371..b5a0183 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_engine.mli"
 (* could be in pretty_print_c because dependent of ast_c but metavars
  * are in ast_c for "bad" reason, so better put the pretty_print
  * of metavars here
index c5689b0..0b6d50c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./sgrep.ml"
 (* no longer used *)
 
 type marker =
index 464f92b..bdce849 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./transformation_c.ml"
 open Common
 
 module F = Control_flow_c
index a55ce20..71d0d38 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./transformation_c.mli"
 (* note that now we do the transformation via side effect on ast *)
 val transform :
   string (* rule name *) -> string list (* dropped isos *) ->
index 4ebb12d..8e0338f 100644 (file)
@@ -1,4 +1,6 @@
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET=extra
 
@@ -12,64 +14,61 @@ INCLUDES= -I ../commons -I ../globals -I  ../parsing_cocci -I  ../parsing_c
 #for warning:  -w A
 #for profiling:  -p -inline 0   with OCAMLOPT
 OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDESDEP)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 OBJS = $(SOURCES:.ml=.cmo)
 OPTOBJS = $(SOURCES:.ml=.cmx)
 
-
 all: $(TARGET).cma
 
 all.opt: $(TARGET).cmxa
 
 $(TARGET).byte: $(OBJS) $(LIBS)
-       $(OCAMLC) -o $(TARGET).byte $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLC_CMD) -o $(TARGET).byte $(SYSLIBS) $(LIBS) $(OBJS)
 
 $(TARGET).opt: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -o $(TARGET).opt   $(SYSLIBS:.cma=.cmxa) $(LIBS:.cma=.cmxa)  $(OPTOBJS)
+       $(OCAMLOPT_CMD) -o $(TARGET).opt   $(SYSLIBS:.cma=.cmxa) $(LIBS:.cma=.cmxa)  $(OPTOBJS)
 
 $(TARGET).cma: $(OBJS)
-       $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
+       $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
 
 $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
 
 $(TARGET).top: $(OBJS) $(LIBS)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 clean::
        rm -f $(TARGET).byte $(TARGET).opt rm -f $(TARGET).top
 
-
-
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
 clean::
+       rm -f .depend
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
        rm -f *~ .*~ gmon.out #*#
 
-distclean::
-       rm -f .depend
-
-beforedepend::
+distclean: clean
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
+.PHONY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
-
-
+endif
+endif
index e50d088..bc70d53 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag_cocci.ml"
 (* the inputs *)
 let show_c = ref false
 let show_cocci = ref false
index 71c6583..fb74f36 100644 (file)
 # Coccinelle under other licenses.
 
 
-
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 ##############################################################################
 # Variables
 ##############################################################################
 TARGET=globals
 
-SRC= flag.ml config.ml iteration.ml $(REGEXP_FILE) regexp.ml
+SRC=config.ml flag.ml iteration.ml $(REGEXP_FILE) regexp.ml
 
 LIBS=
-INCLUDEDIRS= ../commons  $(PCREDIR)
+INCLUDEDIRS= ../commons $(PCREDIR)
 
 ##############################################################################
 # Generic variables
 ##############################################################################
 
 INCLUDES=$(INCLUDEDIRS:%=-I %)
-
-OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 OBJS= $(SRC:.ml=.cmo)
 OPTOBJS= $(SRC:.ml=.cmx)
@@ -58,10 +57,10 @@ all: $(TARGET).cma
 all.opt: $(TARGET).cmxa
 
 $(TARGET).cma: $(LIBS) $(OBJS)
-       $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
+       $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
 
 $(TARGET).cmxa: $(LIBS:.cma=.cmxa) $(OPTOBJS)
-       $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
 
 ##############################################################################
 # Developer rules
@@ -69,29 +68,28 @@ $(TARGET).cmxa: $(LIBS:.cma=.cmxa) $(OPTOBJS)
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
-clean::
+clean:
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
        rm -f *~ .*~ gmon.out #*#
-
-distclean::
        rm -f .depend
 
-beforedepend::
+distclean: clean
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
-
-
-
-
+endif
+endif
index 9ec8712..49e632a 100644 (file)
@@ -1,9 +1,10 @@
-let version = "1.0.0-rc11"
+let version = "@COCCI_VERSION@"
 
 let path =
   try (Sys.getenv "COCCINELLE_HOME")
-  with Not_found->"/usr/local/share/coccinelle"
+  with Not_found->"@prefix@/share/coccinelle"
 
 let std_iso = ref (Filename.concat path "standard.iso")
 let std_h   = ref (Filename.concat path "standard.h")
 
+let dynlink_is_native = @DYNLINK_IS_NATIVE@
index 6b58465..9f96058 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag.ml"
 let sgrep_mode2 = ref false
 
 let show_misc = ref true
@@ -39,10 +40,10 @@ let scanner = ref Grep
 
 let pyoutput = ref "coccilib.output.Console"
 
-let ocamlc = ref "ocamlc"
-let ocamlopt = ref "ocamlopt"
-let ocamldep = ref "ocamldep"
-let ocamlfind = ref "ocamlfind"
+let ocamlc = ref Commands.ocamlc_cmd
+let ocamlopt = ref Commands.ocamlopt_cmd
+let ocamldep = ref Commands.ocamldep_cmd
+let ocamlfind = ref Commands.ocamlfind_cmd
 
 (*"Some" value is the path with respect to which the patch should be created*)
 let patch = ref (None : string option)
index 5d282c7..dcc2f43 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./iteration.ml"
 type init_info = (string (* language *) * string (* rule name *)) *
       string list (* defined virtual rules *)
 
index 098b9c0..933960c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./iteration.mli"
 type init_info = (string (* language *) * string (* rule name *)) *
       string list (* defined virtual rules *)
 
diff --git a/globals/regexp.ml b/globals/regexp.ml
deleted file mode 100644 (file)
index 4753c58..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-(*
- * Copyright 2012, INRIA
- * Julia Lawall, Gilles Muller
- * Copyright 2010-2011, INRIA, University of Copenhagen
- * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
- * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
- * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
- * This file is part of Coccinelle.
- *
- * Coccinelle is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, according to version 2 of the License.
- *
- * Coccinelle is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
- *
- * The authors reserve the right to distribute this or future versions of
- * Coccinelle under other licenses.
- *)
-
-
-include Regexp_pcre
index f45bcac..0e6e33b 100644 (file)
@@ -1 +1 @@
-include @REGEXP_FILE@
+include @REGEXP_MODULE@
index 44e0551..ef75085 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./regexp_pcre.ml"
 
 type regexp =
     Pcre of Pcre.regexp
index 3823e0a..cda4755 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./regexp_str.ml"
 
 type regexp = Str.regexp
 
diff --git a/install-sh b/install-sh
new file mode 100755 (executable)
index 0000000..a9244eb
--- /dev/null
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-01-19.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       # Protect names problematic for `test' and other utilities.
+       case $dst_arg in
+         -* | [=\(\)!]) dst_arg=./$dst_arg;;
+       esac
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for `test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for `test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+       echo "$0: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       [-=\(\)!]*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test X"$d" = X && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/main.ml b/main.ml
index eb58708..129c390 100644 (file)
--- a/main.ml
+++ b/main.ml
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./main.ml"
 open Common
 module FC = Flag_cocci
 
@@ -61,7 +62,7 @@ let test_all = ref false
 let test_okfailed = ref false
 let test_regression_okfailed = ref false
 let expected_score_file = ref ""
-
+let allow_update_score_file = ref true
 
 (* action mode *)
 let action = ref ""
@@ -628,7 +629,7 @@ let other_options = [
   [
     "--use-cache", Arg.Set Flag_parsing_c.use_cache,
     "   use .ast_raw pre-parsed cached C file";
-    "--cache_prefix",
+    "--cache-prefix",
     Arg.String (function s ->
       Flag_parsing_c.cache_prefix := Some s;
       Flag_parsing_c.use_cache := true),
@@ -658,6 +659,8 @@ let other_options = [
     "   use also file.res";
     "--expected-score-file", Arg.Set_string expected_score_file,
     "   which score file to compare with in -testall";
+    "--no-update-score-file", Arg.Clear allow_update_score_file,
+    "   do not update the score file when -testall succeeds";
     "--relax-include-path", Arg.Set FC.relax_include_path,
     " ";
   ];
@@ -1169,9 +1172,10 @@ let main () =
     | []  when !test_all ->
         (if !FC.include_path = []
        then FC.include_path := ["tests/include"]);
-        if !expected_score_file <> ""
-        then Testing.testall ~expected_score_file:!expected_score_file ()
-        else Testing.testall ()
+        let score_file = if !expected_score_file <> ""
+                         then !expected_score_file
+                         else "tests/SCORE_expected.sexp" in
+        Testing.testall score_file !allow_update_score_file
 
     | [] when !test_regression_okfailed ->
         Testing.test_regression_okfailed ()
diff --git a/menhirlib/Makefile b/menhirlib/Makefile
deleted file mode 100644 (file)
index fdf2583..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-
--include ../Makefile.config
-
-##############################################################################
-# Variables
-##############################################################################
-TARGET=menhirLib
-
-SRC= infiniteArray.ml packedIntArray.ml rowDisplacement.ml engineTypes.ml \
-  engine.ml tableFormat.ml tableInterpreter.ml convert.ml
-
-LIBS=
-INCLUDES=
-
-# copy what the menhir authors do
-EXTRAOPT=-for-pack MenhirLib
-
-##############################################################################
-# Generic variables
-##############################################################################
-OCAMLCFLAGS ?=-g -dtypes
-OPTFLAGS=
-
-OCAMLC=ocamlc$(OPTBIN)     $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT= ocamlopt$(OPTBIN) $(OPTFLAGS) $(EXTRAOPT)   $(INCLUDES)
-OCAMLOPT2=ocamlopt$(OPTBIN) $(OPTFLAGS)              $(INCLUDES)
-OCAMLLEX=ocamllex$(OPTBIN)
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
-OBJS= $(SRC:.ml=.cmo)
-OPTOBJS= $(SRC:.ml=.cmx)
-
-
-##############################################################################
-# Top rules
-##############################################################################
-all: $(TARGET).cma menhirLib.cmo
-all.opt: $(TARGET).cmxa menhirLib.cmx
-opt: all.opt
-
-$(TARGET).cma: $(OBJS) $(LIBS)
-       $(OCAMLC) -a -o $@ $(OBJS)
-
-$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $@ $(OPTOBJS)
-
-# I thought at first that only one file menhirLib.ml
-# was needed but in fact it's a wierd cos menhirLib.cmo results from multi
-# files. They used the -pack ocamlc option, and for strange reason
-# decided to produce a .cma instead of a classical .cma.
-# So I put all the necesseray files in this directory.
-
-# copy what the menhir authors do in their own makefile
-menhirLib.cmo: $(OBJS)
-       $(OCAMLC) -pack -o menhirLib.cmo $^
-
-menhirLib.cmx: $(OPTOBJS)
-       $(OCAMLOPT2) -pack -o menhirLib.cmx $^
-
-##############################################################################
-# Generic rules
-##############################################################################
-.SUFFIXES: .ml .mli .cmo .cmi .cmx
-
-.ml.cmo:
-       $(OCAMLC) -c $<
-.mli.cmi:
-       $(OCAMLC) -c $<
-.ml.cmx:
-       $(OCAMLOPT) -c $<
-
-.ml.mldepend:
-       $(OCAMLC) -i $<
-
-clean::
-       rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
-
-clean::
-       rm -f *~ .*~ gmon.out #*#
-
-beforedepend::
-
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
-
-distclean::
-       rm -f .depend
-
--include .depend
diff --git a/menhirlib/convert.ml b/menhirlib/convert.ml
deleted file mode 100644 (file)
index 1ccd1cf..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* An ocamlyacc-style, or Menhir-style, parser requires access to
-   the lexer, which must be parameterized with a lexing buffer, and
-   to the lexing buffer itself, where it reads position information. *)
-
-(* This traditional API is convenient when used with ocamllex, but
-   inelegant when used with other lexer generators. *)
-
-type ('token, 'semantic_value) traditional =
-    (Lexing.lexbuf -> 'token) -> Lexing.lexbuf -> 'semantic_value
-
-(* This revised API is independent of any lexer generator. Here, the
-   parser only requires access to the lexer, and the lexer takes no
-   parameters. The tokens returned by the lexer may contain position
-   information. *)
-
-type ('token, 'semantic_value) revised =
-    (unit -> 'token) -> 'semantic_value
-
-(* --------------------------------------------------------------------------- *)
-
-(* Converting a traditional parser, produced by ocamlyacc or Menhir,
-   into a revised parser. *)
-
-(* A token of the revised lexer is essentially a triple of a token
-   of the traditional lexer (or raw token), a start position, and
-   and end position. The three [get] functions are accessors. *)
-
-(* We do not require the type ['token] to actually be a triple type.
-   This enables complex applications where it is a record type with
-   more three fields. It also enables simple applications where
-   positions are of no interest, so ['token] is just ['raw_token]
-   and [get_startp] and [get_endp] return dummy positions. *)
-
-let traditional2revised
-  (get_raw_token : 'token -> 'raw_token)
-  (get_startp    : 'token -> Lexing.position)
-  (get_endp      : 'token -> Lexing.position)
-  (parser : ('raw_token, 'semantic_value) traditional)
-: ('token, 'semantic_value) revised =
-
-  (* Accept a revised lexer. *)
-
-  fun (lexer : unit -> 'token) ->
-
-    (* Create a dummy lexing buffer. *)
-
-    let lexbuf : Lexing.lexbuf =
-      Lexing.from_string ""
-    in
-
-    (* Wrap the revised lexer as a traditional lexer. A traditional
-       lexer returns a raw token and updates the fields of the lexing
-       buffer with new positions, which will be read by the parser. *)
-
-    let lexer (lexbuf : Lexing.lexbuf) : 'raw_token =
-      let token : 'token = lexer() in
-      lexbuf.Lexing.lex_start_p <- get_startp token;
-      lexbuf.Lexing.lex_curr_p <- get_endp token;
-      get_raw_token token
-    in
-
-    (* Invoke the traditional parser. *)
-
-    parser lexer lexbuf
-
-(* --------------------------------------------------------------------------- *)
-
-(* Converting a revised parser back to a traditional parser. *)
-
-let revised2traditional
-  (make_token : 'raw_token -> Lexing.position -> Lexing.position -> 'token)
-  (parser : ('token, 'semantic_value) revised)
-: ('raw_token, 'semantic_value) traditional =
-
-  (* Accept a traditional lexer and a lexing buffer. *)
-
-  fun (lexer : Lexing.lexbuf -> 'raw_token) (lexbuf : Lexing.lexbuf) ->
-
-    (* Wrap the traditional lexer as a revised lexer. *)
-
-    let lexer () : 'token =
-      let token : 'raw_token = lexer lexbuf in
-      make_token token lexbuf.Lexing.lex_start_p lexbuf.Lexing.lex_curr_p
-    in
-
-    (* Invoke the revised parser. *)
-
-    parser lexer
-
-(* --------------------------------------------------------------------------- *)
-
-(* Simplified versions of the above, where concrete triples are used. *)
-
-module Simplified = struct
-
-  let traditional2revised parser =
-    traditional2revised
-      (fun (token, _, _)  -> token)
-      (fun (_, startp, _) -> startp)
-      (fun (_, _, endp)   -> endp)
-      parser
-
-  let revised2traditional parser =
-    revised2traditional
-      (fun token startp endp -> (token, startp, endp))
-      parser
-
-end
diff --git a/menhirlib/engine.ml b/menhirlib/engine.ml
deleted file mode 100644 (file)
index 53a101e..0000000
+++ /dev/null
@@ -1,367 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-open EngineTypes
-
-(* The LR parsing engine. *)
-
-(* This module is used:
-
-   - at compile time, if so requested by the user, via the --interpret options;
-   - at run time, in the table-based back-end. *)
-
-module Make (T : TABLE) = struct
-
-  (* This propagates type and exception definitions. *)
-
-  include T
-
-  let _eRR : exn =
-    Error
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* [discard] takes a token off the input stream, queries the lexer
-     for a new one, and stores it into [env.token], overwriting the
-     previous token. If [env.shifted] has not yet reached its limit,
-     it is incremented. *)
-
-  let discard env =
-    let lexbuf = env.lexbuf in
-    let token = env.lexer lexbuf in
-    env.token <- token;
-    Log.lookahead_token lexbuf (T.token2terminal token);
-    let shifted = env.shifted + 1 in
-    if shifted >= 0 then
-      env.shifted <- shifted
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* The type [void] is empty. Many of the functions below have return type
-     [void]. This guarantees that they never return a value. Instead, they
-     must stop by raising an exception: either [Accept] or [Error]. *)
-
-  type void
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* In the code-based back-end, the [run] function is sometimes responsible
-     for pushing a new cell on the stack. This is motivated by code sharing
-     concerns. In this interpreter, there is no such concern; [run]'s caller
-     is always responsible for updating the stack. *)
-
-  (* In the code-based back-end, there is a [run] function for each state
-     [s]. This function can behave in two slightly different ways, depending
-     on when it is invoked, or (equivalently) depending on [s].
-
-     If [run] is invoked after shifting a terminal symbol (or, equivalently,
-     if [s] has a terminal incoming symbol), then [run] discards a token,
-     unless [s] has a default reduction on [#]. (Indeed, in that case,
-     requesting the next token might drive the lexer off the end of the input
-     stream.)
-
-     If, on the other hand, [run] is invoked after performing a goto transition,
-     or invoked directly by an entry point, then there is nothing to discard.
-
-     These two cases are reflected in [CodeBackend.gettoken].
-
-     Here, the code is structured in a slightly different way. It is up to
-     the caller of [run] to indicate whether to discard a token. *)
-
-  let rec run env please_discard : void =
-
-    (* Log the fact that we just entered this state. *)
-
-    let s = env.current in
-    Log.state s;
-
-    (* If [please_discard] is set, discard a token and fetch the next one. *)
-
-    (* This flag is set when [s] is being entered by shifting a terminal
-       symbol and [s] does not have a default reduction on [#]. *)
-
-    if please_discard then
-      discard env;
-
-    (* Examine what situation we are in. This case analysis is analogous to
-       that performed in [CodeBackend.gettoken], in the sub-case where we do
-       not have a terminal incoming symbol. *)
-
-    T.default_reduction
-      s
-      reduce   (* there is a default reduction; perform it *)
-      continue (* there is none; continue below *)
-      env
-
-  and continue env : void =
-
-    (* There is no default reduction. Consult the current lookahead token
-       so as to determine which action should be taken. *)
-
-    (* Peeking at the first input token, without taking it off the input
-       stream, is normally done by reading [env.token]. However, we check
-       [env.shifted] first: if it is -1, then the lookahead token is the
-       [error] token. *)
-
-    (* Note that, if we just called [discard] above, then the lookahead
-       token cannot be [error]. *)
-
-    if env.shifted = (-1) then begin
-      Log.resuming_error_handling();
-      error env
-    end
-    else
-      action env
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* When [action] is invoked, we know that the current state does not have
-     a default reduction. We also know that the current lookahead token is
-     not [error]: it is a real token, stored in [env.token]. *)
-
-  and action env : void =
-
-    (* We consult the two-dimensional action table, indexed by the
-       current state and the current lookahead token, in order to
-       determine which action should be taken. *)
-
-    let token = env.token in
-    T.action
-      env.current                    (* determines a row *)
-      (T.token2terminal token)       (* determines a column *)
-      (T.token2value token)
-      shift                          (* shift continuation *)
-      reduce                         (* reduce continuation *)
-      initiate                       (* failure continuation *)
-      env
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* This function takes care of shift transitions along a terminal symbol.
-     (Goto transitions are taken care of within [reduce] below.) The symbol
-     can be either an actual token or the [error] pseudo-token. *)
-
-  and shift env
-      (please_discard : bool)
-      (terminal : terminal)
-      (value : semantic_value)
-      (s' : state)
-      : void =
-
-    (* Log the transition. *)
-
-    Log.shift terminal s';
-
-    (* Push a new cell onto the stack, containing the identity of the
-       state that we are leaving. *)
-
-    let lexbuf = env.lexbuf in
-    env.stack <- {
-      state = env.current;
-      semv = value;
-      startp = lexbuf.Lexing.lex_start_p;
-      endp = lexbuf.Lexing.lex_curr_p;
-      next = env.stack;
-    };
-
-    (* Switch to state [s']. *)
-
-    env.current <- s';
-    run env please_discard
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* This function takes care of reductions. *)
-
-  and reduce env (prod : production) : void =
-
-    (* Log a reduction event. *)
-
-    Log.reduce_or_accept prod;
-
-    (* Invoke the semantic action. The semantic action is responsible for
-       truncating the stack, updating the current state, producing a cell that
-       contains a new semantic value, and raising [Accept] or [Error] if
-       appropriate. *)
-
-    (* If the semantic action raises [Error], we catch it immediately and
-       initiate error handling. *)
-
-    (* The apparently weird idiom used here is an encoding for a
-       [let/unless] construct, which does not exist in ocaml. *)
-
-    if (
-      try
-       T.semantic_action prod env;
-       true
-      with Error ->
-       false
-    ) then begin
-
-      (* By our convention, the semantic action is responsible for updating
-        the stack. The state now found in the top stack cell is the return
-        state. *)
-
-      (* Perform a goto transition. The target state is determined
-        by consulting the goto table at the return state and at
-        production [prod]. *)
-
-      env.current <- T.goto env.stack.state prod;
-      run env false
-
-    end
-    else
-      errorbookkeeping env
-
-
-  (* --------------------------------------------------------------------------- *)
-
-  (* The following functions deal with errors. *)
-
-  (* [initiate] and [errorbookkeeping] initiate error handling. See the functions
-     by the same names in [CodeBackend]. *)
-
-  and initiate env : void =
-    assert (env.shifted >= 0);
-    if T.recovery && env.shifted = 0 then begin
-      Log.discarding_last_token (T.token2terminal env.token);
-      discard env;
-      env.shifted <- 0;
-      action env
-    end
-    else
-      errorbookkeeping env
-
-  and errorbookkeeping env =
-    Log.initiating_error_handling();
-    env.previouserror <- env.shifted;
-    env.shifted <- (-1);
-    error env
-
-  (* [error] handles errors. *)
-
-  and error env : void =
-
-    (* Consult the column associated with the [error] pseudo-token in the
-       action table. *)
-
-    T.action
-      env.current                    (* determines a row *)
-      T.error_terminal               (* determines a column *)
-      T.error_value
-      error_shift                    (* shift continuation *)
-      error_reduce                   (* reduce continuation *)
-      error_fail                     (* failure continuation *)
-      env
-
-  and error_shift env please_discard terminal value s' =
-
-    (* Here, [terminal] is [T.error_terminal], and [value] is [T.error_value]. *)
-
-    assert (terminal = T.error_terminal && value = T.error_value);
-
-    (* This state is capable of shifting the [error] token. *)
-
-    Log.handling_error env.current;
-    shift env please_discard terminal value s'
-
-  and error_reduce env prod =
-
-    (* This state is capable of performing a reduction on [error]. *)
-
-    Log.handling_error env.current;
-    reduce env prod
-
-  and error_fail env =
-
-    (* This state is unable to handle errors. Attempt to pop a stack
-       cell. *)
-
-    let cell = env.stack in
-    let next = cell.next in
-    if next == cell then
-
-      (* The stack is empty. Die. *)
-
-      raise _eRR
-
-    else begin
-
-      (* The stack is nonempty. Pop a cell, updating the current state
-        with that found in the popped cell, and try again. *)
-
-      env.stack <- next;
-      env.current <- cell.state;
-      error env
-
-    end
-
-  (* --------------------------------------------------------------------------- *)
-
-  let entry
-      (s : state)
-      (lexer : Lexing.lexbuf -> token)
-      (lexbuf : Lexing.lexbuf)
-      : semantic_value =
-
-    (* Build an empty stack. This is a dummy cell, which is its own
-       successor. Its fields other than [next] contain dummy values. *)
-
-    let rec empty = {
-      state = s;                          (* dummy *)
-      semv = T.error_value;               (* dummy *)
-      startp = lexbuf.Lexing.lex_start_p; (* dummy *)
-      endp = lexbuf.Lexing.lex_curr_p;    (* dummy *)
-      next = empty;
-    } in
-
-    (* Perform an initial call to the lexer. *)
-
-    let token : token =
-      lexer lexbuf
-    in
-
-    (* Log our first lookahead token. *)
-
-    Log.lookahead_token lexbuf (T.token2terminal token);
-
-    (* Build an initial environment. *)
-
-    let env = {
-      lexer = lexer;
-      lexbuf = lexbuf;
-      token = token;
-      shifted = max_int;
-      previouserror = max_int;
-      stack = empty;
-      current = s;
-    } in
-
-    (* Run. Catch [Accept], which represents normal termination. Let [Error]
-       escape. *)
-
-    try
-
-      (* If ocaml offered a [match/with] construct with zero branches, this is
-        what we would use here, since the type [void] has zero cases. *)
-
-      let (_ : void) = run env false in
-      assert false (* cannot fail *)
-
-    with
-    | Accept v ->
-       v
-
-end
-
diff --git a/menhirlib/engineTypes.ml b/menhirlib/engineTypes.ml
deleted file mode 100644 (file)
index 4203449..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* This file defines several types and module types that are used in the
-   specification of module [Engine]. *)
-
-(* --------------------------------------------------------------------------- *)
-
-(* It would be nice if we could keep the structure of stacks and environments
-   hidden. However, stacks and environments must be accessible to semantic
-   actions, so the following data structure definitions must be public. *)
-
-(* --------------------------------------------------------------------------- *)
-
-(* A stack is a linked list of cells. A sentinel cell -- which is its own
-   successor is used to mark the bottom of the stack. The sentinel cell
-   itself is not significant -- it contains dummy values. *)
-
-type ('state, 'semantic_value) stack = {
-
-  (* The state that we should go back to if we pop this stack cell. *)
-
-  (* This convention means that the state contained in the top stack cell is
-     not the current state [env.current]. It also means that the state found
-     within the sentinel is a dummy -- it is never consulted. This convention
-     is the same as that adopted by the code-based back-end. *)
-
-  state: 'state;
-
-  (* The semantic value associated with the chunk of input that this cell
-     represents. *)
-
-  semv: 'semantic_value;
-
-  (* The start and end positions of the chunk of input that this cell
-     represents. *)
-
-  startp: Lexing.position;
-  endp: Lexing.position;
-
-  (* The next cell down in the stack. If this is a self-pointer, then this
-     cell is the sentinel, and the stack is conceptually empty. *)
-
-  next: ('state, 'semantic_value) stack;
-
-}
-
-(* --------------------------------------------------------------------------- *)
-
-(* A parsing environment contains basically all of the automaton's state. *)
-
-type ('state, 'semantic_value, 'token) env = {
-
-  (* The lexer. *)
-
-  lexer: Lexing.lexbuf -> 'token;
-
-  (* The lexing buffer. It is used as an argument to the lexer, and also
-     accessed directly when extracting positions. *)
-
-  lexbuf: Lexing.lexbuf;
-
-  (* The last token that was obtained from the lexer. *)
-
-  mutable token: 'token;
-
-  (* A count of how many tokens were shifted since the beginning, or since
-     the last [error] token was encountered. By convention, if [shifted]
-     is (-1), then the current lookahead token is [error]. *)
-
-  mutable shifted: int;
-
-  (* A copy of the value of [shifted] just before the most recent error
-     was detected. This value is not used by the automaton itself, but
-     is made accessible to semantic actions. *)
-
-  mutable previouserror: int;
-
-  (* The stack. In [CodeBackend], it is passed around on its own,
-     whereas, here, it is accessed via the environment. *)
-
-  mutable stack: ('state, 'semantic_value) stack;
-
-  (* The current state. In [CodeBackend], it is passed around on its
-     own, whereas, here, it is accessed via the environment. *)
-
-  mutable current: 'state;
-
-}
-
-(* --------------------------------------------------------------------------- *)
-
-(* This signature describes the parameters that must be supplied to the LR
-   engine. *)
-
-module type TABLE = sig
-
-  (* The type of automaton states. *)
-
-  type state
-
-  (* The type of tokens. These can be thought of as real tokens, that is,
-     tokens returned by the lexer. They carry a semantic value. This type
-     does not include the [error] pseudo-token. *)
-
-  type token
-
-  (* The type of terminal symbols. These can be thought of as integer codes.
-     They do not carry a semantic value. This type does include the [error]
-     pseudo-token. *)
-
-  type terminal
-
-  (* The type of semantic values. *)
-
-  type semantic_value
-
-  (* A token is conceptually a pair of a (non-[error]) terminal symbol and
-     a semantic value. The following two functions are the pair projections. *)
-
-  val token2terminal: token -> terminal
-  val token2value: token -> semantic_value
-
-  (* Even though the [error] pseudo-token is not a real token, it is a
-     terminal symbol. Furthermore, for regularity, it must have a semantic
-     value. *)
-
-  val error_terminal: terminal
-  val error_value: semantic_value
-
-  (* The type of productions. *)
-
-  type production
-
-  (* If a state [s] has a default reduction on production [prod], then, upon
-     entering [s], the automaton should reduce [prod] without consulting the
-     lookahead token. The following function allows determining which states
-     have default reductions. *)
-
-  (* Instead of returning a value of a sum type -- either [DefRed prod], or
-     [NoDefRed] -- it accepts two continuations, and invokes just one of
-     them. This mechanism allows avoiding a memory allocation. *)
-
-  val default_reduction:
-    state ->
-    ('env -> production -> 'answer) ->
-    ('env -> 'answer) ->
-    'env -> 'answer
-
-  (* An LR automaton can normally take three kinds of actions: shift, reduce,
-     or fail. (Acceptance is a particular case of reduction: it consists in
-     reducing a start production.) *)
-
-  (* There are two variants of the shift action. [shift/discard s] instructs
-     the automaton to discard the current token, request a new one from the
-     lexer, and move to state [s]. [shift/nodiscard s] instructs it to move to
-     state [s] without requesting a new token. This instruction should be used
-     when [s] has a default reduction on [#]. See [CodeBackend.gettoken] for
-     details. *)
-
-  (* This is the automaton's action table. It maps a pair of a state and a
-     terminal symbol to an action. *)
-
-  (* Instead of returning a value of a sum type -- one of shift/discard,
-     shift/nodiscard, reduce, or fail -- this function accepts three
-     continuations, and invokes just one them. This mechanism allows avoiding
-     a memory allocation. *)
-
-  (* In summary, the parameters to [action] are as follows:
-
-     - the first two parameters, a state and a terminal symbol, are used to
-       look up the action table;
-
-     - the next parameter is the semantic value associated with the above
-       terminal symbol; it is not used, only passed along to the shift
-       continuation, as explained below;
-
-     - the shift continuation expects an environment; a flag that tells
-       whether to discard the current token; the terminal symbol that
-       is being shifted; its semantic value; and the target state of
-       the transition;
-
-     - the reduce continuation expects an environment and a production;
-
-     - the fail continuation expects an environment;
-
-     - the last parameter is the environment; it is not used, only passed
-       along to the selected continuation. *)
-
-  val action:
-    state ->
-    terminal ->
-    semantic_value ->
-    ('env -> bool -> terminal -> semantic_value -> state -> 'answer) ->
-    ('env -> production -> 'answer) ->
-    ('env -> 'answer) ->
-    'env -> 'answer
-
-  (* This is the automaton's goto table. It maps a pair of a state and a
-     production to a new state.
-
-     This convention is slightly different from the textbook approach. The
-     goto table is usually indexed by a state and a non-terminal symbol. *)
-
-  val goto: state -> production -> state
-
-  (* By convention, a semantic action is responsible for:
-
-     1. fetching whatever semantic values and positions it needs off the stack;
-
-     2. popping an appropriate number of cells off the stack, as dictated
-     by the length of the right-hand side of the production; this involves
-     updating [env.stack];
-
-     3. computing a new semantic value, as well as new start and end positions;
-
-     4. pushing a new stack cell, which contains the three values
-     computed in step 3; this again involves updating [env.stack]
-     (only one update is necessary).
-
-     Point 1 is essentially forced upon us: if semantic values were fetched
-     off the stack by this interpreter, then the calling convention for
-     semantic actions would be variadic: not all semantic actions would have
-     the same number of arguments. The rest follows rather naturally. *)
-
-  (* If production [prod] is an accepting production, then the semantic action
-     is responsible for raising exception [Accept], instead of returning
-     normally. This convention allows us to not distinguish between regular
-     productions and accepting productions. All we have to do is catch that
-     exception at top level. *)
-
-  (* Semantic actions are allowed to raise [Error]. *)
-
-  exception Accept of semantic_value
-  exception Error
-
-  type semantic_action =
-      (state, semantic_value, token) env -> unit
-
-  val semantic_action: production -> semantic_action
-
-  (* The LR engine can attempt error recovery. This consists in discarding
-     tokens, just after an error has been successfully handled, until a token
-     that can be successfully handled is found. This mechanism is optional.
-     The following flag enables it. *)
-
-  val recovery: bool
-
-  (* The LR engine requires a number of hooks, which are used for logging. *)
-
-  (* The comments below indicate the conventional messages that correspond
-     to these hooks in the code-based back-end; see [CodeBackend]. *)
-
-  module Log : sig
-
-    (* State %d: *)
-
-    val state: state -> unit
-
-    (* Shifting (<terminal>) to state <state> *)
-
-    val shift: terminal -> state -> unit
-
-    (* Reducing a production should be logged either as a reduction
-       event (for regular productions) or as an acceptance event (for
-       start productions). *)
-
-    (* Reducing production <production> / Accepting *)
-
-    val reduce_or_accept: production -> unit
-
-    (* Lookahead token is now <terminal> (<pos>-<pos>) *)
-
-    val lookahead_token: Lexing.lexbuf -> terminal -> unit
-
-    (* Initiating error handling *)
-
-    val initiating_error_handling: unit -> unit
-
-    (* Resuming error handling *)
-
-    val resuming_error_handling: unit -> unit
-
-    (* Handling error in state <state> *)
-
-    val handling_error: state -> unit
-
-    (* Discarding last token read (<terminal>) *)
-
-    val discarding_last_token: terminal -> unit
-
-  end
-
-end
-
-(* --------------------------------------------------------------------------- *)
-
-(* This signature describes the LR engine. *)
-
-module type ENGINE = sig
-
-  type state
-
-  type token
-
-  type semantic_value
-
-  (* An entry point to the engine requires a start state, a lexer, and a lexing
-     buffer. It either succeeds and produces a semantic value, or fails and
-     raises [Error]. *)
-
-  exception Error
-
-  val entry:
-    state ->
-    (Lexing.lexbuf -> token) ->
-    Lexing.lexbuf ->
-    semantic_value
-
-end
diff --git a/menhirlib/infiniteArray.ml b/menhirlib/infiniteArray.ml
deleted file mode 100644 (file)
index e72f434..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* $Id$ *)
-
-(** This module implements infinite arrays, that is, arrays that grow
-    transparently upon demand. *)
-
-type 'a t = {
-    default: 'a;
-    mutable table: 'a array;
-    mutable extent: int; (* the index of the greatest [set] ever, plus one *)
-  }
-
-let default_size =
-  16384 (* must be non-zero *)
-
-let make x = {
-  default = x;
-  table = Array.make default_size x;
-  extent = 0;
-}
-
-let rec new_length length i =
-  if i < length then
-    length
-  else
-    new_length (2 * length) i
-
-let ensure a i =
-  let table = a.table in
-  let length = Array.length table in
-  if i >= length then begin
-    let table' = Array.make (new_length (2 * length) i) a.default in
-    Array.blit table 0 table' 0 length;
-    a.table <- table'
-  end
-
-let get a i =
-  ensure a i;
-  a.table.(i)
-
-let set a i x =
-  ensure a i;
-  a.table.(i) <- x;
-  a.extent <- max (i + 1) a.extent
-
-let extent a =
-  a.extent
-
-let domain a =
-  Array.sub a.table 0 a.extent
-
diff --git a/menhirlib/license.txt b/menhirlib/license.txt
deleted file mode 100644 (file)
index f7c1ef1..0000000
+++ /dev/null
@@ -1,629 +0,0 @@
-In the following, "the Library" refers to the following files:
-
-  src/standard.mly
-  src/infiniteArray.{ml,mli}
-  src/packedIntArray.{ml,mli}
-  src/rowDisplacement.{ml,mli}
-  src/engineTypes.ml
-  src/engine.{ml,mli}
-  src/tableFormat.ml
-  src/tableInterpreter.{ml,mli}
-  src/convert.{ml,mli}
-
-while "the Generator" refers to all other files in this archive.
-
-The Generator is distributed under the terms of the Q Public License
-version 1.0 with a change to choice of law (included below).
-
-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 Generator
-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 3 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.
-\f
-  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.
-\f
-                  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.
-\f
-  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.
-\f
-  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.
-\f
-  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.
-\f
-  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.
-\f
-  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.
-\f
-  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 INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-     Appendix: How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public
-    License along with this library; if not, write to the Free
-    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-    MA 02111-1307, USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/menhirlib/packedIntArray.ml b/menhirlib/packedIntArray.ml
deleted file mode 100644 (file)
index 57726a3..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* A packed integer array is represented as a pair of an integer [k] and
-   a string [s]. The integer [k] is the number of bits per integer that we
-   use. The string [s] is just an array of bits, which is read in 8-bit
-   chunks. *)
-
-(* The ocaml programming language treats string literals and array literals
-   in slightly different ways: the former are statically allocated, while
-   the latter are dynamically allocated. (This is rather arbitrary.) In the
-   context of Menhir's table-based back-end, where compact, immutable
-   integer arrays are needed, ocaml strings are preferable to ocaml arrays. *)
-
-type t =
-  int * string
-
-(* The magnitude [k] of an integer [v] is the number of bits required
-   to represent [v]. It is rounded up to the nearest power of two, so
-   that [k] divides [Sys.word_size]. *)
-
-let magnitude (v : int) =
-  if v < 0 then
-    Sys.word_size
-  else
-    let rec check k max = (* [max] equals [2^k] *)
-      if (max <= 0) || (v < max) then
-       k
-         (* if [max] just overflew, then [v] requires a full ocaml
-            integer, and [k] is the number of bits in an ocaml integer
-            plus one, that is, [Sys.word_size]. *)
-      else
-       check (2 * k) (max * max)
-    in
-    check 1 2
-
-(* [pack a] turns an array of integers into a packed integer array. *)
-
-(* Because the sign bit is the most significant bit, the magnitude of
-   any negative number is the word size. In other words, [pack] does
-   not achieve any space savings as soon as [a] contains any negative
-   numbers, even if they are ``small''. *)
-
-let pack (a : int array) : t =
-
-  let m = Array.length a in
-
-  (* Compute the maximum magnitude of the array elements. This tells
-     us how many bits per element we are going to use. *)
-
-  let k =
-    Array.fold_left (fun k v ->
-      max k (magnitude v)
-    ) 1 a
-  in
-
-  (* Because access to ocaml strings is performed on an 8-bit basis,
-     two cases arise. If [k] is less than 8, then we can pack multiple
-     array entries into a single character. If [k] is greater than 8,
-     then we must use multiple characters to represent a single array
-     entry. *)
-
-  if k <= 8 then begin
-
-    (* [w] is the number of array entries that we pack in a character. *)
-
-    assert (8 mod k = 0);
-    let w = 8 / k in
-
-    (* [n] is the length of the string that we allocate. *)
-
-    let n =
-      if m mod w = 0 then
-       m / w
-      else
-       m / w + 1
-    in
-
-    let s =
-      String.create n
-    in
-
-    (* Define a reader for the source array. The reader might run off
-       the end if [w] does not divide [m]. *)
-
-    let i = ref 0 in
-    let next () =
-      let ii = !i in
-      if ii = m then
-       0 (* ran off the end, pad with zeroes *)
-      else
-       let v = a.(ii) in
-       i := ii + 1;
-       v
-    in
-
-    (* Fill up the string. *)
-
-    for j = 0 to n - 1 do
-      let c = ref 0 in
-      for x = 1 to w do
-       c := (!c lsl k) lor next()
-      done;
-      s.[j] <- Char.chr !c
-    done;
-
-    (* Done. *)
-
-    k, s
-
-  end
-  else begin (* k > 8 *)
-
-    (* [w] is the number of characters that we use to encode an array entry. *)
-
-    assert (k mod 8 = 0);
-    let w = k / 8 in
-
-    (* [n] is the length of the string that we allocate. *)
-
-    let n =
-      m * w
-    in
-
-    let s =
-      String.create n
-    in
-
-    (* Fill up the string. *)
-
-    for i = 0 to m - 1 do
-      let v = ref a.(i) in
-      for x = 1 to w do
-       s.[(i + 1) * w - x] <- Char.chr (!v land 255);
-       v := !v lsr 8
-      done
-    done;
-
-    (* Done. *)
-
-    k, s
-
-  end
-
-(* Access to a string. *)
-
-let read (s : string) (i : int) : int =
-  Char.code (String.unsafe_get s i)
-
-(* [get1 t i] returns the integer stored in the packed array [t] at index [i].
-   It assumes (and does not check) that the array's bit width is [1]. The
-   parameter [t] is just a string. *)
-
-let get1 (s : string) (i : int) : int =
-  let c = read s (i lsr 3) in
-  let c = c lsr ((lnot i) land 0b111) in
-  let c = c land 0b1 in
-  c
-
-(* [get t i] returns the integer stored in the packed array [t] at index [i]. *)
-
-(* Together, [pack] and [get] satisfy the following property: if the index [i]
-   is within bounds, then [get (pack a) i] equals [a.(i)]. *)
-
-let get ((k, s) : t) (i : int) : int =
-  match k with
-  | 1 ->
-      get1 s i
-  | 2 ->
-      let c = read s (i lsr 2) in
-      let c = c lsr (2 * ((lnot i) land 0b11)) in
-      let c = c land 0b11 in
-      c
-  | 4 ->
-      let c = read s (i lsr 1) in
-      let c = c lsr (4 * ((lnot i) land 0b1)) in
-      let c = c land 0b1111 in
-      c
-  | 8 ->
-      read s i
-  | 16 ->
-      let j = 2 * i in
-      (read s j) lsl 8 + read s (j + 1)
-  | _ ->
-      assert (k = 32); (* 64 bits unlikely, not supported *)
-      let j = 4 * i in
-      (((read s j lsl 8) + read s (j + 1)) lsl 8 + read s (j + 2)) lsl 8 + read s (j + 3)
-
diff --git a/menhirlib/readme.txt b/menhirlib/readme.txt
deleted file mode 100644 (file)
index 09068aa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-To make it easier to install coccinelle, to not have to bother about
-where some of menhir object files are, we simply have copied some
-files from the menhir distribution. Those files are needed for the
-parsers generated with the --table menhir option. The files in this
-directory are thus copyrighted by the menhir authors, François Pottier
-and Yann Régis-Gianas, and covered by the GNU Library General Public
-License version 2.
diff --git a/menhirlib/rowDisplacement.ml b/menhirlib/rowDisplacement.ml
deleted file mode 100644 (file)
index 6176fec..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* This module compresses a two-dimensional table, where some values
-   are considered insignificant, via row displacement. *)
-
-(* This idea reportedly appears in Aho and Ullman's ``Principles
-   of Compiler Design'' (1977). It is evaluated in Tarjan and Yao's
-   ``Storing a Sparse Table'' (1979) and in Dencker, Dürre, and Heuft's
-   ``Optimization of Parser Tables for Portable Compilers'' (1984). *)
-
-(* A compressed table is represented as a pair of arrays. The
-   displacement array is an array of offsets into the data array. *)
-
-type 'a table =
-    int array * (* displacement *)
-     'a array   (* data *)
-
-(* In a natural version of this algorithm, displacements would be greater
-   than (or equal to) [-n]. However, in the particular setting of Menhir,
-   both arrays are intended to be compressed with [PackedIntArray], which
-   does not efficiently support negative numbers. For this reason, we are
-   careful not to produce negative displacements. *)
-
-(* In order to avoid producing negative displacements, we simply use the
-   least significant bit as the sign bit. This is implemented by [encode]
-   and [decode] below. *)
-
-(* One could also think, say, of adding [n] to every displacement, so as
-   to ensure that all displacements are nonnegative. This would work, but
-   would require [n] to be published, for use by the decoder. *)
-
-let encode (displacement : int) : int =
-  if displacement >= 0 then
-    displacement lsl 1
-  else
-    (-displacement) lsl 1 + 1
-
-let decode (displacement : int) : int =
-  if displacement land 1 = 0 then
-    displacement lsr 1
-  else
-    -(displacement lsr 1)
-
-(* It is reasonable to assume that, as matrices grow large, their
-   density becomes low, i.e., they have many insignificant entries.
-   As a result, it is important to work with a sparse data structure
-   for rows. We internally represent a row as a list of its
-   significant entries, where each entry is a pair of a [j] index and
-   an element. *)
-
-type 'a row =
-    (int * 'a) list
-
-(* [compress equal insignificant dummy m n t] turns the two-dimensional table
-   [t] into a compressed table. The parameter [equal] is equality of data
-   values. The parameter [wildcard] tells which data values are insignificant,
-   and can thus be overwritten with other values. The parameter [dummy] is
-   used to fill holes in the data array. [m] and [n] are the integer
-   dimensions of the table [t]. *)
-
-let compress
-    (equal : 'a -> 'a -> bool)
-    (insignificant : 'a -> bool)
-    (dummy : 'a)
-    (m : int) (n : int)
-    (t : 'a array array)
-    : 'a table =
-
-  (* Be defensive. *)
-
-  assert (Array.length t = m);
-  assert begin
-    for i = 0 to m - 1 do
-      assert (Array.length t.(i) = n)
-    done;
-    true
-  end;
-
-  (* This turns a row-as-array into a row-as-sparse-list. *)
-
-  let sparse (line : 'a array) : 'a row =
-
-    let rec loop (j : int) (row : 'a row) =
-      if j < 0 then
-       row
-      else
-       let x = line.(j) in
-       loop
-         (j - 1)
-         (if insignificant x then row else (j, x) :: row)
-    in
-
-    loop (n - 1) []
-
-  in
-
-  (* Define the rank of a row as its number of significant entries. *)
-
-  let rank (row : 'a row) : int =
-    List.length row
-  in
-
-  (* Construct a list of all rows, together with their index and rank. *)
-
-  let rows : (int * int * 'a row) list = (* index, rank, row *)
-    Array.to_list (
-      Array.mapi (fun i line ->
-       let row = sparse line in
-       i, rank row, row
-      ) t
-    )
-  in
-
-  (* Sort this list by decreasing rank. This does not have any impact
-     on correctness, but reportedly improves compression. The
-     intuitive idea is that rows with few significant elements are
-     easy to fit, so they should be inserted last, after the problem
-     has become quite constrained by fitting the heavier rows. This
-     heuristic is attributed to Ziegler. *)
-
-  let rows =
-    List.sort (fun (_, rank1, _) (_, rank2, _) ->
-      compare rank2 rank1
-    ) rows
-  in
-
-  (* Allocate a one-dimensional array of displacements. *)
-
-  let displacement : int array =
-    Array.make m 0
-  in
-
-  (* Allocate a one-dimensional, infinite array of values. Indices
-     into this array are written [k]. *)
-
-  let data : 'a InfiniteArray.t =
-    InfiniteArray.make dummy
-  in
-
-  (* Determine whether [row] fits at offset [k] within the current [data]
-     array, up to extension of this array. *)
-
-  (* Note that this check always succeeds when [k] equals the length of
-     the [data] array. Indeed, the loop is then skipped. This property
-     guarantees the termination of the recursive function [fit] below. *)
-
-  let fits k (row : 'a row) : bool =
-
-    let d = InfiniteArray.extent data in
-
-    let rec loop = function
-      | [] ->
-         true
-      | (j, x) :: row ->
-
-         (* [x] is a significant element. *)
-
-         (* By hypothesis, [k + j] is nonnegative. If it is greater than or
-            equal to the current length of the data array, stop -- the row
-            fits. *)
-
-         assert (k + j >= 0);
-
-         if k + j >= d then
-           true
-
-         (* We now know that [k + j] is within bounds of the data
-            array. Check whether it is compatible with the element [y] found
-            there. If it is, continue. If it isn't, stop -- the row does not
-            fit. *)
-
-         else
-           let y = InfiniteArray.get data (k + j) in
-           if insignificant y || equal x y then
-             loop row
-           else
-             false
-
-    in
-    loop row
-
-  in
-
-  (* Find the leftmost position where a row fits. *)
-
-  (* If the leftmost significant element in this row is at offset [j],
-     then we can hope to fit as far left as [-j] -- so this element
-     lands at offset [0] in the data array. *)
-
-  (* Note that displacements may be negative. This means that, for
-     insignificant elements, accesses to the data array could fail: they could
-     be out of bounds, either towards the left or towards the right. This is
-     not a problem, as long as [get] is invoked only at significant
-     elements. *)
-
-  let rec fit k row : int =
-    if fits k row then
-      k
-    else
-      fit (k + 1) row
-  in
-
-  let fit row =
-    match row with
-    | [] ->
-       0 (* irrelevant *)
-    | (j, _) :: _ ->
-       fit (-j) row
-  in
-
-  (* Write [row] at (compatible) offset [k]. *)
-
-  let rec write k = function
-    | [] ->
-       ()
-    | (j, x) :: row ->
-       InfiniteArray.set data (k + j) x;
-       write k row
-  in
-
-  (* Iterate over the sorted list of rows. Fit and write each row at
-     the leftmost compatible offset. Update the displacement table. *)
-
-  let () =
-    List.iter (fun (i, _, row) ->
-      let k = fit row in (* if [row] has leading insignificant elements, then [k] can be negative *)
-      write k row;
-      displacement.(i) <- encode k
-    ) rows
-  in
-
-  (* Return the compressed tables. *)
-
-  displacement, InfiniteArray.domain data
-
-(* [get ct i j] returns the value found at indices [i] and [j] in the
-   compressed table [ct]. This function call is permitted only if the
-   value found at indices [i] and [j] in the original table is
-   significant -- otherwise, it could fail abruptly. *)
-
-(* Together, [compress] and [get] have the property that, if the value
-   found at indices [i] and [j] in an uncompressed table [t] is
-   significant, then [get (compress t) i j] is equal to that value. *)
-
-let get (displacement, data) i j =
-  assert (0 <= i && i < Array.length displacement);
-  let k = decode displacement.(i) in
-  assert (0 <= k + j && k + j < Array.length data);
-    (* failure of this assertion indicates an attempt to access an
-       insignificant element that happens to be mapped out of the bounds
-       of the [data] array. *)
-  data.(k + j)
-
-(* [getget] is a variant of [get] which only requires read access,
-   via accessors, to the two components of the table. *)
-
-let getget get_displacement get_data (displacement, data) i j =
-  let k = decode (get_displacement displacement i) in
-  get_data data (k + j)
-
diff --git a/menhirlib/tableFormat.ml b/menhirlib/tableFormat.ml
deleted file mode 100644 (file)
index 056dfe4..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* This signature defines the format of the parse tables. It is used as
-   an argument to [TableInterpreter]. *)
-
-module type TABLES = sig
-
-  (* This is the parser's type of tokens. *)
-
-  type token
-
-  (* This maps a token to its internal (generation-time) integer code. *)
-
-  val token2terminal: token -> int
-
-  (* This is the integer code for the error pseudo-token. *)
-
-  val error_terminal: int
-
-  (* This maps a token to its semantic value. *)
-
-  val token2value: token -> Obj.t
-
-  (* Traditionally, an LR automaton is described by two tables, namely, an
-     action table and a goto table. See, for instance, the Dragon book.
-
-     The action table is a two-dimensional matrix that maps a state and a
-     lookahead token to an action. An action is one of: shift to a certain
-     state, reduce a certain production, accept, or fail.
-
-     The goto table is a two-dimensional matrix that maps a state and a
-     non-terminal symbol to either a state or undefined. By construction, this
-     table is sparse: its undefined entries are never looked up. A compression
-     technique is free to overlap them with other entries.
-
-     In Menhir, things are slightly different. If a state has a default
-     reduction on token [#], then that reduction must be performed without
-     consulting the lookahead token. As a result, we must first determine
-     whether that is the case, before we can obtain a lookahead token and use it
-     as an index in the action table.
-
-     Thus, Menhir's tables are as follows.
-
-     A one-dimensional default reduction table maps a state to either ``no
-     default reduction'' (encoded as: 0) or ``by default, reduce prod''
-     (encoded as: 1 + prod). The action table is looked up only when there
-     is no default reduction. *)
-
-  val default_reduction: PackedIntArray.t
-
-  (* Menhir follows Dencker, Dürre and Heuft, who point out that, although the
-     action table is not sparse by nature (i.e., the error entries are
-     significant), it can be made sparse by first factoring out a binary error
-     matrix, then replacing the error entries in the action table with undefined
-     entries. Thus:
-
-     A two-dimensional error bitmap maps a state and a terminal to either
-     ``fail'' (encoded as: 0) or ``do not fail'' (encoded as: 1). The action
-     table, which is now sparse, is looked up only in the latter case. *)
-
-  (* The error bitmap is flattened into a one-dimensional table; its width is
-     recorded so as to allow indexing. The table is then compressed via
-     [PackedIntArray]. The bit width of the resulting packed array must be
-     [1], so it is not explicitly recorded. *)
-
-  (* The error bitmap does not contain a column for the [#] pseudo-terminal.
-     Thus, its width is [Terminal.n - 1]. We exploit the fact that the integer
-     code assigned to [#] is greatest: the fact that the right-most column
-     in the bitmap is missing does not affect the code for accessing it. *)
-
-  val error: int (* width of the bitmap *) * string (* second component of [PackedIntArray.t] *)
-
-  (* A two-dimensional action table maps a state and a terminal to one of
-     ``shift to state s and discard the current token'' (encoded as: s | 10),
-     ``shift to state s without discarding the current token'' (encoded as: s |
-     11), or ``reduce prod'' (encoded as: prod | 01). *)
-
-  (* The action table is first compressed via [RowDisplacement], then packed
-     via [PackedIntArray]. *)
-
-  (* Like the error bitmap, the action table does not contain a column for the
-     [#] pseudo-terminal. *)
-
-  val action: PackedIntArray.t * PackedIntArray.t
-
-  (* A one-dimensional lhs table maps a production to its left-hand side (a
-     non-terminal symbol). *)
-
-  val lhs: PackedIntArray.t
-
-  (* A two-dimensional goto table maps a state and a non-terminal symbol to
-     either undefined (encoded as: 0) or a new state s (encoded as: 1 + s). *)
-
-  (* The goto table is first compressed via [RowDisplacement], then packed
-     via [PackedIntArray]. *)
-
-  val goto: PackedIntArray.t * PackedIntArray.t
-
-  (* A one-dimensional semantic action table maps productions to semantic
-     actions. The calling convention for semantic actions is described in
-     [EngineTypes]. *)
-
-  val semantic_action: ((int, Obj.t, token) EngineTypes.env -> unit) array
-
-  (* The parser defines its own [Error] exception. This exception can be
-     raised by semantic actions and caught by the engine, and raised by the
-     engine towards the final user. *)
-
-  exception Error
-
-  (* The parser indicates whether to perform error recovery. *)
-
-  val recovery: bool
-
-  (* The parser indicates whether to generate a trace. Generating a
-     trace requires two extra tables, which respectively map a
-     terminal symbol and a production to a string. *)
-
-  val trace: (string array * string array) option
-
-end
-
diff --git a/menhirlib/tableInterpreter.ml b/menhirlib/tableInterpreter.ml
deleted file mode 100644 (file)
index cc49874..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  Menhir                                                                *)
-(*                                                                        *)
-(*  François Pottier, INRIA Rocquencourt                                  *)
-(*  Yann Régis-Gianas, PPS, Université Paris Diderot                      *)
-(*                                                                        *)
-(*  Copyright 2005-2008 Institut National de Recherche en Informatique    *)
-(*  et en Automatique. All rights reserved. This file is distributed      *)
-(*  under the terms of the GNU Library General Public License, with the   *)
-(*  special exception on linking described in file LICENSE.               *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* This module instantiates the generic [Engine] with a thin decoding layer
-   for the generated tables. Like [Engine], it is part of [MenhirLib]. *)
-
-(* The exception [Accept] is pre-declared here: this obviates the need
-   for generating its definition. The exception [Error] is declared
-   within the generated parser. This is preferable to pre-declaring it
-   here, as it ensures that each parser gets its own, distinct [Error]
-   exception. This is consistent with the code-based back-end. *)
-
-exception Accept of Obj.t
-
-(* This functor is invoked by the generated parser. *)
-
-module Make (T : TableFormat.TABLES)
-
-= Engine.Make (struct
-
-  type state =
-      int
-
-  type token =
-      T.token
-
-  type terminal =
-      int
-
-  type semantic_value =
-      Obj.t
-
-  let token2terminal =
-    T.token2terminal
-
-  let token2value =
-    T.token2value
-
-  let error_terminal =
-    T.error_terminal
-
-  let error_value =
-    Obj.repr ()
-
-  type production =
-      int
-
-  let default_reduction state defred nodefred env =
-    let code = PackedIntArray.get T.default_reduction state in
-    if code = 0 then
-      nodefred env
-    else
-      defred env (code - 1)
-
-  (* This auxiliary function helps access a compressed, two-dimensional
-     matrix, like the action and goto tables. *)
-
-  let unmarshal2 table i j =
-    RowDisplacement.getget
-      PackedIntArray.get
-      PackedIntArray.get
-      table
-      i j
-
-  (* This auxiliary function helps access a flattened, two-dimensional
-     matrix, like the error bitmap. *)
-
-  let unflatten (n, data) i j =
-    PackedIntArray.get1 data (n * i + j)
-
-  let action state terminal value shift reduce fail env =
-    match unflatten T.error state terminal with
-    | 1 ->
-       let action = unmarshal2 T.action state terminal in
-       let opcode = action land 0b11
-       and param = action lsr 2 in
-       if opcode >= 0b10 then
-         (* 0b10 : shift/discard *)
-         (* 0b11 : shift/nodiscard *)
-         let please_discard = (opcode = 0b10) in
-         shift env please_discard terminal value param
-       else
-         (* 0b01 : reduce *)
-         (* 0b00 : cannot happen *)
-         reduce env param
-    | c ->
-       assert (c = 0);
-       fail env
-
-  let goto state prod =
-    let code = unmarshal2 T.goto state (PackedIntArray.get T.lhs prod) in
-    (* code = 1 + state *)
-    code - 1
-
-  exception Accept =
-       Accept
-
-  exception Error =
-       T.Error
-
-  type semantic_action =
-      (state, semantic_value, token) EngineTypes.env -> unit
-
-  let semantic_action prod =
-    T.semantic_action.(prod)
-
-  let recovery =
-    T.recovery
-
-  module Log = struct
-
-    open Printf
-
-    let state state =
-      match T.trace with
-      | Some _ ->
-          fprintf stderr "State %d:\n%!" state
-      | None ->
-         ()
-
-    let shift terminal state =
-      match T.trace with
-      | Some (terminals, _) ->
-          fprintf stderr "Shifting (%s) to state %d\n%!" terminals.(terminal) state
-      | None ->
-         ()
-
-    let reduce_or_accept prod =
-      match T.trace with
-      | Some (_, productions) ->
-          fprintf stderr "%s\n%!" productions.(prod)
-      | None ->
-         ()
-
-    let lookahead_token lexbuf token =
-      match T.trace with
-      | Some (terminals, _) ->
-          fprintf stderr "Lookahead token is now %s (%d-%d)\n%!"
-            terminals.(token)
-            lexbuf.Lexing.lex_start_p.Lexing.pos_cnum
-            lexbuf.Lexing.lex_curr_p.Lexing.pos_cnum
-      | None ->
-         ()
-
-    let initiating_error_handling () =
-      match T.trace with
-      | Some _ ->
-          fprintf stderr "Initiating error handling\n%!"
-      | None ->
-         ()
-
-    let resuming_error_handling () =
-      match T.trace with
-      | Some _ ->
-          fprintf stderr "Resuming error handling\n%!"
-      | None ->
-         ()
-
-    let handling_error state =
-      match T.trace with
-      | Some _ ->
-          fprintf stderr "Handling error in state %d\n%!" state
-      | None ->
-         ()
-
-    let discarding_last_token token =
-      match T.trace with
-      | Some (terminals, _) ->
-          fprintf stderr "Discarding last token read (%s)\n%!" terminals.(token)
-      | None ->
-         ()
-
-  end
-
-end)
index 3579620..d316e40 100644 (file)
@@ -1,9 +1,12 @@
 ##############################################################################
 # Variables
 ##############################################################################
-#TARGET=cocciocaml
--include ../Makefile.config
--include Makefile.doc
+
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
+
+include Makefile.doc
 
 TARGET=cocciocaml
 
@@ -27,13 +30,10 @@ SYSLIBS= str.cma unix.cma
 OCAMLCFLAGS ?= -g -dtypes
 OPTFLAGS?=$(OCAMLCFLAGS)
 
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLLEX=ocamllex$(OPTBIN) #-ml
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 OBJS = $(SRC:.ml=.cmo)
 OPTOBJS = $(SRC:.ml=.cmx)
@@ -46,13 +46,13 @@ all: $(TARGET).cma
 all.opt: $(TARGET).cmxa
 
 $(TARGET).cma: $(OBJS)
-       $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
+       $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
 
 $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
 
 $(TARGET).top: $(OBJS) $(LIBS)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 clean::
        rm -f $(TARGET).top
@@ -70,25 +70,29 @@ clean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
 clean::
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
        rm -f *~ .*~ gmon.out #*#
-
-distclean::
        rm -f .depend
 
-beforedepend::
+distclean: clean
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml    > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+ifneq ($(MAKECMDGOALS),cleandoc)
 -include .depend
+endif
+endif
+endif
index 1a197f4..62b0b9f 100644 (file)
@@ -1,20 +1,25 @@
-OCAMLDOC=ocamldoc
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
+
 API=coccilib.mli
 DEST=../docs
 FLAGS=$(INCLUDES) -hide Pervasives
 HTMLFLAGS=-all-params -colorize-code
 MANFLAGS=-man-mini
 
-.PHONY:
+.PHONY: doc
 
 doc: html man
 
-html:
-       mkdir -p $(DEST)/html
+html: $(DEST)/html/index.html
+$(DEST)/html/index.html: $(API) ../parsing_c/ast_c.cmi
+       $(MKDIR_P) $(DEST)/html
        $(OCAMLDOC) $(FLAGS) -html $(HTMLFLAGS) -d $(DEST)/html $(API)
 
-man:
-       mkdir -p $(DEST)/man
+man: $(DEST)/man/Coccilib.3o
+$(DEST)/man/Coccilib.3o: $(API) ../parsing_c/ast_c.cmi
+       $(MKDIR_P) $(DEST)/man
        $(OCAMLDOC) $(FLAGS) -man $(MANFLAGS) -d $(DEST)/man $(API)
 
 cleandoc:
diff --git a/ocaml/prepare_ocamlcocci.ml b/ocaml/prepare_ocamlcocci.ml
deleted file mode 100644 (file)
index 94bc873..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include Yes_prepare_ocamlcocci
index 06f66db..0baacfa 100644 (file)
@@ -1 +1 @@
-include @OCAMLCOCCI_FILE@
+include @OCAMLCOCCI_MODULE@
index 736f34e..6e81ebd 100644 (file)
@@ -3,7 +3,7 @@ module Ast = Ast_cocci
 exception CompileFailure of string
 exception LinkFailure of string
 
-let ext = if Dynlink.is_native then ".cmxs" else ".cma"
+let ext = if Config.dynlink_is_native then ".cmxs" else ".cma"
 
 let sysdir () =
   let sysdircmd = !Flag.ocamlfind ^ " printconf stdlib" in
@@ -17,21 +17,28 @@ let check_cmd cmd =
       Unix.WEXITED 0 -> true
     | _ -> false
 
+(* this function does not work when the executable has an extension like .exe *)
+let to_opt cmd =
+  let n = String.length cmd in
+  if n > 4 && String.compare (String.sub cmd (n-4) 4) ".opt" == 0
+  then cmd
+  else cmd ^ ".opt"
+
 let check_runtime () =
-  let has_opt  = check_cmd (!Flag.ocamlc ^".opt -version 2>&1 > /dev/null") in
-  let has_c    = check_cmd (!Flag.ocamlc ^" -version 2>&1 > /dev/null") in
+  let has_opt  = check_cmd (to_opt (!Flag.ocamlc) ^ " -version 2>&1 > /dev/null") in
+  let has_c    = check_cmd (to_opt (!Flag.ocamlc) ^ " -version 2>&1 > /dev/null") in
     if has_opt then
       begin
-       Flag.ocamlc   := !Flag.ocamlc   ^ ".opt";
-       Flag.ocamlopt := !Flag.ocamlopt ^ ".opt";
-       Flag.ocamldep := !Flag.ocamldep ^ ".opt";
+       Flag.ocamlc   := to_opt (!Flag.ocamlc);
+       Flag.ocamlopt := to_opt (!Flag.ocamlopt);
+       Flag.ocamldep := to_opt (!Flag.ocamldep);
        Common.pr2 "Using native version of ocamlc/ocamlopt/ocamldep"
       end
     else
       if has_c then
        Common.pr2 "Using bytecode version of ocamlc/ocamlopt/ocamldep"
       else
-       if Dynlink.is_native then
+       if Config.dynlink_is_native then
          failwith
            "No OCaml compiler found! Install either ocamlopt or ocamlopt.opt"
        else
@@ -370,7 +377,7 @@ let load_file mlfile =
     "-thread -g -dtypes -I %s %s -I %s/globals -I %s/ocaml -I %s/parsing_c -I %s/commons "
       (sysdir ()) inc Config.path Config.path Config.path Config.path in
   let (obj, cmd) =
-    if Dynlink.is_native
+    if Config.dynlink_is_native
     then compile_native_cmd flags mlfile
     else compile_bytecode_cmd flags mlfile in
   compile mlfile cmd;
@@ -385,7 +392,7 @@ let load_file mlfile =
 let clean_file mlfile =
   let basefile = Filename.chop_extension mlfile in
   let files =
-    if Dynlink.is_native then
+    if Config.dynlink_is_native then
       [basefile ^ ".cmxs";
        basefile ^ ".cmx";
        basefile ^ ".o";
diff --git a/ocamlsexp/Makefile b/ocamlsexp/Makefile
deleted file mode 100644 (file)
index f72b85b..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-##############################################################################
-# Variables
-##############################################################################
-
-SRC= \
-  type.ml \
-  parser.ml \
-  lexer.ml \
-  pre_sexp.ml \
-  sexp_intf.ml \
-  sexp.ml \
-  path.ml \
-  conv.ml \
-  conv_error.ml
-#SOURCES = \
-#  parser.mly \
-#  lexer.mll \
-# sexp.mli path.mli conv.mli
-
-
-TARGET=sexplib
-TARGETPACK=sexplib
-LIB_PACK_NAME = Sexplib
-
-##############################################################################
-# Generic variables
-##############################################################################
-
-INCLUDES=
-#-I +camlp4
-SYSLIBS= str.cma unix.cma bigarray.cma num.cma
-#INCDIRS = +camlp4
-#pad: take care for bigarray otherwise get some caml_ba_get_1 error msg
-
-##############################################################################
-#OCAMLFLAGS = -for-pack Sexplib
-
-#PACKS = type-conv
-#RESULT = sexplib
-
-#TRASH = pa_sexp_conv.cmi pa_sexp_conv.cmo pa_sexp_conv.annot
-
-#all: \
-#      pack-byte-code pack-native-code \
-#      sexplib.cma sexplib.cmxa \
-#      pa_sexp_conv.cmi pa_sexp_conv.cmo
-#
-#LIBINSTALL_FILES = \
-#  sexp.mli path.mli conv.mli \
-#  sexplib.cmi sexplib.cma sexplib.cmxa sexplib.a \
-#  pa_sexp_conv.cmi pa_sexp_conv.cmo
-#
-#install:      libinstall
-#uninstall:    libuninstall
-#
-#clean::       clean-doc
-#
-#-include $(OCAMLMAKEFILE)
-
-##############################################################################
-
-##############################################################################
-# Generic variables
-##############################################################################
-
-#dont use -custom, it makes the bytecode unportable.
-OCAMLCFLAGS ?= -g -dtypes # -w A
-#-for-pack Sexplib
-
-# This flag is also used in subdirectories so don't change its name here.
-OPTFLAGS=
-
-
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS)  $(INCLUDES)  $(SYSINCLUDES) -thread
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) $(SYSINCLUDES) -thread
-OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) -thread
-
-#-ccopt -static
-STATIC=
-
-
-##############################################################################
-# Top rules
-##############################################################################
-
-OBJS = $(SRC:.ml=.cmo)
-OPTOBJS = $(SRC:.ml=.cmx)
-
-all: $(TARGET).cma $(TARGETPACK).cmo
-all.opt: $(TARGET).cmxa $(TARGETPACK).cmx
-
-$(TARGET).cma: $(OBJS)
-       $(OCAMLC) -a -o $@ $(OBJS)
-
-$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $@ $(OPTOBJS)
-
-$(TARGET).top: $(OBJS) $(LIBS)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
-
-clean::
-       rm -f $(TARGET).top
-
-$(TARGETPACK).cmo: $(OBJS)
-       $(OCAMLC) -pack -o $@ $(OBJS)
-
-$(TARGETPACK).cmx: $(OPTOBJS)
-       $(OCAMLOPT) -pack -o $@ $(OPTOBJS)
-
-# special handling, fun that they use cpp whereas they claim camplp4 can do everything
-pre_sexp.cmo: pre_sexp.ml
-       $(OCAMLC) -pp "cpp -w" -c $<
-
-pre_sexp.cmx: pre_sexp.ml
-       $(OCAMLOPT) -for-pack $(LIB_PACK_NAME) -pp "cpp -w" -c $<
-
-
-
-lexer.ml: lexer.mll
-       $(OCAMLLEX) $<
-clean::
-       rm -f lexer.ml
-beforedepend:: lexer.ml
-
-
-parser.ml parser.mli: parser.mly
-       $(OCAMLYACC) $<
-clean::
-       rm -f parser.ml parser.mli parser.output
-beforedepend:: parser.ml parser.mli
-
-
-
-##############################################################################
-# Generic rules
-##############################################################################
-
-.SUFFIXES: .ml .mli .cmo .cmi .cmx
-
-.ml.cmo:
-       $(OCAMLC) -c $<
-.mli.cmi:
-       $(OCAMLC) -c $<
-
-.ml.cmx:
-       $(OCAMLOPT) -for-pack $(LIB_PACK_NAME) -c $<
-
-.ml.mldepend:
-       $(OCAMLC) -i $<
-
-clean::
-       rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
-clean::
-       rm -f *~ .*~ gmon.out #*#
-
-beforedepend::
-
-# need also -pp cpp here
-depend:: beforedepend
-       $(OCAMLDEP) -pp "cpp -w" *.mli *.ml    > .depend
-
-distclean: clean
-       rm -f .depend
-
--include .depend
diff --git a/ocamlsexp/conv.ml b/ocamlsexp/conv.ml
deleted file mode 100644 (file)
index 9955924..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-(* File: conv.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(* Conv: Utility Module for S-expression Conversions *)
-
-open Printf
-open Bigarray
-open Sexp
-
-type 'a sexp_option = 'a option
-
-(* Conversion of OCaml-values to S-expressions *)
-
-let default_string_of_float = ref (fun n -> sprintf "%.20G" n)
-let read_old_option_format = ref true
-let write_old_option_format = ref true
-
-let sexp_of_unit () = List []
-let sexp_of_bool b = Atom (string_of_bool b)
-let sexp_of_string str = Atom str
-let sexp_of_char c = Atom (String.make 1 c)
-let sexp_of_int n = Atom (string_of_int n)
-let sexp_of_float n = Atom (!default_string_of_float n)
-let sexp_of_int32 n = Atom (Int32.to_string n)
-let sexp_of_int64 n = Atom (Int64.to_string n)
-let sexp_of_nativeint n = Atom (Nativeint.to_string n)
-let sexp_of_big_int n = Atom (Big_int.string_of_big_int n)
-let sexp_of_nat n = Atom (Nat.string_of_nat n)
-let sexp_of_num n = Atom (Num.string_of_num n)
-let sexp_of_ratio n = Atom (Ratio.string_of_ratio n)
-let sexp_of_ref sexp_of__a rf = sexp_of__a !rf
-let sexp_of_lazy sexp_of__a lv = sexp_of__a (Lazy.force lv)
-
-let sexp_of_option sexp_of__a = function
-  | Some x when !write_old_option_format -> List [sexp_of__a x]
-  | Some x -> List [Atom "some"; sexp_of__a x]
-  | None when !write_old_option_format -> List []
-  | None -> Atom "none"
-
-let sexp_of_pair sexp_of__a sexp_of__b (a, b) =
-  List [sexp_of__a a; sexp_of__b b]
-
-let sexp_of_triple sexp_of__a sexp_of__b sexp_of__c (a, b, c) =
-  List [sexp_of__a a; sexp_of__b b; sexp_of__c c]
-
-let sexp_of_list sexp_of__a lst =
-  List (List.rev (List.rev_map sexp_of__a lst))
-
-let sexp_of_array sexp_of__a ar =
-  let lst_ref = ref [] in
-  for i = Array.length ar - 1 downto 0 do
-    lst_ref := sexp_of__a ar.(i) :: !lst_ref
-  done;
-  List !lst_ref
-
-let sexp_of_hashtbl sexp_of_key sexp_of_val htbl =
-  let coll k v acc = List [sexp_of_key k; sexp_of_val v] :: acc in
-  List (Hashtbl.fold coll htbl [])
-
-let sexp_of_float_vec vec =
-  let lst_ref = ref [] in
-  for i = Array1.dim vec downto 1 do
-    lst_ref := sexp_of_float vec.{i} :: !lst_ref
-  done;
-  List !lst_ref
-
-type vec32 = (float, float32_elt, fortran_layout) Array1.t
-type vec64 = (float, float64_elt, fortran_layout) Array1.t
-let sexp_of_float32_vec (vec : vec32) = sexp_of_float_vec vec
-let sexp_of_float64_vec (vec : vec64) = sexp_of_float_vec vec
-let sexp_of_vec (vec : vec64) = sexp_of_float_vec vec
-
-let sexp_of_float_mat mat =
-  let m = Array2.dim1 mat in
-  let n = Array2.dim2 mat in
-  let lst_ref = ref [] in
-  for col = n downto 1 do
-    let vec = Array2.slice_right mat col in
-    for row = m downto 1 do
-      lst_ref := sexp_of_float vec.{row} :: !lst_ref
-    done
-  done;
-  List (sexp_of_int m :: sexp_of_int n :: !lst_ref)
-
-type mat32 = (float, float32_elt, fortran_layout) Array2.t
-type mat64 = (float, float64_elt, fortran_layout) Array2.t
-let sexp_of_float32_mat (mat : mat32) = sexp_of_float_mat mat
-let sexp_of_float64_mat (mat : mat64) = sexp_of_float_mat mat
-let sexp_of_mat (mat : mat64) = sexp_of_float_mat mat
-
-let sexp_of_abstr _ = Atom "<abstr>"
-let sexp_of_fun _ = Atom "<fun>"
-
-type 'a opaque = 'a
-let sexp_of_opaque _ _ = Atom "<opaque>"
-
-let string_of__of__sexp_of to_sexp x = Sexp.to_string (to_sexp x)
-
-
-(* Conversion of S-expressions to OCaml-values *)
-
-exception Of_sexp_error of string * Sexp.t
-
-let record_check_extra_fields = ref true
-
-let of_sexp_error what sexp = raise (Of_sexp_error (what, sexp))
-
-let unit_of_sexp sexp = match sexp with
-  | List [] -> ()
-  | Atom _ | List _ -> of_sexp_error "unit_of_sexp: empty list needed" sexp
-
-let bool_of_sexp sexp = match sexp with
-  | Atom ("true" | "True") -> true
-  | Atom ("false" | "False") -> false
-  | Atom _ -> of_sexp_error "bool_of_sexp: unknown string" sexp
-  | List _ -> of_sexp_error "bool_of_sexp: atom needed" sexp
-
-let string_of_sexp sexp = match sexp with
-  | Atom str -> str
-  | List _ -> of_sexp_error "string_of_sexp: atom needed" sexp
-
-let char_of_sexp sexp = match sexp with
-  | Atom str ->
-      if String.length str <> 1 then
-        of_sexp_error
-          "char_of_sexp: atom string must contain one character only" sexp;
-      str.[0]
-  | List _ -> of_sexp_error "char_of_sexp: atom needed" sexp
-
-let int_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try int_of_string str
-      with exc -> of_sexp_error ("int_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "int_of_sexp: atom needed" sexp
-
-let float_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try float_of_string str
-      with exc ->
-        of_sexp_error ("float_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "float_of_sexp: atom needed" sexp
-
-let int32_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Int32.of_string str
-      with exc ->
-        of_sexp_error ("int32_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "int32_of_sexp: atom needed" sexp
-
-let int64_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Int64.of_string str
-      with exc ->
-        of_sexp_error ("int64_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "int64_of_sexp: atom needed" sexp
-
-let nativeint_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Nativeint.of_string str
-      with exc ->
-        of_sexp_error ("nativeint_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "nativeint_of_sexp: atom needed" sexp
-
-let big_int_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Big_int.big_int_of_string str
-      with exc ->
-        of_sexp_error ("big_int_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "big_int_of_sexp: atom needed" sexp
-
-let nat_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Nat.nat_of_string str
-      with exc ->
-        of_sexp_error ("nat_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "nat_of_sexp: atom needed" sexp
-
-let num_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Num.num_of_string str
-      with exc ->
-        of_sexp_error ("num_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "num_of_sexp: atom needed" sexp
-
-let ratio_of_sexp sexp = match sexp with
-  | Atom str ->
-      (try Ratio.ratio_of_string str
-      with exc ->
-        of_sexp_error ("ratio_of_sexp: " ^ Printexc.to_string exc) sexp)
-  | List _ -> of_sexp_error "ratio_of_sexp: atom needed" sexp
-
-let ref_of_sexp a__of_sexp sexp = ref (a__of_sexp sexp)
-let lazy_of_sexp a__of_sexp sexp = lazy (a__of_sexp sexp)
-
-let option_of_sexp a__of_sexp sexp =
-  if !read_old_option_format then
-    match sexp with
-    | List [] | Atom ("none" | "None") -> None
-    | List [el] | List [Atom ("some" | "Some"); el] -> Some (a__of_sexp el)
-    | List _ ->
-        of_sexp_error "option_of_sexp: list must represent optional value" sexp
-    | Atom _ -> of_sexp_error "option_of_sexp: only none can be atom" sexp
-  else
-    match sexp with
-    | Atom ("none" | "None") -> None
-    | List [Atom ("some" | "Some"); el] -> Some (a__of_sexp el)
-    | Atom _ -> of_sexp_error "option_of_sexp: only none can be atom" sexp
-    | List _ -> of_sexp_error "option_of_sexp: list must be (some el)" sexp
-
-let pair_of_sexp a__of_sexp b__of_sexp sexp = match sexp with
-  | List [a_sexp; b_sexp] ->
-      let a = a__of_sexp a_sexp in
-      let b = b__of_sexp b_sexp in
-      a, b
-  | List _ ->
-      of_sexp_error
-        "pair_of_sexp: list must contain exactly two elements only" sexp
-  | Atom _ -> of_sexp_error "pair_of_sexp: list needed" sexp
-
-let triple_of_sexp a__of_sexp b__of_sexp c__of_sexp sexp = match sexp with
-  | List [a_sexp; b_sexp; c_sexp] ->
-      let a = a__of_sexp a_sexp in
-      let b = b__of_sexp b_sexp in
-      let c = c__of_sexp c_sexp in
-      a, b, c
-  | List _ ->
-      of_sexp_error
-        "triple_of_sexp: list must contain exactly three elements only" sexp
-  | Atom _ -> of_sexp_error "triple_of_sexp: list needed" sexp
-
-let list_of_sexp a__of_sexp sexp = match sexp with
-  | List lst ->
-      let rev_lst = List.rev_map a__of_sexp lst in
-      List.rev rev_lst
-  | Atom _ -> of_sexp_error "list_of_sexp: list needed" sexp
-
-let array_of_sexp a__of_sexp sexp = match sexp with
-  | List [] -> [||]
-  | List (h :: t) ->
-      let len = List.length t + 1 in
-      let res = Array.create len (a__of_sexp h) in
-      let rec loop i = function
-        | [] -> res
-        | h :: t -> res.(i) <- a__of_sexp h; loop (i + 1) t in
-      loop 1 t
-  | Atom _ -> of_sexp_error "array_of_sexp: list needed" sexp
-
-let hashtbl_of_sexp key_of_sexp val_of_sexp sexp = match sexp with
-  | List lst ->
-      let htbl = Hashtbl.create 0 in
-      let act = function
-        | List [k_sexp; v_sexp] ->
-            Hashtbl.add htbl (key_of_sexp k_sexp) (val_of_sexp v_sexp)
-        | List _ | Atom _ ->
-            of_sexp_error "hashtbl_of_sexp: tuple list needed" sexp
-      in
-      List.iter act lst;
-      htbl
-  | Atom _ -> of_sexp_error "hashtbl_of_sexp: list needed" sexp
-
-let float_vec_of_sexp empty_float_vec create_float_vec sexp = match sexp with
-  | List [] -> empty_float_vec
-  | List lst ->
-      let len = List.length lst in
-      let res = create_float_vec len in
-      let rec loop i = function
-        | [] -> res
-        | h :: t -> res.{i} <- float_of_sexp h; loop (i + 1) t in
-      loop 1 lst
-  | Atom _ -> of_sexp_error "float_vec_of_sexp: list needed" sexp
-
-let create_float32_vec = Array1.create float32 fortran_layout
-let create_float64_vec = Array1.create float64 fortran_layout
-let empty_float32_vec = create_float32_vec 0
-let empty_float64_vec = create_float64_vec 0
-let float32_vec_of_sexp = float_vec_of_sexp empty_float32_vec create_float32_vec
-let float64_vec_of_sexp = float_vec_of_sexp empty_float64_vec create_float64_vec
-let vec_of_sexp = float_vec_of_sexp empty_float64_vec create_float64_vec
-
-let check_too_much_data sexp data res =
-  if data = [] then res
-  else of_sexp_error "float_mat_of_sexp: too much data" sexp
-
-let float_mat_of_sexp create_float_mat sexp = match sexp with
-  | List (sm :: sn :: data) ->
-      let m = int_of_sexp sm in
-      let n = int_of_sexp sn in
-      let res = create_float_mat m n in
-      if m = 0 || n = 0 then check_too_much_data sexp data res
-      else
-        let rec loop_cols col data =
-          let vec = Array2.slice_right res col in
-          let rec loop_rows row = function
-            | [] -> of_sexp_error "float_mat_of_sexp: not enough data" sexp
-            | h :: t ->
-                vec.{row} <- float_of_sexp h;
-                if row = m then
-                  if col = n then check_too_much_data sexp t res
-                  else loop_cols (col + 1) t
-                else loop_rows (row + 1) t in
-          loop_rows 1 data in
-        loop_cols 1 data
-  | List _ -> of_sexp_error "float_mat_of_sexp: list too short" sexp
-  | Atom _ -> of_sexp_error "float_mat_of_sexp: list needed" sexp
-
-let create_float32_mat = Array2.create float32 fortran_layout
-let create_float64_mat = Array2.create float64 fortran_layout
-
-let float32_mat_of_sexp = float_mat_of_sexp create_float32_mat
-let float64_mat_of_sexp = float_mat_of_sexp create_float64_mat
-let mat_of_sexp = float_mat_of_sexp create_float64_mat
-
-let fun_of_sexp sexp =
-  of_sexp_error "fun_of_sexp: cannot convert function values" sexp
-
-let of_string__of__of_sexp of_sexp s =
-  try
-    let sexp = Sexp.of_string s in
-    of_sexp sexp
-  with e ->
-    failwith (sprintf "of_string failed on %s with %s" s (Printexc.to_string e))
diff --git a/ocamlsexp/modif-orig.txt b/ocamlsexp/modif-orig.txt
deleted file mode 100644 (file)
index 9413d40..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-I use in a different way sexplib. I don't like camlp4 but I like the
-metaprogramming facility it offers. So I've found a in-the-middle
-solution where I use camlp4 to generate code (via a small script
-I have written, not included here for the moment), save the generated code
-in a file (e.g commons/sexp_common.ml), which allows then to 
-completely remove the dependency to camlp4. This means among
-other things that the file pa_sexp_conv.ml is not here, as
-I include here only the runtime library for sexp, not the
-camlp4 stuff. As I also didn't like their compilation process,
-with the need for findlib, -pack options, etc, I have rewritten a Makefile.
-
--- pad 
-
-Here are the modifications I've made to the sexplib lib/ directory.
-
-diff -u -p -b -B -r -x .semantic.cache -x .depend -x CVS -x .hg -x .svn -x .git -x _darcs -x *.cm[iao] -x *.[oa] -x *.class /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/ /home/pad/c-coccinelle/ocamlsexp
-Only in /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/: META
-diff -u -p -b -B -r -x .semantic.cache -x .depend -x CVS -x .hg -x .svn -x .git -x _darcs -x '*.cm[iao]' -x '*.[oa]' -x '*.class' /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/Makefile /home/pad/c-coccinelle/ocamlsexp/Makefile
---- /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/Makefile    2009-03-09 19:52:09.000000000 -0500
-+++ /home/pad/c-coccinelle/ocamlsexp/Makefile  2009-04-15 22:04:59.000000000 -0500
-@@ -1,36 +1,166 @@
--OCAMLMAKEFILE = ../OCamlMakefile
-+##############################################################################
-+# Variables
-+##############################################################################
--SOURCES = \
-+SRC= \
-   type.ml \
--  parser.mly \
--  lexer.mll \
-+  parser.ml \
-+  lexer.ml \
-   pre_sexp.ml \
-   sexp_intf.ml \
--  sexp.mli sexp.ml \
--  path.mli path.ml \
--  conv.mli conv.ml \
-+  sexp.ml \
-+  path.ml \
-+  conv.ml \
-   conv_error.ml
--LIB_PACK_NAME = sexplib
--INCDIRS = +camlp4
--OCAMLFLAGS = -for-pack Sexplib
--PACKS = type-conv
--RESULT = sexplib
--
--TRASH = pa_sexp_conv.cmi pa_sexp_conv.cmo pa_sexp_conv.annot
--
--all: \
--      pack-byte-code pack-native-code \
--      sexplib.cma sexplib.cmxa \
--      pa_sexp_conv.cmi pa_sexp_conv.cmo
--
--LIBINSTALL_FILES = \
--  sexp.mli path.mli conv.mli \
--  sexplib.cmi sexplib.cma sexplib.cmxa sexplib.a \
--  pa_sexp_conv.cmi pa_sexp_conv.cmo
-+#SOURCES = \
-+#  parser.mly \
-+#  lexer.mll \
-+# sexp.mli path.mli conv.mli 
--install:      libinstall
--uninstall:    libuninstall
--clean::       clean-doc
-+TARGET=sexplib1
-+TARGETPACK=sexplib
-+#LIB_PACK_NAME = sexplib
---include $(OCAMLMAKEFILE)
-+##############################################################################
-+# Generic variables
-+##############################################################################
-+
-+INCLUDES=
-+#-I +camlp4
-+SYSLIBS= str.cma unix.cma bigarray.cma num.cma
-+#INCDIRS = +camlp4
-+#pad: take care for bigarray otherwise get some caml_ba_get_1 error msg
-+
-+##############################################################################
-+#OCAMLFLAGS = -for-pack Sexplib
-+
-+#PACKS = type-conv
-+#RESULT = sexplib
-+
-+#TRASH = pa_sexp_conv.cmi pa_sexp_conv.cmo pa_sexp_conv.annot
-+
-+#all: \
-+#     pack-byte-code pack-native-code \
-+#     sexplib.cma sexplib.cmxa \
-+#     pa_sexp_conv.cmi pa_sexp_conv.cmo
-+#
-+#LIBINSTALL_FILES = \
-+#  sexp.mli path.mli conv.mli \
-+#  sexplib.cmi sexplib.cma sexplib.cmxa sexplib.a \
-+#  pa_sexp_conv.cmi pa_sexp_conv.cmo
-+#
-+#install:     libinstall
-+#uninstall:   libuninstall
-+#
-+#clean::      clean-doc
-+#
-+#-include $(OCAMLMAKEFILE)
-+
-+##############################################################################
-+
-+##############################################################################
-+# Generic variables
-+##############################################################################
-+
-+#dont use -custom, it makes the bytecode unportable.
-+OCAMLCFLAGS= -g -dtypes # -w A
-+#-for-pack Sexplib
-+
-+# This flag is also used in subdirectories so don't change its name here.
-+OPTFLAGS=
-+
-+
-+OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS)  $(INCLUDES)  $(SYSINCLUDES) -thread
-+OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) $(SYSINCLUDES) -thread
-+OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
-+OCAMLYACC=ocamlyacc -v
-+OCAMLDEP=ocamldep $(INCLUDES)
-+OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) -thread
-+
-+#-ccopt -static
-+STATIC=
-+
-+
-+##############################################################################
-+# Top rules
-+##############################################################################
-+
-+OBJS = $(SRC:.ml=.cmo)
-+OPTOBJS = $(SRC:.ml=.cmx)
-+
-+all: $(TARGET).cma $(TARGETPACK).cmo
-+all.opt: $(TARGET).cmxa
-+
-+$(TARGET).cma: $(OBJS)
-+      $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
-+
-+$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-+      $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
-+
-+$(TARGET).top: $(OBJS) $(LIBS)
-+      $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
-+
-+clean::
-+      rm -f $(TARGET).top
-+
-+
-+
-+$(TARGETPACK).cmo: $(OBJS)
-+      $(OCAMLC) -pack -o $(TARGETPACK).cmo $(OBJS)
-+
-+# special handling, fun that they use cpp whereas they claim camplp4 can do everything
-+pre_sexp.cmo: pre_sexp.ml
-+      $(OCAMLC) -pp cpp -c $<
-+
-+pre_sexp.cmx: pre_sexp.ml
-+      $(OCAMLOPT) -pp cpp -c $<
-+
-+
-+
-+lexer.ml: lexer.mll
-+      $(OCAMLLEX) $<
-+clean::
-+      rm -f lexer.ml
-+beforedepend:: lexer.ml
-+
-+
-+parser.ml parser.mli: parser.mly
-+      $(OCAMLYACC) $<
-+clean::
-+      rm -f parser.ml parser.mli parser.output
-+beforedepend:: parser.ml parser.mli
-+
-+
-+
-+##############################################################################
-+# Generic rules
-+##############################################################################
-+
-+.SUFFIXES: .ml .mli .cmo .cmi .cmx
-+
-+.ml.cmo:
-+      $(OCAMLC) -c $<
-+.mli.cmi:
-+      $(OCAMLC) -c $<
-+.ml.cmx:
-+      $(OCAMLOPT) -c $<
-+
-+.ml.mldepend: 
-+      $(OCAMLC) -i $<
-+
-+clean::
-+      rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
-+clean::
-+      rm -f *~ .*~ gmon.out #*#
-+
-+beforedepend::
-+
-+# need also -pp cpp here
-+depend:: beforedepend
-+      $(OCAMLDEP) -pp cpp *.mli *.ml    > .depend
-+
-+distclean:
-+      rm -f .depend
-+
-+-include .depend
-Only in /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/: OMakefile
-Only in /home/pad/c-coccinelle/ocamlsexp: copyright.txt
-Only in /home/pad/c-coccinelle/ocamlsexp: license-tywith.txt
-Only in /home/pad/c-coccinelle/ocamlsexp: license.txt
-Only in /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/: pa_sexp_conv.ml
-Only in /home/pad/reference/dev-ocaml/orig/ocamljane-orig/sexplib310-3.7.4/lib/: pa_sexp_conv.mli
-
-Diff finished.  Thu Apr 16 10:57:39 2009
diff --git a/ocamlsexp/parser.mly b/ocamlsexp/parser.mly
deleted file mode 100644 (file)
index f53a559..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-%{
-  (* File: parser.mly
-
-      Copyright (C) 2005-
-
-        Jane Street Holding, LLC
-        Author: Markus Mottl
-        email: mmottl@janestcapital.com
-        WWW: http://www.janestcapital.com/ocaml
-
-     This library is free software; you can redistribute it and/or
-     modify it under the terms of the GNU Lesser General Public
-     License as published by the Free Software Foundation; either
-     version 2 of the License, or (at your option) any later version.
-
-     This library is distributed in the hope that it will be useful,
-     but WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     Lesser General Public License for more details.
-
-     You should have received a copy of the GNU Lesser General Public
-     License along with this library; if not, write to the Free Software
-     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  *)
-
-  (** Parser: Grammar Specification for Parsing S-expressions *)
-
-  open Lexing
-
-  let parse_failure what =
-    let pos = symbol_start_pos () in
-    let msg =
-      Printf.sprintf "Sexplib.Parser: failed to parse line %d char %d: %s"
-        pos.pos_lnum (pos.pos_cnum - pos.pos_bol) what in
-    failwith msg
-%}
-
-%token <string> STRING
-%token LPAREN RPAREN EOF
-
-%start sexp
-%type <Type.t> sexp
-
-%start sexp_opt
-%type <Type.t option> sexp_opt
-
-%start sexps
-%type <Type.t list> sexps
-
-%start rev_sexps
-%type <Type.t list> rev_sexps
-
-%%
-
-sexp
-  : STRING { Type.Atom $1 }
-  | LPAREN RPAREN { Type.List [] }
-  | LPAREN rev_sexps_aux RPAREN { Type.List (List.rev $2) }
-  | error { parse_failure "sexp" }
-
-sexp_opt
-  : sexp { Some $1 }
-  | EOF { None }
-
-rev_sexps_aux
-  : sexp { [$1] }
-  | rev_sexps_aux sexp { $2 :: $1 }
-
-rev_sexps
-  : rev_sexps_aux { $1 }
-  | EOF { [] }
-
-sexps
-  : rev_sexps_aux { List.rev $1 }
-  | EOF { [] }
diff --git a/ocamlsexp/pre_sexp.ml b/ocamlsexp/pre_sexp.ml
deleted file mode 100644 (file)
index 63d2429..0000000
+++ /dev/null
@@ -1,680 +0,0 @@
-(*pp cpp *)
-
-(* File: sexp.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(* Sexp: Module for handling S-expressions (I/O, etc.) *)
-
-open Format
-
-include Type
-
-(* Default indentation level for human-readable conversions *)
-
-let default_indent = ref 1
-
-(* Escaping of strings used as atoms in S-expressions *)
-
-let is_special_char c =
-  c <= ' ' || c = '"' || c = '(' || c = ')' || c = ';' || c = '\\'
-
-let must_escape str =
-  let len = String.length str in
-  len = 0 ||
-    let rec loop ix = is_special_char str.[ix] || ix > 0 && loop (ix - 1) in
-    loop (len - 1)
-
-let maybe_esc_str str =
-  if must_escape str then
-    let estr = String.escaped str in
-    let elen = String.length estr in
-    let res = String.create (elen + 2) in
-    String.blit estr 0 res 1 elen;
-    res.[0] <- '"';
-    res.[elen + 1] <- '"';
-    res
-  else str
-
-let pp_maybe_esc_str ppf str = pp_print_string ppf (maybe_esc_str str)
-
-(* Output of S-expressions to formatters *)
-
-let rec pp_hum_indent indent ppf = function
-  | Atom str -> pp_maybe_esc_str ppf str
-  | List (h :: t) ->
-      pp_open_box ppf indent;
-      pp_print_string ppf "(";
-      pp_hum_indent indent ppf h;
-      pp_hum_rest indent ppf t
-  | List [] -> pp_print_string ppf "()"
-
-and pp_hum_rest indent ppf = function
-  | h :: t ->
-      pp_print_space ppf ();
-      pp_hum_indent indent ppf h;
-      pp_hum_rest indent ppf t
-  | [] ->
-      pp_print_string ppf ")";
-      pp_close_box ppf ()
-
-let rec pp_mach_internal may_need_space ppf = function
-  | Atom str ->
-      let str' = maybe_esc_str str in
-      let new_may_need_space = str' == str in
-      if may_need_space && new_may_need_space then pp_print_string ppf " ";
-      pp_print_string ppf str';
-      new_may_need_space
-  | List (h :: t) ->
-      pp_print_string ppf "(";
-      let may_need_space = pp_mach_internal false ppf h in
-      pp_mach_rest may_need_space ppf t;
-      false
-  | List [] -> pp_print_string ppf "()"; false
-
-and pp_mach_rest may_need_space ppf = function
-  | h :: t ->
-      let may_need_space = pp_mach_internal may_need_space ppf h in
-      pp_mach_rest may_need_space ppf t
-  | [] -> pp_print_string ppf ")"
-
-let pp_hum ppf sexp = pp_hum_indent !default_indent ppf sexp
-
-let pp_mach ppf sexp = ignore (pp_mach_internal false ppf sexp)
-let pp = pp_mach
-
-(* Sexp size *)
-
-let rec size_loop (v, c as acc) = function
-  | Atom str -> v + 1, c + String.length str
-  | List lst -> List.fold_left size_loop acc lst
-
-let size sexp = size_loop (0, 0) sexp
-
-
-(* Buffer conversions *)
-
-let to_buffer_hum ~buf ?(indent = !default_indent) sexp =
-  Format.bprintf buf "%a@?" (pp_hum_indent indent) sexp
-
-let to_buffer_mach ~buf sexp =
-  let rec loop may_need_space = function
-    | Atom str ->
-        let str' = maybe_esc_str str in
-        let new_may_need_space = str' == str in
-        if may_need_space && new_may_need_space then Buffer.add_char buf ' ';
-        Buffer.add_string buf str';
-        new_may_need_space
-    | List (h :: t) ->
-        Buffer.add_char buf '(';
-        let may_need_space = loop false h in
-        loop_rest may_need_space t;
-        false
-    | List [] -> Buffer.add_string buf "()"; false
-  and loop_rest may_need_space = function
-    | h :: t ->
-        let may_need_space = loop may_need_space h in
-        loop_rest may_need_space t
-    | [] -> Buffer.add_char buf ')' in
-  ignore (loop false sexp)
-
-let to_buffer = to_buffer_mach
-
-
-(* Output of S-expressions to I/O-channels *)
-
-let buffer () = Buffer.create 4096
-
-let with_new_buffer oc f =
-  let buf = buffer () in
-  f buf;
-  Buffer.output_buffer oc buf
-
-let output_hum oc sexp =
-  with_new_buffer oc (fun buf -> to_buffer_hum sexp ~buf)
-
-let output_hum_indent indent oc sexp =
-  with_new_buffer oc (fun buf -> to_buffer_hum ~indent sexp ~buf)
-
-let output_mach oc sexp =
-  with_new_buffer oc (fun buf -> to_buffer_mach sexp ~buf)
-
-let output = output_mach
-
-
-(* String conversions *)
-
-let to_string_hum ?indent sexp =
-  let buf = buffer () in
-  to_buffer_hum ?indent sexp ~buf;
-  Buffer.contents buf
-
-let to_string_mach sexp =
-  let buf = buffer () in
-  to_buffer_mach sexp ~buf;
-  Buffer.contents buf
-
-let to_string = to_string_mach
-
-
-(* Scan functions *)
-
-let scan_sexp ?buf lexbuf = Parser.sexp (Lexer.main ?buf) lexbuf
-let scan_sexps ?buf lexbuf = Parser.sexps (Lexer.main ?buf) lexbuf
-
-let get_main_buf buf =
-  let buf =
-    match buf with
-    | None -> Buffer.create 64
-    | Some buf -> buf in
-  Lexer.main ~buf
-
-let scan_fold_sexps ?buf ~f ~init lexbuf =
-  let main = get_main_buf buf in
-  let rec loop acc =
-    match Parser.sexp_opt main lexbuf with
-    | None -> acc
-    | Some sexp -> loop (f sexp acc) in
-  loop init
-
-let scan_iter_sexps ?buf ~f lexbuf =
-  let main = get_main_buf buf in
-  let rec loop () =
-    match Parser.sexp_opt main lexbuf with
-    | None -> ()
-    | Some sexp -> f sexp; loop () in
-  loop ()
-
-let scan_cnv_sexps ?buf ~f lexbuf =
-  let coll sexp acc = f sexp :: acc in
-  List.rev (scan_fold_sexps ?buf ~f:coll ~init:[] lexbuf)
-
-
-(* Partial parsing *)
-
-type parse_pos =
-  {
-    mutable text_line : int;  (** Line position in parsed text *)
-    mutable text_char : int;  (** Character position in parsed text *)
-    mutable buf_pos : int;  (** Reading position in buffer *)
-  }
-
-type 'a parse_result = Done of t * parse_pos | Cont of bool * 'a parse_fun
-and 'a parse_fun = pos : int -> len : int -> 'a -> 'a parse_result
-
-type parse_state =
-  {
-    parse_pos : parse_pos;
-    mutable pstack : t list list;
-    pbuf : Buffer.t;
-  }
-
-type parse_error =
-  {
-    location : string;
-    err_msg : string;
-    parse_state : parse_state;
-  }
-
-exception ParseError of parse_error
-
-let bump_text_line { parse_pos = parse_pos } =
-  parse_pos.text_line <- parse_pos.text_line + 1;
-  parse_pos.text_char <- 1
-
-let bump_text_pos { parse_pos = parse_pos } =
-  parse_pos.text_char <- parse_pos.text_char + 1
-
-let bump_pos_cont state str ~max_pos ~pos cont =
-  bump_text_pos state;
-  cont state str ~max_pos ~pos:(pos + 1)
-
-let bump_line_cont state str ~max_pos ~pos cont =
-  bump_text_line state;
-  cont state str ~max_pos ~pos:(pos + 1)
-
-let add_bump bump state str ~max_pos ~pos c cont =
-  Buffer.add_char state.pbuf c;
-  bump state;
-  cont state str ~max_pos ~pos:(pos + 1)
-
-let add_bump_pos state str ~max_pos ~pos c cont =
-  add_bump bump_text_pos state str ~max_pos ~pos c cont
-
-let add_bump_line state str ~max_pos ~pos c cont =
-  add_bump bump_text_line state str ~max_pos ~pos c cont
-
-let mk_parse_pos { parse_pos = parse_pos } buf_pos =
-  parse_pos.buf_pos <- buf_pos;
-  parse_pos
-
-let bump_found_atom bump state str ~max_pos ~pos cont =
-  let pbuf = state.pbuf in
-  let atom = Atom (Buffer.contents pbuf) in
-  match state.pstack with
-  | [] -> Done (atom, mk_parse_pos state pos)
-  | rev_sexp_lst :: sexp_stack ->
-      Buffer.clear pbuf;
-      state.pstack <- (atom :: rev_sexp_lst) :: sexp_stack;
-      bump state;
-      cont state str ~max_pos ~pos:(pos + 1)
-
-let raise_parse_error state location err_msg =
-  let parse_error =
-    {
-      location = location;
-      err_msg = err_msg;
-      parse_state = state;
-    }
-  in
-  raise (ParseError parse_error)
-
-let raise_unexpected_char state ~loc pos c =
-  let err_msg = sprintf "unexpected character: '%c'" c in
-  let parse_pos = state.parse_pos in
-  parse_pos.buf_pos <- pos;
-  parse_pos.text_char <- parse_pos.text_char + 1;
-  raise_parse_error state loc err_msg
-
-(* Macro for generating parsers *)
-#define MK_PARSER(TYPE, GET_LEN, PARSE, GET_CHAR) \
-  let check_str_bounds loc ~pos ~len (str : TYPE) = \
-    if pos < 0 then invalid_arg (loc ^ ": pos < 0"); \
-    if len < 0 then invalid_arg (loc ^ ": len < 0"); \
-    let str_len = GET_LEN str in \
-    let pos_len = pos + len in \
-    if pos_len > str_len then invalid_arg (loc ^ ": pos + len > str_len"); \
-    pos_len - 1 \
-  \
-  let mk_cont name cont state = \
-    let ws_only = state.pstack = [] && Buffer.length state.pbuf = 0 in \
-    let parse_fun ~pos ~len str = \
-      let max_pos = check_str_bounds name ~pos ~len str in \
-      cont state str ~max_pos ~pos \
-    in \
-    Cont (ws_only, parse_fun) \
-  \
-  let rec PARSE state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse" PARSE state \
-    else \
-      match GET_CHAR with \
-      | '(' -> \
-          state.pstack <- [] :: state.pstack; \
-          bump_pos_cont state str ~max_pos ~pos PARSE \
-      | ')' as c -> \
-          (match state.pstack with \
-          | [] -> raise_unexpected_char state ~loc:"parse" pos c \
-          | rev_sexp_lst :: sexp_stack -> \
-              let sexp = List (List.rev rev_sexp_lst) in \
-              match sexp_stack with \
-              | [] -> Done (sexp, mk_parse_pos state (pos + 1)) \
-              | higher_rev_sexp_lst :: higher_sexp_stack -> \
-                  state.pstack <- \
-                    (sexp :: higher_rev_sexp_lst) :: higher_sexp_stack; \
-                  bump_pos_cont state str ~max_pos ~pos PARSE) \
-      | ' ' | '\009' | '\012' -> bump_pos_cont state str ~max_pos ~pos PARSE \
-      | '\010' -> bump_line_cont state str ~max_pos ~pos PARSE \
-      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_nl \
-      | ';' -> bump_pos_cont state str ~max_pos ~pos parse_comment \
-      | '"' -> bump_pos_cont state str ~max_pos ~pos parse_quoted \
-      | c -> add_bump_pos state str ~max_pos ~pos c parse_atom \
-  \
-  and parse_nl state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_nl" parse_nl state \
-    else \
-      let pos = if GET_CHAR = '\010' then pos + 1 else pos in \
-      PARSE state str ~max_pos ~pos \
-  \
-  and parse_comment state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_comment" parse_comment state \
-    else \
-      match GET_CHAR with \
-      | '\010' -> bump_line_cont state str ~max_pos ~pos PARSE \
-      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_nl \
-      | _ -> bump_pos_cont state str ~max_pos ~pos parse_comment \
-  \
-  and parse_atom state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_atom" parse_atom state \
-    else \
-      match GET_CHAR with \
-      | ' ' | '\009' | '\012' -> \
-          bump_found_atom bump_text_pos state str ~max_pos ~pos PARSE \
-      | '(' -> \
-          let pbuf = state.pbuf in \
-          let atom = Atom (Buffer.contents pbuf) in \
-          (match state.pstack with \
-          | [] -> Done (atom, mk_parse_pos state pos) \
-          | rev_sexp_lst :: sexp_stack -> \
-              Buffer.clear pbuf; \
-              state.pstack <- [] :: (atom :: rev_sexp_lst) :: sexp_stack; \
-              bump_pos_cont state str ~max_pos ~pos PARSE) \
-      | ')' -> \
-          let pbuf = state.pbuf in \
-          let atom = Atom (Buffer.contents pbuf) in \
-          (match state.pstack with \
-          | [] -> Done (atom, mk_parse_pos state pos) \
-          | rev_sexp_lst :: sexp_stack -> \
-              let sexp = List (List.rev_append rev_sexp_lst [atom]) in \
-              match sexp_stack with \
-              | [] -> Done (sexp, mk_parse_pos state (pos + 1)) \
-              | higher_rev_sexp_lst :: higher_sexp_stack -> \
-                  Buffer.clear pbuf; \
-                  state.pstack <- \
-                    (sexp :: higher_rev_sexp_lst) :: higher_sexp_stack; \
-                  bump_pos_cont state str ~max_pos ~pos PARSE) \
-      | '\010' -> bump_found_atom bump_text_line state str ~max_pos ~pos PARSE \
-      | '\013' -> \
-          bump_found_atom bump_text_line state str ~max_pos ~pos parse_nl \
-      | ';' -> \
-          bump_found_atom bump_text_pos state str ~max_pos ~pos parse_comment \
-      | '"' -> \
-          bump_found_atom bump_text_pos state str ~max_pos ~pos parse_quoted \
-      | c -> add_bump_pos state str ~max_pos ~pos c parse_atom \
-  \
-  and parse_quoted state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_quoted" parse_quoted state \
-    else \
-      match GET_CHAR with \
-      | '"' -> \
-          let pbuf = state.pbuf in \
-          let atom = Atom (Buffer.contents pbuf) in \
-          (match state.pstack with \
-          | [] -> Done (atom, mk_parse_pos state (pos + 1)) \
-          | rev_sexp_lst :: sexp_stack -> \
-              Buffer.clear pbuf; \
-              state.pstack <- (atom :: rev_sexp_lst) :: sexp_stack; \
-              bump_pos_cont state str ~max_pos ~pos PARSE) \
-      | '\\' -> bump_pos_cont state str ~max_pos ~pos parse_escaped \
-      | '\010' as c -> add_bump_line state str ~max_pos ~pos c parse_quoted \
-      | '\013' as c -> add_bump_line state str ~max_pos ~pos c parse_quoted_nl \
-      | c -> add_bump_pos state str ~max_pos ~pos c parse_quoted \
-  \
-  and parse_quoted_nl state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_quoted_nl" parse_quoted_nl state \
-    else \
-      let pos = \
-        let c = '\010' in \
-        if GET_CHAR = c then ( \
-          Buffer.add_char state.pbuf c; \
-          pos + 1 \
-        ) \
-        else pos \
-      in \
-      parse_quoted state str ~max_pos ~pos \
-  \
-  and parse_escaped state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_escaped" parse_escaped state \
-    else \
-      match GET_CHAR with \
-      | '\010' -> bump_line_cont state str ~max_pos ~pos parse_skip_ws \
-      | '\013' -> bump_line_cont state str ~max_pos ~pos parse_skip_ws_nl \
-      | '0' .. '9' as c -> \
-          bump_text_pos state; \
-          let d = Char.code c - 48 in \
-          parse_dec state str ~max_pos ~pos:(pos + 1) ~count:2 ~d \
-      | 'x' -> \
-          bump_text_pos state; \
-          parse_hex state str ~max_pos ~pos:(pos + 1) ~count:2 ~d:0 \
-      | ('\\' | '"' | '\'' ) as c -> \
-          add_bump_pos state str ~max_pos ~pos c parse_quoted \
-      | 'n' -> add_bump_pos state str ~max_pos ~pos '\n' parse_quoted \
-      | 't' -> add_bump_pos state str ~max_pos ~pos '\t' parse_quoted \
-      | 'b' -> add_bump_pos state str ~max_pos ~pos '\b' parse_quoted \
-      | 'r' -> add_bump_pos state str ~max_pos ~pos '\r' parse_quoted \
-      | c -> \
-          Buffer.add_char state.pbuf '\\'; \
-          add_bump_pos state str ~max_pos ~pos c parse_quoted \
-  \
-  and parse_skip_ws state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_skip_ws" parse_skip_ws state \
-    else \
-      match GET_CHAR with \
-      | ' ' | '\009' -> bump_pos_cont state str ~max_pos ~pos parse_skip_ws \
-      | _ -> parse_quoted state str ~max_pos ~pos \
-  \
-  and parse_skip_ws_nl state str ~max_pos ~pos = \
-    if pos > max_pos then mk_cont "parse_skip_ws_nl" parse_skip_ws_nl state \
-    else \
-      let pos = if GET_CHAR = '\010' then pos + 1 else pos in \
-      parse_skip_ws state str ~max_pos ~pos \
-  \
-  and parse_dec state str ~max_pos ~pos ~count ~d = \
-    if pos > max_pos then mk_cont "parse_dec" (parse_dec ~count ~d) state \
-    else \
-      match GET_CHAR with \
-      | '0' .. '9' as c -> \
-          let d = 10 * d + Char.code c - 48 in \
-          if count = 1 then \
-            if d > 255 then \
-              let err_msg = sprintf "illegal decimal escape: \\%d" d in \
-              raise_parse_error state "parse_dec" err_msg \
-            else \
-              add_bump_pos state str ~max_pos ~pos (Char.chr d) parse_quoted \
-          else ( \
-            bump_text_pos state; \
-            parse_dec state str ~max_pos ~pos:(pos + 1) ~count:(count - 1) ~d) \
-      | c -> raise_unexpected_char state ~loc:"parse_dec" pos c \
-  \
-  and parse_hex state str ~max_pos ~pos ~count ~d = \
-    if pos > max_pos then mk_cont "parse_hex" (parse_hex ~count ~d) state \
-    else \
-      match GET_CHAR with \
-      | '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' as c -> \
-          let corr = \
-            if c >= 'a' then 87 \
-            else if c >= 'A' then 55 \
-            else 48 \
-          in \
-          let d = 16 * d + Char.code c - corr in \
-          if count = 1 then \
-            if d > 255 then \
-              let err_msg = sprintf "illegal hexadecimal escape: \\%x" d in \
-              raise_parse_error state "parse_hex" err_msg \
-            else \
-              add_bump_pos state str ~max_pos ~pos (Char.chr d) parse_quoted \
-          else ( \
-            bump_text_pos state; \
-            parse_hex state str ~max_pos ~pos:(pos + 1) ~count:(count - 1) ~d) \
-      | c -> raise_unexpected_char state ~loc:"parse_hex" pos c \
-  \
-  let PARSE ?(text_line = 1) ?(text_char = 1) ?(pos = 0) ?len str = \
-    let len = \
-      match len with \
-      | Some len -> len \
-      | None -> GET_LEN str - pos \
-    in \
-    let max_pos = check_str_bounds "parse" ~pos ~len str in \
-    let state = \
-      { \
-        parse_pos = \
-          { \
-            text_line = text_line; \
-            text_char = text_char; \
-            buf_pos = pos; \
-          }; \
-        pstack = []; \
-        pbuf = Buffer.create 128; \
-      } \
-    in \
-    PARSE state str ~max_pos ~pos
-
-MK_PARSER(string, String.length, parse_str, str.[pos])
-
-let parse = parse_str
-
-let plain_parse ~pos ~len str = parse ~pos ~len str
-
-
-(* Partial parsing from bigstrings *)
-
-(* NOTE: this is really an awful duplication of the code for parsing
-   strings, but since OCaml does not inline higher-order functions known
-   at compile, other solutions would sacrifice a lot of efficiency. *)
-
-open Bigarray
-
-type bstr = (char, int8_unsigned_elt, c_layout) Array1.t
-
-MK_PARSER(bstr, Array1.dim, parse_bstr, str.{pos})
-
-
-(* Input functions *)
-
-let reraise_parse_error pe global_pos =
-  let ps = pe.parse_state in
-  let ppos = ps.parse_pos in
-  let new_ppos = { ppos with buf_pos = global_pos + ppos.buf_pos } in
-  let new_ps = { ps with parse_pos = new_ppos } in
-  let new_pe = { pe with parse_state = new_ps } in
-  raise (ParseError new_pe)
-
-let input_sexp ?text_line ?text_char ?(buf_pos = 0) ic =
-  let buf = String.create 1 in
-  let rec loop this_parse =
-    let c = input_char ic in
-    buf.[0] <- c;
-    let parse_res =
-      try this_parse ~pos:0 ~len:1 buf
-      with ParseError pe -> reraise_parse_error pe buf_pos
-    in
-    match parse_res with
-    | Done (sexp, _) -> sexp
-    | Cont (_, this_parse) -> loop this_parse
-  in
-  let this_parse ~pos ~len str = parse ?text_line ?text_char ~pos ~len str in
-  loop this_parse
-
-let input_rev_sexps
-      ?text_line ?text_char
-      ?(buf_pos = 0) ?(buf = String.create 8192) ic =
-  let rev_sexps_ref = ref [] in
-  let buf_len = String.length buf in
-  let is_incomplete_ref = ref false in
-  let buf_pos_ref = ref buf_pos in
-  let rec loop this_parse pos len =
-    if len > 0 then
-      let parse_res =
-        try this_parse ~pos ~len buf
-        with ParseError pe -> reraise_parse_error pe !buf_pos_ref
-      in
-      match parse_res with
-      | Done (sexp, new_pos) ->
-          rev_sexps_ref := sexp :: !rev_sexps_ref;
-          let n_parsed = new_pos.buf_pos - pos in
-          is_incomplete_ref := false;
-          let text_line = new_pos.text_line in
-          let text_char = new_pos.text_char in
-          let this_parse ~pos ~len str =
-            parse ~text_line ~text_char ~pos ~len str
-          in
-          if n_parsed = len then
-            let new_len = input ic buf 0 buf_len in
-            buf_pos_ref := !buf_pos_ref + new_pos.buf_pos;
-            loop this_parse 0 new_len
-          else loop this_parse new_pos.buf_pos (len - n_parsed)
-      | Cont (ws_only, this_parse) ->
-          is_incomplete_ref := not ws_only;
-          buf_pos_ref := !buf_pos_ref + len + pos;
-          loop this_parse 0 (input ic buf 0 buf_len)
-    else if !is_incomplete_ref then raise End_of_file
-    else !rev_sexps_ref
-  in
-  let this_parse ~pos ~len str = parse ?text_line ?text_char ~pos ~len str in
-  loop this_parse 0 (input ic buf 0 buf_len)
-
-let input_sexps ?text_line ?text_char ?buf_pos ?buf ic =
-  let rev_sexps = input_rev_sexps ?text_line ?text_char ?buf_pos ?buf ic in
-  List.rev rev_sexps
-
-(* of_string and of_bstr *)
-
-let of_string_bstr loc this_parse ws_buf get_len get_sub str =
-  match this_parse str with
-  | Done (_, { buf_pos = buf_pos }) when buf_pos <> get_len str ->
-      let prefix_len = min (get_len str - buf_pos) 20 in
-      let prefix = get_sub str buf_pos prefix_len in
-      let msg =
-        sprintf "%s: S-expression followed by data at position %d: %S..."
-          loc buf_pos prefix
-      in
-      failwith msg
-  | Done (sexp, _) -> sexp
-  | Cont (ws_only, this_parse) ->
-      if ws_only then failwith (loc ^ ": whitespace only");
-      match this_parse ~pos:0 ~len:1 ws_buf with
-      | Done (sexp, _) -> sexp
-      | Cont _ -> failwith (loc ^ ": incomplete S-expression")
-
-let of_string str =
-  of_string_bstr "Sexp.of_string" parse " " String.length String.sub str
-
-let get_bstr_sub_str bstr pos len =
-  let str = String.create len in
-  for i = 0 to len - 1 do str.[i] <- bstr.{pos + i} done;
-  str
-
-let bstr_ws_buf = Array1.create char c_layout 1
-let () = bstr_ws_buf.{0} <- ' '
-
-let of_bstr bstr =
-  of_string_bstr "Sexp.of_bstr"
-    parse_bstr bstr_ws_buf Array1.dim get_bstr_sub_str bstr
-
-(* Loading *)
-
-let load_sexp ?(buf = String.create 8192) file =
-  let buf_len = String.length buf in
-  let ic = open_in file in
-  let rec loop this_parse =
-    let len = input ic buf 0 buf_len in
-    if len = 0 then raise End_of_file
-    else
-      match this_parse ~pos:0 ~len buf with
-      | Done (sexp, _) -> sexp
-      | Cont (_, this_parse) -> loop this_parse
-  in
-  try
-    let sexp = loop plain_parse in
-    close_in ic;
-    sexp
-  with exc -> close_in_noerr ic; raise exc
-
-let load_rev_sexps ?buf file =
-  let ic = open_in file in
-  try
-    let sexps = input_rev_sexps ?buf ic in
-    close_in ic;
-    sexps
-  with exc -> close_in_noerr ic; raise exc
-
-let load_sexps ?buf file =
-  let rev_sexps = load_rev_sexps ?buf file in
-  List.rev rev_sexps
-
-
-(* Utilities for automated type conversions *)
-
-let unit = List []
-
-external sexp_of_t : t -> t = "%identity"
-external t_of_sexp : t -> t = "%identity"
diff --git a/ocamlsexp/sexp.ml b/ocamlsexp/sexp.ml
deleted file mode 100644 (file)
index 2ba6d73..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include Pre_sexp
diff --git a/ocamlsexp/sexp.mli b/ocamlsexp/sexp.mli
deleted file mode 100644 (file)
index 0cc65ee..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-(* File: sexp.mli
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(** Sexp: Module for handling S-expressions (I/O, etc.) *)
-
-include Sexp_intf.S
diff --git a/ocamlsexp/sexp_intf.ml b/ocamlsexp/sexp_intf.ml
deleted file mode 100644 (file)
index 3907e94..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-(* File: sexp_intf.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(** Sexp_intf: interface specification for handling S-expressions (I/O, etc.) *)
-
-open Format
-open Lexing
-
-module type S = sig
-
-  (** Type of S-expressions *)
-  type t = Type.t = Atom of string | List of t list
-
-
-  (** {6 Defaults} *)
-
-  val default_indent : int ref
-  (** [default_indent] reference to default indentation level for
-      human-readable conversions.  Initialisation value: 2. *)
-
-
-  (** {6 S-expression size} *)
-
-  val size : t -> int * int
-  (** [size sexp] @return [(n_atoms, n_chars)], where [n_atoms] is
-      the number of atoms in S-expression [sexp], and [n_chars] is the
-      number of characters in the atoms of the S-expression. *)
-
-
-  (** {6 Scan functions} *)
-
-  val scan_sexp : ?buf : Buffer.t -> lexbuf -> t
-  (** [scan_sexp ?buf lexbuf] scans an S-expression from lex buffer
-      [lexbuf] using the optional string buffer [buf] for storing
-      intermediate strings. *)
-
-  val scan_sexps : ?buf : Buffer.t -> lexbuf -> t list
-  (** [scan_sexps ?buf lexbuf] reads a list of whitespace separated
-      S-expressions from lex buffer [lexbuf] using the optional string
-      buffer [buf] for storing intermediate strings. *)
-
-  val scan_iter_sexps : ?buf : Buffer.t -> f : (t -> unit) -> lexbuf -> unit
-  (** [scan_iter_sexps ?buf ~f lexbuf] iterates over all whitespace
-      separated S-expressions scanned from lex buffer [lexbuf] using
-      function [f], and the optional string buffer [buf] for storing
-      intermediate strings. *)
-
-  val scan_fold_sexps :
-    ?buf : Buffer.t -> f : (t -> 'a -> 'a) -> init : 'a -> lexbuf -> 'a
-  (** [scan_fold_sexps ?buf ~f ~init lexbuf] folds over all whitespace
-      separated S-expressions scanned from lex buffer [lexbuf] using
-      function [f], initial state [init], and the optional string buffer
-      [buf] for storing intermediate strings. *)
-
-  val scan_cnv_sexps : ?buf : Buffer.t -> f : (t -> 'a) -> lexbuf -> 'a list
-  (** [scan_cnv_sexps ?buf ~f lexbuf] maps all whitespace separated
-      S-expressions scanned from lex buffer [lexbuf] to some list using
-      function [f], and the optional string buffer [buf] for storing
-      intermediate strings. *)
-
-
-  (** {6 (Partial) parsing} *)
-
-  (** Position information after complete parse *)
-  type parse_pos = Pre_sexp.parse_pos =
-    private
-      {
-        mutable text_line : int;  (** Line position in parsed text *)
-        mutable text_char : int;  (** Character position in parsed text *)
-        mutable buf_pos : int;  (** Reading position in text buffer *)
-      }
-
-  (** Type of result from calling {!Sexp.parse}. *)
-  type 'a parse_result = 'a Pre_sexp.parse_result =
-    | Done of t * parse_pos  (** [Done (sexp, parse_pos)] finished
-                                 parsing an S-expression.  Current parse
-                                 position is [parse_pos]. *)
-    | Cont of bool * 'a parse_fun  (** [Cont (ws_only, parse_fun)] met the
-                                       end of input before completely
-                                       parsing an S-expression.  The user
-                                       has to call [parse_fun] to continue
-                                       parsing the S-expression in another
-                                       buffer.  If [ws_only] is true, only
-                                       whitespace has been parsed so far (or
-                                       comments!).  NOTE: the continuation
-                                       may only be called once! *)
-
-  and 'a parse_fun = pos : int -> len : int -> 'a -> 'a parse_result
-  (** Type of parsing functions with given offsets and lengths. *)
-
-  (** Type of state maintained during parsing *)
-  type parse_state = Pre_sexp.parse_state =
-    private
-      {
-        parse_pos : parse_pos;  (** Current parse position *)
-        mutable pstack : t list list;  (** Stack of found S-expression lists *)
-        pbuf : Buffer.t;  (** Current atom buffer *)
-      }
-
-  (** Type of parse errors *)
-  type parse_error = Pre_sexp.parse_error =
-    {
-      location : string;  (** Function in which the parse failed *)
-      err_msg : string;  (** Reason why parsing failed *)
-      parse_state : parse_state;  (** State of parser *)
-    }
-
-  (** Exception raised during partial parsing *)
-  exception ParseError of parse_error
-
-  val parse :
-    ?text_line : int -> ?text_char : int -> ?pos : int -> ?len : int -> string
-    -> string parse_result
-  (** [parse ?text_line ?text_char ?pos ?len str] (partially) parses an
-      S-expression in string buffer [str] starting at position [pos]
-      and reading at most [len] characters.  The text position can be
-      initialized with [text_line] and [text_char].  To parse a single
-      atom that is not delimited by whitespace it is necessary to call
-      this function a second time with the returned continuation, and a
-      dummy buffer that contains whitespace.
-
-      @param text_line default = 1
-      @param text_char default = 1
-      @param pos default = 0
-      @param len default = [String.length str - pos]
-  *)
-
-  open Bigarray
-
-  type bstr = (char, int8_unsigned_elt, c_layout) Array1.t
-
-  val parse_bstr :
-    ?text_line : int -> ?text_char : int -> ?pos : int -> ?len : int -> bstr
-    -> bstr parse_result
-  (** [parse_bstr ?text_line ?text_char ?pos ?len str] same as [parse],
-      but operates on bigstrings. *)
-
-  val input_sexp :
-    ?text_line : int -> ?text_char : int -> ?buf_pos : int -> in_channel -> t
-  (** [input_sexp ?text_line ?text_char ?buf_pos ic] parses an S-expression
-      from input channel [ic] using initial position information
-      [text_line], [text_char], and [buf_pos].  NOTE: this function is not
-      as fast on files as {!Sexp.load_sexp}, and is also slightly slower
-      than the scan-functions.  But it is guaranteed that [input_sexp]
-      is only going to read data parseable as an S-expression.  Thus,
-      subsequent input functions will see the data immediately following it.
-
-      @param text_line default = [1]
-      @param text_char default = [1]
-      @param buf_pos default = [0]
-  *)
-
-  val input_sexps :
-    ?text_line : int -> ?text_char : int -> ?buf_pos : int ->
-    ?buf : string -> in_channel -> t list
-  (** [input_sexps ?text_line ?text_char ?buf_pos ??buf ic] parses
-      whitespace separated S-expressions from input channel [ic] until
-      EOF is reached.  Faster than the scan-functions.  NOTE: [buf_pos]
-      is the initial global buffer position used for locating errors and
-      does not refer to [buf].
-
-      @param text_line default = [1]
-      @param text_char default = [1]
-      @param buf_pos default = [0]
-  *)
-
-  val input_rev_sexps :
-    ?text_line : int -> ?text_char : int -> ?buf_pos : int ->
-    ?buf : string -> in_channel -> t list
-  (** [input_rev_sexps ?buf ic] same as {!Sexp.input_sexps}, but returns a
-      reversed list of S-expressions, which is slightly more efficient. *)
-
-
-  (** {6 Loading} *)
-
-  val load_sexp : ?buf : string -> string -> t
-  (** [load_sexp ?buf file] reads one S-expression from file [file] using
-      buffer [buf] for storing intermediate data.  Ignores any trailing
-      data.  Faster than the scan-functions.
-
-      @raise ParseError if the S-expression is unparseable.
-      @raise End_of_file if no S-expression could be read.
-  *)
-
-  val load_sexps : ?buf : string -> string -> t list
-  (** [load_sexps file] reads a list of whitespace separated S-expressions
-      from file [file] using buffer [buf] for storing intermediate data.
-      Faster than the scan-functions.
-
-      @raise ParseError if there is unparseable data in the file.
-      @raise End_of_file if the last S-expression is incomplete.
-  *)
-
-  val load_rev_sexps : ?buf : string -> string -> t list
-  (** [load_rev_sexps file] same as {!Sexp.load_sexps}, but returns a
-      reversed list of S-expressions, which is slightly more efficient. *)
-
-
-  (** {6 Output of S-expressions to I/O-channels} *)
-
-  val output_hum : out_channel -> t -> unit
-  (** [output_hum oc sexp] outputs S-expression [sexp] to output channel
-      [oc] in human readable form. *)
-
-  val output_hum_indent : int -> out_channel -> t -> unit
-  (** [output_hum_indent indent oc sexp] outputs S-expression [sexp]
-      to output channel [oc] in human readable form using indentation level
-      [indent].
-  *)
-
-  val output_mach : out_channel -> t -> unit
-  (** [output_mach oc sexp] outputs S-expression [sexp] to output channel
-      [oc] in machine readable (i.e. most compact) form. *)
-
-  val output : out_channel -> t -> unit
-  (** [output oc sexp] same as [output_mach]. *)
-
-
-  (** {6 Output of S-expressions to formatters} *)
-
-  val pp_hum : formatter -> t -> unit
-  (** [pp_hum ppf sexp] outputs S-expression [sexp] to formatter [ppf]
-      in human readable form. *)
-
-  val pp_hum_indent : int -> formatter -> t -> unit
-  (** [pp_hum_indent n ppf sexp] outputs S-expression [sexp] to formatter
-      [ppf] in human readable form and indentation level [n]. *)
-
-  val pp_mach : formatter -> t -> unit
-  (** [pp_mach ppf sexp] outputs S-expression [sexp] to formatter [ppf]
-      in machine readable (i.e. most compact) form. *)
-
-  val pp : formatter -> t -> unit
-  (** [pp ppf sexp] same as [pp_mach]. *)
-
-
-  (** {6 String and bigstring conversions} *)
-
-  val of_string : string -> t
-  (** [of_string str] converts string [str] to an S-expression. *)
-
-  val of_bstr : bstr -> t
-  (** [of_bstr bstr] converts bigstring [bstr] to an S-expression. *)
-
-  val to_string_hum : ?indent : int -> t -> string
-  (** [to_string_hum ?indent sexp] converts S-expression [sexp] to a
-      string in human readable form with indentation level [indent].
-
-      @param indent default = [!default_indent]
-  *)
-
-  val to_string_mach : t -> string
-  (** [to_string_mach sexp] converts S-expression [sexp] to a string in
-      machine readable (i.e. most compact) form. *)
-
-  val to_string : t -> string
-  (** [to_string sexp] same as [to_string_mach]. *)
-
-
-  (** {6 Buffer conversions} *)
-
-  val to_buffer_hum : buf : Buffer.t -> ?indent : int -> t -> unit
-  (** [to_buffer_hum ~buf ?indent sexp] outputs the S-expression [sexp]
-      converted to a string in human readable form to buffer [buf].
-
-      @param indent default = [!default_indent]
-  *)
-
-  val to_buffer_mach : buf : Buffer.t -> t -> unit
-  (** [to_buffer_mach ~buf sexp] outputs the S-expression [sexp] converted
-      to a string in machine readable (i.e. most compact) form to buffer [buf].
-  *)
-
-  val to_buffer : buf : Buffer.t -> t -> unit
-  (** [to_buffer ~buf sexp] same as {!to_buffer_mach}. *)
-
-
-  (** {6 Utilities for automated type conversions} *)
-
-  val unit : t
-  (** [unit] the unit-value as expressed by an S-expression. *)
-
-  external sexp_of_t : t -> t = "%identity"
-  (** [sexp_of_t sexp] maps S-expressions which are part of a type with
-      automated S-expression conversion to themselves. *)
-
-  external t_of_sexp : t -> t = "%identity"
-  (** [t_of_sexp sexp] maps S-expressions which are part of a type with
-      automated S-expression conversion to themselves. *)
-
-end
diff --git a/ocamlsexp/type.ml b/ocamlsexp/type.ml
deleted file mode 100644 (file)
index 8e5ddca..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-(* File: type.ml
-
-    Copyright (C) 2005-
-
-      Jane Street Holding, LLC
-      Author: Markus Mottl
-      email: mmottl\@janestcapital.com
-      WWW: http://www.janestcapital.com/ocaml
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*)
-
-(** Type of S-expressions *)
-type t = Atom of string | List of t list
index 7446ef7..1679e7e 100644 (file)
@@ -1,24 +1,12 @@
-
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 ##############################################################################
 # Variables
 ##############################################################################
 TARGET=parsing_c
 
--include ../Makefile.config
-
-# ifeq ($(FEATURE_TARZAN), 1)
-# TARZANSRC=sexp_ast_c.ml
-# ifeq ("$(SEXPDIR)","ocamlsexp")
-# TARZANINCLUDE=-I ../$(SEXPDIR)
-# else
-# TARZANINCLUDE=-I $(SEXPDIR)
-# endif # Use local ocamlsexp
-# endif # FEATURE_TARZAN
-
-
-
 # - type_cocci.ml ast_cocci.ml  # + unparse_hrule
 SRC= flag_parsing_c.ml parsing_stat.ml \
  token_c.ml ast_c.ml control_flow_c.ml \
@@ -40,7 +28,7 @@ SRC= flag_parsing_c.ml parsing_stat.ml \
 
 
 
-# ast_cocci.ml and unparse_cocci.ml should be deleted in the futur
+# ast_cocci.ml and unparse_cocci.ml should be deleted in the future
 # to make parsing_c really independent of coccinelle.
 # control_flow_c have also coccinelle dependencies.
 # old: parsing_c now depends on cocci_parser because in addition to decorate
@@ -54,8 +42,6 @@ INCLUDESDEP= -I ../commons -I ../commons/ocamlextra -I ../commons/ocollection \
 
 INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE)
 
-#LIBS=../commons/commons.cma
-#INCLUDES= -I ../commons
 SYSLIBS= str.cma unix.cma num.cma
 
 ##############################################################################
@@ -66,13 +52,10 @@ SYSLIBS= str.cma unix.cma num.cma
 #for profiling:  -p -inline 0   with OCAMLOPT
 OCAMLCFLAGS ?= -g -dtypes
 
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLLEX=ocamllex$(OPTBIN) #-ml
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDESDEP)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDESDEP)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 OBJS = $(SRC:.ml=.cmo)
 OPTOBJS = $(SRC:.ml=.cmx)
@@ -85,13 +68,13 @@ all: $(TARGET).cma
 all.opt: $(TARGET).cmxa
 
 $(TARGET).cma: $(OBJS)
-       $(OCAMLC) -a -o $(TARGET).cma $(OBJS)
+       $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
 
 $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
-       $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
 
 $(TARGET).top: $(OBJS) $(LIBS)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 clean::
        rm -f $(TARGET).top
@@ -100,14 +83,11 @@ lexer_c.ml: lexer_c.mll
        $(OCAMLLEX) $<
 clean::
        rm -f lexer_c.ml
-beforedepend:: lexer_c.ml
-
 
 parser_c.ml parser_c.mli: parser_c.mly
-       $(OCAMLYACC) $<
+       $(OCAMLYACC) -v $<
 clean::
        rm -f parser_c.ml parser_c.mli parser_c.output
-beforedepend:: parser_c.ml parser_c.mli
 
 
 ##############################################################################
@@ -148,28 +128,27 @@ locindiv:
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 .ml.mldepend:
-       $(OCAMLC) -i $<
+       $(OCAMLC_CMD) -i $<
 
 clean::
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
        rm -f *~ .*~ gmon.out #*#
-
-distclean::
        rm -f .depend
 
-beforedepend::
-
-distclean::
-       rm -f .depend
+distclean: clean
 
-depend:: beforedepend
-       $(OCAMLDEP) *.mli *.ml    > .depend
+.depend depend: lexer_c.ml parser_c.ml parser_c.mli
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 15f43a7..38b9261 100644 (file)
@@ -123,17 +123,25 @@ let commentized xs = xs +> Common.tail_map_filter (function
             ||
             (s =~ "__.*")
         | 3 ->
-            List.mem cppkind [Token_c.CppAttr;Token_c.CppPassingNormal;Token_c.CppDirective]
+           (match cppkind with
+             Token_c.CppAttr | Token_c.CppPassingNormal
+            | Token_c.CppDirective | Token_c.CppIfDirective _ -> true
+           | _ -> false)
             ||
             (s =~ "__.*")
         | 4 ->
-            List.mem cppkind [Token_c.CppAttr;Token_c.CppPassingNormal;Token_c.CppMacro]
+            List.mem cppkind
+             [Token_c.CppAttr;Token_c.CppPassingNormal;Token_c.CppMacro]
             ||
             (s =~ "__.*")
 
 
         | 5 ->
-            List.mem cppkind [Token_c.CppAttr;Token_c.CppPassingNormal;Token_c.CppDirective;Token_c.CppMacro]
+           (match cppkind with
+             Token_c.CppAttr | Token_c.CppPassingNormal
+            | Token_c.CppDirective | Token_c.CppIfDirective _
+            | Token_c.CppMacro -> true
+           | _ -> false)
             ||
             (s =~ "__.*")
 
index 374b496..c0812a4 100644 (file)
@@ -644,7 +644,7 @@ let rec commentize_skip_start_to_end xs =
             in
             let topass = x::x2::before in
             topass +> List.iter (fun tok ->
-              set_as_comment Token_c.CppPassingExplicit tok
+              TV.set_as_comment Token_c.CppPassingExplicit tok
             );
             commentize_skip_start_to_end after
           with Not_found ->
@@ -674,18 +674,20 @@ let rec find_ifdef_bool xs =
       (match xxs with
       | [] -> raise Impossible
       | firstclause::xxs ->
-          info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+          info_ifdef_stmt +>
+         List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
 
           if is_ifdef_positif
           then xxs +> List.iter
-            (iter_token_ifdef (set_as_comment Token_c.CppPassingNormal))
+            (iter_token_ifdef (TV.set_as_comment Token_c.CppPassingNormal))
           else begin
-            firstclause +> iter_token_ifdef (set_as_comment Token_c.CppPassingNormal);
+            firstclause +>
+           iter_token_ifdef (TV.set_as_comment Token_c.CppPassingNormal);
             (match List.rev xxs with
             (* keep only last *)
             | last::startxs ->
                 startxs +> List.iter
-                  (iter_token_ifdef (set_as_comment Token_c.CppPassingNormal))
+                  (iter_token_ifdef (TV.set_as_comment Token_c.CppPassingNormal))
             | [] -> (* not #else *) ()
             );
           end
@@ -730,9 +732,11 @@ let rec find_ifdef_mid xs =
               msg_ifdef_mid_something();
 
               (* keep only first, treat the rest as comment *)
-              info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+              info_ifdef_stmt +>
+             List.iter
+               (TV.save_as_comment (function x -> Token_c.CppIfDirective x));
               (second::rest) +> List.iter
-                (iter_token_ifdef (set_as_comment Token_c.CppPassingCosWouldGetError));
+                (iter_token_ifdef (TV.set_as_comment Token_c.CppPassingCosWouldGetError));
             end
 
       );
@@ -767,10 +771,11 @@ let rec find_ifdef_funheaders = function
       find_ifdef_funheaders xs;
 
       msg_ifdef_funheaders ();
-      info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+      info_ifdef_stmt +>
+      List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
       let all_toks = [xline2] @ line2 in
-      all_toks +> List.iter (set_as_comment Token_c.CppPassingCosWouldGetError) ;
-      ifdefblock2 +> iter_token_ifdef (set_as_comment Token_c.CppPassingCosWouldGetError);
+      all_toks +> List.iter (TV.set_as_comment Token_c.CppPassingCosWouldGetError) ;
+      ifdefblock2 +> iter_token_ifdef (TV.set_as_comment Token_c.CppPassingCosWouldGetError);
 
   (* ifdef with nested ifdef *)
   | Ifdef
@@ -789,10 +794,12 @@ let rec find_ifdef_funheaders = function
       find_ifdef_funheaders xs;
 
       msg_ifdef_funheaders ();
-      info_ifdef_stmt  +> List.iter (set_as_comment Token_c.CppDirective);
-      info_ifdef_stmt2 +> List.iter (set_as_comment Token_c.CppDirective);
+      info_ifdef_stmt  +>
+      List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
+      info_ifdef_stmt2 +>
+      List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
       let all_toks = [xline2;xline3] @ line2 @ line3 in
-      all_toks +> List.iter (set_as_comment Token_c.CppPassingCosWouldGetError);
+      all_toks +> List.iter (TV.set_as_comment Token_c.CppPassingCosWouldGetError);
 
  (* ifdef with elseif *)
   | Ifdef
@@ -807,9 +814,10 @@ let rec find_ifdef_funheaders = function
       find_ifdef_funheaders xs;
 
       msg_ifdef_funheaders ();
-      info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+      info_ifdef_stmt +>
+      List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
       let all_toks = [xline2;xline3] @ line2 @ line3 in
-      all_toks +> List.iter (set_as_comment Token_c.CppPassingCosWouldGetError)
+      all_toks +> List.iter (TV.set_as_comment Token_c.CppPassingCosWouldGetError)
 
   (* recurse *)
   | Ifdef (xxs,info_ifdef_stmt)::xs
@@ -869,9 +877,10 @@ let rec find_ifdef_cparen_else xs =
             msg_ifdef_cparen_else();
 
             (* keep only first, treat the rest as comment *)
-            info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+            info_ifdef_stmt +>
+           List.iter (TV.save_as_comment (fun x -> Token_c.CppIfDirective x));
             (second::rest) +> List.iter
-              (iter_token_ifdef (set_as_comment Token_c.CppPassingCosWouldGetError));
+              (iter_token_ifdef (TV.set_as_comment Token_c.CppPassingCosWouldGetError));
           end
 
       );
@@ -936,15 +945,15 @@ let rec find_macro_paren xs =
      ->
       pr2_cpp ("MACRO: __attribute detected ");
       [Parenthised (xxs, info_parens)] +>
-        iter_token_paren (set_as_comment Token_c.CppAttr);
-      set_as_comment Token_c.CppAttr id;
+        iter_token_paren (TV.set_as_comment Token_c.CppAttr);
+      TV.set_as_comment Token_c.CppAttr id;
       find_macro_paren xs
 
   | PToken ({tok = TattributeNoarg _} as id)
     ::xs
      ->
       pr2_cpp ("MACRO: __attributenoarg detected ");
-      set_as_comment Token_c.CppAttr id;
+      TV.set_as_comment Token_c.CppAttr id;
       find_macro_paren xs
 
 (*
@@ -1001,7 +1010,7 @@ let rec find_macro_paren xs =
       msg_stringification_params s;
       id.tok <- TMacroString (s, TH.info_of_tok id.tok);
       [Parenthised (xxs, info_parens)] +>
-        iter_token_paren (set_as_comment Token_c.CppMacro);
+        iter_token_paren (TV.set_as_comment Token_c.CppMacro);
       find_macro_paren xs
 
   (* after case *)
@@ -1013,7 +1022,7 @@ let rec find_macro_paren xs =
       msg_stringification_params s;
       id.tok <- TMacroString (s, TH.info_of_tok id.tok);
       [Parenthised (xxs, info_parens)] +>
-        iter_token_paren (set_as_comment Token_c.CppMacro);
+        iter_token_paren (TV.set_as_comment Token_c.CppMacro);
       find_macro_paren xs
 
 
@@ -1284,7 +1293,7 @@ let rec find_macro_lineparen xs =
           msg_macro_noptvirg s;
           macro.tok <- TMacroStmt (s, TH.info_of_tok macro.tok);
           [Parenthised (xxs, info_parens)] +>
-            iter_token_paren (set_as_comment Token_c.CppMacro);
+            iter_token_paren (TV.set_as_comment Token_c.CppMacro);
         end;
 
       find_macro_lineparen (line2::xs)
@@ -1447,7 +1456,7 @@ and find_actions_params xxs =
         then
           (* certainly because paren detection had a pb because of
            * some ifdef-exp. Do similar additional checking than
-           * what is done in set_as_comment.
+           * what is done in TV.set_as_comment.
            *)
           pr2 "PB: weird, I try to tag an EOF token as an action"
         else
@@ -1644,9 +1653,9 @@ let pointer = function
   | TAnd _ when !Flag.c_plus_plus -> true
   | _ -> false
 
-let ident_or_star = function
+let ident = function
     TIdent _ -> true
-  | x -> pointer x
+  | _ -> false
 
 (* This function is inefficient, because it will look over a K&R header,
 or function prototype multiple times.  At least when we see a , and are in a
@@ -1990,13 +1999,13 @@ let lookahead2 ~pass next before =
    *)
 
   (*  (xx) yy *)
-  | (TIdent (s, i1)::TCPar i2::(TIdent (_,i3)|TInt (_,i3))::after::_ ,
+  | (TIdent (s, i1)::TCPar i2::(TIdent (_,i3)|TInt (_,i3))::_ ,
     (TOPar info)::x::_)
     when not (TH.is_stuff_taking_parenthized x) (* &&
       Ast_c.line_of_info i2 =|= Ast_c.line_of_info i3 - why useful?
       *)
       && ok_typedef s
-      && not (ident_or_star after) (* possible K&R declaration *)
+      && not (ident x) (* possible K&R declaration *)
       ->
       msg_typedef s i1 29; LP.add_typedef_root s;
       (*TOPar info*)
@@ -2078,7 +2087,7 @@ let lookahead2 ~pass next before =
       ->
       (*
       if not !Flag_parsing_c.ifdef_to_if
-      then TCommentCpp (Ast_c.CppDirective, ii)
+      then TCommentCpp (Ast_c.CppIfDirective, ii)
       else
       *)
       (* not !LP._lexer_hint.toplevel *)
@@ -2094,7 +2103,14 @@ let lookahead2 ~pass next before =
           pr2_cpp("IFDEF: or related inside function. I treat it as comment");
           incr Stat.nIfdefPassing;
         end;
-        TCommentCpp (Token_c.CppDirective, ii)
+       let x =
+         match x with
+           TIfdef _ | TIfdefMisc _ | TIfdefVersion _ -> Token_c.IfDef
+         | TIfdefBool _ -> Token_c.IfDef0
+         | TIfdefelse _ | TIfdefelif _ -> Token_c.Else
+         | TEndif _ -> Token_c.Endif
+         | _ -> Token_c.Other in (* not possible here *)
+        TCommentCpp (Token_c.CppIfDirective x, ii)
       end
       else x
 
index d200825..ff64bf3 100644 (file)
@@ -659,7 +659,7 @@ let mk_pretty_printers
 
       match ty, iity with
       (* the work is to do in base_type !! *)
-      | (NoType _, iis)                         -> ()
+      | (NoType, iis)                           -> ()
       | (BaseType _, iis)                       -> print_ident ident
       | (Enum  (sopt, enumt), iis)              -> print_ident ident
       | (StructUnion (_, sopt, fields),iis)     -> print_ident ident
index 84906a9..062dc47 100644 (file)
@@ -59,12 +59,16 @@ open Common
  *)
 type cppcommentkind =
   | CppDirective
+  | CppIfDirective of ifdef (* ifdef - multipart directive *)
   | CppAttr
   | CppMacro
   | CppPassingNormal (* ifdef 0, cplusplus, etc *)
   | CppPassingCosWouldGetError (* expr passsing *)
   | CppPassingExplicit (* skip_start/end tag *)
 
+(* avoid circularity with Parser_c *)
+and ifdef = IfDef | IfDef0 | Else | Endif | Other
+
 (*****************************************************************************)
 (* Types *)
 (*****************************************************************************)
index f3e08ea..b941476 100644 (file)
@@ -74,6 +74,19 @@ let set_as_comment cppkind x =
   else
     x.tok <- TCommentCpp (cppkind, TH.info_of_tok x.tok)
 
+let save_as_comment cppkind x =
+  if TH.is_eof x.tok
+  then () (* otherwise parse_c will be lost if don't find a EOF token *)
+  else
+    let t =
+      match x.tok with
+       TIfdef _ | TIfdefMisc _ | TIfdefVersion _ -> Token_c.IfDef
+      | TIfdefBool _ -> Token_c.IfDef0
+      | TIfdefelse _ | TIfdefelif _ -> Token_c.Else
+      | TEndif _ -> Token_c.Endif
+      | _ -> Token_c.Other in
+    x.tok <- TCommentCpp (cppkind t, TH.info_of_tok x.tok)
+
 let mk_token_extended x =
   let (line, col) = TH.linecol_of_tok x in
   { tok = x;
index 804552b..1fc83fa 100644 (file)
@@ -59,4 +59,6 @@ val set_context_tag: brace_grouped list -> unit
 
 (* ---------------------------------------------------------------------- *)
 val set_as_comment : Token_c.cppcommentkind -> token_extended -> unit
+val save_as_comment :
+  (Token_c.ifdef -> Token_c.cppcommentkind)-> token_extended -> unit
 
index c331b34..8b0f808 100644 (file)
@@ -396,7 +396,7 @@ let expand_mcode toks =
       |        Ast_c.FakeTok (s,_) ->
          push2 (C2 s) toks_out
       |        _ ->
-         Printf.printf "line: %s\n" (Common.dump info);
+         Printf.fprintf stderr "line: %s\n" (Common.dump info);
          failwith "not an abstract line");
       (!(info.Ast_c.comments_tag)).Ast_c.mafter +>
       List.iter (fun x -> Common.push2 (comment2t2 x) toks_out) in
@@ -493,6 +493,7 @@ let is_minusable_comment = function
       | Parser_c.TComment _
       | Parser_c.TCommentCpp (Token_c.CppAttr, _)
       | Parser_c.TCommentCpp (Token_c.CppMacro, _)
+      | Parser_c.TCommentCpp (Token_c.CppIfDirective _, _)
       | Parser_c.TCommentCpp (Token_c.CppDirective, _) (* result was false *)
         -> true
 
@@ -514,6 +515,7 @@ let is_minusable_comment_nocpp = function
       | Parser_c.TComment _ -> true
       | Parser_c.TCommentCpp (Token_c.CppAttr, _)
       | Parser_c.TCommentCpp (Token_c.CppMacro, _)
+      | Parser_c.TCommentCpp (Token_c.CppIfDirective _, _)
       | Parser_c.TCommentCpp (Token_c.CppDirective, _)
         -> false
 
@@ -544,6 +546,7 @@ let set_minus_comment adj = function
       | Parser_c.TComment _
       | Parser_c.TCommentCpp (Token_c.CppAttr, _)
       | Parser_c.TCommentCpp (Token_c.CppMacro, _)
+      | Parser_c.TCommentCpp (Token_c.CppIfDirective _, _)
       | Parser_c.TCommentCpp (Token_c.CppDirective, _)
         ->
           pr2 (Printf.sprintf "%d: ERASING_COMMENTS: %s"
@@ -556,8 +559,10 @@ let set_minus_comment adj = function
   | Fake2 _ as x -> x
   | _ -> raise Impossible
 
+(* don't touch ifdefs, done after *)
 let set_minus_comment_or_plus adj = function
-    Cocci2 _ | C2 _ | Comma _ | Indent_cocci2 | Unindent_cocci2 _
+    T2(Parser_c.TCommentCpp (Token_c.CppIfDirective _, _),_,_)
+  | Cocci2 _ | C2 _ | Comma _ | Indent_cocci2 | Unindent_cocci2 _
   | EatSpace2 as x -> x
   | x -> set_minus_comment adj x
 
@@ -652,9 +657,9 @@ let remove_minus_and_between_and_expanded_and_fake xs =
            else
              (* remove spaces after removed stuff, eg a comma after a
                 function argument *)
-             let (spaces,rest) = Common.span is_space xs in
+             (let (spaces,rest) = Common.span is_space xs in
              (List.map (set_minus_comment_or_plus adj1) spaces)
-             @ rest)
+             @ rest))
     | xs -> failwith "should always start with minus"
   and not_context = function
       (T2(_,Ctx,_) as x) when not (is_minusable_comment x) -> false
@@ -746,6 +751,48 @@ let remove_minus_and_between_and_expanded_and_fake xs =
   let xs = drop_minus xs in
   xs
 
+let cleanup_ifdefs toks =
+  (* TODO: these functions are horrid, but using tokens caused circularity *)
+  let is_ifdef0 = function
+      T2((Parser_c.TCommentCpp
+           (Token_c.CppIfDirective Token_c.IfDef0, _)),m,idx) -> true
+    | _ -> false in
+  let is_ifdef = function
+      T2((Parser_c.TCommentCpp
+           (Token_c.CppIfDirective Token_c.IfDef, _)),m,idx) -> true
+    | t -> is_ifdef0 t in
+  let is_endif = function
+      T2((Parser_c.TCommentCpp
+           (Token_c.CppIfDirective Token_c.Endif, _)),m,idx) -> true
+    | _ -> false in
+  (* only real comments *)
+let is_whitespace_or_comment if0 = function
+  | (T2 (t,_b,_i)) ->
+      (match t with
+      | Parser_c.TComment _ -> false (* previous pass chooses comments *)
+      | Parser_c.TCommentSpace _ -> true  (* only whitespace *)
+      | Parser_c.TCommentNewline _ (* newline plus whitespace *)
+      |        Parser_c.TCommentCpp (Token_c.CppIfDirective Token_c.Else, _) -> true
+      |        Parser_c.TCommentCpp (Token_c.CppPassingNormal, _) -> if0
+      | t -> false
+      )
+  | _ -> false in
+  let rec loop prev if0s = function
+      [] -> prev
+    | t::rest when is_ifdef0 t -> loop (t::prev) (true::if0s) rest
+    | t::rest when is_ifdef t -> loop (t::prev) (false::if0s) rest
+    | t::rest when is_endif t ->
+       (match if0s with
+         [] -> loop (t::prev) if0s rest
+       | tgt::if0s ->
+           let (spaces,prest) =
+             Common.span (is_whitespace_or_comment tgt) prev in
+           (match prest with
+             t1::prest when is_ifdef t1 -> loop prest if0s rest
+           | _ -> loop (t::prev) [] rest)) (* failed, so drop if0 info *)
+    | x::xs -> loop (x::prev) if0s xs in
+  List.rev (loop [] [] toks)
+
 (* things that should not be followed by space - boundary between SmPL
    code and C code *)
 let adjust_eat_space toks =
@@ -1297,9 +1344,10 @@ let pp_program2 xs outfile  =
              let toks = drop_space_at_endline toks in
              let toks = paren_to_space toks in
              let toks = drop_end_comma toks in
-              let toks = remove_minus_and_between_and_expanded_and_fake toks in
+             let toks = remove_minus_and_between_and_expanded_and_fake toks in
+             let toks = cleanup_ifdefs toks in
               (* assert Origin + Cocci + C and no minus *)
-              let toks = add_space toks in
+             let toks = add_space toks in
              let toks = add_newlines toks tu in
              let toks = paren_then_brace toks in
               let toks = fix_tokens toks in
index aa3fb14..ee96b84 100644 (file)
@@ -22,7 +22,9 @@
 # Coccinelle under other licenses.
 
 
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET=cocci_parser
 
@@ -46,28 +48,16 @@ get_constants2.ml id_utils.ml adjacency.ml parse_cocci.ml command_line.ml
 LIBS=../commons/commons.cma ../globals/globals.cma
 SYSLIBS = str.cma unix.cma
 
-ifeq ("$(MENHIRDIR)","menhirlib")
-MENHIR_PATH=../$(MENHIRDIR)
-else
-MENHIR_PATH=$(MENHIRDIR)
-endif
-
 INCLUDES = -I ../commons \
           -I ../commons/ocamlextra \
           -I ../globals \
-          -I $(MENHIR_PATH)
-
-MENHIR=$(MENHIR_PATH)/menhirLib.cmo
-MENHIRO=$(MENHIR_PATH)/menhirLib.cmx
+          -I $(MENHIRDIR)
 
+MENHIRMOD=menhirLib.cmo
+MENHIROMOD=menhirLib.cmx
 
 # The Caml compilers.
 OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLLEX = ocamllex$(OPTBIN)
-OCAMLYACC= menhir --table
-OCAMLDEP = ocamldep$(OPTBIN) #$(INCLUDES)
 EXEC=$(TARGET).byte
 EXEC=$(TARGET)
 LIB=$(TARGET).cma
@@ -86,18 +76,15 @@ local: $(EXEC)
 all.opt: $(OPTLIB)
 
 $(LIB): $(GENERATED) $(OBJS)
-       $(OCAMLC) -I $(MENHIR_PATH) -a -o $(LIB) $(MENHIR) $(OBJS)
+       $(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -I $(MENHIRDIR) -a -o $(LIB) $(MENHIRMOD) $(OBJS)
 
 
 $(OPTLIB): $(GENERATED) $(OPTOBJS)
-       $(OCAMLOPT) -I $(MENHIR_PATH) -a -o $(OPTLIB) $(MENHIRO) $(OPTOBJS)
+       $(OCAMLOPT) $(OPTFLAGS) $(INCLUDES) -I $(MENHIRDIR) -a -o $(OPTLIB) $(MENHIROMOD) $(OPTOBJS)
 
 
 $(EXEC): $(OBJS) main.cmo $(LIBS)
-       $(OCAMLC) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
-
-
-
+       $(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
 
 clean::
        rm -f $(LIB)
@@ -105,25 +92,23 @@ clean::
        rm -f $(TARGET)
 
 
-
-
 .SUFFIXES:
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -c $<
 
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -c $<
 
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT) $(OPTFLAGS) $(INCLUDES) -c $<
 
 $(LEXER_SOURCES:.mll=.ml) :    $(LEXER_SOURCES)
        $(OCAMLLEX) $(LEXER_SOURCES)
 
 $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
-       $(OCAMLYACC) $(PARSER_SOURCES)
+       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --table --base parser_cocci_menhir $(PARSER_SOURCES)
 
 $(CLI_LEXER_SOURCES:.mll=.ml): $(CLI_LEXER_SOURCES)
        $(OCAMLLEX) $(CLI_LEXER_SOURCES)
@@ -131,27 +116,29 @@ $(CLI_LEXER_SOURCES:.mll=.ml): $(CLI_LEXER_SOURCES)
 $(SCRIPT_LEXER_SOURCES:.mll=.ml): $(SCRIPT_LEXER_SOURCES)
        $(OCAMLLEX) $(SCRIPT_LEXER_SOURCES)
 
-distclean::
+distclean:: clean
+       @echo cleaning generated parsers and lexers
        rm -f $(GENERATED)
 
 # clean rule for others files
 clean::
        rm -f *.cm[iox] *.o *.annot
        rm -f *~ .*~ #*#
-
-distclean::
        rm -f .depend
 
-depend: $(GENERATED)
-       $(OCAMLDEP) *.mli *.ml > .depend
 
-.depend:
+.PHONEY: depend
+.depend depend: $(GENERATED)
        $(OCAMLDEP) *.mli *.ml > .depend
 
--include .depend
-
 lexer_cocci.ml: lexer_cocci.mll
 parser_cocci_menhir.ml: parser_cocci_menhir.mly lexer_cocci.mll
 parser_cocci_menhir.mli: parser_cocci_menhir.mly lexer_cocci.mll
 lexer_script.ml: lexer_script.mll
 lexer_cli.ml: lexer_cli.mll
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+-include .depend
+endif
+endif
index 763703d..cdbf37e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./adjacency.ml"
 module Ast0 = Ast0_cocci
 module V0 = Visitor_ast0
 module VT0 = Visitor_ast0_types
index 7b81df7..20a2cc4 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./adjacency.mli"
 val compute_adjacency : Ast0_cocci.rule -> Ast0_cocci.rule
index 31c747d..9fa77cd 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./adjust_pragmas.ml"
 (* Find a directive or comment at the end of a statement.  Things with aft
 given None, because they can accomodate their own directives or comments *)
 
index 08b9d26..42e9857 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./adjust_pragmas.mli"
 val process : Ast0_cocci.rule -> Ast0_cocci.rule
index fac9765..af2f2ae 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./arity.ml"
 (* Arities matter for the minus slice, but not for the plus slice. *)
 
 (* ? only allowed on rule_elems, and on subterms if the context is ? also. *)
index 35c183b..40a2163 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./arity.mli"
 val minus_arity : Ast0_cocci.rule -> Ast0_cocci.rule
index a479f46..2438b5d 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast0_cocci.ml"
 module Ast = Ast_cocci
 module TC = Type_cocci
 
index 7ada39a..53f7a57 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast0_cocci.mli"
 (* --------------------------------------------------------------------- *)
 (* Modified code *)
 
index d9dd869..74ed4da 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast0toast.ml"
 (* Arities matter for the minus slice, but not for the plus slice. *)
 
 (* + only allowed on code in a nest (in_nest = true).  ? only allowed on
index b45bd7b..f9c116a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast0toast.mli"
 val ast0toast :
     string -> Ast_cocci.dependency -> string list (* dropped isos *) ->
       Ast_cocci.exists -> Ast0_cocci.rule -> bool list -> Ast_cocci.ruletype ->
index e04ff2c..949bb0b 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast_cocci.ml"
 (* --------------------------------------------------------------------- *)
 (* Modified code *)
 
index 0bf2fcd..4492379 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast_cocci.mli"
 (* --------------------------------------------------------------------- *)
 (* Modified code *)
 
index 2f0dd7c..0a4e7f8 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./check_meta.ml"
 (* For minus fragment, checks that all of the identifier metavariables that
 are used are not declared as fresh, and check that all declared variables
 are used.  For plus fragment, just check that the variables declared as
index f0ff4f0..815d5e1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./check_meta.mli"
 val check_meta :
     string ->
     Ast_cocci.metavar list (* old metavariables *) ->
index 952f3a4..dbe9ec6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./comm_assoc.ml"
 (* searches for E op ..., for any commutative and associative binary
 operator.  When this satisfies the isomorphism conditions (ie all minus, or
 context for the op and ...), then this is converted to Nested(E,op).
index 2b271df..5c60773 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./comm_assoc.mli"
 val comm_assoc :
     Ast0_cocci.rule -> string (* rule name *) ->
       string list (* dropped isos *) -> Ast0_cocci.rule
index e828fbe..2182af9 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./command_line.ml"
 (* ---------------------------------------------------------------------- *)
 (* useful functions *)
 
@@ -166,7 +167,7 @@ let command_line args =
   | Some(pre_args,sp,post_args) ->
       (match post_args with
        first::post_args ->
-         pre_args @ "--sp_file" ::
+         pre_args @ "--sp-file" ::
                     (reparse (tokenize first)) ::
                     post_args
       | [] -> failwith "--sp needs an argument")
index 083c0c4..77ef158 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./command_line.mli"
 val command_line : string list -> string list
index ea6aa27..df41966 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./compute_lines.ml"
 (* Computes starting and ending logical lines for statements and
 expressions.  every node gets an index as well. *)
 
index 49fdec4..564aaa1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./compute_lines.mli"
 val compute_lines : bool -> Ast0_cocci.rule -> Ast0_cocci.rule
 
 val compute_statement_dots_lines : bool ->
index 27b4e01..5f9b8e7 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./context_neg.ml"
 (* Detects subtrees that are all minus/plus and nodes that are "binding
 context nodes".  The latter is a node whose structure and immediate tokens
 are the same in the minus and plus trees, and such that for every child,
@@ -1034,6 +1035,23 @@ let check_compatible m p =
   | (Ast0.OTHER(_),Ast0.OTHER(_)) -> ()
   | _ -> fail()
 
+(* can't just remove expressions or types, not sure if all cases are needed. *)
+let check_complete m =
+   match Ast0.unwrap m with
+     Ast0.NONDECL(code) ->
+       if is_exp code or is_ty code
+       then
+        failwith
+          (Printf.sprintf "invalid minus starting on line %d"
+             (Ast0.get_line m))
+   | Ast0.CODE(code) ->
+       if isonly is_exp code or isonly is_ty code
+       then
+        failwith
+           (Printf.sprintf "invalid minus starting on line %d"
+              (Ast0.get_line m))
+   | _ -> ()
+
 (* ------------------------------------------------------------------- *)
 
 (* returns a list of corresponding minus and plus trees *)
@@ -1047,6 +1065,7 @@ let context_neg minus plus =
     | ([],l) ->
        failwith (Printf.sprintf "%d plus things remaining" (List.length l))
     | (minus,[]) ->
+       List.iter check_complete minus;
        plus_lines := [];
        let _ =
          List.map
index d304c47..054902f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./context_neg.mli"
 val context_neg :
     Ast0_cocci.rule -> Ast0_cocci.rule ->
       (Ast0_cocci.top_level * Ast0_cocci.top_level) list
index 674b183..a056742 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./data.ml"
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 
index 85cd346..5b96fc2 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./data.mli"
 (* types that clutter the .mly file *)
 (* for iso metavariables, true if they can only match nonmodified, unitary
    metavariables *)
index ce7e15d..a6dbfef 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./disjdistr.ml"
 module Ast = Ast_cocci
 module V = Visitor_ast
 
index 82f2a45..3d44657 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./disjdistr.mli"
 val disj :
     Ast_cocci.rule_with_metavars list -> Ast_cocci.rule_with_metavars list
index b824e26..60974b4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./flag_parsing_cocci.ml"
 (* uses E rather than A and adds comments indicating the start and end of
 each matched term *)
 
index 995339c..80900e6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./free_vars.ml"
 (* For each rule return the list of variables that are used after it.
 Also augment various parts of each rule with unitary, inherited, and freshness
 informations *)
index fecda61..fd3134e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./free_vars.mli"
 (* Used after things can only have one binding.  Positions can have many
 bindings.  These are combined in ctlcocciintegration, ie after the CTL
 generation. *)
index 3f42d37..0ef454b 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./function_prototypes.ml"
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 module V0 = Visitor_ast0
index d1f3498..b18105c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./function_prototypes.mli"
 val process : string (* name *) -> Ast_cocci.metavar list ->
   string list (* dropped isos *) ->
     Ast0_cocci.rule -> Ast0_cocci.rule -> Ast_cocci.ruletype ->
index 31a479f..95c1742 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./get_constants.ml"
 (* get a list of all of the constants in the - slice of a SmPL file, to be
 used to select which files to process *)
 
index 11f1467..0e95ee3 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./get_constants.mli"
 val get_constants : Ast_cocci.rule list -> string list list
index 4b7cb1a..ed95fd3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./get_constants2.ml"
 module Ast = Ast_cocci
 module V = Visitor_ast
 module TC = Type_cocci
index 19a19ca..2e0dad3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./get_constants2.mli"
 type combine =
     And of combine list | Or of combine list | Elem of string | False | True
 
index cda51ab..ce453a2 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./get_metas.ml"
 (* --------------------------------------------------------------------- *)
 (* creates AsExpr, etc *)
 (* @ attached metavariables can only be associated with positions, so nothing
index 08b9d26..2e226a9 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./get_metas.mli"
 val process : Ast0_cocci.rule -> Ast0_cocci.rule
index 6f05ad0..dc65cf4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./id_utils.ml"
 (* evaluation of nested and and or using id-utils *)
 
 module GC = Get_constants2
index 936c31c..f1387e1 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./id_utils.mli"
 val interpret : string -> Get_constants2.combine -> string list
index 11d2812..62a2180 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./index.ml"
 (* create an index for each constructor *)
 (* current max is 157 *)
 
index ba2c6c2..e6c0539 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./index.mli"
 val expression_dots : Ast0_cocci.expression Ast0_cocci.dots -> int list
 val initialiser_dots : Ast0_cocci.initialiser Ast0_cocci.dots -> int list
 val parameter_dots : Ast0_cocci.parameterTypeDef Ast0_cocci.dots -> int list
index 5991a99..199b04c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./insert_plus.ml"
 (* The error message "no available token to attach to" often comes in an
 argument list of unbounded length.  In this case, one should move a comma so
 that there is a comma after the + code. *)
index ac0e0f6..a060474 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./insert_plus.mli"
 val insert_plus : Ast0_cocci.rule -> Ast0_cocci.rule -> bool -> unit
 (* bool is true if no isos *)
index d46833a..ce4e542 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./iso_compile.ml"
 module V0 = Visitor_ast0
 module VT0 = Visitor_ast0_types
 module Ast0 = Ast0_cocci
index 6560be5..8a7e183 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./iso_compile.mli"
 val process : Iso_pattern.isomorphism -> unit
 
index 2b53341..a91ee67 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./iso_pattern.ml"
 (* Potential problem: offset of mcode is not updated when an iso is
 instantiated, implying that a term may end up with many mcodes with the
 same offset.  On the other hand, at the moment offset only seems to be used
index b82eeba..e6b4271 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./iso_pattern.mli"
 type isomorphism =
     Ast_cocci.metavar list * Ast0_cocci.anything list list * string(*iso name*)
 
diff --git a/parsing_cocci/lexer_cli.ml b/parsing_cocci/lexer_cli.ml
new file mode 100644 (file)
index 0000000..6b8111a
--- /dev/null
@@ -0,0 +1,258 @@
+# 2 "lexer_cli.mll"
+  exception Lexical of string
+
+  let tok = Lexing.lexeme
+
+  type cli_tok =
+      Id of string
+    | NotEq
+    | EqEq
+    | Other of string
+    | EOF
+
+  let pretty_print tok =
+    match tok with
+       Id s    -> s
+      | NotEq   -> "when !="
+      | EqEq    -> "when =="
+      | Other s -> s
+      | EOF     -> ""
+
+# 23 "lexer_cli.ml"
+let __ocaml_lex_tables = {
+  Lexing.lex_base = 
+   "\000\000\250\255\251\255\075\000\001\000\160\000\235\000\054\001\
+    \168\001\000\000\001\000\002\000\004\000\005\000";
+  Lexing.lex_backtrk = 
+   "\255\255\255\255\255\255\003\000\002\000\003\000\003\000\003\000\
+    \003\000\255\255\255\255\255\255\000\000\001\000";
+  Lexing.lex_default = 
+   "\001\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255";
+  Lexing.lex_trans = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\004\000\004\000\011\000\000\000\012\000\013\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \004\000\004\000\011\000\010\000\012\000\013\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\013\000\012\000\009\000\
+    \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\
+    \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\005\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\
+    \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\
+    \002\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \006\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\
+    \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\
+    \007\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\008\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\011\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \011\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\009\000\000\000\000\000\
+    \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\
+    \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000";
+  Lexing.lex_check = 
+   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\000\000\004\000\011\000\255\255\012\000\013\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \000\000\004\000\011\000\011\000\012\000\013\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\009\000\010\000\011\000\
+    \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\255\255\255\255\255\255\255\255\000\000\
+    \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\255\255\255\255\
+    \255\255\255\255\003\000\255\255\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\003\000\003\000\003\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \005\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\255\255\255\255\255\255\255\255\005\000\
+    \000\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
+    \005\000\005\000\005\000\006\000\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\255\255\255\255\
+    \255\255\255\255\006\000\255\255\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
+    \006\000\006\000\006\000\006\000\006\000\006\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\255\255\255\255\255\255\255\255\255\255\255\255\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\255\255\255\255\255\255\255\255\007\000\255\255\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\008\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \008\000\008\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\255\255\255\255\008\000\255\255\255\255\
+    \255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\255\255\255\255\255\255\255\255\008\000\
+    \255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\
+    \008\000\008\000\008\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255";
+  Lexing.lex_base_code = 
+   "";
+  Lexing.lex_backtrk_code = 
+   "";
+  Lexing.lex_default_code = 
+   "";
+  Lexing.lex_trans_code = 
+   "";
+  Lexing.lex_check_code = 
+   "";
+  Lexing.lex_code = 
+   "";
+}
+
+let rec token lexbuf =
+    __ocaml_lex_token_rec lexbuf 0
+and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 31 "lexer_cli.mll"
+                                        ( NotEq )
+# 229 "lexer_cli.ml"
+
+  | 1 ->
+# 32 "lexer_cli.mll"
+                                        ( EqEq  )
+# 234 "lexer_cli.ml"
+
+  | 2 ->
+# 33 "lexer_cli.mll"
+                ( Other(" ") )
+# 239 "lexer_cli.ml"
+
+  | 3 ->
+# 34 "lexer_cli.mll"
+         ( Id(tok lexbuf)    )
+# 244 "lexer_cli.ml"
+
+  | 4 ->
+# 35 "lexer_cli.mll"
+         ( EOF               )
+# 249 "lexer_cli.ml"
+
+  | 5 ->
+# 36 "lexer_cli.mll"
+         ( Other(tok lexbuf) )
+# 254 "lexer_cli.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_token_rec lexbuf __ocaml_lex_state
+
+;;
+
index f8ccb0f..911959a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./lexer_cli.mll"
 (* Lexer for the command line mode *)
 
 {
diff --git a/parsing_cocci/lexer_cocci.ml b/parsing_cocci/lexer_cocci.ml
new file mode 100644 (file)
index 0000000..096239d
--- /dev/null
@@ -0,0 +1,2330 @@
+# 0 "lexer_cocci.mll"
+open Parser_cocci_menhir
+module D = Data
+module Ast = Ast_cocci
+module Ast0 = Ast0_cocci
+module P = Parse_aux
+exception Lexical of string
+let tok = Lexing.lexeme
+
+let line = ref 1
+let logical_line = ref 0
+
+(* ---------------------------------------------------------------------- *)
+(* control codes *)
+
+(* Defined in data.ml
+type line_type = MINUS | OPTMINUS | UNIQUEMINUS | PLUS | CONTEXT | UNIQUE | OPT
+*)
+
+let current_line_type = ref (D.CONTEXT,!line,!logical_line)
+
+let prev_plus = ref false
+let line_start = ref 0 (* offset of the beginning of the line *)
+let get_current_line_type lexbuf =
+  let (c,l,ll) = !current_line_type in
+  let lex_start = Lexing.lexeme_start lexbuf in
+  let preceeding_spaces =
+    if !line_start < 0 then 0 else lex_start - !line_start in
+  (*line_start := -1;*)
+  prev_plus := (c = D.PLUS) or (c = D.PLUSPLUS);
+  (c,l,ll,lex_start,preceeding_spaces,[],[],[])
+let current_line_started = ref false
+let col_zero = ref true
+
+let contextify (c,l,ll,lex_start,preceeding_spaces,bef,aft,pos) =
+  (D.CONTEXT,l,ll,lex_start,preceeding_spaces,bef,aft,pos)
+
+let reset_line lexbuf =
+  line := !line + 1;
+  current_line_type := (D.CONTEXT,!line,!logical_line);
+  current_line_started := false;
+  col_zero := true;
+  line_start := Lexing.lexeme_start lexbuf + 1
+
+let started_line = ref (-1)
+
+let start_line seen_char =
+  current_line_started := true;
+  col_zero := false;
+  (if seen_char && not(!line = !started_line)
+  then
+    begin
+      started_line := !line;
+      logical_line := !logical_line + 1
+    end)
+
+let pass_zero _ = col_zero := false
+
+let lexerr s1 s2 = raise (Lexical (Printf.sprintf "%s%s" s1 s2))
+
+let add_current_line_type x =
+  match (x,!current_line_type) with
+    (D.MINUS,(D.CONTEXT,ln,lln))  ->
+      current_line_type := (D.MINUS,ln,lln)
+  | (D.MINUS,(D.UNIQUE,ln,lln))   ->
+      current_line_type := (D.UNIQUEMINUS,ln,lln)
+  | (D.MINUS,(D.OPT,ln,lln))      ->
+      current_line_type := (D.OPTMINUS,ln,lln)
+  | (D.PLUS,(D.CONTEXT,ln,lln))   ->
+      current_line_type := (D.PLUS,ln,lln)
+  | (D.PLUSPLUS,(D.CONTEXT,ln,lln))   ->
+      current_line_type := (D.PLUSPLUS,ln,lln)
+  | (D.UNIQUE,(D.CONTEXT,ln,lln)) ->
+      current_line_type := (D.UNIQUE,ln,lln)
+  | (D.OPT,(D.CONTEXT,ln,lln))    ->
+      current_line_type := (D.OPT,ln,lln)
+  | _ -> lexerr "invalid control character combination" ""
+
+let check_minus_context_linetype s =
+  match !current_line_type with
+    (D.PLUS,_,_) | (D.PLUSPLUS,_,_) -> lexerr "invalid in a + context: " s
+  | _ -> ()
+
+let check_context_linetype s =
+  match !current_line_type with
+    (D.CONTEXT,_,_) -> ()
+  | _ -> lexerr "invalid in a nonempty context: " s
+
+let check_plus_linetype s =
+  match !current_line_type with
+    (D.PLUS,_,_) | (D.PLUSPLUS,_,_) -> ()
+  | _ -> lexerr "invalid in a non + context: " s
+
+let check_arity_context_linetype s =
+  match !current_line_type with
+    (D.CONTEXT,_,_) | (D.PLUS,_,_) | (D.PLUSPLUS,_,_)
+  | (D.UNIQUE,_,_) | (D.OPT,_,_) -> ()
+  | _ -> lexerr "invalid in a nonempty context: " s
+
+let check_comment s =
+  if not !current_line_started
+  then lexerr "+ expected at the beginning of the line" s
+
+let process_include start finish str =
+  (match !current_line_type with
+    (D.PLUS,_,_) | (D.PLUSPLUS,_,_) ->
+      (try
+       let _ = Str.search_forward (Str.regexp "\\.\\.\\.") str start in
+       lexerr "... not allowed in + include" ""
+      with Not_found -> ())
+  | _ -> ());
+  String.sub str (start + 1) (finish - start - 1)
+
+(* ---------------------------------------------------------------------- *)
+type pm = PATCH | MATCH | UNKNOWN
+
+let pm = ref UNKNOWN
+
+let patch_or_match = function
+    PATCH ->
+      if not !D.ignore_patch_or_match
+      then
+       (match !pm with
+         MATCH ->
+           lexerr "- or + not allowed in the first column for a match" ""
+       | PATCH -> ()
+       | UNKNOWN -> Flag.sgrep_mode2 := false; pm := PATCH)
+  | MATCH ->
+      if not !D.ignore_patch_or_match
+      then
+       (match !pm with
+         PATCH -> lexerr "* not allowed in the first column for a patch" ""
+       | MATCH -> ()
+       | UNKNOWN -> Flag.sgrep_mode2 := true; pm := MATCH)
+  | _ -> failwith "unexpected argument"
+
+(* ---------------------------------------------------------------------- *)
+(* identifiers, including metavariables *)
+
+let metavariables = (Hashtbl.create(100) : (string, D.clt -> token) Hashtbl.t)
+
+let all_metavariables =
+  (Hashtbl.create(100) : (string,(string * (D.clt -> token)) list) Hashtbl.t)
+
+let type_names = (Hashtbl.create(100) : (string, D.clt -> token) Hashtbl.t)
+
+let declarer_names = (Hashtbl.create(100) : (string, D.clt -> token) Hashtbl.t)
+
+let iterator_names = (Hashtbl.create(100) : (string, D.clt -> token) Hashtbl.t)
+
+let symbol_names = (Hashtbl.create(15) : (string, D.clt -> token) Hashtbl.t)
+
+let rule_names = (Hashtbl.create(100) : (string, unit) Hashtbl.t)
+
+let check_var s linetype =
+  let fail _ =
+    if (!Data.in_prolog || !Data.in_rule_name) &&
+      Str.string_match (Str.regexp "<.*>") s 0
+    then TPathIsoFile s
+    else
+      try (Hashtbl.find metavariables s) linetype
+      with Not_found ->
+       (try (Hashtbl.find type_names s) linetype
+       with Not_found ->
+         (try (Hashtbl.find declarer_names s) linetype
+         with Not_found ->
+           (try (Hashtbl.find iterator_names s) linetype
+           with Not_found ->
+             (try (Hashtbl.find symbol_names s) linetype
+             with Not_found ->
+                TIdent (s,linetype))))) in
+  if !Data.in_meta or !Data.in_rule_name
+  then (try Hashtbl.find rule_names s; TRuleName s with Not_found -> fail())
+  else fail()
+
+let id_tokens lexbuf =
+  let s = tok lexbuf in
+  let linetype = get_current_line_type lexbuf in
+  let in_rule_name = !Data.in_rule_name in
+  let in_meta = !Data.in_meta && not !Data.saw_struct in
+  let in_iso = !Data.in_iso in
+  let in_prolog = !Data.in_prolog in
+  (if s = "identifer" && in_meta
+  then Common.pr2 "Warning: should identifer be identifier?");
+  match s with
+    "metavariable" when in_meta -> check_arity_context_linetype s; TMetavariable
+  | "identifier" when in_meta -> check_arity_context_linetype s; TIdentifier
+  | "type" when in_meta ->       check_arity_context_linetype s; TType
+  | "parameter" when in_meta ->  check_arity_context_linetype s; TParameter
+  | "constant"  when in_meta ->  check_arity_context_linetype s; TConstant
+  | "generated" when in_rule_name && not (!Flag.make_hrule = None) ->
+      check_arity_context_linetype s; TGenerated
+  | "expression" when in_meta || in_rule_name ->
+      check_arity_context_linetype s; TExpression
+  | "declaration" when in_meta || in_rule_name ->
+      check_arity_context_linetype s; TDeclaration
+  | "field" when in_meta || in_rule_name ->
+      check_arity_context_linetype s; TField
+  | "initialiser" when in_meta || in_rule_name ->
+      check_arity_context_linetype s; TInitialiser
+  | "initializer" when in_meta || in_rule_name ->
+      check_arity_context_linetype s; TInitialiser
+  | "idexpression" when in_meta ->
+      check_arity_context_linetype s; TIdExpression
+  | "statement" when in_meta ->  check_arity_context_linetype s; TStatement
+  | "function"  when in_meta ->  check_arity_context_linetype s; TFunction
+  | "local" when in_meta ->      check_arity_context_linetype s; TLocal
+  | "list" when in_meta ->       check_arity_context_linetype s; Tlist
+  | "fresh" when in_meta ->      check_arity_context_linetype s; TFresh
+  | "typedef" when in_meta ->    check_arity_context_linetype s; TTypedef
+  | "declarer" when in_meta ->   check_arity_context_linetype s; TDeclarer
+  | "iterator" when in_meta ->   check_arity_context_linetype s; TIterator
+  | "name" when in_meta ->       check_arity_context_linetype s; TName
+  | "position" when in_meta ->   check_arity_context_linetype s; TPosition
+  | "any" when in_meta ->        check_arity_context_linetype s; TPosAny
+  | "pure" when in_meta && in_iso ->
+      check_arity_context_linetype s; TPure
+  | "context" when in_meta && in_iso ->
+      check_arity_context_linetype s; TContext
+  | "error" when in_meta ->      check_arity_context_linetype s; TError
+  | "words" when in_meta ->      check_context_linetype s; TWords
+  | "symbol" when in_meta ->     check_arity_context_linetype s; TSymbol
+
+  | "using" when in_rule_name || in_prolog ->  check_context_linetype s; TUsing
+  | "virtual" when in_prolog or in_rule_name or in_meta ->
+      (* don't want to allow virtual as a rule name *)
+      check_context_linetype s; TVirtual
+  | "disable" when in_rule_name ->  check_context_linetype s; TDisable
+  | "extends" when in_rule_name -> check_context_linetype s; TExtends
+  | "depends" when in_rule_name -> check_context_linetype s; TDepends
+  | "on" when in_rule_name      -> check_context_linetype s; TOn
+  | "ever" when in_rule_name    -> check_context_linetype s; TEver
+  | "never" when in_rule_name   -> check_context_linetype s; TNever
+  (* exists and forall for when are reparsed in parse_cocci.ml *)
+  | "exists" when in_rule_name  -> check_context_linetype s; TExists
+  | "forall" when in_rule_name  -> check_context_linetype s; TForall
+  | "script" when in_rule_name  -> check_context_linetype s; TScript
+  | "initialize" when in_rule_name -> check_context_linetype s; TInitialize
+  | "finalize" when in_rule_name   -> check_context_linetype s; TFinalize
+
+  | "char" ->       Tchar     linetype
+  | "short" ->      Tshort    linetype
+  | "int" ->        Tint      linetype
+  | "double" ->     Tdouble   linetype
+  | "float" ->      Tfloat    linetype
+  | "long" ->       Tlong     linetype
+  | "void" ->       Tvoid     linetype
+  | "size_t" ->     Tsize_t   linetype
+  | "ssize_t" ->    Tssize_t  linetype
+  | "ptrdiff_t" ->  Tptrdiff_t linetype
+  (* in_meta is only for the first keyword; drop it now to allow any type
+     name *)
+  | "struct" ->     Data.saw_struct := true; Tstruct   linetype
+  | "union" ->      Data.saw_struct := true; Tunion    linetype
+  | "enum" ->       Data.saw_struct := true; Tenum     linetype
+  | "unsigned" ->   Tunsigned linetype
+  | "signed" ->     Tsigned   linetype
+
+  | "auto"  ->      Tauto     linetype
+  | "register" ->   Tregister linetype
+  | "extern" ->     Textern   linetype
+  | "static" ->     Tstatic   linetype
+  | "inline" ->     Tinline   linetype
+  | "typedef" ->    Ttypedef  linetype
+
+  | "const" ->      Tconst    linetype
+  | "volatile" ->   Tvolatile linetype
+
+  | "if" ->         TIf       linetype
+  | "else" ->       TElse     linetype
+  | "while" ->      TWhile    linetype
+  | "do" ->         TDo       linetype
+  | "for" ->        TFor      linetype
+  | "switch" ->     TSwitch   linetype
+  | "case" ->       TCase     linetype
+  | "default" ->    TDefault  linetype
+  | "return" ->     TReturn   linetype
+  | "break" ->      TBreak    linetype
+  | "continue" ->   TContinue linetype
+  | "goto" ->       TGoto     linetype
+
+  | "sizeof" ->     TSizeof   linetype
+
+  | "Expression"       when !Data.in_iso -> TIsoExpression
+  | "ArgExpression"    when !Data.in_iso -> TIsoArgExpression
+  | "TestExpression"   when !Data.in_iso -> TIsoTestExpression
+  | "ToTestExpression" when !Data.in_iso -> TIsoToTestExpression
+  | "Statement"        when !Data.in_iso -> TIsoStatement
+  | "Declaration"      when !Data.in_iso -> TIsoDeclaration
+  | "Type"             when !Data.in_iso -> TIsoType
+  | "TopLevel"         when !Data.in_iso -> TIsoTopLevel
+
+  | "_" when !Data.in_meta -> TUnderscore
+
+  | s -> check_var s linetype
+
+let mkassign op lexbuf =
+  TAssign (Ast.OpAssign op, (get_current_line_type lexbuf))
+
+let init _ =
+  line := 1;
+  logical_line := 0;
+  prev_plus := false;
+  line_start := 0;
+  current_line_started := false;
+  current_line_type := (D.CONTEXT,0,0);
+  col_zero := true;
+  pm := UNKNOWN;
+  Data.in_rule_name := false;
+  Data.in_meta := false;
+  Data.in_prolog := false;
+  Data.saw_struct := false;
+  Data.inheritable_positions := [];
+  Hashtbl.clear all_metavariables;
+  Hashtbl.clear Data.all_metadecls;
+  Hashtbl.clear metavariables;
+  Hashtbl.clear type_names;
+  Hashtbl.clear rule_names;
+  Hashtbl.clear iterator_names;
+  Hashtbl.clear declarer_names;
+  Hashtbl.clear symbol_names;
+  let get_name (_,x) = x in
+  Data.add_meta_meta :=
+    (fun name pure ->
+      let fn clt = TMeta(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_id_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaId(name,constraints,Ast.NoVal,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_virt_id_meta_found :=
+    (fun name vl ->
+      let fn clt = TIdent(vl,clt) in
+      Hashtbl.replace metavariables name fn);
+  Data.add_virt_id_meta_not_found :=
+    (fun name pure ->
+      let fn clt = TMetaId(name,Ast.IdNoConstraint,Ast.NoVal,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_fresh_id_meta :=
+    (fun name seed ->
+      let fn clt = TMetaId(name,Ast.IdNoConstraint,seed,Ast0.Impure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_type_meta :=
+    (fun name pure ->
+      let fn clt = TMetaType(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_init_meta :=
+    (fun name pure ->
+      let fn clt = TMetaInit(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_initlist_meta :=
+    (function name -> function lenname -> function pure ->
+      let fn clt = TMetaInitList(name,lenname,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_param_meta :=
+    (function name -> function pure ->
+      let fn clt = TMetaParam(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_paramlist_meta :=
+    (function name -> function lenname -> function pure ->
+      let fn clt = TMetaParamList(name,lenname,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_const_meta :=
+    (fun tyopt name constraints pure ->
+      let fn clt = TMetaConst(name,constraints,pure,tyopt,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_err_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaErr(name,constraints,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_exp_meta :=
+    (fun tyopt name constraints pure ->
+      let fn clt = TMetaExp(name,constraints,pure,tyopt,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_idexp_meta :=
+    (fun tyopt name constraints pure ->
+      let fn clt = TMetaIdExp(name,constraints,pure,tyopt,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_local_idexp_meta :=
+    (fun tyopt name constraints pure ->
+      let fn clt = TMetaLocalIdExp(name,constraints,pure,tyopt,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_explist_meta :=
+    (function name -> function lenname -> function pure ->
+      let fn clt = TMetaExpList(name,lenname,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_decl_meta :=
+    (function name -> function pure ->
+      let fn clt = TMetaDecl(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_field_meta :=
+    (function name -> function pure ->
+      let fn clt = TMetaField(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_field_list_meta :=
+    (function name -> function lenname -> function pure ->
+      let fn clt = TMetaFieldList(name,lenname,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_stm_meta :=
+    (function name -> function pure ->
+      let fn clt = TMetaStm(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_stmlist_meta :=
+    (function name -> function pure ->
+      let fn clt = TMetaStmList(name,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_func_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaFunc(name,constraints,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_local_func_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaLocalFunc(name,constraints,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_iterator_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaIterator(name,constraints,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_declarer_meta :=
+    (fun name constraints pure ->
+      let fn clt = TMetaDeclarer(name,constraints,pure,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_pos_meta :=
+    (fun name constraints any ->
+      let fn ((d,ln,_,_,_,_,_,_) as clt) =
+       (if d = Data.PLUS
+       then
+         failwith
+           (Printf.sprintf "%d: positions only allowed in minus code" ln));
+       TMetaPos(name,constraints,any,clt) in
+      Hashtbl.replace metavariables (get_name name) fn);
+  Data.add_type_name :=
+    (function name ->
+      let fn clt = TTypeId(name,clt) in
+      Hashtbl.replace type_names name fn);
+  Data.add_declarer_name :=
+    (function name ->
+      let fn clt = TDeclarerId(name,clt) in
+      Hashtbl.replace declarer_names name fn);
+  Data.add_iterator_name :=
+    (function name ->
+      let fn clt = TIteratorId(name,clt) in
+      Hashtbl.replace iterator_names name fn);
+  Data.add_symbol_meta :=
+    (function name ->
+      let fn clt = TSymId (name,clt) in
+      Hashtbl.replace symbol_names name fn);
+  Data.init_rule := (function _ -> Hashtbl.clear metavariables);
+  Data.install_bindings :=
+    (function parent ->
+      List.iter (function (name,fn) -> Hashtbl.add metavariables name fn)
+       (Hashtbl.find all_metavariables parent))
+
+(* the following is needed to properly tokenize include files.  Because an
+include file is included after seeing a @, so current_line_started is true.
+Current_line_started is not important for parsing the name of a rule, so we
+don't have to reset this value to true after parsing an included file. *)
+let include_init _ =
+  current_line_started := false
+
+let drop_spaces s =
+  let len = String.length s in
+  let rec loop n =
+    if n = len
+    then n
+    else
+      if List.mem (String.get s n) [' ';'\t']
+      then loop (n+1)
+      else n in
+  let start = loop 0 in
+  String.sub s start (len - start)
+
+# 475 "lexer_cocci.ml"
+let __ocaml_lex_tables = {
+  Lexing.lex_base = 
+   "\000\000\175\255\176\255\081\000\119\000\181\255\182\255\192\000\
+    \219\000\206\255\078\000\035\000\090\000\220\255\080\000\081\000\
+    \224\255\225\255\228\255\229\255\230\255\231\255\233\255\082\000\
+    \105\000\237\255\239\255\101\000\102\000\140\000\162\000\033\001\
+    \108\001\095\000\097\000\084\000\183\001\138\000\255\255\041\002\
+    \102\000\167\000\186\255\213\255\026\002\101\002\176\002\251\002\
+    \070\003\145\003\220\003\039\004\114\004\189\004\008\005\122\005\
+    \112\000\152\000\168\000\242\000\243\000\251\255\177\255\205\255\
+    \249\255\204\255\248\255\197\005\016\006\091\006\166\006\241\006\
+    \084\005\107\000\117\000\092\000\244\255\242\255\012\002\094\005\
+    \060\007\093\000\117\000\135\000\141\000\144\000\245\255\145\000\
+    \147\000\243\255\208\255\178\255\216\255\149\000\227\255\245\000\
+    \215\255\153\000\019\001\232\255\234\255\236\255\198\255\210\255\
+    \214\255\212\255\199\255\211\255\209\255\203\255\136\000\207\255\
+    \097\000\089\000\116\000\123\000\104\000\112\000\109\007\193\255\
+    \131\000\131\000\132\000\060\001\162\007\237\007\133\000\132\000\
+    \128\000\149\000\061\001\095\008\178\008\190\255\039\007\153\000\
+    \145\000\169\000\188\000\214\000\110\007\055\002\090\001\165\001\
+    \189\255\056\002\188\255\056\001\155\005\110\007\154\005\084\001\
+    \111\007\113\007\085\001\202\000\217\000\213\000\219\000\222\000\
+    \086\001\087\001\224\000\228\000\119\001\221\000\219\000\159\001\
+    \237\000\232\000\238\000\028\001\160\001\016\001\026\001\161\001\
+    \046\007\096\001\253\008\124\007\147\007\085\008\024\009\066\008\
+    \095\008\094\009\168\001\179\255\234\001\255\255\034\009\252\255\
+    \164\009\107\007\134\007\254\255\187\009\253\255\235\001\254\255\
+    \053\009\255\255\251\255\226\009\062\009\085\009\253\255\249\009\
+    \252\255\042\007\254\255\025\010\255\255\251\255\049\010\132\009\
+    \155\009\253\255\072\010\252\255\163\004\252\255\253\255\254\255\
+    \119\001\255\255";
+  Lexing.lex_backtrk = 
+   "\255\255\255\255\255\255\076\000\076\000\255\255\255\255\072\000\
+    \080\000\255\255\055\000\061\000\060\000\255\255\034\000\032\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\020\000\
+    \080\000\255\255\255\255\015\000\014\000\054\000\029\000\072\000\
+    \072\000\017\000\038\000\005\000\072\000\033\000\255\255\001\000\
+    \255\255\002\000\255\255\255\255\072\000\072\000\072\000\072\000\
+    \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\
+    \255\255\255\255\255\255\255\255\003\000\255\255\255\255\255\255\
+    \255\255\255\255\255\255\072\000\072\000\008\000\072\000\072\000\
+    \075\000\255\255\009\000\255\255\255\255\255\255\255\255\075\000\
+    \255\255\053\000\059\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\037\000\255\255\070\000\
+    \255\255\036\000\071\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\058\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\063\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\064\000\255\255\068\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\255\255\255\255\255\255\255\255\255\255\
+    \068\000\068\000\255\255\255\255\068\000\255\255\255\255\068\000\
+    \255\255\255\255\255\255\255\255\068\000\255\255\255\255\068\000\
+    \076\000\076\000\255\255\075\000\255\255\255\255\076\000\075\000\
+    \255\255\076\000\076\000\255\255\255\255\255\255\000\000\255\255\
+    \003\000\001\000\001\000\255\255\002\000\255\255\255\255\255\255\
+    \001\000\255\255\255\255\004\000\002\000\002\000\255\255\003\000\
+    \255\255\255\255\255\255\001\000\255\255\255\255\004\000\002\000\
+    \002\000\255\255\003\000\255\255\255\255\255\255\255\255\255\255\
+    \004\000\255\255";
+  Lexing.lex_default = 
+   "\001\000\000\000\000\000\255\255\255\255\000\000\000\000\255\255\
+    \255\255\000\000\255\255\255\255\255\255\000\000\255\255\255\255\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\
+    \255\255\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
+    \255\255\041\000\000\000\000\000\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\058\000\058\000\058\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\000\000\000\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
+    \255\255\000\000\000\000\000\000\000\000\255\255\000\000\095\000\
+    \000\000\255\255\098\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\255\255\000\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\000\000\147\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\145\000\143\000\143\000\
+    \000\000\145\000\000\000\147\000\147\000\147\000\147\000\151\000\
+    \147\000\147\000\154\000\255\255\255\255\255\255\255\255\255\255\
+    \160\000\161\000\255\255\255\255\164\000\255\255\255\255\167\000\
+    \255\255\255\255\255\255\255\255\172\000\255\255\255\255\175\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\000\000\189\000\000\000\191\000\000\000\
+    \255\255\255\255\255\255\000\000\255\255\000\000\199\000\000\000\
+    \202\000\000\000\000\000\255\255\255\255\255\255\000\000\255\255\
+    \000\000\210\000\000\000\213\000\000\000\000\000\255\255\255\255\
+    \255\255\000\000\255\255\000\000\221\000\000\000\000\000\000\000\
+    \255\255\000\000";
+  Lexing.lex_trans = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\039\000\038\000\038\000\038\000\038\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \039\000\033\000\005\000\008\000\000\000\014\000\012\000\006\000\
+    \025\000\022\000\015\000\027\000\017\000\028\000\030\000\037\000\
+    \004\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\009\000\016\000\029\000\034\000\010\000\026\000\
+    \035\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\032\000\
+    \007\000\007\000\007\000\021\000\024\000\020\000\011\000\036\000\
+    \108\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\031\000\
+    \007\000\007\000\007\000\019\000\023\000\018\000\013\000\179\000\
+    \106\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\109\000\110\000\105\000\104\000\103\000\
+    \097\000\101\000\099\000\093\000\061\000\041\000\180\000\107\000\
+    \058\000\074\000\077\000\091\000\065\000\176\000\063\000\062\000\
+    \075\000\057\000\096\000\092\000\094\000\179\000\177\000\182\000\
+    \182\000\182\000\182\000\182\000\182\000\182\000\182\000\181\000\
+    \181\000\255\255\090\000\076\000\042\000\087\000\180\000\083\000\
+    \057\000\041\000\084\000\085\000\180\000\176\000\086\000\088\000\
+    \056\000\089\000\095\000\176\000\098\000\111\000\177\000\043\000\
+    \082\000\081\000\173\000\168\000\177\000\126\000\102\000\178\000\
+    \073\000\059\000\072\000\072\000\072\000\072\000\072\000\072\000\
+    \072\000\072\000\072\000\072\000\180\000\066\000\120\000\064\000\
+    \157\000\134\000\156\000\176\000\118\000\100\000\155\000\121\000\
+    \122\000\135\000\123\000\127\000\177\000\128\000\129\000\178\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\130\000\118\000\136\000\137\000\119\000\255\255\
+    \002\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\060\000\060\000\255\255\138\000\007\000\
+    \139\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\140\000\165\000\162\000\158\000\116\000\
+    \114\000\161\000\255\255\160\000\115\000\124\000\131\000\112\000\
+    \159\000\163\000\164\000\113\000\166\000\167\000\169\000\170\000\
+    \117\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\171\000\124\000\131\000\255\255\255\255\
+    \255\255\255\255\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\255\255\172\000\174\000\175\000\
+    \007\000\255\255\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\070\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\225\000\255\255\
+    \255\255\255\255\255\255\255\255\186\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\067\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\144\000\
+    \000\000\000\000\000\000\007\000\186\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\000\000\255\255\255\255\187\000\255\255\000\000\000\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\201\000\255\255\187\000\000\000\044\000\000\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\039\000\038\000\038\000\038\000\038\000\080\000\
+    \255\255\080\000\000\000\000\000\079\000\079\000\079\000\079\000\
+    \079\000\079\000\079\000\079\000\079\000\079\000\190\000\200\000\
+    \000\000\039\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\255\255\255\255\255\255\255\255\
+    \040\000\000\000\255\255\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\255\255\146\000\255\255\
+    \000\000\007\000\000\000\045\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\255\255\
+    \255\255\255\255\000\000\000\000\000\000\255\255\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \000\000\000\000\000\000\000\000\007\000\000\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\046\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\255\255\255\255\000\000\000\000\000\000\000\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\000\000\000\000\000\000\000\000\007\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\047\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\000\000\000\000\255\255\
+    \255\255\000\000\000\000\000\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\000\000\000\000\
+    \000\000\000\000\007\000\000\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\048\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\000\000\000\000\000\000\000\000\007\000\000\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\049\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\000\000\000\000\000\000\000\000\
+    \007\000\000\000\007\000\050\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\000\000\
+    \000\000\000\000\000\000\007\000\000\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\051\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\000\000\000\000\000\000\000\000\007\000\000\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\052\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\000\000\223\000\223\000\223\000\
+    \223\000\000\000\000\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\224\000\222\000\000\000\
+    \000\000\007\000\000\000\007\000\007\000\007\000\007\000\053\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \000\000\000\000\000\000\000\000\054\000\000\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\000\000\000\000\000\000\000\000\055\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\057\000\072\000\072\000\072\000\072\000\
+    \072\000\072\000\072\000\072\000\072\000\072\000\079\000\079\000\
+    \079\000\079\000\079\000\079\000\079\000\079\000\079\000\079\000\
+    \000\000\078\000\057\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\056\000\255\255\255\255\255\255\000\000\000\000\
+    \000\000\000\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\000\000\000\000\000\000\000\000\
+    \000\000\078\000\000\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\000\000\000\000\000\000\
+    \000\000\007\000\000\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\152\000\
+    \151\000\000\000\000\000\000\000\000\000\000\000\007\000\007\000\
+    \007\000\007\000\068\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \000\000\000\000\000\000\000\000\007\000\000\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\069\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\000\000\000\000\000\000\000\000\007\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\000\000\000\000\000\000\
+    \000\000\000\000\255\255\255\255\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\000\000\000\000\
+    \000\000\000\000\007\000\000\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\000\000\000\000\000\000\000\000\007\000\000\000\007\000\
+    \007\000\007\000\007\000\071\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\255\255\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\212\000\000\000\000\000\000\000\
+    \007\000\000\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\069\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\079\000\079\000\079\000\079\000\
+    \079\000\079\000\079\000\079\000\079\000\079\000\118\000\140\000\
+    \255\255\255\255\187\000\255\255\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\187\000\000\000\000\000\211\000\000\000\
+    \000\000\000\000\000\000\149\000\000\000\118\000\140\000\000\000\
+    \142\000\000\000\000\000\000\000\000\000\148\000\000\000\000\000\
+    \000\000\000\000\187\000\194\000\194\000\194\000\194\000\194\000\
+    \194\000\194\000\194\000\187\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\141\000\124\000\179\000\179\000\179\000\179\000\
+    \179\000\179\000\179\000\179\000\179\000\179\000\195\000\195\000\
+    \195\000\195\000\195\000\195\000\195\000\195\000\184\000\000\000\
+    \184\000\078\000\124\000\183\000\183\000\183\000\183\000\183\000\
+    \183\000\183\000\183\000\183\000\183\000\000\000\000\000\000\000\
+    \000\000\116\000\114\000\150\000\153\000\000\000\115\000\154\000\
+    \000\000\112\000\000\000\000\000\000\000\113\000\000\000\000\000\
+    \000\000\078\000\117\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\000\000\000\000\000\000\
+    \000\000\125\000\000\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\255\255\
+    \000\000\000\000\255\255\000\000\000\000\000\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \000\000\000\000\000\000\000\000\125\000\000\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \131\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\
+    \000\000\255\255\183\000\183\000\183\000\183\000\183\000\183\000\
+    \183\000\183\000\183\000\183\000\000\000\000\000\000\000\131\000\
+    \000\000\000\000\000\000\179\000\000\000\181\000\181\000\181\000\
+    \181\000\181\000\181\000\181\000\181\000\181\000\181\000\183\000\
+    \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+    \183\000\000\000\180\000\000\000\000\000\000\000\000\000\000\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\180\000\000\000\000\000\000\000\132\000\000\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\133\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\000\000\000\000\000\000\
+    \000\000\132\000\000\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\185\000\185\000\185\000\
+    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\185\000\185\000\
+    \185\000\185\000\185\000\185\000\000\000\000\000\179\000\000\000\
+    \182\000\182\000\182\000\182\000\182\000\182\000\182\000\182\000\
+    \181\000\181\000\193\000\193\000\193\000\193\000\193\000\193\000\
+    \193\000\193\000\000\000\000\000\000\000\180\000\185\000\185\000\
+    \185\000\185\000\185\000\185\000\176\000\204\000\204\000\204\000\
+    \204\000\204\000\204\000\204\000\204\000\177\000\205\000\205\000\
+    \205\000\205\000\205\000\205\000\205\000\205\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\180\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\176\000\206\000\206\000\206\000\
+    \206\000\206\000\206\000\206\000\206\000\177\000\185\000\185\000\
+    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
+    \000\000\000\000\192\000\000\000\000\000\000\000\000\000\185\000\
+    \185\000\185\000\185\000\185\000\185\000\000\000\000\000\000\000\
+    \000\000\000\000\176\000\000\000\000\000\203\000\000\000\000\000\
+    \000\000\000\000\000\000\177\000\216\000\216\000\216\000\216\000\
+    \216\000\216\000\216\000\216\000\000\000\000\000\000\000\185\000\
+    \185\000\185\000\185\000\185\000\185\000\000\000\000\000\000\000\
+    \000\000\000\000\176\000\217\000\217\000\217\000\217\000\217\000\
+    \217\000\217\000\217\000\177\000\196\000\196\000\196\000\196\000\
+    \196\000\196\000\196\000\196\000\196\000\196\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\196\000\196\000\196\000\
+    \196\000\196\000\196\000\197\000\197\000\197\000\197\000\197\000\
+    \197\000\197\000\197\000\197\000\197\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\197\000\197\000\197\000\197\000\
+    \197\000\197\000\000\000\000\000\000\000\196\000\196\000\196\000\
+    \196\000\196\000\196\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\207\000\207\000\207\000\207\000\207\000\207\000\
+    \207\000\207\000\207\000\207\000\197\000\197\000\197\000\197\000\
+    \197\000\197\000\255\255\207\000\207\000\207\000\207\000\207\000\
+    \207\000\208\000\208\000\208\000\208\000\208\000\208\000\208\000\
+    \208\000\208\000\208\000\000\000\000\000\255\255\000\000\000\000\
+    \000\000\000\000\208\000\208\000\208\000\208\000\208\000\208\000\
+    \000\000\000\000\000\000\207\000\207\000\207\000\207\000\207\000\
+    \207\000\215\000\215\000\215\000\215\000\215\000\215\000\215\000\
+    \215\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\208\000\208\000\208\000\208\000\208\000\208\000\
+    \000\000\218\000\218\000\218\000\218\000\218\000\218\000\218\000\
+    \218\000\218\000\218\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\218\000\218\000\218\000\218\000\218\000\218\000\
+    \219\000\219\000\219\000\219\000\219\000\219\000\219\000\219\000\
+    \219\000\219\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\219\000\219\000\219\000\219\000\219\000\219\000\000\000\
+    \000\000\214\000\218\000\218\000\218\000\218\000\218\000\218\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\219\000\219\000\219\000\219\000\219\000\219\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000";
+  Lexing.lex_check = 
+   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\000\000\000\000\000\000\000\000\000\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \000\000\000\000\000\000\000\000\255\255\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \011\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\
+    \012\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
+    \003\000\003\000\003\000\010\000\010\000\014\000\015\000\023\000\
+    \027\000\024\000\024\000\028\000\035\000\040\000\003\000\012\000\
+    \056\000\073\000\075\000\081\000\033\000\003\000\034\000\034\000\
+    \074\000\057\000\027\000\028\000\028\000\004\000\003\000\004\000\
+    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
+    \004\000\041\000\082\000\074\000\037\000\083\000\003\000\029\000\
+    \057\000\037\000\029\000\084\000\004\000\003\000\085\000\087\000\
+    \057\000\088\000\093\000\004\000\097\000\110\000\003\000\037\000\
+    \029\000\029\000\112\000\113\000\004\000\116\000\023\000\004\000\
+    \030\000\058\000\030\000\030\000\030\000\030\000\030\000\030\000\
+    \030\000\030\000\030\000\030\000\004\000\033\000\117\000\034\000\
+    \114\000\115\000\114\000\004\000\008\000\024\000\114\000\120\000\
+    \121\000\115\000\122\000\126\000\004\000\127\000\128\000\004\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\129\000\008\000\135\000\136\000\008\000\095\000\
+    \000\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\059\000\060\000\098\000\137\000\007\000\
+    \138\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\
+    \007\000\007\000\007\000\139\000\155\000\156\000\157\000\008\000\
+    \008\000\158\000\147\000\159\000\008\000\123\000\130\000\008\000\
+    \157\000\162\000\163\000\008\000\165\000\166\000\168\000\169\000\
+    \008\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\170\000\123\000\130\000\151\000\154\000\
+    \160\000\161\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\142\000\171\000\173\000\174\000\
+    \031\000\164\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+    \031\000\031\000\031\000\031\000\032\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\224\000\041\000\
+    \058\000\167\000\172\000\175\000\177\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\143\000\
+    \255\255\255\255\255\255\032\000\177\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
+    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\036\000\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\255\255\059\000\060\000\186\000\095\000\255\255\255\255\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\198\000\098\000\186\000\255\255\036\000\255\255\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
+    \036\000\036\000\039\000\039\000\039\000\039\000\039\000\078\000\
+    \147\000\078\000\255\255\255\255\078\000\078\000\078\000\078\000\
+    \078\000\078\000\078\000\078\000\078\000\078\000\188\000\198\000\
+    \255\255\039\000\044\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\151\000\154\000\160\000\161\000\
+    \039\000\255\255\142\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\141\000\145\000\164\000\
+    \255\255\044\000\255\255\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
+    \044\000\044\000\044\000\044\000\044\000\045\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\167\000\
+    \172\000\175\000\255\255\255\255\255\255\143\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \255\255\255\255\255\255\255\255\045\000\255\255\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\
+    \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\188\000\198\000\255\255\255\255\255\255\255\255\
+    \255\255\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\255\255\255\255\255\255\255\255\046\000\
+    \255\255\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+    \046\000\046\000\046\000\047\000\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\255\255\255\255\141\000\
+    \145\000\255\255\255\255\255\255\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\255\255\255\255\
+    \255\255\255\255\047\000\255\255\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
+    \047\000\047\000\047\000\047\000\047\000\047\000\048\000\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\255\255\255\255\255\255\255\255\048\000\255\255\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+    \048\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\255\255\255\255\255\255\255\255\
+    \049\000\255\255\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+    \049\000\049\000\049\000\049\000\050\000\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\255\255\
+    \255\255\255\255\255\255\050\000\255\255\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
+    \050\000\050\000\050\000\050\000\050\000\050\000\050\000\051\000\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\255\255\255\255\255\255\255\255\051\000\255\255\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
+    \051\000\051\000\052\000\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\255\255\220\000\220\000\220\000\
+    \220\000\255\255\255\255\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\220\000\220\000\255\255\
+    \255\255\052\000\255\255\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
+    \052\000\052\000\052\000\052\000\052\000\053\000\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \255\255\255\255\255\255\255\255\053\000\255\255\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
+    \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\255\255\255\255\255\255\255\255\054\000\
+    \255\255\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
+    \054\000\054\000\054\000\055\000\072\000\072\000\072\000\072\000\
+    \072\000\072\000\072\000\072\000\072\000\072\000\079\000\079\000\
+    \079\000\079\000\079\000\079\000\079\000\079\000\079\000\079\000\
+    \255\255\072\000\055\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\055\000\220\000\150\000\148\000\255\255\255\255\
+    \255\255\255\255\055\000\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\255\255\255\255\255\255\255\255\
+    \255\255\072\000\255\255\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\255\255\255\255\255\255\
+    \255\255\055\000\255\255\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\
+    \055\000\055\000\055\000\055\000\055\000\067\000\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\148\000\
+    \150\000\255\255\255\255\255\255\255\255\255\255\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \255\255\255\255\255\255\255\255\067\000\255\255\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
+    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\255\255\255\255\255\255\255\255\068\000\
+    \255\255\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
+    \068\000\068\000\068\000\069\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\255\255\255\255\255\255\
+    \255\255\255\255\150\000\148\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\255\255\255\255\
+    \255\255\255\255\069\000\255\255\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
+    \069\000\069\000\069\000\069\000\069\000\069\000\070\000\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\255\255\255\255\255\255\255\255\070\000\255\255\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
+    \070\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\134\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\209\000\255\255\255\255\255\255\
+    \071\000\255\255\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
+    \071\000\071\000\071\000\071\000\080\000\080\000\080\000\080\000\
+    \080\000\080\000\080\000\080\000\080\000\080\000\118\000\140\000\
+    \149\000\152\000\176\000\153\000\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\176\000\255\255\255\255\209\000\255\255\
+    \255\255\255\255\255\255\134\000\255\255\118\000\140\000\255\255\
+    \140\000\255\255\255\255\255\255\255\255\134\000\255\255\255\255\
+    \255\255\255\255\176\000\193\000\193\000\193\000\193\000\193\000\
+    \193\000\193\000\193\000\176\000\255\255\255\255\255\255\255\255\
+    \255\255\255\255\140\000\124\000\179\000\179\000\179\000\179\000\
+    \179\000\179\000\179\000\179\000\179\000\179\000\194\000\194\000\
+    \194\000\194\000\194\000\194\000\194\000\194\000\180\000\255\255\
+    \180\000\179\000\124\000\180\000\180\000\180\000\180\000\180\000\
+    \180\000\180\000\180\000\180\000\180\000\255\255\255\255\255\255\
+    \255\255\118\000\118\000\149\000\152\000\255\255\118\000\153\000\
+    \255\255\118\000\255\255\255\255\255\255\118\000\255\255\255\255\
+    \255\255\179\000\118\000\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\255\255\255\255\255\255\
+    \255\255\124\000\255\255\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
+    \124\000\124\000\124\000\124\000\124\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\134\000\
+    \255\255\255\255\209\000\255\255\255\255\255\255\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \255\255\255\255\255\255\255\255\125\000\255\255\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \125\000\125\000\125\000\125\000\125\000\125\000\125\000\125\000\
+    \131\000\255\255\255\255\255\255\255\255\255\255\149\000\152\000\
+    \255\255\153\000\183\000\183\000\183\000\183\000\183\000\183\000\
+    \183\000\183\000\183\000\183\000\255\255\255\255\255\255\131\000\
+    \255\255\255\255\255\255\181\000\255\255\181\000\181\000\181\000\
+    \181\000\181\000\181\000\181\000\181\000\181\000\181\000\184\000\
+    \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
+    \184\000\255\255\181\000\255\255\255\255\255\255\255\255\255\255\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\181\000\255\255\255\255\255\255\131\000\255\255\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
+    \131\000\131\000\132\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\255\255\255\255\255\255\
+    \255\255\132\000\255\255\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+    \132\000\132\000\132\000\132\000\132\000\178\000\178\000\178\000\
+    \178\000\178\000\178\000\178\000\178\000\178\000\178\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\178\000\178\000\
+    \178\000\178\000\178\000\178\000\255\255\255\255\182\000\255\255\
+    \182\000\182\000\182\000\182\000\182\000\182\000\182\000\182\000\
+    \182\000\182\000\190\000\190\000\190\000\190\000\190\000\190\000\
+    \190\000\190\000\255\255\255\255\255\255\182\000\178\000\178\000\
+    \178\000\178\000\178\000\178\000\182\000\200\000\200\000\200\000\
+    \200\000\200\000\200\000\200\000\200\000\182\000\204\000\204\000\
+    \204\000\204\000\204\000\204\000\204\000\204\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\182\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\182\000\205\000\205\000\205\000\
+    \205\000\205\000\205\000\205\000\205\000\182\000\185\000\185\000\
+    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
+    \255\255\255\255\190\000\255\255\255\255\255\255\255\255\185\000\
+    \185\000\185\000\185\000\185\000\185\000\255\255\255\255\255\255\
+    \255\255\255\255\185\000\255\255\255\255\200\000\255\255\255\255\
+    \255\255\255\255\255\255\185\000\215\000\215\000\215\000\215\000\
+    \215\000\215\000\215\000\215\000\255\255\255\255\255\255\185\000\
+    \185\000\185\000\185\000\185\000\185\000\255\255\255\255\255\255\
+    \255\255\255\255\185\000\216\000\216\000\216\000\216\000\216\000\
+    \216\000\216\000\216\000\185\000\192\000\192\000\192\000\192\000\
+    \192\000\192\000\192\000\192\000\192\000\192\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\192\000\192\000\192\000\
+    \192\000\192\000\192\000\196\000\196\000\196\000\196\000\196\000\
+    \196\000\196\000\196\000\196\000\196\000\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\196\000\196\000\196\000\196\000\
+    \196\000\196\000\255\255\255\255\255\255\192\000\192\000\192\000\
+    \192\000\192\000\192\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\203\000\203\000\203\000\203\000\203\000\203\000\
+    \203\000\203\000\203\000\203\000\196\000\196\000\196\000\196\000\
+    \196\000\196\000\190\000\203\000\203\000\203\000\203\000\203\000\
+    \203\000\207\000\207\000\207\000\207\000\207\000\207\000\207\000\
+    \207\000\207\000\207\000\255\255\255\255\200\000\255\255\255\255\
+    \255\255\255\255\207\000\207\000\207\000\207\000\207\000\207\000\
+    \255\255\255\255\255\255\203\000\203\000\203\000\203\000\203\000\
+    \203\000\211\000\211\000\211\000\211\000\211\000\211\000\211\000\
+    \211\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\207\000\207\000\207\000\207\000\207\000\207\000\
+    \255\255\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
+    \214\000\214\000\214\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\214\000\214\000\214\000\214\000\214\000\214\000\
+    \218\000\218\000\218\000\218\000\218\000\218\000\218\000\218\000\
+    \218\000\218\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\218\000\218\000\218\000\218\000\218\000\218\000\255\255\
+    \255\255\211\000\214\000\214\000\214\000\214\000\214\000\214\000\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\218\000\218\000\218\000\218\000\218\000\218\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\211\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255";
+  Lexing.lex_base_code = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\002\000\003\000\000\000\000\000\000\000\
+    \000\000\000\000\004\000\005\000\000\000\021\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000";
+  Lexing.lex_backtrk_code = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\018\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000";
+  Lexing.lex_default_code = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000";
+  Lexing.lex_trans_code = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\001\000\001\000\007\000\007\000\013\000\013\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \001\000\001\000\007\000\007\000\013\000\013\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000";
+  Lexing.lex_check_code = 
+   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\000\000\039\000\123\000\124\000\130\000\131\000\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \000\000\039\000\123\000\124\000\130\000\131\000\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255";
+  Lexing.lex_code = 
+   "\255\001\255\255\000\001\255\002\255\255\000\002\255\004\255\003\
+    \255\255\000\003\255\000\004\255";
+}
+
+let rec token lexbuf =
+  lexbuf.Lexing.lex_mem <- Array.create 5 (-1) ; (* L=1 [1] <- p ;  *)
+  lexbuf.Lexing.lex_mem.(1) <- lexbuf.Lexing.lex_curr_pos ;
+  __ocaml_lex_token_rec lexbuf 0
+and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
+  match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 496 "lexer_cocci.mll"
+    ( let cls = !current_line_started in
+
+      if not cls
+      then
+       begin
+         match !current_line_type with
+           (D.PLUS,_,_) | (D.PLUSPLUS,_,_) ->
+             let info = get_current_line_type lexbuf in
+             reset_line lexbuf;
+             TPragma (Ast.Noindent "", info)
+         | _ -> reset_line lexbuf; token lexbuf
+       end
+      else (reset_line lexbuf; token lexbuf) )
+# 1477 "lexer_cocci.ml"
+
+  | 1 ->
+# 510 "lexer_cocci.mll"
+                   ( start_line false; token lexbuf )
+# 1482 "lexer_cocci.ml"
+
+  | 2 ->
+let
+# 512 "lexer_cocci.mll"
+                                       after
+# 1488 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_curr_pos in
+# 512 "lexer_cocci.mll"
+                                              (
+    match !current_line_type with
+      (D.PLUS,_,_) | (D.PLUSPLUS,_,_) ->
+       let str =
+         if !current_line_started
+         then (tok lexbuf)
+         else after in
+       start_line true;
+       TPragma (Ast.Indent str, get_current_line_type lexbuf)
+    | _ -> start_line false; token lexbuf )
+# 1501 "lexer_cocci.ml"
+
+  | 3 ->
+# 524 "lexer_cocci.mll"
+   ( match !current_line_type with
+      (D.PLUS,_,_) | (D.PLUSPLUS,_,_) ->
+       start_line true;
+       TPragma (Ast.Space (tok lexbuf), get_current_line_type lexbuf)
+    | _ -> failwith "attributes only allowedin + code" )
+# 1510 "lexer_cocci.ml"
+
+  | 4 ->
+# 530 "lexer_cocci.mll"
+         ( start_line true; TArobArob )
+# 1515 "lexer_cocci.ml"
+
+  | 5 ->
+# 531 "lexer_cocci.mll"
+         ( pass_zero();
+          if !Data.in_rule_name or not !current_line_started
+          then (start_line true; TArob)
+          else (check_minus_context_linetype "@";
+                TPArob (get_current_line_type lexbuf)) )
+# 1524 "lexer_cocci.ml"
+
+  | 6 ->
+# 537 "lexer_cocci.mll"
+          ( start_line true; TTildeEq (get_current_line_type lexbuf) )
+# 1529 "lexer_cocci.ml"
+
+  | 7 ->
+# 538 "lexer_cocci.mll"
+         ( start_line true; TTildeExclEq (get_current_line_type lexbuf) )
+# 1534 "lexer_cocci.ml"
+
+  | 8 ->
+# 540 "lexer_cocci.mll"
+      ( start_line true; check_minus_context_linetype (tok lexbuf);
+       TWhen (get_current_line_type lexbuf) )
+# 1540 "lexer_cocci.ml"
+
+  | 9 ->
+# 544 "lexer_cocci.mll"
+      ( start_line true; check_minus_context_linetype (tok lexbuf);
+       TEllipsis (get_current_line_type lexbuf) )
+# 1546 "lexer_cocci.ml"
+
+  | 10 ->
+# 555 "lexer_cocci.mll"
+           ( start_line true; check_context_linetype (tok lexbuf);
+            TOEllipsis (get_current_line_type lexbuf) )
+# 1552 "lexer_cocci.ml"
+
+  | 11 ->
+# 557 "lexer_cocci.mll"
+           ( start_line true; check_context_linetype (tok lexbuf);
+            TCEllipsis (get_current_line_type lexbuf) )
+# 1558 "lexer_cocci.ml"
+
+  | 12 ->
+# 559 "lexer_cocci.mll"
+            ( start_line true; check_minus_context_linetype (tok lexbuf);
+            TPOEllipsis (get_current_line_type lexbuf) )
+# 1564 "lexer_cocci.ml"
+
+  | 13 ->
+# 561 "lexer_cocci.mll"
+            ( start_line true; check_minus_context_linetype (tok lexbuf);
+            TPCEllipsis (get_current_line_type lexbuf) )
+# 1570 "lexer_cocci.ml"
+
+  | 14 ->
+# 574 "lexer_cocci.mll"
+        ( pass_zero();
+         if !current_line_started
+         then (start_line true; TMinus (get_current_line_type lexbuf))
+          else (patch_or_match PATCH;
+               add_current_line_type D.MINUS; token lexbuf) )
+# 1579 "lexer_cocci.ml"
+
+  | 15 ->
+# 579 "lexer_cocci.mll"
+        ( pass_zero();
+         if !current_line_started
+         then (start_line true; TPlus (get_current_line_type lexbuf))
+          else if !Data.in_meta
+         then TPlus0
+          else (patch_or_match PATCH;
+               add_current_line_type D.PLUS; token lexbuf) )
+# 1590 "lexer_cocci.ml"
+
+  | 16 ->
+# 586 "lexer_cocci.mll"
+        ( pass_zero();
+         if !current_line_started
+         then (start_line true; TWhy (get_current_line_type lexbuf))
+          else if !Data.in_meta
+         then TWhy0
+          else (add_current_line_type D.OPT; token lexbuf) )
+# 1600 "lexer_cocci.ml"
+
+  | 17 ->
+# 592 "lexer_cocci.mll"
+        ( pass_zero();
+         if !current_line_started
+         then (start_line true; TBang (get_current_line_type lexbuf))
+          else if !Data.in_meta
+         then TBang0
+          else (add_current_line_type D.UNIQUE; token lexbuf) )
+# 1610 "lexer_cocci.ml"
+
+  | 18 ->
+# 598 "lexer_cocci.mll"
+        ( if !Data.in_meta or not !col_zero
+         then (start_line true; TOPar (get_current_line_type lexbuf))
+          else
+            (start_line true; check_context_linetype (tok lexbuf);
+            TOPar0 (get_current_line_type lexbuf)))
+# 1619 "lexer_cocci.ml"
+
+  | 19 ->
+# 603 "lexer_cocci.mll"
+          ( start_line true;
+           TOPar0 (contextify(get_current_line_type lexbuf)) )
+# 1625 "lexer_cocci.ml"
+
+  | 20 ->
+# 605 "lexer_cocci.mll"
+        ( if not (!col_zero)
+         then (start_line true; TOr(get_current_line_type lexbuf))
+          else (start_line true;
+               check_context_linetype (tok lexbuf);
+               TMid0 (get_current_line_type lexbuf)))
+# 1634 "lexer_cocci.ml"
+
+  | 21 ->
+# 610 "lexer_cocci.mll"
+          ( start_line true;
+           TMid0 (contextify(get_current_line_type lexbuf)) )
+# 1640 "lexer_cocci.ml"
+
+  | 22 ->
+# 612 "lexer_cocci.mll"
+        ( if not !col_zero
+         then (start_line true; TCPar (get_current_line_type lexbuf))
+          else
+            (start_line true; check_context_linetype (tok lexbuf);
+            TCPar0 (get_current_line_type lexbuf)))
+# 1649 "lexer_cocci.ml"
+
+  | 23 ->
+# 617 "lexer_cocci.mll"
+          ( start_line true;
+           TCPar0 (contextify(get_current_line_type lexbuf)) )
+# 1655 "lexer_cocci.ml"
+
+  | 24 ->
+# 620 "lexer_cocci.mll"
+        ( start_line true; TOCro (get_current_line_type lexbuf)   )
+# 1660 "lexer_cocci.ml"
+
+  | 25 ->
+# 621 "lexer_cocci.mll"
+        ( start_line true; TCCro (get_current_line_type lexbuf)   )
+# 1665 "lexer_cocci.ml"
+
+  | 26 ->
+# 622 "lexer_cocci.mll"
+        ( start_line true; TOBrace (get_current_line_type lexbuf) )
+# 1670 "lexer_cocci.ml"
+
+  | 27 ->
+# 623 "lexer_cocci.mll"
+        ( start_line true; TCBrace (get_current_line_type lexbuf) )
+# 1675 "lexer_cocci.ml"
+
+  | 28 ->
+# 625 "lexer_cocci.mll"
+                   ( start_line true; TPtrOp (get_current_line_type lexbuf)  )
+# 1680 "lexer_cocci.ml"
+
+  | 29 ->
+# 626 "lexer_cocci.mll"
+                   ( start_line true; TDot (get_current_line_type lexbuf)    )
+# 1685 "lexer_cocci.ml"
+
+  | 30 ->
+# 627 "lexer_cocci.mll"
+                   ( start_line true; TComma (get_current_line_type lexbuf)  )
+# 1690 "lexer_cocci.ml"
+
+  | 31 ->
+# 628 "lexer_cocci.mll"
+                   ( start_line true;
+                    if !Data.in_meta
+                    then TMPtVirg (* works better with tokens_all *)
+                    else TPtVirg (get_current_line_type lexbuf) )
+# 1698 "lexer_cocci.ml"
+
+  | 32 ->
+# 634 "lexer_cocci.mll"
+                   ( pass_zero();
+                    if !current_line_started
+                    then
+                      (start_line true; TMul (get_current_line_type lexbuf))
+                    else
+                      (patch_or_match MATCH;
+                       add_current_line_type D.MINUS; token lexbuf) )
+# 1709 "lexer_cocci.ml"
+
+  | 33 ->
+# 641 "lexer_cocci.mll"
+                   ( start_line true;
+                    TDmOp (Ast.Div,get_current_line_type lexbuf) )
+# 1715 "lexer_cocci.ml"
+
+  | 34 ->
+# 643 "lexer_cocci.mll"
+                   ( start_line true;
+                    TDmOp (Ast.Mod,get_current_line_type lexbuf) )
+# 1721 "lexer_cocci.ml"
+
+  | 35 ->
+# 645 "lexer_cocci.mll"
+                   ( start_line true;  TTilde (get_current_line_type lexbuf) )
+# 1726 "lexer_cocci.ml"
+
+  | 36 ->
+# 647 "lexer_cocci.mll"
+                   ( pass_zero();
+                    if !current_line_started
+                    then
+                      (start_line true; TInc (get_current_line_type lexbuf))
+                    else (patch_or_match PATCH;
+                          add_current_line_type D.PLUSPLUS; token lexbuf) )
+# 1736 "lexer_cocci.ml"
+
+  | 37 ->
+# 653 "lexer_cocci.mll"
+                   ( start_line true;  TDec (get_current_line_type lexbuf) )
+# 1741 "lexer_cocci.ml"
+
+  | 38 ->
+# 655 "lexer_cocci.mll"
+                   ( start_line true; TEq (get_current_line_type lexbuf) )
+# 1746 "lexer_cocci.ml"
+
+  | 39 ->
+# 657 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Minus lexbuf )
+# 1751 "lexer_cocci.ml"
+
+  | 40 ->
+# 658 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Plus lexbuf )
+# 1756 "lexer_cocci.ml"
+
+  | 41 ->
+# 660 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Mul lexbuf )
+# 1761 "lexer_cocci.ml"
+
+  | 42 ->
+# 661 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Div lexbuf )
+# 1766 "lexer_cocci.ml"
+
+  | 43 ->
+# 662 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Mod lexbuf )
+# 1771 "lexer_cocci.ml"
+
+  | 44 ->
+# 664 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.And lexbuf )
+# 1776 "lexer_cocci.ml"
+
+  | 45 ->
+# 665 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Or lexbuf )
+# 1781 "lexer_cocci.ml"
+
+  | 46 ->
+# 666 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.Xor lexbuf )
+# 1786 "lexer_cocci.ml"
+
+  | 47 ->
+# 668 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.DecLeft lexbuf )
+# 1791 "lexer_cocci.ml"
+
+  | 48 ->
+# 669 "lexer_cocci.mll"
+                   ( start_line true; mkassign Ast.DecRight lexbuf )
+# 1796 "lexer_cocci.ml"
+
+  | 49 ->
+# 671 "lexer_cocci.mll"
+                   ( start_line true; TDotDot (get_current_line_type lexbuf) )
+# 1801 "lexer_cocci.ml"
+
+  | 50 ->
+# 673 "lexer_cocci.mll"
+                   ( start_line true; TEqEq    (get_current_line_type lexbuf) )
+# 1806 "lexer_cocci.ml"
+
+  | 51 ->
+# 674 "lexer_cocci.mll"
+                   ( start_line true; TNotEq   (get_current_line_type lexbuf) )
+# 1811 "lexer_cocci.ml"
+
+  | 52 ->
+# 675 "lexer_cocci.mll"
+                   ( start_line true;
+                    TLogOp(Ast.SupEq,get_current_line_type lexbuf) )
+# 1817 "lexer_cocci.ml"
+
+  | 53 ->
+# 677 "lexer_cocci.mll"
+                   ( start_line true;
+                    if !Data.in_meta
+                    then TSub(get_current_line_type lexbuf)
+                    else TLogOp(Ast.InfEq,get_current_line_type lexbuf) )
+# 1825 "lexer_cocci.ml"
+
+  | 54 ->
+# 681 "lexer_cocci.mll"
+                   ( start_line true;
+                    TLogOp(Ast.Inf,get_current_line_type lexbuf) )
+# 1831 "lexer_cocci.ml"
+
+  | 55 ->
+# 683 "lexer_cocci.mll"
+                   ( start_line true;
+                    TLogOp(Ast.Sup,get_current_line_type lexbuf) )
+# 1837 "lexer_cocci.ml"
+
+  | 56 ->
+# 686 "lexer_cocci.mll"
+                   ( start_line true; TAndLog (get_current_line_type lexbuf) )
+# 1842 "lexer_cocci.ml"
+
+  | 57 ->
+# 687 "lexer_cocci.mll"
+                   ( start_line true; TOrLog  (get_current_line_type lexbuf) )
+# 1847 "lexer_cocci.ml"
+
+  | 58 ->
+# 689 "lexer_cocci.mll"
+                   ( start_line true;
+                    TShROp(Ast.DecRight,get_current_line_type lexbuf) )
+# 1853 "lexer_cocci.ml"
+
+  | 59 ->
+# 691 "lexer_cocci.mll"
+                   ( start_line true;
+                    TShLOp(Ast.DecLeft,get_current_line_type lexbuf) )
+# 1859 "lexer_cocci.ml"
+
+  | 60 ->
+# 694 "lexer_cocci.mll"
+                   ( start_line true; TAnd    (get_current_line_type lexbuf) )
+# 1864 "lexer_cocci.ml"
+
+  | 61 ->
+# 695 "lexer_cocci.mll"
+                   ( start_line true; TXor(get_current_line_type lexbuf) )
+# 1869 "lexer_cocci.ml"
+
+  | 62 ->
+# 697 "lexer_cocci.mll"
+                    ( start_line true; TCppConcatOp )
+# 1874 "lexer_cocci.ml"
+
+  | 63 ->
+let
+# 698 "lexer_cocci.mll"
+                                                  def
+# 1880 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_mem.(0)
+and
+# 699 "lexer_cocci.mll"
+                                   ident
+# 1885 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_curr_pos in
+# 700 "lexer_cocci.mll"
+      ( start_line true;
+       let (arity,line,lline,offset,col,strbef,straft,pos) as lt =
+         get_current_line_type lexbuf in
+       let off = String.length def in
+       (* -1 in the code below because the ident is not at the line start *)
+       TUndef
+         (lt,
+          check_var ident
+            (arity,line,lline,offset+off,col+off,[],[],[])) )
+# 1897 "lexer_cocci.ml"
+
+  | 64 ->
+let
+# 709 "lexer_cocci.mll"
+                                                   def
+# 1903 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_mem.(0)
+and
+# 710 "lexer_cocci.mll"
+                                   ident
+# 1908 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_curr_pos in
+# 711 "lexer_cocci.mll"
+      ( start_line true;
+       let (arity,line,lline,offset,col,strbef,straft,pos) as lt =
+         get_current_line_type lexbuf in
+       let off = String.length def in
+       (* -1 in the code below because the ident is not at the line start *)
+       TDefine
+         (lt,
+          check_var ident
+            (arity,line,lline,offset+off,col+off,[],[],[])) )
+# 1920 "lexer_cocci.ml"
+
+  | 65 ->
+let
+# 720 "lexer_cocci.mll"
+                                                   def
+# 1926 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_mem.(0)
+and
+# 721 "lexer_cocci.mll"
+                                    ident
+# 1931 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) (lexbuf.Lexing.lex_curr_pos + -1) in
+# 723 "lexer_cocci.mll"
+      ( start_line true;
+       let (arity,line,lline,offset,col,strbef,straft,pos) as lt =
+         get_current_line_type lexbuf in
+       let off = String.length def in
+       TDefineParam
+        (lt,
+        check_var ident
+          (* why pos here but not above? *)
+          (arity,line,lline,offset+off,col+off,strbef,straft,pos),
+        offset + off + (String.length ident),
+        col + off + (String.length ident)) )
+# 1945 "lexer_cocci.ml"
+
+  | 66 ->
+# 735 "lexer_cocci.mll"
+      ( TIncludeL
+         (let str = tok lexbuf in
+         let start = String.index str '"' in
+         let finish = String.rindex str '"' in
+         start_line true;
+         (process_include start finish str,get_current_line_type lexbuf)) )
+# 1955 "lexer_cocci.ml"
+
+  | 67 ->
+# 742 "lexer_cocci.mll"
+      ( TIncludeNL
+         (let str = tok lexbuf in
+         let start = String.index str '<' in
+         let finish = String.rindex str '>' in
+         start_line true;
+         (process_include start finish str,get_current_line_type lexbuf)) )
+# 1965 "lexer_cocci.ml"
+
+  | 68 ->
+# 757 "lexer_cocci.mll"
+      ( start_line true; check_plus_linetype (tok lexbuf);
+       TPragma (Ast.Noindent(tok lexbuf), get_current_line_type lexbuf) )
+# 1971 "lexer_cocci.ml"
+
+  | 69 ->
+# 760 "lexer_cocci.mll"
+      (
+       match !current_line_type with
+        (D.PLUS,_,_) | (D.PLUSPLUS,_,_) ->
+        start_line true;
+       (* second argument to TPragma is not quite right, because
+          it represents only the first token of the comment, but that
+          should be good enough *)
+       TPragma (Ast.Indent("/*"^(comment check_comment lexbuf)),
+                get_current_line_type lexbuf)
+      |        _ -> let _ = comment (fun _ -> ()) lexbuf in token lexbuf )
+# 1985 "lexer_cocci.ml"
+
+  | 70 ->
+# 771 "lexer_cocci.mll"
+      ( (if !current_line_started
+      then lexerr "--- must be at the beginning of the line" "");
+       start_line true;
+       TMinusFile
+         (let str = tok lexbuf in
+         (drop_spaces(String.sub str 3 (String.length str - 3)),
+          (get_current_line_type lexbuf))) )
+# 1996 "lexer_cocci.ml"
+
+  | 71 ->
+# 779 "lexer_cocci.mll"
+      ( (if !current_line_started
+      then lexerr "+++ must be at the beginning of the line" "");
+       start_line true;
+       TPlusFile
+         (let str = tok lexbuf in
+         (drop_spaces(String.sub str 3 (String.length str - 3)),
+          (get_current_line_type lexbuf))) )
+# 2007 "lexer_cocci.ml"
+
+  | 72 ->
+# 788 "lexer_cocci.mll"
+      ( start_line true; id_tokens lexbuf )
+# 2012 "lexer_cocci.ml"
+
+  | 73 ->
+# 790 "lexer_cocci.mll"
+        ( start_line true;
+         TChar(char lexbuf,get_current_line_type lexbuf) )
+# 2018 "lexer_cocci.ml"
+
+  | 74 ->
+# 792 "lexer_cocci.mll"
+        ( start_line true;
+         TString(string lexbuf,(get_current_line_type lexbuf)) )
+# 2024 "lexer_cocci.ml"
+
+  | 75 ->
+let
+# 794 "lexer_cocci.mll"
+             x
+# 2030 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 794 "lexer_cocci.mll"
+                   ( start_line true;
+                    TFloat(x,(get_current_line_type lexbuf)) )
+# 2035 "lexer_cocci.ml"
+
+  | 76 ->
+let
+# 804 "lexer_cocci.mll"
+         x
+# 2041 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 804 "lexer_cocci.mll"
+            ( start_line true; TInt(x,(get_current_line_type lexbuf)) )
+# 2045 "lexer_cocci.ml"
+
+  | 77 ->
+# 806 "lexer_cocci.mll"
+                   ( TIso )
+# 2050 "lexer_cocci.ml"
+
+  | 78 ->
+# 807 "lexer_cocci.mll"
+                   ( TRightIso )
+# 2055 "lexer_cocci.ml"
+
+  | 79 ->
+# 809 "lexer_cocci.mll"
+                   ( EOF )
+# 2060 "lexer_cocci.ml"
+
+  | 80 ->
+# 811 "lexer_cocci.mll"
+      ( lexerr "unrecognised symbol, in token rule: " (tok lexbuf) )
+# 2065 "lexer_cocci.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_token_rec lexbuf __ocaml_lex_state
+
+and char lexbuf =
+    __ocaml_lex_char_rec lexbuf 188
+and __ocaml_lex_char_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+let
+# 815 "lexer_cocci.mll"
+          x
+# 2077 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
+# 815 "lexer_cocci.mll"
+                                       ( String.make 1 x ^ restchars lexbuf )
+# 2081 "lexer_cocci.ml"
+
+  | 1 ->
+let
+# 817 "lexer_cocci.mll"
+                                             x
+# 2087 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 817 "lexer_cocci.mll"
+                                                     ( x ^ restchars lexbuf )
+# 2091 "lexer_cocci.ml"
+
+  | 2 ->
+let
+# 821 "lexer_cocci.mll"
+                                  x
+# 2097 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 821 "lexer_cocci.mll"
+                                                     ( x ^ restchars lexbuf )
+# 2101 "lexer_cocci.ml"
+
+  | 3 ->
+let
+# 822 "lexer_cocci.mll"
+                 v
+# 2107 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1)
+and
+# 822 "lexer_cocci.mll"
+                                  x
+# 2112 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_start_pos + 2) in
+# 823 "lexer_cocci.mll"
+ (
+          (match v with (* Machine specific ? *)
+          | 'n' -> ()  | 't' -> ()   | 'v' -> ()  | 'b' -> () | 'r' -> ()
+          | 'f' -> () | 'a' -> ()
+         | '\\' -> () | '?'  -> () | '\'' -> ()  | '"' -> ()
+          | 'e' -> () (* linuxext: ? *)
+         | _ ->
+              Common.pr2 ("LEXER: unrecognised symbol in char:"^tok lexbuf);
+         );
+          x ^ restchars lexbuf
+       )
+# 2126 "lexer_cocci.ml"
+
+  | 4 ->
+# 835 "lexer_cocci.mll"
+      ( Common.pr2 ("LEXER: unrecognised symbol in char:"^tok lexbuf);
+        tok lexbuf ^ restchars lexbuf
+      )
+# 2133 "lexer_cocci.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_char_rec lexbuf __ocaml_lex_state
+
+and restchars lexbuf =
+    __ocaml_lex_restchars_rec lexbuf 198
+and __ocaml_lex_restchars_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 840 "lexer_cocci.mll"
+                                       ( "" )
+# 2144 "lexer_cocci.ml"
+
+  | 1 ->
+let
+# 841 "lexer_cocci.mll"
+          x
+# 2150 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
+# 841 "lexer_cocci.mll"
+                                       ( String.make 1 x ^ restchars lexbuf )
+# 2154 "lexer_cocci.ml"
+
+  | 2 ->
+let
+# 843 "lexer_cocci.mll"
+                                             x
+# 2160 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 843 "lexer_cocci.mll"
+                                                     ( x ^ restchars lexbuf )
+# 2164 "lexer_cocci.ml"
+
+  | 3 ->
+let
+# 847 "lexer_cocci.mll"
+                                  x
+# 2170 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 847 "lexer_cocci.mll"
+                                                     ( x ^ restchars lexbuf )
+# 2174 "lexer_cocci.ml"
+
+  | 4 ->
+let
+# 848 "lexer_cocci.mll"
+                 v
+# 2180 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1)
+and
+# 848 "lexer_cocci.mll"
+                                  x
+# 2185 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_start_pos + 2) in
+# 849 "lexer_cocci.mll"
+ (
+          (match v with (* Machine specific ? *)
+          | 'n' -> ()  | 't' -> ()   | 'v' -> ()  | 'b' -> () | 'r' -> ()
+          | 'f' -> () | 'a' -> ()
+         | '\\' -> () | '?'  -> () | '\'' -> ()  | '"' -> ()
+          | 'e' -> () (* linuxext: ? *)
+         | _ ->
+              Common.pr2 ("LEXER: unrecognised symbol in char:"^tok lexbuf);
+         );
+          x ^ restchars lexbuf
+       )
+# 2199 "lexer_cocci.ml"
+
+  | 5 ->
+# 861 "lexer_cocci.mll"
+      ( Common.pr2 ("LEXER: unrecognised symbol in char:"^tok lexbuf);
+        tok lexbuf ^ restchars lexbuf
+      )
+# 2206 "lexer_cocci.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_restchars_rec lexbuf __ocaml_lex_state
+
+and string lexbuf =
+    __ocaml_lex_string_rec lexbuf 209
+and __ocaml_lex_string_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 866 "lexer_cocci.mll"
+                                              ( "" )
+# 2217 "lexer_cocci.ml"
+
+  | 1 ->
+let
+# 867 "lexer_cocci.mll"
+          x
+# 2223 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
+# 867 "lexer_cocci.mll"
+                               ( Common.string_of_char x ^ string lexbuf )
+# 2227 "lexer_cocci.ml"
+
+  | 2 ->
+let
+# 868 "lexer_cocci.mll"
+                                            x
+# 2233 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 868 "lexer_cocci.mll"
+                                              ( x ^ string lexbuf )
+# 2237 "lexer_cocci.ml"
+
+  | 3 ->
+let
+# 869 "lexer_cocci.mll"
+                               x
+# 2243 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
+# 869 "lexer_cocci.mll"
+                                              ( x ^ string lexbuf )
+# 2247 "lexer_cocci.ml"
+
+  | 4 ->
+let
+# 870 "lexer_cocci.mll"
+                v
+# 2253 "lexer_cocci.ml"
+= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1)
+and
+# 870 "lexer_cocci.mll"
+                       x
+# 2258 "lexer_cocci.ml"
+= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_start_pos + 2) in
+# 871 "lexer_cocci.mll"
+       (
+         (match v with
+           | 'n' -> ()  | 't' -> ()   | 'v' -> ()  | 'b' -> () | 'r' -> ()
+           | 'f' -> () | 'a' -> ()
+           | '\\' -> () | '?'  -> () | '\'' -> ()  | '"' -> ()
+           | 'e' -> ()
+           | '\n' -> ()
+           | '(' -> () | '|' -> () | ')' -> ()
+           | _ -> lexerr "unrecognised symbol:" (tok lexbuf)
+        );
+          x ^ string lexbuf
+       )
+# 2273 "lexer_cocci.ml"
+
+  | 5 ->
+# 883 "lexer_cocci.mll"
+      ( lexerr "unrecognised symbol: " (tok lexbuf) )
+# 2278 "lexer_cocci.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_string_rec lexbuf __ocaml_lex_state
+
+and comment check_comment lexbuf =
+    __ocaml_lex_comment_rec check_comment lexbuf 220
+and __ocaml_lex_comment_rec check_comment lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 886 "lexer_cocci.mll"
+         ( let s = tok lexbuf in check_comment s; start_line true; s )
+# 2289 "lexer_cocci.ml"
+
+  | 1 ->
+# 888 "lexer_cocci.mll"
+      ( let s = tok lexbuf in
+        (* even blank line should have a + *)
+        check_comment s;
+        reset_line lexbuf; s ^ comment check_comment lexbuf )
+# 2297 "lexer_cocci.ml"
+
+  | 2 ->
+# 892 "lexer_cocci.mll"
+        ( pass_zero();
+         if !current_line_started
+         then (start_line true;
+               let s = tok lexbuf in s^(comment check_comment lexbuf))
+         else (start_line true; comment check_comment lexbuf) )
+# 2306 "lexer_cocci.ml"
+
+  | 3 ->
+# 899 "lexer_cocci.mll"
+      ( let s = tok lexbuf in
+        check_comment s; start_line true; s ^ comment check_comment lexbuf )
+# 2312 "lexer_cocci.ml"
+
+  | 4 ->
+# 902 "lexer_cocci.mll"
+      ( let s = tok lexbuf in
+        check_comment s; start_line true; s ^ comment check_comment lexbuf )
+# 2318 "lexer_cocci.ml"
+
+  | 5 ->
+# 905 "lexer_cocci.mll"
+      ( start_line true; let s = tok lexbuf in
+        Common.pr2 ("LEXER: unrecognised symbol in comment:"^s);
+        s ^ comment check_comment lexbuf
+      )
+# 2326 "lexer_cocci.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_comment_rec check_comment lexbuf __ocaml_lex_state
+
+;;
+
index d94c7d8..132d7f2 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./lexer_cocci.mll"
 {
 open Parser_cocci_menhir
 module D = Data
@@ -206,6 +207,8 @@ let id_tokens lexbuf =
   let in_meta = !Data.in_meta && not !Data.saw_struct in
   let in_iso = !Data.in_iso in
   let in_prolog = !Data.in_prolog in
+  (if s = "identifer" && in_meta
+  then Common.pr2 "Warning: should identifer be identifier?");
   match s with
     "metavariable" when in_meta -> check_arity_context_linetype s; TMetavariable
   | "identifier" when in_meta -> check_arity_context_linetype s; TIdentifier
diff --git a/parsing_cocci/lexer_script.ml b/parsing_cocci/lexer_script.ml
new file mode 100644 (file)
index 0000000..afe4cb5
--- /dev/null
@@ -0,0 +1,207 @@
+# 0 "lexer_script.mll"
+open Parser_cocci_menhir
+module D = Data
+module Ast = Ast_cocci
+exception Lexical of string
+let tok = Lexing.lexeme
+let inc_line _ = Lexer_cocci.line := !Lexer_cocci.line + 1
+
+# 11 "lexer_script.ml"
+let __ocaml_lex_tables = {
+  Lexing.lex_base = 
+   "\000\000\247\255\248\255\249\255\001\000\001\000\254\255\004\000\
+    \253\255\008\000\001\000\254\255\255\255\002\000\254\255\255\255\
+    ";
+  Lexing.lex_backtrk = 
+   "\255\255\255\255\255\255\255\255\004\000\003\000\255\255\000\000\
+    \255\255\005\000\255\255\255\255\255\255\255\255\255\255\255\255\
+    ";
+  Lexing.lex_default = 
+   "\007\000\000\000\000\000\000\000\255\255\255\255\000\000\007\000\
+    \000\000\009\000\011\000\000\000\000\000\014\000\000\000\000\000\
+    ";
+  Lexing.lex_trans = 
+   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\006\000\006\000\006\000\006\000\255\255\255\255\
+    \255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\003\000\012\000\000\000\000\000\255\255\002\000\
+    \000\000\015\000\000\000\255\255\000\000\000\000\000\000\004\000\
+    \009\000\000\000\000\000\255\255\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \005\000\008\000\000\000\000\000\255\255\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+    \001\000\255\255\255\255\000\000\255\255\000\000\000\000\000\000\
+    \255\255";
+  Lexing.lex_check = 
+   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\000\000\000\000\000\000\000\000\007\000\007\000\
+    \007\000\007\000\009\000\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\000\000\010\000\255\255\255\255\007\000\000\000\
+    \255\255\013\000\255\255\007\000\255\255\255\255\255\255\000\000\
+    \004\000\255\255\255\255\007\000\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \000\000\005\000\255\255\255\255\007\000\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+    \000\000\010\000\013\000\255\255\007\000\255\255\255\255\255\255\
+    \009\000";
+  Lexing.lex_base_code = 
+   "";
+  Lexing.lex_backtrk_code = 
+   "";
+  Lexing.lex_default_code = 
+   "";
+  Lexing.lex_trans_code = 
+   "";
+  Lexing.lex_check_code = 
+   "";
+  Lexing.lex_code = 
+   "";
+}
+
+let rec token lexbuf =
+    __ocaml_lex_token_rec lexbuf 0
+and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 17 "lexer_script.mll"
+           ( TScriptData (tok lexbuf) )
+# 116 "lexer_script.ml"
+
+  | 1 ->
+# 18 "lexer_script.mll"
+                              ( inc_line(); TScriptData (tok lexbuf) )
+# 121 "lexer_script.ml"
+
+  | 2 ->
+# 19 "lexer_script.mll"
+         ( TArobArob )
+# 126 "lexer_script.ml"
+
+  | 3 ->
+# 20 "lexer_script.mll"
+         ( TArob )
+# 131 "lexer_script.ml"
+
+  | 4 ->
+# 21 "lexer_script.mll"
+         ( TScriptData (tok lexbuf) )
+# 136 "lexer_script.ml"
+
+  | 5 ->
+# 22 "lexer_script.mll"
+                   ( token lexbuf )
+# 141 "lexer_script.ml"
+
+  | 6 ->
+# 23 "lexer_script.mll"
+         ( TScriptData (Printf.sprintf "\"%s\"" (string lexbuf)) )
+# 146 "lexer_script.ml"
+
+  | 7 ->
+# 24 "lexer_script.mll"
+         ( TScriptData (Printf.sprintf "'%s'" (cstring lexbuf)) )
+# 151 "lexer_script.ml"
+
+  | 8 ->
+# 25 "lexer_script.mll"
+         ( EOF )
+# 156 "lexer_script.ml"
+
+  | 9 ->
+# 26 "lexer_script.mll"
+      ( raise (Lexical ("unrecognised symbol, in token rule:"^tok lexbuf)) )
+# 161 "lexer_script.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_token_rec lexbuf __ocaml_lex_state
+
+and string lexbuf =
+    __ocaml_lex_string_rec lexbuf 10
+and __ocaml_lex_string_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 30 "lexer_script.mll"
+                        ( "" )
+# 172 "lexer_script.ml"
+
+  | 1 ->
+let
+# 31 "lexer_script.mll"
+          x
+# 178 "lexer_script.ml"
+= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
+# 31 "lexer_script.mll"
+                        ( (String.make 1 x) ^ string lexbuf )
+# 182 "lexer_script.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_string_rec lexbuf __ocaml_lex_state
+
+and cstring lexbuf =
+    __ocaml_lex_cstring_rec lexbuf 13
+and __ocaml_lex_cstring_rec lexbuf __ocaml_lex_state =
+  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
+      | 0 ->
+# 34 "lexer_script.mll"
+                        ( "" )
+# 193 "lexer_script.ml"
+
+  | 1 ->
+let
+# 35 "lexer_script.mll"
+          x
+# 199 "lexer_script.ml"
+= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
+# 35 "lexer_script.mll"
+                        ( (String.make 1 x) ^ cstring lexbuf )
+# 203 "lexer_script.ml"
+
+  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_cstring_rec lexbuf __ocaml_lex_state
+
+;;
+
index d471488..b319ac6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./lexer_script.mll"
 {
 open Parser_cocci_menhir
 module D = Data
index 8a990de..db29505 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./main.ml"
 (* ----------------------------------------------------------------------- *)
 (* Entry point *)
 
index 96d35e4..36e5b58 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./merge.ml"
 (* given parsed minus code and a stream of + code, figure out where to put
 the + code in the mcode of the minus code *)
 
index 94c2dc9..3ebb0a8 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./merge.mli"
 val do_merge :
     Ast0_cocci.rule ->
       (Ast_cocci.anything * int * int * int * int) list list list ->
similarity index 97%
rename from parsing_cocci/parser_cocci.mly
rename to parsing_cocci/obsolete/parser_cocci.mly
index 06331bc..39886c9 100644 (file)
@@ -1,29 +1,3 @@
-/*
- * Copyright 2012, INRIA
- * Julia Lawall, Gilles Muller
- * Copyright 2010-2011, INRIA, University of Copenhagen
- * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
- * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
- * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
- * This file is part of Coccinelle.
- *
- * Coccinelle is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, according to version 2 of the License.
- *
- * Coccinelle is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
- *
- * The authors reserve the right to distribute this or future versions of
- * Coccinelle under other licenses.
- */
-
-
 %{
 
 (* Not clear how to allow function declarations to specify a return type
index 6f300f3..082d3f1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./parse_aux.ml"
 (* exports everything, used only by parser_cocci_menhir.mly *)
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
index bc0af9b..80483de 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./parse_cocci.ml"
 (* splits the entire file into minus and plus fragments, and parses each
 separately (thus duplicating work for the parsing of the context elements) *)
 
index 3d29aa9..9d90dcb 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./parse_cocci.mli"
 exception Bad_virt of string
 
 val process :
index 3f00b18..76324a0 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./plus.ml"
 (* The plus fragments are converted to a list of lists of lists.
 Innermost list: Elements have type anything.  For any pair of successive
 elements, n and n+1, the ending line of n is the same as the starting line
index 0d9b4c8..e5d9941 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./plus.mli"
 val plus :
     Ast_cocci.rule ->
       (Ast_cocci.anything * int * int * int * int) list list list
index 96236b5..ed7e160 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_cocci.ml"
 open Format
 module Ast = Ast_cocci
 
index b178fab..9c26dcd 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_cocci.mli"
 val unparse : Ast_cocci.rule -> unit
 val unparse_to_string : Ast_cocci.rule -> string
 val expression : Ast_cocci.expression -> unit
index 75fb027..6a8bc8e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./safe_for_multi_decls.ml"
 (* This phase sets the safe_for_multi_decls field, which is normally false,
 to true for transformations on declarations where the only change is on the
 declared variable.  This is the only kind of change on such a declaration
index aed1c17..c961945 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./safe_for_multi_decls.mli"
 val safe_for_multi_decls :
     Ast_cocci.rule_with_metavars list ->
       Ast_cocci.rule_with_metavars list
index 165008a..6f588de 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./semantic_cocci.ml"
 exception Semantic of string
index 54d355e..7530d17 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./simple_assignments.ml"
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 module V0 = Visitor_ast0
index 06cacf9..0285031 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./simple_assignments.mli"
 val simple_assignments : Ast0_cocci.rule -> Ast0_cocci.rule
index cc0d180..51d6a9e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./single_statement.ml"
 (* detect statements that are between dots in the minus code, because they
 may need a special treatment if they are if branches *)
 
index 49f0851..aca701c 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./single_statement.mli"
 val single_statement : Ast0_cocci.rule -> Ast0_cocci.rule
index 83d01ca..df6985f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./test_exps.ml"
 module Ast = Ast_cocci
 module Ast0 = Ast0_cocci
 module V0 = Visitor_ast0
index 59cbbfa..103fad4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./test_exps.mli"
 val process : Ast0_cocci.rule -> Ast0_cocci.rule
 
 val process_anything : Ast0_cocci.anything -> Ast0_cocci.anything
index aff803c..9cf774f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./top_level.ml"
 (* Reorganize the top level of a rule to be a list of either top-level
 declarations or code dots.  A function declaration is always considered top
 level.  A statement is always considered code dots.  A variable declaration
index bec8c57..ee91264 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./top_level.mli"
 val top_level :
     bool (* true if must be code *) -> Ast0_cocci.rule -> Ast0_cocci.rule
 
index b628e71..4e61e10 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./type_cocci.ml"
 (* for metavariables in general, but here because needed for metatypes *)
 type inherited = bool (* true if inherited *)
 type keep_binding = Unitary (* need no info *)
index 197589a..f5f92d4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./type_cocci.mli"
 type inherited = bool (* true if inherited *)
 type keep_binding = Unitary (* need no info *)
   | Nonunitary (* need an env entry *) | Saved (* need a witness *)
index 292b580..e49b9a4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./type_infer.ml"
 module T = Type_cocci
 module Ast = Ast_cocci
 module Ast0 = Ast0_cocci
index 06d47b0..aca5264 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./type_infer.mli"
 val type_infer : Ast0_cocci.rule -> unit
index f094b70..586fc8f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unify_ast.ml"
 (* --------------------------------------------------------------------- *)
 (* Given two patterns, A and B, determine whether B can match any matched
 subterms of A.  For simplicity, this doesn't maintain an environment; it
index 534f7f9..1a878df 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unify_ast.mli"
 type res = NO | MAYBE
 
 val unify_statement_dots :
index 9746e86..976914a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unitary_ast0.ml"
 (* find unitary metavariables *)
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
index 334df3e..7d56889 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unitary_ast0.mli"
 (* 'iso is the return type of parse_iso, which currently is
 (Ast_cocci.metavar list * Ast0_cocci.anything list list) list *)
 
index 4ac55e1..8e3698e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unparse_ast0.ml"
 open Format
 module Ast = Ast_cocci
 module Ast0 = Ast0_cocci
index 9ee2bdb..171c173 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./unparse_ast0.mli"
 val expression_dots : Ast0_cocci.expression Ast0_cocci.dots -> unit
 val parameter_list : Ast0_cocci.parameterTypeDef Ast0_cocci.dots -> unit
 val statement_dots : Ast0_cocci.statement Ast0_cocci.dots -> unit
index 425d477..ea01b7b 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./visitor_ast.ml"
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 
index c9fd195..a7acd2d 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./visitor_ast.mli"
 type 'a combiner =
     {combiner_ident : Ast_cocci.ident -> 'a;
      combiner_expression : Ast_cocci.expression -> 'a;
index f50e7c8..e192694 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./visitor_ast0.ml"
 (* --------------------------------------------------------------------- *)
 (* Generic traversal: rebuilder *)
 
index 0117374..819caf0 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./visitor_ast0.mli"
 val combiner_functions : 'a Visitor_ast0_types.combiner_functions
 val combiner :
   ('a -> 'a -> 'a) ->
index 4552c1d..bca7f8e 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./visitor_ast0_types.ml"
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 
index e3d9650..215c5a7 100644 (file)
@@ -24,7 +24,9 @@
 
 #note: if you add a file (a .mli or .ml), dont forget to do a   make depend
 
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 TARGET = popl
 
@@ -40,13 +42,10 @@ INCLUDE_PATH = -I ../commons -I ../globals \
 #The Caml compilers.
 #for warning:  -w A
 #for profiling:  -p -inline 0   with OCAMLOPT
-CAMLC =ocamlc$(OPTBIN) -dtypes -g
-CAMLOPT=ocamlopt$(OPTBIN)   $(OPTFLAGS)
-CAMLLEX = ocamllex$(OPTBIN)
-CAMLYACC= ocamlyacc
-CAMLDEP = ocamldep$(OPTBIN)
-CAMLMKTOP=ocamlmktop -g -custom
-
+OCAMLC_CMD=$(OCAMLC) -dtypes -g
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS)
+OCAMLDEP_CMD=$(OCAMLDEP)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom
 
 
 LIB=$(TARGET).cma
@@ -59,17 +58,17 @@ all: $(LIB)
 all.opt: $(OPTLIB)
 
 $(TARGET).top: $(LIB)
-       $(CAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(CAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 $(LIB):  $(OBJS)
-       $(CAMLC) -a -o $(LIB) $(OBJS)
+       $(CAMLC_CMD) -a -o $(LIB) $(OBJS)
 
 clean::
        rm -f $(LIB) $(TARGET).top
 
 
 $(OPTLIB): $(OPTOBJS)
-       $(CAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
+       $(CAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS)
 
 # clean rule for LIB.opt
 clean::
@@ -80,29 +79,29 @@ clean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(CAMLC) $(INCLUDE_PATH) -c $<
+       $(CAMLC_CMD) $(INCLUDE_PATH) -c $<
 
 .mli.cmi:
-       $(CAMLC) $(INCLUDE_PATH) -c $<
+       $(CAMLC_CMD) $(INCLUDE_PATH) -c $<
 
 .ml.cmx:
-       $(CAMLOPT) $(INCLUDE_PATH) -c $<
-
-
+       $(CAMLOPT_CMD) $(INCLUDE_PATH) -c $<
 
 
 # clean rule for others files
 clean::
        rm -f *.cm[iox] *.o *.annot
        rm -f *~ .*~ #*#
-
-depend:
-       $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
-
-distclean::
        rm -f .depend
 
-.depend:
-       $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
+distclean: clean
+
+.PHONEY: depend
+.depend depend:
+       $(CAMLDEP_CMD) $(INCLUDE_PATH) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 1b3ec5c..09fa70f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast_popl.ml"
 type sequence =
     Seq of element * sequence
   | Empty
index 49b0f00..d02ca6a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttopopl.ml"
 module Ast = Ast_cocci
 module Past = Ast_popl
 
index 8db0851..e787957 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./asttopopl.mli"
 val top : Ast_cocci.top_level -> Ast_popl.sequence
index 4723621..9358719 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./insert_befaft.ml"
 module Past = Ast_popl
 
 (* --------------------------------------------------------------------- *)
index ba0eeeb..31f0c83 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./insert_befaft.mli"
 val insert_befaft : Ast_popl.sequence -> Ast_popl.sequence
index f9c7d70..a82695f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./insert_quantifiers.ml"
 module Ast = Ast_cocci
 module Past = Ast_popl
 
index 954760b..0df0cab 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./insert_quantifiers.mli"
 val insert_quantifiers : Ast_popl.sequence -> Ast_popl.sequence
index f2a814c..63c75d9 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popl.ml"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index b408f4f..0572d47 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popl.mli"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index ea0dd37..8134396 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popltoctl.ml"
 module Past = Ast_popl
 module Ast = Ast_cocci
 module V = Visitor_ast
index bf73a67..96d88e3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popltoctl.mli"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index 61bb843..d0e9b9f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_popl.ml"
 open Format
 module Past = Ast_popl
 
index f36b513..d62c4c6 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./pretty_print_popl.mli"
 val pretty_print : Ast_popl.sequence -> unit
 val pretty_print_e : Ast_popl.element -> unit
index 50c7800..5cfc0b5 100644 (file)
 
 #note: if you add a file (a .mli or .ml), dont forget to do a   make depend
 
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
+
 TARGET = popl
 
 SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml \
@@ -40,12 +43,10 @@ INCLUDES = -I ../commons -I ../globals \
 #for warning:  -w A
 #for profiling:  -p -inline 0   with OCAMLOPT
 OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
-OCAMLMKTOP=ocamlmktop -g -custom
-
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 LIB=$(TARGET).cma
 OPTLIB=$(LIB:.cma=.cmxa)
@@ -57,17 +58,17 @@ all: $(LIB)
 all.opt: $(OPTLIB)
 
 $(TARGET).top: $(LIB)
-       $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
+       $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
 
 $(LIB):  $(OBJS)
-       $(OCAMLC) -a -o $(LIB) $(OBJS)
+       $(OCAMLC_CMD) -a -o $(LIB) $(OBJS)
 
 clean::
        rm -f $(LIB) $(TARGET).top
 
 
 $(OPTLIB): $(OPTOBJS)
-       $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS)
 
 # clean rule for LIB.opt
 clean::
@@ -78,29 +79,29 @@ clean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .ml.cmx:
-       $(OCAMLOPT) -c $<
-
-
+       $(OCAMLOPT_CMD) -c $<
 
 
 # clean rule for others files
 clean::
        rm -f *.cm[iox] *.o *.annot
        rm -f *~ .*~ #*#
-
-depend:
-       $(OCAMLDEP) *.mli *.ml > .depend
-
-distclean::
        rm -f .depend
 
-.depend:
-       $(OCAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
+distclean: clean
+
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 4aaf236..4b3a62f 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./ast_popl.ml"
 type sequence =
     Seq of element * sequence
   | Empty
index e49072c..b86b1d4 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./asttopopl.ml"
 module Ast = Ast_cocci
 module Past = Ast_popl
 
index 8db0851..e787957 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./asttopopl.mli"
 val top : Ast_cocci.top_level -> Ast_popl.sequence
index c5c1324..e7a15c3 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./flag_popl.ml"
 let mark_all = ref false
 let keep_all_wits = ref false
index 80c2ec6..badef2c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./insert_quantifiers.ml"
 module Ast = Ast_cocci
 module Past = Ast_popl
 
index 954760b..0df0cab 100644 (file)
@@ -24,4 +24,5 @@
  *)
 
 
+# 0 "./insert_quantifiers.mli"
 val insert_quantifiers : Ast_popl.sequence -> Ast_popl.sequence
index fd57654..fb4eff5 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popl.ml"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index b408f4f..0572d47 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popl.mli"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index 77c2897..46f4ed6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popltoctl.ml"
 module Past = Ast_popl
 module Ast = Ast_cocci
 module V = Visitor_ast
index bf73a67..96d88e3 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./popltoctl.mli"
 type cocci_predicate = Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif
 type formula =
     (cocci_predicate,Ast_cocci.meta_name, Wrapper_ctl.info) Ast_ctl.generic_ctl
index 42b0a81..fc595e1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pretty_print_popl.ml"
 open Format
 module Past = Ast_popl
 module Ast = Ast_cocci
index f36b513..d62c4c6 100644 (file)
@@ -24,5 +24,6 @@
  *)
 
 
+# 0 "./pretty_print_popl.mli"
 val pretty_print : Ast_popl.sequence -> unit
 val pretty_print_e : Ast_popl.element -> unit
diff --git a/pycaml/Makefile b/pycaml/Makefile
deleted file mode 100644 (file)
index d0b0a95..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#pad: was called Makefile.deb-pycaml before
-
-OCAMLMAKEFILE = OCamlMakefile
-PY_PREFIX = $(shell python getprefix.py)
-PY_VERSION = $(shell python getversion.py)
-CLIBS = python$(PY_VERSION) pthread dl util m c
-
-SOURCES = pycaml.ml pycaml_ml.c
-RESULT = pycaml
-THREADS = yes
-NO_CUSTOM = NO_CUSTOM
-
-CFLAGS = -fPIC
-ifeq ("$(PY_VERSION)","2.4")
-export CPPFLAGS =-DPYTHON24
-endif
-
-LIBDIRS = $(PY_PREFIX)/lib/python$(PY_VERSION)/config
-INCDIRS = $(PY_PREFIX)/include/python$(PY_VERSION)
-OCAMLLDFLAGS = -linkall
-
-all.opt: native-code-library pycaml.customtop
-
-all: pycaml.customtop
-
-pycaml.customtop: byte-code-library
-       cp -f dllpycaml_stubs.so ../
-       ocamlmktop -o pycaml.customtop pycaml.cma
-
-clean::
-       rm -f pycaml.customtop
-       rm -f *.cm[aiox] *.a
-
-distclean:: clean
-       rm -rf ._d
-       rm -f ../dllpycaml_stubs.so
-
-depend: # added by julia, undoubtedly wrong
-
--include $(OCAMLMAKEFILE)
diff --git a/pycaml/Makefile.in b/pycaml/Makefile.in
deleted file mode 100644 (file)
index 5b74075..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Edit SYSLIBS to fit your system
-#
-
-PY_PREFIX=@PY_PREFIX@
-PY_VERSION=@PY_VERSION@
-SYSLIBS=@PY_LIBS@
-
-#
-# The rest is automatic
-#
-
-LIBS=  pycaml_ml.o \
-       -cclib -L$(PY_PREFIX)/lib/python$(PY_VERSION)/config \
-       -cclib -lpython$(PY_VERSION) $(SYSLIBS) \
-       unix.cma threads.cma pycaml.cmo
-
-all: pycamltop pycamltest ocamlobj
-
-pycamltop: pycaml_ml.o pycaml.cmo
-       ocamlmktop -thread -custom -o $@ $(LIBS)
-
-pycaml_ml.o: pycaml_ml.c
-       ocamlc -thread -ccopt -c -ccopt -g \
-       -ccopt -I$(PY_PREFIX)/include/python$(PY_VERSION) $<
-
-pycaml.cmo: pycaml.ml
-       ocamlc -thread -c $<
-
-pycamltest: pycamltest.ml pycaml.cmo pycaml_ml.o
-       ocamlc -custom -thread -ccopt -g $(LIBS) pycamltest.ml -o $@
-
-ocamlobj: ocamlobj.ml pycaml.cmo pycaml_ml.o
-       ocamlc -custom -thread -ccopt -g $(LIBS) ocamlobj.ml -o $@
-
-clean:
-       rm -rf *.o *.cmi *.cmo pycamltop pycamltest ocamlobj
-
-distclean: clean
-       rm -rf config.cache autom4te.cache config.status Makefile
\ No newline at end of file
diff --git a/pycaml/OCamlMakefile b/pycaml/OCamlMakefile
deleted file mode 100644 (file)
index b0b9252..0000000
+++ /dev/null
@@ -1,1231 +0,0 @@
-###########################################################################
-#                              OCamlMakefile
-#                  Copyright (C) 1999-2007  Markus Mottl
-#
-#                             For updates see:
-#                http://www.ocaml.info/home/ocaml_sources.html
-#
-###########################################################################
-
-# Modified by damien for .glade.ml compilation
-
-# Set these variables to the names of the sources to be processed and
-# the result variable. Order matters during linkage!
-
-ifndef SOURCES
-  SOURCES := foo.ml
-endif
-export SOURCES
-
-ifndef RES_CLIB_SUF
-  RES_CLIB_SUF := _stubs
-endif
-export RES_CLIB_SUF
-
-ifndef RESULT
-  RESULT := foo
-endif
-export RESULT := $(strip $(RESULT))
-
-export LIB_PACK_NAME
-
-ifndef DOC_FILES
-  DOC_FILES := $(filter %.mli, $(SOURCES))
-endif
-export DOC_FILES
-FIRST_DOC_FILE := $(firstword $(DOC_FILES))
-
-export BCSUFFIX
-export NCSUFFIX
-
-ifndef TOPSUFFIX
-  TOPSUFFIX := .top
-endif
-export TOPSUFFIX
-
-# Eventually set include- and library-paths, libraries to link,
-# additional compilation-, link- and ocamlyacc-flags
-# Path- and library information needs not be written with "-I" and such...
-# Define THREADS if you need it, otherwise leave it unset (same for
-# USE_CAMLP4)!
-
-export THREADS
-export VMTHREADS
-export ANNOTATE
-export USE_CAMLP4
-
-export INCDIRS
-export LIBDIRS
-export EXTLIBDIRS
-export RESULTDEPS
-export OCAML_DEFAULT_DIRS
-
-export LIBS
-export CLIBS
-export CFRAMEWORKS
-
-export OCAMLFLAGS
-export OCAMLNCFLAGS
-export OCAMLBCFLAGS
-
-export OCAMLLDFLAGS
-export OCAMLNLDFLAGS
-export OCAMLBLDFLAGS
-
-export OCAMLMKLIB_FLAGS
-
-ifndef OCAMLCPFLAGS
-  OCAMLCPFLAGS := a
-endif
-export OCAMLCPFLAGS
-
-ifndef DOC_DIR
-  DOC_DIR := doc
-endif
-export DOC_DIR
-
-export PPFLAGS
-
-export LFLAGS
-export YFLAGS
-export IDLFLAGS
-
-export OCAMLDOCFLAGS
-
-export OCAMLFIND_INSTFLAGS
-
-export DVIPSFLAGS
-
-export STATIC
-
-# Add a list of optional trash files that should be deleted by "make clean"
-export TRASH
-
-ECHO := echo
-
-ifdef REALLY_QUIET
-  export REALLY_QUIET
-  ECHO := true
-  LFLAGS := $(LFLAGS) -q
-  YFLAGS := $(YFLAGS) -q
-endif
-
-####################  variables depending on your OCaml-installation
-
-ifdef MINGW
-  export MINGW
-  WIN32   := 1
-  CFLAGS_WIN32 := -mno-cygwin
-endif
-ifdef MSVC
-  export MSVC
-  WIN32   := 1
-  ifndef STATIC
-    CPPFLAGS_WIN32 := -DCAML_DLL
-  endif
-  CFLAGS_WIN32 += -nologo
-  EXT_OBJ := obj
-  EXT_LIB := lib
-  ifeq ($(CC),gcc)
-    # work around GNU Make default value
-    ifdef THREADS
-      CC := cl -MT
-    else
-      CC := cl
-    endif
-  endif
-  ifeq ($(CXX),g++)
-    # work around GNU Make default value
-    CXX := $(CC)
-  endif
-  CFLAG_O := -Fo
-endif
-ifdef WIN32
-  EXT_CXX := cpp
-  EXE     := .exe
-endif
-
-ifndef EXT_OBJ
-  EXT_OBJ := o
-endif
-ifndef EXT_LIB
-  EXT_LIB := a
-endif
-ifndef EXT_CXX
-  EXT_CXX := cc
-endif
-ifndef EXE
-  EXE := # empty
-endif
-ifndef CFLAG_O
-  CFLAG_O := -o # do not delete this comment (preserves trailing whitespace)!
-endif
-
-export CC
-export CXX
-export CFLAGS
-export CXXFLAGS
-export LDFLAGS
-export CPPFLAGS
-
-ifndef RPATH_FLAG
-  ifdef ELF_RPATH_FLAG
-    RPATH_FLAG := $(ELF_RPATH_FLAG)
-  else
-    RPATH_FLAG := -R
-  endif
-endif
-export RPATH_FLAG
-
-ifndef MSVC
-ifndef PIC_CFLAGS
-  PIC_CFLAGS := -fPIC
-endif
-ifndef PIC_CPPFLAGS
-  PIC_CPPFLAGS := -DPIC
-endif
-endif
-
-export PIC_CFLAGS
-export PIC_CPPFLAGS
-
-BCRESULT  := $(addsuffix $(BCSUFFIX), $(RESULT))
-NCRESULT  := $(addsuffix $(NCSUFFIX), $(RESULT))
-TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT))
-
-ifndef OCAMLFIND
-  OCAMLFIND := ocamlfind
-endif
-export OCAMLFIND
-
-ifndef OCAMLC
-  OCAMLC := ocamlc
-endif
-export OCAMLC
-
-ifndef OCAMLOPT
-  OCAMLOPT := ocamlopt
-endif
-export OCAMLOPT
-
-ifndef OCAMLMKTOP
-  OCAMLMKTOP := ocamlmktop
-endif
-export OCAMLMKTOP
-
-ifndef OCAMLCP
-  OCAMLCP := ocamlcp
-endif
-export OCAMLCP
-
-ifndef OCAMLDEP
-  OCAMLDEP := ocamldep
-endif
-export OCAMLDEP
-
-ifndef OCAMLLEX
-  OCAMLLEX := ocamllex
-endif
-export OCAMLLEX
-
-ifndef OCAMLYACC
-  OCAMLYACC := ocamlyacc
-endif
-export OCAMLYACC
-
-ifndef OCAMLMKLIB
-  OCAMLMKLIB := ocamlmklib
-endif
-export OCAMLMKLIB
-
-ifndef OCAML_GLADECC
-  OCAML_GLADECC := lablgladecc2
-endif
-export OCAML_GLADECC
-
-ifndef OCAML_GLADECC_FLAGS
-  OCAML_GLADECC_FLAGS :=
-endif
-export OCAML_GLADECC_FLAGS
-
-ifndef CAMELEON_REPORT
-  CAMELEON_REPORT := report
-endif
-export CAMELEON_REPORT
-
-ifndef CAMELEON_REPORT_FLAGS
-  CAMELEON_REPORT_FLAGS :=
-endif
-export CAMELEON_REPORT_FLAGS
-
-ifndef CAMELEON_ZOGGY
-  CAMELEON_ZOGGY := camlp4o pa_zog.cma pr_o.cmo
-endif
-export CAMELEON_ZOGGY
-
-ifndef CAMELEON_ZOGGY_FLAGS
-  CAMELEON_ZOGGY_FLAGS :=
-endif
-export CAMELEON_ZOGGY_FLAGS
-
-ifndef OXRIDL
-  OXRIDL := oxridl
-endif
-export OXRIDL
-
-ifndef CAMLIDL
-  CAMLIDL := camlidl
-endif
-export CAMLIDL
-
-ifndef CAMLIDLDLL
-  CAMLIDLDLL := camlidldll
-endif
-export CAMLIDLDLL
-
-ifndef NOIDLHEADER
-  MAYBE_IDL_HEADER := -header
-endif
-export NOIDLHEADER
-
-export NO_CUSTOM
-
-ifndef CAMLP4
-  CAMLP4 := camlp4
-endif
-export CAMLP4
-
-ifndef REAL_OCAMLFIND
-  ifdef PACKS
-    ifndef CREATE_LIB
-      ifdef THREADS
-       PACKS += threads
-      endif
-    endif
-    empty :=
-    space := $(empty) $(empty)
-    comma := ,
-    ifdef PREDS
-      PRE_OCAML_FIND_PREDICATES := $(subst $(space),$(comma),$(PREDS))
-      PRE_OCAML_FIND_PACKAGES := $(subst $(space),$(comma),$(PACKS))
-      OCAML_FIND_PREDICATES := -predicates $(PRE_OCAML_FIND_PREDICATES)
-  #    OCAML_DEP_PREDICATES := -syntax $(PRE_OCAML_FIND_PREDICATES)
-      OCAML_FIND_PACKAGES := $(OCAML_FIND_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
-      OCAML_DEP_PACKAGES := $(OCAML_DEP_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
-    else
-      OCAML_FIND_PACKAGES := -package $(subst $(space),$(comma),$(PACKS))
-      OCAML_DEP_PACKAGES :=
-    endif
-    OCAML_FIND_LINKPKG := -linkpkg
-    REAL_OCAMLFIND := $(OCAMLFIND)
-  endif
-endif
-
-export OCAML_FIND_PACKAGES
-export OCAML_DEP_PACKAGES
-export OCAML_FIND_LINKPKG
-export REAL_OCAMLFIND
-
-ifndef OCAMLDOC
-  OCAMLDOC := ocamldoc
-endif
-export OCAMLDOC
-
-ifndef LATEX
-  LATEX := latex
-endif
-export LATEX
-
-ifndef DVIPS
-  DVIPS := dvips
-endif
-export DVIPS
-
-ifndef PS2PDF
-  PS2PDF := ps2pdf
-endif
-export PS2PDF
-
-ifndef OCAMLMAKEFILE
-  OCAMLMAKEFILE := OCamlMakefile
-endif
-export OCAMLMAKEFILE
-
-ifndef OCAMLLIBPATH
-  OCAMLLIBPATH := \
-    $(shell $(OCAMLC) 2>/dev/null -where || echo /usr/local/lib/ocaml)
-endif
-export OCAMLLIBPATH
-
-ifndef OCAML_LIB_INSTALL
-  OCAML_LIB_INSTALL := $(OCAMLLIBPATH)/contrib
-endif
-export OCAML_LIB_INSTALL
-
-###########################################################################
-
-####################  change following sections only if
-####################    you know what you are doing!
-
-# delete target files when a build command fails
-.PHONY: .DELETE_ON_ERROR
-.DELETE_ON_ERROR:
-
-# for pedants using "--warn-undefined-variables"
-export MAYBE_IDL
-export REAL_RESULT
-export CAMLIDLFLAGS
-export THREAD_FLAG
-export RES_CLIB
-export MAKEDLL
-export ANNOT_FLAG
-export C_OXRIDL
-export SUBPROJS
-export CFLAGS_WIN32
-export CPPFLAGS_WIN32
-
-INCFLAGS :=
-
-SHELL := /bin/sh
-
-MLDEPDIR := ._d
-BCDIDIR  := ._bcdi
-NCDIDIR  := ._ncdi
-
-FILTER_EXTNS := %.mli %.ml %.mll %.mly %.idl %.oxridl %.c %.m %.$(EXT_CXX) %.rep %.zog %.glade
-
-FILTERED     := $(filter $(FILTER_EXTNS), $(SOURCES))
-SOURCE_DIRS  := $(filter-out ./, $(sort $(dir $(FILTERED))))
-
-FILTERED_REP := $(filter %.rep, $(FILTERED))
-DEP_REP      := $(FILTERED_REP:%.rep=$(MLDEPDIR)/%.d)
-AUTO_REP     := $(FILTERED_REP:.rep=.ml)
-
-FILTERED_ZOG := $(filter %.zog, $(FILTERED))
-DEP_ZOG      := $(FILTERED_ZOG:%.zog=$(MLDEPDIR)/%.d)
-AUTO_ZOG     := $(FILTERED_ZOG:.zog=.ml)
-
-FILTERED_GLADE := $(filter %.glade, $(FILTERED))
-DEP_GLADE      := $(FILTERED_GLADE:%.glade=$(MLDEPDIR)/%.d)
-AUTO_GLADE     := $(FILTERED_GLADE:.glade=.ml)
-
-FILTERED_ML  := $(filter %.ml, $(FILTERED))
-DEP_ML       := $(FILTERED_ML:%.ml=$(MLDEPDIR)/%.d)
-
-FILTERED_MLI := $(filter %.mli, $(FILTERED))
-DEP_MLI      := $(FILTERED_MLI:.mli=.di)
-
-FILTERED_MLL := $(filter %.mll, $(FILTERED))
-DEP_MLL      := $(FILTERED_MLL:%.mll=$(MLDEPDIR)/%.d)
-AUTO_MLL     := $(FILTERED_MLL:.mll=.ml)
-
-FILTERED_MLY := $(filter %.mly, $(FILTERED))
-DEP_MLY      := $(FILTERED_MLY:%.mly=$(MLDEPDIR)/%.d) $(FILTERED_MLY:.mly=.di)
-AUTO_MLY     := $(FILTERED_MLY:.mly=.mli) $(FILTERED_MLY:.mly=.ml)
-
-FILTERED_IDL := $(filter %.idl, $(FILTERED))
-DEP_IDL      := $(FILTERED_IDL:%.idl=$(MLDEPDIR)/%.d) $(FILTERED_IDL:.idl=.di)
-C_IDL        := $(FILTERED_IDL:%.idl=%_stubs.c)
-ifndef NOIDLHEADER
- C_IDL += $(FILTERED_IDL:.idl=.h)
-endif
-OBJ_C_IDL    := $(FILTERED_IDL:%.idl=%_stubs.$(EXT_OBJ))
-AUTO_IDL     := $(FILTERED_IDL:.idl=.mli) $(FILTERED_IDL:.idl=.ml) $(C_IDL)
-
-FILTERED_OXRIDL := $(filter %.oxridl, $(FILTERED))
-DEP_OXRIDL      := $(FILTERED_OXRIDL:%.oxridl=$(MLDEPDIR)/%.d) $(FILTERED_OXRIDL:.oxridl=.di)
-AUTO_OXRIDL     := $(FILTERED_OXRIDL:.oxridl=.mli) $(FILTERED_OXRIDL:.oxridl=.ml) $(C_OXRIDL)
-
-FILTERED_C_CXX := $(filter %.c %.m %.$(EXT_CXX), $(FILTERED))
-OBJ_C_CXX      := $(FILTERED_C_CXX:.c=.$(EXT_OBJ))
-OBJ_C_CXX      := $(OBJ_C_CXX:.m=.$(EXT_OBJ))
-OBJ_C_CXX      := $(OBJ_C_CXX:.$(EXT_CXX)=.$(EXT_OBJ))
-
-PRE_TARGETS  += $(AUTO_MLL) $(AUTO_MLY) $(AUTO_IDL) $(AUTO_OXRIDL) $(AUTO_ZOG) $(AUTO_REP) $(AUTO_GLADE)
-
-ALL_DEPS     := $(DEP_ML) $(DEP_MLI) $(DEP_MLL) $(DEP_MLY) $(DEP_IDL) $(DEP_OXRIDL) $(DEP_ZOG) $(DEP_REP) $(DEP_GLADE)
-
-MLDEPS       := $(filter %.d, $(ALL_DEPS))
-MLIDEPS      := $(filter %.di, $(ALL_DEPS))
-BCDEPIS      := $(MLIDEPS:%.di=$(BCDIDIR)/%.di)
-NCDEPIS      := $(MLIDEPS:%.di=$(NCDIDIR)/%.di)
-
-ALLML        := $(filter %.mli %.ml %.mll %.mly %.idl %.oxridl %.rep %.zog %.glade, $(FILTERED))
-
-IMPLO_INTF   := $(ALLML:%.mli=%.mli.__)
-IMPLO_INTF   := $(foreach file, $(IMPLO_INTF), \
-                  $(basename $(file)).cmi $(basename $(file)).cmo)
-IMPLO_INTF   := $(filter-out %.mli.cmo, $(IMPLO_INTF))
-IMPLO_INTF   := $(IMPLO_INTF:%.mli.cmi=%.cmi)
-
-IMPLX_INTF   := $(IMPLO_INTF:.cmo=.cmx)
-
-INTF         := $(filter %.cmi, $(IMPLO_INTF))
-IMPL_CMO     := $(filter %.cmo, $(IMPLO_INTF))
-IMPL_CMX     := $(IMPL_CMO:.cmo=.cmx)
-IMPL_ASM     := $(IMPL_CMO:.cmo=.asm)
-IMPL_S       := $(IMPL_CMO:.cmo=.s)
-
-OBJ_LINK     := $(OBJ_C_IDL) $(OBJ_C_CXX)
-OBJ_FILES    := $(IMPL_CMO:.cmo=.$(EXT_OBJ)) $(OBJ_LINK)
-
-EXECS        := $(addsuffix $(EXE), \
-                            $(sort $(TOPRESULT) $(BCRESULT) $(NCRESULT)))
-ifdef WIN32
-  EXECS      += $(BCRESULT).dll $(NCRESULT).dll
-endif
-
-CLIB_BASE    := $(RESULT)$(RES_CLIB_SUF)
-ifneq ($(strip $(OBJ_LINK)),)
-  RES_CLIB     := lib$(CLIB_BASE).$(EXT_LIB)
-endif
-
-ifdef WIN32
-DLLSONAME := $(CLIB_BASE).dll
-else
-DLLSONAME := dll$(CLIB_BASE).so
-endif
-
-NONEXECS     := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \
-               $(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \
-               $(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmo \
-               $(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).o \
-               $(RES_CLIB) $(IMPL_CMO:.cmo=.annot) \
-               $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx $(LIB_PACK_NAME).o
-
-ifndef STATIC
-  NONEXECS += $(DLLSONAME)
-endif
-
-ifndef LIBINSTALL_FILES
-  LIBINSTALL_FILES := $(RESULT).mli $(RESULT).cmi $(RESULT).cma \
-                     $(RESULT).cmxa $(RESULT).$(EXT_LIB) $(RES_CLIB)
-  ifndef STATIC
-    ifneq ($(strip $(OBJ_LINK)),)
-      LIBINSTALL_FILES += $(DLLSONAME)
-    endif
-  endif
-endif
-
-export LIBINSTALL_FILES
-
-ifdef WIN32
-  # some extra stuff is created while linking DLLs
-  NONEXECS   += $(BCRESULT).$(EXT_LIB) $(BCRESULT).exp $(NCRESULT).exp $(CLIB_BASE).exp $(CLIB_BASE).lib
-endif
-
-TARGETS      := $(EXECS) $(NONEXECS)
-
-# If there are IDL-files
-ifneq ($(strip $(FILTERED_IDL)),)
-  MAYBE_IDL := -cclib -lcamlidl
-endif
-
-ifdef USE_CAMLP4
-  CAMLP4PATH := \
-    $(shell $(CAMLP4) -where 2>/dev/null || echo /usr/local/lib/camlp4)
-  INCFLAGS := -I $(CAMLP4PATH)
-  CINCFLAGS := -I$(CAMLP4PATH)
-endif
-
-DINCFLAGS := $(INCFLAGS) $(SOURCE_DIRS:%=-I %) $(OCAML_DEFAULT_DIRS:%=-I %)
-INCFLAGS := $(DINCFLAGS) $(INCDIRS:%=-I %)
-CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%)
-
-ifndef MSVC
-  CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
-               $(EXTLIBDIRS:%=-L%) $(OCAML_DEFAULT_DIRS:%=-L%)
-
-  ifeq ($(ELF_RPATH), yes)
-    CLIBFLAGS += $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%)
-  endif
-endif
-
-ifndef PROFILING
-  INTF_OCAMLC := $(OCAMLC)
-else
-  ifndef THREADS
-    INTF_OCAMLC := $(OCAMLCP) -p $(OCAMLCPFLAGS)
-  else
-    # OCaml does not support profiling byte code
-    # with threads (yet), therefore we force an error.
-    ifndef REAL_OCAMLC
-      $(error Profiling of multithreaded byte code not yet supported by OCaml)
-    endif
-    INTF_OCAMLC := $(OCAMLC)
-  endif
-endif
-
-ifndef MSVC
-  COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
-                   $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
-                   $(EXTLIBDIRS:%=-ccopt -Wl $(OCAML_DEFAULT_DIRS:%=-ccopt -L%))
-
-  ifeq ($(ELF_RPATH),yes)
-    COMMON_LDFLAGS += $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%)
-  endif
-else
-  COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
-                   $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
-                   $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
-endif
-
-CLIBS_OPTS := $(CLIBS:%=-cclib -l%) $(CFRAMEWORKS:%=-cclib '-framework %')
-ifdef MSVC
-  ifndef STATIC
-  # MSVC libraries do not have 'lib' prefix
-  CLIBS_OPTS := $(CLIBS:%=-cclib %.lib)
-  endif
-endif
-
-ifneq ($(strip $(OBJ_LINK)),)
-  ifdef CREATE_LIB
-    OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL)
-  else
-    OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL)
-  endif
-else
-  OBJS_LIBS := $(CLIBS_OPTS) $(MAYBE_IDL)
-endif
-
-# If we have to make byte-code
-ifndef REAL_OCAMLC
-  BYTE_OCAML := y
-
-  # EXTRADEPS is added dependencies we have to insert for all
-  # executable files we generate.  Ideally it should be all of the
-  # libraries we use, but it's hard to find the ones that get searched on
-  # the path since I don't know the paths built into the compiler, so
-  # just include the ones with slashes in their names.
-  EXTRADEPS := $(addsuffix .cma,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
-  SPECIAL_OCAMLFLAGS := $(OCAMLBCFLAGS)
-
-  REAL_OCAMLC := $(INTF_OCAMLC)
-
-  REAL_IMPL := $(IMPL_CMO)
-  REAL_IMPL_INTF := $(IMPLO_INTF)
-  IMPL_SUF := .cmo
-
-  DEPFLAGS  :=
-  MAKE_DEPS := $(MLDEPS) $(BCDEPIS)
-
-  ifdef CREATE_LIB
-    override CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
-    override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
-    ifndef STATIC
-      ifneq ($(strip $(OBJ_LINK)),)
-       MAKEDLL := $(DLLSONAME)
-       ALL_LDFLAGS := -dllib $(DLLSONAME)
-      endif
-    endif
-  endif
-
-  ifndef NO_CUSTOM
-    ifneq "$(strip $(OBJ_LINK) $(THREADS) $(MAYBE_IDL) $(CLIBS) $(CFRAMEWORKS))" ""
-      ALL_LDFLAGS += -custom
-    endif
-  endif
-
-  ALL_LDFLAGS += $(INCFLAGS) $(OCAMLLDFLAGS) $(OCAMLBLDFLAGS) \
-                 $(COMMON_LDFLAGS) $(LIBS:%=%.cma)
-  CAMLIDLDLLFLAGS :=
-
-  ifdef THREADS
-    ifdef VMTHREADS
-      THREAD_FLAG := -vmthread
-    else
-      THREAD_FLAG := -thread
-    endif
-    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
-    ifndef CREATE_LIB
-      ifndef REAL_OCAMLFIND
-        ALL_LDFLAGS := unix.cma threads.cma $(ALL_LDFLAGS)
-      endif
-    endif
-  endif
-
-# we have to make native-code
-else
-  EXTRADEPS := $(addsuffix .cmxa,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
-  ifndef PROFILING
-    SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS)
-    PLDFLAGS :=
-  else
-    SPECIAL_OCAMLFLAGS := -p $(OCAMLNCFLAGS)
-    PLDFLAGS := -p
-  endif
-
-  REAL_IMPL := $(IMPL_CMX)
-  REAL_IMPL_INTF := $(IMPLX_INTF)
-  IMPL_SUF := .cmx
-
-  override CPPFLAGS := -DNATIVE_CODE $(CPPFLAGS)
-
-  DEPFLAGS  := -native
-  MAKE_DEPS := $(MLDEPS) $(NCDEPIS)
-
-  ALL_LDFLAGS := $(PLDFLAGS) $(INCFLAGS) $(OCAMLLDFLAGS) \
-                 $(OCAMLNLDFLAGS) $(COMMON_LDFLAGS)
-  CAMLIDLDLLFLAGS := -opt
-
-  ifndef CREATE_LIB
-    ALL_LDFLAGS += $(LIBS:%=%.cmxa)
-  else
-    override CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
-    override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
-  endif
-
-  ifdef THREADS
-    THREAD_FLAG := -thread
-    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
-    ifndef CREATE_LIB
-      ifndef REAL_OCAMLFIND
-        ALL_LDFLAGS := unix.cmxa threads.cmxa $(ALL_LDFLAGS)
-      endif
-    endif
-  endif
-endif
-
-export MAKE_DEPS
-
-ifdef ANNOTATE
-  ANNOT_FLAG := -dtypes
-else
-endif
-
-ALL_OCAMLCFLAGS := $(THREAD_FLAG) $(ANNOT_FLAG) $(OCAMLFLAGS) \
-                   $(INCFLAGS) $(SPECIAL_OCAMLFLAGS)
-
-ifdef make_deps
-  -include $(MAKE_DEPS)
-  PRE_TARGETS :=
-endif
-
-###########################################################################
-# USER RULES
-
-# Call "OCamlMakefile QUIET=" to get rid of all of the @'s.
-QUIET=@
-
-# generates byte-code (default)
-byte-code:             $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes
-bc:    byte-code
-
-byte-code-nolink:      $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes
-bcnl:  byte-code-nolink
-
-top:                   $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(TOPRESULT) \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes
-
-# generates native-code
-
-native-code:           $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               make_deps=yes
-nc:    native-code
-
-native-code-nolink:    $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               make_deps=yes
-ncnl:  native-code-nolink
-
-# generates byte-code libraries
-byte-code-library:     $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(BCRESULT).cma \
-                               REAL_RESULT="$(BCRESULT)" \
-                               CREATE_LIB=yes \
-                               make_deps=yes
-bcl:   byte-code-library
-
-# generates native-code libraries
-native-code-library:   $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(NCRESULT).cmxa \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               CREATE_LIB=yes \
-                               make_deps=yes
-ncl:   native-code-library
-
-ifdef WIN32
-# generates byte-code dll
-byte-code-dll:         $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(BCRESULT).dll \
-                               REAL_RESULT="$(BCRESULT)" \
-                               make_deps=yes
-bcd:   byte-code-dll
-
-# generates native-code dll
-native-code-dll:       $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(NCRESULT).dll \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               make_deps=yes
-ncd:   native-code-dll
-endif
-
-# generates byte-code with debugging information
-debug-code:            $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dc:    debug-code
-
-debug-code-nolink:     $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dcnl:  debug-code-nolink
-
-# generates byte-code with debugging information (native code)
-debug-native-code:     $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
-                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dnc:   debug-native-code
-
-debug-native-code-nolink:      $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
-                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dncnl: debug-native-code-nolink
-
-# generates byte-code libraries with debugging information
-debug-code-library:    $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(BCRESULT).cma \
-                               REAL_RESULT="$(BCRESULT)" make_deps=yes \
-                               CREATE_LIB=yes \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dcl:   debug-code-library
-
-# generates byte-code libraries with debugging information (native code)
-debug-native-code-library:     $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(NCRESULT).cma \
-                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               CREATE_LIB=yes \
-                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
-                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
-dncl:  debug-native-code-library
-
-# generates byte-code for profiling
-profiling-byte-code:           $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
-                               REAL_RESULT="$(BCRESULT)" PROFILING="y" \
-                               make_deps=yes
-pbc:   profiling-byte-code
-
-# generates native-code
-
-profiling-native-code:         $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               PROFILING="y" \
-                               make_deps=yes
-pnc:   profiling-native-code
-
-# generates byte-code libraries
-profiling-byte-code-library:   $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(BCRESULT).cma \
-                               REAL_RESULT="$(BCRESULT)" PROFILING="y" \
-                               CREATE_LIB=yes \
-                               make_deps=yes
-pbcl:  profiling-byte-code-library
-
-# generates native-code libraries
-profiling-native-code-library: $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(RES_CLIB) $(NCRESULT).cmxa \
-                               REAL_RESULT="$(NCRESULT)" PROFILING="y" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               CREATE_LIB=yes \
-                               make_deps=yes
-pncl:  profiling-native-code-library
-
-# packs byte-code objects
-pack-byte-code:                        $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT).cmo \
-                               REAL_RESULT="$(BCRESULT)" \
-                               PACK_LIB=yes make_deps=yes
-pabc:  pack-byte-code
-
-# packs native-code objects
-pack-native-code:              $(PRE_TARGETS)
-                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
-                               $(NCRESULT).cmx $(NCRESULT).o \
-                               REAL_RESULT="$(NCRESULT)" \
-                               REAL_OCAMLC="$(OCAMLOPT)" \
-                               PACK_LIB=yes make_deps=yes
-panc:  pack-native-code
-
-# generates HTML-documentation
-htdoc: $(DOC_DIR)/$(RESULT)/html/index.html
-
-# generates Latex-documentation
-ladoc: $(DOC_DIR)/$(RESULT)/latex/doc.tex
-
-# generates PostScript-documentation
-psdoc: $(DOC_DIR)/$(RESULT)/latex/doc.ps
-
-# generates PDF-documentation
-pdfdoc:        $(DOC_DIR)/$(RESULT)/latex/doc.pdf
-
-# generates all supported forms of documentation
-doc: htdoc ladoc psdoc pdfdoc
-
-###########################################################################
-# LOW LEVEL RULES
-
-$(REAL_RESULT):                $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) $(RESULTDEPS)
-                       $(REAL_OCAMLFIND) $(REAL_OCAMLC) \
-                               $(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
-                               $(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
-                               $(REAL_IMPL)
-
-nolink:                        $(REAL_IMPL_INTF) $(OBJ_LINK)
-
-ifdef WIN32
-$(REAL_RESULT).dll:    $(REAL_IMPL_INTF) $(OBJ_LINK)
-                       $(CAMLIDLDLL) $(CAMLIDLDLLFLAGS) $(OBJ_LINK) $(CLIBS) \
-                               -o $@ $(REAL_IMPL)
-endif
-
-%$(TOPSUFFIX):         $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
-                       $(REAL_OCAMLFIND) $(OCAMLMKTOP) \
-                               $(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
-                               $(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
-                               $(REAL_IMPL)
-
-.SUFFIXES:             .mli .ml .cmi .cmo .cmx .cma .cmxa .$(EXT_OBJ) \
-                        .mly .di .d .$(EXT_LIB) .idl %.oxridl .c .m .$(EXT_CXX) .h .so \
-                        .rep .zog .glade
-
-ifndef STATIC
-ifdef MINGW
-$(DLLSONAME):          $(OBJ_LINK)
-                       $(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
-                       -Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
-                        $(OCAMLLIBPATH)/ocamlrun.a \
-                       -Wl,--export-all-symbols \
-                       -Wl,--no-whole-archive
-else
-ifdef MSVC
-$(DLLSONAME):          $(OBJ_LINK)
-                       link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
-                        $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
-                        $(OCAMLLIBPATH)/ocamlrun.lib
-
-else
-$(DLLSONAME):          $(OBJ_LINK)
-                       $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \
-                               -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) $(CFRAMEWORKS:%=-framework %) \
-                               $(OCAMLMKLIB_FLAGS)
-endif
-endif
-endif
-
-ifndef LIB_PACK_NAME
-$(RESULT).cma:         $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
-                       $(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) $(OBJS_LIBS) -o $@ $(REAL_IMPL)
-
-$(RESULT).cmxa $(RESULT).$(EXT_LIB):   $(REAL_IMPL_INTF) $(EXTRADEPS) $(RESULTDEPS)
-                       $(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) -o $@ $(REAL_IMPL)
-else
-ifdef BYTE_OCAML
-$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF)
-                       $(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(OCAMLLDFLAGS) $(REAL_IMPL)
-else
-$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF)
-                       $(REAL_OCAMLFIND) $(OCAMLOPT) -pack -o $(LIB_PACK_NAME).cmx  $(OCAMLLDFLAGS) $(REAL_IMPL)
-endif
-
-$(RESULT).cma:         $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
-                       $(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) $(OBJS_LIBS) -o $@ $(LIB_PACK_NAME).cmo
-
-$(RESULT).cmxa $(RESULT).$(EXT_LIB):   $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx $(EXTRADEPS) $(RESULTDEPS)
-                       $(REAL_OCAMLFIND) $(OCAMLOPT) -a $(filter-out -custom, $(ALL_LDFLAGS)) $(OBJS_LIBS) -o $@ $(LIB_PACK_NAME).cmx
-endif
-
-$(RES_CLIB):           $(OBJ_LINK)
-ifndef MSVC
-  ifneq ($(strip $(OBJ_LINK)),)
-                     $(AR) rcs $@ $(OBJ_LINK)
-  endif
-else
-  ifneq ($(strip $(OBJ_LINK)),)
-                       lib -nologo -debugtype:cv -out:$(RES_CLIB) $(OBJ_LINK)
-  endif
-endif
-
-.mli.cmi: $(EXTRADEPS)
-                       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
-                       if [ -z "$$pp" ]; then \
-                         $(ECHO) $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c $(THREAD_FLAG) $(ANNOT_FLAG) \
-                               $(OCAMLFLAGS) $(INCFLAGS) $<; \
-                         $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c $(THREAD_FLAG) $(ANNOT_FLAG) \
-                               $(OCAMLFLAGS) $(INCFLAGS) $<; \
-                       else \
-                           $(ECHO) $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c -pp \"$$pp $(PPFLAGS)\" $(THREAD_FLAG) $(ANNOT_FLAG) \
-                               $(OCAMLFLAGS) $(INCFLAGS) $<; \
-                           $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c -pp "$$pp $(PPFLAGS)" $(THREAD_FLAG) $(ANNOT_FLAG) \
-                               $(OCAMLFLAGS) $(INCFLAGS) $<; \
-                       fi
-
-.ml.cmi .ml.$(EXT_OBJ) .ml.cmx .ml.cmo: $(EXTRADEPS)
-                       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
-                       if [ -z "$$pp" ]; then \
-                         $(ECHO) $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c $(ALL_OCAMLCFLAGS) $<; \
-                         $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c $(ALL_OCAMLCFLAGS) $<; \
-                       else \
-                         $(ECHO) $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c -pp \"$$pp $(PPFLAGS)\" $(ALL_OCAMLCFLAGS) $<; \
-                         $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
-                               -c -pp "$$pp $(PPFLAGS)" $(ALL_OCAMLCFLAGS) $<; \
-                       fi
-
-ifdef PACK_LIB
-$(REAL_RESULT).cmo $(REAL_RESULT).cmx $(REAL_RESULT).o: $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
-                       $(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack $(ALL_LDFLAGS) \
-                               $(OBJS_LIBS) -o $@ $(REAL_IMPL)
-endif
-
-.PRECIOUS:             %.ml
-%.ml:                  %.mll
-                       $(OCAMLLEX) $(LFLAGS) $<
-
-.PRECIOUS:              %.ml %.mli
-%.ml %.mli:             %.mly
-                       $(OCAMLYACC) $(YFLAGS) $<
-                       $(QUIET)pp=`sed -n -e 's/.*(\*pp \([^*]*\) \*).*/\1/p;q' $<`; \
-                       if [ ! -z "$$pp" ]; then \
-                         mv $*.ml $*.ml.temporary; \
-                         echo "(*pp $$pp $(PPFLAGS)*)" > $*.ml; \
-                         cat $*.ml.temporary >> $*.ml; \
-                         rm $*.ml.temporary; \
-                         mv $*.mli $*.mli.temporary; \
-                         echo "(*pp $$pp $(PPFLAGS)*)" > $*.mli; \
-                         cat $*.mli.temporary >> $*.mli; \
-                         rm $*.mli.temporary; \
-                       fi
-
-
-.PRECIOUS:             %.ml
-%.ml:                  %.rep
-                       $(CAMELEON_REPORT) $(CAMELEON_REPORT_FLAGS) -gen $<
-
-.PRECIOUS:             %.ml
-%.ml:                  %.zog
-                       $(CAMELEON_ZOGGY)  $(CAMELEON_ZOGGY_FLAGS) -impl $< > $@
-
-.PRECIOUS:             %.ml
-%.ml:                  %.glade
-                       $(OCAML_GLADECC)  $(OCAML_GLADECC_FLAGS) $< > $@
-
-.PRECIOUS:             %.ml %.mli
-%.ml %.mli:            %.oxridl
-                       $(OXRIDL) $<
-
-.PRECIOUS:             %.ml %.mli %_stubs.c %.h
-%.ml %.mli %_stubs.c %.h:              %.idl
-                       $(CAMLIDL) $(MAYBE_IDL_HEADER) $(IDLFLAGS) \
-                               $(CAMLIDLFLAGS) $<
-                       $(QUIET)if [ $(NOIDLHEADER) ]; then touch $*.h; fi
-
-.c.$(EXT_OBJ):
-                       $(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \
-                               $(CPPFLAGS) $(CPPFLAGS_WIN32) \
-                               $(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $<
-
-.m.$(EXT_OBJ):
-                       $(CC) -c $(CFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
-                               -I'$(OCAMLLIBPATH)' \
-                               $< $(CFLAG_O)$@
-
-.$(EXT_CXX).$(EXT_OBJ):
-                       $(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
-                               -I'$(OCAMLLIBPATH)' \
-                               $< $(CFLAG_O)$@
-
-$(MLDEPDIR)/%.d:       %.ml
-                       $(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
-                       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
-                       if [ -z "$$pp" ]; then \
-                         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
-                               $(DINCFLAGS) $< \> $@; \
-                         $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
-                               $(DINCFLAGS) $< > $@; \
-                       else \
-                         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
-                               -pp \"$$pp $(PPFLAGS)\" $(DINCFLAGS) $< \> $@; \
-                         $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
-                               -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
-                       fi
-
-$(BCDIDIR)/%.di $(NCDIDIR)/%.di:       %.mli
-                       $(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
-                       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
-                       if [ -z "$$pp" ]; then \
-                         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< \> $@; \
-                         $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< > $@; \
-                       else \
-                         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
-                           -pp \"$$pp $(PPFLAGS)\" $(DINCFLAGS) $< \> $@; \
-                         $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
-                           -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
-                       fi
-
-$(DOC_DIR)/$(RESULT)/html:
-       mkdir -p $@
-
-$(DOC_DIR)/$(RESULT)/html/index.html: $(DOC_DIR)/$(RESULT)/html $(DOC_FILES)
-       rm -rf $</*
-       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $(FIRST_DOC_FILE)`; \
-       if [ -z "$$pp" ]; then \
-         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -html -d $< $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
-         $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -html -d $< $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
-       else \
-         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp \"$$pp $(PPFLAGS)\" -html -d $< $(OCAMLDOCFLAGS) \
-               $(INCFLAGS) $(DOC_FILES); \
-         $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp "$$pp $(PPFLAGS)" -html -d $< $(OCAMLDOCFLAGS) \
-               $(INCFLAGS) $(DOC_FILES); \
-       fi
-
-$(DOC_DIR)/$(RESULT)/latex:
-       mkdir -p $@
-
-$(DOC_DIR)/$(RESULT)/latex/doc.tex: $(DOC_DIR)/$(RESULT)/latex $(DOC_FILES)
-       rm -rf $</*
-       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $(FIRST_DOC_FILE)`; \
-       if [ -z "$$pp" ]; then \
-         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) \
-               $(DOC_FILES) -o $@; \
-         $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES) \
-               -o $@; \
-       else \
-         $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp \"$$pp $(PPFLAGS)\" -latex $(OCAMLDOCFLAGS) \
-               $(INCFLAGS) $(DOC_FILES) -o $@; \
-         $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp "$$pp $(PPFLAGS)" -latex $(OCAMLDOCFLAGS) \
-               $(INCFLAGS) $(DOC_FILES) -o $@; \
-       fi
-
-$(DOC_DIR)/$(RESULT)/latex/doc.ps: $(DOC_DIR)/$(RESULT)/latex/doc.tex
-       cd $(DOC_DIR)/$(RESULT)/latex && \
-         $(LATEX) doc.tex && \
-         $(LATEX) doc.tex && \
-         $(DVIPS) $(DVIPSFLAGS) doc.dvi -o $(@F)
-
-$(DOC_DIR)/$(RESULT)/latex/doc.pdf: $(DOC_DIR)/$(RESULT)/latex/doc.ps
-       cd $(DOC_DIR)/$(RESULT)/latex && $(PS2PDF) $(<F)
-
-define make_subproj
-.PHONY:
-subproj_$(1):
-       $$(eval $$(call PROJ_$(1)))
-       $(QUIET)if [ "$(SUBTARGET)" != "all" ]; then \
-         $(MAKE) -f $(OCAMLMAKEFILE) $(SUBTARGET); \
-       fi
-endef
-
-$(foreach subproj,$(SUBPROJS),$(eval $(call make_subproj,$(subproj))))
-
-.PHONY:
-subprojs: $(SUBPROJS:%=subproj_%)
-
-###########################################################################
-# (UN)INSTALL RULES FOR LIBRARIES
-
-.PHONY: libinstall
-libinstall:    all
-       $(QUIET)printf "\nInstalling library with ocamlfind\n"
-       $(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META $(LIBINSTALL_FILES)
-       $(QUIET)printf "\nInstallation successful.\n"
-
-.PHONY: libinstall-byte-code
-libinstall-byte-code:  all
-       $(QUIET)printf "\nInstalling byte-code library with ocamlfind\n"
-       $(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META \
-         $(filter-out $(RESULT).$(EXT_LIB) $(RESULT).cmxa, $(LIBINSTALL_FILES))
-       $(QUIET)printf "\nInstallation successful.\n"
-
-.PHONY: libinstall-native-code
-libinstall-native-code:        all
-       $(QUIET)printf "\nInstalling native-code library with ocamlfind\n"
-       $(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META \
-         $(filter-out $(DLLSONAME) $(RESULT).cma, $(LIBINSTALL_FILES))
-       $(QUIET)printf "\nInstallation successful.\n"
-
-.PHONY: libuninstall
-libuninstall:
-       $(QUIET)printf "\nUninstalling library with ocamlfind\n"
-       $(OCAMLFIND) remove $(OCAMLFIND_INSTFLAGS) $(RESULT)
-       $(QUIET)printf "\nUninstallation successful.\n"
-
-.PHONY: rawinstall
-rawinstall:    all
-       $(QUIET)printf "\nInstalling library to: $(OCAML_LIB_INSTALL)\n"
-       -install -d $(OCAML_LIB_INSTALL)
-       for i in $(LIBINSTALL_FILES); do \
-         if [ -f $$i ]; then \
-           install -c -m 0644 $$i $(OCAML_LIB_INSTALL); \
-         fi; \
-       done
-       $(QUIET)printf "\nInstallation successful.\n"
-
-.PHONY: rawuninstall
-rawuninstall:
-       $(QUIET)printf "\nUninstalling library from: $(OCAML_LIB_INSTALL)\n"
-       cd $(OCAML_LIB_INSTALL) && rm $(notdir $(LIBINSTALL_FILES))
-       $(QUIET)printf "\nUninstallation successful.\n"
-
-###########################################################################
-# MAINTENANCE RULES
-
-.PHONY:        clean
-clean::
-       rm -f $(TARGETS) $(TRASH)
-       rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
-
-.PHONY:        cleanup
-cleanup::
-       rm -f $(NONEXECS) $(TRASH)
-       rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
-
-.PHONY: clean-doc
-clean-doc::
-       rm -rf $(DOC_DIR)/$(RESULT)
-
-.PHONY: clean-all
-clean-all:: clean clean-doc
-
-.PHONY: nobackup
-nobackup:
-       rm -f *.bak *~ *.dup
diff --git a/pycaml/acinclude.m4 b/pycaml/acinclude.m4
deleted file mode 100644 (file)
index 0f993c8..0000000
+++ /dev/null
@@ -1,3724 +0,0 @@
-AC_DEFUN(AM_PATH_PYTHON,
-[
-AC_ARG_WITH(python-prefix,[  --with-python-prefix=PFX   Prefix where Python is installed (optional)],
-            python_prefix="$withval"
-            PYPACKAGE=""
-            if test -e "$python_prefix/bin/python" ; then
-              PYPACKAGE="$python_prefix/bin/python"
-            fi,
-            PYPACKAGE="")
-]
-)
-
-dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
-dnl
-AC_DEFUN(AC_CHECK_FT2,
-[dnl
-dnl Get the cflags and libraries from the freetype-config script
-dnl
-AC_ARG_WITH(ft-prefix, [  --with-ft-prefix=PFX   Prefix where FreeType is installed (optional)],
-    ft_config_prefix="$withval", ft_config_prefix="")
-AC_ARG_WITH(ft-exec-prefix, [  --with-ft-exec-prefix=PFX Exec prefix where FreeType is installed (optional)],
-    ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
-AC_ARG_ENABLE(freetypetest, [  --disable-freetypetest Do not try to compile and run a FreeType test],
-    , enable_fttest=yes)
-
-if test x$ft_config_exec_prefix != x ; then
-  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
-  fi
-fi
-if test x$ft_config_prefix != x ; then
-  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
-  fi
-fi
-
-AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
-min_ft_version=ifelse([$1], ,6.1.0,$1)
-
-AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
-no_ft=""
-if test "$FT2_CONFIG" = "no" ; then
-  no_ft=yes
-else
-  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
-  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
-  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-  ft_min_major_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-  ft_min_minor_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-  ft_min_micro_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-  if test x$enable_fttest = xyes ; then
-    ft_config_is_lt=""
-    if test $ft_config_major_version -lt $ft_min_major_version ; then
-      ft_config_is_lt=yes
-    else
-      if test $ft_config_major_version -eq $ft_min_major_version ; then
-        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
-          ft_config_is_lt=yes
-        else
-          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
-            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
-              ft_config_is_lt=yes
-            fi
-          fi
-        fi
-      fi
-    fi
-    if test x$ft_config_is_lt = xyes ; then
-      no_ft=yes
-    else
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $FT2_CFLAGS"
-      LIBS="$FT2_LIBS $LIBS"
-dnl
-dnl Sanity checks for the results of freetype-config to some extent
-dnl
-      AC_TRY_RUN([
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main()
-{
-  FT_Library library;
-  FT_Error error;
-
-  error = FT_Init_FreeType(&library);
-
-  if (error)
-    return 1;
-  else
-  {
-    FT_Done_FreeType(library);
-    return 0;
-  }
-}
-],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-      CFLAGS="$ac_save_CFLAGS"
-      LIBS="$ac_save_LIBS"
-    fi             # test $ft_config_version -lt $ft_min_version
-  fi               # test x$enable_fttest = xyes
-fi                 # test "$FT2_CONFIG" = "no"
-if test x$no_ft = x ; then
-   AC_MSG_RESULT(yes)
-   ifelse([$2], , :, [$2])
-else
-   AC_MSG_RESULT(no)
-   if test "$FT2_CONFIG" = "no" ; then
-     echo "*** The freetype-config script installed by FreeType 2 could not be found."
-     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
-     echo "*** your path, or set the FT2_CONFIG environment variable to the"
-     echo "*** full path to freetype-config."
-   else
-     if test x$ft_config_is_lt = xyes ; then
-       echo "*** Your installed version of the FreeType 2 library is too old."
-       echo "*** If you have different versions of FreeType 2, make sure that"
-       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
-       echo "*** are used, or set the FT2_CONFIG environment variable to the"
-       echo "*** full path to freetype-config."
-     else
-       echo "*** The FreeType test program failed to run.  If your system uses"
-       echo "*** shared libraries and they are installed outside the normal"
-       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
-       echo "*** (or whatever is appropiate for your system) is correctly set."
-     fi
-   fi
-   FT2_CFLAGS=""
-   FT2_LIBS=""
-   ifelse([$3], , :, [$3])
-fi
-AC_SUBST(FT2_CFLAGS)
-AC_SUBST(FT2_LIBS)
-])
-
-# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-##
-## As a special exception to the GNU General Public License, if you
-## distribute this file as part of a program that contains a
-## configuration script generated by Autoconf, you may include it under
-## the same distribution terms that you use for the rest of that program.
-
-# serial 46 AC_PROG_LIBTOOL
-
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])
-
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-_LT_AC_PROG_ECHO_BACKSLASH
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE(libtool-lock,
-  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_SAVE
-     AC_LANG_C
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_RESTORE])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
-  # recent cygwin and mingw systems supply a stub DllMain which the user
-  # can override, but on older systems we have to supply one
-  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
-    [AC_TRY_LINK([],
-      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
-      DllMain (0, 0, 0);],
-      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
-  case $host/$CC in
-  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
-    # old mingw systems require "-dll" to link a DLL, while more recent ones
-    # require "-mdll"
-    SAVE_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -mdll"
-    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
-      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
-    CFLAGS="$SAVE_CFLAGS" ;;
-  *-*-cygwin* | *-*-pw32*)
-    # cygwin systems need to pass --dll to the linker, and not link
-    # crt.o which will require a WinMain@16 definition.
-    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
-  esac
-  ;;
-  ])
-esac
-
-_LT_AC_LTCONFIG_HACK
-
-])
-
-# AC_LIBTOOL_HEADER_ASSERT
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
-[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
-    [lt_cv_func_assert_works],
-    [case $host in
-    *-*-solaris*)
-      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
-        case `$CC --version 2>/dev/null` in
-        [[12]].*) lt_cv_func_assert_works=no ;;
-        *)        lt_cv_func_assert_works=yes ;;
-        esac
-      fi
-      ;;
-    esac])
-
-if test "x$lt_cv_func_assert_works" = xyes; then
-  AC_CHECK_HEADERS(assert.h)
-fi
-])# AC_LIBTOOL_HEADER_ASSERT
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)
-])# _LT_AC_CHECK_DLFCN
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-solaris* | sysv5*)
-  symcode='[[BDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $host_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
-  symcode='[[ABCDGISTW]]'
-fi
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Write the raw and C identifiers.
-lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[       ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
-       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
-
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-         sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         save_LIBS="$LIBS"
-         save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$no_builtin_flag"
-         if AC_TRY_EVAL(ac_link) && test -s conftest; then
-           pipe_works=yes
-         fi
-         LIBS="$save_LIBS"
-         CFLAGS="$save_CFLAGS"
-       else
-         echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
-    fi
-  else
-    echo "$progname: failed program was:" >&AC_FD_CC
-    cat conftest.$ac_ext >&5
-  fi
-  rm -f conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  global_symbol_to_cdecl=
-  global_symbol_to_c_name_address=
-else
-  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
-  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
-fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
-then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-# ---------------------------------
-AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
-[# Find the correct PATH separator.  Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
-  UNAME=${UNAME-`uname 2>/dev/null`}
-  case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
-    *)     lt_cv_sys_path_separator=':' ;;
-  esac
-  PATH_SEPARATOR=$lt_cv_sys_path_separator
-fi
-])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-                             [AC_DIVERT_PUSH(NOTICE)])
-_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  IFS="${IFS=  }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
-
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
-
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
-       fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-AC_DIVERT_POP
-])# _LT_AC_PROG_ECHO_BACKSLASH
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}]
-EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-          [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-AC_DEFUN([_LT_AC_LTCONFIG_HACK],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-need_locks="$enable_libtool_lock"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-if test x"$host" != x"$build"; then
-  ac_tool_prefix=${host_alias}-
-else
-  ac_tool_prefix=
-fi
-
-# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
-case $host_os in
-linux-gnu*) ;;
-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
-esac
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-# Allow CC to be a program name with arguments.
-set dummy $CC
-compiler="[$]2"
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([for objdir])
-rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-AC_MSG_RESULT($objdir)
-##
-## END FIXME
-
-
-## FIXME: this should be a separate macro
-##
-AC_ARG_WITH(pic,
-[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
-pic_mode="$withval", pic_mode=default)
-test -z "$pic_mode" && pic_mode=default
-
-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
-# in isolation, and that seeing it set (from the cache) indicates that
-# the associated values are set (in the cache) correctly too.
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-AC_CACHE_VAL(lt_cv_prog_cc_pic,
-[ lt_cv_prog_cc_pic=
-  lt_cv_prog_cc_shlib=
-  lt_cv_prog_cc_wl=
-  lt_cv_prog_cc_static=
-  lt_cv_prog_cc_no_builtin=
-  lt_cv_prog_cc_can_build_shared=$can_build_shared
-
-  if test "$GCC" = yes; then
-    lt_cv_prog_cc_wl='-Wl,'
-    lt_cv_prog_cc_static='-static'
-
-    case $host_os in
-    aix*)
-      # Below there is a dirty hack to force normal static linking with -ldl
-      # The problem is because libdl dynamically linked with both libc and
-      # libC (AIX C++ library), which obviously doesn't included in libraries
-      # list by gcc. This cause undefined symbols with -static flags.
-      # This hack allows C programs to be linked with "-static -ldl", but
-      # not sure about C++ programs.
-      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_cv_prog_cc_pic='-fno-common'
-      ;;
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-        lt_cv_prog_cc_pic=-Kconform_pic
-      fi
-      ;;
-    *)
-      lt_cv_prog_cc_pic='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for PIC flags for the system compiler.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      lt_cv_prog_cc_wl='-Wl,'
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_cv_prog_cc_static='-Bstatic'
-      else
-       lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
-      lt_cv_prog_cc_pic='+Z'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      # PIC (with -KPIC) is the default.
-      ;;
-
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
-
-    newsos6)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      # All OSF/1 code is PIC.
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      ;;
-
-    sco3.2v5*)
-      lt_cv_prog_cc_pic='-Kpic'
-      lt_cv_prog_cc_static='-dn'
-      lt_cv_prog_cc_shlib='-belf'
-      ;;
-
-    solaris*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
-      ;;
-
-    sunos4*)
-      lt_cv_prog_cc_pic='-PIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Qoption ld '
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      if test "x$host_vendor" = xsni; then
-       lt_cv_prog_cc_wl='-LD'
-      else
-       lt_cv_prog_cc_wl='-Wl,'
-      fi
-      ;;
-
-    uts4*)
-      lt_cv_prog_cc_pic='-pic'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_cv_prog_cc_pic='-Kconform_pic'
-       lt_cv_prog_cc_static='-Bstatic'
-      fi
-      ;;
-
-    *)
-      lt_cv_prog_cc_can_build_shared=no
-      ;;
-    esac
-  fi
-])
-if test -z "$lt_cv_prog_cc_pic"; then
-  AC_MSG_RESULT([none])
-else
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
-
-  # Check to make sure the pic_flag actually works.
-  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
-  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
-    AC_TRY_COMPILE([], [], [dnl
-      case $host_os in
-      hpux9* | hpux10* | hpux11*)
-       # On HP-UX, both CC and GCC only warn that PIC is supported... then
-       # they create non-PIC objects.  So, if there were any warnings, we
-       # assume that PIC is not supported.
-       if test -s conftest.err; then
-         lt_cv_prog_cc_pic_works=no
-       else
-         lt_cv_prog_cc_pic_works=yes
-       fi
-       ;;
-      *)
-       lt_cv_prog_cc_pic_works=yes
-       ;;
-      esac
-    ], [dnl
-      lt_cv_prog_cc_pic_works=no
-    ])
-    CFLAGS="$save_CFLAGS"
-  ])
-
-  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
-    lt_cv_prog_cc_pic=
-    lt_cv_prog_cc_can_build_shared=no
-  else
-    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
-  fi
-
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
-fi
-##
-## END FIXME
-
-# Check for any special shared library compilation flags.
-if test -n "$lt_cv_prog_cc_shlib"; then
-  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | egrep -e "[[        ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
-  else
-   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
-AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
-  lt_cv_prog_cc_static_works=no
-  save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
-  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
-  LDFLAGS="$save_LDFLAGS"
-])
-
-# Belt *and* braces to stop my trousers falling down:
-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
-AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
-
-pic_flag="$lt_cv_prog_cc_pic"
-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
-wl="$lt_cv_prog_cc_wl"
-link_static_flag="$lt_cv_prog_cc_static"
-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
-can_build_shared="$lt_cv_prog_cc_can_build_shared"
-##
-## END FIXME
-
-
-## FIXME: this should be a separate macro
-##
-# Check to see if options -o and -c are simultaneously supported by compiler
-AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
-AC_CACHE_VAL([lt_cv_compiler_c_o], [
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-echo "int some_variable = 0;" > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory.  Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
-compiler_c_o=no
-if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
-  # The compiler can only warn and ignore the option if not recognized
-  # So say no if there are warnings
-  if test -s out/conftest.err; then
-    lt_cv_compiler_c_o=no
-  else
-    lt_cv_compiler_c_o=yes
-  fi
-else
-  # Append any errors to the config.log.
-  cat out/conftest.err 1>&AC_FD_CC
-  lt_cv_compiler_c_o=no
-fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
-])
-compiler_c_o=$lt_cv_compiler_c_o
-AC_MSG_RESULT([$compiler_c_o])
-
-if test x"$compiler_c_o" = x"yes"; then
-  # Check to see if we can write to a .lo
-  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
-  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
-  lt_cv_compiler_o_lo=no
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -c -o conftest.lo"
-  save_objext="$ac_objext"
-  ac_objext=lo
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      lt_cv_compiler_o_lo=no
-    else
-      lt_cv_compiler_o_lo=yes
-    fi
-  ])
-  ac_objext="$save_objext"
-  CFLAGS="$save_CFLAGS"
-  ])
-  compiler_o_lo=$lt_cv_compiler_o_lo
-  AC_MSG_RESULT([$compiler_o_lo])
-else
-  compiler_o_lo=no
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Check to see if we can do hard links to lock some files if needed
-hard_links="nottested"
-if test "$compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-if test "$GCC" = yes; then
-  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
-  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
-  compiler_rtti_exceptions=no
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      compiler_rtti_exceptions=no
-    else
-      compiler_rtti_exceptions=yes
-    fi
-  ])
-  CFLAGS="$save_CFLAGS"
-  AC_MSG_RESULT([$compiler_rtti_exceptions])
-
-  if test "$compiler_rtti_exceptions" = "yes"; then
-    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
-  else
-    no_builtin_flag=' -fno-builtin'
-  fi
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# See if the linker supports building shared libraries.
-AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
-
-allow_undefined_flag=
-no_undefined_flag=
-need_lib_prefix=unknown
-need_version=unknown
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-archive_cmds=
-archive_expsym_cmds=
-old_archive_from_new_cmds=
-old_archive_from_expsyms_cmds=
-export_dynamic_flag_spec=
-whole_archive_flag_spec=
-thread_safe_flag_spec=
-hardcode_into_libs=no
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-hardcode_shlibpath_var=unsupported
-runpath_var=
-link_all_deplibs=unknown
-always_export_symbols=no
-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
-# include_expsyms should be a list of space-separated symbols to be *always*
-# included in the symbol list
-include_expsyms=
-# exclude_expsyms can be an egrep regular expression of symbols to exclude
-# it will be wrapped by ` (' and `)$', so one must not match beginning or
-# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-# as well as any symbol that contains `d'.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-# platforms (ab)use it in PIC code, but their linkers get confused if
-# the symbol is explicitly referenced.  Since portable code cannot
-# rely on this symbol name, it's probably fine to never include it in
-# preloaded symbol tables.
-extract_expsyms_cmds=
-
-case $host_os in
-cygwin* | mingw* | pw32*)
-  # FIXME: the MSVC++ port hasn't been tested in a loooong time
-  # When not using gcc, we currently assume that we are using
-  # Microsoft Visual C++.
-  if test "$GCC" != yes; then
-    with_gnu_ld=no
-  fi
-  ;;
-openbsd*)
-  with_gnu_ld=no
-  ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  # If archive_cmds runs LD, not CC, wlarc should be empty
-  wlarc='${wl}'
-
-  # See if GNU ld supports shared libraries.
-  case $host_os in
-  aix3* | aix4* | aix5*)
-    # On AIX, the GNU linker is very broken
-    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
-    ld_shlibs=no
-    cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-    ;;
-
-  amigaos*)
-    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-
-    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-    # that the semantics of dynamic libraries on AmigaOS, at least up
-    # to version 4, is to share data among multiple programs linked
-    # with the same dynamic library.  Since this doesn't match the
-    # behavior of shared libraries on other platforms, we can use
-    # them.
-    ld_shlibs=no
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag=unsupported
-      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec='-L$libdir'
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-
-    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
-      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
-      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
-      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
-      else $CC -o impgen impgen.c ; fi)~
-      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
-
-    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
-
-    # cygwin and mingw dlls have different entry points and sets of symbols
-    # to exclude.
-    # FIXME: what about values for MSVC?
-    dll_entry=__cygwin_dll_entry@12
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
-    case $host_os in
-    mingw*)
-      # mingw values
-      dll_entry=_DllMainCRTStartup@12
-      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
-      ;;
-    esac
-
-    # mingw and cygwin differ, and it's simplest to just exclude the union
-    # of the two symbol sets.
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
-
-    # recent cygwin and mingw systems supply a stub DllMain which the user
-    # can override, but on older systems we have to supply one (in ltdll.c)
-    if test "x$lt_cv_need_dllmain" = "xyes"; then
-      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
-      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
-       test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
-    else
-      ltdll_obj=
-      ltdll_cmds=
-    fi
-
-    # Extract the symbol export list from an `--export-all' def file,
-    # then regenerate the def file from the symbol export list, so that
-    # the compiled dll only exports the symbol export list.
-    # Be careful not to strip the DATA tag left be newer dlltools.
-    export_symbols_cmds="$ltdll_cmds"'
-      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
-      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
-
-    # If the export-symbols file already is a .def file (1st line
-    # is EXPORTS), use it as is.
-    # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
-       cp $export_symbols $output_objdir/$soname-def;
-      else
-       echo EXPORTS > $output_objdir/$soname-def;
-       _lt_hint=1;
-       cat $export_symbols | while read symbol; do
-        set dummy \$symbol;
-        case \[$]# in
-          2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
-          *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
-        esac;
-        _lt_hint=`expr 1 + \$_lt_hint`;
-       done;
-      fi~
-      '"$ltdll_cmds"'
-      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
-      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
-      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
-    ;;
-
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-      wlarc=
-    else
-      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    fi
-    ;;
-
-  solaris* | sysv5*)
-    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-      ld_shlibs=no
-      cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
-  sunos4*)
-    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    wlarc=
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  *)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-  esac
-
-  if test "$ld_shlibs" = yes; then
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    case $host_os in
-    cygwin* | mingw* | pw32*)
-      # dlltool doesn't understand --whole-archive et. al.
-      whole_archive_flag_spec=
-      ;;
-    *)
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
-       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec=
-      fi
-      ;;
-    esac
-  fi
-else
-  # PORTME fill in a description of your system's linker (not GNU ld)
-  case $host_os in
-  aix3*)
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-    # Note: this linker hardcodes the directories in LIBPATH if there
-    # are no directories specified by -L.
-    hardcode_minus_L=yes
-    if test "$GCC" = yes && test -z "$link_static_flag"; then
-      # Neither direct hardcoding nor static linking is supported with a
-      # broken collect2.
-      hardcode_direct=unsupported
-    fi
-    ;;
-
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-       done
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    hardcode_direct=yes
-    archive_cmds=''
-    hardcode_libdir_separator=':'
-    if test "$GCC" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       collect2name=`${CC} -print-prog-name=collect2`
-       if test -f "$collect2name" && \
-         strings "$collect2name" | grep resolve_lib_name >/dev/null
-       then
-         # We have reworked collect2
-         hardcode_direct=yes
-       else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-       fi
-      esac
-
-      shared_flag='-shared'
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-       shared_flag='${wl}-G'
-      else
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag='${wl}-G'
-       else
-         shared_flag='${wl}-bM:SRE'
-       fi
-      fi
-    fi
-
-    # It seems that -bexpall can do strange things, so it is better to
-    # generate a list of symbols to export.
-    always_export_symbols=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag='-berok'
-      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
-      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-    else
-      if test "$host_cpu" = ia64; then
-       hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-       allow_undefined_flag="-z nodefs"
-       archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
-       # Warning - without using the other run time loading flags,
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='${wl}-berok'
-       # This is a bit strange, but is similar to how AIX traditionally builds
-       # it's shared libraries.
-       archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
-      fi
-    fi
-    ;;
-
-  amigaos*)
-    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    # see comment about different semantics on the GNU ld section
-    ld_shlibs=no
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec=' '
-    allow_undefined_flag=unsupported
-    # Tell ltmain to make .lib files, not .a files.
-    libext=lib
-    # FIXME: Setting linknames here is a bad hack.
-    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-    # The linker will automatically build a .lib file if we build a DLL.
-    old_archive_from_new_cmds='true'
-    # FIXME: Should let the user specify the lib program.
-    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
-    fix_srcfile_path='`cygpath -w "$srcfile"`'
-    ;;
-
-  darwin* | rhapsody*)
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      allow_undefined_flag='-flat_namespace -undefined suppress'
-      ;;
-    esac
-    # FIXME: Relying on posixy $() will cause problems for
-    #        cross-compilation, but unfortunately the echo tests do not
-    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
-    #       `"' quotes if we put them in here... so don't!
-    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
-    # We need to add '_' to the symbols in $export_symbols first
-    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    whole_archive_flag_spec='-all_load $convenience'
-    ;;
-
-  freebsd1*)
-    ld_shlibs=no
-    ;;
-
-  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-  # support.  Future versions do this automatically, but an explicit c++rt0.o
-  # does not break anything, and helps significantly (at the cost of a little
-  # extra space).
-  freebsd2.2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-  freebsd2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-  freebsd*)
-    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  hpux9* | hpux10* | hpux11*)
-    case $host_os in
-    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
-    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
-    esac
-    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_direct=yes
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-                        # location of the library.
-    export_dynamic_flag_spec='${wl}-E'
-    ;;
-
-  irix5* | irix6* | nonstopux*)
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-    else
-      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    link_all_deplibs=yes
-    ;;
-
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-    else
-      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-    fi
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  newsos6)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_shlibpath_var=no
-    ;;
-
-  openbsd*)
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-    else
-      case "$host_os" in
-      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-        ;;
-      *)
-        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-        ;;
-      esac
-    fi
-    ;;
-
-  os2*)
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    allow_undefined_flag=unsupported
-    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-    ;;
-
-  osf3*)
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    ;;
-
-  osf4* | osf5*)       # as osf3* with the addition of -msym flag
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
-
-      #Both c and cxx compiler support -rpath directly
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    ;;
-
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
-    export_dynamic_flag_spec='${wl}-Bexport'
-    ;;
-
-  solaris*)
-    # gcc --version < 3.0 without binutils cannot create self contained
-    # shared libraries reliably, requiring libgcc.a to resolve some of
-    # the object symbols generated in some cases.  Libraries that use
-    # assert need libgcc.a to resolve __eprintf, for example.  Linking
-    # a copy of libgcc.a into every shared library to guarantee resolving
-    # such symbols causes other problems:  According to Tim Van Holder
-    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
-    # (to the application) exception stack for one thing.
-    no_undefined_flag=' -z defs'
-    if test "$GCC" = yes; then
-      case `$CC --version 2>/dev/null` in
-      [[12]].*)
-       cat <<EOF 1>&2
-
-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
-*** create self contained shared libraries on Solaris systems, without
-*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
-*** -no-undefined support, which will at least allow you to build shared
-*** libraries.  However, you may find that when you link such libraries
-*** into an application without using GCC, you have to manually add
-*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
-*** upgrade to a newer version of GCC.  Another option is to rebuild your
-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
-
-EOF
-        no_undefined_flag=
-       ;;
-      esac
-    fi
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_shlibpath_var=no
-    case $host_os in
-    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
-    esac
-    link_all_deplibs=yes
-    ;;
-
-  sunos4*)
-    if test "x$host_vendor" = xsequent; then
-      # Use $CC to link under sequent, because it throws in some extra .o
-      # files that make .init and .fini sections work.
-      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-    fi
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4)
-    if test "x$host_vendor" = xsno; then
-      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes # is this really true???
-    else
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4.3*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    export_dynamic_flag_spec='-Bexport'
-    ;;
-
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
-
-  uts4*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
-
-  dgux*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4*MP*)
-    if test -d /usr/nec; then
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ld_shlibs=yes
-    fi
-    ;;
-
-  sysv4.2uw2*)
-    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=no
-    hardcode_shlibpath_var=no
-    hardcode_runpath_var=yes
-    runpath_var=LD_RUN_PATH
-    ;;
-
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
-  *)
-    ld_shlibs=no
-    ;;
-  esac
-fi
-AC_MSG_RESULT([$ld_shlibs])
-test "$ld_shlibs" = no && can_build_shared=no
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Check hardcoding attributes.
-AC_MSG_CHECKING([how to hardcode library paths into programs])
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var"; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$hardcode_shlibpath_var" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-AC_MSG_RESULT([$hardcode_action])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
-##
-## END FIXME
-
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-## FIXME: this should be a separate macro
-##
-# PORTME Fill in your ld.so characteristics
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}.so$major'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-            echo ' yes '
-            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-         :
-       else
-         can_build_shared=no
-       fi
-       ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can
-    # not hardcode correct soname into executable. Probably we can
-    # add versioning support to collect2, so additional links can
-    # be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}.so$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}.so'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi4*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  export_dynamic_flag_spec=-rdynamic
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  need_version=no
-  need_lib_prefix=no
-  case $GCC,$host_os in
-  yes,cygwin*)
-    library_names_spec='$libname.dll.a'
-    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog .libs/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    ;;
-  yes,mingw*)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
-    ;;
-  yes,pw32*)
-    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    ;;
-  *)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  # FIXME: Relying on posixy $() will cause problems for
-  #        cross-compilation, but unfortunately the echo tests do not
-  #        yet detect zsh echo's removal of \ escapes.
-  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
-  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  *)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  dynamic_linker="$host_os dld.sl"
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  shlibpath_var=SHLIB_PATH
-  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
-  soname_spec='${libname}${release}.sl$major'
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)          version_type=irix ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
-    soname_spec='${libname}${release}.so$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case "$host_os" in
-    openbsd2.[[89]] | openbsd2.[[89]].*)
-      shlibpath_overrides_runpath=no
-      ;;
-    *)
-      shlibpath_overrides_runpath=yes
-      ;;
-    esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-os2*)
-  libname_spec='$name'
-  need_lib_prefix=no
-  library_names_spec='$libname.dll $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_version=no
-  need_lib_prefix=no
-  soname_spec='${libname}${release}.so'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
-    soname_spec='$libname.so.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Report the final consequences.
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix4*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-##
-## END FIXME
-
-if test "$hardcode_action" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-AC_LIBTOOL_DLOPEN_SELF
-
-## FIXME: this should be a separate macro
-##
-if test "$enable_shared" = yes && test "$GCC" = yes; then
-  case $archive_cmds in
-  *'~'*)
-    # FIXME: we may have to deal with multi-command sequences.
-    ;;
-  '$CC '*)
-    # Test whether the compiler implicitly links with -lc since on some
-    # systems, -lgcc has to come before -lc. If gcc already passes -lc
-    # to ld, don't add -lc before -lgcc.
-    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
-    [$rm conftest*
-    echo 'static int dummy;' > conftest.$ac_ext
-
-    if AC_TRY_EVAL(ac_compile); then
-      soname=conftest
-      lib=conftest
-      libobjs=conftest.$ac_objext
-      deplibs=
-      wl=$lt_cv_prog_cc_wl
-      compiler_flags=-v
-      linker_flags=-v
-      verstring=
-      output_objdir=.
-      libname=conftest
-      save_allow_undefined_flag=$allow_undefined_flag
-      allow_undefined_flag=
-      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-      then
-       lt_cv_archive_cmds_need_lc=no
-      else
-       lt_cv_archive_cmds_need_lc=yes
-      fi
-      allow_undefined_flag=$save_allow_undefined_flag
-    else
-      cat conftest.err 1>&5
-    fi])
-    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
-    ;;
-  esac
-fi
-need_lc=${lt_cv_archive_cmds_need_lc-yes}
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# The second clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  :
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  test -f Makefile && make "$ltmain"
-fi
-
-if test -f "$ltmain"; then
-  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
-  $rm -f "${ofile}T"
-
-  echo creating $ofile
-
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS \
-    AR AR_FLAGS CC LD LN_S NM SHELL \
-    reload_flag reload_cmds wl \
-    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
-    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
-    library_names_spec soname_spec \
-    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
-    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
-    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
-    old_striplib striplib file_magic_cmd export_symbols_cmds \
-    deplibs_check_method allow_undefined_flag no_undefined_flag \
-    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
-    global_symbol_to_c_name_address \
-    hardcode_libdir_flag_spec hardcode_libdir_separator  \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
-
-    case $var in
-    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
-    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  cat <<__EOF__ > "${ofile}T"
-#! $SHELL
-
-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="sed -e s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# The default C compiler.
-CC=$lt_CC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_pic_flag
-pic_mode=$pic_mode
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_compiler_c_o
-
-# Can we write directly to a .lo ?
-compiler_o_lo=$lt_compiler_o_lo
-
-# Must we lock files when doing compilation ?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_link_static_flag
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "${ofile}T"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | os2*)
-    cat <<'EOF' >> "${ofile}T"
-      # This is a source program that is used to create dlls on Windows
-      # Don't remove nor modify the starting and closing comments
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-       # This is a source program that is used to create import libraries
-       # on Windows for dlls which lack them. Don't remove nor modify the
-       # starting and closing comments
-# /* impgen.c starts here */
-# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
-#
-#  This file is part of GNU libtool.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#  */
-#
-# #include <stdio.h>           /* for printf() */
-# #include <unistd.h>          /* for open(), lseek(), read() */
-# #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
-# #include <string.h>          /* for strdup() */
-#
-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
-# #ifndef O_BINARY
-# #define O_BINARY 0
-# #endif
-#
-# static unsigned int
-# pe_get16 (fd, offset)
-#      int fd;
-#      int offset;
-# {
-#   unsigned char b[2];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 2);
-#   return b[0] + (b[1]<<8);
-# }
-#
-# static unsigned int
-# pe_get32 (fd, offset)
-#     int fd;
-#     int offset;
-# {
-#   unsigned char b[4];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 4);
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# static unsigned int
-# pe_as32 (ptr)
-#      void *ptr;
-# {
-#   unsigned char *b = ptr;
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# int
-# main (argc, argv)
-#     int argc;
-#     char *argv[];
-# {
-#     int dll;
-#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-#     unsigned long export_rva, export_size, nsections, secptr, expptr;
-#     unsigned long name_rvas, nexp;
-#     unsigned char *expdata, *erva;
-#     char *filename, *dll_name;
-#
-#     filename = argv[1];
-#
-#     dll = open(filename, O_RDONLY|O_BINARY);
-#     if (dll < 1)
-#      return 1;
-#
-#     dll_name = filename;
-#
-#     for (i=0; filename[i]; i++)
-#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
-#          dll_name = filename + i +1;
-#
-#     pe_header_offset = pe_get32 (dll, 0x3c);
-#     opthdr_ofs = pe_header_offset + 4 + 20;
-#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
-#
-#     if (num_entries < 1) /* no exports */
-#      return 1;
-#
-#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
-#     export_size = pe_get32 (dll, opthdr_ofs + 100);
-#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
-#     secptr = (pe_header_offset + 4 + 20 +
-#            pe_get16 (dll, pe_header_offset + 4 + 16));
-#
-#     expptr = 0;
-#     for (i = 0; i < nsections; i++)
-#     {
-#      char sname[8];
-#      unsigned long secptr1 = secptr + 40 * i;
-#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
-#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
-#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
-#      lseek(dll, secptr1, SEEK_SET);
-#      read(dll, sname, 8);
-#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
-#      {
-#          expptr = fptr + (export_rva - vaddr);
-#          if (export_rva + export_size > vaddr + vsize)
-#              export_size = vsize - (export_rva - vaddr);
-#          break;
-#      }
-#     }
-#
-#     expdata = (unsigned char*)malloc(export_size);
-#     lseek (dll, expptr, SEEK_SET);
-#     read (dll, expdata, export_size);
-#     erva = expdata - export_rva;
-#
-#     nexp = pe_as32 (expdata+24);
-#     name_rvas = pe_as32 (expdata+32);
-#
-#     printf ("EXPORTS\n");
-#     for (i = 0; i<nexp; i++)
-#     {
-#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
-#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
-#     }
-#
-#     return 0;
-# }
-# /* impgen.c ends here */
-
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
-
-  mv -f "${ofile}T" "$ofile" || \
-    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
-  chmod +x "$ofile"
-fi
-##
-## END FIXME
-
-])# _LT_AC_LTCONFIG_HACK
-
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
-
-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
-
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)])
-
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
-
-
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
-])
-
-# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)])
-
-# AC_LIBTOOL_PICMODE - implement the --with-pic flag
-# Usage: AC_LIBTOOL_PICMODE[(MODE)]
-#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
-#   `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)])
-
-
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-])
-
-
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
-AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])
-
-
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])
-
-# AC_PROG_LD_GNU -
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  lt_cv_prog_gnu_ld=yes
-else
-  lt_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])
-
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
-])
-
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependant libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi4*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin* | mingw* | pw32*)
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  case "$host_os" in
-  rhapsody* | darwin1.[[012]])
-    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
-    ;;
-  *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
-    ;;
-  esac
-  ;;
-
-freebsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20*|hpux11*)
-  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-  irix5* | nonstopux*)
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
-    ;;
-  *)
-    case $LD in
-    *-32|*"-32 ") libmagic=32-bit;;
-    *-n32|*"-n32 ") libmagic=N32;;
-    *-64|*"-64 ") libmagic=64-bit;;
-    *) libmagic=never-match;;
-    esac
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
-    ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
-  else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  # this will be overridden with pass_all, but let us keep it just in case
-  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=/lib/libc.so
-  ;;
-
-sysv5uw[[78]]* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  esac
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-])
-
-
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -B"
-       break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -p"
-       break
-      else
-       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
-
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
-  # These system don't have libm
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, main, LIBM="-lm")
-  ;;
-esac
-])
-
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments.  Note that LIBLTDL and LTDLINCL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
-# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
-# with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
-
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
-# with '${top_srcdir}/' (note the single quotes!).  If your package is
-# not flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, main,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
diff --git a/pycaml/aclocal.m4 b/pycaml/aclocal.m4
deleted file mode 100644 (file)
index 72fad3f..0000000
+++ /dev/null
@@ -1,3655 +0,0 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
-
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-AC_DEFUN(AM_PATH_PYTHON,
-[
-AC_ARG_WITH(python-prefix,[  --with-python-prefix=PFX   Prefix where Python is installed (optional)],
-            python_prefix="$withval"
-            PYPACKAGE=""
-            if test -e "$python_prefix/bin/python" ; then
-              PYPACKAGE="$python_prefix/bin/python"
-            fi,
-            PYPACKAGE="")
-]
-)
-
-dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
-dnl
-AC_DEFUN(AC_CHECK_FT2,
-[dnl
-dnl Get the cflags and libraries from the freetype-config script
-dnl
-AC_ARG_WITH(ft-prefix, [  --with-ft-prefix=PFX   Prefix where FreeType is installed (optional)],
-    ft_config_prefix="$withval", ft_config_prefix="")
-AC_ARG_WITH(ft-exec-prefix, [  --with-ft-exec-prefix=PFX Exec prefix where FreeType is installed (optional)],
-    ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
-AC_ARG_ENABLE(freetypetest, [  --disable-freetypetest Do not try to compile and run a FreeType test],
-    , enable_fttest=yes)
-
-if test x$ft_config_exec_prefix != x ; then
-  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
-  fi
-fi
-if test x$ft_config_prefix != x ; then
-  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
-  fi
-fi
-
-AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
-min_ft_version=ifelse([$1], ,6.1.0,$1)
-
-AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
-no_ft=""
-if test "$FT2_CONFIG" = "no" ; then
-  no_ft=yes
-else
-  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
-  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
-  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-  ft_min_major_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-  ft_min_minor_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-  ft_min_micro_version=`echo $min_ft_version | \
-         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-  if test x$enable_fttest = xyes ; then
-    ft_config_is_lt=""
-    if test $ft_config_major_version -lt $ft_min_major_version ; then
-      ft_config_is_lt=yes
-    else
-      if test $ft_config_major_version -eq $ft_min_major_version ; then
-        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
-          ft_config_is_lt=yes
-        else
-          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
-            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
-              ft_config_is_lt=yes
-            fi
-          fi
-        fi
-      fi
-    fi
-    if test x$ft_config_is_lt = xyes ; then
-      no_ft=yes
-    else
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $FT2_CFLAGS"
-      LIBS="$FT2_LIBS $LIBS"
-dnl
-dnl Sanity checks for the results of freetype-config to some extent
-dnl
-      AC_TRY_RUN([
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main()
-{
-  FT_Library library;
-  FT_Error error;
-
-  error = FT_Init_FreeType(&library);
-
-  if (error)
-    return 1;
-  else
-  {
-    FT_Done_FreeType(library);
-    return 0;
-  }
-}
-],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-      CFLAGS="$ac_save_CFLAGS"
-      LIBS="$ac_save_LIBS"
-    fi             # test $ft_config_version -lt $ft_min_version
-  fi               # test x$enable_fttest = xyes
-fi                 # test "$FT2_CONFIG" = "no"
-if test x$no_ft = x ; then
-   AC_MSG_RESULT(yes)
-   ifelse([$2], , :, [$2])
-else
-   AC_MSG_RESULT(no)
-   if test "$FT2_CONFIG" = "no" ; then
-     echo "*** The freetype-config script installed by FreeType 2 could not be found."
-     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
-     echo "*** your path, or set the FT2_CONFIG environment variable to the"
-     echo "*** full path to freetype-config."
-   else
-     if test x$ft_config_is_lt = xyes ; then
-       echo "*** Your installed version of the FreeType 2 library is too old."
-       echo "*** If you have different versions of FreeType 2, make sure that"
-       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
-       echo "*** are used, or set the FT2_CONFIG environment variable to the"
-       echo "*** full path to freetype-config."
-     else
-       echo "*** The FreeType test program failed to run.  If your system uses"
-       echo "*** shared libraries and they are installed outside the normal"
-       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
-       echo "*** (or whatever is appropiate for your system) is correctly set."
-     fi
-   fi
-   FT2_CFLAGS=""
-   FT2_LIBS=""
-   ifelse([$3], , :, [$3])
-fi
-AC_SUBST(FT2_CFLAGS)
-AC_SUBST(FT2_LIBS)
-])
-
-# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-
-# serial 46 AC_PROG_LIBTOOL
-
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])
-
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-_LT_AC_PROG_ECHO_BACKSLASH
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE(libtool-lock,
-  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_SAVE
-     AC_LANG_C
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_RESTORE])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
-  # recent cygwin and mingw systems supply a stub DllMain which the user
-  # can override, but on older systems we have to supply one
-  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
-    [AC_TRY_LINK([],
-      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
-      DllMain (0, 0, 0);],
-      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
-  case $host/$CC in
-  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
-    # old mingw systems require "-dll" to link a DLL, while more recent ones
-    # require "-mdll"
-    SAVE_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -mdll"
-    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
-      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
-    CFLAGS="$SAVE_CFLAGS" ;;
-  *-*-cygwin* | *-*-pw32*)
-    # cygwin systems need to pass --dll to the linker, and not link
-    # crt.o which will require a WinMain@16 definition.
-    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
-  esac
-  ;;
-  ])
-esac
-
-_LT_AC_LTCONFIG_HACK
-
-])
-
-# AC_LIBTOOL_HEADER_ASSERT
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
-[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
-    [lt_cv_func_assert_works],
-    [case $host in
-    *-*-solaris*)
-      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
-        case `$CC --version 2>/dev/null` in
-        [[12]].*) lt_cv_func_assert_works=no ;;
-        *)        lt_cv_func_assert_works=yes ;;
-        esac
-      fi
-      ;;
-    esac])
-
-if test "x$lt_cv_func_assert_works" = xyes; then
-  AC_CHECK_HEADERS(assert.h)
-fi
-])# AC_LIBTOOL_HEADER_ASSERT
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)
-])# _LT_AC_CHECK_DLFCN
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-solaris* | sysv5*)
-  symcode='[[BDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $host_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
-  symcode='[[ABCDGISTW]]'
-fi
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Write the raw and C identifiers.
-lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[       ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
-       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
-
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-         sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         save_LIBS="$LIBS"
-         save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$no_builtin_flag"
-         if AC_TRY_EVAL(ac_link) && test -s conftest; then
-           pipe_works=yes
-         fi
-         LIBS="$save_LIBS"
-         CFLAGS="$save_CFLAGS"
-       else
-         echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
-    fi
-  else
-    echo "$progname: failed program was:" >&AC_FD_CC
-    cat conftest.$ac_ext >&5
-  fi
-  rm -f conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  global_symbol_to_cdecl=
-  global_symbol_to_c_name_address=
-else
-  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
-  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
-fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
-then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-# ---------------------------------
-AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
-[# Find the correct PATH separator.  Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
-  UNAME=${UNAME-`uname 2>/dev/null`}
-  case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
-    *)     lt_cv_sys_path_separator=':' ;;
-  esac
-  PATH_SEPARATOR=$lt_cv_sys_path_separator
-fi
-])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-                             [AC_DIVERT_PUSH(NOTICE)])
-_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  IFS="${IFS=  }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
-
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
-
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
-       fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-AC_DIVERT_POP
-])# _LT_AC_PROG_ECHO_BACKSLASH
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}]
-EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-          [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-AC_DEFUN([_LT_AC_LTCONFIG_HACK],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-need_locks="$enable_libtool_lock"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-if test x"$host" != x"$build"; then
-  ac_tool_prefix=${host_alias}-
-else
-  ac_tool_prefix=
-fi
-
-# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
-case $host_os in
-linux-gnu*) ;;
-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
-esac
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-# Allow CC to be a program name with arguments.
-set dummy $CC
-compiler="[$]2"
-
-AC_MSG_CHECKING([for objdir])
-rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-AC_MSG_RESULT($objdir)
-
-
-AC_ARG_WITH(pic,
-[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
-pic_mode="$withval", pic_mode=default)
-test -z "$pic_mode" && pic_mode=default
-
-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
-# in isolation, and that seeing it set (from the cache) indicates that
-# the associated values are set (in the cache) correctly too.
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-AC_CACHE_VAL(lt_cv_prog_cc_pic,
-[ lt_cv_prog_cc_pic=
-  lt_cv_prog_cc_shlib=
-  lt_cv_prog_cc_wl=
-  lt_cv_prog_cc_static=
-  lt_cv_prog_cc_no_builtin=
-  lt_cv_prog_cc_can_build_shared=$can_build_shared
-
-  if test "$GCC" = yes; then
-    lt_cv_prog_cc_wl='-Wl,'
-    lt_cv_prog_cc_static='-static'
-
-    case $host_os in
-    aix*)
-      # Below there is a dirty hack to force normal static linking with -ldl
-      # The problem is because libdl dynamically linked with both libc and
-      # libC (AIX C++ library), which obviously doesn't included in libraries
-      # list by gcc. This cause undefined symbols with -static flags.
-      # This hack allows C programs to be linked with "-static -ldl", but
-      # not sure about C++ programs.
-      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_cv_prog_cc_pic='-fno-common'
-      ;;
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-        lt_cv_prog_cc_pic=-Kconform_pic
-      fi
-      ;;
-    *)
-      lt_cv_prog_cc_pic='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for PIC flags for the system compiler.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      lt_cv_prog_cc_wl='-Wl,'
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_cv_prog_cc_static='-Bstatic'
-      else
-       lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
-      lt_cv_prog_cc_pic='+Z'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      # PIC (with -KPIC) is the default.
-      ;;
-
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
-
-    newsos6)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      # All OSF/1 code is PIC.
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      ;;
-
-    sco3.2v5*)
-      lt_cv_prog_cc_pic='-Kpic'
-      lt_cv_prog_cc_static='-dn'
-      lt_cv_prog_cc_shlib='-belf'
-      ;;
-
-    solaris*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
-      ;;
-
-    sunos4*)
-      lt_cv_prog_cc_pic='-PIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Qoption ld '
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      if test "x$host_vendor" = xsni; then
-       lt_cv_prog_cc_wl='-LD'
-      else
-       lt_cv_prog_cc_wl='-Wl,'
-      fi
-      ;;
-
-    uts4*)
-      lt_cv_prog_cc_pic='-pic'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_cv_prog_cc_pic='-Kconform_pic'
-       lt_cv_prog_cc_static='-Bstatic'
-      fi
-      ;;
-
-    *)
-      lt_cv_prog_cc_can_build_shared=no
-      ;;
-    esac
-  fi
-])
-if test -z "$lt_cv_prog_cc_pic"; then
-  AC_MSG_RESULT([none])
-else
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
-
-  # Check to make sure the pic_flag actually works.
-  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
-  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
-    AC_TRY_COMPILE([], [], [dnl
-      case $host_os in
-      hpux9* | hpux10* | hpux11*)
-       # On HP-UX, both CC and GCC only warn that PIC is supported... then
-       # they create non-PIC objects.  So, if there were any warnings, we
-       # assume that PIC is not supported.
-       if test -s conftest.err; then
-         lt_cv_prog_cc_pic_works=no
-       else
-         lt_cv_prog_cc_pic_works=yes
-       fi
-       ;;
-      *)
-       lt_cv_prog_cc_pic_works=yes
-       ;;
-      esac
-    ], [dnl
-      lt_cv_prog_cc_pic_works=no
-    ])
-    CFLAGS="$save_CFLAGS"
-  ])
-
-  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
-    lt_cv_prog_cc_pic=
-    lt_cv_prog_cc_can_build_shared=no
-  else
-    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
-  fi
-
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
-fi
-
-# Check for any special shared library compilation flags.
-if test -n "$lt_cv_prog_cc_shlib"; then
-  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | egrep -e "[[        ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
-  else
-   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
-
-AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
-AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
-  lt_cv_prog_cc_static_works=no
-  save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
-  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
-  LDFLAGS="$save_LDFLAGS"
-])
-
-# Belt *and* braces to stop my trousers falling down:
-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
-AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
-
-pic_flag="$lt_cv_prog_cc_pic"
-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
-wl="$lt_cv_prog_cc_wl"
-link_static_flag="$lt_cv_prog_cc_static"
-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
-can_build_shared="$lt_cv_prog_cc_can_build_shared"
-
-
-# Check to see if options -o and -c are simultaneously supported by compiler
-AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
-AC_CACHE_VAL([lt_cv_compiler_c_o], [
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-echo "int some_variable = 0;" > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory.  Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
-compiler_c_o=no
-if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
-  # The compiler can only warn and ignore the option if not recognized
-  # So say no if there are warnings
-  if test -s out/conftest.err; then
-    lt_cv_compiler_c_o=no
-  else
-    lt_cv_compiler_c_o=yes
-  fi
-else
-  # Append any errors to the config.log.
-  cat out/conftest.err 1>&AC_FD_CC
-  lt_cv_compiler_c_o=no
-fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
-])
-compiler_c_o=$lt_cv_compiler_c_o
-AC_MSG_RESULT([$compiler_c_o])
-
-if test x"$compiler_c_o" = x"yes"; then
-  # Check to see if we can write to a .lo
-  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
-  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
-  lt_cv_compiler_o_lo=no
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -c -o conftest.lo"
-  save_objext="$ac_objext"
-  ac_objext=lo
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      lt_cv_compiler_o_lo=no
-    else
-      lt_cv_compiler_o_lo=yes
-    fi
-  ])
-  ac_objext="$save_objext"
-  CFLAGS="$save_CFLAGS"
-  ])
-  compiler_o_lo=$lt_cv_compiler_o_lo
-  AC_MSG_RESULT([$compiler_o_lo])
-else
-  compiler_o_lo=no
-fi
-
-# Check to see if we can do hard links to lock some files if needed
-hard_links="nottested"
-if test "$compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-if test "$GCC" = yes; then
-  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
-  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
-  compiler_rtti_exceptions=no
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      compiler_rtti_exceptions=no
-    else
-      compiler_rtti_exceptions=yes
-    fi
-  ])
-  CFLAGS="$save_CFLAGS"
-  AC_MSG_RESULT([$compiler_rtti_exceptions])
-
-  if test "$compiler_rtti_exceptions" = "yes"; then
-    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
-  else
-    no_builtin_flag=' -fno-builtin'
-  fi
-fi
-
-# See if the linker supports building shared libraries.
-AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
-
-allow_undefined_flag=
-no_undefined_flag=
-need_lib_prefix=unknown
-need_version=unknown
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-archive_cmds=
-archive_expsym_cmds=
-old_archive_from_new_cmds=
-old_archive_from_expsyms_cmds=
-export_dynamic_flag_spec=
-whole_archive_flag_spec=
-thread_safe_flag_spec=
-hardcode_into_libs=no
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-hardcode_shlibpath_var=unsupported
-runpath_var=
-link_all_deplibs=unknown
-always_export_symbols=no
-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
-# include_expsyms should be a list of space-separated symbols to be *always*
-# included in the symbol list
-include_expsyms=
-# exclude_expsyms can be an egrep regular expression of symbols to exclude
-# it will be wrapped by ` (' and `)$', so one must not match beginning or
-# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-# as well as any symbol that contains `d'.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-# platforms (ab)use it in PIC code, but their linkers get confused if
-# the symbol is explicitly referenced.  Since portable code cannot
-# rely on this symbol name, it's probably fine to never include it in
-# preloaded symbol tables.
-extract_expsyms_cmds=
-
-case $host_os in
-cygwin* | mingw* | pw32*)
-  # FIXME: the MSVC++ port hasn't been tested in a loooong time
-  # When not using gcc, we currently assume that we are using
-  # Microsoft Visual C++.
-  if test "$GCC" != yes; then
-    with_gnu_ld=no
-  fi
-  ;;
-openbsd*)
-  with_gnu_ld=no
-  ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  # If archive_cmds runs LD, not CC, wlarc should be empty
-  wlarc='${wl}'
-
-  # See if GNU ld supports shared libraries.
-  case $host_os in
-  aix3* | aix4* | aix5*)
-    # On AIX, the GNU linker is very broken
-    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
-    ld_shlibs=no
-    cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-    ;;
-
-  amigaos*)
-    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-
-    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-    # that the semantics of dynamic libraries on AmigaOS, at least up
-    # to version 4, is to share data among multiple programs linked
-    # with the same dynamic library.  Since this doesn't match the
-    # behavior of shared libraries on other platforms, we can use
-    # them.
-    ld_shlibs=no
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag=unsupported
-      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec='-L$libdir'
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-
-    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
-      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
-      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
-      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
-      else $CC -o impgen impgen.c ; fi)~
-      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
-
-    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
-
-    # cygwin and mingw dlls have different entry points and sets of symbols
-    # to exclude.
-    # FIXME: what about values for MSVC?
-    dll_entry=__cygwin_dll_entry@12
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
-    case $host_os in
-    mingw*)
-      # mingw values
-      dll_entry=_DllMainCRTStartup@12
-      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
-      ;;
-    esac
-
-    # mingw and cygwin differ, and it's simplest to just exclude the union
-    # of the two symbol sets.
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
-
-    # recent cygwin and mingw systems supply a stub DllMain which the user
-    # can override, but on older systems we have to supply one (in ltdll.c)
-    if test "x$lt_cv_need_dllmain" = "xyes"; then
-      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
-      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
-       test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
-    else
-      ltdll_obj=
-      ltdll_cmds=
-    fi
-
-    # Extract the symbol export list from an `--export-all' def file,
-    # then regenerate the def file from the symbol export list, so that
-    # the compiled dll only exports the symbol export list.
-    # Be careful not to strip the DATA tag left be newer dlltools.
-    export_symbols_cmds="$ltdll_cmds"'
-      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
-      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
-
-    # If the export-symbols file already is a .def file (1st line
-    # is EXPORTS), use it as is.
-    # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
-       cp $export_symbols $output_objdir/$soname-def;
-      else
-       echo EXPORTS > $output_objdir/$soname-def;
-       _lt_hint=1;
-       cat $export_symbols | while read symbol; do
-        set dummy \$symbol;
-        case \[$]# in
-          2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
-          *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
-        esac;
-        _lt_hint=`expr 1 + \$_lt_hint`;
-       done;
-      fi~
-      '"$ltdll_cmds"'
-      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
-      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
-      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
-    ;;
-
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-      wlarc=
-    else
-      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    fi
-    ;;
-
-  solaris* | sysv5*)
-    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-      ld_shlibs=no
-      cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
-  sunos4*)
-    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    wlarc=
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  *)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-  esac
-
-  if test "$ld_shlibs" = yes; then
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    case $host_os in
-    cygwin* | mingw* | pw32*)
-      # dlltool doesn't understand --whole-archive et. al.
-      whole_archive_flag_spec=
-      ;;
-    *)
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
-       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec=
-      fi
-      ;;
-    esac
-  fi
-else
-  # PORTME fill in a description of your system's linker (not GNU ld)
-  case $host_os in
-  aix3*)
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-    # Note: this linker hardcodes the directories in LIBPATH if there
-    # are no directories specified by -L.
-    hardcode_minus_L=yes
-    if test "$GCC" = yes && test -z "$link_static_flag"; then
-      # Neither direct hardcoding nor static linking is supported with a
-      # broken collect2.
-      hardcode_direct=unsupported
-    fi
-    ;;
-
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-       done
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    hardcode_direct=yes
-    archive_cmds=''
-    hardcode_libdir_separator=':'
-    if test "$GCC" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       collect2name=`${CC} -print-prog-name=collect2`
-       if test -f "$collect2name" && \
-         strings "$collect2name" | grep resolve_lib_name >/dev/null
-       then
-         # We have reworked collect2
-         hardcode_direct=yes
-       else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-       fi
-      esac
-
-      shared_flag='-shared'
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-       shared_flag='${wl}-G'
-      else
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag='${wl}-G'
-       else
-         shared_flag='${wl}-bM:SRE'
-       fi
-      fi
-    fi
-
-    # It seems that -bexpall can do strange things, so it is better to
-    # generate a list of symbols to export.
-    always_export_symbols=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag='-berok'
-      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
-      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-    else
-      if test "$host_cpu" = ia64; then
-       hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-       allow_undefined_flag="-z nodefs"
-       archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
-       # Warning - without using the other run time loading flags,
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='${wl}-berok'
-       # This is a bit strange, but is similar to how AIX traditionally builds
-       # it's shared libraries.
-       archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
-      fi
-    fi
-    ;;
-
-  amigaos*)
-    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    # see comment about different semantics on the GNU ld section
-    ld_shlibs=no
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec=' '
-    allow_undefined_flag=unsupported
-    # Tell ltmain to make .lib files, not .a files.
-    libext=lib
-    # FIXME: Setting linknames here is a bad hack.
-    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-    # The linker will automatically build a .lib file if we build a DLL.
-    old_archive_from_new_cmds='true'
-    # FIXME: Should let the user specify the lib program.
-    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
-    fix_srcfile_path='`cygpath -w "$srcfile"`'
-    ;;
-
-  darwin* | rhapsody*)
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      allow_undefined_flag='-flat_namespace -undefined suppress'
-      ;;
-    esac
-    # FIXME: Relying on posixy $() will cause problems for
-    #        cross-compilation, but unfortunately the echo tests do not
-    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
-    #       `"' quotes if we put them in here... so don't!
-    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
-    # We need to add '_' to the symbols in $export_symbols first
-    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    whole_archive_flag_spec='-all_load $convenience'
-    ;;
-
-  freebsd1*)
-    ld_shlibs=no
-    ;;
-
-  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-  # support.  Future versions do this automatically, but an explicit c++rt0.o
-  # does not break anything, and helps significantly (at the cost of a little
-  # extra space).
-  freebsd2.2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-  freebsd2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-  freebsd*)
-    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  hpux9* | hpux10* | hpux11*)
-    case $host_os in
-    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
-    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
-    esac
-    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_direct=yes
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-                        # location of the library.
-    export_dynamic_flag_spec='${wl}-E'
-    ;;
-
-  irix5* | irix6* | nonstopux*)
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-    else
-      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    link_all_deplibs=yes
-    ;;
-
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-    else
-      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-    fi
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  newsos6)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_shlibpath_var=no
-    ;;
-
-  openbsd*)
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-    else
-      case "$host_os" in
-      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-        ;;
-      *)
-        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-        ;;
-      esac
-    fi
-    ;;
-
-  os2*)
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    allow_undefined_flag=unsupported
-    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-    ;;
-
-  osf3*)
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    ;;
-
-  osf4* | osf5*)       # as osf3* with the addition of -msym flag
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
-
-      #Both c and cxx compiler support -rpath directly
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    ;;
-
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
-    export_dynamic_flag_spec='${wl}-Bexport'
-    ;;
-
-  solaris*)
-    # gcc --version < 3.0 without binutils cannot create self contained
-    # shared libraries reliably, requiring libgcc.a to resolve some of
-    # the object symbols generated in some cases.  Libraries that use
-    # assert need libgcc.a to resolve __eprintf, for example.  Linking
-    # a copy of libgcc.a into every shared library to guarantee resolving
-    # such symbols causes other problems:  According to Tim Van Holder
-    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
-    # (to the application) exception stack for one thing.
-    no_undefined_flag=' -z defs'
-    if test "$GCC" = yes; then
-      case `$CC --version 2>/dev/null` in
-      [[12]].*)
-       cat <<EOF 1>&2
-
-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
-*** create self contained shared libraries on Solaris systems, without
-*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
-*** -no-undefined support, which will at least allow you to build shared
-*** libraries.  However, you may find that when you link such libraries
-*** into an application without using GCC, you have to manually add
-*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
-*** upgrade to a newer version of GCC.  Another option is to rebuild your
-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
-
-EOF
-        no_undefined_flag=
-       ;;
-      esac
-    fi
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_shlibpath_var=no
-    case $host_os in
-    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
-    esac
-    link_all_deplibs=yes
-    ;;
-
-  sunos4*)
-    if test "x$host_vendor" = xsequent; then
-      # Use $CC to link under sequent, because it throws in some extra .o
-      # files that make .init and .fini sections work.
-      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-    fi
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4)
-    if test "x$host_vendor" = xsno; then
-      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes # is this really true???
-    else
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4.3*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    export_dynamic_flag_spec='-Bexport'
-    ;;
-
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
-
-  uts4*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
-
-  dgux*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4*MP*)
-    if test -d /usr/nec; then
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ld_shlibs=yes
-    fi
-    ;;
-
-  sysv4.2uw2*)
-    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=no
-    hardcode_shlibpath_var=no
-    hardcode_runpath_var=yes
-    runpath_var=LD_RUN_PATH
-    ;;
-
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
-  *)
-    ld_shlibs=no
-    ;;
-  esac
-fi
-AC_MSG_RESULT([$ld_shlibs])
-test "$ld_shlibs" = no && can_build_shared=no
-
-# Check hardcoding attributes.
-AC_MSG_CHECKING([how to hardcode library paths into programs])
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var"; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$hardcode_shlibpath_var" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-AC_MSG_RESULT([$hardcode_action])
-
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
-
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-# PORTME Fill in your ld.so characteristics
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}.so$major'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-            echo ' yes '
-            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-         :
-       else
-         can_build_shared=no
-       fi
-       ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can
-    # not hardcode correct soname into executable. Probably we can
-    # add versioning support to collect2, so additional links can
-    # be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}.so$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}.so'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi4*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  export_dynamic_flag_spec=-rdynamic
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  need_version=no
-  need_lib_prefix=no
-  case $GCC,$host_os in
-  yes,cygwin*)
-    library_names_spec='$libname.dll.a'
-    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog .libs/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    ;;
-  yes,mingw*)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
-    ;;
-  yes,pw32*)
-    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    ;;
-  *)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  # FIXME: Relying on posixy $() will cause problems for
-  #        cross-compilation, but unfortunately the echo tests do not
-  #        yet detect zsh echo's removal of \ escapes.
-  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
-  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  *)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  dynamic_linker="$host_os dld.sl"
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  shlibpath_var=SHLIB_PATH
-  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
-  soname_spec='${libname}${release}.sl$major'
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)          version_type=irix ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
-    soname_spec='${libname}${release}.so$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case "$host_os" in
-    openbsd2.[[89]] | openbsd2.[[89]].*)
-      shlibpath_overrides_runpath=no
-      ;;
-    *)
-      shlibpath_overrides_runpath=yes
-      ;;
-    esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-os2*)
-  libname_spec='$name'
-  need_lib_prefix=no
-  library_names_spec='$libname.dll $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_version=no
-  need_lib_prefix=no
-  soname_spec='${libname}${release}.so'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
-    soname_spec='$libname.so.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-# Report the final consequences.
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix4*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-if test "$hardcode_action" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-AC_LIBTOOL_DLOPEN_SELF
-
-if test "$enable_shared" = yes && test "$GCC" = yes; then
-  case $archive_cmds in
-  *'~'*)
-    # FIXME: we may have to deal with multi-command sequences.
-    ;;
-  '$CC '*)
-    # Test whether the compiler implicitly links with -lc since on some
-    # systems, -lgcc has to come before -lc. If gcc already passes -lc
-    # to ld, don't add -lc before -lgcc.
-    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
-    [$rm conftest*
-    echo 'static int dummy;' > conftest.$ac_ext
-
-    if AC_TRY_EVAL(ac_compile); then
-      soname=conftest
-      lib=conftest
-      libobjs=conftest.$ac_objext
-      deplibs=
-      wl=$lt_cv_prog_cc_wl
-      compiler_flags=-v
-      linker_flags=-v
-      verstring=
-      output_objdir=.
-      libname=conftest
-      save_allow_undefined_flag=$allow_undefined_flag
-      allow_undefined_flag=
-      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-      then
-       lt_cv_archive_cmds_need_lc=no
-      else
-       lt_cv_archive_cmds_need_lc=yes
-      fi
-      allow_undefined_flag=$save_allow_undefined_flag
-    else
-      cat conftest.err 1>&5
-    fi])
-    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
-    ;;
-  esac
-fi
-need_lc=${lt_cv_archive_cmds_need_lc-yes}
-
-# The second clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  :
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  test -f Makefile && make "$ltmain"
-fi
-
-if test -f "$ltmain"; then
-  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
-  $rm -f "${ofile}T"
-
-  echo creating $ofile
-
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS \
-    AR AR_FLAGS CC LD LN_S NM SHELL \
-    reload_flag reload_cmds wl \
-    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
-    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
-    library_names_spec soname_spec \
-    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
-    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
-    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
-    old_striplib striplib file_magic_cmd export_symbols_cmds \
-    deplibs_check_method allow_undefined_flag no_undefined_flag \
-    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
-    global_symbol_to_c_name_address \
-    hardcode_libdir_flag_spec hardcode_libdir_separator  \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
-
-    case $var in
-    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
-    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  cat <<__EOF__ > "${ofile}T"
-#! $SHELL
-
-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="sed -e s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# The default C compiler.
-CC=$lt_CC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_pic_flag
-pic_mode=$pic_mode
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_compiler_c_o
-
-# Can we write directly to a .lo ?
-compiler_o_lo=$lt_compiler_o_lo
-
-# Must we lock files when doing compilation ?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_link_static_flag
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "${ofile}T"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | os2*)
-    cat <<'EOF' >> "${ofile}T"
-      # This is a source program that is used to create dlls on Windows
-      # Don't remove nor modify the starting and closing comments
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-       # This is a source program that is used to create import libraries
-       # on Windows for dlls which lack them. Don't remove nor modify the
-       # starting and closing comments
-# /* impgen.c starts here */
-# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
-#
-#  This file is part of GNU libtool.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#  */
-#
-# #include <stdio.h>           /* for printf() */
-# #include <unistd.h>          /* for open(), lseek(), read() */
-# #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
-# #include <string.h>          /* for strdup() */
-#
-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
-# #ifndef O_BINARY
-# #define O_BINARY 0
-# #endif
-#
-# static unsigned int
-# pe_get16 (fd, offset)
-#      int fd;
-#      int offset;
-# {
-#   unsigned char b[2];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 2);
-#   return b[0] + (b[1]<<8);
-# }
-#
-# static unsigned int
-# pe_get32 (fd, offset)
-#     int fd;
-#     int offset;
-# {
-#   unsigned char b[4];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 4);
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# static unsigned int
-# pe_as32 (ptr)
-#      void *ptr;
-# {
-#   unsigned char *b = ptr;
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# int
-# main (argc, argv)
-#     int argc;
-#     char *argv[];
-# {
-#     int dll;
-#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-#     unsigned long export_rva, export_size, nsections, secptr, expptr;
-#     unsigned long name_rvas, nexp;
-#     unsigned char *expdata, *erva;
-#     char *filename, *dll_name;
-#
-#     filename = argv[1];
-#
-#     dll = open(filename, O_RDONLY|O_BINARY);
-#     if (dll < 1)
-#      return 1;
-#
-#     dll_name = filename;
-#
-#     for (i=0; filename[i]; i++)
-#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
-#          dll_name = filename + i +1;
-#
-#     pe_header_offset = pe_get32 (dll, 0x3c);
-#     opthdr_ofs = pe_header_offset + 4 + 20;
-#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
-#
-#     if (num_entries < 1) /* no exports */
-#      return 1;
-#
-#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
-#     export_size = pe_get32 (dll, opthdr_ofs + 100);
-#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
-#     secptr = (pe_header_offset + 4 + 20 +
-#            pe_get16 (dll, pe_header_offset + 4 + 16));
-#
-#     expptr = 0;
-#     for (i = 0; i < nsections; i++)
-#     {
-#      char sname[8];
-#      unsigned long secptr1 = secptr + 40 * i;
-#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
-#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
-#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
-#      lseek(dll, secptr1, SEEK_SET);
-#      read(dll, sname, 8);
-#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
-#      {
-#          expptr = fptr + (export_rva - vaddr);
-#          if (export_rva + export_size > vaddr + vsize)
-#              export_size = vsize - (export_rva - vaddr);
-#          break;
-#      }
-#     }
-#
-#     expdata = (unsigned char*)malloc(export_size);
-#     lseek (dll, expptr, SEEK_SET);
-#     read (dll, expdata, export_size);
-#     erva = expdata - export_rva;
-#
-#     nexp = pe_as32 (expdata+24);
-#     name_rvas = pe_as32 (expdata+32);
-#
-#     printf ("EXPORTS\n");
-#     for (i = 0; i<nexp; i++)
-#     {
-#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
-#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
-#     }
-#
-#     return 0;
-# }
-# /* impgen.c ends here */
-
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
-
-  mv -f "${ofile}T" "$ofile" || \
-    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
-  chmod +x "$ofile"
-fi
-
-])# _LT_AC_LTCONFIG_HACK
-
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
-
-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
-
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)])
-
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
-
-
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
-])
-
-# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)])
-
-# AC_LIBTOOL_PICMODE - implement the --with-pic flag
-# Usage: AC_LIBTOOL_PICMODE[(MODE)]
-#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
-#   `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)])
-
-
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-])
-
-
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
-AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])
-
-
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])
-
-# AC_PROG_LD_GNU -
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  lt_cv_prog_gnu_ld=yes
-else
-  lt_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])
-
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
-])
-
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependant libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi4*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin* | mingw* | pw32*)
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  case "$host_os" in
-  rhapsody* | darwin1.[[012]])
-    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
-    ;;
-  *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
-    ;;
-  esac
-  ;;
-
-freebsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20*|hpux11*)
-  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-  irix5* | nonstopux*)
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
-    ;;
-  *)
-    case $LD in
-    *-32|*"-32 ") libmagic=32-bit;;
-    *-n32|*"-n32 ") libmagic=N32;;
-    *-64|*"-64 ") libmagic=64-bit;;
-    *) libmagic=never-match;;
-    esac
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
-    ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
-  else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  # this will be overridden with pass_all, but let us keep it just in case
-  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=/lib/libc.so
-  ;;
-
-sysv5uw[[78]]* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  esac
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-])
-
-
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -B"
-       break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -p"
-       break
-      else
-       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
-
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
-  # These system don't have libm
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, main, LIBM="-lm")
-  ;;
-esac
-])
-
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments.  Note that LIBLTDL and LTDLINCL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
-# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
-# with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
-
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
-# with '${top_srcdir}/' (note the single quotes!).  If your package is
-# not flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, main,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
diff --git a/pycaml/configure b/pycaml/configure
deleted file mode 100644 (file)
index bf39340..0000000
+++ /dev/null
@@ -1,4142 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
-#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="pycaml_ml.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP PYPACKAGE haveldd PY_LIBS PY_VERSION PY_PREFIX LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_option in
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
-  cat <<_ACEOF
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
-_ACEOF
-
-  cat <<\_ACEOF
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
-  cat <<\_ACEOF
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-python-prefix=PFX   Prefix where Python is installed (optional)
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
-  CPP         C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
-    ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
-  cat <<\_ACEOF
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
-    2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-        ac_must_keep_next=false # Got value, back to normal.
-      else
-        case $ac_arg in
-          *=* | --config-cache | -C | -disable-* | --disable-* \
-          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-          | -with-* | --with-* | -without-* | --without-* | --x)
-            case "$ac_configure_args0 " in
-              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-            esac
-            ;;
-          -* ) ac_must_keep_next=true ;;
-        esac
-      fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
-      ;;
-    esac
-  done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-{
-  (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
-    *)
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-}
-    echo
-
-    cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
-      echo
-      for ac_var in $ac_subst_files
-      do
-       eval ac_val=$`echo $ac_var`
-        echo "$ac_var='"'"'$ac_val'"'"'"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
-      echo
-      sed "/^$/d" confdefs.h | sort
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core core.* *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-     ' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
-    esac
-  fi
-else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ac_ct_CC" && break
-done
-
-  CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-        ;;
-    conftest.$ac_ext )
-        # This is the source file.
-        ;;
-    [ab].out )
-        # We found the default executable, but exeext='' is most
-        # certainly right.
-        break;;
-    *.* )
-        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-        # FIXME: I believe we export ac_cv_exeext for Libtool,
-        # but it would be cool to find out if it's true.  Does anybody
-        # maintain Libtool? --akim.
-        export ac_cv_exeext
-        break;;
-    * )
-        break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-       cross_compiling=yes
-    else
-       { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
-    * ) break;;
-  esac
-done
-else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-echo "$as_me:$LINENO: checking for main in -lpython" >&5
-echo $ECHO_N "checking for main in -lpython... $ECHO_C" >&6
-if test "${ac_cv_lib_python_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpython  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_python_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_python_main=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_python_main" >&5
-echo "${ECHO_T}$ac_cv_lib_python_main" >&6
-if test $ac_cv_lib_python_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPYTHON 1
-_ACEOF
-
-  LIBS="-lpython $LIBS"
-
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_c_const=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-
-
-
-
-# Check whether --with-python-prefix or --without-python-prefix was given.
-if test "${with_python_prefix+set}" = set; then
-  withval="$with_python_prefix"
-  python_prefix="$withval"
-            PYPACKAGE=""
-            if test -e "$python_prefix/bin/python" ; then
-              PYPACKAGE="$python_prefix/bin/python"
-            fi
-else
-  PYPACKAGE=""
-fi;
-
-
-
-for ac_prog in python
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PYPACKAGE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PYPACKAGE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PYPACKAGE="$PYPACKAGE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PYPACKAGE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-PYPACKAGE=$ac_cv_path_PYPACKAGE
-
-if test -n "$PYPACKAGE"; then
-  echo "$as_me:$LINENO: result: $PYPACKAGE" >&5
-echo "${ECHO_T}$PYPACKAGE" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$PYPACKAGE" && break
-done
-
-
-
-
-PY_PREFIX=`$PYPACKAGE getprefix.py`
-PY_VERSION=`$PYPACKAGE getversion.py`
-
-
-if test `echo $PY_VERSION | tr -d .` -lt 15; then
-echo "Sorry, you need to have Python 1.5+ installed - update your version!"
-    { { echo "$as_me:$LINENO: error: *** Python 1.5 or better required" >&5
-echo "$as_me: error: *** Python 1.5 or better required" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-echo "$as_me:$LINENO: checking for Python header files" >&5
-echo $ECHO_N "checking for Python header files... $ECHO_C" >&6
-
-PY_INCLUDE=`$PYPACKAGE -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[:3])'`
-
-
-if test -r "$PY_INCLUDE/Python.h"; then
-   PY_CFLAGS="-I$PY_INCLUDE"
-else
-   { { echo "$as_me:$LINENO: error: Could not find Python.h in $PY_INCLUDE" >&5
-echo "$as_me: error: Could not find Python.h in $PY_INCLUDE" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
-
-
-echo "$as_me:$LINENO: checking for Python library" >&5
-echo $ECHO_N "checking for Python library... $ECHO_C" >&6
-PYLIB=""
-
-PY_PREFIX=`$PYPACKAGE -c 'import sys; print sys.prefix'`
-PYLIBVER=`$PYPACKAGE -c 'import sys; print sys.version[:3]'`
-
-
-py_paths="$PY_PREFIX/lib/python$PYLIBVER/config $PYPREFIX/lib"
-py_suffix="$PYLIBVER.so $PYLIBVER.a .so .a"
-
-
-for ppath in $py_paths ; do
-    if test -r "$ppath/libpython$PYLIBVER.so" -o \
-           -r "$ppath/libpython$PYLIBVER.a"; then
-        PYLIB="-cclib -L$ppath -cclib -lpython$PYLIBVER"
-        break
-    fi
-
-    if test -r "$ppath/libpython.so" -o \
-            -r "$ppath/libpython.a"; then
-        PYLIB="-cclib -L$ppath -cclib -lpython"
-    break
-    fi
-done
-
-if test "x$PYLIB" != x ; then
-    PY_LIBS="$PYLIB $PY_LIBS"
-    echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
-else
-    { { echo "$as_me:$LINENO: error: *** Python library not found" >&5
-echo "$as_me: error: *** Python library not found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-# Extract the first word of "ldd", so it can be a program name with args.
-set dummy ldd; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_haveldd+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $haveldd in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_haveldd="$haveldd" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_haveldd="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-haveldd=$ac_cv_path_haveldd
-
-if test -n "$haveldd"; then
-  echo "$as_me:$LINENO: result: $haveldd" >&5
-echo "${ECHO_T}$haveldd" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-echo "$as_me:$LINENO: checking for Python's dependencies" >&5
-echo $ECHO_N "checking for Python's dependencies... $ECHO_C" >&6
-
-if test x$haveldd != x ; then
-
-    py_deps=`ldd $PYPACKAGE | sed 's/\( *lib\([^\/]*\)\.so.*=.*$\)/-cclib\ \"-l\2\"/p; d'`
-    for py_lib in $py_deps ; do
-        if test "$py_lib" != "-lm" && test "$py_lib" != "-lc" ; then
-            PY_DEPS="$PY_DEPS $py_lib"
-        fi
-    done
-
-fi
-
-
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-    PY_LIBS="-Wl,-E $PY_LIBS $PY_DEPS"
-else
-    PY_LIBS="$PY_LIBS $PY_DEPS"
-fi
-
-export PY_LIBS
-export PY_VERSION
-export PY_PREFIX
-
-
-
-
-
-          ac_config_files="$ac_config_files Makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
-  (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
-      sed -n \
-        "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} |
-  sed '
-     t clear
-     : clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[        ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[   ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[     ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\),-D\1=\2,g
-t quote
-s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[    `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.57,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  -*)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
-    ac_need_defaults=false;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1" ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@PYPACKAGE@,$PYPACKAGE,;t t
-s,@haveldd@,$haveldd,;t t
-s,@PY_LIBS@,$PY_LIBS,;t t
-s,@PY_VERSION@,$PY_VERSION,;t t
-s,@PY_PREFIX@,$PY_PREFIX,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         echo $f;;
-      *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/pycaml/configure.in b/pycaml/configure.in
deleted file mode 100644 (file)
index 3e5a426..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(pycaml_ml.c)
-
-dnl Checks for programs.
-
-dnl Checks for libraries.
-dnl Replace `main' with a function in -lpython:
-AC_CHECK_LIB(python, main)
-
-dnl Checks for header files.
-AC_CHECK_HEADERS(unistd.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-
-dnl Checks for library functions.
-AC_HEADER_STDC
-
-dnl ********************
-dnl Check for Python. 
-dnl ********************
-
-AM_PATH_PYTHON()
-
-dnl Find Python executable
-AC_PATH_PROGS(PYPACKAGE, python)
-
-dnl Extract the version using Python, check against 1.5+
-
-changequote(<<, >>)
-PY_PREFIX=`$PYPACKAGE getprefix.py`
-PY_VERSION=`$PYPACKAGE getversion.py`
-changequote([, ])
-
-if test `echo $PY_VERSION | tr -d .` -lt 15; then
-echo "Sorry, you need to have Python 1.5+ installed - update your version!"
-    AC_MSG_ERROR([*** Python 1.5 or better required])
-fi
-
-dnl Find the Python.h header file
-
-AC_MSG_CHECKING(for Python header files)
-changequote(<<, >>)
-PY_INCLUDE=`$PYPACKAGE -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[:3])'`
-changequote([, ])
-
-if test -r "$PY_INCLUDE/Python.h"; then
-   PY_CFLAGS="-I$PY_INCLUDE"
-else
-   AC_MSG_ERROR([Could not find Python.h in $PY_INCLUDE])
-fi
-AC_MSG_RESULT(found)
-
-dnl Find the Python library
-
-AC_MSG_CHECKING(for Python library)
-PYLIB=""
-changequote(<<, >>)
-PY_PREFIX=`$PYPACKAGE -c 'import sys; print sys.prefix'`
-PYLIBVER=`$PYPACKAGE -c 'import sys; print sys.version[:3]'`
-changequote([, ])
-
-py_paths="$PY_PREFIX/lib/python$PYLIBVER/config $PYPREFIX/lib"
-py_suffix="$PYLIBVER.so $PYLIBVER.a .so .a"
-   
-dnl Try for specific version first, then the generic version, then panic
-
-for ppath in $py_paths ; do
-    if test -r "$ppath/libpython$PYLIBVER.so" -o \
-           -r "$ppath/libpython$PYLIBVER.a"; then
-        PYLIB="-cclib -L$ppath -cclib -lpython$PYLIBVER"
-        break
-    fi
-
-    if test -r "$ppath/libpython.so" -o \
-            -r "$ppath/libpython.a"; then
-        PYLIB="-cclib -L$ppath -cclib -lpython"
-    break
-    fi
-done
-
-if test "x$PYLIB" != x ; then
-    PY_LIBS="$PYLIB $PY_LIBS"
-    AC_MSG_RESULT(found)
-else
-    AC_MSG_ERROR([*** Python library not found])
-fi
-
-dnl Get the libraries that python depends on
-
-AC_PATH_PROG(haveldd, ldd)
-AC_MSG_CHECKING(for Python's dependencies)
-
-if test x$haveldd != x ; then
-    changequote(<<, >>)
-    py_deps=`ldd $PYPACKAGE | sed 's/\( *lib\([^\/]*\)\.so.*=.*$\)/-cclib\ \"-l\2\"/p; d'`
-    for py_lib in $py_deps ; do
-        if test "$py_lib" != "-lm" && test "$py_lib" != "-lc" ; then
-            PY_DEPS="$PY_DEPS $py_lib"
-        fi
-    done
-      changequote([, ])
-fi
-
-dnl only GNU ld seems to know -E flag
-
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-    PY_LIBS="-Wl,-E $PY_LIBS $PY_DEPS"
-else
-    PY_LIBS="$PY_LIBS $PY_DEPS"
-fi
-
-export PY_LIBS
-export PY_VERSION
-export PY_PREFIX
-
-AC_SUBST(PY_LIBS)
-AC_SUBST(PY_VERSION)
-AC_SUBST(PY_PREFIX)
-
-AC_OUTPUT(Makefile)
diff --git a/pycaml/getprefix.py b/pycaml/getprefix.py
deleted file mode 100644 (file)
index ee2ea8d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-import sys
-
-print(sys.exec_prefix)
diff --git a/pycaml/getversion.py b/pycaml/getversion.py
deleted file mode 100644 (file)
index 6df8861..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-import sys
-
-print(sys.version[:3])
diff --git a/pycaml/license.txt b/pycaml/license.txt
deleted file mode 100644 (file)
index b1e3f5a..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-                 GNU LESSER GENERAL PUBLIC LICENSE
-                      Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 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 Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                           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 Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-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 and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-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 other code 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.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  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, whereas the latter must
-be combined with the library in order to run.
-\f
-                 GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser 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.
-\f
-  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.
-\f
-  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.
-\f
-  6. As an exception to the Sections above, you may also combine 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) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) 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.
-
-    d) 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.
-
-    e) 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 materials to be 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.
-\f
-  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 with
-this License.
-\f
-  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 Lesser 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.
-\f
-  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 INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/pycaml/modif-orig.txt b/pycaml/modif-orig.txt
deleted file mode 100644 (file)
index bc0743a..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
---- a/pycaml_ml.c      2004-12-02 17:17:07.000000000 +0100
-+++ b/pycaml_ml.c      2008-03-27 12:15:23.000000000 +0100
-@@ -554,6 +554,7 @@
- extern DL_IMPORT(PyObject *) PyObject_GetAttrString(PyObject *, char *);
- /* 17 */
- extern DL_IMPORT(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
-+extern DL_IMPORT(PyObject *) PyObject_CallObject(PyObject *, PyObject *);
- /* 18 */
- extern DL_IMPORT(int) PyObject_IsTrue(PyObject *);
- extern DL_IMPORT(int) PyObject_Not(PyObject *);
-@@ -654,6 +655,7 @@
- extern DL_IMPORT(PyObject *) PyTuple_New(int size);
- /* 18 */
- extern DL_IMPORT(int) PyTuple_Size(PyObject *);
-+extern DL_IMPORT(int) PyTuple_Check(PyObject *);
- /* 40 */
- extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
- /* 41 */
-@@ -883,6 +885,47 @@
- #endif//MAYBE_RUN
- #endif//DONT_COMPILE_THIS
-+/* HST FIXUP */
-+#undef PyRun_SimpleString
-+int PyRun_SimpleString(const char* command) { return PyRun_SimpleStringFlags(command, NULL); }
-+
-+#undef PyRun_AnyFile
-+int PyRun_AnyFile(FILE* fp, const char* filename) { return PyRun_AnyFileExFlags(fp, filename, 0, NULL); }
-+
-+#undef PyRun_SimpleFile
-+int PyRun_SimpleFile(FILE* fp, const char* filename) { return PyRun_SimpleFileExFlags(fp, filename, 0, NULL); }
-+
-+#undef PyRun_InteractiveOne
-+int PyRun_InteractiveOne(FILE* fp, const char* filename) { return PyRun_InteractiveOneFlags(fp, filename, NULL); }
-+
-+#undef PyRun_InteractiveLoop
-+int PyRun_InteractiveLoop(FILE* fp, const char* filename) { return PyRun_InteractiveLoopFlags(fp, filename, NULL); }
-+
-+#undef PyRun_AnyFileEx
-+int PyRun_AnyFileEx(FILE* fp, const char* filename, int closeit) { return PyRun_AnyFileExFlags(fp, filename, closeit, NULL); }
-+
-+#undef PyRun_SimpleFileEx
-+int PyRun_SimpleFileEx(FILE* fp, const char* filename, int closeit) { return PyRun_SimpleFileExFlags(fp, filename, closeit, NULL); }
-+
-+#undef PyRun_String
-+PyObject* PyRun_String(const char* str, int start, PyObject* globals, PyObject* locals) { return PyRun_StringFlags(str, start, globals, locals, NULL); }
-+
-+#undef PyRun_File
-+PyObject* PyRun_File(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals) { return PyRun_FileExFlags(fp, filename, start, globals, locals, 0, NULL); }
-+
-+#undef PyRun_FileEx
-+PyObject* PyRun_FileEx(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals, int closeit) { return PyRun_FileExFlags(fp, filename, start, globals, locals, closeit, NULL); }
-+
-+#undef Py_CompileString
-+PyObject* Py_CompileString(const char* str, const char* filename, int start) { return Py_CompileStringFlags(str, filename, start, NULL); }
-+
-+#undef PyRange_New
-+PyObject* PyRange_New(PyObject* start, PyObject* stop, PyObject* step) { return PyObject_CallFunction((PyObject*)&PyRange_Type, "lll", start, stop, step); }
-+
-+#undef PyTuple_Check
-+int PyTuple_Check(PyObject* op) { return PyObject_TypeCheck(op, &PyTuple_Type); }
-+/* END HST FIXUP */
-+
- /* Value -> Pyobject */
- value pywrapvalue( value cb ) {
-@@ -963,6 +1006,7 @@
-     { (void *)PyObject_GetAttrString, 16, "PyObject_GetAttrString" },
- /* 17 */
-     { (void *)PyObject_GetAttr, 17, "PyObject_GetAttr" },
-+    { (void *)PyObject_CallObject, 17, "PyObject_CallObject" },
- /* 18 */
-     { (void *)PyObject_IsTrue, 18, "PyObject_IsTrue" },
-     { (void *)PyObject_Not, 18, "PyObject_Not" },
-@@ -1051,6 +1095,7 @@
-     { (void *)PyTuple_New, 39, "PyTuple_New" },
- /* 18 */
-     { (void *)PyTuple_Size, 18, "PyTuple_Size" },
-+    { (void *)PyTuple_Check, 18, "PyTuple_Check" },
- /* 40 */
-     { (void *)PyTuple_GetItem, 40, "PyTuple_GetItem" },
- /* 41 */
-@@ -1385,3 +1430,24 @@
-     CAMLreturn(Val_unit);
- }
-+
-+value pycaml_setargs(value argv) {
-+  CAMLparam1(argv);
-+  char* cargv[1];
-+
-+  cargv[0] = String_val(argv);
-+
-+  PySys_SetArgv(1, cargv);
-+
-+  CAMLreturn0; 
-+}
-+
-+value pytrue( value unit ) {
-+    CAMLparam1(unit);
-+    CAMLreturn(pywrap(Py_True));
-+}
-+
-+value pyfalse(value unit) {
-+    CAMLparam1(unit);
-+    CAMLreturn(pywrap(Py_False));
-+}
diff --git a/pycaml/ocamlobj.ml b/pycaml/ocamlobj.ml
deleted file mode 100644 (file)
index 651fd1e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-open Pycaml
-
-let foo_bar_print = pywrap_closure (fun x -> print_endline "hi" ; pynone ()) ;;
-let sd = pyimport_getmoduledict () ;;
-let mx = pymodule_new "CamlModule" ;;
-let cd = pydict_new () ;;
-let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
-let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
-let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
-let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
-let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;
-let _ = pyrun_interactiveloop (0,"-") ;;
diff --git a/pycaml/pycaml.html b/pycaml/pycaml.html
deleted file mode 100644 (file)
index d476329..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-<html>
-<head>
-<title>Module Pycaml</title>
-</head>
-<body>
-<table border=0 width="100%"><tr><td bgcolor="#c0c0c0">
-<h1>Pycaml</h1>
-</td></tr></table>
-<p>
-<h2>What is Pycaml</h2>
-A library written by <a href=mailto:arty@users.sourceforge.net>
-arty@users.sourceforge.net</a> which follows the Python/C API as
-closely as possible, while
-providing equivalent functionality for objective caml.  This is built
-against python 2.x and Ocaml 3.04.<p>  It is intended to allow users to
-build native ocaml libraries and use them from python, and alternately,
-in order to allow ocaml users to benefit from linkable libraries provided
-for python.<p>
-I created this library in order to take advantage of python binding for
-certain native libraries from ocaml.  While it is true that I could have
-written new interfaces specifically for ocaml, the python interface is
-sufficient for my needs, and this project was easier.<p>
-
-<b>Note:</b> Unfortunately, the symbol <tt>init_exceptions</tt> exists in
-both compiled ocaml code, and the python runtime.  In order to proceed, you
-must rename this symbol either in the ocaml distribution (in byterun/fail.c,
-and byterun/startup.c), or in the python distribution, and rebuild the 
-software appropriately.<p>
-
-Please edit the <tt>Makefile</tt> to put in your system's libraries used for
-compiling programs embedded with python.  This library compiles on most
-linux boxes without modification.  The python interpreter is used to determine
-the path to the python library and must be in your path when you run make.
-<p>
-
-<b>Get the distribution here:</b><a href=pycaml.tar.gz>pycaml.tar.gz</a><p>
-
-Because these are made to closely mirror the python API, the user should
-become familiar with the python API.<p>
-Given Ocaml parameter passing convention, it was convenient to pass multiple
-arguments as members of a tuple, but single arguments without.  Consequently,
-functions with arity 1, such as pytuple_new are called as<p>
-<pre>
-  pytuple_new 3 ;;
-</pre><p>
-And functions with more arguments are called as<p>
-<pre>
-  pydict_getitemstring (dict,"keystring") ;;
-</pre>
-
-<h2>Module Pycaml</h2>
-
-<h3>Visible Types</h3>
-
-<table border=0>
-<tr bgcolor="#c0c0c0"><td>type</td><td width="100%">pyobject</td></tr>
-<tr><td colspan=2>
-The abstract type of python objects.
-</td></tr>
-<tr bgcolor="#c0c0c0"><td>type</td><td>pyobject_type =</td></tr>
-<tr><td align=right></td><td>TupleType</td></tr>
-<tr><td align=right>|</td><td>StringType</td></tr>
-<tr><td align=right>|</td><td>IntType</td></tr>
-<tr><td align=right>|</td><td>FloatType</td></tr>
-<tr><td align=right>|</td><td>ListType</td></tr>
-<tr><td align=right>|</td><td>NoneType</td></tr>
-<tr><td align=right>|</td><td>CallableType</td></tr>
-<tr><td align=right>|</td><td>ModuleType</td></tr>
-<tr><td align=right>|</td><td>ClassType</td></tr>
-<tr><td align=right>|</td><td>TypeType</td></tr>
-<tr><td align=right>|</td><td>OtherType</td></tr>
-<tr><td colspan=2>
-The type representing the range of types available to python programs.
-Values of this type are provided by the pytype function, and identify the
-python type of opaque pyobject objects.
-</td></tr></table>
-
-<h3>Supported Functions from the Python/C API</h3>
-In each case, the signature of the function is unchanged from the Python/C
-API except for the case of 'out' pointer to pointer parameters; 
-in the case of a single return, the returned value is copied, otherwise, 
-a tuple is created with copies of all output parameters.  In the case of
-zero parameter, or void return, unit is used.<p>
-In python API functions that take a FILE *, an int file descriptor is used
-instead such as those returned by the Unix library.<p>
-
-<h4>fun unit -> unit</h4>
-py_initialize, py_finalize, pyerr_print, pyerr_clear, pyimport_cleanup
-<h4>fun int -> unit</h4>
-py_exit, pyerr_printex
-<h4>fun string -> unit</h4>
-py_setprogramname, py_setpythonhome
-<h4>fun unit -> int</h4>
-py_isinitialized, pyeval_getrestricted
-<h4>fun string -> int</h4>
-pyrun_simplestring, pyimport_importfrozenmodule,
-<h4>fun (int * string) -> int</h4>
-pyrun_anyfile, pyrun_simplefile, pyrun_interactiveone, pyrun_interactiveloop,
-py_fdisinteractive
-<h4>fun (int * string * int) -> int</h4>
-pyrun_anyfileex, pyrun_simplefileex
-<h4>fun unit -> string</h4>
-py_getprogramname, py_getpthonhome, py_getprogramfullpath, py_getprefix,
-py_getexecprefix, py_getpath, py_getversion, py_getplatform, py_getcopyright,
-py_getcompiler, py_getbuildinfo
-<h4>fun (string * int * pyobject * pyobject) -> pyobject</h4>
-pyrun_string
-<h4>fun (int * string * int * pyobject * pyobject) -> pyobject</h4>
-pyrun_file
-<h4>fun (int * string * int * pyobject * pyobject * int) -> pyobject</h4>
-pyrun_fileex
-<h4>fun (string * string * int) -> pyobject</h4>
-py_compilestring
-<h4>fun (pyobject * int * int) -> int</h4>
-pyobject_print, pytuple_getslice, pysequence_getslice</h4>
-<h4>fun pyobject -> pyobject</h4>
-pyobject_repr, pyobject_str, pyobject_unicode, pydict_keys, pydict_values,
-pydict_items, pydict_copy, pymodule_getdict, pymethod_function, pymethod_self,
-pymethod_class, pymodule_getdict, pyimport_reloadmodule, pyobject_type, 
-pynumber_negative, pynumber_positive, pynumber_absolute, pynumber_invert,
-pynumber_int, pynumber_long, pynumber_float, pysequence_tuple, pysequence_list
-<h4>fun (pyobject * pyobject * int) -> pyobject</h4>
-pyobject_richcompare
-<h4>fun (pyobject * string) -> pyobject</h4>
-pyobject_getattrstring, pydict_getitemstring, pysequence_fast, 
-pymapping_haskeystring, pymapping_getitemstring
-<h4>fun (pyobject * pyobject) -> pyobject</h4>
-pyobject_getattr, pystring_format, pydict_getitem, pyinstance_newraw, 
-pyeval_callobject, pyobject_getitem, pyobject_delitem, pynumber_add,
-pynumber_subtract, pynumber_multiply, pynumber_divide, pynumber_remainder,
-pynumber_divmod, pynumber_lshift, pynumber_rshift, pynumber_and, pynumber_xor,
-pynumber_or, pynumber_inplaceadd, pynumber_inplacesubtract, pynumber_inplacemultiply, pynumber_inplacedivide, pynumber_inplaceremainder, pynumber_inplacelshift, pynumber_inplacershift, pynumber_inplaceand, pynumber_inplacexor, pynumber_inplaceor, pysequence_concat, pysequence_inplaceconcat
-<h4>fun pyobject -> int</h4>
-pyobject_istrue, pyobject_not, pycalable_check, pystring_size, pydict_size,
-pytuple_new, pyerr_exceptionmatches, pyobject_size, pynumber_check, 
-pysequence_check, pysequence_size, pysequence_length, pymapping_check,
-pymapping_size, pymapping_length, pyint_asint
-<h4>fun (pyobject * pyobject) -> int</h4>
-pyobject_compare, pyobject_hasattr, pydict_delitem, 
-pyerr_givenexceptionmatches, pysequence_count, pysequence_contains, 
-pysequence_in, pysequence_index, pymapping_haskey
-<h4>fun (pyobject * pyobject * int) -> int</h4>
-pyobject_richcomparebool, pysequence_delitem
-<h4>fun (pyobject * string * pyobject) -> int</h4>
-pyobject_setattrstring, pydict_setitemstring
-<h4>fun (pyobject * string) -> int</h4>
-pyobject_hasattrstring, pydict_delitemstring, pysequence_inplacerepeat
-<h4>fun (pyobject * pyobject) -> (pyobject * pyobject)</h4>
-pynumber_coerce, pynumber_coerceex
-<h4>fun (pyobject * pyobject * pyobject) -> int</h4>
-pyobject_setattr, pydict_setitem, pyobject_setitem
-<h4>fun pyobject -> int64</h4>
-pyobject_hash, pyint_aslong
-<h4>fun pyobject -> string</h4>
-pystring_asstring, pymodule_getname, pymodule_getfilename
-<h4>fun (pyobject * pyobject) -> pyobject</h4>
-pystring_concat, pystring_concatanddel
-<h4>fun string -> pyobject</h4>
-pystring_fromstring, pymodule_new, pyimport_addmodule, pyimport_importmodule,
-pyimport_import
-<h4>fun unit -> pyobject</h4>
-pydict_new, pyerr_occurred, pyimport_getmoduledict, pyeval_getbuiltins,
-pyeval_getglobals, pyeval_getlocals, pyeval_getframe
-<h4>fun pyobject -> unit</h4>
-pydict_clear, pyerr_setnone
-<h4>fun (pyobject * int) -> (pyobject * pyobject * int)</h4>
-pydict_next
-<h4>fun int64 -> pyobject</h4>
-pyint_fromlong
-<h4>fun unit -> int64</h4>
-pyint_getmax
-<h4>fun float -> pyobject</h4>
-pyfloat_fromdouble
-<h4>fun pyobject -> float</h4>
-pyfloat_asdouble
-<h4>fun int -> pyobject</h4>
-pytuple_new, pyint_fromint
-<h4>fun (pyobject * int) -> pyobject</h4>
-pytuple_getitem, pysequence_repeat, pysequence_getitem
-<h4>fun (pyobject * int * pyobject) -> int</h4>
-pytuple_setitem, pysequence_setitem, pymapping_setitem
-<h4>fun (pyobject * pyobject * pyobject) -> pyobject</h4>
-pyslice_new, pyclass_new, pyinstance_new, pymethod_new, 
-pyeval_callobjectwithkeywords, pynumber_power, pynumber_inplacepower
-<h4>fun (pyobject * int) -> (int * int * int)</h4>
-pyslice_getindices
-<h4>fun (int * int * int * int) -> pyobject</h4>
-pyrange_new
-<h4>fun (pyobject * pyobject) -> unit</h4>
-pyerr_setobject
-<h4>fun (pyobject * string) -> unit</h4>
-pyerr_setstring
-<h4>fun (pyobject * pyobject * pyobject) -> (pyobject * pyobject * pyobject)</h4>
-pyerr_fetch, pyerr_normalizeexception
-<h4>fun (pyobject * pyobject * pyobject) -> unit</h4>
-pyerr_restore
-<h4>fun (pyobject * string) -> pyobject</h4>
-pyimport_execcodemodule
-<h4>fun (string * pyobject * string) -> pyobject</h4>
-pyimport_execcodemoduleex
-<h4>fun (string * pyobject * pyobject * pyobject) -> pyobject</h4>
-pyimport_importmoduleex
-<h4>fun pyobject -> string</h4>
-pyobject_ascharbuffer, pyobject_asreadbuffer, pyobject_aswritebuffer
-<h4>fun (pyobject * int * int * pyobject) -> int</h4>
-pysequence_setslice
-<h4>fun (pyobject * int * int) -> int</h4>
-pysequence_delslice
-
-<h3>Unique Functions Needed for Ocaml</h3>
-In addition to the functions in the usual library, several new functions are
-provided which give specific support for ocaml.<p>
-
-<table border=0 width=100%>
-<tr bgcolor="#c0c0c0">
-<td><b>pytuple_toarray</b></td>
-<td>pyobject -> pyobject array</td></tr>
-<tr><td colspan=2>
-Convert a python tuple to an ocaml array containing the same items.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pywrap_closure</b></td><td>(pyobject -> pyobject) -> pyobject</td></tr>
-<tr><td colspan=2>
-Create a python callable object from a closure.  The closure receives the
-argument tuple from the invocation and returns a pyobject.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pywrap_value</b></td><td>'a -> pyobject</td></tr>
-<tr><td colspan=2>
-Create a simple void * style wrapping around an ocaml object.  The object
-may be retrieved with <tt>pyunwrap_value : pyobject -> 'a</tt>.  Use this
-to enclose an ocaml data structure in python to be used later.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pynull</b></td><td>unit -> pyobject</td></tr>
-<tr><td colspan=2>
-Generate the null PyObject * and return it.  This may sound dangerous, but
-it is used by library calls to indicate errors to the python system.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pynone</b></td><td>unit -> pyobject</td></tr>
-<tr><td colspan=2>
-Generate a reference to the Py_None object.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pytuple_fromarray</b></td>
-<td>pyobject array -> pyobject</td></tr>
-<tr><td colspan=2>
-Create a pytuple (as would be used for a function call) from the given
-array.  This may be used to implement varargs calls on python functions,
-and for other purposes.
-</td></tr>
-<tr bgcolor="#c0c0c0">
-<td><b>pytuple_empty</b></td>
-<td>pyobject array -> pyobject</td></tr>
-<tr><td colspan=2>
-Shortcut for <tt>pytuple_new 0</tt>
-</td></tr>
-
-<tr bgcolor="#c0c0c0">
-<td><b>pytuple_fromsingle</b></td>
-<td>pyobject -> pyobject</tt></td></tr>
-<tr><td colspan=2>
-Create a tuple with the single given object inside.  Use this to create
-single element tuples as for a function call with one argument.
-</td></tr>
-
-<tr bgcolor="#c0c0c0">
-<td><b>pytuple<i>1-5</i></b></td>
-<td>(pyobject * ...) -> pyobject</tt></td></tr>
-<tr><td colspan=2>
-Create a python tuple that has the same contents as the given ocaml tuple.
-</td></tr>
-
-<tr bgcolor="#c0c0c0">
-<td><b>pytype</b></td>
-<td>pyobject -> pyobject_type</tt></td></tr>
-<tr><td colspan=2>
-Determine roughly which type family the given value belongs to.  For example,
-<tt>pytype (pystring_fromstring "hi")</tt> yields <tt>StringType</tt>.
-</td></tr>
-</table>
-
-<h3>Sample Application</h3>
-This is the sample application that I developed the library with.  It 
-illustrates a python function call, as well as a call back into ocaml.
-The first form is used in cases where python libraries are to be used
-from ocaml, and the second would be used to produce native libraries in
-ocaml.<p>
-
-<pre>
-open Pycaml ;;
-
-let colorsys = pyimport_importmodule "colorsys"
-let dict = pymodule_getdict colorsys
-
-let triplet = pytuple3 (pyfloat_fromdouble 1.0,
-                       pyfloat_fromdouble 0.5,
-                       pyfloat_fromdouble 0.2) ;;
-
-let rgbtoyiq = pydict_getitemstring (dict,"rgb_to_yiq")
-let triplet = pyeval_callobject (rgbtoyiq,triplet)
-
-let _ = print_endline ((string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,0)))) ^ 
-                      " " ^
-                      (string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,1)))) ^
-                      " " ^
-                      (string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,2))))) ;;
-
-let x = pywrap_closure 
-    (fun x -> print_string (pystring_asstring (pytuple_getitem (x,0))) ; 
-      pynone ())
-
-let _ = pyeval_callobject 
-    (x,pytuple_fromsingle (pystring_fromstring "hi there"))
-</pre>
-</body>
-</html>
diff --git a/pycaml/pycaml.ml b/pycaml/pycaml.ml
deleted file mode 100644 (file)
index 68f9fd2..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-(*
- * (C) arty 2002
- * This software is covered under the GNU lesser general public license
- *)
-
-open Int64 ;;
-
-type funcptr
-type pyobject
-type funcent = (funcptr * int * int)
-
-type pymodule_func = { pyml_name : string ;
-                      pyml_func : (pyobject -> pyobject) ;
-                      pyml_flags : int ;
-                      pyml_doc : string }
-
-type pyobject_type =
-    TupleType
-  | StringType
-  | IntType
-  | FloatType
-  | ListType
-  | NoneType
-  | CallableType
-  | ModuleType
-  | ClassType
-  | NullType
-  | TypeType
-  | OtherType
-
-      (* Function list *)
-
-external getfuncarray : unit -> funcent array = "pygetfuncarray"
-let py_funcs = getfuncarray ()
-external pytype : pyobject -> pyobject_type = "pytype"
-
-external pyfuncall1 : (funcptr * int * int) -> unit -> unit = "pygencall"
-external pyfuncall2 : (funcptr * int * int) -> int -> unit = "pygencall"
-external pyfuncall3 : (funcptr * int * int) -> string -> unit = "pygencall"
-external pyfuncall4 : (funcptr * int * int) -> unit -> int = "pygencall"
-external pyfuncall5 : (funcptr * int * int) -> string -> int = "pygencall"
-external pyfuncall6 : (funcptr * int * int) -> (int * string) -> int = "pygencall"
-external pyfuncall7 : (funcptr * int * int) -> (int * string * int) -> int =
-  "pygencall"
-external pyfuncall8 : (funcptr * int * int) -> unit -> string = "pygencall"
-external pyfuncall9 : (funcptr * int * int) -> (string * int * pyobject * pyobject) -> pyobject = "pygencall"
-external pyfuncall10 : (funcptr * int * int) ->
-  (int * string * int * pyobject * pyobject) -> pyobject = "pygencall"
-external pyfuncall11 : (funcptr * int * int) ->
-  (int * string * int * pyobject * pyobject * int) -> pyobject = "pygencall"
-external pyfuncall12 : (funcptr * int * int) ->
-  (string * string * int) -> pyobject = "pygencall"
-external pyfuncall13 : (funcptr * int * int) ->
-  (pyobject * int * int) -> int = "pygencall"
-external pyfuncall14 : (funcptr * int * int) -> pyobject -> pyobject = "pygencall"
-external pyfuncall15 : (funcptr * int * int) -> (pyobject * pyobject * int) -> pyobject = "pygencall"
-external pyfuncall16 : (funcptr * int * int) -> (pyobject * string) -> pyobject = "pygencall"
-external pyfuncall17 : (funcptr * int * int) -> (pyobject * pyobject) -> pyobject = "pygencall"
-external pyfuncall18 : (funcptr * int * int) -> pyobject -> int = "pygencall"
-external pyfuncall19 : (funcptr * int * int) -> (pyobject * pyobject) -> int = "pygencall"
-external pyfuncall20 : (funcptr * int * int) -> (pyobject * pyobject * int) -> int = "pygencall"
-external pyfuncall21 : (funcptr * int * int) -> (pyobject * string * pyobject) -> int = "pygencall"
-external pyfuncall22 : (funcptr * int * int) -> (pyobject * string) -> int = "pygencall"
-external pyfuncall23 : (funcptr * int * int) -> (pyobject * pyobject) -> (pyobject * pyobject) option = "pygencall"
-external pyfuncall24 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) -> int = "pygencall"
-external pyfuncall25 : (funcptr * int * int) -> pyobject -> int64 = "pygencall"
-external pyfuncall26 : (funcptr * int * int) -> pyobject -> string = "pygencall"
-external pyfuncall27 : (funcptr * int * int) -> (pyobject * pyobject) -> pyobject = "pygencall"
-external pyfuncall28 : (funcptr * int * int) -> string -> pyobject = "pygencall"
-external pyfuncall29 : (funcptr * int * int) -> unit -> pyobject = "pygencall"
-external pyfuncall30 : (funcptr * int * int) -> pyobject -> unit = "pygencall"
-external pyfuncall31 : (funcptr * int * int) -> (pyobject * int) ->
-  (pyobject * pyobject * int) option = "pygencall"
-external pyfuncall34 : (funcptr * int * int) -> int64 -> pyobject = "pygencall"
-external pyfuncall35 : (funcptr * int * int) -> unit -> int64 = "pygencall"
-external pyfuncall36 : (funcptr * int * int) -> float -> pyobject = "pygencall"
-external pyfuncall37 : (funcptr * int * int) -> pyobject -> float = "pygencall"
-external pyfuncall39 : (funcptr * int * int) -> int -> pyobject = "pygencall"
-external pyfuncall40 : (funcptr * int * int) -> (pyobject * int) ->
-  pyobject = "pygencall"
-external pyfuncall41 : (funcptr * int * int) -> (pyobject * int * pyobject) ->
-  int = "pygencall"
-external pyfuncall42 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
-  pyobject = "pygencall"
-external pyfuncall43 : (funcptr * int * int) -> (pyobject * int) ->
-  (int * int * int) option = "pygencall"
-external pyfuncall44 : (funcptr * int * int) -> (int * int * int * int) ->
-  pyobject = "pygencall"
-external pyfuncall45 : (funcptr * int * int) -> (pyobject * pyobject) -> unit =
-  "pygencall"
-external pyfuncall46 : (funcptr * int * int) -> (pyobject * string) -> unit =
-  "pygencall"
-external pyfuncall47 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
-  (pyobject * pyobject * pyobject) = "pygencall"
-external pyfuncall48 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
-  unit = "pygencall"
-external pyfuncall49 : (funcptr * int * int) -> (pyobject * string) -> pyobject =
-  "pygencall"
-external pyfuncall50 : (funcptr * int * int) -> (string * pyobject * string) ->
-  pyobject = "pygencall"
-external pyfuncall51 : (funcptr * int * int) ->
-  (string * pyobject * pyobject * pyobject) -> pyobject = "pygencall"
-external pyfuncall52 : (funcptr * int * int) -> pyobject -> string = "pygencall"
-external pyfuncall53 : (funcptr * int * int) -> (pyobject * int * int * pyobject) -> int = "pygencall"
-external pyfuncall54 : (funcptr * int * int) -> (pyobject * int * int) -> int =
-  "pygencall"
-
-let fmt1call func = pyfuncall1 func
-let fmt2call func = pyfuncall2 func
-let fmt3call func = pyfuncall3 func
-let fmt4call func = pyfuncall4 func
-let fmt5call func = pyfuncall5 func
-let fmt6call func = pyfuncall6 func
-let fmt7call func = pyfuncall7 func
-let fmt8call func = pyfuncall8 func
-let fmt9call func = pyfuncall9 func
-let fmt10call func = pyfuncall10 func
-let fmt11call func = pyfuncall11 func
-let fmt12call func = pyfuncall12 func
-let fmt13call func = pyfuncall13 func
-let fmt14call func = pyfuncall14 func
-let fmt15call func = pyfuncall15 func
-let fmt16call func = pyfuncall16 func
-let fmt17call func = pyfuncall17 func
-let fmt18call func = pyfuncall18 func
-let fmt19call func = pyfuncall19 func
-let fmt20call func = pyfuncall20 func
-let fmt21call func = pyfuncall21 func
-let fmt22call func = pyfuncall22 func
-let fmt23call func = pyfuncall23 func
-let fmt24call func = pyfuncall24 func
-let fmt25call func = pyfuncall25 func
-let fmt26call func = pyfuncall26 func
-let fmt27call func = pyfuncall27 func
-let fmt28call func = pyfuncall28 func
-let fmt29call func = pyfuncall29 func
-let fmt30call func = pyfuncall30 func
-let fmt31call func = pyfuncall31 func
-      (* 32 *)
-      (* 33 *)
-let fmt34call func = pyfuncall34 func
-let fmt35call func = pyfuncall35 func
-let fmt36call func = pyfuncall36 func
-let fmt37call func = pyfuncall37 func
-      (* 38 *)
-let fmt39call func = pyfuncall39 func
-let fmt40call func = pyfuncall40 func
-let fmt41call func = pyfuncall41 func
-let fmt42call func = pyfuncall42 func
-let fmt43call func = pyfuncall43 func
-let fmt44call func = pyfuncall44 func
-let fmt45call func = pyfuncall45 func
-let fmt46call func = pyfuncall46 func
-let fmt47call func = pyfuncall47 func
-let fmt48call func = pyfuncall48 func
-let fmt49call func = pyfuncall49 func
-let fmt50call func = pyfuncall50 func
-let fmt51call func = pyfuncall51 func
-let fmt52call func = pyfuncall52 func
-let fmt53call func = pyfuncall53 func
-let fmt54call func = pyfuncall54 func
-
-let py_cur_func_num = ref 0
-let pnf () = let this_func = py_funcs.(!py_cur_func_num) in
-py_cur_func_num := !py_cur_func_num + 1 ; this_func
-
-      (* 1 *)
-let py_initialize = fmt1call (pnf ())
-let py_finalize = fmt1call (pnf ())
-let pyerr_print = fmt1call (pnf ())
-      (* 2 *)
-let py_exit = fmt2call (pnf ())
-let pyerr_printex = fmt2call (pnf ())
-      (* 3 *)
-let py_setprogramname = fmt3call (pnf ())
-let py_setpythonhome = fmt3call (pnf ())
-      (* 4 *)
-let py_isinitialized = fmt4call (pnf ())
-      (* 5 *)
-let pyrun_simplestring = fmt5call (pnf ())
-      (* 6 *)
-let pyrun_anyfile = fmt6call (pnf ())
-let pyrun_simplefile = fmt6call (pnf ())
-let pyrun_interactiveone = fmt6call (pnf ())
-let pyrun_interactiveloop = fmt6call (pnf ())
-let py_fdisinteractive = fmt6call (pnf ())
-      (* 7 *)
-let pyrun_anyfileex = fmt7call (pnf ())
-let pyrun_simplefileex = fmt7call (pnf ())
-      (* 8 *)
-let py_getprogramname = fmt8call (pnf ())
-let py_getpythonhome = fmt8call (pnf ())
-let py_getprogramfullpath = fmt8call (pnf ())
-let py_getprefix = fmt8call (pnf ())
-let py_getexecprefix = fmt8call (pnf ())
-let py_getpath = fmt8call (pnf ())
-let py_getversion = fmt8call (pnf ())
-let py_getplatform = fmt8call (pnf ())
-let py_getcopyright = fmt8call (pnf ())
-let py_getcompiler = fmt8call (pnf ())
-let py_getbuildinfo = fmt8call (pnf ())
-      (* 9 *)
-let pyrun_string = fmt9call (pnf ())
-      (* 10 *)
-let pyrun_file = fmt10call (pnf ())
-      (* 11 *)
-let pyrun_fileex = fmt11call (pnf ())
-      (* 12 *)
-let py_compilestring = fmt12call (pnf ())
-      (* 13 *)
-let pyobject_print = fmt13call (pnf ())
-      (* 14 *)
-let pyobject_repr = fmt14call (pnf ())
-let pyobject_str = fmt14call (pnf ())
-let pyobject_unicode = fmt14call (pnf ())
-(* 15 *)
-let pyobject_richcompare = fmt15call (pnf ())
-(* 16 *)
-let pyobject_getattrstring = fmt16call (pnf ())
-(* 17 *)
-let pyobject_getattr = fmt17call (pnf ())
-let pyobject_callobject = fmt17call (pnf ())
-(* 18 *)
-let pyobject_istrue = fmt18call (pnf ())
-let pyobject_not = fmt18call (pnf ())
-let pycallable_check = fmt18call (pnf ())
-(* 19 *)
-let pyobject_compare = fmt19call (pnf ())
-let pyobject_hasattr = fmt19call (pnf ())
-(* 20 *)
-let pyobject_richcomparebool = fmt20call (pnf ())
-(* 21 *)
-let pyobject_setattrstring = fmt21call (pnf ())
-(* 22 *)
-let pyobject_hasattrstring = fmt22call (pnf ())
-(* 23 *)
-let pynumber_coerce = fmt23call (pnf ())
-let pynumber_coerceex = fmt23call (pnf ())
-(* 24 *)
-let pyobject_setattr = fmt24call (pnf ())
-(* 25 *)
-let pyobject_hash = fmt25call (pnf ())
-(* Strings *)
-(* 18 *)
-let pystring_size = fmt18call (pnf ())
-(* 26 *)
-let pystring_asstring = fmt26call (pnf ())
-(* 27 *)
-let pystring_concat = fmt27call (pnf ())
-let pystring_concatanddel = fmt27call (pnf ())
-(* 28 *)
-let pystring_fromstring = fmt28call (pnf ())
-(* 17 *)
-let pystring_format = fmt17call (pnf ())
-
-(* Dictionaries *)
-(* 29 *)
-let pydict_new = fmt29call (pnf ())
-(* 17 *)
-let pydict_getitem = fmt17call (pnf ())
-(* 24 *)
-let pydict_setitem = fmt24call (pnf ())
-(* 19 *)
-let pydict_delitem = fmt19call (pnf ())
-(* 30 *)
-let pydict_clear = fmt30call (pnf ())
-(* 31 *)
-let pydict_next = fmt31call (pnf ())
-(* 14 *)
-let pydict_keys = fmt14call (pnf ())
-let pydict_values = fmt14call (pnf ())
-let pydict_items = fmt14call (pnf ())
-let pydict_copy = fmt14call (pnf ())
-(* 18 *)
-let pydict_size = fmt18call (pnf ())
-(* 16 *)
-let pydict_getitemstring = fmt16call (pnf ())
-(* 22 *)
-let pydict_delitemstring = fmt22call (pnf ())
-(* 21 *)
-let pydict_setitemstring = fmt21call (pnf ())
-
-(* Integer *)
-(* 34 *)
-let pyint_fromlong = fmt34call (pnf ())
-(* 25 *)
-let pyint_aslong = fmt25call (pnf ())
-(* 35 *)
-let pyint_getmax = fmt35call (pnf ())
-
-(* Float *)
-(* 36 *)
-let pyfloat_fromdouble = fmt36call (pnf ())
-(* 37 *)
-let pyfloat_asdouble = fmt37call (pnf ())
-
-(* Modules *)
-(* 28 *)
-let pymodule_new = fmt28call (pnf ())
-(* 14 *)
-let pymodule_getdict = fmt14call (pnf ())
-(* 26 *)
-let pymodule_getname = fmt26call (pnf ())
-let pymodule_getfilename = fmt26call (pnf ())
-
-(* 39 *)
-let pytuple_new = fmt39call (pnf ())
-(* 18 *)
-let pytuple_size = fmt18call (pnf ())
-let pytuple_check = fmt18call (pnf ())
-(* 40 *)
-let pytuple_getitem = fmt40call (pnf ())
-(* 41 *)
-let pytuple_setitem = fmt41call (pnf ())
-(* 13 *)
-let pytuple_getslice = fmt13call (pnf ())
-
-(* 42 *)
-let pyslice_new = fmt42call (pnf ())
-(* 43 *)
-let pyslice_getindices = fmt43call (pnf ())
-(* 44 *)
-let pyrange_new = fmt44call (pnf ())
-
-(* Error handling definitions *)
-
-(* 30 *)
-let pyerr_setnone = fmt30call (pnf ())
-(* 45 *)
-let pyerr_setobject = fmt45call (pnf ())
-(* 46 *)
-let pyerr_setstring = fmt46call (pnf ())
-(* 29 *)
-let pyerr_occurred = fmt29call (pnf ())
-(* 1 *)
-let pyerr_clear = fmt1call (pnf ())
-(* 47 *)
-let pyerr_fetch = fmt47call (pnf ())
-(* 48 *)
-let pyerr_restore = fmt48call (pnf ())
-
-(* Error testing and normalization *)
-(* 19 *)
-let pyerr_givenexceptionmatches = fmt19call (pnf ())
-(* 18 *)
-let pyerr_exceptionmatches = fmt18call (pnf ())
-(* 47 *)
-let pyerr_normalizeexception = fmt47call (pnf ())
-
-(* Classes *)
-(* 42 *)
-let pyclass_new = fmt42call (pnf ())
-(* 42 *)
-let pyinstance_new = fmt42call (pnf ())
-
-(* 17 *)
-let pyinstance_newraw = fmt17call (pnf ())
-(* 42 *)
-let pymethod_new = fmt42call (pnf ())
-(* 14 *)
-let pymethod_function = fmt14call (pnf ())
-let pymethod_self = fmt14call (pnf ())
-let pymethod_class = fmt14call (pnf ())
-
-(* Module *)
-(* 28 *)
-let pymodule_new = fmt28call (pnf ())
-(* 14 *)
-let pymodule_getdict = fmt14call (pnf ())
-(* 26 *)
-let pymodule_getname = fmt26call (pnf ())
-let pymodule_getfilename = fmt26call (pnf ())
-(* 35 *)
-let pyimport_getmagicnumber = fmt35call (pnf ())
-(* 49 *)
-let pyimport_execcodemodule = fmt49call (pnf ())
-(* 50 *)
-let pyimport_execcodemoduleex = fmt50call (pnf ())
-(* 29 *)
-let pyimport_getmoduledict = fmt29call (pnf ())
-(* 28 *)
-let pyimport_addmodule = fmt28call (pnf ())
-let pyimport_importmodule = fmt28call (pnf ())
-(* - disabled, see comment in pycaml_ml.c.  - RWMJ
-(* 51 *)
-let pyimport_importmoduleex = fmt51call (pnf ())
-*)
-(* 28 *)
-let pyimport_import = fmt28call (pnf ())
-(* 14 *)
-let pyimport_reloadmodule = fmt14call (pnf ())
-(* 1 *)
-let pyimport_cleanup = fmt1call (pnf ())
-(* 5 *)
-let pyimport_importfrozenmodule = fmt5call (pnf ())
-
-(* Interface to random parts in ceval.c *)
-(* 42 *)
-let pyeval_callobjectwithkeywords = fmt42call (pnf ())
-(* 17 *)
-(* dropped in Python 2.7
-let pyeval_callobject = fmt17call (pnf ()) *)
-
-(* 29 *)
-let pyeval_getbuiltins = fmt29call (pnf ())
-let pyeval_getglobals = fmt29call (pnf ())
-let pyeval_getlocals = fmt29call (pnf ())
-let pyeval_getframe = fmt29call (pnf ())
-(* 4 *)
-let pyeval_getrestricted = fmt4call (pnf ())
-
-(* Abstract layer *)
-(* 14 *)
-let pyobject_type = fmt14call (pnf ())
-(* 18 *)
-let pyobject_size = fmt18call (pnf ())
-(* 17 *)
-let pyobject_getitem = fmt17call (pnf ())
-(* 24 *)
-let pyobject_setitem = fmt24call (pnf ())
-(* 17 *)
-let pyobject_delitem = fmt17call (pnf ())
-(* 52 *)
-let pyobject_ascharbuffer = fmt52call (pnf ())
-let pyobject_asreadbuffer = fmt52call (pnf ())
-let pyobject_aswritebuffer = fmt52call (pnf ())
-(* 18 *)
-let pynumber_check = fmt18call (pnf ())
-(* 17 *)
-let pynumber_add = fmt17call (pnf ())
-let pynumber_subtract = fmt17call (pnf ())
-let pynumber_multiply = fmt17call (pnf ())
-let pynumber_divide = fmt17call (pnf ())
-let pynumber_remainder = fmt17call (pnf ())
-let pynumber_divmod = fmt17call (pnf ())
-(* 42 *)
-let pynumber_power = fmt42call (pnf ())
-(* 14 *)
-let pynumber_negative = fmt14call (pnf ())
-let pynumber_positive = fmt14call (pnf ())
-let pynumber_absolute = fmt14call (pnf ())
-let pynumber_invert = fmt14call (pnf ())
-(* 17 *)
-let pynumber_lshift = fmt17call (pnf ())
-let pynumber_rshift = fmt17call (pnf ())
-let pynumber_and = fmt17call (pnf ())
-let pynumber_xor = fmt17call (pnf ())
-let pynumber_or = fmt17call (pnf ())
-(* 14 *)
-let pynumber_int = fmt14call (pnf ())
-let pynumber_long = fmt14call (pnf ())
-let pynumber_float = fmt14call (pnf ())
-(* 17 *)
-let pynumber_inplaceadd = fmt17call (pnf ())
-let pynumber_inplacesubtract = fmt17call (pnf ())
-let pynumber_inplacemultiply = fmt17call (pnf ())
-let pynumber_inplacedivide = fmt17call (pnf ())
-let pynumber_inplaceremainder = fmt17call (pnf ())
-let pynumber_inplacelshift = fmt17call (pnf ())
-let pynumber_inplacershift = fmt17call (pnf ())
-let pynumber_inplaceand = fmt17call (pnf ())
-let pynumber_inplacexor = fmt17call (pnf ())
-let pynumber_inplaceor = fmt17call (pnf ())
-(* 42 *)
-let pynumber_inplacepower = fmt42call (pnf ())
-(* 18 *)
-let pysequence_check = fmt18call (pnf ())
-let pysequence_size = fmt18call (pnf ())
-let pysequence_length = fmt18call (pnf ())
-(* 17 *)
-let pysequence_concat = fmt17call (pnf ())
-(* 40 *)
-let pysequence_repeat = fmt40call (pnf ())
-let pysequence_getitem = fmt40call (pnf ())
-(* 13 *)
-let pysequence_getslice = fmt13call (pnf ())
-(* 41 *)
-let pysequence_setitem = fmt41call (pnf ())
-(* 20 *)
-let pysequence_delitem = fmt20call (pnf ())
-(* 53 *)
-let pysequence_setslice = fmt53call (pnf ())
-(* 54 *)
-let pysequence_delslice = fmt54call (pnf ())
-(* 14 *)
-let pysequence_tuple = fmt14call (pnf ())
-let pysequence_list = fmt14call (pnf ())
-(* 16 *)
-let pysequence_fast = fmt16call (pnf ())
-(* 19 *)
-let pysequence_count = fmt19call (pnf ())
-let pysequence_contains = fmt19call (pnf ())
-let pysequence_in = fmt19call (pnf ())
-let pysequence_index = fmt19call (pnf ())
-(* 17 *)
-let pysequence_inplaceconcat = fmt17call (pnf ())
-(* 22 *)
-let pysequence_inplacerepeat = fmt22call (pnf ())
-(* 18 *)
-let pymapping_check = fmt18call (pnf ())
-let pymapping_size = fmt18call (pnf ())
-let pymapping_length = fmt18call (pnf ())
-(* 16 *)
-let pymapping_haskeystring = fmt16call (pnf ())
-(* 19 *)
-let pymapping_haskey = fmt19call (pnf ())
-(* 16 *)
-let pymapping_getitemstring = fmt16call (pnf ())
-(* 41 *)
-let pymapping_setitemstring = fmt41call (pnf ())
-
-external pynull : unit -> pyobject = "pynull"
-
-external pynone : unit -> pyobject = "pynone"
-external pytrue : unit -> pyobject = "pytrue"
-external pyfalse : unit -> pyobject = "pyfalse"
-
-external pytuple_fromarray : pyobject array -> pyobject = "pytuple_fromarray"
-let pytuple_fromsingle elt = pytuple_fromarray [| elt |]
-let pytuple_empty = pytuple_fromarray [| |]
-external pytuple2 : (pyobject * pyobject) -> pyobject =
-  "pytuple_fromarray"
-external pytuple3 : (pyobject * pyobject * pyobject) -> pyobject =
-  "pytuple_fromarray"
-external pytuple4 : (pyobject * pyobject * pyobject * pyobject) ->
-  pyobject = "pytuple_fromarray"
-external pytuple5 : (pyobject * pyobject * pyobject * pyobject * pyobject) ->
-  pyobject = "pytuple_fromarray"
-external pytuple6 : (pyobject * pyobject * pyobject * pyobject * pyobject * pyobject) ->
-  pyobject = "pytuple_fromarray"
-
-let pyint_fromint i = pyint_fromlong (Int64.of_int i)
-let pyint_asint obj = Int64.to_int (pyint_aslong obj)
-
-external pytuple_toarray : pyobject -> pyobject array = "pytuple_toarray"
-
-external pywrap_closure : (pyobject -> pyobject) -> pyobject = "pywrap_closure"
-external pycaml_setargs : string -> unit = "pycaml_setargs"
-
-external pymodule_initmodule : string -> pymodule_func array = "pymodule_initmodule"
-
-external pywrap_value : 'a -> pyobject = "pywrapvalue" ;;
-
-external pyunwrap_value : pyobject -> 'a = "pyunwrapvalue" ;;
-
-let _ = py_initialize () ;;
diff --git a/pycaml/pycaml_ml.c b/pycaml/pycaml_ml.c
deleted file mode 100644 (file)
index d122275..0000000
+++ /dev/null
@@ -1,1482 +0,0 @@
-/*
- * (C) arty 2002
- * This software is covered under the GNU lesser general public license
- */
-
-#include "Python.h"
-#include "caml/mlvalues.h"
-#include "caml/memory.h"
-#include "caml/callback.h"
-#include "caml/custom.h"
-#include "caml/alloc.h"
-#include <unistd.h>
-
-#define true 1
-#define false 0
-
-static void *getcustom( value v ) { return *((void **)Data_custom_val(v)); }
-
-static void pydecref( value v ) {
-    if( getcustom(v) ) { Py_DECREF((PyObject *)getcustom(v)); }
-}
-
-static int pycompare( value v1, value v2 ) {
-    int result;
-    if( getcustom(v1) && !getcustom(v2) ) return -1;
-    if( getcustom(v2) && !getcustom(v1) ) return 1;
-    if( !getcustom(v1) && !getcustom(v2) ) return 0;
-    PyObject_Cmp((PyObject *)getcustom(v1),
-                (PyObject *)getcustom(v2),&result);
-    return result;
-}
-
-static long pyhash( value v ) {
-    if( getcustom(v) ) return PyObject_Hash((PyObject *)getcustom(v));
-    else return 0;
-}
-
-static unsigned long pydeserialize( void *dst ) {
-    return 0;
-}
-
-struct custom_operations pyops = {
-    "PythonObject",
-    pydecref,
-    pycompare,
-    pyhash,
-    custom_serialize_default,
-    pydeserialize
-};
-
-struct custom_operations fnops = {
-    "FuncPointer",
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-};
-
-value pywrap( PyObject *obj ) {
-    CAMLparam0();
-    CAMLlocal1(v);
-    if( obj )
-       Py_INCREF(obj);
-    v = alloc_custom( &pyops, sizeof( PyObject * ), 100, 100000 );
-    *((PyObject **)Data_custom_val(v)) = obj;
-    CAMLreturn(v);
-}
-
-value funcwrap( void *obj ) {
-    CAMLparam0();
-    CAMLlocal1(v);
-    v = alloc_custom( &fnops, sizeof( void * ), 100, 100000 );
-    *((void **)Data_custom_val(v)) = obj;
-    CAMLreturn(v);
-}
-
-PyObject *pyunwrap( value v ) {
-    return *((PyObject **)Data_custom_val(v));
-}
-
-static void camldestr( void *v ) {
-    value *valptr = (value *)v;
-    remove_global_root(valptr);
-    free( v );
-}
-
-PyObject *camlwrap( value val, void *aux_str, int size ) {
-    value *v = (value *)malloc(sizeof(value) + size);
-    *v = val;
-    memcpy((void *)v+sizeof(value),aux_str,size);
-    register_global_root(v);
-    return PyCObject_FromVoidPtr(v,camldestr);
-}
-
-void *caml_aux( PyObject *obj ) {
-    value *v = (value *)PyCObject_AsVoidPtr( obj );
-    return (void *)v+sizeof(value);
-}
-
-PyObject *pycall_callback( PyObject *obj, PyObject *args ) {
-    value out;
-    value *v;
-
-    if( !PyCObject_Check(obj) ) {
-       Py_INCREF(Py_None);
-       return Py_None;
-    }
-    v = (value *)PyCObject_AsVoidPtr( obj );
-    out = callback(*v,pywrap(args));
-    return pyunwrap(out);
-}
-
-typedef void  (*type_1)( void );
-typedef void  (*type_2)( int );
-typedef void  (*type_3)( char * );
-typedef int   (*type_4)( void );
-typedef int   (*type_5)( char * );
-typedef int   (*type_6)( FILE *, char * );
-typedef int   (*type_7)( FILE *, char *, int );
-typedef char *(*type_8)( void );
-typedef PyObject* (*type_9)(char*, int, PyObject *, PyObject *);
-typedef PyObject* (*type_10)(FILE *, char*, int, PyObject *, PyObject *);
-typedef PyObject* (*type_11)(FILE *, char*, int, PyObject *, PyObject *, int );
-typedef PyObject* (*type_12)(char*, char*, int);
-typedef int (*type_13)(PyObject *, FILE *, int);
-typedef PyObject * (*type_14)(PyObject *);
-typedef PyObject * (*type_15)(PyObject *, PyObject *, int);
-typedef PyObject * (*type_16)(PyObject *, char *);
-typedef PyObject * (*type_17)(PyObject *, PyObject *);
-typedef int (*type_18)(PyObject *);
-typedef int (*type_19)(PyObject *, PyObject *);
-typedef int (*type_20)(PyObject *, PyObject *, int);
-typedef int (*type_21)(PyObject *, char *, PyObject *);
-typedef int (*type_22)(PyObject *, char *);
-typedef int (*type_23)(PyObject **, PyObject **);
-typedef int (*type_24)(PyObject *, PyObject *, PyObject *);
-typedef long (*type_25)(PyObject *);
-typedef char *(*type_26)(PyObject *);
-typedef void (*type_27)(PyObject **, PyObject *);
-typedef PyObject *(*type_28)(char *);
-typedef PyObject *(*type_29)(void);
-typedef void (*type_30)(PyObject *);
-typedef int (*type_31)(PyObject *, int *, PyObject **, PyObject **);
-typedef PyObject *(*type_32)(char*, char**, int);
-typedef PyObject *(*type_33)(Py_UNICODE*, int, int);
-typedef PyObject *(*type_34)(long);
-typedef long (*type_35)(void);
-typedef PyObject *(*type_36)(double);
-typedef double (*type_37)(PyObject *);
-typedef PyObject *(*type_38)(PyObject*, char**);
-typedef PyObject *(*type_39)(int size);
-typedef PyObject *(*type_40)(PyObject *, int);
-typedef int (*type_41)(PyObject *, int, PyObject *);
-typedef PyObject *(*type_42)(PyObject* start, PyObject* stop, PyObject* step);
-typedef int (*type_43)(PySliceObject *r, int length, int *start, int *stop, int *step);
-typedef PyObject *(*type_44)(long, long, long, int);
-typedef void (*type_45)(PyObject *, PyObject *);
-typedef void (*type_46)(PyObject *, const char *);
-typedef void (*type_47)(PyObject **, PyObject **, PyObject **);
-typedef void (*type_48)(PyObject *, PyObject *, PyObject *);
-typedef PyObject *(*type_49)(PyObject *, char *);
-typedef PyObject *(*type_50)(char *,PyObject *,char *);
-typedef PyObject *(*type_51)(char *,PyObject *,PyObject *,PyObject *);
-typedef int (*type_52)(PyObject *obj,const char **buffer,int *buffer_len);
-typedef int (*type_53)(PyObject *o, int i1, int i2, PyObject *v);
-typedef int (*type_54)(PyObject *o, int i1, int i2);
-
-value pygencall( value format, value arg ) {
-    CAMLparam2(format,arg);
-    CAMLlocal1(rv);
-    FILE *f;
-    int fd;
-    int x;
-    int ret_int;
-    const char *rvs;
-    int fmt = Int_val(Field(format,1));
-    PyObject *ob1,*ob2,*ob3;
-    void *func = getcustom(Field(format,0));
-    int reflect = Int_val(Field(format,2));
-
-    rv = Val_unit;
-
-    switch( fmt ) {
-    case 1:
-       ((type_1)func)();
-       CAMLreturn(Val_unit);
-
-    case 2:
-       ((type_2)func)(Int_val(arg));
-       CAMLreturn(Val_unit);
-
-    case 3:
-       ((type_3)func)(String_val(arg));
-       CAMLreturn(Val_unit);
-
-    case 4:
-       CAMLreturn(Int_val(((type_4)func)()));
-
-    case 5:
-       CAMLreturn(Int_val(((type_5)func)
-                          (String_val(arg))));
-
-    case 6:
-    case 7:
-    case 10:
-    case 11:
-       fd = dup(Int_val(Field(arg,0)));
-       f = fdopen(fd,"r+");
-       switch( fmt ) {
-       case 6:
-           rv = Val_int(((type_6)func)
-                        (f,String_val(Field(arg,1))));
-           break;
-
-       case 7:
-           rv = Val_int(((type_7)func)
-                        (f,
-                         String_val(Field(arg,1)),
-                         Int_val(Field(arg,2))));
-           break;
-
-       case 10:
-           rv = pywrap(((type_10)func)
-                       (f,
-                        String_val(Field(arg,1)),
-                        Int_val(Field(arg,2)),
-                        pyunwrap(Field(arg,3)),
-                        pyunwrap(Field(arg,4))));
-           break;
-
-       case 11:
-           rv = pywrap(((type_11)func)
-                       (f,
-                        String_val(Field(arg,1)),
-                        Int_val(Field(arg,2)),
-                        pyunwrap(Field(arg,3)),
-                        pyunwrap(Field(arg,4)),
-                        Int_val(Field(arg,5))));
-           break;
-       }
-
-       fclose( f );
-       CAMLreturn( rv );
-
-    case 8:
-       CAMLreturn(copy_string(((type_8)func)()));
-
-    case 9:
-       CAMLreturn(pywrap(((type_9)func)
-                         (String_val(Field(arg,0)),
-                          Int_val(Field(arg,1)),
-                          pyunwrap(Field(arg,2)),
-                          pyunwrap(Field(arg,3)))));
-
-    case 12:
-       CAMLreturn(pywrap(((type_12)func)
-                         (String_val(Field(arg,0)),
-                          String_val(Field(arg,1)),
-                          Int_val(Field(arg,2)))));
-
-    case 13:
-       fd = dup(Int_val(Field(arg,1)));
-       f = fdopen(fd,"r+");
-       rv = Val_int(((type_13)func)
-                    (pyunwrap(Field(arg,0)),
-                     f,
-                     Int_val(Field(arg,2))));
-       fclose( f );
-       break;
-
-    case 14:
-       CAMLreturn(pywrap(((type_14)func)(pyunwrap(arg))));
-
-    case 15:
-       CAMLreturn(pywrap(((type_15)func)
-                         (pyunwrap(Field(arg,0)),
-                          pyunwrap(Field(arg,1)),Int_val(Field(arg,2)))));
-
-    case 16:
-       CAMLreturn(pywrap(((type_16)func)
-                         (pyunwrap(Field(arg,0)),
-                          String_val(Field(arg,1)))));
-
-    case 17:
-       CAMLreturn(pywrap(((type_17)func)
-                         (pyunwrap(Field(arg,0)),pyunwrap(Field(arg,1)))));
-
-    case 18:
-       CAMLreturn(Val_int(((type_18)func)(pyunwrap(arg))));
-
-    case 19:
-       CAMLreturn(Val_int(((type_19)func)
-                          (pyunwrap(Field(arg,0)),
-                           pyunwrap(Field(arg,1)))));
-
-    case 20:
-       CAMLreturn(Val_int(((type_20)func)
-                          (pyunwrap(Field(arg,0)),
-                           pyunwrap(Field(arg,1)),
-                           Int_val(Field(arg,2)))));
-
-    case 21:
-       CAMLreturn(Val_int(((type_21)func)
-                          (pyunwrap(Field(arg,0)),
-                           String_val(Field(arg,1)),
-                           pyunwrap(Field(arg,2)))));
-
-    case 22:
-       CAMLreturn(Val_int(((type_22)func)
-                          (pyunwrap(Field(arg,0)),
-                           String_val(Field(arg,1)))));
-
-    case 23:
-       ob1 = pyunwrap(Field(arg,0)); ob2 = pyunwrap(Field(arg,1));
-       ret_int = ((type_23)func)( &ob1, &ob2 );
-       if( ret_int == -1 ) CAMLreturn((value)1);
-       else {
-           rv = alloc_tuple(2);
-           Field(rv,0) = pywrap(ob1);
-           Field(rv,1) = pywrap(ob2);
-           CAMLreturn(rv);
-       }
-
-    case 24:
-       CAMLreturn(Int_val(((type_24)func)
-                          (pyunwrap(Field(arg,0)),
-                           pyunwrap(Field(arg,1)),
-                           pyunwrap(Field(arg,2)))));
-
-    case 25:
-       CAMLreturn(copy_int64(((type_25)func)(pyunwrap(arg))));
-
-    case 26:
-       CAMLreturn(copy_string(((type_26)func)(pyunwrap(arg))));
-
-    case 27:
-       ob1 = pyunwrap(Field(arg,0));
-       ((type_27)func)(&ob1,pyunwrap(Field(arg,1)));
-       CAMLreturn(pywrap(ob1));
-
-    case 28:
-       CAMLreturn(pywrap(((type_28)func)(String_val(arg))));
-
-    case 29:
-       CAMLreturn(pywrap(((type_29)func)()));
-
-    case 30:
-       ((type_30)func)(pyunwrap(arg));
-       CAMLreturn(Val_unit);
-
-    case 31:
-       x = Int_val(Field(arg,1));
-       ret_int = ((type_31)func)
-           (pyunwrap(Field(arg,0)),
-            &x,
-            &ob1, &ob2);
-       if( !ret_int ) CAMLreturn((value)1);
-       else {
-           rv = alloc_tuple(3);
-           Field(rv,0) = pywrap(ob1);
-           Field(rv,1) = pywrap(ob2);
-           Field(rv,2) = Val_int(x);
-           CAMLreturn(rv);
-       }
-
-       /* case 32: string -> int */
-
-       /* case 33: unicode ... need to do something coherent */
-
-    case 34:
-       CAMLreturn(pywrap(((type_34)func)(Int64_val(arg))));
-
-    case 35:
-       CAMLreturn(copy_int64(((type_35)func)()));
-
-    case 36:
-       CAMLreturn(pywrap(((type_36)func)(Double_val(arg))));
-
-    case 37:
-       CAMLreturn(copy_double(((type_37)func)
-                              (pyunwrap(arg))));
-
-       /* case 38: string -> float */
-
-    case 39:
-       CAMLreturn(pywrap(((type_39)func)(Int_val(arg))));
-
-    case 40:
-       CAMLreturn(pywrap(((type_40)func)
-                         (pyunwrap(Field(arg,0)),
-                          Int_val(Field(arg,1)))));
-
-    case 41:
-       CAMLreturn(Val_int(((type_41)func)
-                          (pyunwrap(Field(arg,0)),
-                           Int_val(Field(arg,1)),
-                           pyunwrap(Field(arg,2)))));
-
-    case 42:
-       CAMLreturn(pywrap(((type_42)func)
-                         (pyunwrap(Field(arg,0)),
-                          pyunwrap(Field(arg,1)),
-                          pyunwrap(Field(arg,2)))));
-
-    case 43: {
-       int start,end,step;
-
-       ret_int = ((type_43)func)
-           ((PySliceObject *)pyunwrap(Field(arg,0)),
-            Int_val(Field(arg,1)),
-            &start, &end, &step);
-       if( !ret_int ) CAMLreturn((value)1);
-       else {
-           rv = alloc_tuple(3);
-           Field(rv,0) = start;
-           Field(rv,1) = end;
-           Field(rv,2) = step;
-           CAMLreturn(rv);
-       }
-    }
-
-    case 44:
-       CAMLreturn(pywrap(((type_44)func)
-                         (Int_val(Field(arg,0)),
-                          Int_val(Field(arg,1)),
-                          Int_val(Field(arg,2)),
-                          Int_val(Field(arg,3)))));
-
-    case 45:
-       ((type_45)func)
-           (pyunwrap(Field(arg,0)),
-            pyunwrap(Field(arg,1)));
-       CAMLreturn(Val_unit);
-
-    case 46:
-       ((type_46)func)
-           (pyunwrap(Field(arg,0)),String_val(Field(arg,1)));
-       CAMLreturn(Val_unit);
-
-    case 47:
-       ob1 = pyunwrap(Field(arg,0));
-       ob2 = pyunwrap(Field(arg,1));
-       ob3 = pyunwrap(Field(arg,2));
-       ((type_47)func)(&ob1,&ob2,&ob3);
-       rv = alloc_tuple(3);
-       Field(rv,0) = pywrap(ob1);
-       Field(rv,1) = pywrap(ob2);
-       Field(rv,2) = pywrap(ob3);
-       CAMLreturn(rv);
-
-    case 48:
-       ((type_48)func)
-           (pyunwrap(Field(arg,0)),
-            pyunwrap(Field(arg,1)),
-            pyunwrap(Field(arg,2)));
-       CAMLreturn(Val_unit);
-
-    case 49:
-       CAMLreturn(pywrap(((type_49)func)
-                         (pyunwrap(Field(arg,0)),
-                          String_val(Field(arg,1)))));
-
-    case 50:
-       CAMLreturn(pywrap(((type_50)func)
-                         (String_val(Field(arg,0)),
-                          pyunwrap(Field(arg,1)),
-                          String_val(Field(arg,2)))));
-
-    case 51:
-       CAMLreturn(pywrap(((type_51)func)
-                         (String_val(Field(arg,0)),
-                          pyunwrap(Field(arg,1)),
-                          pyunwrap(Field(arg,2)),
-                          pyunwrap(Field(arg,3)))));
-
-    case 52:
-       ((type_52)func)(pyunwrap(arg),&rvs,&ret_int);
-       rv = copy_string(rvs);
-       CAMLreturn(rv);
-
-    case 53:
-       CAMLreturn(Val_int(((type_53)func)
-                          (pyunwrap(Field(arg,0)),
-                           Int_val(Field(arg,1)),
-                           Int_val(Field(arg,2)),
-                           pyunwrap(Field(arg,3)))));
-
-    case 54:
-       CAMLreturn(Val_int(((type_54)func)
-                          (pyunwrap(Field(arg,0)),
-                           Int_val(Field(arg,1)),
-                           Int_val(Field(arg,2)))));
-    }
-
-    CAMLreturn(rv);
-}
-
-#ifdef DONT_COMPILE_THIS
-/* 1 */
-DL_IMPORT(void) Py_Initialize(void);
-DL_IMPORT(void) Py_Finalize(void);
-DL_IMPORT(void) PyErr_Print(void);
-/* 2 */
-DL_IMPORT(void) Py_Exit(int);
-DL_IMPORT(void) PyErr_PrintEx(int);
-/* 3 */
-DL_IMPORT(void) Py_SetProgramName(char *);
-DL_IMPORT(void) Py_SetPythonHome(char *);
-/* 4 */
-DL_IMPORT(int) Py_IsInitialized(void);
-/* 5 */
-DL_IMPORT(int) PyRun_SimpleString(char *);
-/* 6 */
-DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
-DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
-DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
-DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
-DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);
-/* 7 */
-DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int);
-DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int);
-/* 8 */
-DL_IMPORT(char*) Py_GetProgramName(void);
-DL_IMPORT(char*) Py_GetPythonHome(void);
-DL_IMPORT(char*) Py_GetProgramFullPath(void);
-DL_IMPORT(char*) Py_GetPrefix(void);
-DL_IMPORT(char*) Py_GetExecPrefix(void);
-DL_IMPORT(char*) Py_GetPath(void);
-DL_IMPORT(char*) Py_GetVersion(void);
-DL_IMPORT(char*) Py_GetPlatform(void);
-DL_IMPORT(char*) Py_GetCopyright(void);
-DL_IMPORT(char*) Py_GetCompiler(void);
-DL_IMPORT(char*) Py_GetBuildInfo(void);
-/* 9 */
-DL_IMPORT(PyObject*) PyRun_String(char*, int, PyObject *, PyObject *);
-/* 10 */
-DL_IMPORT(PyObject*) PyRun_File(FILE *, char*, int, PyObject *, PyObject *);
-/* 11 */
-DL_IMPORT(PyObject*) PyRun_FileEx(FILE *, char*, int, PyObject *, PyObject *, int );
-/* 12 */
-DL_IMPORT(PyObject*) Py_CompileString(char*, char*, int); /* FUNCTION 30 */
-
-/* Generic operations on objects */
-/* 13 */
-extern DL_IMPORT(int) PyObject_Print(PyObject *, FILE *, int);
-/* 14 */
-extern DL_IMPORT(PyObject *) PyObject_Repr(PyObject *);
-extern DL_IMPORT(PyObject *) PyObject_Str(PyObject *);
-extern DL_IMPORT(PyObject *) PyObject_Unicode(PyObject *);
-/* 15 */
-extern DL_IMPORT(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int);
-/* 16 */
-extern DL_IMPORT(PyObject *) PyObject_GetAttrString(PyObject *, char *);
-/* 17 */
-extern DL_IMPORT(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
-extern DL_IMPORT(PyObject *) PyObject_CallObject(PyObject *, PyObject *);
-/* 18 */
-extern DL_IMPORT(int) PyObject_IsTrue(PyObject *);
-extern DL_IMPORT(int) PyObject_Not(PyObject *);
-extern DL_IMPORT(int) PyCallable_Check(PyObject *);
-/* 19 */
-extern DL_IMPORT(int) PyObject_Compare(PyObject *, PyObject *);
-extern DL_IMPORT(int) PyObject_HasAttr(PyObject *, PyObject *);
-/* 20 */
-extern DL_IMPORT(int) PyObject_RichCompareBool(PyObject *, PyObject *, int);
-/* 21 */
-extern DL_IMPORT(int) PyObject_SetAttrString(PyObject *, char *, PyObject *);
-/* 22 */
-extern DL_IMPORT(int) PyObject_HasAttrString(PyObject *, char *);
-/* 23 */
-extern DL_IMPORT(int) PyNumber_Coerce(PyObject **, PyObject **);
-extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
-/* 24 */
-extern DL_IMPORT(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
-/* 25 */
-extern DL_IMPORT(long) PyObject_Hash(PyObject *);
-
-/* Strings */
-/* 18 */
-extern DL_IMPORT(int) PyString_Size(PyObject *);
-/* 26 */
-extern DL_IMPORT(char *) PyString_AsString(PyObject *);
-/* 27 */
-extern DL_IMPORT(void) PyString_Concat(PyObject **, PyObject *);
-extern DL_IMPORT(void) PyString_ConcatAndDel(PyObject **, PyObject *);
-/* 28 */
-extern DL_IMPORT(PyObject *) PyString_FromString(const char *);
-/* 17 */
-extern DL_IMPORT(PyObject *) PyString_Format(PyObject *, PyObject *);
-
-/* Dictionaries */
-/* 29 */
-extern DL_IMPORT(PyObject *) PyDict_New(void);
-/* 17 */
-extern DL_IMPORT(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
-/* 24 */
-extern DL_IMPORT(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
-/* 19 */
-extern DL_IMPORT(int) PyDict_DelItem(PyObject *mp, PyObject *key);
-/* 30 */
-extern DL_IMPORT(void) PyDict_Clear(PyObject *mp);
-/* 31 */
-extern DL_IMPORT(int) PyDict_Next
-       (PyObject *mp, int *pos, PyObject **key, PyObject **value);
-/* 14 */
-extern DL_IMPORT(PyObject *) PyDict_Keys(PyObject *mp);
-extern DL_IMPORT(PyObject *) PyDict_Values(PyObject *mp);
-extern DL_IMPORT(PyObject *) PyDict_Items(PyObject *mp);
-extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp);
-/* 18 */
-extern DL_IMPORT(int) PyDict_Size(PyObject *mp);
-/* 16 */
-extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key);
-/* 22 */
-extern DL_IMPORT(int) PyDict_DelItemString(PyObject *dp, char *key);
-/* 21 */
-extern DL_IMPORT(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item);
-
-/* Integer */
-/* 32 */
-extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int);
-/* 33 */
-extern DL_IMPORT(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int);
-/* 34 */
-extern DL_IMPORT(PyObject *) PyInt_FromLong(long);
-/* 25 */
-extern DL_IMPORT(long) PyInt_AsLong(PyObject *);
-/* 35 */
-extern DL_IMPORT(long) PyInt_GetMax(void);
-/* Long */
-/* 34 */
-extern DL_IMPORT(PyObject *) PyLong_FromLong(long);
-/* 36 */
-extern DL_IMPORT(PyObject *) PyLong_FromDouble(double);
-/* 25 */
-extern DL_IMPORT(long) PyLong_AsLong(PyObject *);
-
-/* Float */
-/* 36 */
-extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double);
-/* 37 */
-extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *);
-
-/* Modules */
-/* 28 */
-extern DL_IMPORT(PyObject *) PyModule_New(char *);
-/* 14 */
-extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *);
-/* 26 */
-extern DL_IMPORT(char *) PyModule_GetName(PyObject *);
-extern DL_IMPORT(char *) PyModule_GetFilename(PyObject *);
-
-/* 39 */
-extern DL_IMPORT(PyObject *) PyTuple_New(int size);
-/* 18 */
-extern DL_IMPORT(int) PyTuple_Size(PyObject *);
-extern DL_IMPORT(int) PyTuple_Check(PyObject *);
-/* 40 */
-extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
-/* 41 */
-extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
-/* 13 */
-extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
-
-/* 42 */
-DL_IMPORT(PyObject *) PySlice_New(PyObject* start, PyObject* stop, PyObject* step);
-/* 43 */
-DL_IMPORT(int) PySlice_GetIndices(PySliceObject *r, int length, int *start, int *stop, int *step);
-/* 44 */
-DL_IMPORT(PyObject *) PyRange_New(long, long, long, int);
-
-/* Error handling definitions */
-
-/* 30 */
-DL_IMPORT(void) PyErr_SetNone(PyObject *);
-/* 45 */
-DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *);
-/* 46 */
-DL_IMPORT(void) PyErr_SetString(PyObject *, const char *);
-/* 29 */
-DL_IMPORT(PyObject *) PyErr_Occurred(void);
-/* 1 */
-DL_IMPORT(void) PyErr_Clear(void);
-/* 47 */
-DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
-/* 48 */
-DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
-
-/* Error testing and normalization */
-/* 19 */
-DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
-/* 18 */
-DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *);
-/* 47 */
-DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
-
-/* Classes */
-/* 42 */
-extern DL_IMPORT(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *);
-/* 42 */
-extern DL_IMPORT(PyObject *) PyInstance_New(PyObject *, PyObject *,
-                                            PyObject *);
-/* 17 */
-extern DL_IMPORT(PyObject *) PyInstance_NewRaw(PyObject *, PyObject *);
-/* 42 */
-extern DL_IMPORT(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *);
-/* 14 */
-extern DL_IMPORT(PyObject *) PyMethod_Function(PyObject *);
-extern DL_IMPORT(PyObject *) PyMethod_Self(PyObject *);
-extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *);
-
-/* Module */
-/* 28 */
-extern DL_IMPORT(PyObject *) PyModule_New(char *);
-/* 14 */
-extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *);
-/* 26 */
-extern DL_IMPORT(char *) PyModule_GetName(PyObject *);
-extern DL_IMPORT(char *) PyModule_GetFilename(PyObject *);
-/* 35 */
-DL_IMPORT(long) PyImport_GetMagicNumber(void);
-/* 49 */
-DL_IMPORT(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
-/* 50 */
-DL_IMPORT(PyObject *) PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname);
-/* 29 */
-DL_IMPORT(PyObject *) PyImport_GetModuleDict(void);
-/* 28 */
-DL_IMPORT(PyObject *) PyImport_AddModule(char *name);
-DL_IMPORT(PyObject *) PyImport_ImportModule(char *name);
-/* 51 */
-DL_IMPORT(PyObject *) PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist);
-/* 28 */
-DL_IMPORT(PyObject *) PyImport_Import(PyObject *name);
-/* 14 */
-DL_IMPORT(PyObject *) PyImport_ReloadModule(PyObject *m);
-/* 1 */
-DL_IMPORT(void) PyImport_Cleanup(void);
-/* 5 */
-DL_IMPORT(int) PyImport_ImportFrozenModule(char *);
-
-/* Interface to random parts in ceval.c */
-/* 42 */
-DL_IMPORT(PyObject *) PyEval_CallObjectWithKeywords(PyObject *, PyObject *, PyObject *);
-/* 17 */
-#if 0
-// dropped in Python 2.7
-DL_IMPORT(PyObject *) PyEval_CallObject(PyObject *, PyObject *);
-#endif
-
-/* 29 */
-DL_IMPORT(PyObject *) PyEval_GetBuiltins(void);
-DL_IMPORT(PyObject *) PyEval_GetGlobals(void);
-DL_IMPORT(PyObject *) PyEval_GetLocals(void);
-DL_IMPORT(PyObject *) PyEval_GetFrame(void);
-/* 4 */
-DL_IMPORT(int) PyEval_GetRestricted(void);
-
-/* Abstract layer */
-/* 14 */
-DL_IMPORT(PyObject *) PyObject_Type(PyObject *o);
-/* 18 */
-DL_IMPORT(int) PyObject_Size(PyObject *o);
-/* 17 */
-DL_IMPORT(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key);
-/* 24 */
-DL_IMPORT(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
-/* 17 */
-DL_IMPORT(int) PyObject_DelItem(PyObject *o, PyObject *key);
-/* 52 */
-DL_IMPORT(int) PyObject_AsCharBuffer(PyObject *obj,const char **buffer,int *buffer_len);
-DL_IMPORT(int) PyObject_AsReadBuffer(PyObject *obj,const void **buffer,int *buffer_len);
-DL_IMPORT(int) PyObject_AsWriteBuffer(PyObject *obj,void **buffer,int *buffer_len);
-/* 18 */
-DL_IMPORT(int) PyNumber_Check(PyObject *o);
-/* 17 */
-DL_IMPORT(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
-/* 42 */
-DL_IMPORT(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,PyObject *o3);
-/* 14 */
-DL_IMPORT(PyObject *) PyNumber_Negative(PyObject *o);
-DL_IMPORT(PyObject *) PyNumber_Positive(PyObject *o);
-DL_IMPORT(PyObject *) PyNumber_Absolute(PyObject *o);
-DL_IMPORT(PyObject *) PyNumber_Invert(PyObject *o);
-/* 17 */
-DL_IMPORT(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
-/* 14 */
-DL_IMPORT(PyObject *) PyNumber_Int(PyObject *o);
-DL_IMPORT(PyObject *) PyNumber_Long(PyObject *o);
-DL_IMPORT(PyObject *) PyNumber_Float(PyObject *o);
-/* 17 */
-DL_IMPORT(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
-DL_IMPORT(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
-/* 42 */
-DL_IMPORT(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,PyObject *o3);
-/* 18 */
-DL_IMPORT(int) PySequence_Check(PyObject *o);
-DL_IMPORT(int) PySequence_Size(PyObject *o);
-DL_IMPORT(int) PySequence_Length(PyObject *o);
-/* 17 */
-DL_IMPORT(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
-/* 40 */
-DL_IMPORT(PyObject *) PySequence_Repeat(PyObject *o, int count);
-DL_IMPORT(PyObject *) PySequence_GetItem(PyObject *o, int i);
-/* 13 */
-DL_IMPORT(PyObject *) PySequence_GetSlice(PyObject *o, int i1, int i2);
-/* 41 */
-DL_IMPORT(int) PySequence_SetItem(PyObject *o, int i, PyObject *v);
-/* 20 */
-DL_IMPORT(int) PySequence_DelItem(PyObject *o, int i);
-/* 53 */
-DL_IMPORT(int) PySequence_SetSlice(PyObject *o, int i1, int i2, PyObject *v);
-/* 54 */
-DL_IMPORT(int) PySequence_DelSlice(PyObject *o, int i1, int i2);
-/* 14 */
-DL_IMPORT(PyObject *) PySequence_Tuple(PyObject *o);
-DL_IMPORT(PyObject *) PySequence_List(PyObject *o);
-/* 16 */
-DL_IMPORT(PyObject *) PySequence_Fast(PyObject *o, const char* m);
-/* 19 */
-DL_IMPORT(int) PySequence_Count(PyObject *o, PyObject *value);
-DL_IMPORT(int) PySequence_Contains(PyObject *o, PyObject *value);
-DL_IMPORT(int) PySequence_In(PyObject *o, PyObject *value);
-DL_IMPORT(int) PySequence_Index(PyObject *o, PyObject *value);
-/* 17 */
-DL_IMPORT(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
-/* 22 */
-DL_IMPORT(PyObject *) PySequence_InPlaceRepeat(PyObject *o, int count);
-/* 18 */
-DL_IMPORT(int) PyMapping_Check(PyObject *o);
-DL_IMPORT(int) PyMapping_Size(PyObject *o);
-DL_IMPORT(int) PyMapping_Length(PyObject *o);
-/* 16 */
-DL_IMPORT(int) PyMapping_HasKeyString(PyObject *o, char *key);
-/* 19 */
-DL_IMPORT(int) PyMapping_HasKey(PyObject *o, PyObject *key);
-/* 16 */
-DL_IMPORT(PyObject *) PyMapping_GetItemString(PyObject *o, char *key);
-/* 41 */
-DL_IMPORT(int) PyMapping_SetItemString(PyObject *o, char *key, PyObject *value);
-
-
-#ifdef  MAYBE_RUN
-DL_IMPORT(void) init_exceptions(void);
-DL_IMPORT(void) fini_exceptions(void);
-DL_IMPORT(void) _PyImport_Init(void);
-DL_IMPORT(void) _PyImport_Fini(void);
-DL_IMPORT(void) PyMethod_Fini(void);
-DL_IMPORT(void) PyFrame_Fini(void);
-DL_IMPORT(void) PyCFunction_Fini(void);
-DL_IMPORT(void) PyTuple_Fini(void);
-DL_IMPORT(void) PyString_Fini(void);
-DL_IMPORT(void) PyInt_Fini(void);
-DL_IMPORT(void) PyFloat_Fini(void);
-DL_IMPORT(PyObject*) _PyBuiltin_Init(void);
-DL_IMPORT(PyObject*) _PySys_Init(void);
-DL_IMPORT(struct symtable *) Py_SymtableString(char*, char*, int);
-DL_IMPORT(struct _node *) PyParser_SimpleParseString(char*, int);
-DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char*, int);
-DL_IMPORT(int) Py_AtExit(void (*func)(void));
-DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
-DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
-DL_IMPORT(int) (*PyOS_InputHook)(void);
-DL_IMPORT(int) PyOS_CheckStack(void);
-DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char*);
-DL_IMPORT(PyOS_sighandler_t) PyOS_getsig(int);
-DL_IMPORT(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
-DL_IMPORT(void) PyOS_FiniInterrupts(void);
-DL_IMPORT(char*) PyOS_Readline(char*);
-#endif//MAYBE_RUN
-#endif//DONT_COMPILE_THIS
-
-/* HST FIXUP */
-#if (PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION > 4)
-#undef PyRun_SimpleString
-#define PyRun_SimpleString PyRun_SimpleString_redo
-int PyRun_SimpleString_redo(const char* command) { return PyRun_SimpleStringFlags(command, NULL); }
-
-#undef PyRun_AnyFile
-#define PyRun_AnyFile PyRun_AnyFile_redo
-int PyRun_AnyFile_redo(FILE* fp, const char* filename) { return PyRun_AnyFileExFlags(fp, filename, 0, NULL); }
-
-#undef PyRun_SimpleFile
-#define PyRun_SimpleFile PyRun_SimpleFile_redo
-int PyRun_SimpleFile_redo(FILE* fp, const char* filename) { return PyRun_SimpleFileExFlags(fp, filename, 0, NULL); }
-
-#undef PyRun_InteractiveOne
-#define PyRun_InteractiveOne PyRun_InteractiveOne_redo
-int PyRun_InteractiveOne_redo(FILE* fp, const char* filename) { return PyRun_InteractiveOneFlags(fp, filename, NULL); }
-
-#undef PyRun_InteractiveLoop
-#define PyRun_InteractiveLoop PyRun_InteractiveLoop_redo
-int PyRun_InteractiveLoop_redo(FILE* fp, const char* filename) { return PyRun_InteractiveLoopFlags(fp, filename, NULL); }
-
-#undef PyRun_AnyFileEx
-#define PyRun_AnyFileEx PyRun_AnyFileEx_redo
-int PyRun_AnyFileEx_redo(FILE* fp, const char* filename, int closeit) { return PyRun_AnyFileExFlags(fp, filename, closeit, NULL); }
-
-#undef PyRun_SimpleFileEx
-#define PyRun_SimpleFileEx PyRun_SimpleFileEx_redo
-int PyRun_SimpleFileEx_redo(FILE* fp, const char* filename, int closeit) { return PyRun_SimpleFileExFlags(fp, filename, closeit, NULL); }
-
-#undef PyRun_String
-#define PyRun_String PyRun_String_redo
-PyObject* PyRun_String_redo(const char* str, int start, PyObject* globals, PyObject* locals) { return PyRun_StringFlags(str, start, globals, locals, NULL); }
-
-#undef PyRun_File
-#define PyRun_File PyRun_File_redo
-PyObject* PyRun_File_redo(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals) { return PyRun_FileExFlags(fp, filename, start, globals, locals, 0, NULL); }
-
-#undef PyRun_FileEx
-#define PyRun_FileEx PyRun_FileEx_redo
-PyObject* PyRun_FileEx_redo(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals, int closeit) { return PyRun_FileExFlags(fp, filename, start, globals, locals, closeit, NULL); }
-
-#undef Py_CompileString
-#define Py_CompileString Py_CompileString_redo
-PyObject* Py_CompileString_redo(const char* str, const char* filename, int start) { return Py_CompileStringFlags(str, filename, start, NULL); }
-
-#undef PyRange_New
-#define PyRange_New PyRange_New_redo
-PyObject* PyRange_New_redo(PyObject* start, PyObject* stop, PyObject* step) { return PyObject_CallFunction((PyObject*)&PyRange_Type, "lll", start, stop, step); }
-#endif /* PYTHON 2.4 */
-
-#undef PyTuple_Check
-int PyTuple_Check(PyObject* op) { return PyObject_TypeCheck(op, &PyTuple_Type); }
-/* END HST FIXUP */
-
-/* Value -> Pyobject */
-
-value pywrapvalue( value cb ) {
-    CAMLparam1(cb);
-    CAMLreturn(pywrap(camlwrap(cb,NULL,0)));
-}
-
-value pyunwrapvalue( value cb ) {
-    CAMLparam1(cb);
-    value *v;
-    v = (value *)PyCObject_AsVoidPtr( pyunwrap(cb) );
-    CAMLreturn(*v);
-}
-
-/* Create the function table */
-
-typedef struct _python_func_table {
-    void *func;
-    int format;
-    char *desc;
-} python_func_table;
-
-python_func_table the_python_func_table[] = {
-/* 1 */
-    { (void *)Py_Initialize, 1, "Py_Initialize" },
-    { (void *)Py_Finalize, 1, "Py_Finalize" },
-    { (void *)PyErr_Print, 1, "PyErr_Print" },
-/* 2 */
-    { (void *)Py_Exit, 2, "Py_Exit" },
-    { (void *)PyErr_PrintEx, 2, "PyErr_PrintEx" },
-/* 3 */
-    { (void *)Py_SetProgramName, 3, "Py_SetProgramName" },
-    { (void *)Py_SetPythonHome, 3, "Py_SetPythonHome" },
-/* 4 */
-    { (void *)Py_IsInitialized, 4, "Py_IsInitialized" },
-/* 5 */
-    { (void *)PyRun_SimpleString, 5, "PyRun_SimpleString" },
-/* 6 */
-    { (void *)PyRun_AnyFile, 6, "PyRun_AnyFile" },
-    { (void *)PyRun_SimpleFile, 6, "PyRun_SimpleFile" },
-    { (void *)PyRun_InteractiveOne, 6, "PyRun_InteractiveOne" },
-    { (void *)PyRun_InteractiveLoop, 6, "PyRun_InteractiveLoop" },
-    { (void *)Py_FdIsInteractive, 6, "Py_FdIsInteractive" },
-/* 7 */
-    { (void *)PyRun_AnyFileEx, 7, "PyRun_AnyFileEx" },
-    { (void *)PyRun_SimpleFileEx, 7, "PyRun_SimpleFileEx" },
-/* 8 */
-    { (void *)Py_GetProgramName, 8, "Py_GetProgramName" },
-    { (void *)Py_GetPythonHome, 8, "Py_GetPythonHome" },
-    { (void *)Py_GetProgramFullPath, 8, "Py_GetProgramFullPath" },
-    { (void *)Py_GetPrefix, 8, "Py_GetPrefix" },
-    { (void *)Py_GetExecPrefix, 8, "Py_GetExecPrefix" },
-    { (void *)Py_GetPath, 8, "Py_GetPath" },
-    { (void *)Py_GetVersion, 8, "Py_GetVersion" },
-    { (void *)Py_GetPlatform, 8, "Py_GetPlatform" },
-    { (void *)Py_GetCopyright, 8, "Py_GetCopyright" },
-    { (void *)Py_GetCompiler, 8, "Py_GetCompiler" },
-    { (void *)Py_GetBuildInfo, 8, "Py_GetBuildInfo" },
-/* 9 */
-    { (void *)PyRun_String, 9, "PyRun_String" },
-/* 10 */
-    { (void *)PyRun_File, 10, "PyRun_File" },
-/* 11 */
-    { (void *)PyRun_FileEx, 11, "PyRun_FileEx" },
-/* 12 */
-    { (void *)Py_CompileString, 12, "Py_CompileString" },
-
-/* Object */
-/* 13 */
-    { (void *)PyObject_Print, 13, "PyObject_Print" },
-/* 14 */
-    { (void *)PyObject_Repr, 14, "PyObject_Repr" },
-    { (void *)PyObject_Str, 14, "PyObject_Str" },
-    { (void *)PyObject_Unicode, 14, "PyObject_Unicode" },
-/* 15 */
-    { (void *)PyObject_RichCompare, 15, "PyObject_RichCompare" },
-/* 16 */
-    { (void *)PyObject_GetAttrString, 16, "PyObject_GetAttrString" },
-/* 17 */
-    { (void *)PyObject_GetAttr, 17, "PyObject_GetAttr" },
-    { (void *)PyObject_CallObject, 17, "PyObject_CallObject" },
-/* 18 */
-    { (void *)PyObject_IsTrue, 18, "PyObject_IsTrue" },
-    { (void *)PyObject_Not, 18, "PyObject_Not" },
-    { (void *)PyCallable_Check, 18, "PyCallable_Check" },
-/* 19 */
-    { (void *)PyObject_Compare, 19, "PyObject_Compare" },
-    { (void *)PyObject_HasAttr, 19, "PyObject_HasAttr" },
-/* 20 */
-    { (void *)PyObject_RichCompareBool, 20, "PyObject_RichCompareBool" },
-/* 21 */
-    { (void *)PyObject_SetAttrString, 21, "PyObject_SetAttrString" },
-/* 22 */
-    { (void *)PyObject_HasAttrString, 22, "PyObject_HasAttrString" },
-/* 23 */
-    { (void *)PyNumber_Coerce, 23, "PyNumber_Coerce" },
-    { (void *)PyNumber_CoerceEx, 23, "PyNumber_CoerceEx" },
-/* 24 */
-    { (void *)PyObject_SetAttr, 24, "PyObject_SetAttr" },
-/* 25 */
-    { (void *)PyObject_Hash, 25, "PyObject_Hash" },
-
-/* Strings */
-/* 18 */
-    { (void *)PyString_Size, 18, "PyString_Size" },
-/* 26 */
-    { (void *)PyString_AsString, 26, "PyString_AsString" },
-/* 27 */
-    { (void *)PyString_Concat, 27, "PyString_Concat" },
-    { (void *)PyString_ConcatAndDel, 27, "PyString_ConcatAndDel" },
-/* 28 */
-    { (void *)PyString_FromString, 28, "PyString_FromString" },
-/* 17 */
-    { (void *)PyString_Format, 17, "PyString_Format" },
-
-/* Dictionaries */
-/* 29 */
-    { (void *)PyDict_New, 29, "PyDict_New" },
-/* 17 */
-    { (void *)PyDict_GetItem, 17, "PyDict_GetItem" },
-/* 24 */
-    { (void *)PyDict_SetItem, 24, "PyDict_SetItem" },
-/* 19 */
-    { (void *)PyDict_DelItem, 19, "PyDict_DelItem" },
-/* 30 */
-    { (void *)PyDict_Clear, 30, "PyDict_Clear" },
-/* 31 */
-    { (void *)PyDict_Next, 31, "PyDict_Next" },
-/* 14 */
-    { (void *)PyDict_Keys, 14, "PyDict_Keys" },
-    { (void *)PyDict_Values, 14, "PyDict_Values" },
-    { (void *)PyDict_Items, 14, "PyDict_Items" },
-    { (void *)PyDict_Copy, 14, "PyDict_Copy" },
-/* 18 */
-    { (void *)PyDict_Size, 18, "PyDict_Size" },
-/* 16 */
-    { (void *)PyDict_GetItemString, 16, "PyDict_GetItemString" },
-/* 22 */
-    { (void *)PyDict_DelItemString, 22, "PyDict_DelItemString" },
-/* 21 */
-    { (void *)PyDict_SetItemString, 21, "PyDict_SetItemString" },
-
-/* Integer */
-/* 34 */
-    { (void *)PyInt_FromLong, 34, "PyInt_FromLong" },
-/* 25 */
-    { (void *)PyInt_AsLong, 25, "PyInt_AsLong" },
-/* 35 */
-    { (void *)PyInt_GetMax, 35, "PyInt_GetMax" },
-
-/* Float */
-/* 36 */
-    { (void *)PyFloat_FromDouble, 36, "PyFloat_FromDouble" },
-/* 37 */
-    { (void *)PyFloat_AsDouble, 37, "PyFloat_AsDouble" },
-
-/* Modules */
-/* 28 */
-    { (void *)PyModule_New, 28, "PyModule_New" },
-/* 14 */
-    { (void *)PyModule_GetDict, 14, "PyModule_GetDict" },
-/* 26 */
-    { (void *)PyModule_GetName, 26, "PyModule_GetName" },
-    { (void *)PyModule_GetFilename, 26, "PyModule_GetFilename" },
-
-/* 39 */
-    { (void *)PyTuple_New, 39, "PyTuple_New" },
-/* 18 */
-    { (void *)PyTuple_Size, 18, "PyTuple_Size" },
-    { (void *)PyTuple_Check, 18, "PyTuple_Check" },
-/* 40 */
-    { (void *)PyTuple_GetItem, 40, "PyTuple_GetItem" },
-/* 41 */
-    { (void *)PyTuple_SetItem, 41, "PyTuple_SetItem" },
-/* 13 */
-    { (void *)PyTuple_GetSlice, 13, "PyTuple_GetSlice" },
-
-/* 42 */
-    { (void *)PySlice_New, 42, "PySlice_New" },
-/* 43 */
-    { (void *)PySlice_GetIndices, 43, "PySlice_GetIndices" },
-/* 44 */
-    { (void *)PyRange_New, 44, "PyRange_New" },
-
-/* Error handling definitions */
-
-/* 30 */
-    { (void *)PyErr_SetNone, 30, "PyErr_SetNone" },
-/* 45 */
-    { (void *)PyErr_SetObject, 45, "PyErr_SetObject" },
-/* 46 */
-    { (void *)PyErr_SetString, 46, "PyErr_SetString" },
-/* 29 */
-    { (void *)PyErr_Occurred, 29, "PyErr_Occurred" },
-/* 1 */
-    { (void *)PyErr_Clear, 1, "PyErr_Clear" },
-/* 47 */
-    { (void *)PyErr_Fetch, 47, "PyErr_Fetch" },
-/* 48 */
-    { (void *)PyErr_Restore, 48, "PyErr_Restore" },
-
-/* Error testing and normalization */
-/* 19 */
-    { (void *)PyErr_GivenExceptionMatches, 19, "PyErr_GivenExceptionMatches" },
-/* 18 */
-    { (void *)PyErr_ExceptionMatches, 18, "PyErr_ExceptionMatches" },
-/* 47 */
-    { (void *)PyErr_NormalizeException, 47, "PyErr_NormalizeException" },
-
-/* Classes */
-/* 42 */
-    { (void *)PyClass_New, 42, "PyClass_New" },
-/* 42 */
-    { (void *)PyInstance_New, 42, "PyInstance_New" },
-
-/* 17 */
-{ (void *)PyInstance_NewRaw, 17, "PyInstance_NewRaw" },
-/* 42 */
-{ (void *)PyMethod_New, 42, "PyMethod_New" },
-/* 14 */
-{ (void *)PyMethod_Function, 14, "PyMethod_Function" },
-{ (void *)PyMethod_Self, 14, "PyMethod_Self" },
-{ (void *)PyMethod_Class, 14, "PyMethod_Class" },
-
-/* Module */
-/* 28 */
-{ (void *)PyModule_New, 28, "PyModule_New" },
-/* 14 */
-{ (void *)PyModule_GetDict, 14, "PyModule_GetDict" },
-/* 26 */
-{ (void *)PyModule_GetName, 26, "PyModule_GetName" },
-{ (void *)PyModule_GetFilename, 26, "PyModule_GetFilename" },
-/* 35 */
-{ (void *)PyImport_GetMagicNumber, 35, "PyImport_GetMagicNumber" },
-/* 49 */
-{ (void *)PyImport_ExecCodeModule, 49, "PyImport_ExecCodeModule" },
-/* 50 */
-{ (void *)PyImport_ExecCodeModuleEx, 50, "PyImport_ExecCodeModuleEx" },
-/* 29 */
-{ (void *)PyImport_GetModuleDict, 29, "PyImport_GetModuleDict" },
-/* 28 */
-{ (void *)PyImport_AddModule, 28, "PyImport_AddModule" },
-{ (void *)PyImport_ImportModule, 28, "PyImport_ImportModule" },
-/* 51 */
-#if 0
-    /* In Python 2.6, this because a #define so we cannot take
-     * the address of the function.  - RWMJ.
-     */
-{ (void *)PyImport_ImportModuleEx, 51, "PyImport_ImportModuleEx" },
-#endif
-/* 28 */
-{ (void *)PyImport_Import, 28, "PyImport_Import" },
-/* 14 */
-{ (void *)PyImport_ReloadModule, 14, "PyImport_ReloadModule" },
-/* 1 */
-{ (void *)PyImport_Cleanup, 1, "PyImport_Cleanup" },
-/* 5 */
-{ (void *)PyImport_ImportFrozenModule, 5, "PyImport_ImportFrozenModule" },
-
-/* Interface to random parts in ceval.c */
-/* 42 */
-{ (void *)PyEval_CallObjectWithKeywords, 42, "PyEval_CallObjectWithKeywords" },
-/* 17 */
-#if 0
-// dropped in Python 2.7
-{ (void *)PyEval_CallObject, 17, "PyEval_CallObject" },
-#endif
-
-/* 29 */
-{ (void *)PyEval_GetBuiltins, 29, "PyEval_GetBuiltins" },
-{ (void *)PyEval_GetGlobals, 29, "PyEval_GetGlobals" },
-{ (void *)PyEval_GetLocals, 29, "PyEval_GetLocals" },
-{ (void *)PyEval_GetFrame, 29, "PyEval_GetFrame" },
-/* 4 */
-{ (void *)PyEval_GetRestricted, 4, "PyEval_GetRestricted" },
-
-/* Abstract layer */
-/* 14 */
-{ (void *)PyObject_Type, 14, "PyObject_Type" },
-/* 18 */
-{ (void *)PyObject_Size, 18, "PyObject_Size" },
-/* 17 */
-{ (void *)PyObject_GetItem, 17, "PyObject_GetItem" },
-/* 24 */
-{ (void *)PyObject_SetItem, 24, "PyObject_SetItem" },
-/* 17 */
-{ (void *)PyObject_DelItem, 17, "PyObject_DelItem" },
-/* 52 */
-{ (void *)PyObject_AsCharBuffer, 52, "PyObject_AsCharBuffer" },
-{ (void *)PyObject_AsReadBuffer, 52, "PyObject_AsReadBuffer" },
-{ (void *)PyObject_AsWriteBuffer, 52, "PyObject_AsWriteBuffer" },
-/* 18 */
-{ (void *)PyNumber_Check, 18, "PyNumber_Check" },
-/* 17 */
-{ (void *)PyNumber_Add, 17, "PyNumber_Add" },
-{ (void *)PyNumber_Subtract, 17, "PyNumber_Subtract" },
-{ (void *)PyNumber_Multiply, 17, "PyNumber_Multiply" },
-{ (void *)PyNumber_Divide, 17, "PyNumber_Divide" },
-{ (void *)PyNumber_Remainder, 17, "PyNumber_Remainder" },
-{ (void *)PyNumber_Divmod, 17, "PyNumber_Divmod" },
-/* 42 */
-{ (void *)PyNumber_Power, 42, "PyNumber_Power" },
-/* 14 */
-{ (void *)PyNumber_Negative, 14, "PyNumber_Negative" },
-{ (void *)PyNumber_Positive, 14, "PyNumber_Positive" },
-{ (void *)PyNumber_Absolute, 14, "PyNumber_Absolute" },
-{ (void *)PyNumber_Invert, 14, "PyNumber_Invert" },
-/* 17 */
-{ (void *)PyNumber_Lshift, 17, "PyNumber_Lshift" },
-{ (void *)PyNumber_Rshift, 17, "PyNumber_Rshift" },
-{ (void *)PyNumber_And, 17, "PyNumber_And" },
-{ (void *)PyNumber_Xor, 17, "PyNumber_Xor" },
-{ (void *)PyNumber_Or, 17, "PyNumber_Or" },
-/* 14 */
-{ (void *)PyNumber_Int, 14, "PyNumber_Int" },
-{ (void *)PyNumber_Long, 14, "PyNumber_Long" },
-{ (void *)PyNumber_Float, 14, "PyNumber_Float" },
-/* 17 */
-{ (void *)PyNumber_InPlaceAdd, 17, "PyNumber_InPlaceAdd" },
-{ (void *)PyNumber_InPlaceSubtract, 17, "PyNumber_InPlaceSubtract" },
-{ (void *)PyNumber_InPlaceMultiply, 17, "PyNumber_InPlaceMultiply" },
-{ (void *)PyNumber_InPlaceDivide, 17, "PyNumber_InPlaceDivide" },
-{ (void *)PyNumber_InPlaceRemainder, 17, "PyNumber_InPlaceRemainder" },
-{ (void *)PyNumber_InPlaceLshift, 17, "PyNumber_InPlaceLshift" },
-{ (void *)PyNumber_InPlaceRshift, 17, "PyNumber_InPlaceRshift" },
-{ (void *)PyNumber_InPlaceAnd, 17, "PyNumber_InPlaceAnd" },
-{ (void *)PyNumber_InPlaceXor, 17, "PyNumber_InPlaceXor" },
-{ (void *)PyNumber_InPlaceOr, 17, "PyNumber_InPlaceOr" },
-/* 42 */
-{ (void *)PyNumber_InPlacePower, 42, "PyNumber_InPlacePower" },
-/* 18 */
-{ (void *)PySequence_Check, 18, "PySequence_Check" },
-{ (void *)PySequence_Size, 18, "PySequence_Size" },
-{ (void *)PySequence_Length, 18, "PySequence_Length" },
-/* 17 */
-{ (void *)PySequence_Concat, 17, "PySequence_Concat" },
-/* 40 */
-{ (void *)PySequence_Repeat, 40, "PySequence_Repeat" },
-{ (void *)PySequence_GetItem, 40, "PySequence_GetItem" },
-/* 13 */
-{ (void *)PySequence_GetSlice, 13, "PySequence_GetSlice" },
-/* 41 */
-{ (void *)PySequence_SetItem, 41, "PySequence_SetItem" },
-/* 20 */
-{ (void *)PySequence_DelItem, 20, "PySequence_DelItem" },
-/* 53 */
-{ (void *)PySequence_SetSlice, 53, "PySequence_SetSlice" },
-/* 54 */
-{ (void *)PySequence_DelSlice, 54, "PySequence_DelSlice" },
-/* 14 */
-{ (void *)PySequence_Tuple, 14, "PySequence_Tuple" },
-{ (void *)PySequence_List, 14, "PySequence_List" },
-/* 16 */
-{ (void *)PySequence_Fast, 16, "PySequence_Fast" },
-/* 19 */
-{ (void *)PySequence_Count, 19, "PySequence_Count" },
-{ (void *)PySequence_Contains, 19, "PySequence_Contains" },
-{ (void *)PySequence_In, 19, "PySequence_In" },
-{ (void *)PySequence_Index, 19, "PySequence_Index" },
-/* 17 */
-{ (void *)PySequence_InPlaceConcat, 17, "PySequence_InPlaceConcat" },
-/* 22 */
-{ (void *)PySequence_InPlaceRepeat, 22, "PySequence_InPlaceRepeat" },
-/* 18 */
-{ (void *)PyMapping_Check, 18, "PyMapping_Check" },
-{ (void *)PyMapping_Size, 18, "PyMapping_Size" },
-{ (void *)PyMapping_Length, 18, "PyMapping_Length" },
-/* 16 */
-{ (void *)PyMapping_HasKeyString, 16, "PyMapping_HasKeyString" },
-/* 19 */
-{ (void *)PyMapping_HasKey, 19, "PyMapping_HasKey" },
-/* 16 */
-{ (void *)PyMapping_GetItemString, 16, "PyMapping_GetItemString" },
-/* 41 */
-{ (void *)PyMapping_SetItemString, 41, "PyMapping_SetItemString" },
-
-/* End */
-{ NULL, 0 }
-};
-
-value pygetfuncarray( value unit ) {
-    CAMLparam1(unit);
-    CAMLlocal2(retv,tuplev);
-    int i;
-    int total_funcs;
-
-    for( i = 0; the_python_func_table[i].func; i++ ) ; total_funcs = i;
-
-    retv = alloc(total_funcs,0);
-
-    for( i = 0; i < total_funcs; i++ ) {
-       tuplev = alloc_tuple( 3 );
-       Store_field(tuplev,0,funcwrap((void *)the_python_func_table[i].func));
-       Store_field(tuplev,1,Val_int(the_python_func_table[i].format));
-       Store_field(tuplev,2,Val_int(i));
-       Store_field(retv,i,tuplev);
-    }
-
-    CAMLreturn(retv);
-}
-
-enum PycamlTypeLabels { 
-    TupleType = 0,
-    StringType,
-    IntType,
-    FloatType,
-    ListType,
-    NoneType,
-    CallableType,
-    ModuleType,
-    ClassType,
-    TypeType,
-    DictType,
-    NullType,
-    OtherType
-};
-
-value pytype( value obj ) {
-    CAMLparam1(obj);
-    PyObject *pobj = pyunwrap( obj );
-    if( !pobj ) CAMLreturn(NullType);
-    else if( PyTuple_Check( pobj ) ) CAMLreturn(Val_int(TupleType));
-    else if( PyString_Check( pobj ) ) CAMLreturn(Val_int(StringType));
-    else if( PyInt_Check( pobj ) ) CAMLreturn(Val_int(IntType));
-    else if( PyFloat_Check( pobj ) ) CAMLreturn(Val_int(FloatType));
-    else if( PyList_Check( pobj ) ) CAMLreturn(Val_int(ListType));
-    else if( pobj == Py_None ) CAMLreturn(Val_int(NoneType));
-    else if( PyCallable_Check( pobj ) ) CAMLreturn(Val_int(CallableType));
-    else if( PyModule_Check( pobj ) ) CAMLreturn(Val_int(ModuleType));
-    else if( PyClass_Check( pobj ) ) CAMLreturn(Val_int(ClassType));
-    else if( PyType_Check( pobj ) ) CAMLreturn(Val_int(TypeType));
-    else if( PyDict_Check( pobj ) ) CAMLreturn(Val_int(DictType));
-    else CAMLreturn(Val_int(OtherType));
-}
-
-value pynull( value unit ) {
-    CAMLparam1(unit);
-    CAMLreturn(pywrap(NULL));
-}
-
-value pynone( value unit ) {
-    CAMLparam1(unit);
-    CAMLreturn(pywrap(Py_None));
-}
-
-value pytuple_fromarray( value array ) {
-    CAMLparam1(array);
-    PyObject *tuple = PyTuple_New(Wosize_val(array));
-    PyObject *elt;
-    int i;
-    int x;
-
-    for( i = 0; i < Wosize_val(array); i++ ) {
-       elt = pyunwrap(Field(array,i));
-       Py_INCREF(elt); /* PyTuple_SetItem will steal a reference */
-       x = PyTuple_SetItem(tuple,i,elt);
-    }
-
-    CAMLreturn(pywrap(tuple));
-}
-
-value pytuple_toarray( value array ) {
-    CAMLparam1(array);
-    PyObject *obj = pyunwrap(array);
-    int i;
-    CAMLlocal1(rv);
-
-    rv = alloc_tuple( PySequence_Size(obj) );
-
-    for( i = 0; i < PySequence_Size(obj); i++ )
-       Store_field(rv,i,pywrap(PySequence_GetItem(obj,i)));
-
-    CAMLreturn(rv);
-}
-
-value pywrap_closure( value closure ) {
-    CAMLparam1(closure);
-    PyMethodDef ml;
-    PyObject *obj;
-    PyMethodDef *ml_def;
-    ml.ml_name = "anonymous_closure";
-    ml.ml_meth = pycall_callback;
-    ml.ml_flags = 1;
-    ml.ml_doc = "Anonymous closure";
-    obj = camlwrap(closure,&ml,sizeof(ml));
-    ml_def = (PyMethodDef *)caml_aux(obj);
-    CAMLreturn(pywrap(PyCFunction_New(ml_def,obj)));
-}
-
-value pymodule_initmodule( value name, value funclist ) {
-    CAMLparam2(name,funclist);
-    int i;
-    PyMethodDef *methods = malloc( sizeof( PyMethodDef ) *
-                                  Wosize_val(funclist) );
-    CAMLlocal1(item);
-
-    PyImport_AddModule( String_val(name) );
-
-    for( i = 0; i < Wosize_val(funclist); i++ ) {
-       item = Field(funclist,i);
-       methods[i].ml_name = String_val(Field(item,0));
-#ifdef PYTHON24
-       methods[i].ml_meth = pywrap_closure(Field(item,1));
-#else
-       methods[i].ml_meth = (void *)(uintptr_t)pywrap_closure(Field(item,1));
-#endif
-       methods[i].ml_flags = Int_val(Field(item,2));
-       methods[i].ml_doc = String_val(Field(item,3));
-    }
-
-    Py_InitModule( String_val(name), methods );
-
-    free( methods );
-
-    CAMLreturn(Val_unit);
-}
-
-value pycaml_setargs(value argv) {
-  CAMLparam1(argv);
-  char* cargv[1];
-
-  cargv[0] = String_val(argv);
-
-  PySys_SetArgv(1, cargv);
-
-  CAMLreturn0; 
-}
-
-value pytrue( value unit ) {
-    CAMLparam1(unit);
-    CAMLreturn(pywrap(Py_True));
-}
-
-value pyfalse(value unit) {
-    CAMLparam1(unit);
-    CAMLreturn(pywrap(Py_False));
-}
diff --git a/pycaml/pycamltest.ml b/pycaml/pycamltest.ml
deleted file mode 100644 (file)
index 291b8a6..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-(*
- * (C) arty 2002
- * This software is covered under the GNU lesser general public license
- *)
-open Pycaml ;;
-
-let colorsys = pyimport_importmodule "colorsys"
-let dict = pymodule_getdict colorsys
-
-let triplet = pytuple3 (pyfloat_fromdouble 1.0,
-                       pyfloat_fromdouble 0.5,
-                       pyfloat_fromdouble 0.2) ;;
-
-let rgbtoyiq = pydict_getitemstring (dict,"rgb_to_yiq")
-let triplet = pyeval_callobject (rgbtoyiq,triplet)
-
-let _ = print_endline ((string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,0)))) ^
-                      " " ^
-                      (string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,1)))) ^
-                      " " ^
-                      (string_of_float
-                         (pyfloat_asdouble (pytuple_getitem (triplet,2))))) ;;
-
-let x = pywrap_closure
-    (fun x -> print_string (pystring_asstring (pytuple_getitem (x,0))) ;
-      pynone ())
-
-let _ = pyeval_callobject
-    (x,pytuple_fromsingle (pystring_fromstring "hi there"))
diff --git a/pycaml/tupletest.ml b/pycaml/tupletest.ml
deleted file mode 100644 (file)
index 41ecdc3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-open Pycaml
-
-let foo_bar_print = pywrap_closure
-  (fun x -> pytuple_fromarray (pytuple_toarray x)) ;;
-let sd = pyimport_getmoduledict () ;;
-let mx = pymodule_new "CamlModule" ;;
-let cd = pydict_new () ;;
-let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
-let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
-let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
-let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
-let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;
-let _ = pyrun_simplestring
-  ("from CamlModule import CamlClass\n" ^
-   "x = CamlClass()\n" ^
-   "for i in range(100000):\n" ^
-   "  x.CamlMethod(1,2,3,4)\n")
index 90fa83a..c935e33 100644 (file)
@@ -25,7 +25,9 @@
 #############################################################################
 # Configuration section
 #############################################################################
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 ##############################################################################
 # Variables
@@ -37,12 +39,7 @@ SOURCES= pycocci_aux.ml $(PYCOCCI_FILE) pycocci.ml
 INCLUDEDIRS_LOCAL = ../commons ../commons/ocamlextra ../globals \
                    ../parsing_c ../parsing_cocci
 
-ifeq ("$(PYCAMLDIR)", "pycaml")
-INCLUDEDIRS_LOCAL += ../$(PYCAMLDIR)
-INCLUDEDIRS = $(INCLUDEDIRS_LOCAL)
-else
 INCLUDEDIRS = $(INCLUDEDIRS_LOCAL) $(PYCAMLDIR)
-endif
 
 SYSLIBS = str.cma unix.cma pycaml.cma
 LIBS=../commons/commons.cma ../globals/globals.cma
@@ -60,10 +57,10 @@ INCLUDES_DEPEND=$(INCLUDEDIRS_LOCAL:%=-I %) $(INCLUDESEXTRA)
 
 # The Caml compilers.
 OCAMLCFLAGS ?= -g -dtypes
-OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
-OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES_DEPEND)
-
+OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES_DEPEND)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
 
 ##############################################################################
 # Top rules
@@ -81,8 +78,6 @@ OPTOBJS = $(OBJS:.cmo=.cmx)
 CTLOBJS = $(CTLSOURCES:.ml=.cmo)
 CTLOPTOBJS = $(CTLOBJS:.cmo=.cmx)
 
-
-#all: $(EXEC) $(LIB)
 all: $(LIB)
 
 all.opt: $(OPTLIB)
@@ -91,21 +86,21 @@ ctl: $(CTLEXEC)
 
 
 $(LIB): $(OBJS)
-       $(OCAMLC) -a -o $(LIB) $(OBJS)
+       $(OCAMLC_CMD) -a -o $(LIB) $(OBJS)
 
 clean::
        rm -f $(LIB)
 
 
 $(OPTLIB): $(OPTOBJS)
-       $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
+       $(OCAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS)
 
 
 $(EXEC): $(OBJS) main.cmo $(LIBS)
-       $(OCAMLC) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
+       $(OCAMLC_CMD) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
 
 $(CTLEXEC): $(CTLOBJS) $(LIBS)
-       $(OCAMLC) -o $(CTLEXEC) $(SYSLIBS) $(LIBS) $(CTLOBJS)
+       $(OCAMLC_CMD) -o $(CTLEXEC) $(SYSLIBS) $(LIBS) $(CTLOBJS)
 
 
 clean::
@@ -113,10 +108,10 @@ clean::
        rm -f $(TARGET)
        rm -f $(TARGET).byte
        rm -f $(CTLTARGET)
+       rm -f .depend
 
 distclean::
        $(MAKE) -C coccilib $@
-       rm -f .depend
        rm -f pycocci.ml
 
 ##############################################################################
@@ -127,13 +122,13 @@ distclean::
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 
 # clean rule for others files
@@ -141,12 +136,12 @@ clean::
        rm -f *.cm[iox] *.o  *.annot
        rm -f *~ .*~ #*#
 
-beforedepend:
-
-depend: beforedepend
-       $(OCAMLDEP) *.mli *.ml > .depend
-
-.depend:
-       $(OCAMLDEP) *.mli *.ml > .depend
+.PHONEY: depend
+.depend depend:
+       $(OCAMLDEP_CMD) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 3aff755..1eb427c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./no_pycocci.ml"
 open Ast_c
 open Common
 open Pycocci_aux
index ca370fc..967025d 100644 (file)
@@ -1 +1 @@
-include @PYCOCCI_FILE@
+include @PYCOCCI_MODULE@
index aca8366..270ef71 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pycocci.mli"
 val build_classes : Ast_cocci.meta_name list -> unit
 val construct_variables :
     (string * Ast_cocci.meta_name * Ast_cocci.metavar) list
index 6bc09b9..72f1884 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pycocci_aux.ml"
 open Ast_c
 open Common
 
index acef890..2b5c2e6 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./pycocci_aux.mli"
 val exprlistrep : Ast_c.argument Ast_c.wrap2 list -> string * string list
 val paramlistrep : Ast_c.parameterType Ast_c.wrap2 list -> string * string list
 val initlistrep : Ast_c.initialiser Ast_c.wrap2 list -> string * string list
index c1792b6..f36eebf 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./yes_pycocci.ml"
 open Ast_c
 open Common
 open Pycaml
index c1c18d1..e7df4b8 100644 (file)
@@ -4,29 +4,27 @@
 , cocciSrc ? { outPath = ./.; revCount = 1234; gitTag = "abcdef"; }
 , testsSrc ? { outPath = ../big-tests; rev = 1234; }
 , officialRelease ? false
+, performRegress ? false
 }:
 
+
 let
   
   # version information
   version = builtins.readFile ./version;
   versionSuffix = if officialRelease then "" else "pre${toString cocciSrc.revCount}-${cocciSrc.gitTag}";
 
+
+  #
+  # Source release (tarball)
+  #
+
   # The source tarball taken from the repository.
   # The tarball should actually be compilable using
   #   ./configure && make depend && make opt && make install
   # on systems other than nix.
   tarball =
-    let
-      pkgs = import nixpkgs {
-        # use ocaml 3.12
-        config.packageOverrides =
-          pkgs:
-          { ocaml = pkgs.ocaml_3_12_1;
-            ocamlPackages = pkgs.ocamlPackages_3_12_1;
-          };
-      };
-      
+    let pkgs = import nixpkgs { };
     in with pkgs; with ocamlPackages; releaseTools.sourceTarball {
       name = "coccinelle-tarball";
       src = cocciSrc;
@@ -35,20 +33,10 @@ let
       inherit versionSuffix;
 
       buildInputs = [
-        perl python texLiveFull
-        ocaml findlib menhir
-        ocaml_pcre ocaml_sexplib
-        ocaml_extlib pycaml
+        ocaml findlib menhir python
+        texLiveFull # for building the documentation
+       pkgconfig  # for the autoconf macros
       ];
-      
-      configurePhase = ''
-        # explicitly run perl because the configure script references a perl outside the nix store
-        # substituting the path to perl is not a good idea as it would invalidate the tarball on
-        # non-nix machines.
-        perl -w ./configure
-        
-        make depend
-      '';
 
       preDist = ''
         local PREVHOME=$HOME
@@ -67,68 +55,64 @@ let
     };
 
 
-  # builds coccinelle, given a ocaml selector function and an ocaml environment builder.
-  # the build procedure itself is largely the same as the coccinelle expression in nixpkgs.
+  #
+  # Builds for specific configurations
+  #
+
+  # builds coccinelle, parameterized over the ocaml and python packages, and the configure flags.
   # the result should be a usable nix-expression
-  mkBuild = { name, ocamlVer, mkEnv, inclPython }: { system ? builtins.currentSystem }:
+
+  # mkConfiguration is a function that takes the nix package collection of the build
+  # (called 'pkgs') and results in a record containing:
+  #  name of the configuration, python packages, ocaml packages selection function
+  #  (which takes the original 'pkgs' as parameter), and ocaml packages. The selection
+  #  function is used by 'mkConfiguration' to determine the appropriate ocamlPackages
+  #  field in 'pkgs'.
+  mkBuild = mkConfiguration: { system ? builtins.currentSystem }:
     let pkgs = import nixpkgs {
           inherit system;
-          config.packageOverrides = ocamlVer;
+          config.packageOverrides = orig : {
+            ocamlPackages = cfg.selOcaml orig;
+          };
         };
-
-        ocamlEnv = mkEnv pkgs;
+        cfg = mkConfiguration pkgs;
     in with pkgs; releaseTools.nixBuild {
-      inherit name;
+      name = "cocci-build-${cfg.name}";
       src = tarball;
-
-      # ocamlEnv contains the ocaml libraries in scope.
-      buildInputs = 
-        lib.optional inclPython python
-        ++ [ perl texLiveFull ncurses makeWrapper ocamlEnv ];
-
-      # patch the files for use with nix
-      preConfigure = ''
-        sed -i "configure" -e's|/usr/bin/perl|${perl}/bin/perl|g'
-        sed -i "globals/config.ml.in" \
-            -e"s|/usr/local/share|$out/share|g"
-      '';
-
-      configureFlags = lib.optional (!inclPython) "--without-python";
-
+      buildInputs = [ pkgconfig pcre ncurses ocamlPackages.ocaml ] ++ cfg.ocamls ++ cfg.pythons;
+      configureFlagsArray = cfg.flags ++ [ "--enable-release=world" ];
       buildPhase = ''
-        make depend 2> >(tee -a "$out/nix-support/make.log" >&2)
-        make all 2> >(tee -a "$out/nix-support/make.log" >&2)
-        make all.opt 2> >(tee -a "$out/nix-support/make.log" >&2)
-      '';
+        mkdir -p "$out/nix-support/"
+        touch "$out/nix-support/make.log"
+        echo "report log $out/nix-support/result.log" >> "$out/nix-support/hydra-build-products"
 
-      # run checking after installation.
-      # also, the test phase may require a yes/no input.
-      doCheck = false;
-      postInstall = ''
-        wrapProgram "$out/bin/spatch"                              \
-         --prefix "LD_LIBRARY_PATH" ":" "$out/lib"                 \
-         --prefix "PYTHONPATH" ":" "$out/share/coccinelle/python"
-
-        wrapProgram "$out/bin/spatch.opt"                          \
-         --prefix "LD_LIBRARY_PATH" ":" "$out/lib"                 \
-         --prefix "PYTHONPATH" ":" "$out/share/coccinelle/python"
-
-        yes | make test
+        make all 2> >(tee -a "$out/nix-support/make.log" >&2)
       '';
     };
 
+  build = mkBuild defaultCfg;
+  defaultCfg = pkgs: with pkgs; {
+    name = "default";
+    pythons = [ python3 ];
+    ocamls = with ocamlPackages; [
+      findlib menhir ocaml_sexplib ocaml_extlib ocaml_pcre pycaml
+    ];
+    flags = [];
+    selOcaml = orig: orig.ocamlPackages;
+  };
+
 
+  /*
   # selects which version of ocaml and ocamlPackages to use in nixpkgs.
   selOcaml312 = pkgs:
     { ocaml = pkgs.ocaml_3_12_1;
       ocamlPackages = pkgs.ocamlPackages_3_12_1;
     };
-  selOcaml311 = pkgs:
-    { ocaml = pkgs.ocaml_3_11_1;
-      ocamlPackages = pkgs.ocamlPackages_3_11_1;
+  selOcaml310 = pkgs:
+    { ocaml = pkgs.ocaml_3_10_0;
+      ocamlPackages = pkgs.ocamlPackages_3_10_0;
     };
 
-
   # builds an environment with the ocaml packages needed to build coccinelle
   # the mkList function selects which additional packages to include
   mkOcamlEnv = mkList: pkgs:
@@ -143,6 +127,22 @@ let
   libs_se   = mkOcamlEnv (libs: with libs; [ ocaml_sexplib ocaml_extlib ]);
   libs_null = mkOcamlEnv (libs: []);
 
+  # different configurations of coccinelle builds based on different ocamls/available libraries
+  build = mkBuild { name = "coccinelle"; ocamlVer = selOcaml312; mkEnv = libs_full; inclPython = true; };
+  build_rse = mkBuild { name = "coccinelle_config1"; ocamlVer = selOcaml312; mkEnv = libs_rse; inclPython = true; };
+  build_se = mkBuild { name = "coccinelle_config2"; ocamlVer = selOcaml312; mkEnv = libs_se; inclPython = true; };
+  build_null_12 = mkBuild { name = "coccinelle_config3"; ocamlVer = selOcaml312; mkEnv = libs_null; inclPython = true; };
+  # build_null_10 = mkBuild { name = "coccinelle_config4"; ocamlVer = selOcaml310; mkEnv = libs_null; inclPython = true; };
+  build_null_12_np = mkBuild { name = "coccinelle_config5"; ocamlVer = selOcaml312; mkEnv = libs_null; inclPython = false; };
+  # build_null_10_np = mkBuild { name = "coccinelle_config6"; ocamlVer = selOcaml310; mkEnv = libs_null; inclPython = false; };
+  build_rse_np = mkBuild { name = "coccinelle_config7"; ocamlVer = selOcaml312; mkEnv = libs_rse; inclPython = false; };
+  */
+
+
+  #
+  # Package builders
+  #
+
   # package builder for Debian-based OS'ses
   makeDeb =
     system: diskImageFun:
@@ -167,6 +167,15 @@ let
   makeDeb_i686 = makeDeb "i686-linux";
   makeDeb_x86_64 = makeDeb "x86_64-linux";
 
+  # different debian builds
+  # deb_ubuntu1010_i386 = makeDeb_i686 (disk: disk.ubuntu1010i386);
+  # deb_ubuntu1010_x86_64 = makeDeb_x86_64 (disk: disk.ubuntu1010x86_64);
+
+
+  #
+  # Testing tasks
+  #
+
   mkTask =
     argsfun: { system ? builtins.currentSystem }:
     let pkgs = import nixpkgs { inherit system; };
@@ -219,6 +228,14 @@ let
     };
   });
 
+  report = mkReport [ build ];
+  # build_rse build_se build_null_12 build_null_12_np build_rse_np
+
+
+  #
+  # Regression tests
+  #
+
   # Produces regression test results, which can be positive or
   # negative. The build should succeed regardless of the outcome
   # of individual tests unless coccinelle is horribly broken.
@@ -300,27 +317,62 @@ let
       };
     });
 
-in # list of jobs
-rec {
-  inherit tarball;
+  regress = assert performRegress; mkRegress build;
+  test = checkRegress regress;
 
-  # different configurations of coccinelle builds based on different ocamls/available libraries
-  build = mkBuild { name = "coccinelle"; ocamlVer = selOcaml312; mkEnv = libs_full; inclPython = true; };
-  build_rse = mkBuild { name = "coccinelle_config1"; ocamlVer = selOcaml312; mkEnv = libs_rse; inclPython = true; };
-  build_se = mkBuild { name = "coccinelle_config2"; ocamlVer = selOcaml312; mkEnv = libs_se; inclPython = true; };
-  build_null_12 = mkBuild { name = "coccinelle_config3"; ocamlVer = selOcaml312; mkEnv = libs_null; inclPython = true; };
-  build_null_11 = mkBuild { name = "coccinelle_config4"; ocamlVer = selOcaml311; mkEnv = libs_null; inclPython = true; };
-  build_null_12_np = mkBuild { name = "coccinelle_config5"; ocamlVer = selOcaml312; mkEnv = libs_null; inclPython = false; };
-  build_null_11_np = mkBuild { name = "coccinelle_config6"; ocamlVer = selOcaml311; mkEnv = libs_null; inclPython = false; };
-  build_rse_np = mkBuild { name = "coccinelle_config7"; ocamlVer = selOcaml312; mkEnv = libs_rse; inclPython = false; };
 
-  report = mkReport [ build build_rse build_se build_null_12 build_null_11 build_null_12_np build_null_11_np build_rse_np ];
+  #
+  # Performing release actions
+  #
 
-  # different debian builds
-  # deb_ubuntu1010_i386 = makeDeb_i686 (disk: disk.ubuntu1010i386);
-  # deb_ubuntu1010_x86_64 = makeDeb_x86_64 (disk: disk.ubuntu1010x86_64);
+  dist =
+    let pkgs = import nixpkgs { };
+        name = "release-${version}${versionSuffix}";
+    in with pkgs; releaseTools.nixBuild {
+      inherit name;
+      src = cocciSrc;
+      buildInputs = with ocamlPackages; [
+        pkgconfig ncurses texLiveFull
+        ocaml findlib menhir
+        python
+      ];
+      configureFlagsArray = [ "--enable-release=world" ];
+      
+      buildPhase = ''
+        export HOME=$TMPDIR
+       make prerelease GIT=echo
+       make release GIT=echo
+       make package
+      '';
 
-  # extensive tests
-  regress = mkRegress build;
-  test = checkRegress regress;
-}
+      installPhase = ''
+        mkdir -p "$out/nix-support/"
+       echo "cocci-dist-${version}" > "$out/nix-support/hydra-release-name"
+       cp $TMP/*.tgz "$out/"
+       for file in $out/*.tgz; do
+          echo "file binary-dist $file" >> $out/nix-support/hydra-build-products
+       done
+      '';
+
+      dontInstall = false;
+      doCheck = false;
+    };
+  
+  #
+  # collections of build tasks
+  #
+
+  basicAttrs = {
+    inherit tarball;
+    inherit build;
+# build_rse build_se build_null_12 build_null_12_np build_rse_np;
+    inherit report;
+    inherit dist;
+  };
+
+  testAttrs = {
+    inherit regress;
+    inherit test;
+  };
+
+in basicAttrs // (if performRegress then testAttrs else {})
diff --git a/scripts/genversion.sh b/scripts/genversion.sh
new file mode 100755 (executable)
index 0000000..9ae5a04
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# fallback date (in RFC format)
+VERSION=`date "+%a, %d %b %Y %H:%M:%S %z"`
+
+# use the date information from git, if git is present
+which git &>/dev/null
+if [ $? -eq 0 ] && [ -d ".git" ]
+then
+VERSION=`git log -1 --date-order --date=rfc --pretty="format:%cd"`
+fi
+
+echo "let version_date = \"$VERSION\""
index 9a0254b..52de4f4 100644 (file)
@@ -42,11 +42,12 @@ _spatch()
     COMPREPLY=()
     cur=${COMP_WORDS[COMP_CWORD]}
     prev=${COMP_WORDS[COMP_CWORD-1]}
-    _spatch_options="-parse_cocci -sp_file -I -dir -patch
-          -iso_file -macro_file -macro_file_builtins
-          -inplace -outplace -use_glimpse -help -o -ignore_unknown_options
-          -include_headers -no_includes -all_includes -local_includes
-          -quiet -very_quiet -debug -timeout -test"
+    _spatch_options="--parse-cocci --sp-file -I --dir --patch
+          --iso-file --macro-file --macro-file-builtins
+          --in-place --out-place -h --help --shorthelp --longhelp -o --ignore-unknown-options
+          --use-glimpse --use-google --use-idutils
+          --include-headers --no-includes --all-includes --local-includes --preprocess
+          --quiet --very-quiet --debug --timeout --test"
 
     if [[ $COMP_CWORD -eq 1 ]]; then
         local IFS=$'\n'
@@ -54,16 +55,16 @@ _spatch()
         return 0
     fi
     case "$prev" in
-        -parse_cocci|-sp_file)
+        --parse-cocci|--sp-file)
             xspec="!*.cocci"
            ;;
-        -iso_file)
+        --iso-file)
             xspec="!*.iso"
            ;;
-        -macro_file|-macro_file_builtins)
+        --macro-file|--macro-file-builtins)
             xspec="!*.h"
            ;;
-        -I|-dir|-patch)
+        -I|--dir|--patch)
             xspec=""
            ;;
         *)
diff --git a/scripts/spatch.sh b/scripts/spatch.sh
deleted file mode 100644 (file)
index 05dc0ab..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-COCCINELLE_HOME=${COCCINELLE_HOME:=SHAREDIR}
-#echo setting COCCINELLE_HOME=${COCCINELLE_HOME:=SHAREDIR}
-
-if [ ! -r "$COCCINELLE_HOME"/standard.iso ] ; then
-    echo "There is no standard.iso in SHAREDIR."
-    echo "Are you sure you run a properly installed version of spatch ?\n"
-else
-
- export COCCINELLE_HOME
- export LD_LIBRARY_PATH="LIBDIR:$LD_LIBRARY_PATH"
- export PYTHONPATH="$COCCINELLE_HOME/python:$PYTHONPATH"
-
-# echo setting LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
-# echo setting PYTHONPATH="$PYTHONPATH"
-
-fi
-
-"$COCCINELLE_HOME"/spatch.opt "$@"
-
diff --git a/scripts/spatch.sh.in b/scripts/spatch.sh.in
new file mode 100644 (file)
index 0000000..ea47a12
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh -e
+
+# generic wrapper script to invoke 'spatch' or 'spatch.opt'
+# it sets the python variables (if relevant)
+# and OCCINELLE_HOME
+
+SHAREDIR="@prefix@/share/coccinelle"
+LIBDIR="@prefix@/lib"
+
+COCCINELLE_HOME="${COCCINELLE_HOME:=$SHAREDIR}"
+#echo setting COCCINELLE_HOME=${COCCINELLE_HOME:=$SHAREDIR}
+
+if [ ! -d "${COCCINELLE_HOME}" ]; then
+  echo "\$COCCINELLE_HOME is not a directory: ${COCCINELLE_HOME}" 1>&2
+fi
+
+if [ ! -r "${COCCINELLE_HOME}/standard.iso" ] ; then
+  echo "There is no standard.iso in ${COCCINELLE_HOME}." 1>&2
+  echo "Are you sure you run a properly installed version of spatch ?\n" 1>&2
+else
+
+export COCCINELLE_HOME
+
+export LD_LIBRARY_PATH="${LIBDIR}:$LD_LIBRARY_PATH"
+export PYTHONPATH="${COCCINELLE_HOME}/python:$PYTHONPATH"
+
+# echo setting LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+# echo setting PYTHONPATH="$PYTHONPATH"
+
+fi
+
+extension="${0##*.}"
+if [ "x$extension" = "xopt" ]; then
+  TOOL="spatch.opt"
+elif [ "x$extension" = "xbyte" ]; then
+  TOOL="spatch"
+else
+  # autodetect
+  if [ -f "${COCCINELLE_HOME}/spatch.opt" ]; then
+    TOOL="spatch.opt"
+  elif [ -f "${COCCINELLE_HOME}/spatch" ]; then
+    TOOL="spatch"
+  else
+    echo "No 'spatch' nor 'spatch.opt' found in ${COCCINELLE_HOME}" 1>&2
+    exit 1
+  fi
+fi
+
+exec "${COCCINELLE_HOME}/${TOOL}" "$@"
diff --git a/setup/cocci.m4 b/setup/cocci.m4
new file mode 100644 (file)
index 0000000..74fc281
--- /dev/null
@@ -0,0 +1,322 @@
+dnl
+dnl  autoconf helper macros for coccinelle
+dnl
+
+
+dnl  check if the ocaml version is recent enough
+dnl    $1: the variable to assign
+dnl    $2: version to test against
+AC_DEFUN([AC_CHECK_OCAMLVERSION],
+[dnl
+  AS_UNSET([versioncheck])
+  AC_MSG_CHECKING([that the OCaml version is at least $2])
+  AS_VERSION_COMPARE([$OCAMLVERSION],[$2],[versioncheck=no],[versioncheck=yes],[versioncheck=yes])
+  AC_MSG_RESULT([$versioncheck])
+  AC_SUBST([$1], [$versioncheck])
+])
+
+
+dnl  using ocamlfind to store into $1 the location where
+dnl  a package $2 resides.
+AC_DEFUN([AC_COCCI_OCAMLPKGDIR],
+[dnl
+  AC_SUBST(AS_TR_SH([PATH_$1]),[`$OCAMLFIND query $1 2>/dev/null`])
+])
+
+
+dnl  stores the result of checking for the
+dnl  ocaml package given as $2 in the
+dnl  variable given as $1
+AC_DEFUN([AC_COCCI_OCAMLPKG],
+[dnl
+  AC_CHECK_OCAML_PKG([$1])
+  AS_IF([test "x$[]AS_TR_SH([OCAML_PKG_$1])" != xno],[AC_COCCI_OCAMLPKGDIR([$1])])
+])
+
+dnl  requires that the ocaml package is installed.
+dnl  it is assumed that this package is part of the
+dnl  ocaml installation.
+AC_DEFUN([AC_REQ_COCCI_STDPKG],
+[dnl
+  AC_COCCI_OCAMLPKG([$1])
+  AS_IF([test "x$[]AS_TR_SH([OCAML_PKG_$1])" = xno],
+  [dnl
+    AC_MSG_ERROR([package $1 is required. It should be part of your ocaml installation.])
+  ])
+])
+
+
+dnl  defines the COCCI_OCAML_EXTERNAL variable to point to the directory
+dnl  with extra ocaml packages
+AC_DEFUN([AC_COCCI_SET_EXTERNAL_DIR],
+[dnl
+  AC_ARG_VAR(COCCI_OCAML_EXTERNAL, [path to extra ocaml packages (default: $1)])
+  AC_SUBST([COCCI_OCAML_EXTERNAL],["$1"])
+  AC_MSG_NOTICE([coccinelle may use external ocaml libraries in $COCCI_OCAML_EXTERNAL])
+])
+
+
+dnl  handle optional packages for which coccinelle may have
+dnl  local versions.
+dnl
+dnl  Note: this macro sets additional variables for use with
+dnl  'Makefile.config'.
+dnl
+dnl  variables:
+dnl    enable_$1: either 'yes', 'local', or 'no'
+AC_DEFUN([AC_CHECK_COCCI_EXTPKG],
+[dnl
+  AC_MSG_NOTICE([configuring package $1])
+  AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1], [enable global package $1 (yes,no) (default: auto)]))
+
+  dnl  try and find a globally installed version
+  dnl  if not, enable_$1 will be "no"
+  AS_IF([test "x$[]AS_TR_SH([enable_$1])" != xno],
+  [dnl
+    AC_COCCI_OCAMLPKG([$1])
+    AC_SUBST(AS_TR_SH([GLOBAL_$1]),[$[]AS_TR_SH([OCAML_PKG_$1])])
+
+    AS_IF([test "x$[]AS_TR_SH([GLOBAL_$1])" != xno],
+    [dnl  when the package is available
+      AC_SUBST(AS_TR_SH([enable_$1]),[yes])
+    ],
+    [dnl  when the package is not available
+      AS_IF([test "x$[]AS_TR_SH([enable_$1])" = xyes],
+      [dnl  when explicitly requested the global version
+        AC_MSG_ERROR([OCaml package $1 is not available but requested explicitly])
+      ])
+      AC_SUBST(AS_TR_SH([enable_$1]),[no])
+    ])
+  ])
+
+  dnl  check for a local package
+  AS_IF([test "x$AS_TR_SH([enable_$1])" = xno],
+  [dnl
+    AS_UNSET([pkgdir])
+    pkgdir="$COCCI_OCAML_EXTERNAL/$1/"
+    AC_MSG_CHECKING([for a bundled substitute of $1])
+    AS_IF([test -d "$pkgdir"],
+    [dnl
+      AC_MSG_RESULT([yes])
+      AC_MSG_NOTICE([using bundled substitute for $1 in $pkgdir])
+      AC_SUBST(AS_TR_SH([enable_$1]), [local])
+      AC_SUBST(AS_TR_SH([PATH_$1]), ["$pkgdir"])
+    ],
+    [AC_MSG_RESULT([not available])])
+  ])
+
+  dnl  additional handling
+  AS_IF([test "x$[]AS_TR_SH([enable_$1])" != xno],
+  [dnl
+    AC_SUBST(AS_TR_SH([FEATURE_$1]),[1])
+    AC_SUBST(AS_TR_SH([FLAGS_$1]),['$([]AS_TR_SH([FLAGS_$1]))'])
+
+    dnl  distinguish global/local
+    AS_IF([test "x$[]AS_TR_SH([enable_$1])" = xlocal],
+    [dnl
+      AC_SUBST(AS_TR_SH([LOCALLIB_$1]),[1])
+      AC_SUBST(AS_TR_SH([MODULES_$1]),['$(AS_TR_SH([LOCAL_$1]))'])
+      AC_SUBST(AS_TR_SH([MODULESOPT_$1]),['$(AS_TR_SH([LOCALOPT_$1]))'])
+
+      dnl check if the local directory has a Makefile
+      AS_IF([test -f "$[]AS_TR_SH([PATH_$1])/Makefile"],
+      [dnl
+        AC_SUBST(AS_TR_SH([MAKE_$1]),[$[]AS_TR_SH([PATH_$1])])
+      ],
+      [dnl
+        AC_SUBST(AS_TR_SH([MAKE_$1]),[ ])
+      ])
+    ],
+    [dnl
+      AC_SUBST(AS_TR_SH([MODULES_$1]),['$(AS_TR_SH([GLOBAL_$1]))'])
+      AC_SUBST(AS_TR_SH([MODULESOPT_$1]),['$(AS_TR_SH([GLOBALOPT_$1]))'])
+    ])
+  ])
+])
+
+
+dnl  initializes the defaults substitutions for
+dnl  configuration variables of packages
+AC_DEFUN([AC_COCCI_INIT_PKG_EMPTY],
+[dnl
+  AC_SUBST(AS_TR_SH([FEATURE_$1]), [0])
+  AC_SUBST(AS_TR_SH([LOCALLIB_$1]), [0])
+  AC_SUBST(AS_TR_SH([FLAGS_$1]), [ ])
+  AC_SUBST(AS_TR_SH([MODULES_$1]), [ ])
+  AC_SUBST(AS_TR_SH([MODULESOPT_$1]), [ ])
+  AC_SUBST(AS_TR_SH([PATH_$1]), [ ])
+])
+
+
+dnl  version of AC_CHECK_COCCI_EXTPKG that fails with an
+dnl  error if the package could not be found and no local
+dnl  substitute is available.
+AC_DEFUN([AC_REQ_COCCI_EXTPKG],
+[dnl
+  AC_CHECK_COCCI_EXTPKG([$1])
+  AS_IF([test "x$[]AS_TR_SH([enable_$1])" = xno],
+  [dnl
+    AC_MSG_ERROR([OCaml package $1 is required. Please make sure it is available.])
+  ])
+])
+
+
+dnl  determine python version
+AC_ARG_VAR([PYVER], [python version])
+AC_DEFUN([AC_COCCI_PYVER],
+[dnl
+  AS_IF([test -z "$PYVER"],
+  [dnl  PYVER not set before, determine it
+    AC_COCCI_TOOL([PYTHON],[python],[])
+
+    AS_IF([test "x$PYTHON" = xno -a -n "$with_python" -a "x$with_python" != xyes],
+    [dnl  python interpreter not found, but perhaps it was a version
+      AC_MSG_NOTICE([$1 is not a found as tool, therefore interpreted as version])
+      AC_SUBST([PYVER],["$1"])
+    ])
+
+    AS_IF([test "x$PYTHON" != xno],
+    [dnl  python interpereter found
+      AC_MSG_CHECKING([python version])
+      PYVER=`$PYTHON -c "import sys; print(sys.version[[:3]])"`
+      AS_IF([test -n "$PYVER"],[AC_MSG_RESULT([$PYVER found])],[AC_MSG_RESULT([failed])])
+      AC_SUBST([PYVER])
+    ])
+  ],
+  [dnl  PYVER set before
+    AC_MSG_NOTICE([python version assumed to be $PYVER])
+  ])
+])
+
+
+dnl  determine version date (RTC format)
+AC_DEFUN([AC_COCCI_CONFVERSION],
+[dnl
+  AC_SUBST([CONFVERSION])
+  AC_MSG_NOTICE([determining version suffix])
+
+  AS_IF([test -z "$CONFVERSION" -a -d "./.git"],
+  [dnl  git administration found
+    AC_MSG_NOTICE([building a version from a git repository])
+    AC_PATH_TOOL([GIT],[git])
+    AS_IF([test -n "$GIT"],
+    [dnl  ask git
+      CONFVERSION=`$GIT log -1 --date-order --date=rfc --pretty="format:%cd"`
+    ])
+  ])
+
+  AS_IF([test -z "$CONFVERSION"],
+  [dnl  otherwise, take the current date
+    AC_PATH_TOOL([DATE],[date])
+    AS_IF([test -n "$DATE"],
+    [dnl
+      CONFVERSION=`$DATE "+%a, %d %b %Y %H:%M:%S %z"`
+    ])
+  ])
+
+  AS_IF([test -z "$CONFVERSION"],
+  [dnl  fallback
+    CONFVERSION=unknown
+  ])
+
+  AC_MSG_NOTICE([version suffix set to $CONFVERSION])
+])
+
+
+dnl  find a tool, with specialized macros for certain cases
+dnl  $1: name of the variable
+dnl  $2: name of the tool
+AC_DEFUN([AC_COCCI_FINDTOOL],
+[dnl
+  AS_IF([test "x$2" = xpkg-config -a "x$1" = xPKG_CONFIG],
+  [dnl  specialized macro for pkg-config (from pkg-config m4 macros)
+    PKG_PROG_PKG_CONFIG
+  ], [test "x$2" = xocamllex -a "x$1" = xOCAMLLEX],
+  [dnl  specialized macro for ocamllex (from ocaml.m4)
+    AC_PROG_OCAMLLEX
+  ], [test "x$2" = xocamlyacc -a "x$1" = xOCAMLYACC],
+  [dnl  specialized macro for ocamlyacc (from ocaml.m4)
+    AC_PROG_OCAMLYACC
+  ],
+  [dnl  generic macro
+    AC_PATH_TOOL([$1], [$2])
+  ])
+])
+
+dnl  find/override a particular tool
+dnl  $1: var name
+dnl  $2: prog name
+dnl  $3: path to substitute (or empty)
+AC_DEFUN([AC_COCCI_TOOL],
+[dnl
+  AC_ARG_VAR([$1], [path to $2])
+  AC_ARG_WITH([$2], [AS_HELP_STRING([--with-$2], [whether/which $2 to use (default: auto)])])
+  AC_SUBST([with_$1],["$with_[]AS_TR_SH([$2])"])
+
+  dnl  explicit tool or command given
+  AS_IF([test -n "$with_[]$1" -a "x$with_[]$1" != xno -a "x$with_[]$1" != xyes],
+  [dnl  custom $with_$1 given
+    AC_SUBST([$1], ["$with_[]$1"])
+  ])
+
+  dnl  searches for the tool (result either empty or 'no' if not found)
+  AS_IF([test "x$with_$1" != xno],
+  [dnl  find the tool
+    AC_COCCI_FINDTOOL([$1],[$2])
+  ])
+
+  AS_IF([test -z "[$]$1" -o "x[$]$1" = xno],
+  [dnl  command not found
+    AS_IF([test "x$with_$1" = xyes],
+    [dnl  abort if a command was given explicitly
+      AC_MSG_ERROR([--with=$2 is given explicitly but not found])
+    ])
+
+    AS_IF([test -n "$3"],
+    [dnl  try substitute
+      AC_MSG_NOTICE([$2 not found. Trying substitute $3.])
+      AC_SUBST([$1],["$3"])
+      AC_COCCI_FINDTOOL([$1],[$2])
+      AC_SUBST([SUBSTITUTED_$1], [yes])
+    ])
+  ])
+
+  dnl  $1 will always be defined at the exit of this macro
+  AS_IF([test -z "[$]$1"],[AC_SUBST([$1],[no])])
+])
+
+
+dnl  defines a $1_CMD with $1 if set to a tool, otherwise
+dnl  takes $2
+AC_DEFUN([AC_COCCI_RUNTIME_CMD],
+[dnl
+  AC_ARG_VAR([RUNTIME_$1_CMD], [path to $2])
+  AC_ARG_WITH([runtime-$2], [AS_HELP_STRING([--with-runtime-$2], [override the runtime cmd for $2])])
+  
+  AS_IF([test -z "$RUNTIME_$1_CMD"],
+  [dnl  variable not yet set
+    AS_IF([test "x$with_runtime_[]AS_TR_SH([$2])" = xno],
+    [dnl  with_runtime_$2 set to no: use configured with_$2
+      AC_SUBST([RUNTIME_$1_CMD],[$][$1])
+    ], [test -n "$with_runtime_[]AS_TR_SH([$2])" -a "x$with_runtime_[]AS_TR_SH([$2])" != xyes],
+    [dnl  explicit with_runtime_$2 parameter given: use that as default
+      AC_SUBST([RUNTIME_$1_CMD],["$with_runtime_[]AS_TR_SH([$2])"])
+    ],
+    [dnl  otherwise, use $2
+      AC_SUBST([RUNTIME_$1_CMD],["$2"])
+    ])
+  ])
+])
+
+
+AC_DEFUN([AC_COCCI_YESNO],
+[dnl
+  AC_PATH_TOOL([YES], [yes])
+  AS_IF([test -n "$YES" -a "x$YES" != xno],
+  [dnl
+    AC_SUBST([YES_N_CMD],["$YES n"])
+  ],
+  [dnl
+    AC_SUBST([YES_N_CMD],["echo -e 'n\nn'"])
+  ])
+])
diff --git a/setup/fake-menhir.sh b/setup/fake-menhir.sh
new file mode 100755 (executable)
index 0000000..dcd3313
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh -e
+
+# If you don't have menhir installed, but you do have the generated files, then
+# this script fakes menhir by providing the generated files as the result of the
+# menhir invocation.
+
+STATE=0
+base=
+reqml=
+reqmli=
+
+for arg in "$@"; do
+  if test "x$STATE" == x0 -a "x$arg" == "x--base" -o "x$arg" == "x-b"; then
+    STATE=1
+  elif test "x$STATE" == x1; then
+    base="$arg"
+    STATE=0
+  else
+    filename="$arg"
+    basename="${filename%.*}"
+    extension="${filename##*.}"
+
+    # assumes that all commandline parameters ending in .mly are files to be processed by menhir
+    if test "x$extension" == xmly; then
+      reqml="${basename}.ml"
+      reqmli="${basename}.mli"
+
+      # do we have a preprocessed ml file?
+      if test ! -f "$reqml"; then
+        echo "error: the file $reqml is needed, which requires preprocessing by menhir to obtain it from ${filename}. However, menhir is not enabled." 1>&2
+       exit 1
+      fi
+
+      # do we have a preprocessed mli file?
+      if test ! -f "$reqmli"; then
+        echo "error: the files ${basename}.mli is needed, which requires preprocessing by menhir to obtain it from ${filename}. However, menhir is not enabled." 1>&2
+       exit 1
+      fi
+
+      # is the preprocessed file not older than the original source?
+      if test "$reqml" -ot "$filename" -o "$reqmli" -ot "$filename"; then
+        echo "error: ${basename}.ml(i) is older than $filename, which requires preprocessing by menhir to update them from ${filename}. However, menhir is not enabled." 1>&2
+        exit 1
+      fi
+
+      if test -z "$base"; then
+        base="$basename"
+      fi
+    fi
+  fi
+done
+
+if test -n "$reqml" -a -n "$reqmli" -a -n "$base"; then
+  if test "$reqml" != "${base}.ml"; then
+    cp -f "$reqml" "${base}.ml"
+  fi
+
+  if test "$reqmli" != "${base}.mli"; then
+    cp -f "$reqmli" "${base}.mli"
+  fi
+
+  touch "${base}.ml"
+  touch "${base}.mli"
+  exit 0
+else
+  echo "error: do not know how to handle: $@" 1>&2
+  exit 1
+fi
diff --git a/setup/fake-pdflatex.sh b/setup/fake-pdflatex.sh
new file mode 100755 (executable)
index 0000000..33cbb7d
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+
+# If you don't have pdflatex installed, but do have the generated pdf files, then
+# this script provides those pdf files as a substitute for the pdflatex invocation.
+
+for arg in "$@"; do
+  basename="${arg%.*}"
+  extension="${arg##*.}"
+
+  if test "x$extension" = xtex; then
+    if test -f "${basename}.pdf"; then
+      echo "fake-pdflatex.sh: ${basename}.pdf provided as substitute for: $@"
+      touch "${basename}.pdf"
+      exit 1
+    fi
+  fi
+done
+
+echo "error: pdflatex has not been configured, therefore refusing to execute: $@" 1>&2
+exit 1
diff --git a/setup/fake-subst.sh b/setup/fake-subst.sh
new file mode 100755 (executable)
index 0000000..c0a3994
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/sh -e
+
+# This is a program that gives scripted replies
+# to queries that are normally handled by programs
+# such as pkg-config and ocamlfind. This program
+# can serve as a poor substitute.
+
+# the replies file contains sets of two lines. The
+# first line is an extended regex to match against
+# the command line. The second line is the reply to
+# print to stdout. Variables ${BASH_REMATCH[i]} may be
+# used to match against capture groups.
+
+# the replies file assumes that the
+# libpcre and python libraries are installed, and
+# that none of the optional ocaml libraries are
+# installed.
+
+cmdline="$@"
+scriptdir=$(dirname "$BASH_SOURCE")
+responsefile="$scriptdir/replies.txt"
+
+# learning mode
+# echo "$cmdline" >> /tmp/queries.txt
+
+# some helper functions callable from the replacement macros
+function ocamllibdir {
+  ocamlc -where &2>/dev/null
+}
+
+# outputs with what prefix 'python' was configured
+function pythonprefix {
+  python -c "import sys; print(sys.prefix)" &2>/dev/null
+}
+
+# outputs the "include" cflags for python
+function pythoncflags {
+  local version=$1
+  local prefix="$(pythonprefix)"
+  test $? == 0
+  echo "-I${prefix}/include/python${version}"
+}
+
+# outputs the "linker" flags for python
+function pythonlibs {
+  local version=$1
+  local prefix="$(pythonprefix)"
+
+  echo "-L${prefix}/lib -lpython${version}"
+}
+
+# succeeds only if "/usr/include/pcre.h" exists
+function checkpcre {
+  test -f /usr/include/pcre.h
+}
+
+# interate through pattern-response pairs
+while read pattern
+do
+  # empty lines preceeding pattern
+  if test -z "$pattern"; then
+    continue
+  fi
+
+  # response may be empty
+  read response
+
+  if [[ $cmdline =~ $pattern ]]; then
+    if test -n "$response"; then
+      (eval "R=\"$response\""; test $? == 0; echo $R)
+      test $? == 0
+    fi
+
+    exit 0
+  fi
+done < $responsefile
+
+# fallback case
+echo "fake-subst.sh: no substitution for: $cmdline" 1>&2
+exit 1
diff --git a/setup/ocaml.m4 b/setup/ocaml.m4
new file mode 100644 (file)
index 0000000..6d3c80a
--- /dev/null
@@ -0,0 +1,244 @@
+dnl  changes from the original for coccinelle:
+dnl    replaced AC_CHECK_TOOL with AC_PATH_TOOL to obtain full paths
+dnl    removed some of the AC_REQUIRE calls
+
+dnl autoconf macros for OCaml
+dnl
+dnl Copyright Â© 2009      Richard W.M. Jones
+dnl Copyright Â© 2009      Stefano Zacchiroli
+dnl Copyright Â© 2000-2005 Olivier Andrieu
+dnl Copyright Â© 2000-2005 Jean-Christophe Filliâtre
+dnl Copyright Â© 2000-2005 Georges Mariano
+dnl
+dnl For documentation, please read the ocaml.m4 man page.
+
+AC_DEFUN([AC_PROG_OCAML],
+[dnl
+  # checking for ocamlc
+  AC_PATH_TOOL([OCAMLC],[ocamlc],[no])
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     AC_MSG_RESULT([OCaml version is $OCAMLVERSION])
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        AC_MSG_RESULT([OCAMLLIB previously set; preserving it.])
+     fi
+     AC_MSG_RESULT([OCaml library path is $OCAMLLIB])
+
+     AC_SUBST([OCAMLVERSION])
+     AC_SUBST([OCAMLLIB])
+
+     # checking for ocamlopt
+     AC_PATH_TOOL([OCAMLOPT],[ocamlopt],[no])
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+       AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
+     else
+       TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+       if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+           AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.])
+           OCAMLOPT=no
+       else
+           OCAMLBEST=opt
+       fi
+     fi
+
+     AC_SUBST([OCAMLBEST])
+
+     # checking for ocamlc.opt
+     AC_PATH_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
+     if test "$OCAMLCDOTOPT" != "no"; then
+       TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+       if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+           AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.])
+       else
+           OCAMLC=$OCAMLCDOTOPT
+       fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+       AC_PATH_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
+       if test "$OCAMLOPTDOTOPT" != "no"; then
+          TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+          if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+             AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.])
+          else
+             OCAMLOPT=$OCAMLOPTDOTOPT
+          fi
+        fi
+     fi
+
+     AC_SUBST([OCAMLOPT])
+  fi
+
+  AC_SUBST([OCAMLC])
+
+  # checking for ocaml toplevel
+  AC_PATH_TOOL([OCAML],[ocaml],[no])
+
+  # checking for ocamldep
+  AC_PATH_TOOL([OCAMLDEP],[ocamldep],[no])
+
+  # checking for ocamlmktop
+  AC_PATH_TOOL([OCAMLMKTOP],[ocamlmktop],[no])
+
+  # checking for ocamlmklib
+  AC_PATH_TOOL([OCAMLMKLIB],[ocamlmklib],[no])
+
+  # checking for ocamldoc
+  AC_PATH_TOOL([OCAMLDOC],[ocamldoc],[no])
+
+  # checking for ocamlbuild
+  AC_PATH_TOOL([OCAMLBUILD],[ocamlbuild],[no])
+])
+
+
+AC_DEFUN([AC_PROG_OCAMLLEX],
+[dnl
+  # checking for ocamllex
+  AC_PATH_TOOL([OCAMLLEX],[ocamllex],[no])
+  if test "$OCAMLLEX" != "no"; then
+    AC_PATH_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
+    if test "$OCAMLLEXDOTOPT" != "no"; then
+       OCAMLLEX=$OCAMLLEXDOTOPT
+    fi
+  fi
+  AC_SUBST([OCAMLLEX])
+])
+
+AC_DEFUN([AC_PROG_OCAMLYACC],
+[dnl
+  AC_PATH_TOOL([OCAMLYACC],[ocamlyacc],[no])
+  AC_SUBST([OCAMLYACC])
+])
+
+
+AC_DEFUN([AC_PROG_CAMLP4],
+[dnl
+  AC_REQUIRE([AC_PROG_OCAML])dnl
+
+  # checking for camlp4
+  AC_PATH_TOOL([CAMLP4],[camlp4],[no])
+  if test "$CAMLP4" != "no"; then
+     TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
+     if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+       AC_MSG_RESULT([versions differs from ocamlc])
+        CAMLP4=no
+     fi
+  fi
+  AC_SUBST([CAMLP4])
+
+  # checking for companion tools
+  AC_PATH_TOOL([CAMLP4BOOT],[camlp4boot],[no])
+  AC_PATH_TOOL([CAMLP4O],[camlp4o],[no])
+  AC_PATH_TOOL([CAMLP4OF],[camlp4of],[no])
+  AC_PATH_TOOL([CAMLP4OOF],[camlp4oof],[no])
+  AC_PATH_TOOL([CAMLP4ORF],[camlp4orf],[no])
+  AC_PATH_TOOL([CAMLP4PROF],[camlp4prof],[no])
+  AC_PATH_TOOL([CAMLP4R],[camlp4r],[no])
+  AC_PATH_TOOL([CAMLP4RF],[camlp4rf],[no])
+  AC_SUBST([CAMLP4BOOT])
+  AC_SUBST([CAMLP4O])
+  AC_SUBST([CAMLP4OF])
+  AC_SUBST([CAMLP4OOF])
+  AC_SUBST([CAMLP4ORF])
+  AC_SUBST([CAMLP4PROF])
+  AC_SUBST([CAMLP4R])
+  AC_SUBST([CAMLP4RF])
+])
+
+
+AC_DEFUN([AC_PROG_FINDLIB],
+[dnl
+  dnl  AC_REQUIRE([AC_PROG_OCAML])dnl
+
+  # checking for ocamlfind
+  AC_PATH_TOOL([OCAMLFIND],[ocamlfind],[no])
+  AC_SUBST([OCAMLFIND])
+])
+
+
+dnl Thanks to Jim Meyering for working this next bit out for us.
+dnl XXX We should define AS_TR_SH if it's not defined already
+dnl (eg. for old autoconf).
+AC_DEFUN([AC_CHECK_OCAML_PKG],
+[dnl
+  dnl  AC_REQUIRE([AC_PROG_FINDLIB])dnl
+
+  AC_MSG_CHECKING([for OCaml findlib package $1])
+
+  unset found
+  unset pkg
+  found=no
+  for pkg in $1 $2 ; do
+    if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+      AC_MSG_RESULT([found])
+      AS_TR_SH([OCAML_PKG_$1])=$pkg
+      found=yes
+      break
+    fi
+  done
+  if test "$found" = "no" ; then
+    AC_MSG_RESULT([not found])
+    AS_TR_SH([OCAML_PKG_$1])=no
+  fi
+
+  AC_SUBST(AS_TR_SH([OCAML_PKG_$1]))
+])
+
+
+AC_DEFUN([AC_CHECK_OCAML_MODULE],
+[dnl
+  AC_MSG_CHECKING([for OCaml module $2])
+
+  cat > conftest.ml <<EOF
+open $3
+EOF
+  unset found
+  for $1 in $$1 $4 ; do
+    if $OCAMLC -c -I "$$1" conftest.ml >&5 2>&5 ; then
+      found=yes
+      break
+    fi
+  done
+
+  if test "$found" ; then
+    AC_MSG_RESULT([$$1])
+  else
+    AC_MSG_RESULT([not found])
+    $1=no
+  fi
+  AC_SUBST([$1])
+])
+
+
+dnl XXX Cross-compiling
+AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE],
+[dnl
+  AC_REQUIRE([AC_PROG_OCAML])dnl
+  AC_MSG_CHECKING([for OCaml compiler word size])
+  cat > conftest.ml <<EOF
+  print_endline (string_of_int Sys.word_size)
+  EOF
+  OCAML_WORD_SIZE=`$OCAML conftest.ml`
+  AC_MSG_RESULT([$OCAML_WORD_SIZE])
+  AC_SUBST([OCAML_WORD_SIZE])
+])
+
+AC_DEFUN([AC_CHECK_OCAML_OS_TYPE],
+[dnl
+  AC_REQUIRE([AC_PROG_OCAML])dnl
+  AC_MSG_CHECKING([OCaml Sys.os_type])
+
+  cat > conftest.ml <<EOF
+  print_string(Sys.os_type);;
+EOF
+
+  OCAML_OS_TYPE=`$OCAML conftest.ml`
+  AC_MSG_RESULT([$OCAML_OS_TYPE])
+  AC_SUBST([OCAML_OS_TYPE])
+])
diff --git a/setup/replies.txt b/setup/replies.txt
new file mode 100644 (file)
index 0000000..d588316
--- /dev/null
@@ -0,0 +1,28 @@
+ocamlfind query (unix|bigarray|num|dynlink|str|threads)
+$(ocamllibdir)
+
+ocamlfind query camlp4
+$(ocamllibdir)/camlp4
+
+pkg-config --atleast-pkgconfig-version
+
+pkg-config --exists --print-errors python
+
+pkg-config --print-errors python
+
+pkg-config --cflags python(-([0-9\.]+))?$
+$(pythoncflags "${BASH_REMATCH[2]}")
+
+pkg-config --libs python(-([0-9\.]+))?$
+$(pythonlibs "${BASH_REMATCH[2]}")
+
+pkg-config --exists --print-errors libpcre
+$(checkpcre)
+
+pkg-config --print-errors libpcre
+$(checkpcre)
+
+pkg-config --cflags libpcre
+
+pkg-config --libs libpcre
+-lpcre
diff --git a/test.ml b/test.ml
new file mode 100644 (file)
index 0000000..d1176b7
--- /dev/null
+++ b/test.ml
@@ -0,0 +1 @@
+let foo_ctl () = failwith "there is no foo_ctl formula"
index 2192c2a..023d365 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./testing.ml"
 open Common
 open Sexplib
 
@@ -55,7 +56,7 @@ let testone prefix x compare_with_expected_flag =
           if List.length res > 1
           then pr2 ("note that not just " ^ cfile ^ " was involved");
 
-          let tmpfile = "/tmp/"^Common.basename cfile in
+          let tmpfile = new_temp_file (Common.basename cfile) ".c" in
           pr2 (sprintf "One file modified. Result is here: %s" tmpfile);
           Common.command2 ("mv "^outfile^" "^tmpfile);
           tmpfile
@@ -83,7 +84,7 @@ let testone prefix x compare_with_expected_flag =
  * (via -testall). Fortunately such bugs are rare.
  *
  *)
-let testall ?(expected_score_file="tests/SCORE_expected.sexp") () =
+let testall expected_score_file update_score_file =
 
   let score  = empty_score () in
 
@@ -103,7 +104,7 @@ let testall ?(expected_score_file="tests/SCORE_expected.sexp") () =
       let cocci_file = "tests/" ^ base ^ ".cocci" in
       let expected = "tests/" ^ res in
 
-      let timeout_testall = 30 in
+      let timeout_testall = 60 in
 
       try (
         Common.timeout_function timeout_testall  (fun () ->
@@ -239,11 +240,24 @@ let testall ?(expected_score_file="tests/SCORE_expected.sexp") () =
       else begin
         pr2 "Current score is greater than expected :)";
         pr2 (spf "(was expecting %d but got %d)" expected_good good);
-        pr2 "Generating new expected score file and saving old one";
-        Common.command2_y_or_no_exit_if_no
-          (spf "mv %s %s" expected_score_file (expected_score_file ^ ".save"));
-        Common.command2_y_or_no_exit_if_no
-          (spf "mv %s %s" best_of_both_file expected_score_file);
+        if update_score_file then
+        begin
+          pr2 "Generating new expected score file and saving old one";
+          Common.command2_y_or_no_exit_if_no
+            (spf "mv %s %s" expected_score_file (expected_score_file ^ ".save"));
+          Common.command2_y_or_no_exit_if_no
+            (spf "mv %s %s" best_of_both_file expected_score_file);
+        end;
+
+        (* when there are sufficient number of tests, abort if a substantial
+         * amount of tests fail, which would indicate a broken build.
+         *)
+        if total > 40 && good < (total * 3) / 4
+        then begin
+         pr2 "Still, less 75% the tests passed. Returning a nonzero exist status.";
+          raise (UnixExit 1);
+        end;
+
         raise (UnixExit 0);
       end
 
@@ -261,7 +275,7 @@ let t_to_s = function
 
 let delete_previous_result_files infile =
   [Ok;SpatchOK;Failed] +> List.iter (fun kind ->
-    Common.command2 ("rm -f " ^ infile ^ t_to_s kind)
+    Common.remove_file (infile ^ t_to_s kind)
   )
 
 (* quite similar to compare_with_expected  below *)
index d981e56..5fb1862 100644 (file)
  *)
 
 
+# 0 "./testing.mli"
 open Common
 
 (*****************************************************************************)
 (* work with tests/ *)
 (*****************************************************************************)
 val testone : string (*prefix*) -> string (*test*) -> bool (*compare_expected*) -> unit
-val testall : ?expected_score_file:string -> unit -> unit
+val testall : string -> bool -> unit
 
 (*****************************************************************************)
 (* works with tests-big/. The .res, .ok, .spatch_ok, .failed, .var *)
index ceb191a..31bb7ad 100644 (file)
  (empty.res Ok) (end_commas.res Ok) (endif.res Ok) (enum.res Ok)
  (exitc.res
   (Pb
-   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/exitc87c840.cmxs\")\n"))
+   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/exitcd9b50a.cmxs\")\n"))
  (exitp.res (Pb "PROBLEM\n   exn = Failure(\"no python\")\n")) (exp.res Ok)
  (expnest.res Ok) (expopt.res Ok) (expopt2.res Ok) (expopt3.res Ok)
  (expopt3_ver1.res Ok) (expopt3_ver2.res Ok)
  (extra.res
   (Pb
-   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/extra768a97.cmxs\")\n"))
+   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/extrac8550b.cmxs\")\n"))
  (fields.res Ok) (fieldsmin.res Ok) (find_long.res Ok) (fix_flow_need.res Ok)
  (fn_todo.res Ok) (fnptr.res Ok) (fnret.res Ok) (fnty.res Ok) (four.res Ok)
  (foura.res Ok) (fp.res Ok) (fsh.res Ok) (fun.res Ok)
  (null_type.res Ok)
  (oddifdef.res
   (Pb
-   "INCORRECT:diff token: #else\n VS x\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 114\n    around = '#else\n', whole content = #else\nFile \"tests/oddifdef.res\", line 10, column 2,  charpos = 116\n    around = 'x', whole content =   x = 0;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -7,8 +7,9 @@\n         a = 5;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n     \n    @@ -21,8 +22,9 @@\n         a = 3;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n     \n    @@ -35,7 +37,8 @@\n     #endif\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n"))
+   "INCORRECT:diff token: } VS #ifdef FOO\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 104\n    around = '}', whole content = }\nFile \"tests/oddifdef.res\", line 9, column 0,  charpos = 103\n    around = '#ifdef FOO', whole content = #ifdef FOO\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -6,7 +6,11 @@\n         )\n         a = 5;\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n     \n     void two() {\n    @@ -17,7 +21,11 @@\n     #endif\n         a = 3;\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n     \n     void three() {\n    @@ -28,5 +36,9 @@\n         meth=SSLv2_client_method();\n     #endif\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n"))
  (of.res Ok) (oneline.res Ok) (opt.res Ok) (optional_qualifier.res Ok)
  (optional_storage.res Ok) (orexp.res Ok) (overshoot.res Ok) (param.res Ok)
  (param_end.res Ok) (param_ver1.res Ok) (parameters_dots.res Ok)
index ceb191a..31bb7ad 100644 (file)
  (empty.res Ok) (end_commas.res Ok) (endif.res Ok) (enum.res Ok)
  (exitc.res
   (Pb
-   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/exitc87c840.cmxs\")\n"))
+   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/exitcd9b50a.cmxs\")\n"))
  (exitp.res (Pb "PROBLEM\n   exn = Failure(\"no python\")\n")) (exp.res Ok)
  (expnest.res Ok) (expopt.res Ok) (expopt2.res Ok) (expopt3.res Ok)
  (expopt3_ver1.res Ok) (expopt3_ver2.res Ok)
  (extra.res
   (Pb
-   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/extra768a97.cmxs\")\n"))
+   "PROBLEM\n   exn = Yes_prepare_ocamlcocci.LinkFailure(\"/tmp/extrac8550b.cmxs\")\n"))
  (fields.res Ok) (fieldsmin.res Ok) (find_long.res Ok) (fix_flow_need.res Ok)
  (fn_todo.res Ok) (fnptr.res Ok) (fnret.res Ok) (fnty.res Ok) (four.res Ok)
  (foura.res Ok) (fp.res Ok) (fsh.res Ok) (fun.res Ok)
  (null_type.res Ok)
  (oddifdef.res
   (Pb
-   "INCORRECT:diff token: #else\n VS x\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 114\n    around = '#else\n', whole content = #else\nFile \"tests/oddifdef.res\", line 10, column 2,  charpos = 116\n    around = 'x', whole content =   x = 0;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -7,8 +7,9 @@\n         a = 5;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n     \n    @@ -21,8 +22,9 @@\n         a = 3;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n     \n    @@ -35,7 +37,8 @@\n     #endif\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -\n    +  x = 0;\n     #endif\n     }\n"))
+   "INCORRECT:diff token: } VS #ifdef FOO\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 104\n    around = '}', whole content = }\nFile \"tests/oddifdef.res\", line 9, column 0,  charpos = 103\n    around = '#ifdef FOO', whole content = #ifdef FOO\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -6,7 +6,11 @@\n         )\n         a = 5;\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n     \n     void two() {\n    @@ -17,7 +21,11 @@\n     #endif\n         a = 3;\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n     \n     void three() {\n    @@ -28,5 +36,9 @@\n         meth=SSLv2_client_method();\n     #endif\n     \n    -\n    +#ifdef FOO\n    +  x = 0;\n    +#else\n    +  x = 0;\n    +#endif\n     }\n"))
  (of.res Ok) (oneline.res Ok) (opt.res Ok) (optional_qualifier.res Ok)
  (optional_storage.res Ok) (orexp.res Ok) (overshoot.res Ok) (param.res Ok)
  (param_end.res Ok) (param_ver1.res Ok) (parameters_dots.res Ok)
index dea5d0f..a6916b6 100644 (file)
@@ -4,6 +4,8 @@ expression E, F;
 
 (
 -  foo(E)
++ 4
 |
 -  bar(F)
++ 4
 )
\ No newline at end of file
index cec667a..5031e39 100644 (file)
@@ -1,3 +1,3 @@
 int main() {
-  ;
+  4;
 }
index 35a7364..ebd459f 100644 (file)
@@ -22,7 +22,9 @@
 # Coccinelle under other licenses.
 
 
--include ../Makefile.config
+ifneq ($(MAKECMDGOALS),distclean)
+include ../Makefile.config
+endif
 
 PROGS=spp gitgrep splitpatch extract_c_and_res #generate_dependencies
 
@@ -32,20 +34,20 @@ all: $(SUBDIRS) $(PROGS)
 all.opt: $(PROGS)
 
 gitgrep: gitgrep.ml
-       ocamlopt -o gitgrep str.cmxa gitgrep.ml
+       $(OCAMLOPT) -o gitgrep str.cmxa gitgrep.ml
 
 gitsort: gitsort.ml
-       ocamlopt -o gitsort str.cmxa gitsort.ml
+       $(OCAMLOPT) -o gitsort str.cmxa gitsort.ml
 
 isoprof: process_isoprofile.ml
-       ocamlc -g -o isoprof str.cma process_isoprofile.ml
+       $(OCAMLC) -g -o isoprof str.cma process_isoprofile.ml
 
 alloc_free: alloc_free.ml
-       ocamlopt -o alloc_free str.cmxa alloc_free.ml
+       $(OCAMLOPT) -o alloc_free str.cmxa alloc_free.ml
 
 # more flexible version of alloc_free
 bridge: bridge.ml
-       ocamlopt -o bridge str.cmxa dumper.mli dumper.ml bridge.ml
+       $(OCAMLOPT) -o bridge str.cmxa dumper.mli dumper.ml bridge.ml
 
 install_bridge: bridge
        cp -f bridge /usr/local/bin
@@ -59,46 +61,46 @@ INCLUDE=-I ../commons -I ../extra -I  ../parsing_c
 LIBS=../commons/commons.cma ../globals/globals.cma \
      ../parsing_c/parsing_c.cma ../extra/extra.cma
 
-OCAMLC=ocamlc$(OPTBIN) -g -dtypes   $(INCLUDE)
-OCAMLOPT=ocamlopt$(OPTBIN)   $(INCLUDE) $(OPTFLAGS)
-#OCAMLLEX=ocamllex$(OPTBIN) -ml
-OCAMLLEX=ocamllex$(OPTBIN)
-OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDE)
-OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE)
+OCAMLC_CMD=$(OCAMLC) -g -dtypes $(INCLUDE)
+OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDE)
+OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDE)
+OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDE)
+OCAMLYACC_CMD=$(OCAMLYACC) -v
 
 spp: spp.ml
-       $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS)  $+
-#      ocamlc -I ../commons/ -o spp str.cma unix.cma bigarray.cma  ../commons/common.cmo spp.ml
+       $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
 
 splitpatch: splitpatch.cmo
-       $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $+
+       $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $+
 
 extract_c_and_res: extract_c_and_res.cmo
-       $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS)  $+
+       $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS)  $+
 
 generate_dependencies: generate_dependencies.cmo
-       $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS)  $+
+       $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS)  $+
 
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 
 .ml.cmo:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .mli.cmi:
-       $(OCAMLC) -c $<
+       $(OCAMLC_CMD) -c $<
 .ml.cmx:
-       $(OCAMLOPT) -c $<
+       $(OCAMLOPT_CMD) -c $<
 
 clean:
        rm -f $(PROGS)
        rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
+       rm -f .depend
 
-beforedepend::
-
-depend:: beforedepend
-       ocamldep $(INCLUDE) *.mli *.ml    > .depend
+distclean: clean
 
-distclean:: clean
-       rm -f .depend
+.PHONEY: depend
+.depend depend: beforedepend
+       ocamldep $(INCLUDE) *.mli *.ml > .depend
 
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
 -include .depend
+endif
+endif
index 462a4f0..623284d 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./alloc_free.ml"
 (* The following finds out for each file, how it does deallocation for each
 allocator *)
 
index 2aebdc7..a9d8325 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./bridge.ml"
 let drop_spaces s =
   String.concat "" (Str.split (Str.regexp "[ ]+") s)
 
index d8b6c79..c1781ba 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./dir_stats.ml"
 (* for each marked thing, how often does it occur and in what files and
 directories *)
 
index fb2ce8d..3bd1728 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./dumper.ml"
 (* Dump an OCaml value into a printable string.
  * By Richard W.M. Jones (rich@annexia.org).
  * dumper.ml 1.2 2005/02/06 12:38:21 rich Exp
index 57b1304..b639ec2 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./dumper.mli"
 (* Dump an OCaml value into a printable string.
  * By Richard W.M. Jones (rich@annexia.org).
  * dumper.mli 1.1 2005/02/03 23:07:47 rich Exp
index 109a26a..21bcc09 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./extract_c_and_res.ml"
 open Common
 
 (*****************************************************************************)
index cdce4ed..82cd19c 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./generate_dependencies.ml"
 open Common
 
 (*****************************************************************************)
index b3cb00c..69656a1 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./gitgrep.ml"
 (* adjust as convenient *)
 let prefix = "/tmp/"
 let prefix = ""
index 045f17f..01d5f70 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./gitsort.ml"
 (* sort a list of git codes such that the most recent comes first *)
 
 let git_home = ref "/home/julia/linux-2.6"
index 5fee114..49f3ab0 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./licensify.ml"
 let lines =
 ["Copyright 2012, INRIA";
 "Julia Lawall, Gilles Muller";
@@ -76,10 +77,11 @@ let do_one file =
   List.iter (function l -> Printf.fprintf o "%s\n" l) lines;
   Printf.fprintf o "\n";
   Printf.fprintf o "\n";
+  if List.exists (Filename.check_suffix file) [ ".ml" ; ".mli" ; ".mll" ] then
+    Printf.fprintf o "# 0 \"%s\"\n" file;
   close_out o;
   let _ = Sys.command (Printf.sprintf "cat %s >> %s" tmpfl file) in
-  let _ = Sys.command (Printf.sprintf "rm -f %s" tmpfl) in
-  ()
+  Sys.remove tmpfl
 
 (* pad's modif *)
 let (+>) o f = f o
index d967193..5c0601a 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./process_isoprofile.ml"
 (* This is for processing information created with the -profile_iso option.
 Runs are assumed separated with a line beginning with =.
 The first run is discarded *)
index 3eb045c..7774e4d 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./splitpatch.ml"
 (* split patch per file *)
 
 (* ------------------------------------------------------------------------ *)
@@ -136,12 +137,12 @@ let read_configs template =
 
 let maintainer_command file =
   Printf.sprintf
-    "cd %s; scripts/get_maintainer.pl --separator , --nogit-fallback --norolestats -f %s"
+    "cd %s; scripts/get_maintainer.pl --nokeywords --separator , --nogit-fallback --norolestats -f %s"
     !git_tree file
 
 let subsystem_command file =
   Printf.sprintf
-    "cd %s; scripts/get_maintainer.pl --nogit-fallback --subsystem --norolestats -f %s | grep -v @"
+    "cd %s; scripts/get_maintainer.pl --nokeywords --nogit-fallback --subsystem --norolestats -f %s | grep -v @"
     !git_tree file
 
 let checkpatch_command file =
index a85cc9b..c3af3ae 100644 (file)
@@ -24,6 +24,7 @@
  *)
 
 
+# 0 "./spp.ml"
 open Common
 
 exception WrongArguments
diff --git a/version b/version
index 5954780..4a40da8 100644 (file)
--- a/version
+++ b/version
@@ -1,3 +1 @@
-1.0.0-rc11
-
-
+1.0.0-rc12
\ No newline at end of file
diff --git a/version.ml.in b/version.ml.in
new file mode 100644 (file)
index 0000000..89fab3f
--- /dev/null
@@ -0,0 +1 @@
+let version_date = "@CONFVERSION@"