From 56fe74aee105e98cd02a7560be5798d1ec5b1b1c Mon Sep 17 00:00:00 2001 From: Maxime Levillain Date: Fri, 15 May 2020 15:13:19 +0200 Subject: [PATCH] Dune packaging --- .gitignore | 8 + .merlin | 6 - autoconf/travis-ci.sh => .travis-ci.sh | 8 +- .../travis-install.sh => .travis-install.sh | 4 +- .travis.yml | 12 +- CHANGES | 3 + Makefile | 38 +- autoconf/.gitignore | 7 - autoconf/Makefile.config.in | 28 - autoconf/Makefile.rules | 42 - autoconf/aclocal.m4 | 16 - autoconf/config.ocp2gen.in | 55 - autoconf/config.ocpgen.in | 49 - autoconf/configure | 5527 ----------------- autoconf/configure.ac | 209 - autoconf/generated.files | 22 - autoconf/m4/ax_compare_version.m4 | 177 - autoconf/m4/ocaml.m4 | 268 - autoconf/ocaml-config.h.in | 1 - configure | 18 - dune | 3 + dune-project | 25 + .../chrome-extension/background-example.js | 2091 ------- examples/chrome-extension/chrome-example.js | 1985 ------ examples/chrome-extension/options-example.js | 2092 ------- examples/chrome-extension/popup-example.js | 1915 ------ libs/build.ocp2 | 0 libs/common | 133 - libs/js-min/dune | 20 + libs/js-min/js_min.ml | 3 +- libs/ocplib-ace/ace.ml | 2 +- libs/ocplib-ace/ace.mli | 2 +- libs/ocplib-ace/ace_types.mli | 2 +- libs/ocplib-ace/dune | 7 + libs/ocplib-amcharts3/dune | 7 + libs/ocplib-bs4/dune | 7 + libs/ocplib-cleave/cleave.ml | 2 +- libs/ocplib-cleave/dune | 6 + libs/ocplib-cytoscape/dune | 6 + libs/ocplib-d3pie/build.ocp2 | 5 +- .../{d3pie_types.ml => d3pie_types.mli} | 0 libs/ocplib-d3pie/dune | 7 + libs/ocplib-disqus/dune | 6 + libs/ocplib-extension/browser-lwt/dune | 12 + .../browser-lwt/tabs_browser_lwt.ml | 4 +- libs/ocplib-extension/browser/dune | 26 + libs/ocplib-extension/chrome-lwt/dune | 12 + libs/ocplib-extension/chrome/dune | 27 + libs/ocplib-extension/common/dune | 28 + libs/ocplib-jquery/dune | 13 + libs/ocplib-odometer/dune | 6 + libs/ocplib-odometer/odometer.ml | 2 +- libs/ocplib-push/dune | 6 + libs/ocplib-push/push_js.ml | 6 +- libs/ocplib-qrcode/dune | 6 + libs/ocplib-recaptcha/dune | 6 + libs/ocplib-utils/build.ocp2 | 7 +- libs/ocplib-utils/dune | 26 + libs/ocplib-utils/xor.ml | 6 +- libs/ocplib-utils/xor3.ml | 54 - ocp-autoconf.config | 10 +- ocp-autoconf.d/Makefile | 5 - ocp-autoconf.d/build.ocp2inc | 5 - ocp-autoconf.d/configure.ac | 5 - ocplib-jsutils.opam | 38 + opam | 42 - push-opam.sh | 130 - 67 files changed, 355 insertions(+), 14951 deletions(-) delete mode 100644 .merlin rename autoconf/travis-ci.sh => .travis-ci.sh (66%) rename autoconf/travis-install.sh => .travis-install.sh (76%) create mode 100644 CHANGES delete mode 100644 autoconf/.gitignore delete mode 100644 autoconf/Makefile.config.in delete mode 100644 autoconf/Makefile.rules delete mode 100644 autoconf/aclocal.m4 delete mode 100644 autoconf/config.ocp2gen.in delete mode 100644 autoconf/config.ocpgen.in delete mode 100755 autoconf/configure delete mode 100644 autoconf/configure.ac delete mode 100644 autoconf/generated.files delete mode 100644 autoconf/m4/ax_compare_version.m4 delete mode 100644 autoconf/m4/ocaml.m4 delete mode 100644 autoconf/ocaml-config.h.in delete mode 100755 configure create mode 100644 dune create mode 100644 dune-project delete mode 100644 examples/chrome-extension/background-example.js delete mode 100644 examples/chrome-extension/chrome-example.js delete mode 100644 examples/chrome-extension/options-example.js delete mode 100644 examples/chrome-extension/popup-example.js delete mode 100644 libs/build.ocp2 delete mode 100644 libs/common create mode 100644 libs/js-min/dune create mode 100644 libs/ocplib-ace/dune create mode 100644 libs/ocplib-amcharts3/dune create mode 100644 libs/ocplib-bs4/dune create mode 100644 libs/ocplib-cleave/dune create mode 100644 libs/ocplib-cytoscape/dune rename libs/ocplib-d3pie/{d3pie_types.ml => d3pie_types.mli} (100%) create mode 100644 libs/ocplib-d3pie/dune create mode 100644 libs/ocplib-disqus/dune create mode 100644 libs/ocplib-extension/browser-lwt/dune create mode 100644 libs/ocplib-extension/browser/dune create mode 100644 libs/ocplib-extension/chrome-lwt/dune create mode 100644 libs/ocplib-extension/chrome/dune create mode 100644 libs/ocplib-extension/common/dune create mode 100644 libs/ocplib-jquery/dune create mode 100644 libs/ocplib-odometer/dune create mode 100644 libs/ocplib-push/dune create mode 100644 libs/ocplib-qrcode/dune create mode 100644 libs/ocplib-recaptcha/dune create mode 100644 libs/ocplib-utils/dune delete mode 100644 libs/ocplib-utils/xor3.ml delete mode 100644 ocp-autoconf.d/Makefile delete mode 100644 ocp-autoconf.d/build.ocp2inc delete mode 100644 ocp-autoconf.d/configure.ac create mode 100644 ocplib-jsutils.opam delete mode 100644 opam delete mode 100755 push-opam.sh diff --git a/.gitignore b/.gitignore index 1032127..11d300f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,11 @@ ocp-autoconf.d/config.ocp2inc _esy esy.lock + +_build +*.merlin +autoconf +ocp-autoconf.d +test/*.js +examples/chrome-extension/*.js +configure \ No newline at end of file diff --git a/.merlin b/.merlin deleted file mode 100644 index 4553bad..0000000 --- a/.merlin +++ /dev/null @@ -1,6 +0,0 @@ -S libs/** -B _obuild/** -PKG js_of_ocaml -PKG js_of_ocaml-ppx -PKG js_of_ocaml-tyxml -PKG lwt \ No newline at end of file diff --git a/autoconf/travis-ci.sh b/.travis-ci.sh similarity index 66% rename from autoconf/travis-ci.sh rename to .travis-ci.sh index eb7316c..6ec2a03 100644 --- a/autoconf/travis-ci.sh +++ b/.travis-ci.sh @@ -1,7 +1,7 @@ #!/bin/sh export OPAMYES=1 OPAMVERBOSE=1 -eval `opam config env` +eval $(opam env) echo Architecture uname -a @@ -13,7 +13,5 @@ opam --git-version PREFIX=$HOME/.opam/$OCAML_VERSION -opam pin add my-package . -opam install my-package -opam remove my-package - +opam install . +opam remove . diff --git a/autoconf/travis-install.sh b/.travis-install.sh similarity index 76% rename from autoconf/travis-install.sh rename to .travis-install.sh index 7ee853c..66b6200 100644 --- a/autoconf/travis-install.sh +++ b/.travis-install.sh @@ -9,6 +9,4 @@ echo OPAM versions opam --version opam --git-version -opam init -opam switch $OCAML_VERSION - +opam init --disable-sandboxing --compiler=${OCAML_VERSION} diff --git a/.travis.yml b/.travis.yml index fab3621..a82aec6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,10 @@ addons: - ocaml - opam - ocaml-native-compilers -install: sh -ex ./autoconf/travis-install.sh +install: sh -ex .travis-install.sh cache: directories: - ${HOME}/.opam -script: sh -ex ./autoconf/travis-ci.sh +script: sh -ex .travis-ci.sh env: - - OCAML_VERSION=system - - OCAML_VERSION=4.02.3 - - OCAML_VERSION=4.03.0 - - OCAML_VERSION=4.04.0 - - OCAML_VERSION=4.05.0 - - OCAML_VERSION=4.06.1 - - OCAML_VERSION=4.07.0 + - OCAML_VERSION=4.08.1 diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..3663264 --- /dev/null +++ b/CHANGES @@ -0,0 +1,3 @@ +## 0.0 (2020-05-15) + +Initial public release diff --git a/Makefile b/Makefile index 8433486..75d43e4 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,33 @@ +-include autoconf/Makefile.config -############################################################################# -# -# This file is managed by ocp-autoconf. -# -# Remove it from `manage_files` in 'ocp-autoconf.config' if you want to -# modify it manually. -# -############################################################################# - -BASE64_3:=true +all: build -include autoconf/Makefile.config +build: + dune build -all: build +clean: + dune clean --include ocp-autoconf.d/Makefile +install: + dune install -build: base64-conf ocp-build-build $(PROJECT_BUILD) +ocp-build-conf: + ocp-autoconf -install: ocp-build-install $(PROJECT_INSTALL) +ocp-build: ocp-build-conf + ocp-build $(PROJECT_BUILD) -clean: ocp-build-clean $(PROJECT_CLEAN) +ocp-build-install: ocp-build-install $(PROJECT_INSTALL) -distclean: clean ocp-distclean $(PROJECT_DISTCLEAN) - find . -name '*~' -exec rm -f {} \; +ocp-build-clean: ocp-build-clean $(PROJECT_CLEAN) -test: build +test: ocp-build cp _obuild/main/main.js test -chrome-extension-example: build +chrome-extension-example: ocp-build cp _obuild/background-example/background-example.js examples/chrome-extension cp _obuild/popup-example/popup-example.js examples/chrome-extension cp _obuild/options-example/options-example.js examples/chrome-extension cp _obuild/chrome-example/chrome-example.js examples/chrome-extension -include autoconf/Makefile.rules +-include autoconf/Makefile.rules diff --git a/autoconf/.gitignore b/autoconf/.gitignore deleted file mode 100644 index 89a680d..0000000 --- a/autoconf/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/config.ocpgen -/config.ocp2gen -/Makefile.config -/autom4te.cache -/config.status -/config.log -/ocaml-config.h diff --git a/autoconf/Makefile.config.in b/autoconf/Makefile.config.in deleted file mode 100644 index ed0033a..0000000 --- a/autoconf/Makefile.config.in +++ /dev/null @@ -1,28 +0,0 @@ -OCAMLFIND=@OCAMLFIND@ -CONFIGURE_ARGS=@CONFIGURE_ARGS@ -ROOTDIR=@ROOTDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -libdir=@libdir@ -datarootdir=@datarootdir@ -mandir=@mandir@ -datadir=@datadir@ -ocamldir=@ocamldir@ -metadir=@metadir@ -PACKAGE_NAME=@PACKAGE_NAME@ -PACKAGE_VERSION=@PACKAGE_VERSION@ -OPAM_REPO=@OPAM_REPO@ -OPAM_REPO_OFFICIAL_REMOTE=@OPAM_REPO_OFFICIAL_REMOTE@ -OPAM_REPO_FORK_REMOTE=@OPAM_REPO_FORK_REMOTE@ -DOWNLOAD_URL_PREFIX=@DOWNLOAD_URL_PREFIX@ -OCAMLVERSION=@OCAMLVERSION@ -OCAMLC=@OCAMLC@ -OCAMLOPT=@OCAMLOPT@ -OCAMLDEP=@OCAMLDEP@ -OCAMLMKTOP=@OCAMLMKTOP@ -OCAMLMKLIB=@OCAMLMKLIB@ -OCAMLDOC=@OCAMLDOC@ -OCAMLLIB=@OCAMLLIB@ -OCAMLBIN=@OCAMLBIN@ -OCAML_USE_BINANNOT=@OCAML_USE_BINANNOT@ diff --git a/autoconf/Makefile.rules b/autoconf/Makefile.rules deleted file mode 100644 index c2b804f..0000000 --- a/autoconf/Makefile.rules +++ /dev/null @@ -1,42 +0,0 @@ - -autoconf/Makefile.config: autoconf/configure - ./configure $(CONFIGURE_ARGS) - - -# We can override this variable to change the binary to use -# for ocp-build -ifeq ($(OCP_BUILD),) -OCP_BUILD:=ocp-build -endif - -_obuild: Makefile - $(OCP_BUILD) init - -ocp-build-build: _obuild - $(OCP_BUILD) - -ocp-build-install: _obuild - $(OCP_BUILD) install \ - -install-bin $(bindir) \ - -install-lib $(ocamldir) \ - -install-meta $(metadir) - -ocp-build-clean: _obuild - $(OCP_BUILD) clean - -ocp-build-distclean: - rm -rf _obuild - -ocp-lint-distclean: - rm -rf _olint - -ocp-autoconf-distclean: - rm -f autoconf/Makefile.config - rm -f autoconf/config.ocpgen - rm -f autoconf/config.ocp2gen - rm -f autoconf/config.status - rm -f autoconf/config.log - rm -f autoconf/ocaml-config.h - rm -rf autoconf/autom4te.cache/ - -ocp-distclean: ocp-autoconf-distclean ocp-build-distclean ocp-lint-distclean diff --git a/autoconf/aclocal.m4 b/autoconf/aclocal.m4 deleted file mode 100644 index 6e6ba2d..0000000 --- a/autoconf/aclocal.m4 +++ /dev/null @@ -1,16 +0,0 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- - -# Copyright (C) 1996-2017 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. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_include([m4/ax_compare_version.m4]) -m4_include([m4/ocaml.m4]) diff --git a/autoconf/config.ocp2gen.in b/autoconf/config.ocp2gen.in deleted file mode 100644 index 6cb3b79..0000000 --- a/autoconf/config.ocp2gen.in +++ /dev/null @@ -1,55 +0,0 @@ -autoconf = { - conf_ocamlfind="@OCAMLFIND@"; - rootdir="@ROOTDIR@"; - prefix="@prefix@"; - exec_prefix="@exec_prefix@"; - bindir="@bindir@"; - libdir="@libdir@"; - datarootdir="@datarootdir@"; - mandir="@mandir@"; - datadir="@datadir@"; - ocamldir="@ocamldir@"; - metadir="@metadir@"; - package_name="@PACKAGE_NAME@"; - package_version="@PACKAGE_VERSION@"; - opam_repo="@OPAM_REPO@"; - opam_repo_official_remote="@OPAM_REPO_OFFICIAL_REMOTE@"; - opam_repo_fork_remote="@OPAM_REPO_FORK_REMOTE@"; - download_url_prefix="@DOWNLOAD_URL_PREFIX@"; - conf_ocamlversion="@OCAMLVERSION@"; - conf_ocamlc="@OCAMLC@"; - conf_ocamlopt="@OCAMLOPT@"; - conf_ocamldep="@OCAMLDEP@"; - conf_ocamlmktop="@OCAMLMKTOP@"; - conf_ocamlmklib="@OCAMLMKLIB@"; - conf_ocamldoc="@OCAMLDOC@"; - conf_ocamllib="@OCAMLLIB@"; - conf_ocamlbin="@OCAMLBIN@"; - ocaml_use_binannot = @OCAML_USE_BINANNOT@; - autoconf_dir = "@PACKAGE_NAME@-autoconf-dir"; - -}; (* end of "autoconf = {" *) - -ocaml.exists = true; -ocaml = { bytecomp = []; asmcomp = [] } + ocaml; - -if( autoconf.ocaml_use_binannot && ocaml_version >= "4.00" ) { - ocaml.bytecomp += [ "-bin-annot" ]; - ocaml.asmcomp += [ "-bin-annot" ]; -} - -autoconf_cflags = [ "-I"; "autoconf" ]; - -if( ocaml_version = "4.01.0+ocp1" || ocaml_version = "4.02.1+ocp1" ) { - string_compat = []; - ocp_pp = []; -} else { - string_compat = [ "ocplib-compat" ]; - ocp_pp = [ "ocp-pp" ]; -} - -if( ocaml_version < "4.01" ){ - compiler_libs_compat = [ "compiler-libs.compat" ]; -} else { - compiler_libs_compat = []; -} diff --git a/autoconf/config.ocpgen.in b/autoconf/config.ocpgen.in deleted file mode 100644 index 1828af8..0000000 --- a/autoconf/config.ocpgen.in +++ /dev/null @@ -1,49 +0,0 @@ -conf_ocamlfind="@OCAMLFIND@" -rootdir="@ROOTDIR@" -prefix="@prefix@" -exec_prefix="@exec_prefix@" -bindir="@bindir@" -libdir="@libdir@" -datarootdir="@datarootdir@" -mandir="@mandir@" -datadir="@datadir@" -ocamldir="@ocamldir@" -metadir="@metadir@" -package_name="@PACKAGE_NAME@" -package_version="@PACKAGE_VERSION@" -opam_repo="@OPAM_REPO@" -opam_repo_official_remote="@OPAM_REPO_OFFICIAL_REMOTE@" -opam_repo_fork_remote="@OPAM_REPO_FORK_REMOTE@" -download_url_prefix="@DOWNLOAD_URL_PREFIX@" -conf_ocamlversion="@OCAMLVERSION@" -conf_ocamlc="@OCAMLC@" -conf_ocamlopt="@OCAMLOPT@" -conf_ocamldep="@OCAMLDEP@" -conf_ocamlmktop="@OCAMLMKTOP@" -conf_ocamlmklib="@OCAMLMKLIB@" -conf_ocamldoc="@OCAMLDOC@" -conf_ocamllib="@OCAMLLIB@" -conf_ocamlbin="@OCAMLBIN@" -ocaml_use_binannot = @OCAML_USE_BINANNOT@ -autoconf_dir = "@PACKAGE_NAME@-autoconf-dir" - - -if ocaml_use_bin_annot && ocaml_version >= "4.00" then { - comp += [ "-bin-annot" ] -} - -autoconf_cflags = [ "-I" "autoconf" ] - -if ocaml_version = "4.01.0+ocp1" || ocaml_version = "4.02.1+ocp1" then { - string_compat = []; - ocp_pp = []; -} else { - string_compat = [ "ocplib-compat" ] - ocp_pp = [ "ocp-pp" ]; -} - -if ocaml_version < "4.01" then { - compiler_libs_compat = [ "compiler-libs.compat" ] -} else { - compiler_libs_compat = [] -} diff --git a/autoconf/configure b/autoconf/configure deleted file mode 100755 index 83b213c..0000000 --- a/autoconf/configure +++ /dev/null @@ -1,5527 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ocplib-jsutils 1.0. -# -# -# Copyright (C) 1992-1996, 1998-2012 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 - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # 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 -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+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -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 -test -x / || 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 -test \$(( 1 + 1 )) = 2 || 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 : - export CONFIG_SHELL - # 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 -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+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -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 about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do 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_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_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; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # 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 -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -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 - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# 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'" - - -test -n "$DJDIR" || exec 7<&0 &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='ocplib-jsutils' -PACKAGE_TARNAME='ocplib-jsutils' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='ocplib-jsutils 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_subst_vars='LTLIBOBJS -LIBOBJS -OCAML_USE_BINANNOT -DOWNLOAD_URL_PREFIX -OPAM_REPO_FORK_REMOTE -OPAM_REPO_OFFICIAL_REMOTE -OPAM_REPO -ROOTDIR -OCAML_PKG_lwt -OCAML_PKG_base64 -OCAML_PKG_js_of_ocaml_tyxml -OCAML_PKG_js_of_ocaml_ppx -OCAML_PKG_js_of_ocaml -OCAML_PKG_ocp_build -OCAMLBIN -CONFIGURE_ARGS -metadir -ocamldir -OCAMLFIND -OCAML_USE_POSIX_TYPES -AWK -SED -OCAMLBUILD -OCAMLDOC -OCAMLMKLIB -OCAMLMKTOP -OCAMLDEPDOTOPT -OCAMLDEP -OCAML -OCAMLOPTDOTOPT -OCAMLCDOTOPT -OCAMLBEST -OCAMLOPT -OCAMLLIB -OCAMLVERSION -OCAMLC -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -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 -runstatedir -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' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_version_check -enable_bin_annot -with_ocamldir -with_metadir -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS' - - -# 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' -runstatedir='${localstatedir}/run' -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 ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -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 runstatedir -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 - 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 ocplib-jsutils 1.0 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] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --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/ocplib-jsutils] - --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 ocplib-jsutils 1.0:";; - 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] - --disable-version-check do not check OCaml version - --disable-bin-annot do not use -bin-annot - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-ocamldir=DIRNAME root storage of the OCaml distribution - --with-metadir=DIRNAME store meta files in DIRNAME - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - -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 the package provider. -_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 -ocplib-jsutils configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 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 -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 ocplib-jsutils $as_me 1.0, which was -generated by GNU Autoconf 2.69. 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 - - -CONFIGURE_ARGS=$* - -OCAML_MINIMAL_VERSION=4.02.3 - - -# Check whether --enable-version-check was given. -if test "${enable_version_check+set}" = set; then : - enableval=$enable_version_check; VERSION_CHECK="$enableval" -else - VERSION_CHECK="yes" -fi - - -# Check whether --enable-bin-annot was given. -if test "${enable_bin_annot+set}" = set; then : - enableval=$enable_bin_annot; OCAML_USE_BINANNOT=false -else - OCAML_USE_BINANNOT=true -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 -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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_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" - $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 as_fn_executable_p "$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 as_fn_executable_p "$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 -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 -#include -struct stat; -/* 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 - - - # 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_prog_OCAMLC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLC"; then - ac_cv_prog_OCAMLC="$OCAMLC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" - $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 -OCAMLC=$ac_cv_prog_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_prog_OCAMLC"; then - ac_ct_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_prog_ac_ct_OCAMLC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLC"; then - ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLC="ocamlc" - $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_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC -if test -n "$ac_ct_OCAMLC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 -$as_echo "$ac_ct_OCAMLC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLC - fi -else - OCAMLC="$ac_cv_prog_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_prog_OCAMLOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLOPT"; then - ac_cv_prog_OCAMLOPT="$OCAMLOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" - $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 -OCAMLOPT=$ac_cv_prog_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_prog_OCAMLOPT"; then - ac_ct_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_prog_ac_ct_OCAMLOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLOPT"; then - ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" - $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_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT -if test -n "$ac_ct_OCAMLOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 -$as_echo "$ac_ct_OCAMLOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLOPT - fi -else - OCAMLOPT="$ac_cv_prog_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_prog_OCAMLCDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLCDOTOPT"; then - ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" - $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 -OCAMLCDOTOPT=$ac_cv_prog_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_prog_OCAMLCDOTOPT"; then - ac_ct_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_prog_ac_ct_OCAMLCDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLCDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" - $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_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT -if test -n "$ac_ct_OCAMLCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLCDOTOPT - fi -else - OCAMLCDOTOPT="$ac_cv_prog_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_prog_OCAMLOPTDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLOPTDOTOPT"; then - ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" - $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 -OCAMLOPTDOTOPT=$ac_cv_prog_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_prog_OCAMLOPTDOTOPT"; then - ac_ct_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_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" - $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_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT -if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLOPTDOTOPT - fi -else - OCAMLOPTDOTOPT="$ac_cv_prog_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_prog_OCAML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAML"; then - ac_cv_prog_OCAML="$OCAML" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAML="${ac_tool_prefix}ocaml" - $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 -OCAML=$ac_cv_prog_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_prog_OCAML"; then - ac_ct_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_prog_ac_ct_OCAML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAML"; then - ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAML="ocaml" - $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_OCAML=$ac_cv_prog_ac_ct_OCAML -if test -n "$ac_ct_OCAML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5 -$as_echo "$ac_ct_OCAML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAML - fi -else - OCAML="$ac_cv_prog_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_prog_OCAMLDEP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDEP"; then - ac_cv_prog_OCAMLDEP="$OCAMLDEP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" - $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 -OCAMLDEP=$ac_cv_prog_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_prog_OCAMLDEP"; then - ac_ct_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_prog_ac_ct_OCAMLDEP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDEP"; then - ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" - $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_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP -if test -n "$ac_ct_OCAMLDEP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 -$as_echo "$ac_ct_OCAMLDEP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLDEP - fi -else - OCAMLDEP="$ac_cv_prog_OCAMLDEP" -fi - - - if test "$OCAMLDEP" != "no" ; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldep.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldep.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_prog_OCAMLDEPDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDEPDOTOPT"; then - ac_cv_prog_OCAMLDEPDOTOPT="$OCAMLDEPDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDEPDOTOPT="${ac_tool_prefix}ocamldep.opt" - $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 -OCAMLDEPDOTOPT=$ac_cv_prog_OCAMLDEPDOTOPT -if test -n "$OCAMLDEPDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEPDOTOPT" >&5 -$as_echo "$OCAMLDEPDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OCAMLDEPDOTOPT"; then - ac_ct_OCAMLDEPDOTOPT=$OCAMLDEPDOTOPT - # Extract the first word of "ocamldep.opt", so it can be a program name with args. -set dummy ocamldep.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_prog_ac_ct_OCAMLDEPDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDEPDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="$ac_ct_OCAMLDEPDOTOPT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="ocamldep.opt" - $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_OCAMLDEPDOTOPT=$ac_cv_prog_ac_ct_OCAMLDEPDOTOPT -if test -n "$ac_ct_OCAMLDEPDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEPDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLDEPDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OCAMLDEPDOTOPT" = x; then - OCAMLDEPDOTOPT="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 - OCAMLDEPDOTOPT=$ac_ct_OCAMLDEPDOTOPT - fi -else - OCAMLDEPDOTOPT="$ac_cv_prog_OCAMLDEPDOTOPT" -fi - - if test "$OCAMLDEPDOTOPT" != "no"; then - TMPVERSION=`$OCAMLDEPDOTOPT -version | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamldep.opt discarded." >&5 -$as_echo "version differs from ocamlc; ocamldep.opt discarded." >&6; } - else - OCAMLDEP=$OCAMLDEPDOTOPT - fi - fi - 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_prog_OCAMLMKTOP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLMKTOP"; then - ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" - $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 -OCAMLMKTOP=$ac_cv_prog_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_prog_OCAMLMKTOP"; then - ac_ct_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_prog_ac_ct_OCAMLMKTOP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLMKTOP"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" - $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_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP -if test -n "$ac_ct_OCAMLMKTOP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 -$as_echo "$ac_ct_OCAMLMKTOP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLMKTOP - fi -else - OCAMLMKTOP="$ac_cv_prog_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_prog_OCAMLMKLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLMKLIB"; then - ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" - $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 -OCAMLMKLIB=$ac_cv_prog_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_prog_OCAMLMKLIB"; then - ac_ct_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_prog_ac_ct_OCAMLMKLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLMKLIB"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" - $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_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB -if test -n "$ac_ct_OCAMLMKLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 -$as_echo "$ac_ct_OCAMLMKLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLMKLIB - fi -else - OCAMLMKLIB="$ac_cv_prog_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_prog_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDOC"; then - ac_cv_prog_OCAMLDOC="$OCAMLDOC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" - $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 -OCAMLDOC=$ac_cv_prog_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_prog_OCAMLDOC"; then - ac_ct_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_prog_ac_ct_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDOC"; then - ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" - $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_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC -if test -n "$ac_ct_OCAMLDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 -$as_echo "$ac_ct_OCAMLDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLDOC - fi -else - OCAMLDOC="$ac_cv_prog_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_prog_OCAMLBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLBUILD"; then - ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" - $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 -OCAMLBUILD=$ac_cv_prog_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_prog_OCAMLBUILD"; then - ac_ct_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_prog_ac_ct_OCAMLBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLBUILD"; then - ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" - $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_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD -if test -n "$ac_ct_OCAMLBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 -$as_echo "$ac_ct_OCAMLBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_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_ct_OCAMLBUILD - fi -else - OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" -fi - - - -ROOTDIR=$(dirname $(pwd)) - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - 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_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - - AX_MAJOR_VERSION=`echo "$OCAMLVERSION" | $SED 's/\([^.][^.]*\).*/\1/'` - AX_MINOR_VERSION=`echo "$OCAMLVERSION" | $SED 's/[^.][^.]*.\([^.][^.]*\).*/\1/'` - AX_POINT_VERSION=`echo "$OCAMLVERSION" | $SED 's/[^.][^.]*.[^.][^.]*.\(.*\)/\1/'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Major version" >&5 -$as_echo_n "checking Major version... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AX_MAJOR_VERSION" >&5 -$as_echo "$AX_MAJOR_VERSION" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Minor version" >&5 -$as_echo_n "checking Minor version... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AX_MINOR_VERSION" >&5 -$as_echo "$AX_MINOR_VERSION" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Point version" >&5 -$as_echo_n "checking Point version... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AX_POINT_VERSION" >&5 -$as_echo "$AX_POINT_VERSION" >&6; } - -OCAML_MAJOR_VERSION=$AX_MAJOR_VERSION -OCAML_MINOR_VERSION=$AX_MINOR_VERSION -OCAML_POINT_VERSION=$AX_POINT_VERSION - -if test "$OCAMLC" = "no"; then - as_fn_error $? "You must install the OCaml compiler" "$LINENO" 5 -fi - -if test "${OCAMLVERSION}" = ""; then - as_fn_error $? "No OCaml version. ocamlc -version is not parsable." "$LINENO" 5 -fi - -if test "$VERSION_CHECK" = "yes" ; then - for ac_prog in gawk mawk nawk awk -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_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$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 -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "${OCAML_MINIMAL_VERSION}" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - as_fn_error $? "Your version of OCaml: $OCAMLVERSION is not supported. You need ${OCAML_MINIMAL_VERSION} at least." "$LINENO" 5 - fi - -fi - - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "4.03.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - OCAML_USE_POSIX_TYPES=undef - else OCAML_USE_POSIX_TYPES=define - fi - - - -case "$OCAMLLIB" in - */lib/ocaml) - OCAMLBIN=`dirname $OCAMLLIB` - OCAMLBIN=`dirname $OCAMLBIN` - OCAMLBIN=$OCAMLBIN/bin - ;; - */lib) - OCAMLBIN=`dirname $OCAMLLIB` - OCAMLBIN=$OCAMLBIN/bin - ;; - *) OCAMLBIN=/usr/local/bin - ;; -esac - -ocamldir='${libdir}/ocaml' -metadir='${ocamldir}' - - - # checking for ocamlfind - 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_prog_OCAMLFIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLFIND"; then - ac_cv_prog_OCAMLFIND="$OCAMLFIND" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind" - $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 -OCAMLFIND=$ac_cv_prog_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_prog_OCAMLFIND"; then - ac_ct_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_prog_ac_ct_OCAMLFIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLFIND"; then - ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind" - $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_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND -if test -n "$ac_ct_OCAMLFIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5 -$as_echo "$ac_ct_OCAMLFIND" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OCAMLFIND" = x; then - OCAMLFIND="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 - OCAMLFIND=$ac_ct_OCAMLFIND - fi -else - OCAMLFIND="$ac_cv_prog_OCAMLFIND" -fi - - - -if test "${OCAMLFIND}" != "no"; then - metadir="$(${OCAMLFIND} -printconf destdir)" - echo "initializing metadir from ocamlfind config" -fi - -if test "x${prefix}" = "xNONE"; then - if test "x${OPAM_PREFIX}" != "x"; then - echo inheriting OPAM settings from OPAM_PREFIX - prefix="${OPAM_PREFIX}" - ocamldir='${libdir}' - metadir="${OPAM_PREFIX}/lib" - else - prefix="$(dirname ${OCAMLLIB})" - base="$(basename ${prefix})" - if test "x${base}" = "xlib"; then - prefix="$(dirname ${prefix})" - fi - fi -fi - - -# Check whether --with-ocamldir was given. -if test "${with_ocamldir+set}" = set; then : - withval=$with_ocamldir; ocamldir="${withval}" -fi - - - -# Check whether --with-metadir was given. -if test "${with_metadir+set}" = set; then : - withval=$with_metadir; metadir="${withval}" -fi - - - - - - - - - - - -if test "$OCAMLFIND" = "no"; then - as_fn_error $? "You must install OCaml package 'ocamlfind'" "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package ocp-build" >&5 -$as_echo_n "checking for OCaml findlib package ocp-build... " >&6; } - - unset found - unset pkg - found=no - for pkg in ocp-build ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_ocp_build=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_ocp_build_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_ocp_build=no - fi - - - -if test "$OCAML_PKG_ocp_build" = "no"; then - as_fn_error $? "Please install OCaml package 'ocp-build'." "$LINENO" 5 -fi - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAML_PKG_ocp_build_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "1.99.19-beta" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - as_fn_error $? "Version 1.99.19-beta of ocp-build is needed" "$LINENO" 5 - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package js_of_ocaml" >&5 -$as_echo_n "checking for OCaml findlib package js_of_ocaml... " >&6; } - - unset found - unset pkg - found=no - for pkg in js_of_ocaml ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_js_of_ocaml=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_js_of_ocaml_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_js_of_ocaml=no - fi - - - -if test "$OCAML_PKG_js_of_ocaml" = "no"; then - as_fn_error $? "Please install OCaml package 'js_of_ocaml'." "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package js_of_ocaml-ppx" >&5 -$as_echo_n "checking for OCaml findlib package js_of_ocaml-ppx... " >&6; } - - unset found - unset pkg - found=no - for pkg in js_of_ocaml-ppx ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_js_of_ocaml_ppx=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_js_of_ocaml_ppx_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_js_of_ocaml_ppx=no - fi - - - -if test "$OCAML_PKG_js_of_ocaml_ppx" = "no"; then - as_fn_error $? "Please install OCaml package 'js_of_ocaml-ppx'." "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package js_of_ocaml-tyxml" >&5 -$as_echo_n "checking for OCaml findlib package js_of_ocaml-tyxml... " >&6; } - - unset found - unset pkg - found=no - for pkg in js_of_ocaml-tyxml ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_js_of_ocaml_tyxml=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_js_of_ocaml_tyxml_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_js_of_ocaml_tyxml=no - fi - - - -if test "$OCAML_PKG_js_of_ocaml_tyxml" = "no"; then - as_fn_error $? "Please install OCaml package 'js_of_ocaml-tyxml'." "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package base64" >&5 -$as_echo_n "checking for OCaml findlib package base64... " >&6; } - - unset found - unset pkg - found=no - for pkg in base64 ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_base64=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_base64_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_base64=no - fi - - - -if test "$OCAML_PKG_base64" = "no"; then - as_fn_error $? "Please install OCaml package 'base64'." "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package lwt" >&5 -$as_echo_n "checking for OCaml findlib package lwt... " >&6; } - - unset found - unset pkg - found=no - for pkg in lwt ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - OCAML_PKG_lwt=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $2}') - OCAML_PKG_lwt_VERSION=$ocaml_pkg_version - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_pkg_version" >&5 -$as_echo "$ocaml_pkg_version" >&6; } - 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_lwt=no - fi - - - -if test "$OCAML_PKG_lwt" = "no"; then - as_fn_error $? "Please install OCaml package 'lwt'." "$LINENO" 5 -fi -OPAM_REPO=/home/lefessan/GIT/ocp-public/opam-repository -OPAM_REPO_OFFICIAL_REMOTE=ocaml -OPAM_REPO_FORK_REMOTE=origin -DOWNLOAD_URL_PREFIX=http://github.com/OCamlPro/ocplib-jsutils/archive/ - -############################################################### -## # -## From autoconf.ac: # -## # -############################################################### - - -# This file will be inserted inside autoconf/configure.ac by ocp-autoconf -# If you create variables, do not forget to add them in ocp-autoconf.config -# in the 'extra_config_vars' and 'extra_bool_vars' options. - - -############################################################### -## # -## END of autoconf.ac # -## # -############################################################### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ac_config_files="$ac_config_files Makefile.config config.ocpgen config.ocp2gen ocaml-config.h" - -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 -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -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 - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# 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 ocplib-jsutils $as_me 1.0, which was -generated by GNU Autoconf 2.69. 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 the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -ocplib-jsutils config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 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' -AWK='$AWK' -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" ;; - "config.ocpgen") CONFIG_FILES="$CONFIG_FILES config.ocpgen" ;; - "config.ocp2gen") CONFIG_FILES="$CONFIG_FILES config.ocp2gen" ;; - "ocaml-config.h") CONFIG_FILES="$CONFIG_FILES ocaml-config.h" ;; - - *) 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` -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 -' >$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 = "" - -} -{ - 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 - # - -_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 -$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 - - -echo -echo "Summary for ${PACKAGE_NAME}.${PACKAGE_VERSION}:" -echo "prefix=${prefix}" -echo "exec_prefix=${exec_prefix}" -echo "bindir=${bindir}" -echo " (Executables will be installed there)" -echo "libdir=${libdir}" -echo "ocamldir=${ocamldir}" -echo " (OCaml files will be installed there)" -echo "metadir=${metadir}" -echo " (META files will be installed there)" -echo "datarootdir=${datarootdir}" -echo "mandir=${mandir}" -echo " (Manual pages will be installed there)" diff --git a/autoconf/configure.ac b/autoconf/configure.ac deleted file mode 100644 index 0f11052..0000000 --- a/autoconf/configure.ac +++ /dev/null @@ -1,209 +0,0 @@ -####################################################### -# # -# DO NOT EDIT THIS FILE # -# # -# Use ocp-autoconf to generate this file from: # -# * ocp-autoconf.config for the OCaml part # -# * ocp-autoconf.ac for autoconf parts # -# # -####################################################### -AC_INIT(ocplib-jsutils,1.0) -CONFIGURE_ARGS=$* -AC_COPYRIGHT() -OCAML_MINIMAL_VERSION=4.02.3 -AC_CONFIG_MACRO_DIR([m4]) - -AC_ARG_ENABLE(version-check, - [ --disable-version-check do not check OCaml version], - [VERSION_CHECK="$enableval"], - [VERSION_CHECK="yes"]) - -AC_ARG_ENABLE(bin-annot, - [ --disable-bin-annot do not use -bin-annot], - [OCAML_USE_BINANNOT=false], - [OCAML_USE_BINANNOT=true]) - -AC_PROG_CC - -AC_PROG_OCAML - -ROOTDIR=$(dirname $(pwd)) - -AX_SPLIT_VERSION(OCAMLVERSION) -OCAML_MAJOR_VERSION=$AX_MAJOR_VERSION -OCAML_MINOR_VERSION=$AX_MINOR_VERSION -OCAML_POINT_VERSION=$AX_POINT_VERSION - -if test "$OCAMLC" = "no"; then - AC_MSG_ERROR([You must install the OCaml compiler]) -fi - -if test "${OCAMLVERSION}" = ""; then - AC_MSG_ERROR([No OCaml version. ocamlc -version is not parsable.]) -fi - -if test "$VERSION_CHECK" = "yes" ; then - AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [${OCAML_MINIMAL_VERSION}], - AC_MSG_ERROR([Your version of OCaml: $OCAMLVERSION is not supported. You need ${OCAML_MINIMAL_VERSION} at least.])) -fi - -AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [4.03.0], - [OCAML_USE_POSIX_TYPES=undef], [OCAML_USE_POSIX_TYPES=define]) -AC_SUBST(OCAML_USE_POSIX_TYPES) - -case "$OCAMLLIB" in - */lib/ocaml) - OCAMLBIN=`dirname $OCAMLLIB` - OCAMLBIN=`dirname $OCAMLBIN` - OCAMLBIN=$OCAMLBIN/bin - ;; - */lib) - OCAMLBIN=`dirname $OCAMLLIB` - OCAMLBIN=$OCAMLBIN/bin - ;; - *) OCAMLBIN=/usr/local/bin - ;; -esac - -ocamldir='${libdir}/ocaml' -metadir='${ocamldir}' - -AC_PROG_FINDLIB -if test "${OCAMLFIND}" != "no"; then - metadir="$(${OCAMLFIND} -printconf destdir)" - echo "initializing metadir from ocamlfind config" -fi - -if test "x${prefix}" = "xNONE"; then - if test "x${OPAM_PREFIX}" != "x"; then - echo inheriting OPAM settings from OPAM_PREFIX - prefix="${OPAM_PREFIX}" - ocamldir='${libdir}' - metadir="${OPAM_PREFIX}/lib" - else - prefix="$(dirname ${OCAMLLIB})" - base="$(basename ${prefix})" - if test "x${base}" = "xlib"; then - prefix="$(dirname ${prefix})" - fi - fi -fi - -AC_ARG_WITH(ocamldir, - [AS_HELP_STRING([--with-ocamldir=DIRNAME], - [root storage of the OCaml distribution])], - [ocamldir="${withval}"], - []) - -AC_ARG_WITH(metadir, - [AS_HELP_STRING([--with-metadir=DIRNAME], - [store meta files in DIRNAME])], - [metadir="${withval}"], - []) - -AC_SUBST(ocamldir) -AC_SUBST(metadir) - -AC_SUBST(CONFIGURE_ARGS) -AC_SUBST(OCAMLVERSION) -AC_SUBST(OCAMLLIB) -AC_SUBST(OCAMLOPT) -AC_SUBST(OCAMLDEP) -AC_SUBST(OCAMLBIN) -if test "$OCAMLFIND" = "no"; then - AC_MSG_ERROR([You must install OCaml package 'ocamlfind']) -fi -AC_CHECK_OCAML_PKG(ocp-build) -if test "$OCAML_PKG_ocp_build" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'ocp-build'.]) -fi - AX_COMPARE_VERSION( [$OCAML_PKG_ocp_build_VERSION], [lt], [1.99.19-beta], - AC_MSG_ERROR([Version 1.99.19-beta of ocp-build is needed])) -AC_CHECK_OCAML_PKG(js_of_ocaml) -if test "$OCAML_PKG_js_of_ocaml" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'js_of_ocaml'.]) -fi -AC_CHECK_OCAML_PKG(js_of_ocaml-ppx) -if test "$OCAML_PKG_js_of_ocaml_ppx" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'js_of_ocaml-ppx'.]) -fi -AC_CHECK_OCAML_PKG(js_of_ocaml-tyxml) -if test "$OCAML_PKG_js_of_ocaml_tyxml" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'js_of_ocaml-tyxml'.]) -fi -OPAM_REPO=/home/lefessan/GIT/ocp-public/opam-repository -OPAM_REPO_OFFICIAL_REMOTE=ocaml -OPAM_REPO_FORK_REMOTE=origin -AC_CHECK_OCAML_PKG(base64) -if test "$OCAML_PKG_base64" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'base64'.]) -fi -AC_CHECK_OCAML_PKG(lwt) -if test "$OCAML_PKG_lwt" = "no"; then - AC_MSG_ERROR([Please install OCaml package 'lwt'.]) -fi -DOWNLOAD_URL_PREFIX=http://github.com/OCamlPro/ocplib-jsutils/archive/ - -############################################################### -## # -## From autoconf.ac: # -## # -############################################################### - - -# This file will be inserted inside autoconf/configure.ac by ocp-autoconf -# If you create variables, do not forget to add them in ocp-autoconf.config -# in the 'extra_config_vars' and 'extra_bool_vars' options. - - -############################################################### -## # -## END of autoconf.ac # -## # -############################################################### - -AC_SUBST(OCAMLFIND) -AC_SUBST(CONFIGURE_ARGS) -AC_SUBST(ROOTDIR) -AC_SUBST(prefix) -AC_SUBST(exec_prefix) -AC_SUBST(bindir) -AC_SUBST(libdir) -AC_SUBST(datarootdir) -AC_SUBST(mandir) -AC_SUBST(datadir) -AC_SUBST(ocamldir) -AC_SUBST(metadir) -AC_SUBST(PACKAGE_NAME) -AC_SUBST(PACKAGE_VERSION) -AC_SUBST(OPAM_REPO) -AC_SUBST(OPAM_REPO_OFFICIAL_REMOTE) -AC_SUBST(OPAM_REPO_FORK_REMOTE) -AC_SUBST(DOWNLOAD_URL_PREFIX) -AC_SUBST(OCAMLVERSION) -AC_SUBST(OCAMLC) -AC_SUBST(OCAMLOPT) -AC_SUBST(OCAMLDEP) -AC_SUBST(OCAMLMKTOP) -AC_SUBST(OCAMLMKLIB) -AC_SUBST(OCAMLDOC) -AC_SUBST(OCAMLLIB) -AC_SUBST(OCAMLBIN) -AC_SUBST(OCAML_USE_BINANNOT) -AC_CONFIG_FILES(Makefile.config config.ocpgen config.ocp2gen ocaml-config.h) -AC_OUTPUT - -echo -echo "Summary for ${PACKAGE_NAME}.${PACKAGE_VERSION}:" -echo "prefix=${prefix}" -echo "exec_prefix=${exec_prefix}" -echo "bindir=${bindir}" -echo " (Executables will be installed there)" -echo "libdir=${libdir}" -echo "ocamldir=${ocamldir}" -echo " (OCaml files will be installed there)" -echo "metadir=${metadir}" -echo " (META files will be installed there)" -echo "datarootdir=${datarootdir}" -echo "mandir=${mandir}" -echo " (Manual pages will be installed there)" diff --git a/autoconf/generated.files b/autoconf/generated.files deleted file mode 100644 index 6bcd669..0000000 --- a/autoconf/generated.files +++ /dev/null @@ -1,22 +0,0 @@ -.gitignore ccd4691949dc0d64affdd63e96ab8537 -.travis.yml df41ee49d448823e26a88d75c2c3d8e5 -LICENSE c8283c42bd0c08ab3d588c102df2dad3 -Makefile b4929467815b005ec85d2baece515a59 -autoconf/.gitignore 00973f185af428536c3caff11a53626d -autoconf/Makefile.config.in 8edc4964d3e8d09eb9867cadc98d13a7 -autoconf/Makefile.rules c9e85dee44380b1a855cb2d49da44d54 -autoconf/build.ocp 9d81103f0dd977b6414645b9ab29c713 -autoconf/config.ocp2gen.in 98b5f8ae8a16187c0c76daccc72bee2d -autoconf/config.ocpgen.in 159639bcf1a04a7c846aa1dffe556db9 -autoconf/configure.ac a261fe8fa6c9f7ebbd03bc8ba92a3743 -autoconf/m4/ax_compare_version.m4 ebb455a7fd6a8ba9a4e38a25c8f0b686 -autoconf/m4/ocaml.m4 bffe7da970a9e23a89b611c00360f36f -autoconf/ocaml-config.h.in 361f7d5a23b30c6c49756a9e34c2dcf9 -autoconf/travis-ci.sh e22cfae9156c383ce5a4abf646798a17 -autoconf/travis-install.sh 9bfd3722ac873da3f33d69fd670659b2 -build.ocp e34f091d3841a5b334fbb7341b9e227e -build.ocp2 1e8c5c999be6aa80323779226d7c7f1a -configure 3ffc5da4b7c00140c3024342e64cc2a5 -ocp-autoconf.d/configure.ac bb8a88addef00eed10bfc70827998e9e -opam d81a1ad723ba13781750761e1a49757f -push-opam.sh c48fac7c8991f96357c9fc65a2ae6288 diff --git a/autoconf/m4/ax_compare_version.m4 b/autoconf/m4/ax_compare_version.m4 deleted file mode 100644 index 74dc0fd..0000000 --- a/autoconf/m4/ax_compare_version.m4 +++ /dev/null @@ -1,177 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# -# DESCRIPTION -# -# This macro compares two version strings. Due to the various number of -# minor-version numbers that can exist, and the fact that string -# comparisons are not compatible with numeric comparisons, this is not -# necessarily trivial to do in a autoconf script. This macro makes doing -# these comparisons easy. -# -# The six basic comparisons are available, as well as checking equality -# limited to a certain number of minor-version levels. -# -# The operator OP determines what type of comparison to do, and can be one -# of: -# -# eq - equal (test A == B) -# ne - not equal (test A != B) -# le - less than or equal (test A <= B) -# ge - greater than or equal (test A >= B) -# lt - less than (test A < B) -# gt - greater than (test A > B) -# -# Additionally, the eq and ne operator can have a number after it to limit -# the test to that number of minor versions. -# -# eq0 - equal up to the length of the shorter version -# ne0 - not equal up to the length of the shorter version -# eqN - equal up to N sub-version levels -# neN - not equal up to N sub-version levels -# -# When the condition is true, shell commands ACTION-IF-TRUE are run, -# otherwise shell commands ACTION-IF-FALSE are run. The environment -# variable 'ax_compare_version' is always set to either 'true' or 'false' -# as well. -# -# Examples: -# -# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) -# -# would both be true. -# -# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) -# -# would both be false. -# -# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) -# -# would be true because it is only comparing two minor versions. -# -# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) -# -# would be true because it is only comparing the lesser number of minor -# versions of the two values. -# -# Note: The characters that separate the version numbers do not matter. An -# empty string is the same as version 0. OP is evaluated by autoconf, not -# configure, so must be a string, not a variable. -# -# The author would like to acknowledge Guido Draheim whose advice about -# the m4_case and m4_ifvaln functions make this macro only include the -# portions necessary to perform the specific comparison specified by the -# OP argument in the final configure script. -# -# LICENSE -# -# Copyright (c) 2008 Tim Toolan -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -dnl ######################################################################### -AC_DEFUN([AX_COMPARE_VERSION], [ - AC_REQUIRE([AC_PROG_AWK]) - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - AS_VAR_PUSHDEF([A],[ax_compare_version_A]) - A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - AS_VAR_PUSHDEF([B],[ax_compare_version_B]) - B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary - dnl # then the first line is used to determine if the condition is true. - dnl # The sed right after the echo is to remove any indented white space. - m4_case(m4_tolower($2), - [lt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [gt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [le],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ], - [ge],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ],[ - dnl Split the operator from the subversion count if present. - m4_bmatch(m4_substr($2,2), - [0],[ - # A count of zero means use the length of the shorter version. - # Determine the number of characters in A and B. - ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` - ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` - - # Set A to no more than B's length and B to no more than A's length. - A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` - B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` - ], - [[0-9]+],[ - # A count greater than zero means use only that many subversions - A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - ], - [.+],[ - AC_WARNING( - [illegal OP numeric parameter: $2]) - ],[]) - - # Pad zeros at end of numbers to make same length. - ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" - B="$B`echo $A | sed 's/./0/g'`" - A="$ax_compare_version_tmp_A" - - # Check for equality or inequality as necessary. - m4_case(m4_tolower(m4_substr($2,0,2)), - [eq],[ - test "x$A" = "x$B" && ax_compare_version=true - ], - [ne],[ - test "x$A" != "x$B" && ax_compare_version=true - ],[ - AC_WARNING([illegal OP parameter: $2]) - ]) - ]) - - AS_VAR_POPDEF([A])dnl - AS_VAR_POPDEF([B])dnl - - dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. - if test "$ax_compare_version" = "true" ; then - m4_ifvaln([$4],[$4],[:])dnl - m4_ifvaln([$5],[else $5])dnl - fi -]) dnl AX_COMPARE_VERSION diff --git a/autoconf/m4/ocaml.m4 b/autoconf/m4/ocaml.m4 deleted file mode 100644 index eb75ab5..0000000 --- a/autoconf/m4/ocaml.m4 +++ /dev/null @@ -1,268 +0,0 @@ -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_CHECK_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_CHECK_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_CHECK_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_CHECK_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_CHECK_TOOL([OCAML],[ocaml],[no]) - - # checking for ocamldep - AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no]) - - if test "$OCAMLDEP" != "no" ; then - AC_CHECK_TOOL([OCAMLDEPDOTOPT],[ocamldep.opt],[no]) - if test "$OCAMLDEPDOTOPT" != "no"; then - TMPVERSION=`$OCAMLDEPDOTOPT -version | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - AC_MSG_RESULT([version differs from ocamlc; ocamldep.opt discarded.]) - else - OCAMLDEP=$OCAMLDEPDOTOPT - fi - fi - fi - - # checking for ocamlmktop - AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no]) - - # checking for ocamlmklib - AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no]) - - # checking for ocamldoc - AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no]) - - # checking for ocamlbuild - AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no]) -]) - - -AC_DEFUN([AC_PROG_OCAMLLEX], -[dnl - # checking for ocamllex - AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no]) - if test "$OCAMLLEX" != "no"; then - AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no]) - if test "$OCAMLLEXDOTOPT" != "no"; then - OCAMLLEX=$OCAMLLEXDOTOPT - fi - fi - AC_SUBST([OCAMLLEX]) -]) - -AC_DEFUN([AC_PROG_OCAMLYACC], -[dnl - AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no]) - AC_SUBST([OCAMLYACC]) -]) - - -AC_DEFUN([AC_PROG_CAMLP4], -[dnl - AC_REQUIRE([AC_PROG_OCAML])dnl - - # checking for camlp4 - AC_CHECK_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_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no]) - AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no]) - AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no]) - AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no]) - AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no]) - AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no]) - AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no]) - AC_CHECK_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 - AC_REQUIRE([AC_PROG_OCAML])dnl - - # checking for ocamlfind - AC_CHECK_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 - 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 - AS_TR_SH([OCAML_PKG_$1])=$pkg - ocaml_pkg_version=$($OCAMLFIND query -l $pkg|grep version: | awk '{ print $[]2}') - AS_TR_SH([OCAML_PKG_$1_VERSION])=$ocaml_pkg_version - - AC_MSG_RESULT([$ocaml_pkg_version]) - 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 <&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 < conftest.ml <" + "Michael Laporte " + "Fabrice Le Fessant " + "Maxime Levillain " + "Steven de Oliveira ") +(maintainers "Fabrice Le Fessant ") + +(package + (name ocplib-jsutils) + (synopsis "A collection of useful libraries to build sites with js_of_ocaml") + (description "A collection of useful libraries to build sites with js_of_ocaml") + (documentation "https://ocamlpro.github.io/ocplib-jsutils/doc") + (depends + (js_of_ocaml-tyxml (>= 3.4.0)) + (base64 (>= 3.2.0)) + (lwt (>= 4.0.0)))) diff --git a/examples/chrome-extension/background-example.js b/examples/chrome-extension/background-example.js deleted file mode 100644 index 0f9b073..0000000 --- a/examples/chrome-extension/background-example.js +++ /dev/null @@ -1,2091 +0,0 @@ -// Generated by js_of_ocaml 3.5.2 -(function(joo_global_object) - {"use strict"; - function raw_array_sub(a,i,l) - {var b=new Array(l);for(var j=0;j < l;j++)b[j] = a[i + j];return b} - function caml_subarray_to_string(a,i,len) - {var f=String.fromCharCode; - if(i == 0 && len <= 4096 && len == a.length)return f.apply(null,a); - var s=""; - for(;0 < len;i += 1024,len -= 1024) - s += f.apply(null,raw_array_sub(a,i,Math.min(len,1024))); - return s} - function caml_convert_string_to_array(s) - {if(joo_global_object.Uint8Array) - var a=new (joo_global_object.Uint8Array)(s.l); - else - var a=new Array(s.l); - var b=s.c,l=b.length,i=0; - for(;i < l;i++)a[i] = b.charCodeAt(i); - for(l = s.l;i < l;i++)a[i] = 0; - s.c = a; - s.t = 4; - return a} - function caml_blit_bytes(s1,i1,s2,i2,len) - {if(len == 0)return 0; - if(i2 == 0 && (len >= s2.l || s2.t == 2 && len >= s2.c.length)) - {s2.c - = - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - if(s2.t == 2 && i2 == s2.c.length) - {s2.c - += - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - {if(s2.t != 4)caml_convert_string_to_array(s2); - var c1=s1.c,c2=s2.c; - if(s1.t == 4) - if(i2 <= i1) - for(var i=0;i < len;i++)c2[i2 + i] = c1[i1 + i]; - else - for(var i=len - 1;i >= 0;i--)c2[i2 + i] = c1[i1 + i]; - else - {var l=Math.min(len,c1.length - i1); - for(var i=0;i < l;i++)c2[i2 + i] = c1.charCodeAt(i1 + i); - for(;i < len;i++)c2[i2 + i] = 0}} - return 0} - function caml_blit_string(s1,i1,s2,i2,len) - {return caml_blit_bytes(s1,i1,s2,i2,len)} - function raw_array_append_one(a,x) - {var l=a.length,b=new Array(l + 1),i=0; - for(;i < l;i++)b[i] = a[i]; - b[i] = x; - return b} - function caml_call_gen(f,args) - {if(f.fun)return caml_call_gen(f.fun,args); - var n=f.length,argsLen=args.length,d=n - argsLen; - if(d == 0) - return f.apply(null,args); - else - if(d < 0) - return caml_call_gen - (f.apply(null,raw_array_sub(args,0,n)), - raw_array_sub(args,n,argsLen - n)); - else - return function(x) - {return caml_call_gen(f,raw_array_append_one(args,x))}} - function caml_str_repeat(n,s) - {if(n == 0)return ""; - if(s.repeat)return s.repeat(n); - var r="",l=0; - if(n == 0)return r; - for(;;) - {if(n & 1)r += s; - n >>= 1; - if(n == 0)return r; - s += s; - l++; - if(l == 9)s.slice(0,1)}} - function caml_convert_string_to_bytes(s) - {if(s.t == 2) - s.c += caml_str_repeat(s.l - s.c.length,"\0"); - else - s.c = caml_subarray_to_string(s.c,0,s.c.length); - s.t = 0} - function caml_is_ascii(s) - {if(s.length < 24) - {for(var i=0;i < s.length;i++)if(s.charCodeAt(i) > 127)return false; - return true} - else - return ! /[^\x00-\x7f]/.test(s)} - function caml_utf16_of_utf8(s) - {for(var b="",t="",c,c1,c2,v,i=0,l=s.length;i < l;i++) - {c1 = s.charCodeAt(i); - if(c1 < 0x80) - {for(var j=i + 1;j < l && (c1 = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - v = 1; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c1 << 6); - if(c1 < 0xe0) - {v = c - 0x3080;if(v < 0x80)v = 1} - else - {v = 2; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c << 6); - if(c1 < 0xf0) - {v = c - 0xe2080; - if(v < 0x800 || v >= 0xd7ff && v < 0xe000)v = 2} - else - {v = 3; - if - (++i - < - l - && - ((c2 = s.charCodeAt(i)) & - 64) - == - 128 - && - c1 - < - 0xf5) - {v = c2 - 0x3c82080 + (c << 6); - if(v < 0x10000 || v > 0x10ffff)v = 3}}}}} - if(v < 4) - {i -= v;t += "\ufffd"} - else - if(v > 0xffff) - t += String.fromCharCode(0xd7c0 + (v >> 10),0xdc00 + (v & 0x3FF)); - else - t += String.fromCharCode(v); - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_to_js_string(s) - {switch(s.t) - {case 9:return s.c; - default:caml_convert_string_to_bytes(s);case 0: - if(caml_is_ascii(s.c)){s.t = 9;return s.c}s.t = 8; - case 8:return caml_utf16_of_utf8(s.c) - }} - function MlBytes(tag,contents,length) - {this.t = tag;this.c = contents;this.l = length} - MlBytes.prototype.toString = function(){return caml_to_js_string(this)}; - MlBytes.prototype.slice - = - function() - {var content=this.t == 4?this.c.slice():this.c; - return new MlBytes(this.t,content,this.l)}; - function caml_raise_with_arg(tag,arg){throw [0,tag,arg]} - function caml_new_string(s){return new MlBytes(0,s,s.length)} - function caml_raise_with_string(tag,msg) - {caml_raise_with_arg(tag,caml_new_string(msg))} - var caml_global_data=[0]; - function caml_invalid_argument(msg) - {caml_raise_with_string(caml_global_data.Invalid_argument,msg)} - function caml_create_bytes(len) - {if(len < 0)caml_invalid_argument("Bytes.create"); - return new MlBytes(len?2:9,"",len)} - function caml_fill_bytes(s,i,l,c) - {if(l > 0) - if(i == 0 && (l >= s.l || s.t == 2 && l >= s.c.length)) - if(c == 0) - {s.c = "";s.t = 2} - else - {s.c = caml_str_repeat(l,String.fromCharCode(c));s.t = l == s.l?0:2} - else - {if(s.t != 4)caml_convert_string_to_array(s); - for(l += i;i < l;i++)s.c[i] = c} - return 0} - var caml_oo_last_id=0; - function caml_fresh_oo_id(){return caml_oo_last_id++} - function caml_failwith(msg) - {caml_raise_with_string(caml_global_data.Failure,msg)} - if(joo_global_object.process && joo_global_object.process.cwd) - var caml_current_dir=joo_global_object.process.cwd().replace(/\\/g,"/"); - else - var caml_current_dir="/static"; - if(caml_current_dir.slice(- 1) !== "/")caml_current_dir += "/"; - function caml_make_path(name) - {name = name instanceof MlBytes?name.toString():name; - if(name.charCodeAt(0) != 47)name = caml_current_dir + name; - var comp=name.split("/"),ncomp=[]; - for(var i=0;i < comp.length;i++) - switch(comp[i]) - {case "..":if(ncomp.length > 1)ncomp.pop();break; - case ".":break; - case "":if(ncomp.length == 0)ncomp.push("");break; - default:ncomp.push(comp[i]);break} - ncomp.orig = name; - return ncomp} - function caml_raise_sys_error(msg) - {caml_raise_with_string(caml_global_data.Sys_error,msg)} - function caml_raise_no_such_file(name) - {name = name instanceof MlBytes?name.toString():name; - caml_raise_sys_error(name + ": No such file or directory")} - function caml_string_of_array(a){return new MlBytes(4,a,a.length)} - function caml_string_bound_error() - {caml_invalid_argument("index out of bounds")} - function caml_bytes_unsafe_get(s,i) - {switch(s.t & 6) - {default:if(i >= s.c.length)return 0;case 0:return s.c.charCodeAt(i); - case 4:return s.c[i] - }} - function caml_bytes_get(s,i) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_get(s,i)} - function caml_ml_bytes_length(s){return s.l} - function MlFile(){} - function MlFakeFile(content){this.data = content} - MlFakeFile.prototype = new MlFile(); - MlFakeFile.prototype.truncate - = - function(len) - {var old=this.data; - this.data = caml_create_bytes(len | 0); - caml_blit_bytes(old,0,this.data,0,len)}; - MlFakeFile.prototype.length - = - function(){return caml_ml_bytes_length(this.data)}; - MlFakeFile.prototype.write - = - function(offset,buf,pos,len) - {var clen=this.length(); - if(offset + len >= clen) - {var new_str=caml_create_bytes(offset + len),old_data=this.data; - this.data = new_str; - caml_blit_bytes(old_data,0,this.data,0,clen)} - caml_blit_bytes(buf,pos,this.data,offset,len); - return 0}; - MlFakeFile.prototype.read - = - function(offset,buf,pos,len) - {var clen=this.length(); - caml_blit_bytes(this.data,offset,buf,pos,len); - return 0}; - MlFakeFile.prototype.read_one - = - function(offset){return caml_bytes_get(this.data,offset)}; - MlFakeFile.prototype.close = function(){}; - MlFakeFile.prototype.constructor = MlFakeFile; - function MlFakeDevice(root,f) - {this.content = {};this.root = root;this.lookupFun = f} - MlFakeDevice.prototype.nm = function(name){return this.root + name}; - MlFakeDevice.prototype.lookup - = - function(name) - {if(! this.content[name] && this.lookupFun) - {var - res= - this.lookupFun(caml_new_string(this.root),caml_new_string(name)); - if(res !== 0)this.content[name] = new MlFakeFile(res[1])}}; - MlFakeDevice.prototype.exists - = - function(name) - {if(name == "")return 1; - var name_slash=name + "/",r=new RegExp("^" + name_slash); - for(var n in this.content)if(n.match(r))return 1; - this.lookup(name); - return this.content[name]?1:0}; - MlFakeDevice.prototype.readdir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - seen={}, - a=[]; - for(var n in this.content) - {var m=n.match(r); - if(m && ! seen[m[1]]){seen[m[1]] = true;a.push(m[1])}} - return a}; - MlFakeDevice.prototype.is_dir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - a=[]; - for(var n in this.content){var m=n.match(r);if(m)return 1} - return 0}; - MlFakeDevice.prototype.unlink - = - function(name) - {var ok=this.content[name]?true:false; - delete this.content[name]; - return ok}; - MlFakeDevice.prototype.open - = - function(name,f) - {if(f.rdonly && f.wronly) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_text and Open_binary are not compatible"); - this.lookup(name); - if(this.content[name]) - {if(this.is_dir(name)) - caml_raise_sys_error(this.nm(name) + " : is a directory"); - if(f.create && f.excl) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - var file=this.content[name]; - if(f.truncate)file.truncate(); - return file} - else - if(f.create) - {this.content[name] = new MlFakeFile(caml_create_bytes(0)); - return this.content[name]} - else - caml_raise_no_such_file(this.nm(name))}; - MlFakeDevice.prototype.register - = - function(name,content) - {if(this.content[name]) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - if(content instanceof MlBytes) - this.content[name] = new MlFakeFile(content); - else - if(content instanceof Array) - this.content[name] = new MlFakeFile(caml_string_of_array(content)); - else - if(content.toString) - {var mlstring=caml_new_string(content.toString()); - this.content[name] = new MlFakeFile(mlstring)}}; - MlFakeDevice.prototype.constructor = MlFakeDevice; - function caml_array_of_string(s) - {if(s.t != 4)caml_convert_string_to_array(s);return s.c} - function caml_bytes_unsafe_set(s,i,c) - {c &= 0xff; - if(s.t != 4) - {if(i == s.c.length) - {s.c += String.fromCharCode(c);if(i + 1 == s.l)s.t = 0;return 0} - caml_convert_string_to_array(s)} - s.c[i] = c; - return 0} - function caml_bytes_set(s,i,c) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_set(s,i,c)} - var Buffer=joo_global_object.Buffer; - function MlNodeFile(fd){this.fs = require("fs");this.fd = fd} - MlNodeFile.prototype = new MlFile(); - MlNodeFile.prototype.truncate - = - function(len){this.fs.ftruncateSync(this.fd,len | 0)}; - MlNodeFile.prototype.length - = - function(){return this.fs.fstatSync(this.fd).size}; - MlNodeFile.prototype.write - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.writeSync(this.fd,buffer,buf_offset,len,offset); - return 0}; - MlNodeFile.prototype.read - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,buf_offset,len,offset); - for(var i=0;i < len;i++) - caml_bytes_set(buf,buf_offset + i,buffer[buf_offset + i]); - return 0}; - MlNodeFile.prototype.read_one - = - function(offset) - {var a=new (joo_global_object.Uint8Array)(1),buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,0,1,offset); - return buffer[0]}; - MlNodeFile.prototype.close = function(){this.fs.closeSync(this.fd)}; - MlNodeFile.prototype.constructor = MlNodeFile; - function MlNodeDevice(root){this.fs = require("fs");this.root = root} - MlNodeDevice.prototype.nm = function(name){return this.root + name}; - MlNodeDevice.prototype.exists - = - function(name){return this.fs.existsSync(this.nm(name))?1:0}; - MlNodeDevice.prototype.readdir - = - function(name){return this.fs.readdirSync(this.nm(name))}; - MlNodeDevice.prototype.is_dir - = - function(name){return this.fs.statSync(this.nm(name)).isDirectory()?1:0}; - MlNodeDevice.prototype.unlink - = - function(name) - {var b=this.fs.existsSync(this.nm(name))?1:0; - this.fs.unlinkSync(this.nm(name)); - return b}; - MlNodeDevice.prototype.open - = - function(name,f) - {var consts=require("constants"),res=0; - for(var key in f) - switch(key) - {case "rdonly":res |= consts.O_RDONLY;break; - case "wronly":res |= consts.O_WRONLY;break; - case "append":res |= consts.O_WRONLY | consts.O_APPEND;break; - case "create":res |= consts.O_CREAT;break; - case "truncate":res |= consts.O_TRUNC;break; - case "excl":res |= consts.O_EXCL;break; - case "binary":res |= consts.O_BINARY;break; - case "text":res |= consts.O_TEXT;break; - case "nonblock":res |= consts.O_NONBLOCK;break - } - var fd=this.fs.openSync(this.nm(name),res); - return new MlNodeFile(fd)}; - MlNodeDevice.prototype.rename - = - function(o,n){this.fs.renameSync(this.nm(o),this.nm(n))}; - MlNodeDevice.prototype.constructor = MlNodeDevice; - var caml_root=caml_current_dir.match(/[^\/]*\//)[0]; - function fs_node_supported() - {return typeof joo_global_object.process - !== - "undefined" - && - typeof joo_global_object.process.versions - !== - "undefined" - && - typeof joo_global_object.process.versions.node - !== - "undefined" - && - joo_global_object.process.platform - !== - "browser"} - var jsoo_mount_point=[]; - if(fs_node_supported()) - jsoo_mount_point.push - ({path:caml_root,device:new MlNodeDevice(caml_root)}); - else - jsoo_mount_point.push - ({path:caml_root,device:new MlFakeDevice(caml_root)}); - jsoo_mount_point.push - ({path:caml_root + "static/", - device:new MlFakeDevice(caml_root + "static/")}); - function resolve_fs_device(name) - {var - path=caml_make_path(name), - name=path.join("/"), - name_slash=name + "/", - res; - for(var i=0;i < jsoo_mount_point.length;i++) - {var m=jsoo_mount_point[i]; - if - (name_slash.search(m.path) - == - 0 - && - (! res || res.path.length < m.path.length)) - res - = - {path:m.path, - device:m.device, - rest:name.substring(m.path.length,name.length)}} - return res} - function caml_create_file(name,content) - {var root=resolve_fs_device(name); - if(! root.device.register)caml_failwith("cannot register file"); - root.device.register(root.rest,content); - return 0} - function caml_fs_init() - {var tmp=joo_global_object.caml_fs_tmp; - if(tmp) - for(var i=0;i < tmp.length;i++) - caml_create_file(tmp[i].name,tmp[i].content); - joo_global_object.caml_create_file = caml_create_file; - joo_global_object.caml_fs_tmp = []; - return 0} - var log2_ok=Math.log2 && Math.log2(1.1235582092889474E+307) == 1020; - function jsoo_floor_log2(x) - {if(log2_ok)return Math.floor(Math.log2(x)); - var i=0; - if(x == 0)return - Infinity; - if(x >= 1)while(x >= 2){x /= 2;i++}else while(x < 1){x *= 2;i--} - return i} - function caml_int32_bits_of_float(x) - {var float32a=new (joo_global_object.Float32Array)(1); - float32a[0] = x; - var int32a=new (joo_global_object.Int32Array)(float32a.buffer); - return int32a[0] | 0} - function caml_int64_create_lo_mi_hi(lo,mi,hi){return [255,lo,mi,hi]} - function caml_int64_bits_of_float(x) - {if(! isFinite(x)) - {if(isNaN(x))return caml_int64_create_lo_mi_hi(1,0,0x7ff0); - return x > 0 - ?caml_int64_create_lo_mi_hi(0,0,0x7ff0) - :caml_int64_create_lo_mi_hi(0,0,0xfff0)} - var sign=x == 0 && 1 / x == - Infinity?0x8000:x >= 0?0:0x8000; - if(sign)x = - x; - var exp=jsoo_floor_log2(x) + 1023; - if(exp <= 0) - {exp = 0;x /= Math.pow(2,- 1026)} - else - {x /= Math.pow(2,exp - 1027); - if(x < 16){x *= 2;exp -= 1} - if(exp == 0)x /= 2} - var k=Math.pow(2,24),r3=x | 0; - x = (x - r3) * k; - var r2=x | 0; - x = (x - r2) * k; - var r1=x | 0; - r3 = r3 & 0xf | sign | exp << 4; - return caml_int64_create_lo_mi_hi(r1,r2,r3)} - function caml_int64_to_bytes(x) - {return [x[3] >> 8, - x[3] & 0xff, - x[2] >> 16, - x[2] >> 8 & 0xff, - x[2] & 0xff, - x[1] >> 16, - x[1] >> 8 & 0xff, - x[1] & 0xff]} - function caml_ba_serialize(writer,ba,sz) - {writer.write(32,ba.dims.length); - writer.write(32,ba.kind | ba.layout << 8); - for(var i=0;i < ba.dims.length;i++)writer.write(32,ba.dims[i]); - switch(ba.kind) - {case 2: - case 3: - case 12: - for(var i=0;i < ba.data.length;i++)writer.write(8,ba.data[i]);break; - case 4: - case 5: - for(var i=0;i < ba.data.length;i++)writer.write(16,ba.data[i]);break; - case 6: - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]);break; - case 8: - case 9: - writer.write(8,0); - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]); - break; - case 7: - for(var i=0;i < ba.data.length / 2;i++) - {var b=caml_int64_to_bytes(ba.get(i)); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 1: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i))); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 0: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int32_bits_of_float(ba.get(i));writer.write(32,b)} - break; - case 10: - for(var i=0;i < ba.data.length / 2;i++) - {var j=ba.get(i); - writer.write(32,caml_int32_bits_of_float(j[1])); - writer.write(32,caml_int32_bits_of_float(j[2]))} - break; - case 11: - for(var i=0;i < ba.data.length / 2;i++) - {var - complex=ba.get(i), - b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[1])); - for(var j=0;j < 8;j++)writer.write(8,b[j]); - var b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[2])); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break - } - sz[0] = (4 + ba.dims.length) * 4; - sz[1] = (4 + ba.dims.length) * 8} - function caml_ba_get_size_per_element(kind) - {switch(kind){case 7:case 10:case 11:return 2;default:return 1}} - function caml_ba_create_buffer(kind,size) - {var g=joo_global_object,view; - switch(kind) - {case 0:view = g.Float32Array;break; - case 1:view = g.Float64Array;break; - case 2:view = g.Int8Array;break; - case 3:view = g.Uint8Array;break; - case 4:view = g.Int16Array;break; - case 5:view = g.Uint16Array;break; - case 6:view = g.Int32Array;break; - case 7:view = g.Int32Array;break; - case 8:view = g.Int32Array;break; - case 9:view = g.Int32Array;break; - case 10:view = g.Float32Array;break; - case 11:view = g.Float64Array;break; - case 12:view = g.Uint8Array;break - } - if(! view)caml_invalid_argument("Bigarray.create: unsupported kind"); - var data=new view(size * caml_ba_get_size_per_element(kind)); - return data} - function caml_int32_float_of_bits(x) - {var int32a=new (joo_global_object.Int32Array)(1); - int32a[0] = x; - var float32a=new (joo_global_object.Float32Array)(int32a.buffer); - return float32a[0]} - function caml_int64_of_bytes(a) - {return [255, - a[7] | a[6] << 8 | a[5] << 16, - a[4] | a[3] << 8 | a[2] << 16, - a[1] | a[0] << 8]} - function caml_int64_float_of_bits(x) - {var lo=x[1],mi=x[2],hi=x[3],exp=(hi & 0x7fff) >> 4; - if(exp == 2047) - return (lo | mi | hi & 0xf) == 0?hi & 0x8000?- Infinity:Infinity:NaN; - var k=Math.pow(2,- 24),res=(lo * k + mi) * k + (hi & 0xf); - if(exp > 0) - {res += 16;res *= Math.pow(2,exp - 1027)} - else - res *= Math.pow(2,- 1026); - if(hi & 0x8000)res = - res; - return res} - function caml_ba_get_size(dims) - {var n_dims=dims.length,size=1; - for(var i=0;i < n_dims;i++) - {if(dims[i] < 0) - caml_invalid_argument("Bigarray.create: negative dimension"); - size = size * dims[i]} - return size} - function caml_int64_create_lo_hi(lo,hi) - {return [255, - lo & 0xffffff, - lo >>> 24 & 0xff | (hi & 0xffff) << 8, - hi >>> 16 & 0xffff]} - function caml_int64_hi32(v){return v[2] >>> 8 & 0xffff | v[3] << 16} - function caml_int64_lo32(v){return v[1] | (v[2] & 0xff) << 24} - function caml_array_bound_error() - {caml_invalid_argument("index out of bounds")} - function Ml_Bigarray(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray.prototype.caml_custom = "_bigarray"; - Ml_Bigarray.prototype.offset - = - function(arg) - {var ofs=0; - if(typeof arg === "number")arg = [arg]; - if(! (arg instanceof Array)) - caml_invalid_argument("bigarray.js: invalid offset"); - if(this.dims.length != arg.length) - caml_invalid_argument("Bigarray.get/set: bad number of dimensions"); - if(this.layout == 0) - for(var i=0;i < this.dims.length;i++) - {if(arg[i] < 0 || arg[i] >= this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + arg[i]} - else - for(var i=this.dims.length - 1;i >= 0;i--) - {if(arg[i] < 1 || arg[i] > this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + (arg[i] - 1)} - return ofs}; - Ml_Bigarray.prototype.get - = - function(ofs) - {switch(this.kind) - {case 7: - var l=this.data[ofs * 2 + 0],h=this.data[ofs * 2 + 1]; - return caml_int64_create_lo_hi(l,h); - case 10: - case 11: - var r=this.data[ofs * 2 + 0],i=this.data[ofs * 2 + 1]; - return [254,r,i]; - default:return this.data[ofs]}}; - Ml_Bigarray.prototype.set - = - function(ofs,v) - {switch(this.kind) - {case 7: - this.data[ofs * 2 + 0] = caml_int64_lo32(v); - this.data[ofs * 2 + 1] = caml_int64_hi32(v); - break; - case 10: - case 11: - this.data[ofs * 2 + 0] = v[1];this.data[ofs * 2 + 1] = v[2];break; - default:this.data[ofs] = v;break} - return 0}; - Ml_Bigarray.prototype.fill - = - function(v) - {switch(this.kind) - {case 7: - var a=caml_int64_lo32(v),b=caml_int64_hi32(v); - if(a == b) - this.data.fill(a); - else - for(var i=0;i < this.data.length;i++)this.data[i] = i % 2 == 0?a:b; - break; - case 10: - case 11: - var im=v[1],re=v[2]; - if(im == re) - this.data.fill(im); - else - for(var i=0;i < this.data.length;i++) - this.data[i] = i % 2 == 0?im:re; - break; - default:this.data.fill(v);break}}; - Ml_Bigarray.prototype.compare - = - function(b,total) - {if(this.layout != b.layout || this.kind != b.kind) - {var k1=this.kind | this.layout << 8,k2=b.kind | b.layout << 8; - return k2 - k1} - if(this.dims.length != b.dims.length) - return b.dims.length - this.dims.length; - for(var i=0;i < this.dims.length;i++) - if(this.dims[i] != b.dims[i])return this.dims[i] < b.dims[i]?- 1:1; - switch(this.kind) - {case 0: - case 1: - case 10: - case 11: - var x,y; - for(var i=0;i < this.data.length;i++) - {x = this.data[i]; - y = b.data[i]; - if(x < y)return - 1; - if(x > y)return 1; - if(x != y) - {if(! total)return NaN;if(x == x)return 1;if(y == y)return - 1}} - break; - case 7: - for(var i=0;i < this.data.length;i += 2) - {if(this.data[i + 1] < b.data[i + 1])return - 1; - if(this.data[i + 1] > b.data[i + 1])return 1; - if(this.data[i] >>> 0 < b.data[i] >>> 0)return - 1; - if(this.data[i] >>> 0 > b.data[i] >>> 0)return 1} - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - case 12: - for(var i=0;i < this.data.length;i++) - {if(this.data[i] < b.data[i])return - 1; - if(this.data[i] > b.data[i])return 1} - break - } - return 0}; - function Ml_Bigarray_c_1_1(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray_c_1_1.prototype = new Ml_Bigarray(); - Ml_Bigarray_c_1_1.prototype.offset - = - function(arg) - {if(typeof arg !== "number") - if(arg instanceof Array && arg.length == 1) - arg = arg[0]; - else - caml_invalid_argument("Ml_Bigarray_c_1_1.offset"); - if(arg < 0 || arg >= this.dims[0])caml_array_bound_error(); - return arg}; - Ml_Bigarray_c_1_1.prototype.get = function(ofs){return this.data[ofs]}; - Ml_Bigarray_c_1_1.prototype.set - = - function(ofs,v){this.data[ofs] = v;return 0}; - Ml_Bigarray_c_1_1.prototype.fill - = - function(v){this.data.fill(v);return 0}; - function caml_ba_create_unsafe(kind,layout,dims,data) - {var size_per_element=caml_ba_get_size_per_element(kind); - if(caml_ba_get_size(dims) * size_per_element != data.length) - caml_invalid_argument("length doesn't match dims"); - if(layout == 0 && dims.length == 1 && size_per_element == 1) - return new Ml_Bigarray_c_1_1(kind,layout,dims,data); - return new Ml_Bigarray(kind,layout,dims,data)} - function caml_ba_deserialize(reader,sz) - {var num_dims=reader.read32s(); - if(num_dims < 0 || num_dims > 16) - caml_failwith("input_value: wrong number of bigarray dimensions"); - var tag=reader.read32s(),kind=tag & 0xff,layout=tag >> 8 & 1,dims=[]; - for(var i=0;i < num_dims;i++)dims.push(reader.read32u()); - var - size=caml_ba_get_size(dims), - data=caml_ba_create_buffer(kind,size), - ba=caml_ba_create_unsafe(kind,layout,dims,data); - switch(kind) - {case 2:for(var i=0;i < size;i++)data[i] = reader.read8s();break; - case 3: - case 12:for(var i=0;i < size;i++)data[i] = reader.read8u();break; - case 4:for(var i=0;i < size;i++)data[i] = reader.read16s();break; - case 5:for(var i=0;i < size;i++)data[i] = reader.read16u();break; - case 6:for(var i=0;i < size;i++)data[i] = reader.read32s();break; - case 8: - case 9: - var sixty=reader.read8u(); - if(sixty) - caml_failwith - ("input_value: cannot read bigarray with 64-bit OCaml ints"); - for(var i=0;i < size;i++)data[i] = reader.read32s(); - break; - case 7: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var int64=caml_int64_of_bytes(t); - ba.set(i,int64)} - break; - case 1: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var f=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,f)} - break; - case 0: - for(var i=0;i < size;i++) - {var f=caml_int32_float_of_bits(reader.read32s());ba.set(i,f)} - break; - case 10: - for(var i=0;i < size;i++) - {var - re=caml_int32_float_of_bits(reader.read32s()), - im=caml_int32_float_of_bits(reader.read32s()); - ba.set(i,[254,re,im])} - break; - case 11: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var re=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var im=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,[254,re,im])} - break - } - sz[0] = (4 + num_dims) * 4; - return caml_ba_create_unsafe(kind,layout,dims,data)} - function caml_ba_compare(a,b,total){return a.compare(b,total)} - if(! Math.imul) - Math.imul - = - function(x,y){y |= 0;return ((x >> 16) * y << 16) + (x & 0xffff) * y | 0}; - var caml_mul=Math.imul; - function caml_hash_mix_int(h,d) - {d = caml_mul(d,0xcc9e2d51 | 0); - d = d << 15 | d >>> 32 - 15; - d = caml_mul(d,0x1b873593); - h ^= d; - h = h << 13 | h >>> 32 - 13; - return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0} - function caml_hash_mix_int64(h,v) - {h = caml_hash_mix_int(h,caml_int64_lo32(v)); - h = caml_hash_mix_int(h,caml_int64_hi32(v)); - return h} - function caml_hash_mix_float(h,v0) - {return caml_hash_mix_int64(h,caml_int64_bits_of_float(v0))} - function caml_ba_hash(ba) - {var num_elts=caml_ba_get_size(ba.dims),h=0; - switch(ba.kind) - {case 2: - case 3: - case 12: - if(num_elts > 256)num_elts = 256; - var w=0,i=0; - for(i = 0;i + 4 <= ba.data.length;i += 4) - {w - = - ba.data[i + 0] - | - ba.data[i + 1] - << - 8 - | - ba.data[i + 2] - << - 16 - | - ba.data[i + 3] - << - 24; - h = caml_hash_mix_int(h,w)} - w = 0; - switch(num_elts & 3) - {case 3:w = ba.data[i + 2] << 16; - case 2:w |= ba.data[i + 1] << 8; - case 1:w |= ba.data[i + 0];h = caml_hash_mix_int(h,w) - } - break; - case 4: - case 5: - if(num_elts > 128)num_elts = 128; - var w=0,i=0; - for(i = 0;i + 2 <= ba.data.length;i += 2) - {w = ba.data[i + 0] | ba.data[i + 1] << 16; - h = caml_hash_mix_int(h,w)} - if((num_elts & 1) != 0)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 6: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 8: - case 9: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 7: - if(num_elts > 32)num_elts = 32; - num_elts *= 2; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 10:num_elts *= 2; - case 0: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break; - case 11:num_elts *= 2; - case 1: - if(num_elts > 32)num_elts = 32; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break - } - return h} - function caml_int32_unmarshal(reader,size) - {size[0] = 4;return reader.read32s()} - function caml_nativeint_unmarshal(reader,size) - {switch(reader.read8u()) - {case 1:size[0] = 4;return reader.read32s(); - case 2:caml_failwith("input_value: native integer value too large"); - default:caml_failwith("input_value: ill-formed native integer")}} - function caml_int64_unmarshal(reader,size) - {var t=new Array(8); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - size[0] = 8; - return caml_int64_of_bytes(t)} - function caml_int64_marshal(writer,v,sizes) - {var b=caml_int64_to_bytes(v); - for(var i=0;i < 8;i++)writer.write(8,b[i]); - sizes[0] = 8; - sizes[1] = 8} - function caml_int64_compare(x,y) - {var x3=x[3] << 16,y3=y[3] << 16; - if(x3 > y3)return 1; - if(x3 < y3)return - 1; - if(x[2] > y[2])return 1; - if(x[2] < y[2])return - 1; - if(x[1] > y[1])return 1; - if(x[1] < y[1])return - 1; - return 0} - function caml_int64_hash(x) - {var lo=x[1] | (x[2] & 0xff) << 24,hi=x[2] >>> 8 & 0xffff | x[3] << 16; - return lo ^ hi} - var - caml_custom_ops= - {"_j": - {deserialize:caml_int64_unmarshal, - serialize:caml_int64_marshal, - fixed_length:8, - compare:caml_int64_compare, - hash:caml_int64_hash}, - "_i":{deserialize:caml_int32_unmarshal,fixed_length:4}, - "_n":{deserialize:caml_nativeint_unmarshal,fixed_length:4}, - "_bigarray": - {deserialize:caml_ba_deserialize, - serialize:caml_ba_serialize, - compare:caml_ba_compare, - hash:caml_ba_hash}}; - function caml_compare_val_get_custom(a) - {return caml_custom_ops[a.caml_custom] - && - caml_custom_ops[a.caml_custom].compare} - function caml_compare_val_number_custom(num,custom,swap,total) - {var comp=caml_compare_val_get_custom(custom); - if(comp) - {var x=swap > 0?comp(custom,num,total):comp(num,custom,total); - if(total && x != x)return swap; - if(+ x != + x)return + x; - if((x | 0) != 0)return x | 0} - return swap} - function caml_compare_val_tag(a) - {if(typeof a === "number") - return 1000; - else - if(a instanceof MlBytes) - return 252; - else - if(a instanceof Array && a[0] === a[0] >>> 0 && a[0] <= 255) - {var tag=a[0] | 0;return tag == 254?0:tag} - else - if(a instanceof String) - return 1252; - else - if(typeof a == "string") - return 1252; - else - if(a instanceof Number) - return 1000; - else - if(a && a.caml_custom) - return 1255; - else - if(a && a.compare) - return 1256; - else - if(typeof a == "function") - return 1247; - else - if(typeof a == "symbol")return 1251; - return 1001} - function caml_int_compare(a,b) - {if(a < b)return - 1;if(a == b)return 0;return 1} - function caml_string_compare(s1,s2) - {s1.t & 6 && caml_convert_string_to_bytes(s1); - s2.t & 6 && caml_convert_string_to_bytes(s2); - return s1.c < s2.c?- 1:s1.c > s2.c?1:0} - function caml_compare_val(a,b,total) - {var stack=[]; - for(;;) - {if(! (total && a === b)) - {var tag_a=caml_compare_val_tag(a); - if(tag_a == 250){a = a[1];continue} - var tag_b=caml_compare_val_tag(b); - if(tag_b == 250){b = b[1];continue} - if(tag_a !== tag_b) - {if(tag_a == 1000) - {if(tag_b == 1255) - return caml_compare_val_number_custom(a,b,- 1,total); - return - 1} - if(tag_b == 1000) - {if(tag_a == 1255) - return caml_compare_val_number_custom(b,a,1,total); - return 1} - return tag_a < tag_b?- 1:1} - switch(tag_a) - {case 247:caml_invalid_argument("compare: functional value");break; - case 248: - var x=caml_int_compare(a[2],b[2]);if(x != 0)return x | 0;break; - case 249:caml_invalid_argument("compare: functional value");break; - case 250: - caml_invalid_argument - ("equal: got Forward_tag, should not happen"); - break; - case 251:caml_invalid_argument("equal: abstract value");break; - case 252: - if(a !== b) - {var x=caml_string_compare(a,b);if(x != 0)return x | 0} - break; - case 253: - caml_invalid_argument("equal: got Double_tag, should not happen"); - break; - case 254: - caml_invalid_argument - ("equal: got Double_array_tag, should not happen"); - break; - case 255: - var x=caml_int64_compare(a,b);if(x != 0)return x | 0;break; - case 1247: - caml_invalid_argument("compare: functional value");break; - case 1255: - var comp=caml_compare_val_get_custom(a); - if(comp != caml_compare_val_get_custom(b)) - return a.caml_custom < b.caml_custom?- 1:1; - if(! comp)caml_invalid_argument("compare: abstract value"); - var x=comp(a,b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1256: - var x=a.compare(b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1000: - a = + a; - b = + b; - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1001: - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1251:if(a !== b){if(! total)return NaN;return 1}break; - case 1252: - var a=a.toString(),b=b.toString(); - if(a !== b){if(a < b)return - 1;if(a > b)return 1} - break; - case 246: - case 254: - default: - if(a.length != b.length)return a.length < b.length?- 1:1; - if(a.length > 1)stack.push(a,b,1); - break}} - if(stack.length == 0)return 0; - var i=stack.pop(); - b = stack.pop(); - a = stack.pop(); - if(i + 1 < a.length)stack.push(a,b,i + 1); - a = a[i]; - b = b[i]}} - function caml_greaterequal(x,y) - {return + (caml_compare_val(x,y,false) >= 0)} - function caml_js_from_array(a){return raw_array_sub(a,1,a.length - 1)} - function caml_js_from_bool(x){return ! ! x} - function caml_js_from_string(s){return s.toString()} - function caml_js_get_console() - {var - c=joo_global_object.console?joo_global_object.console:{}, - m= - ["log", - "debug", - "info", - "warn", - "error", - "assert", - "dir", - "dirxml", - "trace", - "group", - "groupCollapsed", - "groupEnd", - "time", - "timeEnd"]; - function f(){} - for(var i=0;i < m.length;i++)if(! c[m[i]])c[m[i]] = f; - return c} - function caml_utf8_of_utf16(s) - {for(var b="",t=b,c,d,i=0,l=s.length;i < l;i++) - {c = s.charCodeAt(i); - if(c < 0x80) - {for(var j=i + 1;j < l && (c = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - if(c < 0x800) - {t += String.fromCharCode(0xc0 | c >> 6); - t += String.fromCharCode(0x80 | c & 0x3f)} - else - if(c < 0xd800 || c >= 0xdfff) - t - += - String.fromCharCode - (0xe0 | c >> 12,0x80 | c >> 6 & 0x3f,0x80 | c & 0x3f); - else - if - (c - >= - 0xdbff - || - i - + - 1 - == - l - || - (d = s.charCodeAt(i + 1)) - < - 0xdc00 - || - d - > - 0xdfff) - t += "\xef\xbf\xbd"; - else - {i++; - c = (c << 10) + d - 0x35fdc00; - t - += - String.fromCharCode - (0xf0 | c >> 18, - 0x80 | c >> 12 & 0x3f, - 0x80 | c >> 6 & 0x3f, - 0x80 | c & 0x3f)} - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_js_to_string(s) - {var tag=9; - if(! caml_is_ascii(s))tag = 8,s = caml_utf8_of_utf16(s); - return new MlBytes(tag,s,s.length)} - function caml_js_wrap_callback(f) - {return function() - {return arguments.length > 0 - ?caml_call_gen(f,arguments) - :caml_call_gen(f,[undefined])}} - function caml_lessequal(x,y){return + (caml_compare_val(x,y,false) <= 0)} - function caml_lessthan(x,y){return + (caml_compare_val(x,y,false) < 0)} - function caml_make_vect(len,init) - {if(len < 0)caml_array_bound_error(); - var len=len + 1 | 0,b=new Array(len); - b[0] = 0; - for(var i=1;i < len;i++)b[i] = init; - return b} - var caml_ml_channels=new Array(); - function caml_ml_flush(chanid) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened)caml_raise_sys_error("Cannot flush a closed channel"); - if(! chan.buffer || chan.buffer == "")return 0; - if - (chan.fd - && - caml_global_data.fds[chan.fd] - && - caml_global_data.fds[chan.fd].output) - {var output=caml_global_data.fds[chan.fd].output; - switch(output.length) - {case 2:output(chanid,chan.buffer);break;default:output(chan.buffer)}} - chan.buffer = ""; - return 0} - function caml_ml_string_length(s){return s.l} - function caml_std_output(chanid,s) - {var - chan=caml_ml_channels[chanid], - str=caml_new_string(s), - slen=caml_ml_string_length(str); - chan.file.write(chan.offset,str,0,slen); - chan.offset += slen; - return 0} - function js_print_stderr(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stderr.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.error && v.error(s)}} - function js_print_stdout(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stdout.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.log && v.log(s)}} - function caml_sys_open_internal(idx,output,file,flags) - {if(caml_global_data.fds === undefined) - caml_global_data.fds = new Array(); - flags = flags?flags:{}; - var info={}; - info.file = file; - info.offset = flags.append?file.length():0; - info.flags = flags; - info.output = output; - caml_global_data.fds[idx] = info; - if(! caml_global_data.fd_last_idx || idx > caml_global_data.fd_last_idx) - caml_global_data.fd_last_idx = idx; - return idx} - function caml_sys_open(name,flags,_perms) - {var f={}; - while(flags) - {switch(flags[1]) - {case 0:f.rdonly = 1;break; - case 1:f.wronly = 1;break; - case 2:f.append = 1;break; - case 3:f.create = 1;break; - case 4:f.truncate = 1;break; - case 5:f.excl = 1;break; - case 6:f.binary = 1;break; - case 7:f.text = 1;break; - case 8:f.nonblock = 1;break - } - flags = flags[2]} - if(f.rdonly && f.wronly) - caml_raise_sys_error - (name.toString() - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (name.toString() - + - " : flags Open_text and Open_binary are not compatible"); - var - root=resolve_fs_device(name), - file=root.device.open(root.rest,f), - idx=caml_global_data.fd_last_idx?caml_global_data.fd_last_idx:0; - return caml_sys_open_internal(idx + 1,caml_std_output,file,f)} - caml_sys_open_internal - (0,caml_std_output,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (1,js_print_stdout,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (2,js_print_stderr,new MlFakeFile(caml_create_bytes(0))); - function caml_ml_open_descriptor_in(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.wronly)caml_raise_sys_error("fd " + fd + " is writeonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:false, - refill:null}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_open_descriptor_out(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.rdonly)caml_raise_sys_error("fd " + fd + " is readonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:true, - buffer:""}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_out_channels_list() - {var l=0; - for(var c=0;c < caml_ml_channels.length;c++) - if - (caml_ml_channels[c] - && - caml_ml_channels[c].opened - && - caml_ml_channels[c].out) - l = [0,caml_ml_channels[c].fd,l]; - return l} - function caml_jsbytes_of_string(s) - {if((s.t & 6) != 0)caml_convert_string_to_bytes(s);return s.c} - function caml_ml_output_bytes(chanid,buffer,offset,len) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened) - caml_raise_sys_error("Cannot output to a closed channel"); - var string; - if(offset == 0 && caml_ml_bytes_length(buffer) == len) - string = buffer; - else - {string = caml_create_bytes(len); - caml_blit_bytes(buffer,offset,string,0,len)} - var - jsstring=caml_jsbytes_of_string(string), - id=jsstring.lastIndexOf("\n"); - if(id < 0) - chan.buffer += jsstring; - else - {chan.buffer += jsstring.substr(0,id + 1); - caml_ml_flush(chanid); - chan.buffer += jsstring.substr(id + 1)} - return 0} - function caml_ml_output(chanid,buffer,offset,len) - {return caml_ml_output_bytes(chanid,buffer,offset,len)} - function caml_obj_tag(x) - {if(x instanceof Array && x[0] == x[0] >>> 0) - return x[0]; - else - if(x instanceof MlBytes) - return 252; - else - if(x instanceof Function || typeof x == "function") - return 247; - else - if(x && x.caml_custom)return 255;else return 1000} - function caml_register_global(n,v,name_opt) - {if(name_opt && joo_global_object.toplevelReloc) - n = joo_global_object.toplevelReloc(name_opt); - caml_global_data[n + 1] = v; - if(name_opt)caml_global_data[name_opt] = v} - var caml_named_values={}; - function caml_register_named_value(nm,v) - {caml_named_values[caml_jsbytes_of_string(nm)] = v;return 0} - function caml_string_of_bytes(s){return s} - function caml_sys_const_backend_type() - {return [0,caml_new_string("js_of_ocaml")]} - function caml_sys_const_max_wosize(){return 0x7FFFFFFF / 4 | 0} - var - caml_argv= - function() - {var g=joo_global_object,main="a.out",args=[]; - if(g.process && g.process.argv && g.process.argv.length > 1) - {var argv=g.process.argv; - main = argv[1]; - args = raw_array_sub(argv,2,argv.length - 2)} - var p=caml_js_to_string(main),args2=[0,p]; - for(var i=0;i < args.length;i++) - args2.push(caml_js_to_string(args[i])); - return args2} - (); - function caml_sys_get_argv(a){return [0,caml_argv[1],caml_argv]} - function caml_return_exn_constant(tag){return tag} - function caml_named_value(nm){return caml_named_values[nm]} - function caml_wrap_exception(e) - {if(e instanceof Array)return e; - if - (joo_global_object.RangeError - && - e instanceof joo_global_object.RangeError - && - e.message - && - e.message.match(/maximum call stack/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if - (joo_global_object.InternalError - && - e instanceof joo_global_object.InternalError - && - e.message - && - e.message.match(/too much recursion/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if(e instanceof joo_global_object.Error && caml_named_value("jsError")) - return [0,caml_named_value("jsError"),e]; - return [0,caml_global_data.Failure,caml_js_to_string(String(e))]} - function caml_call1(f,a0) - {return f.length == 1?f(a0):caml_call_gen(f,[a0])} - function caml_call3(f,a0,a1,a2) - {return f.length == 3?f(a0,a1,a2):caml_call_gen(f,[a0,a1,a2])} - caml_fs_init(); - var - Out_of_memory=[248,caml_new_string("Out_of_memory"),-1], - Sys_error=[248,caml_new_string("Sys_error"),-2], - Failure=[248,caml_new_string("Failure"),-3], - Invalid_argument=[248,caml_new_string("Invalid_argument"),-4], - End_of_file=[248,caml_new_string("End_of_file"),-5], - Division_by_zero=[248,caml_new_string("Division_by_zero"),-6], - Not_found=[248,caml_new_string("Not_found"),-7], - Match_failure=[248,caml_new_string("Match_failure"),-8], - Stack_overflow=[248,caml_new_string("Stack_overflow"),-9], - Sys_blocked_io=[248,caml_new_string("Sys_blocked_io"),-10], - Assert_failure=[248,caml_new_string("Assert_failure"),-11], - Undefined_recursive_module= - [248,caml_new_string("Undefined_recursive_module"),-12]; - caml_register_global - (11,Undefined_recursive_module,"Undefined_recursive_module"); - caml_register_global(10,Assert_failure,"Assert_failure"); - caml_register_global(9,Sys_blocked_io,"Sys_blocked_io"); - caml_register_global(8,Stack_overflow,"Stack_overflow"); - caml_register_global(7,Match_failure,"Match_failure"); - caml_register_global(6,Not_found,"Not_found"); - caml_register_global(5,Division_by_zero,"Division_by_zero"); - caml_register_global(4,End_of_file,"End_of_file"); - caml_register_global(3,Invalid_argument,"Invalid_argument"); - caml_register_global(2,Failure,"Failure"); - caml_register_global(1,Sys_error,"Sys_error"); - caml_register_global(0,Out_of_memory,"Out_of_memory"); - var - _f_=caml_new_string("output_substring"), - _n_=caml_new_string("String.blit / Bytes.blit_string"), - _m_=caml_new_string("Bytes.blit"), - _r_=caml_new_string(""), - _p_=caml_new_string("String.concat"), - _x_=caml_new_string("Buffer.add_substring/add_subbytes"), - _w_=caml_new_string("Buffer.add: cannot grow buffer"), - _ac_=[3,0,3], - _ad_=caml_new_string("."), - ___=caml_new_string(">"), - _$_=caml_new_string("<\/"), - _X_=caml_new_string(">"), - _Y_=caml_new_string("<"), - _U_=caml_new_string("\n"), - _B_=caml_new_string("Stdlib.Format.Empty_queue"), - _Q_=[0,caml_new_string("")], - _ao_=caml_new_string("Js_of_ocaml__Js.Error"), - _aF_=caml_new_string(":"), - _aE_=caml_new_string("}"), - _aG_=caml_new_string(","), - _aH_=caml_new_string("{"), - _aI_=caml_new_string("cannot parse json "), - _aB_=caml_new_string('"'), - _aC_=caml_new_string('"'), - _aN_=[0,caml_new_string("localhost")], - _aM_=caml_new_string("color is green"), - _aK_=caml_new_string("#3aa757"), - _aL_=caml_new_string("color"); - function _a_(_eH_){throw [0,Invalid_argument,_eH_]} - caml_fresh_oo_id(0); - var _b_=2147483647; - function _c_(_eD_,_eC_) - {var - _eE_=caml_ml_string_length(_eD_), - _eF_=caml_ml_string_length(_eC_), - _eG_=caml_create_bytes(_eE_ + _eF_ | 0); - caml_blit_string(_eD_,0,_eG_,0,_eE_); - caml_blit_string(_eC_,0,_eG_,_eE_,_eF_); - return caml_string_of_bytes(_eG_)} - caml_ml_open_descriptor_in(0); - var - _d_=caml_ml_open_descriptor_out(1), - _e_=caml_ml_open_descriptor_out(2), - _g_= - [0, - function(_eu_) - {function _ev_(_ew_) - {var _ex_=_ew_; - for(;;) - {if(_ex_) - {var _ey_=_ex_[2],_ez_=_ex_[1]; - try - {caml_ml_flush(_ez_)} - catch(_eB_) - {_eB_ = caml_wrap_exception(_eB_); - if(_eB_[1] !== Sys_error)throw _eB_; - var _eA_=_eB_} - var _ex_=_ey_; - continue} - return 0}} - return _ev_(caml_ml_out_channels_list(0))}]; - caml_sys_get_argv(0); - var _j_=(4 * caml_sys_const_max_wosize(0) | 0) - 1 | 0; - caml_fresh_oo_id(0); - typeof caml_sys_const_backend_type(0) === "number"; - function _k_(_er_,_eq_) - {if(_eq_) - {var _es_=_eq_[2],_et_=caml_call1(_er_,_eq_[1]); - return [0,_et_,_k_(_er_,_es_)]} - return 0} - function _q_(_el_,_ek_) - {if(_ek_) - {var _em_=caml_ml_string_length(_el_),_eb_=0,_ea_=_ek_,_en_=0; - for(;;) - {if(_ea_) - {var _ec_=_ea_[2],_ed_=_ea_[1]; - if(_ec_) - {var - _ee_=(caml_ml_string_length(_ed_) + _em_ | 0) + _eb_ | 0, - _ef_=_eb_ <= _ee_?_ee_:_a_(_p_), - _eb_=_ef_, - _ea_=_ec_; - continue} - var _eo_=caml_ml_string_length(_ed_) + _eb_ | 0} - else - var _eo_=_eb_; - var _ep_=caml_create_bytes(_eo_),_eh_=_en_,_eg_=_ek_; - for(;;) - {if(_eg_) - {var _ei_=_eg_[2],_ej_=_eg_[1]; - if(_ei_) - {caml_blit_string(_ej_,0,_ep_,_eh_,caml_ml_string_length(_ej_)); - caml_blit_string - (_el_,0,_ep_,_eh_ + caml_ml_string_length(_ej_) | 0,_em_); - var - _eh_=(_eh_ + caml_ml_string_length(_ej_) | 0) + _em_ | 0, - _eg_=_ei_; - continue} - caml_blit_string(_ej_,0,_ep_,_eh_,caml_ml_string_length(_ej_))} - return caml_string_of_bytes(_ep_)}}} - return _r_} - function _s_(_d5_) - {if(_d5_) - {var _d4_=0,_d3_=_d5_,_d6_=_d5_[2],_d7_=_d5_[1]; - for(;;) - {if(_d3_){var _d4_=_d4_ + 1 | 0,_d3_=_d3_[2];continue} - var _d8_=caml_make_vect(_d4_,_d7_),_d__=1,_d9_=_d6_; - for(;;) - {if(_d9_) - {var _d$_=_d9_[2]; - _d8_[1 + _d__] = _d9_[1]; - var _d__=_d__ + 1 | 0,_d9_=_d$_; - continue} - return _d8_}}} - return [0]} - caml_fresh_oo_id(0); - caml_fresh_oo_id(0); - var _y_=[0,0]; - function _z_(_d2_){_y_[1] = [0,_d2_,_y_[1]];return 0} - function _A_(_dZ_,_dY_) - {var _d0_=[0,_dZ_,0],_d1_=_dY_[1]; - return _d1_ - ?(_dY_[1] = _d0_,_d1_[2] = _d0_,0) - :(_dY_[1] = _d0_,_dY_[2] = _d0_,0)} - var _C_=[248,_B_,caml_fresh_oo_id(0)]; - function _D_(_dU_) - {var _dV_=_dU_[2]; - if(_dV_) - {var _dX_=_dV_[2],_dW_=_dV_[1]; - _dU_[2] = _dX_; - if(0 === _dX_)_dU_[1] = 0; - return _dW_} - throw _C_} - function _E_(_dT_,_dS_) - {_dT_[13] = _dT_[13] + _dS_[3] | 0;return _A_(_dS_,_dT_[28])} - var _F_=1000000010; - function _G_(_dR_,_dQ_) - {return caml_call3(_dR_[17],_dQ_,0,caml_ml_string_length(_dQ_))} - function _H_(_dP_){return caml_call1(_dP_[19],0)} - function _I_(_dL_,_dK_,_dJ_) - {_H_(_dL_); - _dL_[11] = 1; - var - _dM_=(_dL_[6] - _dJ_ | 0) + _dK_ | 0, - _dN_=_dL_[8], - _dO_=caml_lessequal(_dN_,_dM_)?_dN_:_dM_; - _dL_[10] = _dO_; - _dL_[9] = _dL_[6] - _dL_[10] | 0; - return caml_call1(_dL_[21],_dL_[10])} - function _J_(_dI_,_dH_){return _I_(_dI_,0,_dH_)} - function _K_(_dG_,_dF_) - {_dG_[9] = _dG_[9] - _dF_ | 0;return caml_call1(_dG_[20],_dF_)} - function _L_(_dy_) - {var _dz_=_dy_[2]; - if(_dz_) - {var _dA_=_dz_[1],_dB_=_dA_[2],_dC_=_dA_[1],_dD_=_dy_[9] < _dB_?1:0; - if(_dD_) - {if(0 !== _dC_)return 5 <= _dC_?0:_J_(_dy_,_dB_);var _dE_=0} - else - var _dE_=_dD_; - return _dE_} - return _H_(_dy_)} - function _M_(_dv_) - {var _dw_=_D_(_dv_[28]),_dx_=_dw_[1]; - _dv_[12] = _dv_[12] - _dw_[3] | 0; - _dv_[9] = _dv_[9] + _dx_ | 0; - return 0} - function _N_(_cQ_,_cP_,_cO_) - {if(typeof _cO_ === "number") - switch(_cO_) - {case 0: - var _cR_=_cQ_[3]; - if(_cR_) - {var - _cS_=_cR_[1][1], - _cT_= - function(_dm_,_dl_) - {if(_dl_) - {var _do_=_dl_[1],_dn_=_dl_[2]; - return caml_lessthan(_dm_,_do_) - ?[0,_dm_,_dl_] - :[0,_do_,_cT_(_dm_,_dn_)]} - return [0,_dm_,0]}; - _cS_[1] = _cT_(_cQ_[6] - _cQ_[9] | 0,_cS_[1]); - return 0} - return 0; - case 1:var _cU_=_cQ_[2];return _cU_?(_cQ_[2] = _cU_[2],0):0; - case 2:var _cV_=_cQ_[3];return _cV_?(_cQ_[3] = _cV_[2],0):0; - case 3:var _cW_=_cQ_[2];return _cW_?_J_(_cQ_,_cW_[1][2]):_H_(_cQ_); - case 4: - var _cX_=_cQ_[10] !== (_cQ_[6] - _cQ_[9] | 0)?1:0; - return _cX_?_M_(_cQ_):_cX_; - default: - var _cY_=_cQ_[5]; - if(_cY_) - {var _cZ_=_cY_[2]; - _G_(_cQ_,caml_call1(_cQ_[25],_cY_[1])); - _cQ_[5] = _cZ_; - return 0} - return 0} - else - switch(_cO_[0]) - {case 0: - var _c0_=_cO_[1]; - _cQ_[9] = _cQ_[9] - _cP_ | 0; - _G_(_cQ_,_c0_); - _cQ_[11] = 0; - return 0; - case 1: - var _c1_=_cO_[2],_c2_=_cO_[1],_c3_=_cQ_[2]; - if(_c3_) - {var _c4_=_c3_[1],_c5_=_c4_[2]; - switch(_c4_[1]) - {case 0:return _K_(_cQ_,_c2_); - case 1:return _I_(_cQ_,_c1_,_c5_); - case 2:return _I_(_cQ_,_c1_,_c5_); - case 3:return _cQ_[9] < _cP_?_I_(_cQ_,_c1_,_c5_):_K_(_cQ_,_c2_); - case 4: - return _cQ_[11] - ?_K_(_cQ_,_c2_) - :_cQ_[9] < _cP_ - ?_I_(_cQ_,_c1_,_c5_) - :((_cQ_[6] - _c5_ | 0) + _c1_ | 0) < _cQ_[10] - ?_I_(_cQ_,_c1_,_c5_) - :_K_(_cQ_,_c2_); - default:return _K_(_cQ_,_c2_)}} - return 0; - case 2: - var - _c8_=_cQ_[6] - _cQ_[9] | 0, - _c9_=_cQ_[3], - _c6_=_cO_[2], - _c7_=_cO_[1]; - if(_c9_) - {var - _c__=_c9_[1][1], - _c$_= - function(_dr_,_dq_) - {var _ds_=_dq_; - for(;;) - {if(_ds_) - {var _du_=_ds_[1],_dt_=_ds_[2]; - if(caml_greaterequal(_du_,_dr_))return _du_; - var _ds_=_dt_; - continue} - throw Not_found}}, - _da_=_c__[1]; - if(_da_) - {var _db_=_da_[1]; - try - {var _df_=_c$_(_c8_,_c__[1]),_dc_=_df_} - catch(_dp_) - {_dp_ = caml_wrap_exception(_dp_); - if(_dp_ !== Not_found)throw _dp_; - var _dc_=_db_} - var _dd_=_dc_} - else - var _dd_=_c8_; - var _de_=_dd_ - _c8_ | 0; - return 0 <= _de_ - ?_K_(_cQ_,_de_ + _c7_ | 0) - :_I_(_cQ_,_dd_ + _c6_ | 0,_cQ_[6])} - return 0; - case 3: - var _dg_=_cO_[2],_dh_=_cO_[1]; - if(_cQ_[8] < (_cQ_[6] - _cQ_[9] | 0))_L_(_cQ_); - var _di_=_cQ_[9] - _dh_ | 0,_dj_=1 === _dg_?1:_cQ_[9] < _cP_?_dg_:5; - _cQ_[2] = [0,[0,_dj_,_di_],_cQ_[2]]; - return 0; - case 4:_cQ_[3] = [0,_cO_[1],_cQ_[3]];return 0; - default: - var _dk_=_cO_[1]; - _G_(_cQ_,caml_call1(_cQ_[24],_dk_)); - _cQ_[5] = [0,_dk_,_cQ_[5]]; - return 0}} - function _O_(_cG_) - {for(;;) - {var _cE_=_cG_[28][2]; - if(_cE_) - {var - _cF_=_cE_[1], - _cH_=_cF_[1], - _cK_=_cH_ < 0?1:0, - _cI_=_cF_[3], - _cJ_=_cF_[2], - _cL_=_cK_?(_cG_[13] - _cG_[12] | 0) < _cG_[9]?1:0:_cK_, - _cM_=1 - _cL_; - if(_cM_) - {_D_(_cG_[28]); - var _cN_=0 <= _cH_?_cH_:_F_; - _N_(_cG_,_cN_,_cJ_); - _cG_[12] = _cI_ + _cG_[12] | 0; - continue} - return _cM_} - throw _C_}} - function _P_(_cB_) - {try - {var _cC_=_O_(_cB_);return _cC_} - catch(_cD_) - {_cD_ = caml_wrap_exception(_cD_);if(_cD_ === _C_)return 0;throw _cD_}} - var _R_=[0,[0,-1,[0,-1,_Q_,0]],0]; - function _S_(_cA_){_cA_[1] = _R_;return 0} - function _T_(_cq_,_cp_) - {var _cr_=_cq_[1]; - if(_cr_) - {var _cs_=_cr_[1],_ct_=_cs_[2],_cu_=_ct_[1],_cv_=_cr_[2],_cw_=_ct_[2]; - if(_cs_[1] < _cq_[12])return _S_(_cq_); - if(typeof _cw_ !== "number") - switch(_cw_[0]) - {case 3: - var - _cy_=1 - _cp_, - _cz_=_cy_?(_ct_[1] = _cq_[13] + _cu_ | 0,_cq_[1] = _cv_,0):_cy_; - return _cz_; - case 1: - case 2: - var - _cx_= - _cp_?(_ct_[1] = _cq_[13] + _cu_ | 0,_cq_[1] = _cv_,0):_cp_; - return _cx_ - } - return 0} - return 0} - var _l_=caml_create_bytes(80); - caml_fill_bytes(_l_,0,80,32); - var _o_=caml_string_of_bytes(_l_); - function _V_(_cm_,_cl_) - {var _cn_=_cl_; - for(;;) - {var _co_=0 < _cn_?1:0; - if(_co_) - {if(80 < _cn_) - {caml_call3(_cm_[17],_o_,0,80);var _cn_=_cn_ - 80 | 0;continue} - return caml_call3(_cm_[17],_o_,0,_cn_)} - return _co_}} - function _W_(_ck_){return _c_(_Y_,_c_(_ck_,_X_))} - function _Z_(_cj_){return _c_(_$_,_c_(_cj_,___))} - function _aa_(_ci_){return 0} - function _ab_(_ch_){return 0} - function _ae_(_b9_,_b8_) - {function _b__(_cg_){return 0} - function _b$_(_cf_){return 0} - var _b5_=[0,0,0],_b6_=[0,-1,_ac_,0]; - function _ca_(_ce_){return 0} - _A_(_b6_,_b5_); - var - _b7_= - [0, - [0,[0,1,_b6_],_R_], - 0, - 0, - 0, - 0, - 78, - 10, - 68, - 78, - 0, - 1, - 1, - 1, - 1, - _b_, - _ad_, - _b9_, - _b8_, - _ca_, - _b$_, - _b__, - 0, - 0, - _W_, - _Z_, - _aa_, - _ab_, - _b5_]; - _b7_[19] = function(_cd_){return caml_call3(_b7_[17],_U_,0,1)}; - _b7_[20] = function(_cc_){return _V_(_b7_,_cc_)}; - _b7_[21] = function(_cb_){return _V_(_b7_,_cb_)}; - return _b7_} - function _af_(_bZ_) - {function _b0_(_b4_){return caml_ml_flush(_bZ_)} - return _ae_ - (function(_b1_,_b2_,_b3_) - {if(0 <= _b2_) - if(0 <= _b3_) - if(! ((caml_ml_string_length(_b1_) - _b3_ | 0) < _b2_)) - return caml_ml_output(_bZ_,_b1_,_b2_,_b3_); - return _a_(_f_)}, - _b0_)} - var - _ah_=512, - _t_=_j_ < 512?_j_:_ah_, - _u_=caml_create_bytes(_t_), - _v_=[0,_u_,0,_t_,_u_], - _ai_=_af_(_d_); - _af_(_e_); - function _ag_(_bY_){return 0} - _ae_ - (function(_bV_,_bW_,_bX_) - {var _bP_=_bW_ < 0?1:0; - if(_bP_) - var _bQ_=_bP_; - else - var - _bU_=_bX_ < 0?1:0, - _bQ_=_bU_ || ((caml_ml_string_length(_bV_) - _bX_ | 0) < _bW_?1:0); - if(_bQ_)_a_(_x_); - var _bR_=_v_[2] + _bX_ | 0; - if(_v_[3] < _bR_) - {var _bL_=[0,_v_[3]]; - for(;;) - {if(_bL_[1] < (_v_[2] + _bX_ | 0)) - {_bL_[1] = 2 * _bL_[1] | 0;continue} - if(_j_ < _bL_[1]) - {if(! ((_v_[2] + _bX_ | 0) <= _j_))throw [0,Failure,_w_]; - _bL_[1] = _j_} - var - _bM_=caml_create_bytes(_bL_[1]), - _bN_=_v_[2], - _bO_=_v_[1], - switch$0= - 0 <= _bN_ - ?(caml_ml_bytes_length(_bO_) - _bN_ | 0) < 0 - ?0 - :(caml_ml_bytes_length(_bM_) - _bN_ | 0) < 0 - ?0 - :(caml_blit_bytes(_bO_,0,_bM_,0,_bN_),1) - :0; - if(! switch$0)_a_(_m_); - _v_[1] = _bM_; - _v_[3] = _bL_[1]; - break}} - var - _bS_=_v_[2], - _bT_=_v_[1], - switch$1= - 0 <= _bX_ - ?0 <= _bW_ - ?(caml_ml_string_length(_bV_) - _bX_ | 0) < _bW_ - ?0 - :0 <= _bS_ - ?(caml_ml_bytes_length(_bT_) - _bX_ | 0) < _bS_ - ?0 - :(caml_blit_string(_bV_,_bW_,_bT_,_bS_,_bX_),1) - :0 - :0 - :0; - if(! switch$1)_a_(_n_); - _v_[2] = _bR_; - return 0}, - _ag_); - var _i_=[0,0],_h_=_g_[1]; - _g_[1] - = - function(_bA_) - {if(1 - _i_[1]) - {_i_[1] = 1; - var _bB_=_ai_[4]; - for(;;) - {if(_bB_) - {var _bC_=_bB_[2]; - if(_ai_[23])_E_(_ai_,[0,0,5,0]); - if(_ai_[22]) - {var _bJ_=_ai_[4]; - if(_bJ_) - {var _bK_=_bJ_[2]; - caml_call1(_ai_[27],_bJ_[1]); - _ai_[4] = _bK_; - var switch$0=1} - else - var switch$0=0} - else - var switch$0=0; - var _bB_=_bC_; - continue} - for(;;) - {if(1 < _ai_[14]) - {if(1 < _ai_[14]) - {if(_ai_[14] < _ai_[15]) - {_E_(_ai_,[0,0,1,0]);_T_(_ai_,1);_T_(_ai_,0)} - _ai_[14] = _ai_[14] - 1 | 0} - continue} - _ai_[13] = _F_; - _P_(_ai_); - _ai_[12] = 1; - _ai_[13] = 1; - var _bD_=_ai_[28]; - _bD_[1] = 0; - _bD_[2] = 0; - _S_(_ai_); - _ai_[2] = 0; - _ai_[3] = 0; - _ai_[4] = 0; - _ai_[5] = 0; - _ai_[10] = 0; - _ai_[14] = 0; - _ai_[9] = _ai_[6]; - _ai_[14] = _ai_[14] + 1 | 0; - var _bH_=3,_bI_=0; - if(_ai_[14] < _ai_[15]) - {var _bF_=[0,- _ai_[13] | 0,[3,_bI_,_bH_],0]; - _E_(_ai_,_bF_); - _ai_[1] = [0,[0,_ai_[13],_bF_],_ai_[1]]} - else - if(_ai_[14] === _ai_[15]) - {var _bG_=_ai_[16],_bE_=caml_ml_string_length(_bG_); - _E_(_ai_,[0,_bE_,[0,_bG_],_bE_]); - _P_(_ai_)} - caml_call1(_ai_[18],0); - break} - break}} - return caml_call1(_h_,0)}; - var _ak_=joo_global_object,_al_=undefined; - function _am_(_bz_){return _bz_?_bz_[1]:_al_} - var - _an_=_ak_.Array, - _ap_=[248,_ao_,caml_fresh_oo_id(0)], - _aq_=[0,_ap_,{}], - _aj_=caml_obj_tag(_aq_) === 248?_aq_:_aq_[1]; - caml_register_named_value(caml_new_string("jsError"),_aj_); - (function(exn){throw exn}); - var _ar_=_ak_.JSON; - _z_ - (function(_by_) - {return _by_[1] === _ap_?[0,caml_js_to_string(_by_[2].toString())]:0}); - _z_ - (function(_bx_) - {return _bx_ instanceof _an_?0:[0,caml_js_to_string(_bx_.toString())]}); - caml_fresh_oo_id(0); - _ak_.HTMLElement === _al_; - var _as_=caml_js_get_console(0); - function _at_(_bw_){return caml_js_from_array(_s_(_bw_))} - function _au_(_bu_,_bt_) - {var _bv_=_s_(_bt_),_bm_=_bv_.length - 1; - if(0 === _bm_) - var _bs_=[0]; - else - {var - _bn_=caml_make_vect(_bm_,caml_call1(_bu_,_bv_[1])), - _bp_=_bm_ - 1 | 0, - _bo_=1; - if(! (_bp_ < 1)) - {var _bq_=_bo_; - for(;;) - {_bn_[1 + _bq_] = caml_call1(_bu_,_bv_[1 + _bq_]); - var _br_=_bq_ + 1 | 0; - if(_bp_ !== _bq_){var _bq_=_br_;continue} - break}} - var _bs_=_bn_} - return caml_js_from_array(_bs_)} - function _av_(_bl_,_bk_){return _bk_?caml_call1(_bl_,_bk_[1]):_al_} - function _aw_(_bj_){return _as_.log(_bj_.toString())} - var - _az_=chrome.declarativeContent, - _ax_=chrome.runtime, - _ay_=chrome.storage.sync; - function _aA_(_bi_){return _c_(_aC_,_c_(_bi_,_aB_))} - function _aD_(_bc_) - {var - _bd_= - _c_ - (_aH_, - _c_ - (_q_ - (_aG_, - _k_ - (function(_bg_) - {var _bh_=_c_(_aF_,_bg_[2]);return _c_(_aA_(_bg_[1]),_bh_)}, - _bc_)), - _aE_)); - try - {var _be_=_ar_.parse(_bd_.toString());return _be_} - catch(_bf_){_aw_(_c_(_aI_,_bd_));return {}}} - function _aJ_(_aR_) - {var _aS_=_aD_([0,[0,_aL_,_aA_(_aK_)],0]); - _ay_.set - (_aS_, - _av_(caml_js_wrap_callback,[0,function(_bb_){return _aw_(_aM_)}])); - var - _aT_=0, - _aO_= - caml_js_wrap_callback - (function(_a3_) - {var _aV_={}; - _aV_.hostContains = _av_(caml_js_from_string,0); - _aV_.hostEquals = _av_(caml_js_from_string,_aN_); - _aV_.hostPrefix = _av_(caml_js_from_string,0); - _aV_.hostSuffix = _av_(caml_js_from_string,0); - _aV_.pathContains = _av_(caml_js_from_string,0); - _aV_.pathPrefix = _av_(caml_js_from_string,0); - _aV_.pathSuffix = _av_(caml_js_from_string,0); - _aV_.queryContains = _av_(caml_js_from_string,0); - _aV_.queryEquals = _av_(caml_js_from_string,0); - _aV_.queryPrefix = _av_(caml_js_from_string,0); - _aV_.querySuffix = _av_(caml_js_from_string,0); - _aV_.urlContains = _av_(caml_js_from_string,0); - _aV_.urlEquals = _av_(caml_js_from_string,0); - _aV_.urlMatches = _av_(caml_js_from_string,0); - _aV_.originAndPathMatches = _av_(caml_js_from_string,0); - _aV_.urlPrefix = _av_(caml_js_from_string,0); - _aV_.urlSuffix = _av_(caml_js_from_string,0); - var _a4_=0,_a5_=0,_a6_=0,_a7_=0,_aW_=caml_js_from_string; - _aV_.schemes = _av_(function(_ba_){return _au_(_aW_,_ba_)},_a7_); - _aV_.ports = _am_(_a6_); - var _aX_={}; - _aX_.pageUrl = _am_([0,_aV_]); - var _aY_=caml_js_from_string; - _aX_.css = _av_(function(_a$_){return _au_(_aY_,_a$_)},_a5_); - _aX_.isBookmarked = _av_(caml_js_from_bool,_a4_); - var - _aZ_=new (_az_.PageStateMatcher)(_aX_), - _a0_={}, - _a8_=[0,new (_az_.ShowPageAction)(),0]; - _a0_.conditions = _at_([0,_aZ_,0]); - _a0_.actions = _at_(_a8_); - _a0_.priority = _am_(0); - _a0_.id = _av_(caml_js_from_string,0); - var - _a9_=[0,_a0_,0], - _a1_=caml_js_wrap_callback(function(_a__){return 0}), - _a2_=_at_(_a9_); - return _az_.onPageChanged.addRules(_a2_,_a1_)}), - _aP_=caml_js_from_string, - _aQ_=_av_(function(_aU_){return _au_(_aP_,_aU_)},_aT_); - return _az_.onPageChanged.removeRules(_aQ_,_aO_)} - _ax_.onInstalled.addListener(_aJ_); - caml_call1(_g_[1],0); - return} - (function(){return this}())); diff --git a/examples/chrome-extension/chrome-example.js b/examples/chrome-extension/chrome-example.js deleted file mode 100644 index 50ed535..0000000 --- a/examples/chrome-extension/chrome-example.js +++ /dev/null @@ -1,1985 +0,0 @@ -// Generated by js_of_ocaml 3.5.2 -(function(joo_global_object) - {"use strict"; - function raw_array_sub(a,i,l) - {var b=new Array(l);for(var j=0;j < l;j++)b[j] = a[i + j];return b} - function caml_subarray_to_string(a,i,len) - {var f=String.fromCharCode; - if(i == 0 && len <= 4096 && len == a.length)return f.apply(null,a); - var s=""; - for(;0 < len;i += 1024,len -= 1024) - s += f.apply(null,raw_array_sub(a,i,Math.min(len,1024))); - return s} - function caml_convert_string_to_array(s) - {if(joo_global_object.Uint8Array) - var a=new (joo_global_object.Uint8Array)(s.l); - else - var a=new Array(s.l); - var b=s.c,l=b.length,i=0; - for(;i < l;i++)a[i] = b.charCodeAt(i); - for(l = s.l;i < l;i++)a[i] = 0; - s.c = a; - s.t = 4; - return a} - function caml_blit_bytes(s1,i1,s2,i2,len) - {if(len == 0)return 0; - if(i2 == 0 && (len >= s2.l || s2.t == 2 && len >= s2.c.length)) - {s2.c - = - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - if(s2.t == 2 && i2 == s2.c.length) - {s2.c - += - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - {if(s2.t != 4)caml_convert_string_to_array(s2); - var c1=s1.c,c2=s2.c; - if(s1.t == 4) - if(i2 <= i1) - for(var i=0;i < len;i++)c2[i2 + i] = c1[i1 + i]; - else - for(var i=len - 1;i >= 0;i--)c2[i2 + i] = c1[i1 + i]; - else - {var l=Math.min(len,c1.length - i1); - for(var i=0;i < l;i++)c2[i2 + i] = c1.charCodeAt(i1 + i); - for(;i < len;i++)c2[i2 + i] = 0}} - return 0} - function caml_blit_string(s1,i1,s2,i2,len) - {return caml_blit_bytes(s1,i1,s2,i2,len)} - function raw_array_append_one(a,x) - {var l=a.length,b=new Array(l + 1),i=0; - for(;i < l;i++)b[i] = a[i]; - b[i] = x; - return b} - function caml_call_gen(f,args) - {if(f.fun)return caml_call_gen(f.fun,args); - var n=f.length,argsLen=args.length,d=n - argsLen; - if(d == 0) - return f.apply(null,args); - else - if(d < 0) - return caml_call_gen - (f.apply(null,raw_array_sub(args,0,n)), - raw_array_sub(args,n,argsLen - n)); - else - return function(x) - {return caml_call_gen(f,raw_array_append_one(args,x))}} - function caml_str_repeat(n,s) - {if(n == 0)return ""; - if(s.repeat)return s.repeat(n); - var r="",l=0; - if(n == 0)return r; - for(;;) - {if(n & 1)r += s; - n >>= 1; - if(n == 0)return r; - s += s; - l++; - if(l == 9)s.slice(0,1)}} - function caml_convert_string_to_bytes(s) - {if(s.t == 2) - s.c += caml_str_repeat(s.l - s.c.length,"\0"); - else - s.c = caml_subarray_to_string(s.c,0,s.c.length); - s.t = 0} - function caml_is_ascii(s) - {if(s.length < 24) - {for(var i=0;i < s.length;i++)if(s.charCodeAt(i) > 127)return false; - return true} - else - return ! /[^\x00-\x7f]/.test(s)} - function caml_utf16_of_utf8(s) - {for(var b="",t="",c,c1,c2,v,i=0,l=s.length;i < l;i++) - {c1 = s.charCodeAt(i); - if(c1 < 0x80) - {for(var j=i + 1;j < l && (c1 = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - v = 1; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c1 << 6); - if(c1 < 0xe0) - {v = c - 0x3080;if(v < 0x80)v = 1} - else - {v = 2; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c << 6); - if(c1 < 0xf0) - {v = c - 0xe2080; - if(v < 0x800 || v >= 0xd7ff && v < 0xe000)v = 2} - else - {v = 3; - if - (++i - < - l - && - ((c2 = s.charCodeAt(i)) & - 64) - == - 128 - && - c1 - < - 0xf5) - {v = c2 - 0x3c82080 + (c << 6); - if(v < 0x10000 || v > 0x10ffff)v = 3}}}}} - if(v < 4) - {i -= v;t += "\ufffd"} - else - if(v > 0xffff) - t += String.fromCharCode(0xd7c0 + (v >> 10),0xdc00 + (v & 0x3FF)); - else - t += String.fromCharCode(v); - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_to_js_string(s) - {switch(s.t) - {case 9:return s.c; - default:caml_convert_string_to_bytes(s);case 0: - if(caml_is_ascii(s.c)){s.t = 9;return s.c}s.t = 8; - case 8:return caml_utf16_of_utf8(s.c) - }} - function MlBytes(tag,contents,length) - {this.t = tag;this.c = contents;this.l = length} - MlBytes.prototype.toString = function(){return caml_to_js_string(this)}; - MlBytes.prototype.slice - = - function() - {var content=this.t == 4?this.c.slice():this.c; - return new MlBytes(this.t,content,this.l)}; - function caml_raise_with_arg(tag,arg){throw [0,tag,arg]} - function caml_new_string(s){return new MlBytes(0,s,s.length)} - function caml_raise_with_string(tag,msg) - {caml_raise_with_arg(tag,caml_new_string(msg))} - var caml_global_data=[0]; - function caml_invalid_argument(msg) - {caml_raise_with_string(caml_global_data.Invalid_argument,msg)} - function caml_create_bytes(len) - {if(len < 0)caml_invalid_argument("Bytes.create"); - return new MlBytes(len?2:9,"",len)} - function caml_fill_bytes(s,i,l,c) - {if(l > 0) - if(i == 0 && (l >= s.l || s.t == 2 && l >= s.c.length)) - if(c == 0) - {s.c = "";s.t = 2} - else - {s.c = caml_str_repeat(l,String.fromCharCode(c));s.t = l == s.l?0:2} - else - {if(s.t != 4)caml_convert_string_to_array(s); - for(l += i;i < l;i++)s.c[i] = c} - return 0} - var caml_oo_last_id=0; - function caml_fresh_oo_id(){return caml_oo_last_id++} - function caml_failwith(msg) - {caml_raise_with_string(caml_global_data.Failure,msg)} - if(joo_global_object.process && joo_global_object.process.cwd) - var caml_current_dir=joo_global_object.process.cwd().replace(/\\/g,"/"); - else - var caml_current_dir="/static"; - if(caml_current_dir.slice(- 1) !== "/")caml_current_dir += "/"; - function caml_make_path(name) - {name = name instanceof MlBytes?name.toString():name; - if(name.charCodeAt(0) != 47)name = caml_current_dir + name; - var comp=name.split("/"),ncomp=[]; - for(var i=0;i < comp.length;i++) - switch(comp[i]) - {case "..":if(ncomp.length > 1)ncomp.pop();break; - case ".":break; - case "":if(ncomp.length == 0)ncomp.push("");break; - default:ncomp.push(comp[i]);break} - ncomp.orig = name; - return ncomp} - function caml_raise_sys_error(msg) - {caml_raise_with_string(caml_global_data.Sys_error,msg)} - function caml_raise_no_such_file(name) - {name = name instanceof MlBytes?name.toString():name; - caml_raise_sys_error(name + ": No such file or directory")} - function caml_string_of_array(a){return new MlBytes(4,a,a.length)} - function caml_string_bound_error() - {caml_invalid_argument("index out of bounds")} - function caml_bytes_unsafe_get(s,i) - {switch(s.t & 6) - {default:if(i >= s.c.length)return 0;case 0:return s.c.charCodeAt(i); - case 4:return s.c[i] - }} - function caml_bytes_get(s,i) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_get(s,i)} - function caml_ml_bytes_length(s){return s.l} - function MlFile(){} - function MlFakeFile(content){this.data = content} - MlFakeFile.prototype = new MlFile(); - MlFakeFile.prototype.truncate - = - function(len) - {var old=this.data; - this.data = caml_create_bytes(len | 0); - caml_blit_bytes(old,0,this.data,0,len)}; - MlFakeFile.prototype.length - = - function(){return caml_ml_bytes_length(this.data)}; - MlFakeFile.prototype.write - = - function(offset,buf,pos,len) - {var clen=this.length(); - if(offset + len >= clen) - {var new_str=caml_create_bytes(offset + len),old_data=this.data; - this.data = new_str; - caml_blit_bytes(old_data,0,this.data,0,clen)} - caml_blit_bytes(buf,pos,this.data,offset,len); - return 0}; - MlFakeFile.prototype.read - = - function(offset,buf,pos,len) - {var clen=this.length(); - caml_blit_bytes(this.data,offset,buf,pos,len); - return 0}; - MlFakeFile.prototype.read_one - = - function(offset){return caml_bytes_get(this.data,offset)}; - MlFakeFile.prototype.close = function(){}; - MlFakeFile.prototype.constructor = MlFakeFile; - function MlFakeDevice(root,f) - {this.content = {};this.root = root;this.lookupFun = f} - MlFakeDevice.prototype.nm = function(name){return this.root + name}; - MlFakeDevice.prototype.lookup - = - function(name) - {if(! this.content[name] && this.lookupFun) - {var - res= - this.lookupFun(caml_new_string(this.root),caml_new_string(name)); - if(res !== 0)this.content[name] = new MlFakeFile(res[1])}}; - MlFakeDevice.prototype.exists - = - function(name) - {if(name == "")return 1; - var name_slash=name + "/",r=new RegExp("^" + name_slash); - for(var n in this.content)if(n.match(r))return 1; - this.lookup(name); - return this.content[name]?1:0}; - MlFakeDevice.prototype.readdir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - seen={}, - a=[]; - for(var n in this.content) - {var m=n.match(r); - if(m && ! seen[m[1]]){seen[m[1]] = true;a.push(m[1])}} - return a}; - MlFakeDevice.prototype.is_dir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - a=[]; - for(var n in this.content){var m=n.match(r);if(m)return 1} - return 0}; - MlFakeDevice.prototype.unlink - = - function(name) - {var ok=this.content[name]?true:false; - delete this.content[name]; - return ok}; - MlFakeDevice.prototype.open - = - function(name,f) - {if(f.rdonly && f.wronly) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_text and Open_binary are not compatible"); - this.lookup(name); - if(this.content[name]) - {if(this.is_dir(name)) - caml_raise_sys_error(this.nm(name) + " : is a directory"); - if(f.create && f.excl) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - var file=this.content[name]; - if(f.truncate)file.truncate(); - return file} - else - if(f.create) - {this.content[name] = new MlFakeFile(caml_create_bytes(0)); - return this.content[name]} - else - caml_raise_no_such_file(this.nm(name))}; - MlFakeDevice.prototype.register - = - function(name,content) - {if(this.content[name]) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - if(content instanceof MlBytes) - this.content[name] = new MlFakeFile(content); - else - if(content instanceof Array) - this.content[name] = new MlFakeFile(caml_string_of_array(content)); - else - if(content.toString) - {var mlstring=caml_new_string(content.toString()); - this.content[name] = new MlFakeFile(mlstring)}}; - MlFakeDevice.prototype.constructor = MlFakeDevice; - function caml_array_of_string(s) - {if(s.t != 4)caml_convert_string_to_array(s);return s.c} - function caml_bytes_unsafe_set(s,i,c) - {c &= 0xff; - if(s.t != 4) - {if(i == s.c.length) - {s.c += String.fromCharCode(c);if(i + 1 == s.l)s.t = 0;return 0} - caml_convert_string_to_array(s)} - s.c[i] = c; - return 0} - function caml_bytes_set(s,i,c) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_set(s,i,c)} - var Buffer=joo_global_object.Buffer; - function MlNodeFile(fd){this.fs = require("fs");this.fd = fd} - MlNodeFile.prototype = new MlFile(); - MlNodeFile.prototype.truncate - = - function(len){this.fs.ftruncateSync(this.fd,len | 0)}; - MlNodeFile.prototype.length - = - function(){return this.fs.fstatSync(this.fd).size}; - MlNodeFile.prototype.write - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.writeSync(this.fd,buffer,buf_offset,len,offset); - return 0}; - MlNodeFile.prototype.read - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,buf_offset,len,offset); - for(var i=0;i < len;i++) - caml_bytes_set(buf,buf_offset + i,buffer[buf_offset + i]); - return 0}; - MlNodeFile.prototype.read_one - = - function(offset) - {var a=new (joo_global_object.Uint8Array)(1),buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,0,1,offset); - return buffer[0]}; - MlNodeFile.prototype.close = function(){this.fs.closeSync(this.fd)}; - MlNodeFile.prototype.constructor = MlNodeFile; - function MlNodeDevice(root){this.fs = require("fs");this.root = root} - MlNodeDevice.prototype.nm = function(name){return this.root + name}; - MlNodeDevice.prototype.exists - = - function(name){return this.fs.existsSync(this.nm(name))?1:0}; - MlNodeDevice.prototype.readdir - = - function(name){return this.fs.readdirSync(this.nm(name))}; - MlNodeDevice.prototype.is_dir - = - function(name){return this.fs.statSync(this.nm(name)).isDirectory()?1:0}; - MlNodeDevice.prototype.unlink - = - function(name) - {var b=this.fs.existsSync(this.nm(name))?1:0; - this.fs.unlinkSync(this.nm(name)); - return b}; - MlNodeDevice.prototype.open - = - function(name,f) - {var consts=require("constants"),res=0; - for(var key in f) - switch(key) - {case "rdonly":res |= consts.O_RDONLY;break; - case "wronly":res |= consts.O_WRONLY;break; - case "append":res |= consts.O_WRONLY | consts.O_APPEND;break; - case "create":res |= consts.O_CREAT;break; - case "truncate":res |= consts.O_TRUNC;break; - case "excl":res |= consts.O_EXCL;break; - case "binary":res |= consts.O_BINARY;break; - case "text":res |= consts.O_TEXT;break; - case "nonblock":res |= consts.O_NONBLOCK;break - } - var fd=this.fs.openSync(this.nm(name),res); - return new MlNodeFile(fd)}; - MlNodeDevice.prototype.rename - = - function(o,n){this.fs.renameSync(this.nm(o),this.nm(n))}; - MlNodeDevice.prototype.constructor = MlNodeDevice; - var caml_root=caml_current_dir.match(/[^\/]*\//)[0]; - function fs_node_supported() - {return typeof joo_global_object.process - !== - "undefined" - && - typeof joo_global_object.process.versions - !== - "undefined" - && - typeof joo_global_object.process.versions.node - !== - "undefined" - && - joo_global_object.process.platform - !== - "browser"} - var jsoo_mount_point=[]; - if(fs_node_supported()) - jsoo_mount_point.push - ({path:caml_root,device:new MlNodeDevice(caml_root)}); - else - jsoo_mount_point.push - ({path:caml_root,device:new MlFakeDevice(caml_root)}); - jsoo_mount_point.push - ({path:caml_root + "static/", - device:new MlFakeDevice(caml_root + "static/")}); - function resolve_fs_device(name) - {var - path=caml_make_path(name), - name=path.join("/"), - name_slash=name + "/", - res; - for(var i=0;i < jsoo_mount_point.length;i++) - {var m=jsoo_mount_point[i]; - if - (name_slash.search(m.path) - == - 0 - && - (! res || res.path.length < m.path.length)) - res - = - {path:m.path, - device:m.device, - rest:name.substring(m.path.length,name.length)}} - return res} - function caml_create_file(name,content) - {var root=resolve_fs_device(name); - if(! root.device.register)caml_failwith("cannot register file"); - root.device.register(root.rest,content); - return 0} - function caml_fs_init() - {var tmp=joo_global_object.caml_fs_tmp; - if(tmp) - for(var i=0;i < tmp.length;i++) - caml_create_file(tmp[i].name,tmp[i].content); - joo_global_object.caml_create_file = caml_create_file; - joo_global_object.caml_fs_tmp = []; - return 0} - var log2_ok=Math.log2 && Math.log2(1.1235582092889474E+307) == 1020; - function jsoo_floor_log2(x) - {if(log2_ok)return Math.floor(Math.log2(x)); - var i=0; - if(x == 0)return - Infinity; - if(x >= 1)while(x >= 2){x /= 2;i++}else while(x < 1){x *= 2;i--} - return i} - function caml_int32_bits_of_float(x) - {var float32a=new (joo_global_object.Float32Array)(1); - float32a[0] = x; - var int32a=new (joo_global_object.Int32Array)(float32a.buffer); - return int32a[0] | 0} - function caml_int64_create_lo_mi_hi(lo,mi,hi){return [255,lo,mi,hi]} - function caml_int64_bits_of_float(x) - {if(! isFinite(x)) - {if(isNaN(x))return caml_int64_create_lo_mi_hi(1,0,0x7ff0); - return x > 0 - ?caml_int64_create_lo_mi_hi(0,0,0x7ff0) - :caml_int64_create_lo_mi_hi(0,0,0xfff0)} - var sign=x == 0 && 1 / x == - Infinity?0x8000:x >= 0?0:0x8000; - if(sign)x = - x; - var exp=jsoo_floor_log2(x) + 1023; - if(exp <= 0) - {exp = 0;x /= Math.pow(2,- 1026)} - else - {x /= Math.pow(2,exp - 1027); - if(x < 16){x *= 2;exp -= 1} - if(exp == 0)x /= 2} - var k=Math.pow(2,24),r3=x | 0; - x = (x - r3) * k; - var r2=x | 0; - x = (x - r2) * k; - var r1=x | 0; - r3 = r3 & 0xf | sign | exp << 4; - return caml_int64_create_lo_mi_hi(r1,r2,r3)} - function caml_int64_to_bytes(x) - {return [x[3] >> 8, - x[3] & 0xff, - x[2] >> 16, - x[2] >> 8 & 0xff, - x[2] & 0xff, - x[1] >> 16, - x[1] >> 8 & 0xff, - x[1] & 0xff]} - function caml_ba_serialize(writer,ba,sz) - {writer.write(32,ba.dims.length); - writer.write(32,ba.kind | ba.layout << 8); - for(var i=0;i < ba.dims.length;i++)writer.write(32,ba.dims[i]); - switch(ba.kind) - {case 2: - case 3: - case 12: - for(var i=0;i < ba.data.length;i++)writer.write(8,ba.data[i]);break; - case 4: - case 5: - for(var i=0;i < ba.data.length;i++)writer.write(16,ba.data[i]);break; - case 6: - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]);break; - case 8: - case 9: - writer.write(8,0); - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]); - break; - case 7: - for(var i=0;i < ba.data.length / 2;i++) - {var b=caml_int64_to_bytes(ba.get(i)); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 1: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i))); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 0: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int32_bits_of_float(ba.get(i));writer.write(32,b)} - break; - case 10: - for(var i=0;i < ba.data.length / 2;i++) - {var j=ba.get(i); - writer.write(32,caml_int32_bits_of_float(j[1])); - writer.write(32,caml_int32_bits_of_float(j[2]))} - break; - case 11: - for(var i=0;i < ba.data.length / 2;i++) - {var - complex=ba.get(i), - b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[1])); - for(var j=0;j < 8;j++)writer.write(8,b[j]); - var b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[2])); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break - } - sz[0] = (4 + ba.dims.length) * 4; - sz[1] = (4 + ba.dims.length) * 8} - function caml_ba_get_size_per_element(kind) - {switch(kind){case 7:case 10:case 11:return 2;default:return 1}} - function caml_ba_create_buffer(kind,size) - {var g=joo_global_object,view; - switch(kind) - {case 0:view = g.Float32Array;break; - case 1:view = g.Float64Array;break; - case 2:view = g.Int8Array;break; - case 3:view = g.Uint8Array;break; - case 4:view = g.Int16Array;break; - case 5:view = g.Uint16Array;break; - case 6:view = g.Int32Array;break; - case 7:view = g.Int32Array;break; - case 8:view = g.Int32Array;break; - case 9:view = g.Int32Array;break; - case 10:view = g.Float32Array;break; - case 11:view = g.Float64Array;break; - case 12:view = g.Uint8Array;break - } - if(! view)caml_invalid_argument("Bigarray.create: unsupported kind"); - var data=new view(size * caml_ba_get_size_per_element(kind)); - return data} - function caml_int32_float_of_bits(x) - {var int32a=new (joo_global_object.Int32Array)(1); - int32a[0] = x; - var float32a=new (joo_global_object.Float32Array)(int32a.buffer); - return float32a[0]} - function caml_int64_of_bytes(a) - {return [255, - a[7] | a[6] << 8 | a[5] << 16, - a[4] | a[3] << 8 | a[2] << 16, - a[1] | a[0] << 8]} - function caml_int64_float_of_bits(x) - {var lo=x[1],mi=x[2],hi=x[3],exp=(hi & 0x7fff) >> 4; - if(exp == 2047) - return (lo | mi | hi & 0xf) == 0?hi & 0x8000?- Infinity:Infinity:NaN; - var k=Math.pow(2,- 24),res=(lo * k + mi) * k + (hi & 0xf); - if(exp > 0) - {res += 16;res *= Math.pow(2,exp - 1027)} - else - res *= Math.pow(2,- 1026); - if(hi & 0x8000)res = - res; - return res} - function caml_ba_get_size(dims) - {var n_dims=dims.length,size=1; - for(var i=0;i < n_dims;i++) - {if(dims[i] < 0) - caml_invalid_argument("Bigarray.create: negative dimension"); - size = size * dims[i]} - return size} - function caml_int64_create_lo_hi(lo,hi) - {return [255, - lo & 0xffffff, - lo >>> 24 & 0xff | (hi & 0xffff) << 8, - hi >>> 16 & 0xffff]} - function caml_int64_hi32(v){return v[2] >>> 8 & 0xffff | v[3] << 16} - function caml_int64_lo32(v){return v[1] | (v[2] & 0xff) << 24} - function caml_array_bound_error() - {caml_invalid_argument("index out of bounds")} - function Ml_Bigarray(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray.prototype.caml_custom = "_bigarray"; - Ml_Bigarray.prototype.offset - = - function(arg) - {var ofs=0; - if(typeof arg === "number")arg = [arg]; - if(! (arg instanceof Array)) - caml_invalid_argument("bigarray.js: invalid offset"); - if(this.dims.length != arg.length) - caml_invalid_argument("Bigarray.get/set: bad number of dimensions"); - if(this.layout == 0) - for(var i=0;i < this.dims.length;i++) - {if(arg[i] < 0 || arg[i] >= this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + arg[i]} - else - for(var i=this.dims.length - 1;i >= 0;i--) - {if(arg[i] < 1 || arg[i] > this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + (arg[i] - 1)} - return ofs}; - Ml_Bigarray.prototype.get - = - function(ofs) - {switch(this.kind) - {case 7: - var l=this.data[ofs * 2 + 0],h=this.data[ofs * 2 + 1]; - return caml_int64_create_lo_hi(l,h); - case 10: - case 11: - var r=this.data[ofs * 2 + 0],i=this.data[ofs * 2 + 1]; - return [254,r,i]; - default:return this.data[ofs]}}; - Ml_Bigarray.prototype.set - = - function(ofs,v) - {switch(this.kind) - {case 7: - this.data[ofs * 2 + 0] = caml_int64_lo32(v); - this.data[ofs * 2 + 1] = caml_int64_hi32(v); - break; - case 10: - case 11: - this.data[ofs * 2 + 0] = v[1];this.data[ofs * 2 + 1] = v[2];break; - default:this.data[ofs] = v;break} - return 0}; - Ml_Bigarray.prototype.fill - = - function(v) - {switch(this.kind) - {case 7: - var a=caml_int64_lo32(v),b=caml_int64_hi32(v); - if(a == b) - this.data.fill(a); - else - for(var i=0;i < this.data.length;i++)this.data[i] = i % 2 == 0?a:b; - break; - case 10: - case 11: - var im=v[1],re=v[2]; - if(im == re) - this.data.fill(im); - else - for(var i=0;i < this.data.length;i++) - this.data[i] = i % 2 == 0?im:re; - break; - default:this.data.fill(v);break}}; - Ml_Bigarray.prototype.compare - = - function(b,total) - {if(this.layout != b.layout || this.kind != b.kind) - {var k1=this.kind | this.layout << 8,k2=b.kind | b.layout << 8; - return k2 - k1} - if(this.dims.length != b.dims.length) - return b.dims.length - this.dims.length; - for(var i=0;i < this.dims.length;i++) - if(this.dims[i] != b.dims[i])return this.dims[i] < b.dims[i]?- 1:1; - switch(this.kind) - {case 0: - case 1: - case 10: - case 11: - var x,y; - for(var i=0;i < this.data.length;i++) - {x = this.data[i]; - y = b.data[i]; - if(x < y)return - 1; - if(x > y)return 1; - if(x != y) - {if(! total)return NaN;if(x == x)return 1;if(y == y)return - 1}} - break; - case 7: - for(var i=0;i < this.data.length;i += 2) - {if(this.data[i + 1] < b.data[i + 1])return - 1; - if(this.data[i + 1] > b.data[i + 1])return 1; - if(this.data[i] >>> 0 < b.data[i] >>> 0)return - 1; - if(this.data[i] >>> 0 > b.data[i] >>> 0)return 1} - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - case 12: - for(var i=0;i < this.data.length;i++) - {if(this.data[i] < b.data[i])return - 1; - if(this.data[i] > b.data[i])return 1} - break - } - return 0}; - function Ml_Bigarray_c_1_1(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray_c_1_1.prototype = new Ml_Bigarray(); - Ml_Bigarray_c_1_1.prototype.offset - = - function(arg) - {if(typeof arg !== "number") - if(arg instanceof Array && arg.length == 1) - arg = arg[0]; - else - caml_invalid_argument("Ml_Bigarray_c_1_1.offset"); - if(arg < 0 || arg >= this.dims[0])caml_array_bound_error(); - return arg}; - Ml_Bigarray_c_1_1.prototype.get = function(ofs){return this.data[ofs]}; - Ml_Bigarray_c_1_1.prototype.set - = - function(ofs,v){this.data[ofs] = v;return 0}; - Ml_Bigarray_c_1_1.prototype.fill - = - function(v){this.data.fill(v);return 0}; - function caml_ba_create_unsafe(kind,layout,dims,data) - {var size_per_element=caml_ba_get_size_per_element(kind); - if(caml_ba_get_size(dims) * size_per_element != data.length) - caml_invalid_argument("length doesn't match dims"); - if(layout == 0 && dims.length == 1 && size_per_element == 1) - return new Ml_Bigarray_c_1_1(kind,layout,dims,data); - return new Ml_Bigarray(kind,layout,dims,data)} - function caml_ba_deserialize(reader,sz) - {var num_dims=reader.read32s(); - if(num_dims < 0 || num_dims > 16) - caml_failwith("input_value: wrong number of bigarray dimensions"); - var tag=reader.read32s(),kind=tag & 0xff,layout=tag >> 8 & 1,dims=[]; - for(var i=0;i < num_dims;i++)dims.push(reader.read32u()); - var - size=caml_ba_get_size(dims), - data=caml_ba_create_buffer(kind,size), - ba=caml_ba_create_unsafe(kind,layout,dims,data); - switch(kind) - {case 2:for(var i=0;i < size;i++)data[i] = reader.read8s();break; - case 3: - case 12:for(var i=0;i < size;i++)data[i] = reader.read8u();break; - case 4:for(var i=0;i < size;i++)data[i] = reader.read16s();break; - case 5:for(var i=0;i < size;i++)data[i] = reader.read16u();break; - case 6:for(var i=0;i < size;i++)data[i] = reader.read32s();break; - case 8: - case 9: - var sixty=reader.read8u(); - if(sixty) - caml_failwith - ("input_value: cannot read bigarray with 64-bit OCaml ints"); - for(var i=0;i < size;i++)data[i] = reader.read32s(); - break; - case 7: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var int64=caml_int64_of_bytes(t); - ba.set(i,int64)} - break; - case 1: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var f=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,f)} - break; - case 0: - for(var i=0;i < size;i++) - {var f=caml_int32_float_of_bits(reader.read32s());ba.set(i,f)} - break; - case 10: - for(var i=0;i < size;i++) - {var - re=caml_int32_float_of_bits(reader.read32s()), - im=caml_int32_float_of_bits(reader.read32s()); - ba.set(i,[254,re,im])} - break; - case 11: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var re=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var im=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,[254,re,im])} - break - } - sz[0] = (4 + num_dims) * 4; - return caml_ba_create_unsafe(kind,layout,dims,data)} - function caml_ba_compare(a,b,total){return a.compare(b,total)} - if(! Math.imul) - Math.imul - = - function(x,y){y |= 0;return ((x >> 16) * y << 16) + (x & 0xffff) * y | 0}; - var caml_mul=Math.imul; - function caml_hash_mix_int(h,d) - {d = caml_mul(d,0xcc9e2d51 | 0); - d = d << 15 | d >>> 32 - 15; - d = caml_mul(d,0x1b873593); - h ^= d; - h = h << 13 | h >>> 32 - 13; - return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0} - function caml_hash_mix_int64(h,v) - {h = caml_hash_mix_int(h,caml_int64_lo32(v)); - h = caml_hash_mix_int(h,caml_int64_hi32(v)); - return h} - function caml_hash_mix_float(h,v0) - {return caml_hash_mix_int64(h,caml_int64_bits_of_float(v0))} - function caml_ba_hash(ba) - {var num_elts=caml_ba_get_size(ba.dims),h=0; - switch(ba.kind) - {case 2: - case 3: - case 12: - if(num_elts > 256)num_elts = 256; - var w=0,i=0; - for(i = 0;i + 4 <= ba.data.length;i += 4) - {w - = - ba.data[i + 0] - | - ba.data[i + 1] - << - 8 - | - ba.data[i + 2] - << - 16 - | - ba.data[i + 3] - << - 24; - h = caml_hash_mix_int(h,w)} - w = 0; - switch(num_elts & 3) - {case 3:w = ba.data[i + 2] << 16; - case 2:w |= ba.data[i + 1] << 8; - case 1:w |= ba.data[i + 0];h = caml_hash_mix_int(h,w) - } - break; - case 4: - case 5: - if(num_elts > 128)num_elts = 128; - var w=0,i=0; - for(i = 0;i + 2 <= ba.data.length;i += 2) - {w = ba.data[i + 0] | ba.data[i + 1] << 16; - h = caml_hash_mix_int(h,w)} - if((num_elts & 1) != 0)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 6: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 8: - case 9: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 7: - if(num_elts > 32)num_elts = 32; - num_elts *= 2; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 10:num_elts *= 2; - case 0: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break; - case 11:num_elts *= 2; - case 1: - if(num_elts > 32)num_elts = 32; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break - } - return h} - function caml_int32_unmarshal(reader,size) - {size[0] = 4;return reader.read32s()} - function caml_nativeint_unmarshal(reader,size) - {switch(reader.read8u()) - {case 1:size[0] = 4;return reader.read32s(); - case 2:caml_failwith("input_value: native integer value too large"); - default:caml_failwith("input_value: ill-formed native integer")}} - function caml_int64_unmarshal(reader,size) - {var t=new Array(8); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - size[0] = 8; - return caml_int64_of_bytes(t)} - function caml_int64_marshal(writer,v,sizes) - {var b=caml_int64_to_bytes(v); - for(var i=0;i < 8;i++)writer.write(8,b[i]); - sizes[0] = 8; - sizes[1] = 8} - function caml_int64_compare(x,y) - {var x3=x[3] << 16,y3=y[3] << 16; - if(x3 > y3)return 1; - if(x3 < y3)return - 1; - if(x[2] > y[2])return 1; - if(x[2] < y[2])return - 1; - if(x[1] > y[1])return 1; - if(x[1] < y[1])return - 1; - return 0} - function caml_int64_hash(x) - {var lo=x[1] | (x[2] & 0xff) << 24,hi=x[2] >>> 8 & 0xffff | x[3] << 16; - return lo ^ hi} - var - caml_custom_ops= - {"_j": - {deserialize:caml_int64_unmarshal, - serialize:caml_int64_marshal, - fixed_length:8, - compare:caml_int64_compare, - hash:caml_int64_hash}, - "_i":{deserialize:caml_int32_unmarshal,fixed_length:4}, - "_n":{deserialize:caml_nativeint_unmarshal,fixed_length:4}, - "_bigarray": - {deserialize:caml_ba_deserialize, - serialize:caml_ba_serialize, - compare:caml_ba_compare, - hash:caml_ba_hash}}; - function caml_compare_val_get_custom(a) - {return caml_custom_ops[a.caml_custom] - && - caml_custom_ops[a.caml_custom].compare} - function caml_compare_val_number_custom(num,custom,swap,total) - {var comp=caml_compare_val_get_custom(custom); - if(comp) - {var x=swap > 0?comp(custom,num,total):comp(num,custom,total); - if(total && x != x)return swap; - if(+ x != + x)return + x; - if((x | 0) != 0)return x | 0} - return swap} - function caml_compare_val_tag(a) - {if(typeof a === "number") - return 1000; - else - if(a instanceof MlBytes) - return 252; - else - if(a instanceof Array && a[0] === a[0] >>> 0 && a[0] <= 255) - {var tag=a[0] | 0;return tag == 254?0:tag} - else - if(a instanceof String) - return 1252; - else - if(typeof a == "string") - return 1252; - else - if(a instanceof Number) - return 1000; - else - if(a && a.caml_custom) - return 1255; - else - if(a && a.compare) - return 1256; - else - if(typeof a == "function") - return 1247; - else - if(typeof a == "symbol")return 1251; - return 1001} - function caml_int_compare(a,b) - {if(a < b)return - 1;if(a == b)return 0;return 1} - function caml_string_compare(s1,s2) - {s1.t & 6 && caml_convert_string_to_bytes(s1); - s2.t & 6 && caml_convert_string_to_bytes(s2); - return s1.c < s2.c?- 1:s1.c > s2.c?1:0} - function caml_compare_val(a,b,total) - {var stack=[]; - for(;;) - {if(! (total && a === b)) - {var tag_a=caml_compare_val_tag(a); - if(tag_a == 250){a = a[1];continue} - var tag_b=caml_compare_val_tag(b); - if(tag_b == 250){b = b[1];continue} - if(tag_a !== tag_b) - {if(tag_a == 1000) - {if(tag_b == 1255) - return caml_compare_val_number_custom(a,b,- 1,total); - return - 1} - if(tag_b == 1000) - {if(tag_a == 1255) - return caml_compare_val_number_custom(b,a,1,total); - return 1} - return tag_a < tag_b?- 1:1} - switch(tag_a) - {case 247:caml_invalid_argument("compare: functional value");break; - case 248: - var x=caml_int_compare(a[2],b[2]);if(x != 0)return x | 0;break; - case 249:caml_invalid_argument("compare: functional value");break; - case 250: - caml_invalid_argument - ("equal: got Forward_tag, should not happen"); - break; - case 251:caml_invalid_argument("equal: abstract value");break; - case 252: - if(a !== b) - {var x=caml_string_compare(a,b);if(x != 0)return x | 0} - break; - case 253: - caml_invalid_argument("equal: got Double_tag, should not happen"); - break; - case 254: - caml_invalid_argument - ("equal: got Double_array_tag, should not happen"); - break; - case 255: - var x=caml_int64_compare(a,b);if(x != 0)return x | 0;break; - case 1247: - caml_invalid_argument("compare: functional value");break; - case 1255: - var comp=caml_compare_val_get_custom(a); - if(comp != caml_compare_val_get_custom(b)) - return a.caml_custom < b.caml_custom?- 1:1; - if(! comp)caml_invalid_argument("compare: abstract value"); - var x=comp(a,b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1256: - var x=a.compare(b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1000: - a = + a; - b = + b; - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1001: - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1251:if(a !== b){if(! total)return NaN;return 1}break; - case 1252: - var a=a.toString(),b=b.toString(); - if(a !== b){if(a < b)return - 1;if(a > b)return 1} - break; - case 246: - case 254: - default: - if(a.length != b.length)return a.length < b.length?- 1:1; - if(a.length > 1)stack.push(a,b,1); - break}} - if(stack.length == 0)return 0; - var i=stack.pop(); - b = stack.pop(); - a = stack.pop(); - if(i + 1 < a.length)stack.push(a,b,i + 1); - a = a[i]; - b = b[i]}} - function caml_greaterequal(x,y) - {return + (caml_compare_val(x,y,false) >= 0)} - function caml_js_get_console() - {var - c=joo_global_object.console?joo_global_object.console:{}, - m= - ["log", - "debug", - "info", - "warn", - "error", - "assert", - "dir", - "dirxml", - "trace", - "group", - "groupCollapsed", - "groupEnd", - "time", - "timeEnd"]; - function f(){} - for(var i=0;i < m.length;i++)if(! c[m[i]])c[m[i]] = f; - return c} - function caml_utf8_of_utf16(s) - {for(var b="",t=b,c,d,i=0,l=s.length;i < l;i++) - {c = s.charCodeAt(i); - if(c < 0x80) - {for(var j=i + 1;j < l && (c = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - if(c < 0x800) - {t += String.fromCharCode(0xc0 | c >> 6); - t += String.fromCharCode(0x80 | c & 0x3f)} - else - if(c < 0xd800 || c >= 0xdfff) - t - += - String.fromCharCode - (0xe0 | c >> 12,0x80 | c >> 6 & 0x3f,0x80 | c & 0x3f); - else - if - (c - >= - 0xdbff - || - i - + - 1 - == - l - || - (d = s.charCodeAt(i + 1)) - < - 0xdc00 - || - d - > - 0xdfff) - t += "\xef\xbf\xbd"; - else - {i++; - c = (c << 10) + d - 0x35fdc00; - t - += - String.fromCharCode - (0xf0 | c >> 18, - 0x80 | c >> 12 & 0x3f, - 0x80 | c >> 6 & 0x3f, - 0x80 | c & 0x3f)} - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_js_to_string(s) - {var tag=9; - if(! caml_is_ascii(s))tag = 8,s = caml_utf8_of_utf16(s); - return new MlBytes(tag,s,s.length)} - function caml_lessequal(x,y){return + (caml_compare_val(x,y,false) <= 0)} - function caml_lessthan(x,y){return + (caml_compare_val(x,y,false) < 0)} - var caml_ml_channels=new Array(); - function caml_ml_flush(chanid) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened)caml_raise_sys_error("Cannot flush a closed channel"); - if(! chan.buffer || chan.buffer == "")return 0; - if - (chan.fd - && - caml_global_data.fds[chan.fd] - && - caml_global_data.fds[chan.fd].output) - {var output=caml_global_data.fds[chan.fd].output; - switch(output.length) - {case 2:output(chanid,chan.buffer);break;default:output(chan.buffer)}} - chan.buffer = ""; - return 0} - function caml_ml_string_length(s){return s.l} - function caml_std_output(chanid,s) - {var - chan=caml_ml_channels[chanid], - str=caml_new_string(s), - slen=caml_ml_string_length(str); - chan.file.write(chan.offset,str,0,slen); - chan.offset += slen; - return 0} - function js_print_stderr(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stderr.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.error && v.error(s)}} - function js_print_stdout(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stdout.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.log && v.log(s)}} - function caml_sys_open_internal(idx,output,file,flags) - {if(caml_global_data.fds === undefined) - caml_global_data.fds = new Array(); - flags = flags?flags:{}; - var info={}; - info.file = file; - info.offset = flags.append?file.length():0; - info.flags = flags; - info.output = output; - caml_global_data.fds[idx] = info; - if(! caml_global_data.fd_last_idx || idx > caml_global_data.fd_last_idx) - caml_global_data.fd_last_idx = idx; - return idx} - function caml_sys_open(name,flags,_perms) - {var f={}; - while(flags) - {switch(flags[1]) - {case 0:f.rdonly = 1;break; - case 1:f.wronly = 1;break; - case 2:f.append = 1;break; - case 3:f.create = 1;break; - case 4:f.truncate = 1;break; - case 5:f.excl = 1;break; - case 6:f.binary = 1;break; - case 7:f.text = 1;break; - case 8:f.nonblock = 1;break - } - flags = flags[2]} - if(f.rdonly && f.wronly) - caml_raise_sys_error - (name.toString() - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (name.toString() - + - " : flags Open_text and Open_binary are not compatible"); - var - root=resolve_fs_device(name), - file=root.device.open(root.rest,f), - idx=caml_global_data.fd_last_idx?caml_global_data.fd_last_idx:0; - return caml_sys_open_internal(idx + 1,caml_std_output,file,f)} - caml_sys_open_internal - (0,caml_std_output,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (1,js_print_stdout,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (2,js_print_stderr,new MlFakeFile(caml_create_bytes(0))); - function caml_ml_open_descriptor_in(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.wronly)caml_raise_sys_error("fd " + fd + " is writeonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:false, - refill:null}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_open_descriptor_out(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.rdonly)caml_raise_sys_error("fd " + fd + " is readonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:true, - buffer:""}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_out_channels_list() - {var l=0; - for(var c=0;c < caml_ml_channels.length;c++) - if - (caml_ml_channels[c] - && - caml_ml_channels[c].opened - && - caml_ml_channels[c].out) - l = [0,caml_ml_channels[c].fd,l]; - return l} - function caml_jsbytes_of_string(s) - {if((s.t & 6) != 0)caml_convert_string_to_bytes(s);return s.c} - function caml_ml_output_bytes(chanid,buffer,offset,len) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened) - caml_raise_sys_error("Cannot output to a closed channel"); - var string; - if(offset == 0 && caml_ml_bytes_length(buffer) == len) - string = buffer; - else - {string = caml_create_bytes(len); - caml_blit_bytes(buffer,offset,string,0,len)} - var - jsstring=caml_jsbytes_of_string(string), - id=jsstring.lastIndexOf("\n"); - if(id < 0) - chan.buffer += jsstring; - else - {chan.buffer += jsstring.substr(0,id + 1); - caml_ml_flush(chanid); - chan.buffer += jsstring.substr(id + 1)} - return 0} - function caml_ml_output(chanid,buffer,offset,len) - {return caml_ml_output_bytes(chanid,buffer,offset,len)} - function caml_obj_tag(x) - {if(x instanceof Array && x[0] == x[0] >>> 0) - return x[0]; - else - if(x instanceof MlBytes) - return 252; - else - if(x instanceof Function || typeof x == "function") - return 247; - else - if(x && x.caml_custom)return 255;else return 1000} - function caml_register_global(n,v,name_opt) - {if(name_opt && joo_global_object.toplevelReloc) - n = joo_global_object.toplevelReloc(name_opt); - caml_global_data[n + 1] = v; - if(name_opt)caml_global_data[name_opt] = v} - var caml_named_values={}; - function caml_register_named_value(nm,v) - {caml_named_values[caml_jsbytes_of_string(nm)] = v;return 0} - function caml_string_of_bytes(s){return s} - function caml_sys_const_backend_type() - {return [0,caml_new_string("js_of_ocaml")]} - function caml_sys_const_max_wosize(){return 0x7FFFFFFF / 4 | 0} - var - caml_argv= - function() - {var g=joo_global_object,main="a.out",args=[]; - if(g.process && g.process.argv && g.process.argv.length > 1) - {var argv=g.process.argv; - main = argv[1]; - args = raw_array_sub(argv,2,argv.length - 2)} - var p=caml_js_to_string(main),args2=[0,p]; - for(var i=0;i < args.length;i++) - args2.push(caml_js_to_string(args[i])); - return args2} - (); - function caml_sys_get_argv(a){return [0,caml_argv[1],caml_argv]} - function caml_return_exn_constant(tag){return tag} - function caml_named_value(nm){return caml_named_values[nm]} - function caml_wrap_exception(e) - {if(e instanceof Array)return e; - if - (joo_global_object.RangeError - && - e instanceof joo_global_object.RangeError - && - e.message - && - e.message.match(/maximum call stack/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if - (joo_global_object.InternalError - && - e instanceof joo_global_object.InternalError - && - e.message - && - e.message.match(/too much recursion/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if(e instanceof joo_global_object.Error && caml_named_value("jsError")) - return [0,caml_named_value("jsError"),e]; - return [0,caml_global_data.Failure,caml_js_to_string(String(e))]} - function caml_call1(f,a0) - {return f.length == 1?f(a0):caml_call_gen(f,[a0])} - function caml_call3(f,a0,a1,a2) - {return f.length == 3?f(a0,a1,a2):caml_call_gen(f,[a0,a1,a2])} - caml_fs_init(); - var - Out_of_memory=[248,caml_new_string("Out_of_memory"),-1], - Sys_error=[248,caml_new_string("Sys_error"),-2], - Failure=[248,caml_new_string("Failure"),-3], - Invalid_argument=[248,caml_new_string("Invalid_argument"),-4], - End_of_file=[248,caml_new_string("End_of_file"),-5], - Division_by_zero=[248,caml_new_string("Division_by_zero"),-6], - Not_found=[248,caml_new_string("Not_found"),-7], - Match_failure=[248,caml_new_string("Match_failure"),-8], - Stack_overflow=[248,caml_new_string("Stack_overflow"),-9], - Sys_blocked_io=[248,caml_new_string("Sys_blocked_io"),-10], - Assert_failure=[248,caml_new_string("Assert_failure"),-11], - Undefined_recursive_module= - [248,caml_new_string("Undefined_recursive_module"),-12]; - caml_register_global - (11,Undefined_recursive_module,"Undefined_recursive_module"); - caml_register_global(10,Assert_failure,"Assert_failure"); - caml_register_global(9,Sys_blocked_io,"Sys_blocked_io"); - caml_register_global(8,Stack_overflow,"Stack_overflow"); - caml_register_global(7,Match_failure,"Match_failure"); - caml_register_global(6,Not_found,"Not_found"); - caml_register_global(5,Division_by_zero,"Division_by_zero"); - caml_register_global(4,End_of_file,"End_of_file"); - caml_register_global(3,Invalid_argument,"Invalid_argument"); - caml_register_global(2,Failure,"Failure"); - caml_register_global(1,Sys_error,"Sys_error"); - caml_register_global(0,Out_of_memory,"Out_of_memory"); - var - _f_=caml_new_string("output_substring"), - _n_=caml_new_string("String.blit / Bytes.blit_string"), - _m_=caml_new_string("Bytes.blit"), - _r_=caml_new_string(""), - _p_=caml_new_string("String.concat"), - _w_=caml_new_string("Buffer.add_substring/add_subbytes"), - _v_=caml_new_string("Buffer.add: cannot grow buffer"), - _ab_=[3,0,3], - _ac_=caml_new_string("."), - _Z_=caml_new_string(">"), - ___=caml_new_string("<\/"), - _W_=caml_new_string(">"), - _X_=caml_new_string("<"), - _T_=caml_new_string("\n"), - _A_=caml_new_string("Stdlib.Format.Empty_queue"), - _P_=[0,caml_new_string("")], - _am_=caml_new_string("Js_of_ocaml__Js.Error"), - _ax_=caml_new_string(":"), - _aw_=caml_new_string("}"), - _ay_=caml_new_string(","), - _az_=caml_new_string("{"), - _aA_=caml_new_string("cannot parse json "), - _at_=caml_new_string('"'), - _au_=caml_new_string('"'), - _aB_=caml_new_string("#3aa757"), - _aC_=caml_new_string("color"); - function _a_(_dL_){throw [0,Invalid_argument,_dL_]} - caml_fresh_oo_id(0); - var _b_=2147483647; - function _c_(_dH_,_dG_) - {var - _dI_=caml_ml_string_length(_dH_), - _dJ_=caml_ml_string_length(_dG_), - _dK_=caml_create_bytes(_dI_ + _dJ_ | 0); - caml_blit_string(_dH_,0,_dK_,0,_dI_); - caml_blit_string(_dG_,0,_dK_,_dI_,_dJ_); - return caml_string_of_bytes(_dK_)} - caml_ml_open_descriptor_in(0); - var - _d_=caml_ml_open_descriptor_out(1), - _e_=caml_ml_open_descriptor_out(2), - _g_= - [0, - function(_dy_) - {function _dz_(_dA_) - {var _dB_=_dA_; - for(;;) - {if(_dB_) - {var _dC_=_dB_[2],_dD_=_dB_[1]; - try - {caml_ml_flush(_dD_)} - catch(_dF_) - {_dF_ = caml_wrap_exception(_dF_); - if(_dF_[1] !== Sys_error)throw _dF_; - var _dE_=_dF_} - var _dB_=_dC_; - continue} - return 0}} - return _dz_(caml_ml_out_channels_list(0))}]; - caml_sys_get_argv(0); - var _j_=(4 * caml_sys_const_max_wosize(0) | 0) - 1 | 0; - caml_fresh_oo_id(0); - typeof caml_sys_const_backend_type(0) === "number"; - function _k_(_dv_,_du_) - {if(_du_) - {var _dw_=_du_[2],_dx_=caml_call1(_dv_,_du_[1]); - return [0,_dx_,_k_(_dv_,_dw_)]} - return 0} - function _q_(_dp_,_do_) - {if(_do_) - {var _dq_=caml_ml_string_length(_dp_),_df_=0,_de_=_do_,_dr_=0; - for(;;) - {if(_de_) - {var _dg_=_de_[2],_dh_=_de_[1]; - if(_dg_) - {var - _di_=(caml_ml_string_length(_dh_) + _dq_ | 0) + _df_ | 0, - _dj_=_df_ <= _di_?_di_:_a_(_p_), - _df_=_dj_, - _de_=_dg_; - continue} - var _ds_=caml_ml_string_length(_dh_) + _df_ | 0} - else - var _ds_=_df_; - var _dt_=caml_create_bytes(_ds_),_dl_=_dr_,_dk_=_do_; - for(;;) - {if(_dk_) - {var _dm_=_dk_[2],_dn_=_dk_[1]; - if(_dm_) - {caml_blit_string(_dn_,0,_dt_,_dl_,caml_ml_string_length(_dn_)); - caml_blit_string - (_dp_,0,_dt_,_dl_ + caml_ml_string_length(_dn_) | 0,_dq_); - var - _dl_=(_dl_ + caml_ml_string_length(_dn_) | 0) + _dq_ | 0, - _dk_=_dm_; - continue} - caml_blit_string(_dn_,0,_dt_,_dl_,caml_ml_string_length(_dn_))} - return caml_string_of_bytes(_dt_)}}} - return _r_} - caml_fresh_oo_id(0); - caml_fresh_oo_id(0); - var _x_=[0,0]; - function _y_(_dd_){_x_[1] = [0,_dd_,_x_[1]];return 0} - function _z_(_da_,_c$_) - {var _db_=[0,_da_,0],_dc_=_c$_[1]; - return _dc_ - ?(_c$_[1] = _db_,_dc_[2] = _db_,0) - :(_c$_[1] = _db_,_c$_[2] = _db_,0)} - var _B_=[248,_A_,caml_fresh_oo_id(0)]; - function _C_(_c7_) - {var _c8_=_c7_[2]; - if(_c8_) - {var _c__=_c8_[2],_c9_=_c8_[1]; - _c7_[2] = _c__; - if(0 === _c__)_c7_[1] = 0; - return _c9_} - throw _B_} - function _D_(_c6_,_c5_) - {_c6_[13] = _c6_[13] + _c5_[3] | 0;return _z_(_c5_,_c6_[28])} - var _E_=1000000010; - function _F_(_c4_,_c3_) - {return caml_call3(_c4_[17],_c3_,0,caml_ml_string_length(_c3_))} - function _G_(_c2_){return caml_call1(_c2_[19],0)} - function _H_(_cY_,_cX_,_cW_) - {_G_(_cY_); - _cY_[11] = 1; - var - _cZ_=(_cY_[6] - _cW_ | 0) + _cX_ | 0, - _c0_=_cY_[8], - _c1_=caml_lessequal(_c0_,_cZ_)?_c0_:_cZ_; - _cY_[10] = _c1_; - _cY_[9] = _cY_[6] - _cY_[10] | 0; - return caml_call1(_cY_[21],_cY_[10])} - function _I_(_cV_,_cU_){return _H_(_cV_,0,_cU_)} - function _J_(_cT_,_cS_) - {_cT_[9] = _cT_[9] - _cS_ | 0;return caml_call1(_cT_[20],_cS_)} - function _K_(_cL_) - {var _cM_=_cL_[2]; - if(_cM_) - {var _cN_=_cM_[1],_cO_=_cN_[2],_cP_=_cN_[1],_cQ_=_cL_[9] < _cO_?1:0; - if(_cQ_) - {if(0 !== _cP_)return 5 <= _cP_?0:_I_(_cL_,_cO_);var _cR_=0} - else - var _cR_=_cQ_; - return _cR_} - return _G_(_cL_)} - function _L_(_cI_) - {var _cJ_=_C_(_cI_[28]),_cK_=_cJ_[1]; - _cI_[12] = _cI_[12] - _cJ_[3] | 0; - _cI_[9] = _cI_[9] + _cK_ | 0; - return 0} - function _M_(_b3_,_b2_,_b1_) - {if(typeof _b1_ === "number") - switch(_b1_) - {case 0: - var _b4_=_b3_[3]; - if(_b4_) - {var - _b5_=_b4_[1][1], - _b6_= - function(_cz_,_cy_) - {if(_cy_) - {var _cB_=_cy_[1],_cA_=_cy_[2]; - return caml_lessthan(_cz_,_cB_) - ?[0,_cz_,_cy_] - :[0,_cB_,_b6_(_cz_,_cA_)]} - return [0,_cz_,0]}; - _b5_[1] = _b6_(_b3_[6] - _b3_[9] | 0,_b5_[1]); - return 0} - return 0; - case 1:var _b7_=_b3_[2];return _b7_?(_b3_[2] = _b7_[2],0):0; - case 2:var _b8_=_b3_[3];return _b8_?(_b3_[3] = _b8_[2],0):0; - case 3:var _b9_=_b3_[2];return _b9_?_I_(_b3_,_b9_[1][2]):_G_(_b3_); - case 4: - var _b__=_b3_[10] !== (_b3_[6] - _b3_[9] | 0)?1:0; - return _b__?_L_(_b3_):_b__; - default: - var _b$_=_b3_[5]; - if(_b$_) - {var _ca_=_b$_[2]; - _F_(_b3_,caml_call1(_b3_[25],_b$_[1])); - _b3_[5] = _ca_; - return 0} - return 0} - else - switch(_b1_[0]) - {case 0: - var _cb_=_b1_[1]; - _b3_[9] = _b3_[9] - _b2_ | 0; - _F_(_b3_,_cb_); - _b3_[11] = 0; - return 0; - case 1: - var _cc_=_b1_[2],_cd_=_b1_[1],_ce_=_b3_[2]; - if(_ce_) - {var _cf_=_ce_[1],_cg_=_cf_[2]; - switch(_cf_[1]) - {case 0:return _J_(_b3_,_cd_); - case 1:return _H_(_b3_,_cc_,_cg_); - case 2:return _H_(_b3_,_cc_,_cg_); - case 3:return _b3_[9] < _b2_?_H_(_b3_,_cc_,_cg_):_J_(_b3_,_cd_); - case 4: - return _b3_[11] - ?_J_(_b3_,_cd_) - :_b3_[9] < _b2_ - ?_H_(_b3_,_cc_,_cg_) - :((_b3_[6] - _cg_ | 0) + _cc_ | 0) < _b3_[10] - ?_H_(_b3_,_cc_,_cg_) - :_J_(_b3_,_cd_); - default:return _J_(_b3_,_cd_)}} - return 0; - case 2: - var - _cj_=_b3_[6] - _b3_[9] | 0, - _ck_=_b3_[3], - _ch_=_b1_[2], - _ci_=_b1_[1]; - if(_ck_) - {var - _cl_=_ck_[1][1], - _cm_= - function(_cE_,_cD_) - {var _cF_=_cD_; - for(;;) - {if(_cF_) - {var _cH_=_cF_[1],_cG_=_cF_[2]; - if(caml_greaterequal(_cH_,_cE_))return _cH_; - var _cF_=_cG_; - continue} - throw Not_found}}, - _cn_=_cl_[1]; - if(_cn_) - {var _co_=_cn_[1]; - try - {var _cs_=_cm_(_cj_,_cl_[1]),_cp_=_cs_} - catch(_cC_) - {_cC_ = caml_wrap_exception(_cC_); - if(_cC_ !== Not_found)throw _cC_; - var _cp_=_co_} - var _cq_=_cp_} - else - var _cq_=_cj_; - var _cr_=_cq_ - _cj_ | 0; - return 0 <= _cr_ - ?_J_(_b3_,_cr_ + _ci_ | 0) - :_H_(_b3_,_cq_ + _ch_ | 0,_b3_[6])} - return 0; - case 3: - var _ct_=_b1_[2],_cu_=_b1_[1]; - if(_b3_[8] < (_b3_[6] - _b3_[9] | 0))_K_(_b3_); - var _cv_=_b3_[9] - _cu_ | 0,_cw_=1 === _ct_?1:_b3_[9] < _b2_?_ct_:5; - _b3_[2] = [0,[0,_cw_,_cv_],_b3_[2]]; - return 0; - case 4:_b3_[3] = [0,_b1_[1],_b3_[3]];return 0; - default: - var _cx_=_b1_[1]; - _F_(_b3_,caml_call1(_b3_[24],_cx_)); - _b3_[5] = [0,_cx_,_b3_[5]]; - return 0}} - function _N_(_bT_) - {for(;;) - {var _bR_=_bT_[28][2]; - if(_bR_) - {var - _bS_=_bR_[1], - _bU_=_bS_[1], - _bX_=_bU_ < 0?1:0, - _bV_=_bS_[3], - _bW_=_bS_[2], - _bY_=_bX_?(_bT_[13] - _bT_[12] | 0) < _bT_[9]?1:0:_bX_, - _bZ_=1 - _bY_; - if(_bZ_) - {_C_(_bT_[28]); - var _b0_=0 <= _bU_?_bU_:_E_; - _M_(_bT_,_b0_,_bW_); - _bT_[12] = _bV_ + _bT_[12] | 0; - continue} - return _bZ_} - throw _B_}} - function _O_(_bO_) - {try - {var _bP_=_N_(_bO_);return _bP_} - catch(_bQ_) - {_bQ_ = caml_wrap_exception(_bQ_);if(_bQ_ === _B_)return 0;throw _bQ_}} - var _Q_=[0,[0,-1,[0,-1,_P_,0]],0]; - function _R_(_bN_){_bN_[1] = _Q_;return 0} - function _S_(_bD_,_bC_) - {var _bE_=_bD_[1]; - if(_bE_) - {var _bF_=_bE_[1],_bG_=_bF_[2],_bH_=_bG_[1],_bI_=_bE_[2],_bJ_=_bG_[2]; - if(_bF_[1] < _bD_[12])return _R_(_bD_); - if(typeof _bJ_ !== "number") - switch(_bJ_[0]) - {case 3: - var - _bL_=1 - _bC_, - _bM_=_bL_?(_bG_[1] = _bD_[13] + _bH_ | 0,_bD_[1] = _bI_,0):_bL_; - return _bM_; - case 1: - case 2: - var - _bK_= - _bC_?(_bG_[1] = _bD_[13] + _bH_ | 0,_bD_[1] = _bI_,0):_bC_; - return _bK_ - } - return 0} - return 0} - var _l_=caml_create_bytes(80); - caml_fill_bytes(_l_,0,80,32); - var _o_=caml_string_of_bytes(_l_); - function _U_(_bz_,_by_) - {var _bA_=_by_; - for(;;) - {var _bB_=0 < _bA_?1:0; - if(_bB_) - {if(80 < _bA_) - {caml_call3(_bz_[17],_o_,0,80);var _bA_=_bA_ - 80 | 0;continue} - return caml_call3(_bz_[17],_o_,0,_bA_)} - return _bB_}} - function _V_(_bx_){return _c_(_X_,_c_(_bx_,_W_))} - function _Y_(_bw_){return _c_(___,_c_(_bw_,_Z_))} - function _$_(_bv_){return 0} - function _aa_(_bu_){return 0} - function _ad_(_bk_,_bj_) - {function _bl_(_bt_){return 0} - function _bm_(_bs_){return 0} - var _bg_=[0,0,0],_bh_=[0,-1,_ab_,0]; - function _bn_(_br_){return 0} - _z_(_bh_,_bg_); - var - _bi_= - [0, - [0,[0,1,_bh_],_Q_], - 0, - 0, - 0, - 0, - 78, - 10, - 68, - 78, - 0, - 1, - 1, - 1, - 1, - _b_, - _ac_, - _bk_, - _bj_, - _bn_, - _bm_, - _bl_, - 0, - 0, - _V_, - _Y_, - _$_, - _aa_, - _bg_]; - _bi_[19] = function(_bq_){return caml_call3(_bi_[17],_T_,0,1)}; - _bi_[20] = function(_bp_){return _U_(_bi_,_bp_)}; - _bi_[21] = function(_bo_){return _U_(_bi_,_bo_)}; - return _bi_} - function _ae_(_ba_) - {function _bb_(_bf_){return caml_ml_flush(_ba_)} - return _ad_ - (function(_bc_,_bd_,_be_) - {if(0 <= _bd_) - if(0 <= _be_) - if(! ((caml_ml_string_length(_bc_) - _be_ | 0) < _bd_)) - return caml_ml_output(_ba_,_bc_,_bd_,_be_); - return _a_(_f_)}, - _bb_)} - var - _ag_=512, - _s_=_j_ < 512?_j_:_ag_, - _t_=caml_create_bytes(_s_), - _u_=[0,_t_,0,_s_,_t_], - _ah_=_ae_(_d_); - _ae_(_e_); - function _af_(_a$_){return 0} - _ad_ - (function(_a8_,_a9_,_a__) - {var _a2_=_a9_ < 0?1:0; - if(_a2_) - var _a3_=_a2_; - else - var - _a7_=_a__ < 0?1:0, - _a3_=_a7_ || ((caml_ml_string_length(_a8_) - _a__ | 0) < _a9_?1:0); - if(_a3_)_a_(_w_); - var _a4_=_u_[2] + _a__ | 0; - if(_u_[3] < _a4_) - {var _aY_=[0,_u_[3]]; - for(;;) - {if(_aY_[1] < (_u_[2] + _a__ | 0)) - {_aY_[1] = 2 * _aY_[1] | 0;continue} - if(_j_ < _aY_[1]) - {if(! ((_u_[2] + _a__ | 0) <= _j_))throw [0,Failure,_v_]; - _aY_[1] = _j_} - var - _aZ_=caml_create_bytes(_aY_[1]), - _a0_=_u_[2], - _a1_=_u_[1], - switch$0= - 0 <= _a0_ - ?(caml_ml_bytes_length(_a1_) - _a0_ | 0) < 0 - ?0 - :(caml_ml_bytes_length(_aZ_) - _a0_ | 0) < 0 - ?0 - :(caml_blit_bytes(_a1_,0,_aZ_,0,_a0_),1) - :0; - if(! switch$0)_a_(_m_); - _u_[1] = _aZ_; - _u_[3] = _aY_[1]; - break}} - var - _a5_=_u_[2], - _a6_=_u_[1], - switch$1= - 0 <= _a__ - ?0 <= _a9_ - ?(caml_ml_string_length(_a8_) - _a__ | 0) < _a9_ - ?0 - :0 <= _a5_ - ?(caml_ml_bytes_length(_a6_) - _a__ | 0) < _a5_ - ?0 - :(caml_blit_string(_a8_,_a9_,_a6_,_a5_,_a__),1) - :0 - :0 - :0; - if(! switch$1)_a_(_n_); - _u_[2] = _a4_; - return 0}, - _af_); - var _i_=[0,0],_h_=_g_[1]; - _g_[1] - = - function(_aN_) - {if(1 - _i_[1]) - {_i_[1] = 1; - var _aO_=_ah_[4]; - for(;;) - {if(_aO_) - {var _aP_=_aO_[2]; - if(_ah_[23])_D_(_ah_,[0,0,5,0]); - if(_ah_[22]) - {var _aW_=_ah_[4]; - if(_aW_) - {var _aX_=_aW_[2]; - caml_call1(_ah_[27],_aW_[1]); - _ah_[4] = _aX_; - var switch$0=1} - else - var switch$0=0} - else - var switch$0=0; - var _aO_=_aP_; - continue} - for(;;) - {if(1 < _ah_[14]) - {if(1 < _ah_[14]) - {if(_ah_[14] < _ah_[15]) - {_D_(_ah_,[0,0,1,0]);_S_(_ah_,1);_S_(_ah_,0)} - _ah_[14] = _ah_[14] - 1 | 0} - continue} - _ah_[13] = _E_; - _O_(_ah_); - _ah_[12] = 1; - _ah_[13] = 1; - var _aQ_=_ah_[28]; - _aQ_[1] = 0; - _aQ_[2] = 0; - _R_(_ah_); - _ah_[2] = 0; - _ah_[3] = 0; - _ah_[4] = 0; - _ah_[5] = 0; - _ah_[10] = 0; - _ah_[14] = 0; - _ah_[9] = _ah_[6]; - _ah_[14] = _ah_[14] + 1 | 0; - var _aU_=3,_aV_=0; - if(_ah_[14] < _ah_[15]) - {var _aS_=[0,- _ah_[13] | 0,[3,_aV_,_aU_],0]; - _D_(_ah_,_aS_); - _ah_[1] = [0,[0,_ah_[13],_aS_],_ah_[1]]} - else - if(_ah_[14] === _ah_[15]) - {var _aT_=_ah_[16],_aR_=caml_ml_string_length(_aT_); - _D_(_ah_,[0,_aR_,[0,_aT_],_aR_]); - _O_(_ah_)} - caml_call1(_ah_[18],0); - break} - break}} - return caml_call1(_h_,0)}; - var - _aj_=joo_global_object, - _al_=_aj_.Array, - _an_=[248,_am_,caml_fresh_oo_id(0)], - _ao_=[0,_an_,{}], - _ak_=undefined, - _ai_=caml_obj_tag(_ao_) === 248?_ao_:_ao_[1]; - caml_register_named_value(caml_new_string("jsError"),_ai_); - (function(exn){throw exn}); - var _ap_=_aj_.JSON; - _y_ - (function(_aM_) - {return _aM_[1] === _an_?[0,caml_js_to_string(_aM_[2].toString())]:0}); - _y_ - (function(_aL_) - {return _aL_ instanceof _al_?0:[0,caml_js_to_string(_aL_.toString())]}); - caml_fresh_oo_id(0); - _aj_.HTMLElement === _ak_; - var _aq_=caml_js_get_console(0); - function _ar_(_aK_){return _aq_.log(_aK_.toString())} - function _as_(_aJ_){return _c_(_au_,_c_(_aJ_,_at_))} - function _av_(_aD_) - {var - _aE_= - _c_ - (_az_, - _c_ - (_q_ - (_ay_, - _k_ - (function(_aH_) - {var _aI_=_c_(_ax_,_aH_[2]);return _c_(_as_(_aH_[1]),_aI_)}, - _aD_)), - _aw_)); - try - {var _aF_=_ap_.parse(_aE_.toString());return _aF_} - catch(_aG_){_ar_(_c_(_aA_,_aE_));return {}}} - _aq_.log(_av_([0,[0,_aC_,_as_(_aB_)],0])); - caml_call1(_g_[1],0); - return} - (function(){return this}())); diff --git a/examples/chrome-extension/options-example.js b/examples/chrome-extension/options-example.js deleted file mode 100644 index 4fd1743..0000000 --- a/examples/chrome-extension/options-example.js +++ /dev/null @@ -1,2092 +0,0 @@ -// Generated by js_of_ocaml 3.5.2 -(function(joo_global_object) - {"use strict"; - function raw_array_sub(a,i,l) - {var b=new Array(l);for(var j=0;j < l;j++)b[j] = a[i + j];return b} - function caml_subarray_to_string(a,i,len) - {var f=String.fromCharCode; - if(i == 0 && len <= 4096 && len == a.length)return f.apply(null,a); - var s=""; - for(;0 < len;i += 1024,len -= 1024) - s += f.apply(null,raw_array_sub(a,i,Math.min(len,1024))); - return s} - function caml_convert_string_to_array(s) - {if(joo_global_object.Uint8Array) - var a=new (joo_global_object.Uint8Array)(s.l); - else - var a=new Array(s.l); - var b=s.c,l=b.length,i=0; - for(;i < l;i++)a[i] = b.charCodeAt(i); - for(l = s.l;i < l;i++)a[i] = 0; - s.c = a; - s.t = 4; - return a} - function caml_blit_bytes(s1,i1,s2,i2,len) - {if(len == 0)return 0; - if(i2 == 0 && (len >= s2.l || s2.t == 2 && len >= s2.c.length)) - {s2.c - = - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - if(s2.t == 2 && i2 == s2.c.length) - {s2.c - += - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - {if(s2.t != 4)caml_convert_string_to_array(s2); - var c1=s1.c,c2=s2.c; - if(s1.t == 4) - if(i2 <= i1) - for(var i=0;i < len;i++)c2[i2 + i] = c1[i1 + i]; - else - for(var i=len - 1;i >= 0;i--)c2[i2 + i] = c1[i1 + i]; - else - {var l=Math.min(len,c1.length - i1); - for(var i=0;i < l;i++)c2[i2 + i] = c1.charCodeAt(i1 + i); - for(;i < len;i++)c2[i2 + i] = 0}} - return 0} - function caml_blit_string(s1,i1,s2,i2,len) - {return caml_blit_bytes(s1,i1,s2,i2,len)} - function raw_array_append_one(a,x) - {var l=a.length,b=new Array(l + 1),i=0; - for(;i < l;i++)b[i] = a[i]; - b[i] = x; - return b} - function caml_call_gen(f,args) - {if(f.fun)return caml_call_gen(f.fun,args); - var n=f.length,argsLen=args.length,d=n - argsLen; - if(d == 0) - return f.apply(null,args); - else - if(d < 0) - return caml_call_gen - (f.apply(null,raw_array_sub(args,0,n)), - raw_array_sub(args,n,argsLen - n)); - else - return function(x) - {return caml_call_gen(f,raw_array_append_one(args,x))}} - function caml_str_repeat(n,s) - {if(n == 0)return ""; - if(s.repeat)return s.repeat(n); - var r="",l=0; - if(n == 0)return r; - for(;;) - {if(n & 1)r += s; - n >>= 1; - if(n == 0)return r; - s += s; - l++; - if(l == 9)s.slice(0,1)}} - function caml_convert_string_to_bytes(s) - {if(s.t == 2) - s.c += caml_str_repeat(s.l - s.c.length,"\0"); - else - s.c = caml_subarray_to_string(s.c,0,s.c.length); - s.t = 0} - function caml_is_ascii(s) - {if(s.length < 24) - {for(var i=0;i < s.length;i++)if(s.charCodeAt(i) > 127)return false; - return true} - else - return ! /[^\x00-\x7f]/.test(s)} - function caml_utf16_of_utf8(s) - {for(var b="",t="",c,c1,c2,v,i=0,l=s.length;i < l;i++) - {c1 = s.charCodeAt(i); - if(c1 < 0x80) - {for(var j=i + 1;j < l && (c1 = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - v = 1; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c1 << 6); - if(c1 < 0xe0) - {v = c - 0x3080;if(v < 0x80)v = 1} - else - {v = 2; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c << 6); - if(c1 < 0xf0) - {v = c - 0xe2080; - if(v < 0x800 || v >= 0xd7ff && v < 0xe000)v = 2} - else - {v = 3; - if - (++i - < - l - && - ((c2 = s.charCodeAt(i)) & - 64) - == - 128 - && - c1 - < - 0xf5) - {v = c2 - 0x3c82080 + (c << 6); - if(v < 0x10000 || v > 0x10ffff)v = 3}}}}} - if(v < 4) - {i -= v;t += "\ufffd"} - else - if(v > 0xffff) - t += String.fromCharCode(0xd7c0 + (v >> 10),0xdc00 + (v & 0x3FF)); - else - t += String.fromCharCode(v); - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_to_js_string(s) - {switch(s.t) - {case 9:return s.c; - default:caml_convert_string_to_bytes(s);case 0: - if(caml_is_ascii(s.c)){s.t = 9;return s.c}s.t = 8; - case 8:return caml_utf16_of_utf8(s.c) - }} - function MlBytes(tag,contents,length) - {this.t = tag;this.c = contents;this.l = length} - MlBytes.prototype.toString = function(){return caml_to_js_string(this)}; - MlBytes.prototype.slice - = - function() - {var content=this.t == 4?this.c.slice():this.c; - return new MlBytes(this.t,content,this.l)}; - function caml_raise_with_arg(tag,arg){throw [0,tag,arg]} - function caml_new_string(s){return new MlBytes(0,s,s.length)} - function caml_raise_with_string(tag,msg) - {caml_raise_with_arg(tag,caml_new_string(msg))} - var caml_global_data=[0]; - function caml_invalid_argument(msg) - {caml_raise_with_string(caml_global_data.Invalid_argument,msg)} - function caml_create_bytes(len) - {if(len < 0)caml_invalid_argument("Bytes.create"); - return new MlBytes(len?2:9,"",len)} - function caml_fill_bytes(s,i,l,c) - {if(l > 0) - if(i == 0 && (l >= s.l || s.t == 2 && l >= s.c.length)) - if(c == 0) - {s.c = "";s.t = 2} - else - {s.c = caml_str_repeat(l,String.fromCharCode(c));s.t = l == s.l?0:2} - else - {if(s.t != 4)caml_convert_string_to_array(s); - for(l += i;i < l;i++)s.c[i] = c} - return 0} - var caml_oo_last_id=0; - function caml_fresh_oo_id(){return caml_oo_last_id++} - function caml_failwith(msg) - {caml_raise_with_string(caml_global_data.Failure,msg)} - if(joo_global_object.process && joo_global_object.process.cwd) - var caml_current_dir=joo_global_object.process.cwd().replace(/\\/g,"/"); - else - var caml_current_dir="/static"; - if(caml_current_dir.slice(- 1) !== "/")caml_current_dir += "/"; - function caml_make_path(name) - {name = name instanceof MlBytes?name.toString():name; - if(name.charCodeAt(0) != 47)name = caml_current_dir + name; - var comp=name.split("/"),ncomp=[]; - for(var i=0;i < comp.length;i++) - switch(comp[i]) - {case "..":if(ncomp.length > 1)ncomp.pop();break; - case ".":break; - case "":if(ncomp.length == 0)ncomp.push("");break; - default:ncomp.push(comp[i]);break} - ncomp.orig = name; - return ncomp} - function caml_raise_sys_error(msg) - {caml_raise_with_string(caml_global_data.Sys_error,msg)} - function caml_raise_no_such_file(name) - {name = name instanceof MlBytes?name.toString():name; - caml_raise_sys_error(name + ": No such file or directory")} - function caml_string_of_array(a){return new MlBytes(4,a,a.length)} - function caml_string_bound_error() - {caml_invalid_argument("index out of bounds")} - function caml_bytes_unsafe_get(s,i) - {switch(s.t & 6) - {default:if(i >= s.c.length)return 0;case 0:return s.c.charCodeAt(i); - case 4:return s.c[i] - }} - function caml_bytes_get(s,i) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_get(s,i)} - function caml_ml_bytes_length(s){return s.l} - function MlFile(){} - function MlFakeFile(content){this.data = content} - MlFakeFile.prototype = new MlFile(); - MlFakeFile.prototype.truncate - = - function(len) - {var old=this.data; - this.data = caml_create_bytes(len | 0); - caml_blit_bytes(old,0,this.data,0,len)}; - MlFakeFile.prototype.length - = - function(){return caml_ml_bytes_length(this.data)}; - MlFakeFile.prototype.write - = - function(offset,buf,pos,len) - {var clen=this.length(); - if(offset + len >= clen) - {var new_str=caml_create_bytes(offset + len),old_data=this.data; - this.data = new_str; - caml_blit_bytes(old_data,0,this.data,0,clen)} - caml_blit_bytes(buf,pos,this.data,offset,len); - return 0}; - MlFakeFile.prototype.read - = - function(offset,buf,pos,len) - {var clen=this.length(); - caml_blit_bytes(this.data,offset,buf,pos,len); - return 0}; - MlFakeFile.prototype.read_one - = - function(offset){return caml_bytes_get(this.data,offset)}; - MlFakeFile.prototype.close = function(){}; - MlFakeFile.prototype.constructor = MlFakeFile; - function MlFakeDevice(root,f) - {this.content = {};this.root = root;this.lookupFun = f} - MlFakeDevice.prototype.nm = function(name){return this.root + name}; - MlFakeDevice.prototype.lookup - = - function(name) - {if(! this.content[name] && this.lookupFun) - {var - res= - this.lookupFun(caml_new_string(this.root),caml_new_string(name)); - if(res !== 0)this.content[name] = new MlFakeFile(res[1])}}; - MlFakeDevice.prototype.exists - = - function(name) - {if(name == "")return 1; - var name_slash=name + "/",r=new RegExp("^" + name_slash); - for(var n in this.content)if(n.match(r))return 1; - this.lookup(name); - return this.content[name]?1:0}; - MlFakeDevice.prototype.readdir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - seen={}, - a=[]; - for(var n in this.content) - {var m=n.match(r); - if(m && ! seen[m[1]]){seen[m[1]] = true;a.push(m[1])}} - return a}; - MlFakeDevice.prototype.is_dir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - a=[]; - for(var n in this.content){var m=n.match(r);if(m)return 1} - return 0}; - MlFakeDevice.prototype.unlink - = - function(name) - {var ok=this.content[name]?true:false; - delete this.content[name]; - return ok}; - MlFakeDevice.prototype.open - = - function(name,f) - {if(f.rdonly && f.wronly) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_text and Open_binary are not compatible"); - this.lookup(name); - if(this.content[name]) - {if(this.is_dir(name)) - caml_raise_sys_error(this.nm(name) + " : is a directory"); - if(f.create && f.excl) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - var file=this.content[name]; - if(f.truncate)file.truncate(); - return file} - else - if(f.create) - {this.content[name] = new MlFakeFile(caml_create_bytes(0)); - return this.content[name]} - else - caml_raise_no_such_file(this.nm(name))}; - MlFakeDevice.prototype.register - = - function(name,content) - {if(this.content[name]) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - if(content instanceof MlBytes) - this.content[name] = new MlFakeFile(content); - else - if(content instanceof Array) - this.content[name] = new MlFakeFile(caml_string_of_array(content)); - else - if(content.toString) - {var mlstring=caml_new_string(content.toString()); - this.content[name] = new MlFakeFile(mlstring)}}; - MlFakeDevice.prototype.constructor = MlFakeDevice; - function caml_array_of_string(s) - {if(s.t != 4)caml_convert_string_to_array(s);return s.c} - function caml_bytes_unsafe_set(s,i,c) - {c &= 0xff; - if(s.t != 4) - {if(i == s.c.length) - {s.c += String.fromCharCode(c);if(i + 1 == s.l)s.t = 0;return 0} - caml_convert_string_to_array(s)} - s.c[i] = c; - return 0} - function caml_bytes_set(s,i,c) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_set(s,i,c)} - var Buffer=joo_global_object.Buffer; - function MlNodeFile(fd){this.fs = require("fs");this.fd = fd} - MlNodeFile.prototype = new MlFile(); - MlNodeFile.prototype.truncate - = - function(len){this.fs.ftruncateSync(this.fd,len | 0)}; - MlNodeFile.prototype.length - = - function(){return this.fs.fstatSync(this.fd).size}; - MlNodeFile.prototype.write - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.writeSync(this.fd,buffer,buf_offset,len,offset); - return 0}; - MlNodeFile.prototype.read - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,buf_offset,len,offset); - for(var i=0;i < len;i++) - caml_bytes_set(buf,buf_offset + i,buffer[buf_offset + i]); - return 0}; - MlNodeFile.prototype.read_one - = - function(offset) - {var a=new (joo_global_object.Uint8Array)(1),buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,0,1,offset); - return buffer[0]}; - MlNodeFile.prototype.close = function(){this.fs.closeSync(this.fd)}; - MlNodeFile.prototype.constructor = MlNodeFile; - function MlNodeDevice(root){this.fs = require("fs");this.root = root} - MlNodeDevice.prototype.nm = function(name){return this.root + name}; - MlNodeDevice.prototype.exists - = - function(name){return this.fs.existsSync(this.nm(name))?1:0}; - MlNodeDevice.prototype.readdir - = - function(name){return this.fs.readdirSync(this.nm(name))}; - MlNodeDevice.prototype.is_dir - = - function(name){return this.fs.statSync(this.nm(name)).isDirectory()?1:0}; - MlNodeDevice.prototype.unlink - = - function(name) - {var b=this.fs.existsSync(this.nm(name))?1:0; - this.fs.unlinkSync(this.nm(name)); - return b}; - MlNodeDevice.prototype.open - = - function(name,f) - {var consts=require("constants"),res=0; - for(var key in f) - switch(key) - {case "rdonly":res |= consts.O_RDONLY;break; - case "wronly":res |= consts.O_WRONLY;break; - case "append":res |= consts.O_WRONLY | consts.O_APPEND;break; - case "create":res |= consts.O_CREAT;break; - case "truncate":res |= consts.O_TRUNC;break; - case "excl":res |= consts.O_EXCL;break; - case "binary":res |= consts.O_BINARY;break; - case "text":res |= consts.O_TEXT;break; - case "nonblock":res |= consts.O_NONBLOCK;break - } - var fd=this.fs.openSync(this.nm(name),res); - return new MlNodeFile(fd)}; - MlNodeDevice.prototype.rename - = - function(o,n){this.fs.renameSync(this.nm(o),this.nm(n))}; - MlNodeDevice.prototype.constructor = MlNodeDevice; - var caml_root=caml_current_dir.match(/[^\/]*\//)[0]; - function fs_node_supported() - {return typeof joo_global_object.process - !== - "undefined" - && - typeof joo_global_object.process.versions - !== - "undefined" - && - typeof joo_global_object.process.versions.node - !== - "undefined" - && - joo_global_object.process.platform - !== - "browser"} - var jsoo_mount_point=[]; - if(fs_node_supported()) - jsoo_mount_point.push - ({path:caml_root,device:new MlNodeDevice(caml_root)}); - else - jsoo_mount_point.push - ({path:caml_root,device:new MlFakeDevice(caml_root)}); - jsoo_mount_point.push - ({path:caml_root + "static/", - device:new MlFakeDevice(caml_root + "static/")}); - function resolve_fs_device(name) - {var - path=caml_make_path(name), - name=path.join("/"), - name_slash=name + "/", - res; - for(var i=0;i < jsoo_mount_point.length;i++) - {var m=jsoo_mount_point[i]; - if - (name_slash.search(m.path) - == - 0 - && - (! res || res.path.length < m.path.length)) - res - = - {path:m.path, - device:m.device, - rest:name.substring(m.path.length,name.length)}} - return res} - function caml_create_file(name,content) - {var root=resolve_fs_device(name); - if(! root.device.register)caml_failwith("cannot register file"); - root.device.register(root.rest,content); - return 0} - function caml_fs_init() - {var tmp=joo_global_object.caml_fs_tmp; - if(tmp) - for(var i=0;i < tmp.length;i++) - caml_create_file(tmp[i].name,tmp[i].content); - joo_global_object.caml_create_file = caml_create_file; - joo_global_object.caml_fs_tmp = []; - return 0} - var log2_ok=Math.log2 && Math.log2(1.1235582092889474E+307) == 1020; - function jsoo_floor_log2(x) - {if(log2_ok)return Math.floor(Math.log2(x)); - var i=0; - if(x == 0)return - Infinity; - if(x >= 1)while(x >= 2){x /= 2;i++}else while(x < 1){x *= 2;i--} - return i} - function caml_int32_bits_of_float(x) - {var float32a=new (joo_global_object.Float32Array)(1); - float32a[0] = x; - var int32a=new (joo_global_object.Int32Array)(float32a.buffer); - return int32a[0] | 0} - function caml_int64_create_lo_mi_hi(lo,mi,hi){return [255,lo,mi,hi]} - function caml_int64_bits_of_float(x) - {if(! isFinite(x)) - {if(isNaN(x))return caml_int64_create_lo_mi_hi(1,0,0x7ff0); - return x > 0 - ?caml_int64_create_lo_mi_hi(0,0,0x7ff0) - :caml_int64_create_lo_mi_hi(0,0,0xfff0)} - var sign=x == 0 && 1 / x == - Infinity?0x8000:x >= 0?0:0x8000; - if(sign)x = - x; - var exp=jsoo_floor_log2(x) + 1023; - if(exp <= 0) - {exp = 0;x /= Math.pow(2,- 1026)} - else - {x /= Math.pow(2,exp - 1027); - if(x < 16){x *= 2;exp -= 1} - if(exp == 0)x /= 2} - var k=Math.pow(2,24),r3=x | 0; - x = (x - r3) * k; - var r2=x | 0; - x = (x - r2) * k; - var r1=x | 0; - r3 = r3 & 0xf | sign | exp << 4; - return caml_int64_create_lo_mi_hi(r1,r2,r3)} - function caml_int64_to_bytes(x) - {return [x[3] >> 8, - x[3] & 0xff, - x[2] >> 16, - x[2] >> 8 & 0xff, - x[2] & 0xff, - x[1] >> 16, - x[1] >> 8 & 0xff, - x[1] & 0xff]} - function caml_ba_serialize(writer,ba,sz) - {writer.write(32,ba.dims.length); - writer.write(32,ba.kind | ba.layout << 8); - for(var i=0;i < ba.dims.length;i++)writer.write(32,ba.dims[i]); - switch(ba.kind) - {case 2: - case 3: - case 12: - for(var i=0;i < ba.data.length;i++)writer.write(8,ba.data[i]);break; - case 4: - case 5: - for(var i=0;i < ba.data.length;i++)writer.write(16,ba.data[i]);break; - case 6: - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]);break; - case 8: - case 9: - writer.write(8,0); - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]); - break; - case 7: - for(var i=0;i < ba.data.length / 2;i++) - {var b=caml_int64_to_bytes(ba.get(i)); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 1: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i))); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 0: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int32_bits_of_float(ba.get(i));writer.write(32,b)} - break; - case 10: - for(var i=0;i < ba.data.length / 2;i++) - {var j=ba.get(i); - writer.write(32,caml_int32_bits_of_float(j[1])); - writer.write(32,caml_int32_bits_of_float(j[2]))} - break; - case 11: - for(var i=0;i < ba.data.length / 2;i++) - {var - complex=ba.get(i), - b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[1])); - for(var j=0;j < 8;j++)writer.write(8,b[j]); - var b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[2])); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break - } - sz[0] = (4 + ba.dims.length) * 4; - sz[1] = (4 + ba.dims.length) * 8} - function caml_ba_get_size_per_element(kind) - {switch(kind){case 7:case 10:case 11:return 2;default:return 1}} - function caml_ba_create_buffer(kind,size) - {var g=joo_global_object,view; - switch(kind) - {case 0:view = g.Float32Array;break; - case 1:view = g.Float64Array;break; - case 2:view = g.Int8Array;break; - case 3:view = g.Uint8Array;break; - case 4:view = g.Int16Array;break; - case 5:view = g.Uint16Array;break; - case 6:view = g.Int32Array;break; - case 7:view = g.Int32Array;break; - case 8:view = g.Int32Array;break; - case 9:view = g.Int32Array;break; - case 10:view = g.Float32Array;break; - case 11:view = g.Float64Array;break; - case 12:view = g.Uint8Array;break - } - if(! view)caml_invalid_argument("Bigarray.create: unsupported kind"); - var data=new view(size * caml_ba_get_size_per_element(kind)); - return data} - function caml_int32_float_of_bits(x) - {var int32a=new (joo_global_object.Int32Array)(1); - int32a[0] = x; - var float32a=new (joo_global_object.Float32Array)(int32a.buffer); - return float32a[0]} - function caml_int64_of_bytes(a) - {return [255, - a[7] | a[6] << 8 | a[5] << 16, - a[4] | a[3] << 8 | a[2] << 16, - a[1] | a[0] << 8]} - function caml_int64_float_of_bits(x) - {var lo=x[1],mi=x[2],hi=x[3],exp=(hi & 0x7fff) >> 4; - if(exp == 2047) - return (lo | mi | hi & 0xf) == 0?hi & 0x8000?- Infinity:Infinity:NaN; - var k=Math.pow(2,- 24),res=(lo * k + mi) * k + (hi & 0xf); - if(exp > 0) - {res += 16;res *= Math.pow(2,exp - 1027)} - else - res *= Math.pow(2,- 1026); - if(hi & 0x8000)res = - res; - return res} - function caml_ba_get_size(dims) - {var n_dims=dims.length,size=1; - for(var i=0;i < n_dims;i++) - {if(dims[i] < 0) - caml_invalid_argument("Bigarray.create: negative dimension"); - size = size * dims[i]} - return size} - function caml_int64_create_lo_hi(lo,hi) - {return [255, - lo & 0xffffff, - lo >>> 24 & 0xff | (hi & 0xffff) << 8, - hi >>> 16 & 0xffff]} - function caml_int64_hi32(v){return v[2] >>> 8 & 0xffff | v[3] << 16} - function caml_int64_lo32(v){return v[1] | (v[2] & 0xff) << 24} - function caml_array_bound_error() - {caml_invalid_argument("index out of bounds")} - function Ml_Bigarray(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray.prototype.caml_custom = "_bigarray"; - Ml_Bigarray.prototype.offset - = - function(arg) - {var ofs=0; - if(typeof arg === "number")arg = [arg]; - if(! (arg instanceof Array)) - caml_invalid_argument("bigarray.js: invalid offset"); - if(this.dims.length != arg.length) - caml_invalid_argument("Bigarray.get/set: bad number of dimensions"); - if(this.layout == 0) - for(var i=0;i < this.dims.length;i++) - {if(arg[i] < 0 || arg[i] >= this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + arg[i]} - else - for(var i=this.dims.length - 1;i >= 0;i--) - {if(arg[i] < 1 || arg[i] > this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + (arg[i] - 1)} - return ofs}; - Ml_Bigarray.prototype.get - = - function(ofs) - {switch(this.kind) - {case 7: - var l=this.data[ofs * 2 + 0],h=this.data[ofs * 2 + 1]; - return caml_int64_create_lo_hi(l,h); - case 10: - case 11: - var r=this.data[ofs * 2 + 0],i=this.data[ofs * 2 + 1]; - return [254,r,i]; - default:return this.data[ofs]}}; - Ml_Bigarray.prototype.set - = - function(ofs,v) - {switch(this.kind) - {case 7: - this.data[ofs * 2 + 0] = caml_int64_lo32(v); - this.data[ofs * 2 + 1] = caml_int64_hi32(v); - break; - case 10: - case 11: - this.data[ofs * 2 + 0] = v[1];this.data[ofs * 2 + 1] = v[2];break; - default:this.data[ofs] = v;break} - return 0}; - Ml_Bigarray.prototype.fill - = - function(v) - {switch(this.kind) - {case 7: - var a=caml_int64_lo32(v),b=caml_int64_hi32(v); - if(a == b) - this.data.fill(a); - else - for(var i=0;i < this.data.length;i++)this.data[i] = i % 2 == 0?a:b; - break; - case 10: - case 11: - var im=v[1],re=v[2]; - if(im == re) - this.data.fill(im); - else - for(var i=0;i < this.data.length;i++) - this.data[i] = i % 2 == 0?im:re; - break; - default:this.data.fill(v);break}}; - Ml_Bigarray.prototype.compare - = - function(b,total) - {if(this.layout != b.layout || this.kind != b.kind) - {var k1=this.kind | this.layout << 8,k2=b.kind | b.layout << 8; - return k2 - k1} - if(this.dims.length != b.dims.length) - return b.dims.length - this.dims.length; - for(var i=0;i < this.dims.length;i++) - if(this.dims[i] != b.dims[i])return this.dims[i] < b.dims[i]?- 1:1; - switch(this.kind) - {case 0: - case 1: - case 10: - case 11: - var x,y; - for(var i=0;i < this.data.length;i++) - {x = this.data[i]; - y = b.data[i]; - if(x < y)return - 1; - if(x > y)return 1; - if(x != y) - {if(! total)return NaN;if(x == x)return 1;if(y == y)return - 1}} - break; - case 7: - for(var i=0;i < this.data.length;i += 2) - {if(this.data[i + 1] < b.data[i + 1])return - 1; - if(this.data[i + 1] > b.data[i + 1])return 1; - if(this.data[i] >>> 0 < b.data[i] >>> 0)return - 1; - if(this.data[i] >>> 0 > b.data[i] >>> 0)return 1} - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - case 12: - for(var i=0;i < this.data.length;i++) - {if(this.data[i] < b.data[i])return - 1; - if(this.data[i] > b.data[i])return 1} - break - } - return 0}; - function Ml_Bigarray_c_1_1(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray_c_1_1.prototype = new Ml_Bigarray(); - Ml_Bigarray_c_1_1.prototype.offset - = - function(arg) - {if(typeof arg !== "number") - if(arg instanceof Array && arg.length == 1) - arg = arg[0]; - else - caml_invalid_argument("Ml_Bigarray_c_1_1.offset"); - if(arg < 0 || arg >= this.dims[0])caml_array_bound_error(); - return arg}; - Ml_Bigarray_c_1_1.prototype.get = function(ofs){return this.data[ofs]}; - Ml_Bigarray_c_1_1.prototype.set - = - function(ofs,v){this.data[ofs] = v;return 0}; - Ml_Bigarray_c_1_1.prototype.fill - = - function(v){this.data.fill(v);return 0}; - function caml_ba_create_unsafe(kind,layout,dims,data) - {var size_per_element=caml_ba_get_size_per_element(kind); - if(caml_ba_get_size(dims) * size_per_element != data.length) - caml_invalid_argument("length doesn't match dims"); - if(layout == 0 && dims.length == 1 && size_per_element == 1) - return new Ml_Bigarray_c_1_1(kind,layout,dims,data); - return new Ml_Bigarray(kind,layout,dims,data)} - function caml_ba_deserialize(reader,sz) - {var num_dims=reader.read32s(); - if(num_dims < 0 || num_dims > 16) - caml_failwith("input_value: wrong number of bigarray dimensions"); - var tag=reader.read32s(),kind=tag & 0xff,layout=tag >> 8 & 1,dims=[]; - for(var i=0;i < num_dims;i++)dims.push(reader.read32u()); - var - size=caml_ba_get_size(dims), - data=caml_ba_create_buffer(kind,size), - ba=caml_ba_create_unsafe(kind,layout,dims,data); - switch(kind) - {case 2:for(var i=0;i < size;i++)data[i] = reader.read8s();break; - case 3: - case 12:for(var i=0;i < size;i++)data[i] = reader.read8u();break; - case 4:for(var i=0;i < size;i++)data[i] = reader.read16s();break; - case 5:for(var i=0;i < size;i++)data[i] = reader.read16u();break; - case 6:for(var i=0;i < size;i++)data[i] = reader.read32s();break; - case 8: - case 9: - var sixty=reader.read8u(); - if(sixty) - caml_failwith - ("input_value: cannot read bigarray with 64-bit OCaml ints"); - for(var i=0;i < size;i++)data[i] = reader.read32s(); - break; - case 7: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var int64=caml_int64_of_bytes(t); - ba.set(i,int64)} - break; - case 1: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var f=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,f)} - break; - case 0: - for(var i=0;i < size;i++) - {var f=caml_int32_float_of_bits(reader.read32s());ba.set(i,f)} - break; - case 10: - for(var i=0;i < size;i++) - {var - re=caml_int32_float_of_bits(reader.read32s()), - im=caml_int32_float_of_bits(reader.read32s()); - ba.set(i,[254,re,im])} - break; - case 11: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var re=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var im=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,[254,re,im])} - break - } - sz[0] = (4 + num_dims) * 4; - return caml_ba_create_unsafe(kind,layout,dims,data)} - function caml_ba_compare(a,b,total){return a.compare(b,total)} - if(! Math.imul) - Math.imul - = - function(x,y){y |= 0;return ((x >> 16) * y << 16) + (x & 0xffff) * y | 0}; - var caml_mul=Math.imul; - function caml_hash_mix_int(h,d) - {d = caml_mul(d,0xcc9e2d51 | 0); - d = d << 15 | d >>> 32 - 15; - d = caml_mul(d,0x1b873593); - h ^= d; - h = h << 13 | h >>> 32 - 13; - return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0} - function caml_hash_mix_int64(h,v) - {h = caml_hash_mix_int(h,caml_int64_lo32(v)); - h = caml_hash_mix_int(h,caml_int64_hi32(v)); - return h} - function caml_hash_mix_float(h,v0) - {return caml_hash_mix_int64(h,caml_int64_bits_of_float(v0))} - function caml_ba_hash(ba) - {var num_elts=caml_ba_get_size(ba.dims),h=0; - switch(ba.kind) - {case 2: - case 3: - case 12: - if(num_elts > 256)num_elts = 256; - var w=0,i=0; - for(i = 0;i + 4 <= ba.data.length;i += 4) - {w - = - ba.data[i + 0] - | - ba.data[i + 1] - << - 8 - | - ba.data[i + 2] - << - 16 - | - ba.data[i + 3] - << - 24; - h = caml_hash_mix_int(h,w)} - w = 0; - switch(num_elts & 3) - {case 3:w = ba.data[i + 2] << 16; - case 2:w |= ba.data[i + 1] << 8; - case 1:w |= ba.data[i + 0];h = caml_hash_mix_int(h,w) - } - break; - case 4: - case 5: - if(num_elts > 128)num_elts = 128; - var w=0,i=0; - for(i = 0;i + 2 <= ba.data.length;i += 2) - {w = ba.data[i + 0] | ba.data[i + 1] << 16; - h = caml_hash_mix_int(h,w)} - if((num_elts & 1) != 0)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 6: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 8: - case 9: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 7: - if(num_elts > 32)num_elts = 32; - num_elts *= 2; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 10:num_elts *= 2; - case 0: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break; - case 11:num_elts *= 2; - case 1: - if(num_elts > 32)num_elts = 32; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break - } - return h} - function caml_int32_unmarshal(reader,size) - {size[0] = 4;return reader.read32s()} - function caml_nativeint_unmarshal(reader,size) - {switch(reader.read8u()) - {case 1:size[0] = 4;return reader.read32s(); - case 2:caml_failwith("input_value: native integer value too large"); - default:caml_failwith("input_value: ill-formed native integer")}} - function caml_int64_unmarshal(reader,size) - {var t=new Array(8); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - size[0] = 8; - return caml_int64_of_bytes(t)} - function caml_int64_marshal(writer,v,sizes) - {var b=caml_int64_to_bytes(v); - for(var i=0;i < 8;i++)writer.write(8,b[i]); - sizes[0] = 8; - sizes[1] = 8} - function caml_int64_compare(x,y) - {var x3=x[3] << 16,y3=y[3] << 16; - if(x3 > y3)return 1; - if(x3 < y3)return - 1; - if(x[2] > y[2])return 1; - if(x[2] < y[2])return - 1; - if(x[1] > y[1])return 1; - if(x[1] < y[1])return - 1; - return 0} - function caml_int64_hash(x) - {var lo=x[1] | (x[2] & 0xff) << 24,hi=x[2] >>> 8 & 0xffff | x[3] << 16; - return lo ^ hi} - var - caml_custom_ops= - {"_j": - {deserialize:caml_int64_unmarshal, - serialize:caml_int64_marshal, - fixed_length:8, - compare:caml_int64_compare, - hash:caml_int64_hash}, - "_i":{deserialize:caml_int32_unmarshal,fixed_length:4}, - "_n":{deserialize:caml_nativeint_unmarshal,fixed_length:4}, - "_bigarray": - {deserialize:caml_ba_deserialize, - serialize:caml_ba_serialize, - compare:caml_ba_compare, - hash:caml_ba_hash}}; - function caml_compare_val_get_custom(a) - {return caml_custom_ops[a.caml_custom] - && - caml_custom_ops[a.caml_custom].compare} - function caml_compare_val_number_custom(num,custom,swap,total) - {var comp=caml_compare_val_get_custom(custom); - if(comp) - {var x=swap > 0?comp(custom,num,total):comp(num,custom,total); - if(total && x != x)return swap; - if(+ x != + x)return + x; - if((x | 0) != 0)return x | 0} - return swap} - function caml_compare_val_tag(a) - {if(typeof a === "number") - return 1000; - else - if(a instanceof MlBytes) - return 252; - else - if(a instanceof Array && a[0] === a[0] >>> 0 && a[0] <= 255) - {var tag=a[0] | 0;return tag == 254?0:tag} - else - if(a instanceof String) - return 1252; - else - if(typeof a == "string") - return 1252; - else - if(a instanceof Number) - return 1000; - else - if(a && a.caml_custom) - return 1255; - else - if(a && a.compare) - return 1256; - else - if(typeof a == "function") - return 1247; - else - if(typeof a == "symbol")return 1251; - return 1001} - function caml_int_compare(a,b) - {if(a < b)return - 1;if(a == b)return 0;return 1} - function caml_string_compare(s1,s2) - {s1.t & 6 && caml_convert_string_to_bytes(s1); - s2.t & 6 && caml_convert_string_to_bytes(s2); - return s1.c < s2.c?- 1:s1.c > s2.c?1:0} - function caml_compare_val(a,b,total) - {var stack=[]; - for(;;) - {if(! (total && a === b)) - {var tag_a=caml_compare_val_tag(a); - if(tag_a == 250){a = a[1];continue} - var tag_b=caml_compare_val_tag(b); - if(tag_b == 250){b = b[1];continue} - if(tag_a !== tag_b) - {if(tag_a == 1000) - {if(tag_b == 1255) - return caml_compare_val_number_custom(a,b,- 1,total); - return - 1} - if(tag_b == 1000) - {if(tag_a == 1255) - return caml_compare_val_number_custom(b,a,1,total); - return 1} - return tag_a < tag_b?- 1:1} - switch(tag_a) - {case 247:caml_invalid_argument("compare: functional value");break; - case 248: - var x=caml_int_compare(a[2],b[2]);if(x != 0)return x | 0;break; - case 249:caml_invalid_argument("compare: functional value");break; - case 250: - caml_invalid_argument - ("equal: got Forward_tag, should not happen"); - break; - case 251:caml_invalid_argument("equal: abstract value");break; - case 252: - if(a !== b) - {var x=caml_string_compare(a,b);if(x != 0)return x | 0} - break; - case 253: - caml_invalid_argument("equal: got Double_tag, should not happen"); - break; - case 254: - caml_invalid_argument - ("equal: got Double_array_tag, should not happen"); - break; - case 255: - var x=caml_int64_compare(a,b);if(x != 0)return x | 0;break; - case 1247: - caml_invalid_argument("compare: functional value");break; - case 1255: - var comp=caml_compare_val_get_custom(a); - if(comp != caml_compare_val_get_custom(b)) - return a.caml_custom < b.caml_custom?- 1:1; - if(! comp)caml_invalid_argument("compare: abstract value"); - var x=comp(a,b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1256: - var x=a.compare(b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1000: - a = + a; - b = + b; - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1001: - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1251:if(a !== b){if(! total)return NaN;return 1}break; - case 1252: - var a=a.toString(),b=b.toString(); - if(a !== b){if(a < b)return - 1;if(a > b)return 1} - break; - case 246: - case 254: - default: - if(a.length != b.length)return a.length < b.length?- 1:1; - if(a.length > 1)stack.push(a,b,1); - break}} - if(stack.length == 0)return 0; - var i=stack.pop(); - b = stack.pop(); - a = stack.pop(); - if(i + 1 < a.length)stack.push(a,b,i + 1); - a = a[i]; - b = b[i]}} - function caml_greaterequal(x,y) - {return + (caml_compare_val(x,y,false) >= 0)} - function caml_js_get_console() - {var - c=joo_global_object.console?joo_global_object.console:{}, - m= - ["log", - "debug", - "info", - "warn", - "error", - "assert", - "dir", - "dirxml", - "trace", - "group", - "groupCollapsed", - "groupEnd", - "time", - "timeEnd"]; - function f(){} - for(var i=0;i < m.length;i++)if(! c[m[i]])c[m[i]] = f; - return c} - var caml_js_regexps={amp:/&/g,lt:/ 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - if(c < 0x800) - {t += String.fromCharCode(0xc0 | c >> 6); - t += String.fromCharCode(0x80 | c & 0x3f)} - else - if(c < 0xd800 || c >= 0xdfff) - t - += - String.fromCharCode - (0xe0 | c >> 12,0x80 | c >> 6 & 0x3f,0x80 | c & 0x3f); - else - if - (c - >= - 0xdbff - || - i - + - 1 - == - l - || - (d = s.charCodeAt(i + 1)) - < - 0xdc00 - || - d - > - 0xdfff) - t += "\xef\xbf\xbd"; - else - {i++; - c = (c << 10) + d - 0x35fdc00; - t - += - String.fromCharCode - (0xf0 | c >> 18, - 0x80 | c >> 12 & 0x3f, - 0x80 | c >> 6 & 0x3f, - 0x80 | c & 0x3f)} - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_js_to_string(s) - {var tag=9; - if(! caml_is_ascii(s))tag = 8,s = caml_utf8_of_utf16(s); - return new MlBytes(tag,s,s.length)} - function caml_js_wrap_callback(f) - {return function() - {return arguments.length > 0 - ?caml_call_gen(f,arguments) - :caml_call_gen(f,[undefined])}} - function caml_lessequal(x,y){return + (caml_compare_val(x,y,false) <= 0)} - function caml_lessthan(x,y){return + (caml_compare_val(x,y,false) < 0)} - var caml_ml_channels=new Array(); - function caml_ml_flush(chanid) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened)caml_raise_sys_error("Cannot flush a closed channel"); - if(! chan.buffer || chan.buffer == "")return 0; - if - (chan.fd - && - caml_global_data.fds[chan.fd] - && - caml_global_data.fds[chan.fd].output) - {var output=caml_global_data.fds[chan.fd].output; - switch(output.length) - {case 2:output(chanid,chan.buffer);break;default:output(chan.buffer)}} - chan.buffer = ""; - return 0} - function caml_ml_string_length(s){return s.l} - function caml_std_output(chanid,s) - {var - chan=caml_ml_channels[chanid], - str=caml_new_string(s), - slen=caml_ml_string_length(str); - chan.file.write(chan.offset,str,0,slen); - chan.offset += slen; - return 0} - function js_print_stderr(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stderr.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.error && v.error(s)}} - function js_print_stdout(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stdout.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.log && v.log(s)}} - function caml_sys_open_internal(idx,output,file,flags) - {if(caml_global_data.fds === undefined) - caml_global_data.fds = new Array(); - flags = flags?flags:{}; - var info={}; - info.file = file; - info.offset = flags.append?file.length():0; - info.flags = flags; - info.output = output; - caml_global_data.fds[idx] = info; - if(! caml_global_data.fd_last_idx || idx > caml_global_data.fd_last_idx) - caml_global_data.fd_last_idx = idx; - return idx} - function caml_sys_open(name,flags,_perms) - {var f={}; - while(flags) - {switch(flags[1]) - {case 0:f.rdonly = 1;break; - case 1:f.wronly = 1;break; - case 2:f.append = 1;break; - case 3:f.create = 1;break; - case 4:f.truncate = 1;break; - case 5:f.excl = 1;break; - case 6:f.binary = 1;break; - case 7:f.text = 1;break; - case 8:f.nonblock = 1;break - } - flags = flags[2]} - if(f.rdonly && f.wronly) - caml_raise_sys_error - (name.toString() - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (name.toString() - + - " : flags Open_text and Open_binary are not compatible"); - var - root=resolve_fs_device(name), - file=root.device.open(root.rest,f), - idx=caml_global_data.fd_last_idx?caml_global_data.fd_last_idx:0; - return caml_sys_open_internal(idx + 1,caml_std_output,file,f)} - caml_sys_open_internal - (0,caml_std_output,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (1,js_print_stdout,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (2,js_print_stderr,new MlFakeFile(caml_create_bytes(0))); - function caml_ml_open_descriptor_in(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.wronly)caml_raise_sys_error("fd " + fd + " is writeonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:false, - refill:null}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_open_descriptor_out(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.rdonly)caml_raise_sys_error("fd " + fd + " is readonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:true, - buffer:""}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_out_channels_list() - {var l=0; - for(var c=0;c < caml_ml_channels.length;c++) - if - (caml_ml_channels[c] - && - caml_ml_channels[c].opened - && - caml_ml_channels[c].out) - l = [0,caml_ml_channels[c].fd,l]; - return l} - function caml_jsbytes_of_string(s) - {if((s.t & 6) != 0)caml_convert_string_to_bytes(s);return s.c} - function caml_ml_output_bytes(chanid,buffer,offset,len) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened) - caml_raise_sys_error("Cannot output to a closed channel"); - var string; - if(offset == 0 && caml_ml_bytes_length(buffer) == len) - string = buffer; - else - {string = caml_create_bytes(len); - caml_blit_bytes(buffer,offset,string,0,len)} - var - jsstring=caml_jsbytes_of_string(string), - id=jsstring.lastIndexOf("\n"); - if(id < 0) - chan.buffer += jsstring; - else - {chan.buffer += jsstring.substr(0,id + 1); - caml_ml_flush(chanid); - chan.buffer += jsstring.substr(id + 1)} - return 0} - function caml_ml_output(chanid,buffer,offset,len) - {return caml_ml_output_bytes(chanid,buffer,offset,len)} - function caml_obj_tag(x) - {if(x instanceof Array && x[0] == x[0] >>> 0) - return x[0]; - else - if(x instanceof MlBytes) - return 252; - else - if(x instanceof Function || typeof x == "function") - return 247; - else - if(x && x.caml_custom)return 255;else return 1000} - function caml_register_global(n,v,name_opt) - {if(name_opt && joo_global_object.toplevelReloc) - n = joo_global_object.toplevelReloc(name_opt); - caml_global_data[n + 1] = v; - if(name_opt)caml_global_data[name_opt] = v} - var caml_named_values={}; - function caml_register_named_value(nm,v) - {caml_named_values[caml_jsbytes_of_string(nm)] = v;return 0} - function caml_string_of_bytes(s){return s} - function caml_sys_const_backend_type() - {return [0,caml_new_string("js_of_ocaml")]} - function caml_sys_const_max_wosize(){return 0x7FFFFFFF / 4 | 0} - var - caml_argv= - function() - {var g=joo_global_object,main="a.out",args=[]; - if(g.process && g.process.argv && g.process.argv.length > 1) - {var argv=g.process.argv; - main = argv[1]; - args = raw_array_sub(argv,2,argv.length - 2)} - var p=caml_js_to_string(main),args2=[0,p]; - for(var i=0;i < args.length;i++) - args2.push(caml_js_to_string(args[i])); - return args2} - (); - function caml_sys_get_argv(a){return [0,caml_argv[1],caml_argv]} - function caml_return_exn_constant(tag){return tag} - function caml_named_value(nm){return caml_named_values[nm]} - function caml_wrap_exception(e) - {if(e instanceof Array)return e; - if - (joo_global_object.RangeError - && - e instanceof joo_global_object.RangeError - && - e.message - && - e.message.match(/maximum call stack/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if - (joo_global_object.InternalError - && - e instanceof joo_global_object.InternalError - && - e.message - && - e.message.match(/too much recursion/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if(e instanceof joo_global_object.Error && caml_named_value("jsError")) - return [0,caml_named_value("jsError"),e]; - return [0,caml_global_data.Failure,caml_js_to_string(String(e))]} - function caml_call1(f,a0) - {return f.length == 1?f(a0):caml_call_gen(f,[a0])} - function caml_call3(f,a0,a1,a2) - {return f.length == 3?f(a0,a1,a2):caml_call_gen(f,[a0,a1,a2])} - caml_fs_init(); - var - Out_of_memory=[248,caml_new_string("Out_of_memory"),-1], - Sys_error=[248,caml_new_string("Sys_error"),-2], - Failure=[248,caml_new_string("Failure"),-3], - Invalid_argument=[248,caml_new_string("Invalid_argument"),-4], - End_of_file=[248,caml_new_string("End_of_file"),-5], - Division_by_zero=[248,caml_new_string("Division_by_zero"),-6], - Not_found=[248,caml_new_string("Not_found"),-7], - Match_failure=[248,caml_new_string("Match_failure"),-8], - Stack_overflow=[248,caml_new_string("Stack_overflow"),-9], - Sys_blocked_io=[248,caml_new_string("Sys_blocked_io"),-10], - Assert_failure=[248,caml_new_string("Assert_failure"),-11], - Undefined_recursive_module= - [248,caml_new_string("Undefined_recursive_module"),-12]; - caml_register_global - (11,Undefined_recursive_module,"Undefined_recursive_module"); - caml_register_global(10,Assert_failure,"Assert_failure"); - caml_register_global(9,Sys_blocked_io,"Sys_blocked_io"); - caml_register_global(8,Stack_overflow,"Stack_overflow"); - caml_register_global(7,Match_failure,"Match_failure"); - caml_register_global(6,Not_found,"Not_found"); - caml_register_global(5,Division_by_zero,"Division_by_zero"); - caml_register_global(4,End_of_file,"End_of_file"); - caml_register_global(3,Invalid_argument,"Invalid_argument"); - caml_register_global(2,Failure,"Failure"); - caml_register_global(1,Sys_error,"Sys_error"); - caml_register_global(0,Out_of_memory,"Out_of_memory"); - var - _f_=caml_new_string("output_substring"), - _o_=caml_new_string("String.blit / Bytes.blit_string"), - _n_=caml_new_string("Bytes.blit"), - _s_=caml_new_string(""), - _q_=caml_new_string("String.concat"), - _x_=caml_new_string("Buffer.add_substring/add_subbytes"), - _w_=caml_new_string("Buffer.add: cannot grow buffer"), - _ac_=[3,0,3], - _ad_=caml_new_string("."), - ___=caml_new_string(">"), - _$_=caml_new_string("<\/"), - _X_=caml_new_string(">"), - _Y_=caml_new_string("<"), - _U_=caml_new_string("\n"), - _B_=caml_new_string("Stdlib.Format.Empty_queue"), - _Q_=[0,caml_new_string("")], - _ao_=caml_new_string("Js_of_ocaml__Js.Error"), - _az_=caml_new_string("button"), - _aM_=caml_new_string(":"), - _aL_=caml_new_string("}"), - _aN_=caml_new_string(","), - _aO_=caml_new_string("{"), - _aP_=caml_new_string("cannot parse json "), - _aI_=caml_new_string('"'), - _aJ_=caml_new_string('"'), - _aE_=caml_new_string(": "), - _aF_=caml_new_string("; "), - _aG_=caml_new_string("style"), - _aS_=caml_new_string("color is "), - _aR_=caml_new_string("color"), - _aT_=caml_new_string("click"), - _aU_=caml_new_string("background-color"), - _aQ_= - [0, - caml_new_string("#3aa757"), - [0, - caml_new_string("#e8453c"), - [0,caml_new_string("#f9bb2d"),[0,caml_new_string("#4688f1"),0]]]]; - function _a_(_eS_){throw [0,Invalid_argument,_eS_]} - caml_fresh_oo_id(0); - var _b_=2147483647; - function _c_(_eO_,_eN_) - {var - _eP_=caml_ml_string_length(_eO_), - _eQ_=caml_ml_string_length(_eN_), - _eR_=caml_create_bytes(_eP_ + _eQ_ | 0); - caml_blit_string(_eO_,0,_eR_,0,_eP_); - caml_blit_string(_eN_,0,_eR_,_eP_,_eQ_); - return caml_string_of_bytes(_eR_)} - caml_ml_open_descriptor_in(0); - var - _d_=caml_ml_open_descriptor_out(1), - _e_=caml_ml_open_descriptor_out(2), - _g_= - [0, - function(_eF_) - {function _eG_(_eH_) - {var _eI_=_eH_; - for(;;) - {if(_eI_) - {var _eJ_=_eI_[2],_eK_=_eI_[1]; - try - {caml_ml_flush(_eK_)} - catch(_eM_) - {_eM_ = caml_wrap_exception(_eM_); - if(_eM_[1] !== Sys_error)throw _eM_; - var _eL_=_eM_} - var _eI_=_eJ_; - continue} - return 0}} - return _eG_(caml_ml_out_channels_list(0))}]; - caml_sys_get_argv(0); - var _j_=(4 * caml_sys_const_max_wosize(0) | 0) - 1 | 0; - caml_fresh_oo_id(0); - typeof caml_sys_const_backend_type(0) === "number"; - function _k_(_eC_,_eB_) - {if(_eB_) - {var _eD_=_eB_[2],_eE_=caml_call1(_eC_,_eB_[1]); - return [0,_eE_,_k_(_eC_,_eD_)]} - return 0} - function _l_(_ey_,_ex_) - {var _ez_=_ex_; - for(;;) - {if(_ez_) - {var _eA_=_ez_[2];caml_call1(_ey_,_ez_[1]);var _ez_=_eA_;continue} - return 0}} - function _r_(_es_,_er_) - {if(_er_) - {var _et_=caml_ml_string_length(_es_),_ei_=0,_eh_=_er_,_eu_=0; - for(;;) - {if(_eh_) - {var _ej_=_eh_[2],_ek_=_eh_[1]; - if(_ej_) - {var - _el_=(caml_ml_string_length(_ek_) + _et_ | 0) + _ei_ | 0, - _em_=_ei_ <= _el_?_el_:_a_(_q_), - _ei_=_em_, - _eh_=_ej_; - continue} - var _ev_=caml_ml_string_length(_ek_) + _ei_ | 0} - else - var _ev_=_ei_; - var _ew_=caml_create_bytes(_ev_),_eo_=_eu_,_en_=_er_; - for(;;) - {if(_en_) - {var _ep_=_en_[2],_eq_=_en_[1]; - if(_ep_) - {caml_blit_string(_eq_,0,_ew_,_eo_,caml_ml_string_length(_eq_)); - caml_blit_string - (_es_,0,_ew_,_eo_ + caml_ml_string_length(_eq_) | 0,_et_); - var - _eo_=(_eo_ + caml_ml_string_length(_eq_) | 0) + _et_ | 0, - _en_=_ep_; - continue} - caml_blit_string(_eq_,0,_ew_,_eo_,caml_ml_string_length(_eq_))} - return caml_string_of_bytes(_ew_)}}} - return _s_} - caml_fresh_oo_id(0); - caml_fresh_oo_id(0); - var _y_=[0,0]; - function _z_(_eg_){_y_[1] = [0,_eg_,_y_[1]];return 0} - function _A_(_ed_,_ec_) - {var _ee_=[0,_ed_,0],_ef_=_ec_[1]; - return _ef_ - ?(_ec_[1] = _ee_,_ef_[2] = _ee_,0) - :(_ec_[1] = _ee_,_ec_[2] = _ee_,0)} - var _C_=[248,_B_,caml_fresh_oo_id(0)]; - function _D_(_d__) - {var _d$_=_d__[2]; - if(_d$_) - {var _eb_=_d$_[2],_ea_=_d$_[1]; - _d__[2] = _eb_; - if(0 === _eb_)_d__[1] = 0; - return _ea_} - throw _C_} - function _E_(_d9_,_d8_) - {_d9_[13] = _d9_[13] + _d8_[3] | 0;return _A_(_d8_,_d9_[28])} - var _F_=1000000010; - function _G_(_d7_,_d6_) - {return caml_call3(_d7_[17],_d6_,0,caml_ml_string_length(_d6_))} - function _H_(_d5_){return caml_call1(_d5_[19],0)} - function _I_(_d1_,_d0_,_dZ_) - {_H_(_d1_); - _d1_[11] = 1; - var - _d2_=(_d1_[6] - _dZ_ | 0) + _d0_ | 0, - _d3_=_d1_[8], - _d4_=caml_lessequal(_d3_,_d2_)?_d3_:_d2_; - _d1_[10] = _d4_; - _d1_[9] = _d1_[6] - _d1_[10] | 0; - return caml_call1(_d1_[21],_d1_[10])} - function _J_(_dY_,_dX_){return _I_(_dY_,0,_dX_)} - function _K_(_dW_,_dV_) - {_dW_[9] = _dW_[9] - _dV_ | 0;return caml_call1(_dW_[20],_dV_)} - function _L_(_dO_) - {var _dP_=_dO_[2]; - if(_dP_) - {var _dQ_=_dP_[1],_dR_=_dQ_[2],_dS_=_dQ_[1],_dT_=_dO_[9] < _dR_?1:0; - if(_dT_) - {if(0 !== _dS_)return 5 <= _dS_?0:_J_(_dO_,_dR_);var _dU_=0} - else - var _dU_=_dT_; - return _dU_} - return _H_(_dO_)} - function _M_(_dL_) - {var _dM_=_D_(_dL_[28]),_dN_=_dM_[1]; - _dL_[12] = _dL_[12] - _dM_[3] | 0; - _dL_[9] = _dL_[9] + _dN_ | 0; - return 0} - function _N_(_c6_,_c5_,_c4_) - {if(typeof _c4_ === "number") - switch(_c4_) - {case 0: - var _c7_=_c6_[3]; - if(_c7_) - {var - _c8_=_c7_[1][1], - _c9_= - function(_dC_,_dB_) - {if(_dB_) - {var _dE_=_dB_[1],_dD_=_dB_[2]; - return caml_lessthan(_dC_,_dE_) - ?[0,_dC_,_dB_] - :[0,_dE_,_c9_(_dC_,_dD_)]} - return [0,_dC_,0]}; - _c8_[1] = _c9_(_c6_[6] - _c6_[9] | 0,_c8_[1]); - return 0} - return 0; - case 1:var _c__=_c6_[2];return _c__?(_c6_[2] = _c__[2],0):0; - case 2:var _c$_=_c6_[3];return _c$_?(_c6_[3] = _c$_[2],0):0; - case 3:var _da_=_c6_[2];return _da_?_J_(_c6_,_da_[1][2]):_H_(_c6_); - case 4: - var _db_=_c6_[10] !== (_c6_[6] - _c6_[9] | 0)?1:0; - return _db_?_M_(_c6_):_db_; - default: - var _dc_=_c6_[5]; - if(_dc_) - {var _dd_=_dc_[2]; - _G_(_c6_,caml_call1(_c6_[25],_dc_[1])); - _c6_[5] = _dd_; - return 0} - return 0} - else - switch(_c4_[0]) - {case 0: - var _de_=_c4_[1]; - _c6_[9] = _c6_[9] - _c5_ | 0; - _G_(_c6_,_de_); - _c6_[11] = 0; - return 0; - case 1: - var _df_=_c4_[2],_dg_=_c4_[1],_dh_=_c6_[2]; - if(_dh_) - {var _di_=_dh_[1],_dj_=_di_[2]; - switch(_di_[1]) - {case 0:return _K_(_c6_,_dg_); - case 1:return _I_(_c6_,_df_,_dj_); - case 2:return _I_(_c6_,_df_,_dj_); - case 3:return _c6_[9] < _c5_?_I_(_c6_,_df_,_dj_):_K_(_c6_,_dg_); - case 4: - return _c6_[11] - ?_K_(_c6_,_dg_) - :_c6_[9] < _c5_ - ?_I_(_c6_,_df_,_dj_) - :((_c6_[6] - _dj_ | 0) + _df_ | 0) < _c6_[10] - ?_I_(_c6_,_df_,_dj_) - :_K_(_c6_,_dg_); - default:return _K_(_c6_,_dg_)}} - return 0; - case 2: - var - _dm_=_c6_[6] - _c6_[9] | 0, - _dn_=_c6_[3], - _dk_=_c4_[2], - _dl_=_c4_[1]; - if(_dn_) - {var - _do_=_dn_[1][1], - _dp_= - function(_dH_,_dG_) - {var _dI_=_dG_; - for(;;) - {if(_dI_) - {var _dK_=_dI_[1],_dJ_=_dI_[2]; - if(caml_greaterequal(_dK_,_dH_))return _dK_; - var _dI_=_dJ_; - continue} - throw Not_found}}, - _dq_=_do_[1]; - if(_dq_) - {var _dr_=_dq_[1]; - try - {var _dv_=_dp_(_dm_,_do_[1]),_ds_=_dv_} - catch(_dF_) - {_dF_ = caml_wrap_exception(_dF_); - if(_dF_ !== Not_found)throw _dF_; - var _ds_=_dr_} - var _dt_=_ds_} - else - var _dt_=_dm_; - var _du_=_dt_ - _dm_ | 0; - return 0 <= _du_ - ?_K_(_c6_,_du_ + _dl_ | 0) - :_I_(_c6_,_dt_ + _dk_ | 0,_c6_[6])} - return 0; - case 3: - var _dw_=_c4_[2],_dx_=_c4_[1]; - if(_c6_[8] < (_c6_[6] - _c6_[9] | 0))_L_(_c6_); - var _dy_=_c6_[9] - _dx_ | 0,_dz_=1 === _dw_?1:_c6_[9] < _c5_?_dw_:5; - _c6_[2] = [0,[0,_dz_,_dy_],_c6_[2]]; - return 0; - case 4:_c6_[3] = [0,_c4_[1],_c6_[3]];return 0; - default: - var _dA_=_c4_[1]; - _G_(_c6_,caml_call1(_c6_[24],_dA_)); - _c6_[5] = [0,_dA_,_c6_[5]]; - return 0}} - function _O_(_cW_) - {for(;;) - {var _cU_=_cW_[28][2]; - if(_cU_) - {var - _cV_=_cU_[1], - _cX_=_cV_[1], - _c0_=_cX_ < 0?1:0, - _cY_=_cV_[3], - _cZ_=_cV_[2], - _c1_=_c0_?(_cW_[13] - _cW_[12] | 0) < _cW_[9]?1:0:_c0_, - _c2_=1 - _c1_; - if(_c2_) - {_D_(_cW_[28]); - var _c3_=0 <= _cX_?_cX_:_F_; - _N_(_cW_,_c3_,_cZ_); - _cW_[12] = _cY_ + _cW_[12] | 0; - continue} - return _c2_} - throw _C_}} - function _P_(_cR_) - {try - {var _cS_=_O_(_cR_);return _cS_} - catch(_cT_) - {_cT_ = caml_wrap_exception(_cT_);if(_cT_ === _C_)return 0;throw _cT_}} - var _R_=[0,[0,-1,[0,-1,_Q_,0]],0]; - function _S_(_cQ_){_cQ_[1] = _R_;return 0} - function _T_(_cG_,_cF_) - {var _cH_=_cG_[1]; - if(_cH_) - {var _cI_=_cH_[1],_cJ_=_cI_[2],_cK_=_cJ_[1],_cL_=_cH_[2],_cM_=_cJ_[2]; - if(_cI_[1] < _cG_[12])return _S_(_cG_); - if(typeof _cM_ !== "number") - switch(_cM_[0]) - {case 3: - var - _cO_=1 - _cF_, - _cP_=_cO_?(_cJ_[1] = _cG_[13] + _cK_ | 0,_cG_[1] = _cL_,0):_cO_; - return _cP_; - case 1: - case 2: - var - _cN_= - _cF_?(_cJ_[1] = _cG_[13] + _cK_ | 0,_cG_[1] = _cL_,0):_cF_; - return _cN_ - } - return 0} - return 0} - var _m_=caml_create_bytes(80); - caml_fill_bytes(_m_,0,80,32); - var _p_=caml_string_of_bytes(_m_); - function _V_(_cC_,_cB_) - {var _cD_=_cB_; - for(;;) - {var _cE_=0 < _cD_?1:0; - if(_cE_) - {if(80 < _cD_) - {caml_call3(_cC_[17],_p_,0,80);var _cD_=_cD_ - 80 | 0;continue} - return caml_call3(_cC_[17],_p_,0,_cD_)} - return _cE_}} - function _W_(_cA_){return _c_(_Y_,_c_(_cA_,_X_))} - function _Z_(_cz_){return _c_(_$_,_c_(_cz_,___))} - function _aa_(_cy_){return 0} - function _ab_(_cx_){return 0} - function _ae_(_cn_,_cm_) - {function _co_(_cw_){return 0} - function _cp_(_cv_){return 0} - var _cj_=[0,0,0],_ck_=[0,-1,_ac_,0]; - function _cq_(_cu_){return 0} - _A_(_ck_,_cj_); - var - _cl_= - [0, - [0,[0,1,_ck_],_R_], - 0, - 0, - 0, - 0, - 78, - 10, - 68, - 78, - 0, - 1, - 1, - 1, - 1, - _b_, - _ad_, - _cn_, - _cm_, - _cq_, - _cp_, - _co_, - 0, - 0, - _W_, - _Z_, - _aa_, - _ab_, - _cj_]; - _cl_[19] = function(_ct_){return caml_call3(_cl_[17],_U_,0,1)}; - _cl_[20] = function(_cs_){return _V_(_cl_,_cs_)}; - _cl_[21] = function(_cr_){return _V_(_cl_,_cr_)}; - return _cl_} - function _af_(_cd_) - {function _ce_(_ci_){return caml_ml_flush(_cd_)} - return _ae_ - (function(_cf_,_cg_,_ch_) - {if(0 <= _cg_) - if(0 <= _ch_) - if(! ((caml_ml_string_length(_cf_) - _ch_ | 0) < _cg_)) - return caml_ml_output(_cd_,_cf_,_cg_,_ch_); - return _a_(_f_)}, - _ce_)} - var - _ah_=512, - _t_=_j_ < 512?_j_:_ah_, - _u_=caml_create_bytes(_t_), - _v_=[0,_u_,0,_t_,_u_], - _ai_=_af_(_d_); - _af_(_e_); - function _ag_(_cc_){return 0} - _ae_ - (function(_b$_,_ca_,_cb_) - {var _b5_=_ca_ < 0?1:0; - if(_b5_) - var _b6_=_b5_; - else - var - _b__=_cb_ < 0?1:0, - _b6_=_b__ || ((caml_ml_string_length(_b$_) - _cb_ | 0) < _ca_?1:0); - if(_b6_)_a_(_x_); - var _b7_=_v_[2] + _cb_ | 0; - if(_v_[3] < _b7_) - {var _b1_=[0,_v_[3]]; - for(;;) - {if(_b1_[1] < (_v_[2] + _cb_ | 0)) - {_b1_[1] = 2 * _b1_[1] | 0;continue} - if(_j_ < _b1_[1]) - {if(! ((_v_[2] + _cb_ | 0) <= _j_))throw [0,Failure,_w_]; - _b1_[1] = _j_} - var - _b2_=caml_create_bytes(_b1_[1]), - _b3_=_v_[2], - _b4_=_v_[1], - switch$0= - 0 <= _b3_ - ?(caml_ml_bytes_length(_b4_) - _b3_ | 0) < 0 - ?0 - :(caml_ml_bytes_length(_b2_) - _b3_ | 0) < 0 - ?0 - :(caml_blit_bytes(_b4_,0,_b2_,0,_b3_),1) - :0; - if(! switch$0)_a_(_n_); - _v_[1] = _b2_; - _v_[3] = _b1_[1]; - break}} - var - _b8_=_v_[2], - _b9_=_v_[1], - switch$1= - 0 <= _cb_ - ?0 <= _ca_ - ?(caml_ml_string_length(_b$_) - _cb_ | 0) < _ca_ - ?0 - :0 <= _b8_ - ?(caml_ml_bytes_length(_b9_) - _cb_ | 0) < _b8_ - ?0 - :(caml_blit_string(_b$_,_ca_,_b9_,_b8_,_cb_),1) - :0 - :0 - :0; - if(! switch$1)_a_(_o_); - _v_[2] = _b7_; - return 0}, - _ag_); - var _i_=[0,0],_h_=_g_[1]; - _g_[1] - = - function(_bO_) - {if(1 - _i_[1]) - {_i_[1] = 1; - var _bV_=_ai_[4]; - _l_ - (function(_b0_) - {if(_ai_[23])_E_(_ai_,[0,0,5,0]); - var _bW_=_ai_[22]; - if(_bW_) - {var _bX_=_ai_[4]; - if(_bX_) - {var _bY_=_bX_[2]; - caml_call1(_ai_[27],_bX_[1]); - _ai_[4] = _bY_; - return 0} - var _bZ_=0} - else - var _bZ_=_bW_; - return _bZ_}, - _bV_); - for(;;) - {if(1 < _ai_[14]) - {if(1 < _ai_[14]) - {if(_ai_[14] < _ai_[15]) - {_E_(_ai_,[0,0,1,0]);_T_(_ai_,1);_T_(_ai_,0)} - _ai_[14] = _ai_[14] - 1 | 0} - continue} - _ai_[13] = _F_; - _P_(_ai_); - _ai_[12] = 1; - _ai_[13] = 1; - var _bP_=_ai_[28]; - _bP_[1] = 0; - _bP_[2] = 0; - _S_(_ai_); - _ai_[2] = 0; - _ai_[3] = 0; - _ai_[4] = 0; - _ai_[5] = 0; - _ai_[10] = 0; - _ai_[14] = 0; - _ai_[9] = _ai_[6]; - _ai_[14] = _ai_[14] + 1 | 0; - var _bT_=3,_bU_=0; - if(_ai_[14] < _ai_[15]) - {var _bR_=[0,- _ai_[13] | 0,[3,_bU_,_bT_],0]; - _E_(_ai_,_bR_); - _ai_[1] = [0,[0,_ai_[13],_bR_],_ai_[1]]} - else - if(_ai_[14] === _ai_[15]) - {var _bS_=_ai_[16],_bQ_=caml_ml_string_length(_bS_); - _E_(_ai_,[0,_bQ_,[0,_bS_],_bQ_]); - _P_(_ai_)} - caml_call1(_ai_[18],0); - break}} - return caml_call1(_h_,0)}; - var - _ak_=joo_global_object, - _am_=undefined, - _an_=_ak_.Array, - _ap_=[248,_ao_,caml_fresh_oo_id(0)], - _aq_=[0,_ap_,{}], - _al_=null, - _aj_=caml_obj_tag(_aq_) === 248?_aq_:_aq_[1]; - caml_register_named_value(caml_new_string("jsError"),_aj_); - (function(exn){throw exn}); - var _ar_=_ak_.JSON; - _z_ - (function(_bN_) - {return _bN_[1] === _ap_?[0,caml_js_to_string(_bN_[2].toString())]:0}); - _z_ - (function(_bM_) - {return _bM_ instanceof _an_?0:[0,caml_js_to_string(_bM_.toString())]}); - function _as_(_bL_,_bK_){_bL_.appendChild(_bK_);return 0} - var _at_=_ak_.document; - function _av_(_bJ_,_bI_){return _bJ_?caml_call1(_bI_,_bJ_[1]):0} - function _aw_(_bH_,_bG_){return _bH_.createElement(_bG_.toString())} - var _ax_=[0,785140586]; - function _ay_(_bs_,_br_,_bq_,_bp_) - {for(;;) - {if(0 === _bs_)if(0 === _br_)return _aw_(_bq_,_bp_); - var _bt_=_ax_[1]; - if(785140586 === _bt_) - {try - {var - _bw_=_at_.createElement(''), - _bx_=_bw_.tagName.toLowerCase() === "input"?1:0, - _by_=_bx_?_bw_.name === "x"?1:0:_bx_, - _bu_=_by_} - catch(_bF_){var _bu_=0} - var _bv_=_bu_?982028505:-1003883683; - _ax_[1] = _bv_; - continue} - if(982028505 <= _bt_) - {var _bz_=new _an_(); - _bz_.push("<",_bp_.toString()); - _av_ - (_bs_, - function(_bE_) - {_bz_.push(' type="',caml_js_html_escape(_bE_),'"');return 0}); - _av_ - (_br_, - function(_bD_) - {_bz_.push(' name="',caml_js_html_escape(_bD_),'"');return 0}); - _bz_.push(">"); - return _bq_.createElement(_bz_.join(""))} - var _bA_=_aw_(_bq_,_bp_); - _av_(_bs_,function(_bC_){return _bA_.type = _bC_}); - _av_(_br_,function(_bB_){return _bA_.name = _bB_}); - return _bA_}} - caml_fresh_oo_id(0); - _ak_.HTMLElement === _am_; - var _aA_=caml_js_get_console(0); - function _aB_(_bo_){return _aA_.log(_bo_.toString())} - var _aC_=chrome.storage.sync; - function _aD_(_bn_,_bm_,_bl_) - {return _bn_.setAttribute(_bm_.toString(),_bl_.toString())} - function _aH_(_bk_){return _c_(_aJ_,_c_(_bk_,_aI_))} - function _aK_(_be_) - {var - _bf_= - _c_ - (_aO_, - _c_ - (_r_ - (_aN_, - _k_ - (function(_bi_) - {var _bj_=_c_(_aM_,_bi_[2]);return _c_(_aH_(_bi_[1]),_bj_)}, - _be_)), - _aL_)); - try - {var _bg_=_ar_.parse(_bf_.toString());return _bg_} - catch(_bh_){_aB_(_c_(_aP_,_bf_));return {}}} - var _au_=_at_.getElementById("buttonDiv"); - if(_au_ == _al_)throw Not_found; - _l_ - (function(_aY_) - {var _aZ_=_aK_([0,[0,_aR_,_aH_(_aY_)],0]); - function _a0_(_bd_){return _aB_(_c_(_aS_,_aY_))} - var - _a1_=0, - _a2_=0, - _a3_=0, - _a4_= - [0, - [0, - [0, - _aT_, - function(_bc_) - {var _bb_=[0,_a0_]?caml_js_wrap_callback(_a0_):_am_; - _aC_.set(_aZ_,_bb_); - return 1}], - _a3_]], - _a5_=[0,[0,[0,_aU_,_aY_],0]], - _a6_=0, - _aW_=_a5_?_a5_[1]:_a5_, - _aX_=_a4_?_a4_[1]:_a4_, - _aV_=_ay_(0,0,_at_,_az_); - _l_(function(_ba_){return 0},_aX_); - _l_(function(_a$_){return _aV_.classList.add(_a$_.toString())},_a6_); - _aD_ - (_aV_, - _aG_, - _r_ - (_aF_, - _k_ - (function(_a9_) - {var _a__=_c_(_aE_,_a9_[2]);return _c_(_a9_[1],_a__)}, - _aW_))); - _l_(function(_a8_){return _aD_(_aV_,_a8_[1],_a8_[2])},_a2_); - _l_(function(_a7_){return _as_(_aV_,_a7_)},_a1_); - return _as_(_au_,_aV_)}, - _aQ_); - caml_call1(_g_[1],0); - return} - (function(){return this}())); diff --git a/examples/chrome-extension/popup-example.js b/examples/chrome-extension/popup-example.js deleted file mode 100644 index 2590deb..0000000 --- a/examples/chrome-extension/popup-example.js +++ /dev/null @@ -1,1915 +0,0 @@ -// Generated by js_of_ocaml 3.5.2 -(function(joo_global_object) - {"use strict"; - function raw_array_sub(a,i,l) - {var b=new Array(l);for(var j=0;j < l;j++)b[j] = a[i + j];return b} - function caml_subarray_to_string(a,i,len) - {var f=String.fromCharCode; - if(i == 0 && len <= 4096 && len == a.length)return f.apply(null,a); - var s=""; - for(;0 < len;i += 1024,len -= 1024) - s += f.apply(null,raw_array_sub(a,i,Math.min(len,1024))); - return s} - function caml_convert_string_to_array(s) - {if(joo_global_object.Uint8Array) - var a=new (joo_global_object.Uint8Array)(s.l); - else - var a=new Array(s.l); - var b=s.c,l=b.length,i=0; - for(;i < l;i++)a[i] = b.charCodeAt(i); - for(l = s.l;i < l;i++)a[i] = 0; - s.c = a; - s.t = 4; - return a} - function caml_blit_bytes(s1,i1,s2,i2,len) - {if(len == 0)return 0; - if(i2 == 0 && (len >= s2.l || s2.t == 2 && len >= s2.c.length)) - {s2.c - = - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - if(s2.t == 2 && i2 == s2.c.length) - {s2.c - += - s1.t == 4 - ?caml_subarray_to_string(s1.c,i1,len) - :i1 == 0 && s1.c.length == len?s1.c:s1.c.substr(i1,len); - s2.t = s2.c.length == s2.l?0:2} - else - {if(s2.t != 4)caml_convert_string_to_array(s2); - var c1=s1.c,c2=s2.c; - if(s1.t == 4) - if(i2 <= i1) - for(var i=0;i < len;i++)c2[i2 + i] = c1[i1 + i]; - else - for(var i=len - 1;i >= 0;i--)c2[i2 + i] = c1[i1 + i]; - else - {var l=Math.min(len,c1.length - i1); - for(var i=0;i < l;i++)c2[i2 + i] = c1.charCodeAt(i1 + i); - for(;i < len;i++)c2[i2 + i] = 0}} - return 0} - function caml_blit_string(s1,i1,s2,i2,len) - {return caml_blit_bytes(s1,i1,s2,i2,len)} - function raw_array_append_one(a,x) - {var l=a.length,b=new Array(l + 1),i=0; - for(;i < l;i++)b[i] = a[i]; - b[i] = x; - return b} - function caml_call_gen(f,args) - {if(f.fun)return caml_call_gen(f.fun,args); - var n=f.length,argsLen=args.length,d=n - argsLen; - if(d == 0) - return f.apply(null,args); - else - if(d < 0) - return caml_call_gen - (f.apply(null,raw_array_sub(args,0,n)), - raw_array_sub(args,n,argsLen - n)); - else - return function(x) - {return caml_call_gen(f,raw_array_append_one(args,x))}} - function caml_str_repeat(n,s) - {if(n == 0)return ""; - if(s.repeat)return s.repeat(n); - var r="",l=0; - if(n == 0)return r; - for(;;) - {if(n & 1)r += s; - n >>= 1; - if(n == 0)return r; - s += s; - l++; - if(l == 9)s.slice(0,1)}} - function caml_convert_string_to_bytes(s) - {if(s.t == 2) - s.c += caml_str_repeat(s.l - s.c.length,"\0"); - else - s.c = caml_subarray_to_string(s.c,0,s.c.length); - s.t = 0} - function caml_is_ascii(s) - {if(s.length < 24) - {for(var i=0;i < s.length;i++)if(s.charCodeAt(i) > 127)return false; - return true} - else - return ! /[^\x00-\x7f]/.test(s)} - function caml_utf16_of_utf8(s) - {for(var b="",t="",c,c1,c2,v,i=0,l=s.length;i < l;i++) - {c1 = s.charCodeAt(i); - if(c1 < 0x80) - {for(var j=i + 1;j < l && (c1 = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - v = 1; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c1 << 6); - if(c1 < 0xe0) - {v = c - 0x3080;if(v < 0x80)v = 1} - else - {v = 2; - if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128) - {c = c2 + (c << 6); - if(c1 < 0xf0) - {v = c - 0xe2080; - if(v < 0x800 || v >= 0xd7ff && v < 0xe000)v = 2} - else - {v = 3; - if - (++i - < - l - && - ((c2 = s.charCodeAt(i)) & - 64) - == - 128 - && - c1 - < - 0xf5) - {v = c2 - 0x3c82080 + (c << 6); - if(v < 0x10000 || v > 0x10ffff)v = 3}}}}} - if(v < 4) - {i -= v;t += "\ufffd"} - else - if(v > 0xffff) - t += String.fromCharCode(0xd7c0 + (v >> 10),0xdc00 + (v & 0x3FF)); - else - t += String.fromCharCode(v); - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_to_js_string(s) - {switch(s.t) - {case 9:return s.c; - default:caml_convert_string_to_bytes(s);case 0: - if(caml_is_ascii(s.c)){s.t = 9;return s.c}s.t = 8; - case 8:return caml_utf16_of_utf8(s.c) - }} - function MlBytes(tag,contents,length) - {this.t = tag;this.c = contents;this.l = length} - MlBytes.prototype.toString = function(){return caml_to_js_string(this)}; - MlBytes.prototype.slice - = - function() - {var content=this.t == 4?this.c.slice():this.c; - return new MlBytes(this.t,content,this.l)}; - function caml_raise_with_arg(tag,arg){throw [0,tag,arg]} - function caml_new_string(s){return new MlBytes(0,s,s.length)} - function caml_raise_with_string(tag,msg) - {caml_raise_with_arg(tag,caml_new_string(msg))} - var caml_global_data=[0]; - function caml_invalid_argument(msg) - {caml_raise_with_string(caml_global_data.Invalid_argument,msg)} - function caml_create_bytes(len) - {if(len < 0)caml_invalid_argument("Bytes.create"); - return new MlBytes(len?2:9,"",len)} - function caml_fill_bytes(s,i,l,c) - {if(l > 0) - if(i == 0 && (l >= s.l || s.t == 2 && l >= s.c.length)) - if(c == 0) - {s.c = "";s.t = 2} - else - {s.c = caml_str_repeat(l,String.fromCharCode(c));s.t = l == s.l?0:2} - else - {if(s.t != 4)caml_convert_string_to_array(s); - for(l += i;i < l;i++)s.c[i] = c} - return 0} - var caml_oo_last_id=0; - function caml_fresh_oo_id(){return caml_oo_last_id++} - function caml_failwith(msg) - {caml_raise_with_string(caml_global_data.Failure,msg)} - if(joo_global_object.process && joo_global_object.process.cwd) - var caml_current_dir=joo_global_object.process.cwd().replace(/\\/g,"/"); - else - var caml_current_dir="/static"; - if(caml_current_dir.slice(- 1) !== "/")caml_current_dir += "/"; - function caml_make_path(name) - {name = name instanceof MlBytes?name.toString():name; - if(name.charCodeAt(0) != 47)name = caml_current_dir + name; - var comp=name.split("/"),ncomp=[]; - for(var i=0;i < comp.length;i++) - switch(comp[i]) - {case "..":if(ncomp.length > 1)ncomp.pop();break; - case ".":break; - case "":if(ncomp.length == 0)ncomp.push("");break; - default:ncomp.push(comp[i]);break} - ncomp.orig = name; - return ncomp} - function caml_raise_sys_error(msg) - {caml_raise_with_string(caml_global_data.Sys_error,msg)} - function caml_raise_no_such_file(name) - {name = name instanceof MlBytes?name.toString():name; - caml_raise_sys_error(name + ": No such file or directory")} - function caml_string_of_array(a){return new MlBytes(4,a,a.length)} - function caml_string_bound_error() - {caml_invalid_argument("index out of bounds")} - function caml_bytes_unsafe_get(s,i) - {switch(s.t & 6) - {default:if(i >= s.c.length)return 0;case 0:return s.c.charCodeAt(i); - case 4:return s.c[i] - }} - function caml_bytes_get(s,i) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_get(s,i)} - function caml_ml_bytes_length(s){return s.l} - function MlFile(){} - function MlFakeFile(content){this.data = content} - MlFakeFile.prototype = new MlFile(); - MlFakeFile.prototype.truncate - = - function(len) - {var old=this.data; - this.data = caml_create_bytes(len | 0); - caml_blit_bytes(old,0,this.data,0,len)}; - MlFakeFile.prototype.length - = - function(){return caml_ml_bytes_length(this.data)}; - MlFakeFile.prototype.write - = - function(offset,buf,pos,len) - {var clen=this.length(); - if(offset + len >= clen) - {var new_str=caml_create_bytes(offset + len),old_data=this.data; - this.data = new_str; - caml_blit_bytes(old_data,0,this.data,0,clen)} - caml_blit_bytes(buf,pos,this.data,offset,len); - return 0}; - MlFakeFile.prototype.read - = - function(offset,buf,pos,len) - {var clen=this.length(); - caml_blit_bytes(this.data,offset,buf,pos,len); - return 0}; - MlFakeFile.prototype.read_one - = - function(offset){return caml_bytes_get(this.data,offset)}; - MlFakeFile.prototype.close = function(){}; - MlFakeFile.prototype.constructor = MlFakeFile; - function MlFakeDevice(root,f) - {this.content = {};this.root = root;this.lookupFun = f} - MlFakeDevice.prototype.nm = function(name){return this.root + name}; - MlFakeDevice.prototype.lookup - = - function(name) - {if(! this.content[name] && this.lookupFun) - {var - res= - this.lookupFun(caml_new_string(this.root),caml_new_string(name)); - if(res !== 0)this.content[name] = new MlFakeFile(res[1])}}; - MlFakeDevice.prototype.exists - = - function(name) - {if(name == "")return 1; - var name_slash=name + "/",r=new RegExp("^" + name_slash); - for(var n in this.content)if(n.match(r))return 1; - this.lookup(name); - return this.content[name]?1:0}; - MlFakeDevice.prototype.readdir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - seen={}, - a=[]; - for(var n in this.content) - {var m=n.match(r); - if(m && ! seen[m[1]]){seen[m[1]] = true;a.push(m[1])}} - return a}; - MlFakeDevice.prototype.is_dir - = - function(name) - {var - name_slash=name == ""?"":name + "/", - r=new RegExp("^" + name_slash + "([^/]*)"), - a=[]; - for(var n in this.content){var m=n.match(r);if(m)return 1} - return 0}; - MlFakeDevice.prototype.unlink - = - function(name) - {var ok=this.content[name]?true:false; - delete this.content[name]; - return ok}; - MlFakeDevice.prototype.open - = - function(name,f) - {if(f.rdonly && f.wronly) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (this.nm(name) - + - " : flags Open_text and Open_binary are not compatible"); - this.lookup(name); - if(this.content[name]) - {if(this.is_dir(name)) - caml_raise_sys_error(this.nm(name) + " : is a directory"); - if(f.create && f.excl) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - var file=this.content[name]; - if(f.truncate)file.truncate(); - return file} - else - if(f.create) - {this.content[name] = new MlFakeFile(caml_create_bytes(0)); - return this.content[name]} - else - caml_raise_no_such_file(this.nm(name))}; - MlFakeDevice.prototype.register - = - function(name,content) - {if(this.content[name]) - caml_raise_sys_error(this.nm(name) + " : file already exists"); - if(content instanceof MlBytes) - this.content[name] = new MlFakeFile(content); - else - if(content instanceof Array) - this.content[name] = new MlFakeFile(caml_string_of_array(content)); - else - if(content.toString) - {var mlstring=caml_new_string(content.toString()); - this.content[name] = new MlFakeFile(mlstring)}}; - MlFakeDevice.prototype.constructor = MlFakeDevice; - function caml_array_of_string(s) - {if(s.t != 4)caml_convert_string_to_array(s);return s.c} - function caml_bytes_unsafe_set(s,i,c) - {c &= 0xff; - if(s.t != 4) - {if(i == s.c.length) - {s.c += String.fromCharCode(c);if(i + 1 == s.l)s.t = 0;return 0} - caml_convert_string_to_array(s)} - s.c[i] = c; - return 0} - function caml_bytes_set(s,i,c) - {if(i >>> 0 >= s.l)caml_string_bound_error(); - return caml_bytes_unsafe_set(s,i,c)} - var Buffer=joo_global_object.Buffer; - function MlNodeFile(fd){this.fs = require("fs");this.fd = fd} - MlNodeFile.prototype = new MlFile(); - MlNodeFile.prototype.truncate - = - function(len){this.fs.ftruncateSync(this.fd,len | 0)}; - MlNodeFile.prototype.length - = - function(){return this.fs.fstatSync(this.fd).size}; - MlNodeFile.prototype.write - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.writeSync(this.fd,buffer,buf_offset,len,offset); - return 0}; - MlNodeFile.prototype.read - = - function(offset,buf,buf_offset,len) - {var a=caml_array_of_string(buf); - if(! (a instanceof joo_global_object.Uint8Array)) - a = new (joo_global_object.Uint8Array)(a); - var buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,buf_offset,len,offset); - for(var i=0;i < len;i++) - caml_bytes_set(buf,buf_offset + i,buffer[buf_offset + i]); - return 0}; - MlNodeFile.prototype.read_one - = - function(offset) - {var a=new (joo_global_object.Uint8Array)(1),buffer=Buffer.from(a); - this.fs.readSync(this.fd,buffer,0,1,offset); - return buffer[0]}; - MlNodeFile.prototype.close = function(){this.fs.closeSync(this.fd)}; - MlNodeFile.prototype.constructor = MlNodeFile; - function MlNodeDevice(root){this.fs = require("fs");this.root = root} - MlNodeDevice.prototype.nm = function(name){return this.root + name}; - MlNodeDevice.prototype.exists - = - function(name){return this.fs.existsSync(this.nm(name))?1:0}; - MlNodeDevice.prototype.readdir - = - function(name){return this.fs.readdirSync(this.nm(name))}; - MlNodeDevice.prototype.is_dir - = - function(name){return this.fs.statSync(this.nm(name)).isDirectory()?1:0}; - MlNodeDevice.prototype.unlink - = - function(name) - {var b=this.fs.existsSync(this.nm(name))?1:0; - this.fs.unlinkSync(this.nm(name)); - return b}; - MlNodeDevice.prototype.open - = - function(name,f) - {var consts=require("constants"),res=0; - for(var key in f) - switch(key) - {case "rdonly":res |= consts.O_RDONLY;break; - case "wronly":res |= consts.O_WRONLY;break; - case "append":res |= consts.O_WRONLY | consts.O_APPEND;break; - case "create":res |= consts.O_CREAT;break; - case "truncate":res |= consts.O_TRUNC;break; - case "excl":res |= consts.O_EXCL;break; - case "binary":res |= consts.O_BINARY;break; - case "text":res |= consts.O_TEXT;break; - case "nonblock":res |= consts.O_NONBLOCK;break - } - var fd=this.fs.openSync(this.nm(name),res); - return new MlNodeFile(fd)}; - MlNodeDevice.prototype.rename - = - function(o,n){this.fs.renameSync(this.nm(o),this.nm(n))}; - MlNodeDevice.prototype.constructor = MlNodeDevice; - var caml_root=caml_current_dir.match(/[^\/]*\//)[0]; - function fs_node_supported() - {return typeof joo_global_object.process - !== - "undefined" - && - typeof joo_global_object.process.versions - !== - "undefined" - && - typeof joo_global_object.process.versions.node - !== - "undefined" - && - joo_global_object.process.platform - !== - "browser"} - var jsoo_mount_point=[]; - if(fs_node_supported()) - jsoo_mount_point.push - ({path:caml_root,device:new MlNodeDevice(caml_root)}); - else - jsoo_mount_point.push - ({path:caml_root,device:new MlFakeDevice(caml_root)}); - jsoo_mount_point.push - ({path:caml_root + "static/", - device:new MlFakeDevice(caml_root + "static/")}); - function resolve_fs_device(name) - {var - path=caml_make_path(name), - name=path.join("/"), - name_slash=name + "/", - res; - for(var i=0;i < jsoo_mount_point.length;i++) - {var m=jsoo_mount_point[i]; - if - (name_slash.search(m.path) - == - 0 - && - (! res || res.path.length < m.path.length)) - res - = - {path:m.path, - device:m.device, - rest:name.substring(m.path.length,name.length)}} - return res} - function caml_create_file(name,content) - {var root=resolve_fs_device(name); - if(! root.device.register)caml_failwith("cannot register file"); - root.device.register(root.rest,content); - return 0} - function caml_fs_init() - {var tmp=joo_global_object.caml_fs_tmp; - if(tmp) - for(var i=0;i < tmp.length;i++) - caml_create_file(tmp[i].name,tmp[i].content); - joo_global_object.caml_create_file = caml_create_file; - joo_global_object.caml_fs_tmp = []; - return 0} - var log2_ok=Math.log2 && Math.log2(1.1235582092889474E+307) == 1020; - function jsoo_floor_log2(x) - {if(log2_ok)return Math.floor(Math.log2(x)); - var i=0; - if(x == 0)return - Infinity; - if(x >= 1)while(x >= 2){x /= 2;i++}else while(x < 1){x *= 2;i--} - return i} - function caml_int32_bits_of_float(x) - {var float32a=new (joo_global_object.Float32Array)(1); - float32a[0] = x; - var int32a=new (joo_global_object.Int32Array)(float32a.buffer); - return int32a[0] | 0} - function caml_int64_create_lo_mi_hi(lo,mi,hi){return [255,lo,mi,hi]} - function caml_int64_bits_of_float(x) - {if(! isFinite(x)) - {if(isNaN(x))return caml_int64_create_lo_mi_hi(1,0,0x7ff0); - return x > 0 - ?caml_int64_create_lo_mi_hi(0,0,0x7ff0) - :caml_int64_create_lo_mi_hi(0,0,0xfff0)} - var sign=x == 0 && 1 / x == - Infinity?0x8000:x >= 0?0:0x8000; - if(sign)x = - x; - var exp=jsoo_floor_log2(x) + 1023; - if(exp <= 0) - {exp = 0;x /= Math.pow(2,- 1026)} - else - {x /= Math.pow(2,exp - 1027); - if(x < 16){x *= 2;exp -= 1} - if(exp == 0)x /= 2} - var k=Math.pow(2,24),r3=x | 0; - x = (x - r3) * k; - var r2=x | 0; - x = (x - r2) * k; - var r1=x | 0; - r3 = r3 & 0xf | sign | exp << 4; - return caml_int64_create_lo_mi_hi(r1,r2,r3)} - function caml_int64_to_bytes(x) - {return [x[3] >> 8, - x[3] & 0xff, - x[2] >> 16, - x[2] >> 8 & 0xff, - x[2] & 0xff, - x[1] >> 16, - x[1] >> 8 & 0xff, - x[1] & 0xff]} - function caml_ba_serialize(writer,ba,sz) - {writer.write(32,ba.dims.length); - writer.write(32,ba.kind | ba.layout << 8); - for(var i=0;i < ba.dims.length;i++)writer.write(32,ba.dims[i]); - switch(ba.kind) - {case 2: - case 3: - case 12: - for(var i=0;i < ba.data.length;i++)writer.write(8,ba.data[i]);break; - case 4: - case 5: - for(var i=0;i < ba.data.length;i++)writer.write(16,ba.data[i]);break; - case 6: - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]);break; - case 8: - case 9: - writer.write(8,0); - for(var i=0;i < ba.data.length;i++)writer.write(32,ba.data[i]); - break; - case 7: - for(var i=0;i < ba.data.length / 2;i++) - {var b=caml_int64_to_bytes(ba.get(i)); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 1: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i))); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break; - case 0: - for(var i=0;i < ba.data.length;i++) - {var b=caml_int32_bits_of_float(ba.get(i));writer.write(32,b)} - break; - case 10: - for(var i=0;i < ba.data.length / 2;i++) - {var j=ba.get(i); - writer.write(32,caml_int32_bits_of_float(j[1])); - writer.write(32,caml_int32_bits_of_float(j[2]))} - break; - case 11: - for(var i=0;i < ba.data.length / 2;i++) - {var - complex=ba.get(i), - b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[1])); - for(var j=0;j < 8;j++)writer.write(8,b[j]); - var b=caml_int64_to_bytes(caml_int64_bits_of_float(complex[2])); - for(var j=0;j < 8;j++)writer.write(8,b[j])} - break - } - sz[0] = (4 + ba.dims.length) * 4; - sz[1] = (4 + ba.dims.length) * 8} - function caml_ba_get_size_per_element(kind) - {switch(kind){case 7:case 10:case 11:return 2;default:return 1}} - function caml_ba_create_buffer(kind,size) - {var g=joo_global_object,view; - switch(kind) - {case 0:view = g.Float32Array;break; - case 1:view = g.Float64Array;break; - case 2:view = g.Int8Array;break; - case 3:view = g.Uint8Array;break; - case 4:view = g.Int16Array;break; - case 5:view = g.Uint16Array;break; - case 6:view = g.Int32Array;break; - case 7:view = g.Int32Array;break; - case 8:view = g.Int32Array;break; - case 9:view = g.Int32Array;break; - case 10:view = g.Float32Array;break; - case 11:view = g.Float64Array;break; - case 12:view = g.Uint8Array;break - } - if(! view)caml_invalid_argument("Bigarray.create: unsupported kind"); - var data=new view(size * caml_ba_get_size_per_element(kind)); - return data} - function caml_int32_float_of_bits(x) - {var int32a=new (joo_global_object.Int32Array)(1); - int32a[0] = x; - var float32a=new (joo_global_object.Float32Array)(int32a.buffer); - return float32a[0]} - function caml_int64_of_bytes(a) - {return [255, - a[7] | a[6] << 8 | a[5] << 16, - a[4] | a[3] << 8 | a[2] << 16, - a[1] | a[0] << 8]} - function caml_int64_float_of_bits(x) - {var lo=x[1],mi=x[2],hi=x[3],exp=(hi & 0x7fff) >> 4; - if(exp == 2047) - return (lo | mi | hi & 0xf) == 0?hi & 0x8000?- Infinity:Infinity:NaN; - var k=Math.pow(2,- 24),res=(lo * k + mi) * k + (hi & 0xf); - if(exp > 0) - {res += 16;res *= Math.pow(2,exp - 1027)} - else - res *= Math.pow(2,- 1026); - if(hi & 0x8000)res = - res; - return res} - function caml_ba_get_size(dims) - {var n_dims=dims.length,size=1; - for(var i=0;i < n_dims;i++) - {if(dims[i] < 0) - caml_invalid_argument("Bigarray.create: negative dimension"); - size = size * dims[i]} - return size} - function caml_int64_create_lo_hi(lo,hi) - {return [255, - lo & 0xffffff, - lo >>> 24 & 0xff | (hi & 0xffff) << 8, - hi >>> 16 & 0xffff]} - function caml_int64_hi32(v){return v[2] >>> 8 & 0xffff | v[3] << 16} - function caml_int64_lo32(v){return v[1] | (v[2] & 0xff) << 24} - function caml_array_bound_error() - {caml_invalid_argument("index out of bounds")} - function Ml_Bigarray(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray.prototype.caml_custom = "_bigarray"; - Ml_Bigarray.prototype.offset - = - function(arg) - {var ofs=0; - if(typeof arg === "number")arg = [arg]; - if(! (arg instanceof Array)) - caml_invalid_argument("bigarray.js: invalid offset"); - if(this.dims.length != arg.length) - caml_invalid_argument("Bigarray.get/set: bad number of dimensions"); - if(this.layout == 0) - for(var i=0;i < this.dims.length;i++) - {if(arg[i] < 0 || arg[i] >= this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + arg[i]} - else - for(var i=this.dims.length - 1;i >= 0;i--) - {if(arg[i] < 1 || arg[i] > this.dims[i])caml_array_bound_error(); - ofs = ofs * this.dims[i] + (arg[i] - 1)} - return ofs}; - Ml_Bigarray.prototype.get - = - function(ofs) - {switch(this.kind) - {case 7: - var l=this.data[ofs * 2 + 0],h=this.data[ofs * 2 + 1]; - return caml_int64_create_lo_hi(l,h); - case 10: - case 11: - var r=this.data[ofs * 2 + 0],i=this.data[ofs * 2 + 1]; - return [254,r,i]; - default:return this.data[ofs]}}; - Ml_Bigarray.prototype.set - = - function(ofs,v) - {switch(this.kind) - {case 7: - this.data[ofs * 2 + 0] = caml_int64_lo32(v); - this.data[ofs * 2 + 1] = caml_int64_hi32(v); - break; - case 10: - case 11: - this.data[ofs * 2 + 0] = v[1];this.data[ofs * 2 + 1] = v[2];break; - default:this.data[ofs] = v;break} - return 0}; - Ml_Bigarray.prototype.fill - = - function(v) - {switch(this.kind) - {case 7: - var a=caml_int64_lo32(v),b=caml_int64_hi32(v); - if(a == b) - this.data.fill(a); - else - for(var i=0;i < this.data.length;i++)this.data[i] = i % 2 == 0?a:b; - break; - case 10: - case 11: - var im=v[1],re=v[2]; - if(im == re) - this.data.fill(im); - else - for(var i=0;i < this.data.length;i++) - this.data[i] = i % 2 == 0?im:re; - break; - default:this.data.fill(v);break}}; - Ml_Bigarray.prototype.compare - = - function(b,total) - {if(this.layout != b.layout || this.kind != b.kind) - {var k1=this.kind | this.layout << 8,k2=b.kind | b.layout << 8; - return k2 - k1} - if(this.dims.length != b.dims.length) - return b.dims.length - this.dims.length; - for(var i=0;i < this.dims.length;i++) - if(this.dims[i] != b.dims[i])return this.dims[i] < b.dims[i]?- 1:1; - switch(this.kind) - {case 0: - case 1: - case 10: - case 11: - var x,y; - for(var i=0;i < this.data.length;i++) - {x = this.data[i]; - y = b.data[i]; - if(x < y)return - 1; - if(x > y)return 1; - if(x != y) - {if(! total)return NaN;if(x == x)return 1;if(y == y)return - 1}} - break; - case 7: - for(var i=0;i < this.data.length;i += 2) - {if(this.data[i + 1] < b.data[i + 1])return - 1; - if(this.data[i + 1] > b.data[i + 1])return 1; - if(this.data[i] >>> 0 < b.data[i] >>> 0)return - 1; - if(this.data[i] >>> 0 > b.data[i] >>> 0)return 1} - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - case 12: - for(var i=0;i < this.data.length;i++) - {if(this.data[i] < b.data[i])return - 1; - if(this.data[i] > b.data[i])return 1} - break - } - return 0}; - function Ml_Bigarray_c_1_1(kind,layout,dims,buffer) - {this.kind = kind; - this.layout = layout; - this.dims = dims; - this.data = buffer} - Ml_Bigarray_c_1_1.prototype = new Ml_Bigarray(); - Ml_Bigarray_c_1_1.prototype.offset - = - function(arg) - {if(typeof arg !== "number") - if(arg instanceof Array && arg.length == 1) - arg = arg[0]; - else - caml_invalid_argument("Ml_Bigarray_c_1_1.offset"); - if(arg < 0 || arg >= this.dims[0])caml_array_bound_error(); - return arg}; - Ml_Bigarray_c_1_1.prototype.get = function(ofs){return this.data[ofs]}; - Ml_Bigarray_c_1_1.prototype.set - = - function(ofs,v){this.data[ofs] = v;return 0}; - Ml_Bigarray_c_1_1.prototype.fill - = - function(v){this.data.fill(v);return 0}; - function caml_ba_create_unsafe(kind,layout,dims,data) - {var size_per_element=caml_ba_get_size_per_element(kind); - if(caml_ba_get_size(dims) * size_per_element != data.length) - caml_invalid_argument("length doesn't match dims"); - if(layout == 0 && dims.length == 1 && size_per_element == 1) - return new Ml_Bigarray_c_1_1(kind,layout,dims,data); - return new Ml_Bigarray(kind,layout,dims,data)} - function caml_ba_deserialize(reader,sz) - {var num_dims=reader.read32s(); - if(num_dims < 0 || num_dims > 16) - caml_failwith("input_value: wrong number of bigarray dimensions"); - var tag=reader.read32s(),kind=tag & 0xff,layout=tag >> 8 & 1,dims=[]; - for(var i=0;i < num_dims;i++)dims.push(reader.read32u()); - var - size=caml_ba_get_size(dims), - data=caml_ba_create_buffer(kind,size), - ba=caml_ba_create_unsafe(kind,layout,dims,data); - switch(kind) - {case 2:for(var i=0;i < size;i++)data[i] = reader.read8s();break; - case 3: - case 12:for(var i=0;i < size;i++)data[i] = reader.read8u();break; - case 4:for(var i=0;i < size;i++)data[i] = reader.read16s();break; - case 5:for(var i=0;i < size;i++)data[i] = reader.read16u();break; - case 6:for(var i=0;i < size;i++)data[i] = reader.read32s();break; - case 8: - case 9: - var sixty=reader.read8u(); - if(sixty) - caml_failwith - ("input_value: cannot read bigarray with 64-bit OCaml ints"); - for(var i=0;i < size;i++)data[i] = reader.read32s(); - break; - case 7: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var int64=caml_int64_of_bytes(t); - ba.set(i,int64)} - break; - case 1: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var f=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,f)} - break; - case 0: - for(var i=0;i < size;i++) - {var f=caml_int32_float_of_bits(reader.read32s());ba.set(i,f)} - break; - case 10: - for(var i=0;i < size;i++) - {var - re=caml_int32_float_of_bits(reader.read32s()), - im=caml_int32_float_of_bits(reader.read32s()); - ba.set(i,[254,re,im])} - break; - case 11: - var t=new Array(8); - for(var i=0;i < size;i++) - {for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var re=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - var im=caml_int64_float_of_bits(caml_int64_of_bytes(t)); - ba.set(i,[254,re,im])} - break - } - sz[0] = (4 + num_dims) * 4; - return caml_ba_create_unsafe(kind,layout,dims,data)} - function caml_ba_compare(a,b,total){return a.compare(b,total)} - if(! Math.imul) - Math.imul - = - function(x,y){y |= 0;return ((x >> 16) * y << 16) + (x & 0xffff) * y | 0}; - var caml_mul=Math.imul; - function caml_hash_mix_int(h,d) - {d = caml_mul(d,0xcc9e2d51 | 0); - d = d << 15 | d >>> 32 - 15; - d = caml_mul(d,0x1b873593); - h ^= d; - h = h << 13 | h >>> 32 - 13; - return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0} - function caml_hash_mix_int64(h,v) - {h = caml_hash_mix_int(h,caml_int64_lo32(v)); - h = caml_hash_mix_int(h,caml_int64_hi32(v)); - return h} - function caml_hash_mix_float(h,v0) - {return caml_hash_mix_int64(h,caml_int64_bits_of_float(v0))} - function caml_ba_hash(ba) - {var num_elts=caml_ba_get_size(ba.dims),h=0; - switch(ba.kind) - {case 2: - case 3: - case 12: - if(num_elts > 256)num_elts = 256; - var w=0,i=0; - for(i = 0;i + 4 <= ba.data.length;i += 4) - {w - = - ba.data[i + 0] - | - ba.data[i + 1] - << - 8 - | - ba.data[i + 2] - << - 16 - | - ba.data[i + 3] - << - 24; - h = caml_hash_mix_int(h,w)} - w = 0; - switch(num_elts & 3) - {case 3:w = ba.data[i + 2] << 16; - case 2:w |= ba.data[i + 1] << 8; - case 1:w |= ba.data[i + 0];h = caml_hash_mix_int(h,w) - } - break; - case 4: - case 5: - if(num_elts > 128)num_elts = 128; - var w=0,i=0; - for(i = 0;i + 2 <= ba.data.length;i += 2) - {w = ba.data[i + 0] | ba.data[i + 1] << 16; - h = caml_hash_mix_int(h,w)} - if((num_elts & 1) != 0)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 6: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 8: - case 9: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 7: - if(num_elts > 32)num_elts = 32; - num_elts *= 2; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_int(h,ba.data[i]); - break; - case 10:num_elts *= 2; - case 0: - if(num_elts > 64)num_elts = 64; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break; - case 11:num_elts *= 2; - case 1: - if(num_elts > 32)num_elts = 32; - for(var i=0;i < num_elts;i++)h = caml_hash_mix_float(h,ba.data[i]); - break - } - return h} - function caml_int32_unmarshal(reader,size) - {size[0] = 4;return reader.read32s()} - function caml_nativeint_unmarshal(reader,size) - {switch(reader.read8u()) - {case 1:size[0] = 4;return reader.read32s(); - case 2:caml_failwith("input_value: native integer value too large"); - default:caml_failwith("input_value: ill-formed native integer")}} - function caml_int64_unmarshal(reader,size) - {var t=new Array(8); - for(var j=0;j < 8;j++)t[j] = reader.read8u(); - size[0] = 8; - return caml_int64_of_bytes(t)} - function caml_int64_marshal(writer,v,sizes) - {var b=caml_int64_to_bytes(v); - for(var i=0;i < 8;i++)writer.write(8,b[i]); - sizes[0] = 8; - sizes[1] = 8} - function caml_int64_compare(x,y) - {var x3=x[3] << 16,y3=y[3] << 16; - if(x3 > y3)return 1; - if(x3 < y3)return - 1; - if(x[2] > y[2])return 1; - if(x[2] < y[2])return - 1; - if(x[1] > y[1])return 1; - if(x[1] < y[1])return - 1; - return 0} - function caml_int64_hash(x) - {var lo=x[1] | (x[2] & 0xff) << 24,hi=x[2] >>> 8 & 0xffff | x[3] << 16; - return lo ^ hi} - var - caml_custom_ops= - {"_j": - {deserialize:caml_int64_unmarshal, - serialize:caml_int64_marshal, - fixed_length:8, - compare:caml_int64_compare, - hash:caml_int64_hash}, - "_i":{deserialize:caml_int32_unmarshal,fixed_length:4}, - "_n":{deserialize:caml_nativeint_unmarshal,fixed_length:4}, - "_bigarray": - {deserialize:caml_ba_deserialize, - serialize:caml_ba_serialize, - compare:caml_ba_compare, - hash:caml_ba_hash}}; - function caml_compare_val_get_custom(a) - {return caml_custom_ops[a.caml_custom] - && - caml_custom_ops[a.caml_custom].compare} - function caml_compare_val_number_custom(num,custom,swap,total) - {var comp=caml_compare_val_get_custom(custom); - if(comp) - {var x=swap > 0?comp(custom,num,total):comp(num,custom,total); - if(total && x != x)return swap; - if(+ x != + x)return + x; - if((x | 0) != 0)return x | 0} - return swap} - function caml_compare_val_tag(a) - {if(typeof a === "number") - return 1000; - else - if(a instanceof MlBytes) - return 252; - else - if(a instanceof Array && a[0] === a[0] >>> 0 && a[0] <= 255) - {var tag=a[0] | 0;return tag == 254?0:tag} - else - if(a instanceof String) - return 1252; - else - if(typeof a == "string") - return 1252; - else - if(a instanceof Number) - return 1000; - else - if(a && a.caml_custom) - return 1255; - else - if(a && a.compare) - return 1256; - else - if(typeof a == "function") - return 1247; - else - if(typeof a == "symbol")return 1251; - return 1001} - function caml_int_compare(a,b) - {if(a < b)return - 1;if(a == b)return 0;return 1} - function caml_string_compare(s1,s2) - {s1.t & 6 && caml_convert_string_to_bytes(s1); - s2.t & 6 && caml_convert_string_to_bytes(s2); - return s1.c < s2.c?- 1:s1.c > s2.c?1:0} - function caml_compare_val(a,b,total) - {var stack=[]; - for(;;) - {if(! (total && a === b)) - {var tag_a=caml_compare_val_tag(a); - if(tag_a == 250){a = a[1];continue} - var tag_b=caml_compare_val_tag(b); - if(tag_b == 250){b = b[1];continue} - if(tag_a !== tag_b) - {if(tag_a == 1000) - {if(tag_b == 1255) - return caml_compare_val_number_custom(a,b,- 1,total); - return - 1} - if(tag_b == 1000) - {if(tag_a == 1255) - return caml_compare_val_number_custom(b,a,1,total); - return 1} - return tag_a < tag_b?- 1:1} - switch(tag_a) - {case 247:caml_invalid_argument("compare: functional value");break; - case 248: - var x=caml_int_compare(a[2],b[2]);if(x != 0)return x | 0;break; - case 249:caml_invalid_argument("compare: functional value");break; - case 250: - caml_invalid_argument - ("equal: got Forward_tag, should not happen"); - break; - case 251:caml_invalid_argument("equal: abstract value");break; - case 252: - if(a !== b) - {var x=caml_string_compare(a,b);if(x != 0)return x | 0} - break; - case 253: - caml_invalid_argument("equal: got Double_tag, should not happen"); - break; - case 254: - caml_invalid_argument - ("equal: got Double_array_tag, should not happen"); - break; - case 255: - var x=caml_int64_compare(a,b);if(x != 0)return x | 0;break; - case 1247: - caml_invalid_argument("compare: functional value");break; - case 1255: - var comp=caml_compare_val_get_custom(a); - if(comp != caml_compare_val_get_custom(b)) - return a.caml_custom < b.caml_custom?- 1:1; - if(! comp)caml_invalid_argument("compare: abstract value"); - var x=comp(a,b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1256: - var x=a.compare(b,total); - if(x != x)return total?- 1:x; - if(x !== (x | 0))return - 1; - if(x != 0)return x | 0; - break; - case 1000: - a = + a; - b = + b; - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1001: - if(a < b)return - 1; - if(a > b)return 1; - if(a != b) - {if(! total)return NaN;if(a == a)return 1;if(b == b)return - 1} - break; - case 1251:if(a !== b){if(! total)return NaN;return 1}break; - case 1252: - var a=a.toString(),b=b.toString(); - if(a !== b){if(a < b)return - 1;if(a > b)return 1} - break; - case 246: - case 254: - default: - if(a.length != b.length)return a.length < b.length?- 1:1; - if(a.length > 1)stack.push(a,b,1); - break}} - if(stack.length == 0)return 0; - var i=stack.pop(); - b = stack.pop(); - a = stack.pop(); - if(i + 1 < a.length)stack.push(a,b,i + 1); - a = a[i]; - b = b[i]}} - function caml_greaterequal(x,y) - {return + (caml_compare_val(x,y,false) >= 0)} - function caml_js_from_string(s){return s.toString()} - function caml_utf8_of_utf16(s) - {for(var b="",t=b,c,d,i=0,l=s.length;i < l;i++) - {c = s.charCodeAt(i); - if(c < 0x80) - {for(var j=i + 1;j < l && (c = s.charCodeAt(j)) < 0x80;j++); - if(j - i > 512) - {t.substr(0,1);b += t;t = "";b += s.slice(i,j)} - else - t += s.slice(i,j); - if(j == l)break; - i = j} - if(c < 0x800) - {t += String.fromCharCode(0xc0 | c >> 6); - t += String.fromCharCode(0x80 | c & 0x3f)} - else - if(c < 0xd800 || c >= 0xdfff) - t - += - String.fromCharCode - (0xe0 | c >> 12,0x80 | c >> 6 & 0x3f,0x80 | c & 0x3f); - else - if - (c - >= - 0xdbff - || - i - + - 1 - == - l - || - (d = s.charCodeAt(i + 1)) - < - 0xdc00 - || - d - > - 0xdfff) - t += "\xef\xbf\xbd"; - else - {i++; - c = (c << 10) + d - 0x35fdc00; - t - += - String.fromCharCode - (0xf0 | c >> 18, - 0x80 | c >> 12 & 0x3f, - 0x80 | c >> 6 & 0x3f, - 0x80 | c & 0x3f)} - if(t.length > 1024){t.substr(0,1);b += t;t = ""}} - return b + t} - function caml_js_to_string(s) - {var tag=9; - if(! caml_is_ascii(s))tag = 8,s = caml_utf8_of_utf16(s); - return new MlBytes(tag,s,s.length)} - function caml_js_wrap_callback(f) - {return function() - {return arguments.length > 0 - ?caml_call_gen(f,arguments) - :caml_call_gen(f,[undefined])}} - function caml_lessequal(x,y){return + (caml_compare_val(x,y,false) <= 0)} - function caml_lessthan(x,y){return + (caml_compare_val(x,y,false) < 0)} - var caml_ml_channels=new Array(); - function caml_ml_flush(chanid) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened)caml_raise_sys_error("Cannot flush a closed channel"); - if(! chan.buffer || chan.buffer == "")return 0; - if - (chan.fd - && - caml_global_data.fds[chan.fd] - && - caml_global_data.fds[chan.fd].output) - {var output=caml_global_data.fds[chan.fd].output; - switch(output.length) - {case 2:output(chanid,chan.buffer);break;default:output(chan.buffer)}} - chan.buffer = ""; - return 0} - function caml_ml_string_length(s){return s.l} - function caml_std_output(chanid,s) - {var - chan=caml_ml_channels[chanid], - str=caml_new_string(s), - slen=caml_ml_string_length(str); - chan.file.write(chan.offset,str,0,slen); - chan.offset += slen; - return 0} - function js_print_stderr(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stderr.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.error && v.error(s)}} - function js_print_stdout(s) - {var s=caml_utf16_of_utf8(s),g=joo_global_object; - if(g.process && g.process.stdout && g.process.stdout.write) - g.process.stdout.write(s); - else - {if(s.charCodeAt(s.length - 1) == 10)s = s.substr(0,s.length - 1); - var v=g.console; - v && v.log && v.log(s)}} - function caml_sys_open_internal(idx,output,file,flags) - {if(caml_global_data.fds === undefined) - caml_global_data.fds = new Array(); - flags = flags?flags:{}; - var info={}; - info.file = file; - info.offset = flags.append?file.length():0; - info.flags = flags; - info.output = output; - caml_global_data.fds[idx] = info; - if(! caml_global_data.fd_last_idx || idx > caml_global_data.fd_last_idx) - caml_global_data.fd_last_idx = idx; - return idx} - function caml_sys_open(name,flags,_perms) - {var f={}; - while(flags) - {switch(flags[1]) - {case 0:f.rdonly = 1;break; - case 1:f.wronly = 1;break; - case 2:f.append = 1;break; - case 3:f.create = 1;break; - case 4:f.truncate = 1;break; - case 5:f.excl = 1;break; - case 6:f.binary = 1;break; - case 7:f.text = 1;break; - case 8:f.nonblock = 1;break - } - flags = flags[2]} - if(f.rdonly && f.wronly) - caml_raise_sys_error - (name.toString() - + - " : flags Open_rdonly and Open_wronly are not compatible"); - if(f.text && f.binary) - caml_raise_sys_error - (name.toString() - + - " : flags Open_text and Open_binary are not compatible"); - var - root=resolve_fs_device(name), - file=root.device.open(root.rest,f), - idx=caml_global_data.fd_last_idx?caml_global_data.fd_last_idx:0; - return caml_sys_open_internal(idx + 1,caml_std_output,file,f)} - caml_sys_open_internal - (0,caml_std_output,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (1,js_print_stdout,new MlFakeFile(caml_create_bytes(0))); - caml_sys_open_internal - (2,js_print_stderr,new MlFakeFile(caml_create_bytes(0))); - function caml_ml_open_descriptor_in(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.wronly)caml_raise_sys_error("fd " + fd + " is writeonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:false, - refill:null}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_open_descriptor_out(fd) - {var data=caml_global_data.fds[fd]; - if(data.flags.rdonly)caml_raise_sys_error("fd " + fd + " is readonly"); - var - channel= - {file:data.file, - offset:data.offset, - fd:fd, - opened:true, - out:true, - buffer:""}; - caml_ml_channels[channel.fd] = channel; - return channel.fd} - function caml_ml_out_channels_list() - {var l=0; - for(var c=0;c < caml_ml_channels.length;c++) - if - (caml_ml_channels[c] - && - caml_ml_channels[c].opened - && - caml_ml_channels[c].out) - l = [0,caml_ml_channels[c].fd,l]; - return l} - function caml_jsbytes_of_string(s) - {if((s.t & 6) != 0)caml_convert_string_to_bytes(s);return s.c} - function caml_ml_output_bytes(chanid,buffer,offset,len) - {var chan=caml_ml_channels[chanid]; - if(! chan.opened) - caml_raise_sys_error("Cannot output to a closed channel"); - var string; - if(offset == 0 && caml_ml_bytes_length(buffer) == len) - string = buffer; - else - {string = caml_create_bytes(len); - caml_blit_bytes(buffer,offset,string,0,len)} - var - jsstring=caml_jsbytes_of_string(string), - id=jsstring.lastIndexOf("\n"); - if(id < 0) - chan.buffer += jsstring; - else - {chan.buffer += jsstring.substr(0,id + 1); - caml_ml_flush(chanid); - chan.buffer += jsstring.substr(id + 1)} - return 0} - function caml_ml_output(chanid,buffer,offset,len) - {return caml_ml_output_bytes(chanid,buffer,offset,len)} - function caml_obj_tag(x) - {if(x instanceof Array && x[0] == x[0] >>> 0) - return x[0]; - else - if(x instanceof MlBytes) - return 252; - else - if(x instanceof Function || typeof x == "function") - return 247; - else - if(x && x.caml_custom)return 255;else return 1000} - function caml_register_global(n,v,name_opt) - {if(name_opt && joo_global_object.toplevelReloc) - n = joo_global_object.toplevelReloc(name_opt); - caml_global_data[n + 1] = v; - if(name_opt)caml_global_data[name_opt] = v} - var caml_named_values={}; - function caml_register_named_value(nm,v) - {caml_named_values[caml_jsbytes_of_string(nm)] = v;return 0} - function caml_string_of_bytes(s){return s} - function caml_sys_const_backend_type() - {return [0,caml_new_string("js_of_ocaml")]} - function caml_sys_const_max_wosize(){return 0x7FFFFFFF / 4 | 0} - var - caml_argv= - function() - {var g=joo_global_object,main="a.out",args=[]; - if(g.process && g.process.argv && g.process.argv.length > 1) - {var argv=g.process.argv; - main = argv[1]; - args = raw_array_sub(argv,2,argv.length - 2)} - var p=caml_js_to_string(main),args2=[0,p]; - for(var i=0;i < args.length;i++) - args2.push(caml_js_to_string(args[i])); - return args2} - (); - function caml_sys_get_argv(a){return [0,caml_argv[1],caml_argv]} - function caml_return_exn_constant(tag){return tag} - function caml_named_value(nm){return caml_named_values[nm]} - function caml_wrap_exception(e) - {if(e instanceof Array)return e; - if - (joo_global_object.RangeError - && - e instanceof joo_global_object.RangeError - && - e.message - && - e.message.match(/maximum call stack/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if - (joo_global_object.InternalError - && - e instanceof joo_global_object.InternalError - && - e.message - && - e.message.match(/too much recursion/i)) - return caml_return_exn_constant(caml_global_data.Stack_overflow); - if(e instanceof joo_global_object.Error && caml_named_value("jsError")) - return [0,caml_named_value("jsError"),e]; - return [0,caml_global_data.Failure,caml_js_to_string(String(e))]} - function caml_call1(f,a0) - {return f.length == 1?f(a0):caml_call_gen(f,[a0])} - function caml_call3(f,a0,a1,a2) - {return f.length == 3?f(a0,a1,a2):caml_call_gen(f,[a0,a1,a2])} - caml_fs_init(); - var - Out_of_memory=[248,caml_new_string("Out_of_memory"),-1], - Sys_error=[248,caml_new_string("Sys_error"),-2], - Failure=[248,caml_new_string("Failure"),-3], - Invalid_argument=[248,caml_new_string("Invalid_argument"),-4], - End_of_file=[248,caml_new_string("End_of_file"),-5], - Division_by_zero=[248,caml_new_string("Division_by_zero"),-6], - Not_found=[248,caml_new_string("Not_found"),-7], - Match_failure=[248,caml_new_string("Match_failure"),-8], - Stack_overflow=[248,caml_new_string("Stack_overflow"),-9], - Sys_blocked_io=[248,caml_new_string("Sys_blocked_io"),-10], - Assert_failure=[248,caml_new_string("Assert_failure"),-11], - Undefined_recursive_module= - [248,caml_new_string("Undefined_recursive_module"),-12], - _ar_=[0,caml_new_string("color")]; - caml_register_global - (11,Undefined_recursive_module,"Undefined_recursive_module"); - caml_register_global(10,Assert_failure,"Assert_failure"); - caml_register_global(9,Sys_blocked_io,"Sys_blocked_io"); - caml_register_global(8,Stack_overflow,"Stack_overflow"); - caml_register_global(7,Match_failure,"Match_failure"); - caml_register_global(6,Not_found,"Not_found"); - caml_register_global(5,Division_by_zero,"Division_by_zero"); - caml_register_global(4,End_of_file,"End_of_file"); - caml_register_global(3,Invalid_argument,"Invalid_argument"); - caml_register_global(2,Failure,"Failure"); - caml_register_global(1,Sys_error,"Sys_error"); - caml_register_global(0,Out_of_memory,"Out_of_memory"); - var - _f_=caml_new_string("output_substring"), - _m_=caml_new_string("String.blit / Bytes.blit_string"), - _l_=caml_new_string("Bytes.blit"), - _s_=caml_new_string("Buffer.add_substring/add_subbytes"), - _r_=caml_new_string("Buffer.add: cannot grow buffer"), - _Z_=[3,0,3], - ___=caml_new_string("."), - _V_=caml_new_string(">"), - _W_=caml_new_string("<\/"), - _S_=caml_new_string(">"), - _T_=caml_new_string("<"), - _P_=caml_new_string("\n"), - _w_=caml_new_string("Stdlib.Format.Empty_queue"), - _L_=[0,caml_new_string("")], - _aj_=caml_new_string("Js_of_ocaml__Js.Error"); - function _a_(_c$_){throw [0,Invalid_argument,_c$_]} - caml_fresh_oo_id(0); - var _b_=2147483647; - function _c_(_c7_,_c6_) - {var - _c8_=caml_ml_string_length(_c7_), - _c9_=caml_ml_string_length(_c6_), - _c__=caml_create_bytes(_c8_ + _c9_ | 0); - caml_blit_string(_c7_,0,_c__,0,_c8_); - caml_blit_string(_c6_,0,_c__,_c8_,_c9_); - return caml_string_of_bytes(_c__)} - caml_ml_open_descriptor_in(0); - var - _d_=caml_ml_open_descriptor_out(1), - _e_=caml_ml_open_descriptor_out(2), - _g_= - [0, - function(_cY_) - {function _cZ_(_c0_) - {var _c1_=_c0_; - for(;;) - {if(_c1_) - {var _c2_=_c1_[2],_c3_=_c1_[1]; - try - {caml_ml_flush(_c3_)} - catch(_c5_) - {_c5_ = caml_wrap_exception(_c5_); - if(_c5_[1] !== Sys_error)throw _c5_; - var _c4_=_c5_} - var _c1_=_c2_; - continue} - return 0}} - return _cZ_(caml_ml_out_channels_list(0))}]; - caml_sys_get_argv(0); - var _j_=(4 * caml_sys_const_max_wosize(0) | 0) - 1 | 0; - caml_fresh_oo_id(0); - typeof caml_sys_const_backend_type(0) === "number"; - caml_fresh_oo_id(0); - caml_fresh_oo_id(0); - var _t_=[0,0]; - function _u_(_cX_){_t_[1] = [0,_cX_,_t_[1]];return 0} - function _v_(_cU_,_cT_) - {var _cV_=[0,_cU_,0],_cW_=_cT_[1]; - return _cW_ - ?(_cT_[1] = _cV_,_cW_[2] = _cV_,0) - :(_cT_[1] = _cV_,_cT_[2] = _cV_,0)} - var _x_=[248,_w_,caml_fresh_oo_id(0)]; - function _y_(_cP_) - {var _cQ_=_cP_[2]; - if(_cQ_) - {var _cS_=_cQ_[2],_cR_=_cQ_[1]; - _cP_[2] = _cS_; - if(0 === _cS_)_cP_[1] = 0; - return _cR_} - throw _x_} - function _z_(_cO_,_cN_) - {_cO_[13] = _cO_[13] + _cN_[3] | 0;return _v_(_cN_,_cO_[28])} - var _A_=1000000010; - function _B_(_cM_,_cL_) - {return caml_call3(_cM_[17],_cL_,0,caml_ml_string_length(_cL_))} - function _C_(_cK_){return caml_call1(_cK_[19],0)} - function _D_(_cG_,_cF_,_cE_) - {_C_(_cG_); - _cG_[11] = 1; - var - _cH_=(_cG_[6] - _cE_ | 0) + _cF_ | 0, - _cI_=_cG_[8], - _cJ_=caml_lessequal(_cI_,_cH_)?_cI_:_cH_; - _cG_[10] = _cJ_; - _cG_[9] = _cG_[6] - _cG_[10] | 0; - return caml_call1(_cG_[21],_cG_[10])} - function _E_(_cD_,_cC_){return _D_(_cD_,0,_cC_)} - function _F_(_cB_,_cA_) - {_cB_[9] = _cB_[9] - _cA_ | 0;return caml_call1(_cB_[20],_cA_)} - function _G_(_ct_) - {var _cu_=_ct_[2]; - if(_cu_) - {var _cv_=_cu_[1],_cw_=_cv_[2],_cx_=_cv_[1],_cy_=_ct_[9] < _cw_?1:0; - if(_cy_) - {if(0 !== _cx_)return 5 <= _cx_?0:_E_(_ct_,_cw_);var _cz_=0} - else - var _cz_=_cy_; - return _cz_} - return _C_(_ct_)} - function _H_(_cq_) - {var _cr_=_y_(_cq_[28]),_cs_=_cr_[1]; - _cq_[12] = _cq_[12] - _cr_[3] | 0; - _cq_[9] = _cq_[9] + _cs_ | 0; - return 0} - function _I_(_bL_,_bK_,_bJ_) - {if(typeof _bJ_ === "number") - switch(_bJ_) - {case 0: - var _bM_=_bL_[3]; - if(_bM_) - {var - _bN_=_bM_[1][1], - _bO_= - function(_ch_,_cg_) - {if(_cg_) - {var _cj_=_cg_[1],_ci_=_cg_[2]; - return caml_lessthan(_ch_,_cj_) - ?[0,_ch_,_cg_] - :[0,_cj_,_bO_(_ch_,_ci_)]} - return [0,_ch_,0]}; - _bN_[1] = _bO_(_bL_[6] - _bL_[9] | 0,_bN_[1]); - return 0} - return 0; - case 1:var _bP_=_bL_[2];return _bP_?(_bL_[2] = _bP_[2],0):0; - case 2:var _bQ_=_bL_[3];return _bQ_?(_bL_[3] = _bQ_[2],0):0; - case 3:var _bR_=_bL_[2];return _bR_?_E_(_bL_,_bR_[1][2]):_C_(_bL_); - case 4: - var _bS_=_bL_[10] !== (_bL_[6] - _bL_[9] | 0)?1:0; - return _bS_?_H_(_bL_):_bS_; - default: - var _bT_=_bL_[5]; - if(_bT_) - {var _bU_=_bT_[2]; - _B_(_bL_,caml_call1(_bL_[25],_bT_[1])); - _bL_[5] = _bU_; - return 0} - return 0} - else - switch(_bJ_[0]) - {case 0: - var _bV_=_bJ_[1]; - _bL_[9] = _bL_[9] - _bK_ | 0; - _B_(_bL_,_bV_); - _bL_[11] = 0; - return 0; - case 1: - var _bW_=_bJ_[2],_bX_=_bJ_[1],_bY_=_bL_[2]; - if(_bY_) - {var _bZ_=_bY_[1],_b0_=_bZ_[2]; - switch(_bZ_[1]) - {case 0:return _F_(_bL_,_bX_); - case 1:return _D_(_bL_,_bW_,_b0_); - case 2:return _D_(_bL_,_bW_,_b0_); - case 3:return _bL_[9] < _bK_?_D_(_bL_,_bW_,_b0_):_F_(_bL_,_bX_); - case 4: - return _bL_[11] - ?_F_(_bL_,_bX_) - :_bL_[9] < _bK_ - ?_D_(_bL_,_bW_,_b0_) - :((_bL_[6] - _b0_ | 0) + _bW_ | 0) < _bL_[10] - ?_D_(_bL_,_bW_,_b0_) - :_F_(_bL_,_bX_); - default:return _F_(_bL_,_bX_)}} - return 0; - case 2: - var - _b3_=_bL_[6] - _bL_[9] | 0, - _b4_=_bL_[3], - _b1_=_bJ_[2], - _b2_=_bJ_[1]; - if(_b4_) - {var - _b5_=_b4_[1][1], - _b6_= - function(_cm_,_cl_) - {var _cn_=_cl_; - for(;;) - {if(_cn_) - {var _cp_=_cn_[1],_co_=_cn_[2]; - if(caml_greaterequal(_cp_,_cm_))return _cp_; - var _cn_=_co_; - continue} - throw Not_found}}, - _b7_=_b5_[1]; - if(_b7_) - {var _b8_=_b7_[1]; - try - {var _ca_=_b6_(_b3_,_b5_[1]),_b9_=_ca_} - catch(_ck_) - {_ck_ = caml_wrap_exception(_ck_); - if(_ck_ !== Not_found)throw _ck_; - var _b9_=_b8_} - var _b__=_b9_} - else - var _b__=_b3_; - var _b$_=_b__ - _b3_ | 0; - return 0 <= _b$_ - ?_F_(_bL_,_b$_ + _b2_ | 0) - :_D_(_bL_,_b__ + _b1_ | 0,_bL_[6])} - return 0; - case 3: - var _cb_=_bJ_[2],_cc_=_bJ_[1]; - if(_bL_[8] < (_bL_[6] - _bL_[9] | 0))_G_(_bL_); - var _cd_=_bL_[9] - _cc_ | 0,_ce_=1 === _cb_?1:_bL_[9] < _bK_?_cb_:5; - _bL_[2] = [0,[0,_ce_,_cd_],_bL_[2]]; - return 0; - case 4:_bL_[3] = [0,_bJ_[1],_bL_[3]];return 0; - default: - var _cf_=_bJ_[1]; - _B_(_bL_,caml_call1(_bL_[24],_cf_)); - _bL_[5] = [0,_cf_,_bL_[5]]; - return 0}} - function _J_(_bB_) - {for(;;) - {var _bz_=_bB_[28][2]; - if(_bz_) - {var - _bA_=_bz_[1], - _bC_=_bA_[1], - _bF_=_bC_ < 0?1:0, - _bD_=_bA_[3], - _bE_=_bA_[2], - _bG_=_bF_?(_bB_[13] - _bB_[12] | 0) < _bB_[9]?1:0:_bF_, - _bH_=1 - _bG_; - if(_bH_) - {_y_(_bB_[28]); - var _bI_=0 <= _bC_?_bC_:_A_; - _I_(_bB_,_bI_,_bE_); - _bB_[12] = _bD_ + _bB_[12] | 0; - continue} - return _bH_} - throw _x_}} - function _K_(_bw_) - {try - {var _bx_=_J_(_bw_);return _bx_} - catch(_by_) - {_by_ = caml_wrap_exception(_by_);if(_by_ === _x_)return 0;throw _by_}} - var _M_=[0,[0,-1,[0,-1,_L_,0]],0]; - function _N_(_bv_){_bv_[1] = _M_;return 0} - function _O_(_bl_,_bk_) - {var _bm_=_bl_[1]; - if(_bm_) - {var _bn_=_bm_[1],_bo_=_bn_[2],_bp_=_bo_[1],_bq_=_bm_[2],_br_=_bo_[2]; - if(_bn_[1] < _bl_[12])return _N_(_bl_); - if(typeof _br_ !== "number") - switch(_br_[0]) - {case 3: - var - _bt_=1 - _bk_, - _bu_=_bt_?(_bo_[1] = _bl_[13] + _bp_ | 0,_bl_[1] = _bq_,0):_bt_; - return _bu_; - case 1: - case 2: - var - _bs_= - _bk_?(_bo_[1] = _bl_[13] + _bp_ | 0,_bl_[1] = _bq_,0):_bk_; - return _bs_ - } - return 0} - return 0} - var _k_=caml_create_bytes(80); - caml_fill_bytes(_k_,0,80,32); - var _n_=caml_string_of_bytes(_k_); - function _Q_(_bh_,_bg_) - {var _bi_=_bg_; - for(;;) - {var _bj_=0 < _bi_?1:0; - if(_bj_) - {if(80 < _bi_) - {caml_call3(_bh_[17],_n_,0,80);var _bi_=_bi_ - 80 | 0;continue} - return caml_call3(_bh_[17],_n_,0,_bi_)} - return _bj_}} - function _R_(_bf_){return _c_(_T_,_c_(_bf_,_S_))} - function _U_(_be_){return _c_(_W_,_c_(_be_,_V_))} - function _X_(_bd_){return 0} - function _Y_(_bc_){return 0} - function _$_(_a4_,_a3_) - {function _a5_(_bb_){return 0} - function _a6_(_ba_){return 0} - var _a0_=[0,0,0],_a1_=[0,-1,_Z_,0]; - function _a7_(_a$_){return 0} - _v_(_a1_,_a0_); - var - _a2_= - [0, - [0,[0,1,_a1_],_M_], - 0, - 0, - 0, - 0, - 78, - 10, - 68, - 78, - 0, - 1, - 1, - 1, - 1, - _b_, - ___, - _a4_, - _a3_, - _a7_, - _a6_, - _a5_, - 0, - 0, - _R_, - _U_, - _X_, - _Y_, - _a0_]; - _a2_[19] = function(_a__){return caml_call3(_a2_[17],_P_,0,1)}; - _a2_[20] = function(_a9_){return _Q_(_a2_,_a9_)}; - _a2_[21] = function(_a8_){return _Q_(_a2_,_a8_)}; - return _a2_} - function _aa_(_aU_) - {function _aV_(_aZ_){return caml_ml_flush(_aU_)} - return _$_ - (function(_aW_,_aX_,_aY_) - {if(0 <= _aX_) - if(0 <= _aY_) - if(! ((caml_ml_string_length(_aW_) - _aY_ | 0) < _aX_)) - return caml_ml_output(_aU_,_aW_,_aX_,_aY_); - return _a_(_f_)}, - _aV_)} - var - _ac_=512, - _o_=_j_ < 512?_j_:_ac_, - _p_=caml_create_bytes(_o_), - _q_=[0,_p_,0,_o_,_p_], - _ad_=_aa_(_d_); - _aa_(_e_); - function _ab_(_aT_){return 0} - _$_ - (function(_aQ_,_aR_,_aS_) - {var _aK_=_aR_ < 0?1:0; - if(_aK_) - var _aL_=_aK_; - else - var - _aP_=_aS_ < 0?1:0, - _aL_=_aP_ || ((caml_ml_string_length(_aQ_) - _aS_ | 0) < _aR_?1:0); - if(_aL_)_a_(_s_); - var _aM_=_q_[2] + _aS_ | 0; - if(_q_[3] < _aM_) - {var _aG_=[0,_q_[3]]; - for(;;) - {if(_aG_[1] < (_q_[2] + _aS_ | 0)) - {_aG_[1] = 2 * _aG_[1] | 0;continue} - if(_j_ < _aG_[1]) - {if(! ((_q_[2] + _aS_ | 0) <= _j_))throw [0,Failure,_r_]; - _aG_[1] = _j_} - var - _aH_=caml_create_bytes(_aG_[1]), - _aI_=_q_[2], - _aJ_=_q_[1], - switch$0= - 0 <= _aI_ - ?(caml_ml_bytes_length(_aJ_) - _aI_ | 0) < 0 - ?0 - :(caml_ml_bytes_length(_aH_) - _aI_ | 0) < 0 - ?0 - :(caml_blit_bytes(_aJ_,0,_aH_,0,_aI_),1) - :0; - if(! switch$0)_a_(_l_); - _q_[1] = _aH_; - _q_[3] = _aG_[1]; - break}} - var - _aN_=_q_[2], - _aO_=_q_[1], - switch$1= - 0 <= _aS_ - ?0 <= _aR_ - ?(caml_ml_string_length(_aQ_) - _aS_ | 0) < _aR_ - ?0 - :0 <= _aN_ - ?(caml_ml_bytes_length(_aO_) - _aS_ | 0) < _aN_ - ?0 - :(caml_blit_string(_aQ_,_aR_,_aO_,_aN_,_aS_),1) - :0 - :0 - :0; - if(! switch$1)_a_(_m_); - _q_[2] = _aM_; - return 0}, - _ab_); - var _i_=[0,0],_h_=_g_[1]; - _g_[1] - = - function(_av_) - {if(1 - _i_[1]) - {_i_[1] = 1; - var _aw_=_ad_[4]; - for(;;) - {if(_aw_) - {var _ax_=_aw_[2]; - if(_ad_[23])_z_(_ad_,[0,0,5,0]); - if(_ad_[22]) - {var _aE_=_ad_[4]; - if(_aE_) - {var _aF_=_aE_[2]; - caml_call1(_ad_[27],_aE_[1]); - _ad_[4] = _aF_; - var switch$0=1} - else - var switch$0=0} - else - var switch$0=0; - var _aw_=_ax_; - continue} - for(;;) - {if(1 < _ad_[14]) - {if(1 < _ad_[14]) - {if(_ad_[14] < _ad_[15]) - {_z_(_ad_,[0,0,1,0]);_O_(_ad_,1);_O_(_ad_,0)} - _ad_[14] = _ad_[14] - 1 | 0} - continue} - _ad_[13] = _A_; - _K_(_ad_); - _ad_[12] = 1; - _ad_[13] = 1; - var _ay_=_ad_[28]; - _ay_[1] = 0; - _ay_[2] = 0; - _N_(_ad_); - _ad_[2] = 0; - _ad_[3] = 0; - _ad_[4] = 0; - _ad_[5] = 0; - _ad_[10] = 0; - _ad_[14] = 0; - _ad_[9] = _ad_[6]; - _ad_[14] = _ad_[14] + 1 | 0; - var _aC_=3,_aD_=0; - if(_ad_[14] < _ad_[15]) - {var _aA_=[0,- _ad_[13] | 0,[3,_aD_,_aC_],0]; - _z_(_ad_,_aA_); - _ad_[1] = [0,[0,_ad_[13],_aA_],_ad_[1]]} - else - if(_ad_[14] === _ad_[15]) - {var _aB_=_ad_[16],_az_=caml_ml_string_length(_aB_); - _z_(_ad_,[0,_az_,[0,_aB_],_az_]); - _K_(_ad_)} - caml_call1(_ad_[18],0); - break} - break}} - return caml_call1(_h_,0)}; - var - _af_=joo_global_object, - _ag_=null, - _ai_=_af_.Array, - _ak_=[248,_aj_,caml_fresh_oo_id(0)], - _al_=[0,_ak_,{}], - _ah_=undefined, - _ae_=caml_obj_tag(_al_) === 248?_al_:_al_[1]; - caml_register_named_value(caml_new_string("jsError"),_ae_); - (function(exn){throw exn}); - _u_ - (function(_au_) - {return _au_[1] === _ak_?[0,caml_js_to_string(_au_[2].toString())]:0}); - _u_ - (function(_at_) - {return _at_ instanceof _ai_?0:[0,caml_js_to_string(_at_.toString())]}); - var _am_=_af_.document; - caml_fresh_oo_id(0); - _af_.HTMLElement === _ah_; - var _ao_=chrome.storage.sync,_an_=_am_.getElementById("changeColor"); - if(_an_ == _ag_)throw Not_found; - var - _ap_= - caml_js_wrap_callback - (function(_as_) - {_an_.style.backgroundColor = _as_.color; - return _an_.setAttribute("value",_as_.color)}), - _aq_=_ar_?_ar_[1].toString():_ag_; - _ao_.get(_aq_,_ap_); - caml_call1(_g_[1],0); - return} - (function(){return this}())); diff --git a/libs/build.ocp2 b/libs/build.ocp2 deleted file mode 100644 index e69de29..0000000 diff --git a/libs/common b/libs/common deleted file mode 100644 index 7362455..0000000 --- a/libs/common +++ /dev/null @@ -1,133 +0,0 @@ -open Js_types -open Promise - -class type condition = object end -class type action = object end - -class type pageUrl = object - method hostContains : js_string t optdef prop - method hostEquals : js_string t optdef prop - method hostPrefix : js_string t optdef prop - method hostSuffix : js_string t optdef prop - method pathContains : js_string t optdef prop - method pathPrefix : js_string t optdef prop - method pathSuffix : js_string t optdef prop - method queryContains : js_string t optdef prop - method queryEquals : js_string t optdef prop - method queryPrefix : js_string t optdef prop - method querySuffix : js_string t optdef prop - method urlContains : js_string t optdef prop - method urlEquals : js_string t optdef prop - method urlMatches : js_string t optdef prop - method originAndPathMatches : js_string t optdef prop - method urlPrefix : js_string t optdef prop - method urlSuffix : js_string t optdef prop - method schemes : js_string t js_array t optdef prop - method ports : int js_array t optdef prop -end - -class type pageStateMatcher = object - method pageUrl : pageUrl t optdef prop - method css : js_string t js_array t optdef prop - method isBookmarked : bool t optdef prop -end - -class type rule = object - method id : js_string t optdef prop - method priority : int optdef prop - method conditions : condition t js_array t prop - method actions : action t js_array t prop -end - -class type declarativeEvent = object - method addRules : rule t js_array t -> ('a t -> unit) callback -> unit meth - method removeRules : js_string t js_array t optdef -> ('a t -> unit) callback -> unit meth - method getRules : js_string t js_array t -> ('a t -> unit) callback -> unit meth -end - -class type declarativeContent = object - method _ShowPageAction : action t constr prop - method _SetIcon : (js_string t -> action t) constr prop - method _RequestContentScript : - (js_string t js_array t optdef -> - js_string t js_array t optdef -> bool t optdef -> bool t optdef -> action t) constr prop - method _PageStateMatcher : (pageStateMatcher t -> condition t) constr prop - method onPageChanged : declarativeEvent t prop -end - -let declarativeContent : declarativeContent t = variable "chrome.declarativeContent" - -let make_pageUrl - ?hostContains ?hostEquals ?hostPrefix ?hostSuffix ?pathContains ?pathPrefix - ?pathSuffix ?queryContains ?queryEquals ?queryPrefix ?querySuffix ?urlContains - ?urlEquals ?urlMatches ?originAndPathMatches ?urlPrefix ?urlSuffix ?schemes - ?ports () = - let url : pageUrl t = obj [||] in - url##.hostContains := optdef string hostContains; - url##.hostEquals := optdef string hostEquals; - url##.hostPrefix := optdef string hostPrefix; - url##.hostSuffix := optdef string hostSuffix; - url##.pathContains := optdef string pathContains; - url##.pathPrefix := optdef string pathPrefix; - url##.pathSuffix := optdef string pathSuffix; - url##.queryContains := optdef string queryContains; - url##.queryEquals := optdef string queryEquals; - url##.queryPrefix := optdef string queryPrefix; - url##.querySuffix := optdef string querySuffix; - url##.urlContains := optdef string urlContains; - url##.urlEquals := optdef string urlEquals; - url##.urlMatches := optdef string urlMatches; - url##.originAndPathMatches := optdef string originAndPathMatches; - url##.urlPrefix := optdef string urlPrefix; - url##.urlSuffix := optdef string urlSuffix; - url##.schemes := optdef array_of_list_str schemes; - url##.ports := def_option ports; - url - -let make_pageStateMatcher ?pageUrl ?css ?isBookmarked () = - let state_matcher : pageStateMatcher t = obj [||] in - state_matcher##.pageUrl := def_option pageUrl; - state_matcher##.css := optdef array_of_list_str css; - state_matcher##.isBookmarked := optdef bool isBookmarked; - state_matcher - -let make_condition_base state_matcher = - let cst = declarativeContent##._PageStateMatcher in - new%js cst state_matcher - -let make_condition ?hostContains ?hostEquals ?hostPrefix ?hostSuffix ?pathContains ?pathPrefix - ?pathSuffix ?queryContains ?queryEquals ?queryPrefix ?querySuffix ?urlContains - ?urlEquals ?urlMatches ?originAndPathMatches ?urlPrefix ?urlSuffix ?schemes - ?ports ?css ?isBookmarked () = - let pageUrl = make_pageUrl ?hostContains ?hostEquals ?hostPrefix ?hostSuffix ?pathContains ?pathPrefix - ?pathSuffix ?queryContains ?queryEquals ?queryPrefix ?querySuffix ?urlContains - ?urlEquals ?urlMatches ?originAndPathMatches ?urlPrefix ?urlSuffix ?schemes - ?ports () in - let state_matcher = make_pageStateMatcher ~pageUrl ?css ?isBookmarked () in - make_condition_base state_matcher - -let showPageAction () = - let cst = declarativeContent##._ShowPageAction in new%js cst -let setIcon path = - let cst = declarativeContent##._SetIcon in new%js cst (string path) -let requestContentScript ?css ?js ?allFrames ?matchAboutBlank () = - let cst = declarativeContent##._RequestContentScript in - new%js cst (optdef array_of_list_str css) (optdef array_of_list_str js) - (optdef bool allFrames) (optdef bool matchAboutBlank) - -let make_rule ?id ?priority conditions actions = - let rule : rule t = obj [||] in - rule##.conditions := array_of_list conditions; - rule##.actions := array_of_list actions; - rule##.priority := def_option priority; - rule##.id := optdef string id; - rule - -let addRules rules = - to_lwt_cb (fun cb -> - declarativeContent##.onPageChanged##addRules (array_of_list rules) cb) - -let removeRules ?ids () = - to_lwt_cb (fun cb -> - declarativeContent##.onPageChanged##removeRules - (optdef array_of_list_str ids) cb) diff --git a/libs/js-min/dune b/libs/js-min/dune new file mode 100644 index 0000000..9641158 --- /dev/null +++ b/libs/js-min/dune @@ -0,0 +1,20 @@ +(library + (name js_log) + (public_name ocplib-jsutils.js-log) + (modules js_log) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) + +(library + (name js_min) + (public_name ocplib-jsutils.js-min) + (modules js_min) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) + +(library + (name dom_min) + (public_name ocplib-jsutils.dom-min) + (modules dom_min) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_min)) \ No newline at end of file diff --git a/libs/js-min/js_min.ml b/libs/js-min/js_min.ml index f606c92..22942b0 100644 --- a/libs/js-min/js_min.ml +++ b/libs/js-min/js_min.ml @@ -1,11 +1,12 @@ include Js_of_ocaml.Js -include Pervasives module Url = Js_of_ocaml.Url module Dom_html = Js_of_ocaml.Dom_html module Firebug = Js_of_ocaml.Firebug module File = Js_of_ocaml.File module Dom = Js_of_ocaml.Dom +type ('a, 'b) result = ('a, 'b) Stdlib.Result.t = Ok of 'a | Error of 'b + type window = Dom_html.window let to_arrayf f a = Array.map f (to_array a) diff --git a/libs/ocplib-ace/ace.ml b/libs/ocplib-ace/ace.ml index 8d387f2..57cc9d9 100644 --- a/libs/ocplib-ace/ace.ml +++ b/libs/ocplib-ace/ace.ml @@ -15,7 +15,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . *) -open Ocp_js +open Js_of_ocaml open Ace_types let iter_option f = function diff --git a/libs/ocplib-ace/ace.mli b/libs/ocplib-ace/ace.mli index 5981751..3b24bb0 100644 --- a/libs/ocplib-ace/ace.mli +++ b/libs/ocplib-ace/ace.mli @@ -15,7 +15,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . *) -open Ocp_js +open Js_of_ocaml (** Editor *) diff --git a/libs/ocplib-ace/ace_types.mli b/libs/ocplib-ace/ace_types.mli index 2303dfc..75d1f0c 100644 --- a/libs/ocplib-ace/ace_types.mli +++ b/libs/ocplib-ace/ace_types.mli @@ -15,7 +15,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . *) -open Ocp_js +open Js_of_ocaml class type token = object method value : Js.js_string Js.t Js.prop diff --git a/libs/ocplib-ace/dune b/libs/ocplib-ace/dune new file mode 100644 index 0000000..1d37a1f --- /dev/null +++ b/libs/ocplib-ace/dune @@ -0,0 +1,7 @@ +(library + (name ocplib_ace) + (public_name ocplib-jsutils.ace) + (modules_without_implementation ace_types) + (modules ace_types ace) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-amcharts3/dune b/libs/ocplib-amcharts3/dune new file mode 100644 index 0000000..d085ca7 --- /dev/null +++ b/libs/ocplib-amcharts3/dune @@ -0,0 +1,7 @@ +(library + (name amcharts3) + (public_name ocplib-jsutils.amcharts3) + (wrapped false) + (modules ammap3 amcharts3 amcharts3_bis) + (preprocess (pps js_of_ocaml-ppx)) + (libraries jsutils)) diff --git a/libs/ocplib-bs4/dune b/libs/ocplib-bs4/dune new file mode 100644 index 0000000..ae54186 --- /dev/null +++ b/libs/ocplib-bs4/dune @@ -0,0 +1,7 @@ +(library + (name bs4) + (public_name ocplib-jsutils.bs4) + (wrapped false) + (flags (:standard -w +a-3-4-44-45-48)) + (modules bs4 bs4_card bs4_navs bs4_form bs4_deck) + (libraries cleave jquery)) \ No newline at end of file diff --git a/libs/ocplib-cleave/cleave.ml b/libs/ocplib-cleave/cleave.ml index e131235..86c251b 100644 --- a/libs/ocplib-cleave/cleave.ml +++ b/libs/ocplib-cleave/cleave.ml @@ -1,4 +1,4 @@ -open Ocp_js +open Js_of_ocaml type string_field = Js.js_string Js.t Js.prop type int_field = int Js.prop diff --git a/libs/ocplib-cleave/dune b/libs/ocplib-cleave/dune new file mode 100644 index 0000000..4d99bfd --- /dev/null +++ b/libs/ocplib-cleave/dune @@ -0,0 +1,6 @@ +(library + (name cleave) + (public_name ocplib-jsutils.cleave) + (modules cleave) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-cytoscape/dune b/libs/ocplib-cytoscape/dune new file mode 100644 index 0000000..bee74aa --- /dev/null +++ b/libs/ocplib-cytoscape/dune @@ -0,0 +1,6 @@ +(library + (name cytoscape) + (public_name ocplib-jsutils.cytoscape) + (modules cytoscape) + (preprocess (pps js_of_ocaml-ppx)) + (libraries jsutils)) \ No newline at end of file diff --git a/libs/ocplib-d3pie/build.ocp2 b/libs/ocplib-d3pie/build.ocp2 index 2032990..29f54db 100644 --- a/libs/ocplib-d3pie/build.ocp2 +++ b/libs/ocplib-d3pie/build.ocp2 @@ -18,11 +18,8 @@ (* SOFTWARE. *) (**************************************************************************) OCaml.library("ocplib-d3pie-js", ocaml + { - link = [ - "-linkall" - ]; files = [ - "d3pie_types.ml"; + "d3pie_types.mli"; "d3pie.ml", pp_js ]; requires = [ diff --git a/libs/ocplib-d3pie/d3pie_types.ml b/libs/ocplib-d3pie/d3pie_types.mli similarity index 100% rename from libs/ocplib-d3pie/d3pie_types.ml rename to libs/ocplib-d3pie/d3pie_types.mli diff --git a/libs/ocplib-d3pie/dune b/libs/ocplib-d3pie/dune new file mode 100644 index 0000000..c84880b --- /dev/null +++ b/libs/ocplib-d3pie/dune @@ -0,0 +1,7 @@ +(library + (name d3pie) + (public_name ocplib-jsutils.d3pie) + (modules_without_implementation d3pie_types) + (modules d3pie_types d3pie) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-disqus/dune b/libs/ocplib-disqus/dune new file mode 100644 index 0000000..dd7daf9 --- /dev/null +++ b/libs/ocplib-disqus/dune @@ -0,0 +1,6 @@ +(library + (name disqus) + (public_name ocplib-jsutils.disqus) + (modules disqus) + (preprocess (pps js_of_ocaml-ppx)) + (libraries jsutils)) \ No newline at end of file diff --git a/libs/ocplib-extension/browser-lwt/dune b/libs/ocplib-extension/browser-lwt/dune new file mode 100644 index 0000000..af34c6c --- /dev/null +++ b/libs/ocplib-extension/browser-lwt/dune @@ -0,0 +1,12 @@ +(library + (name browser_lwt) + (public_name ocplib-jsutils.browser-lwt) + (modules + tabs_browser_lwt + windows_browser_lwt + runtime_browser_lwt + storage_browser_lwt + i18n_browser_lwt + browser_lwt) + (preprocess (pps js_of_ocaml-ppx)) + (libraries browser_common promise_lwt)) diff --git a/libs/ocplib-extension/browser-lwt/tabs_browser_lwt.ml b/libs/ocplib-extension/browser-lwt/tabs_browser_lwt.ml index 5219f41..5c8cb11 100644 --- a/libs/ocplib-extension/browser-lwt/tabs_browser_lwt.ml +++ b/libs/ocplib-extension/browser-lwt/tabs_browser_lwt.ml @@ -10,7 +10,7 @@ class type tabs = object method captureVisibleTab : int optdef -> imageDetails t optdef -> js_string t promise t meth method connect : int -> 'a t optdef -> port meth method create : createProperties t -> tab t promise t meth - method detectLanguage : int optdef -> (js_string t -> unit) callback -> js_string t promise t meth + method detectLanguage : int optdef -> js_string t promise t meth method discard : int -> unit promise t meth method discard_arr : int js_array t -> unit promise t meth method duplicate : int -> tab t promise t meth @@ -63,7 +63,7 @@ let captureVisibleTab ?id ?options () = let connect ?info id = tabs##connect id (Optdef.option info) let create ?callback tab = to_lwt_opt callback (tabs##create tab) let detectLanguage ?id () = - to_lwt_cb_tr to_string (fun cb -> (tabs##detectLanguage (Optdef.option id) cb)) + to_lwt_tr to_string (tabs##detectLanguage (Optdef.option id)) let discard ?callback id = to_lwt_opt callback (tabs##discard id) let discard_list ?callback ids = to_lwt_opt callback (tabs##discard_arr (of_list ids)) diff --git a/libs/ocplib-extension/browser/dune b/libs/ocplib-extension/browser/dune new file mode 100644 index 0000000..71c24a8 --- /dev/null +++ b/libs/ocplib-extension/browser/dune @@ -0,0 +1,26 @@ +(library + (name browser_common) + (public_name ocplib-jsutils.browser-common) + (wrapped false) + (modules + tabs_browser_common + windows_browser_common + runtime_browser_common + storage_browser_common + i18n_browser_common + browser_action_browser_common) + (preprocess (pps js_of_ocaml-ppx)) + (libraries extension_common promise)) + +(library + (name browser) + (public_name ocplib-jsutils.browser) + (modules + tabs_browser + windows_browser + runtime_browser + storage_browser + i18n_browser + browser_action_browser) + (preprocess (pps js_of_ocaml-ppx)) + (libraries browser_common)) diff --git a/libs/ocplib-extension/chrome-lwt/dune b/libs/ocplib-extension/chrome-lwt/dune new file mode 100644 index 0000000..62dd495 --- /dev/null +++ b/libs/ocplib-extension/chrome-lwt/dune @@ -0,0 +1,12 @@ +(library + (name chrome_lwt) + (public_name ocplib-jsutils.chrome-lwt) + (modules + tabs_chrome_lwt + windows_chrome_lwt + runtime_chrome_lwt + storage_chrome_lwt + i18n_chrome_lwt + chrome_lwt) + (preprocess (pps js_of_ocaml-ppx)) + (libraries chrome_common promise_lwt)) diff --git a/libs/ocplib-extension/chrome/dune b/libs/ocplib-extension/chrome/dune new file mode 100644 index 0000000..19ec258 --- /dev/null +++ b/libs/ocplib-extension/chrome/dune @@ -0,0 +1,27 @@ +(library + (name chrome_common) + (public_name ocplib-jsutils.chrome-common) + (wrapped false) + (modules + tabs_chrome_common + windows_chrome_common + runtime_chrome_common + storage_chrome_common + i18n_chrome_common + browser_action_chrome_common) + (preprocess (pps js_of_ocaml-ppx)) + (libraries extension_common promise)) + +(library + (name chrome) + (public_name ocplib-jsutils.chrome) + (modules + tabs_chrome + windows_chrome + runtime_chrome + storage_chrome + i18n_chrome + browser_action_chrome + chrome) + (preprocess (pps js_of_ocaml-ppx)) + (libraries chrome_common)) diff --git a/libs/ocplib-extension/common/dune b/libs/ocplib-extension/common/dune new file mode 100644 index 0000000..b8fd408 --- /dev/null +++ b/libs/ocplib-extension/common/dune @@ -0,0 +1,28 @@ +(library + (name promise) + (public_name ocplib-jsutils.promise) + (modules promise) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_min)) + +(library + (name promise_lwt) + (public_name ocplib-jsutils.promise-lwt) + (modules promise_lwt) + (preprocess (pps js_of_ocaml-ppx)) + (libraries promise lwt)) + +(library + (name extension_common) + (public_name ocplib-jsutils.extension-common) + (wrapped false) + (modules browser_utils tabs_utils runtime_utils) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_min)) + +(library + (name declarative_content) + (public_name ocplib-jsutils.declarative-content) + (modules declarative_content) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_min)) diff --git a/libs/ocplib-jquery/dune b/libs/ocplib-jquery/dune new file mode 100644 index 0000000..cb2d3f2 --- /dev/null +++ b/libs/ocplib-jquery/dune @@ -0,0 +1,13 @@ +(library + (name jquery) + (public_name ocplib-jsutils.jquery) + (modules jquery) + (preprocess (pps js_of_ocaml-ppx)) + (libraries jsutils)) + +(library + (name sortable) + (public_name ocplib-jsutils.sortable) + (modules sortable) + (preprocess (pps js_of_ocaml-ppx)) + (libraries jquery)) \ No newline at end of file diff --git a/libs/ocplib-odometer/dune b/libs/ocplib-odometer/dune new file mode 100644 index 0000000..5a30285 --- /dev/null +++ b/libs/ocplib-odometer/dune @@ -0,0 +1,6 @@ +(library + (name odometer) + (public_name ocplib-jsutils.odometer) + (modules odometer) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-odometer/odometer.ml b/libs/ocplib-odometer/odometer.ml index b42e97a..7b29c2b 100644 --- a/libs/ocplib-odometer/odometer.ml +++ b/libs/ocplib-odometer/odometer.ml @@ -1,4 +1,4 @@ -open Ocp_js +open Js_of_ocaml class type configuration = object method auto : bool Js.prop diff --git a/libs/ocplib-push/dune b/libs/ocplib-push/dune new file mode 100644 index 0000000..f3b88ee --- /dev/null +++ b/libs/ocplib-push/dune @@ -0,0 +1,6 @@ +(library + (name push_js) + (public_name ocplib-jsutils.push-js) + (modules push_js) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-push/push_js.ml b/libs/ocplib-push/push_js.ml index e978bcf..8782334 100644 --- a/libs/ocplib-push/push_js.ml +++ b/libs/ocplib-push/push_js.ml @@ -1,4 +1,4 @@ -open Ocp_js +open Js_of_ocaml class type ['a] promise = object method _then : ('a -> unit) -> 'a promise Js.t Js.meth @@ -117,7 +117,7 @@ let register_worker path f = let service_worker = service_worker () in then1 service_worker##(register (Js.string path)) f -let get_registration ?(none=fun () -> Js_utils.log "No service worker") f = +let get_registration ?(none=fun () -> Firebug.console##log (Js.string "No service worker")) f = let service_worker = service_worker () in then1 service_worker##getRegistration (fun reg -> Js.Optdef.case reg none f) @@ -160,7 +160,7 @@ let subscribe ?options reg f = let push_manager = push_manager reg in then1 push_manager##(subscribe options) f -let get_subscription ?(none=fun () -> Js_utils.log "No subscription") reg f = +let get_subscription ?(none=fun () -> Firebug.console##log (Js.string "No subscription")) reg f = let push_manager = push_manager reg in then1 push_manager##getSubscription (fun subs -> Js.Opt.case subs none f) diff --git a/libs/ocplib-qrcode/dune b/libs/ocplib-qrcode/dune new file mode 100644 index 0000000..6ff1184 --- /dev/null +++ b/libs/ocplib-qrcode/dune @@ -0,0 +1,6 @@ +(library + (name qrcode) + (public_name ocplib-jsutils.qrcode) + (modules qrcode) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-recaptcha/dune b/libs/ocplib-recaptcha/dune new file mode 100644 index 0000000..8f0eafb --- /dev/null +++ b/libs/ocplib-recaptcha/dune @@ -0,0 +1,6 @@ +(library + (name recaptcha_js) + (public_name ocplib-jsutils.recaptcha) + (modules recaptcha_js) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml)) \ No newline at end of file diff --git a/libs/ocplib-utils/build.ocp2 b/libs/ocplib-utils/build.ocp2 index 9bcf370..7ea8991 100644 --- a/libs/ocplib-utils/build.ocp2 +++ b/libs/ocplib-utils/build.ocp2 @@ -21,15 +21,10 @@ OCaml.library("ocplib-utils-js", ocaml+ { "lwt" ]; }); -if (base64_3) { - xor_file = "xor3.ml"; -} else { - xor_file = "xor.ml"; -} OCaml.library("ocplib-xor", ocaml + { has_asm = true; files = [ - xor_file + "xor.ml" ]; requires = [ "base64" diff --git a/libs/ocplib-utils/dune b/libs/ocplib-utils/dune new file mode 100644 index 0000000..1e51e09 --- /dev/null +++ b/libs/ocplib-utils/dune @@ -0,0 +1,26 @@ +(library + (name jsutils) + (public_name ocplib-jsutils.utils) + (wrapped false) + (modules + ocp_js + js_utils + lwt_request + xhr + jsbind + bootstrap_helpers + jsloc + jsStorage + cookie + session + jslang + onload + jsdate) + (preprocess (pps js_of_ocaml-ppx)) + (libraries js_of_ocaml-tyxml lwt)) + +(library + (public_name ocplib-jsutils.xor) + (name xor) + (modules xor) + (libraries base64)) \ No newline at end of file diff --git a/libs/ocplib-utils/xor.ml b/libs/ocplib-utils/xor.ml index 819bb12..4a428bb 100644 --- a/libs/ocplib-utils/xor.ml +++ b/libs/ocplib-utils/xor.ml @@ -49,6 +49,6 @@ let xor ?prefix str = done; Bytes.to_string str' -let alphabet = Bytes.to_string alphabet -let decode ?prefix str = xor ?prefix @@ B64.decode ~alphabet str -let encode ?prefix str = B64.encode ~alphabet ( xor ?prefix str ) +let alphabet = Base64.make_alphabet @@ Bytes.to_string alphabet +let decode ?prefix str = xor ?prefix @@ Base64.decode_exn ~alphabet str +let encode ?prefix str = Base64.encode_exn ~alphabet ( xor ?prefix str ) diff --git a/libs/ocplib-utils/xor3.ml b/libs/ocplib-utils/xor3.ml deleted file mode 100644 index 4a428bb..0000000 --- a/libs/ocplib-utils/xor3.ml +++ /dev/null @@ -1,54 +0,0 @@ -(* This file is part of Learn-OCaml. - * - * Copyright (C) 2016 OCamlPro. - * - * Learn-OCaml is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * Learn-OCaml 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . *) - -let alphabet = - Bytes.of_string - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - -let () = - Bytes.set alphabet 26 '+'; - Bytes.set alphabet 37 '/'; - for i = 0 to 25 do - Bytes.set alphabet i (Char.chr @@ 65 + i); - Bytes.set alphabet (i+38) (Char.chr @@ 97 + 25 - i) - done; - for i = 0 to 9 do - Bytes.set alphabet (i+27) (Char.chr @@ 48 + i) - done - -let xor_key = - "Caml1999I0150\153\200\232\027\154a\029u@\251\127SX\141\140\157\ - \219\195\000\228\020\180_CR\202\130\129\127\2491\130\011\183\ - \158b\022\"qB0\166+\169\212_\205\164 D\210Qn\181o\225\147q\156\ - \028u6\248b\177\002\164`\187\250\221\240o6\156\240\020\027\243o\ - \017h\218\208\168\164f\161+5\137\132ml\169\235\174\212\029" - -let xor ?prefix str = - let xor_key = - match prefix with - | None -> xor_key - | Some prefix -> prefix ^ xor_key in - let str' = Bytes.create (String.length str) in - for i = 0 to String.length str - 1 do - let c = Char.code xor_key.[i mod (String.length xor_key)] in - Bytes.set str' (i) (Char.chr (c lxor (Char.code (String.get str i)))) - done; - Bytes.to_string str' - -let alphabet = Base64.make_alphabet @@ Bytes.to_string alphabet -let decode ?prefix str = xor ?prefix @@ Base64.decode_exn ~alphabet str -let encode ?prefix str = Base64.encode_exn ~alphabet ( xor ?prefix str ) diff --git a/ocp-autoconf.config b/ocp-autoconf.config index b4e7578..fbd0bd4 100644 --- a/ocp-autoconf.config +++ b/ocp-autoconf.config @@ -121,6 +121,8 @@ authors = [ "Cagdas Bozman "; "Michael Laporte "; "Fabrice Le Fessant "; + "Maxime Levillain "; + "Steven de Oliveira "; ] (* [homepage]: URL of project homepage *) @@ -166,11 +168,5 @@ format_version = 5 (* [travis_versions]: Versions of OCaml to build on Travis. *) travis_versions = [ - system; - "4.02.3"; - "4.03.0"; - "4.04.0"; - "4.05.0"; - "4.06.1"; - "4.07.0" + "4.08.1"; ] diff --git a/ocp-autoconf.d/Makefile b/ocp-autoconf.d/Makefile deleted file mode 100644 index 8bf48be..0000000 --- a/ocp-autoconf.d/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -base64-conf: - @echo Updating ocp-autoconf.d/config.ocp2inc - @echo "(* Automatically generated from ocp-autoconf.d *)" > ocp-autoconf.d/config.ocp2inc - @echo "base64_3=$(BASE64_3);" >> ocp-autoconf.d/config.ocp2inc diff --git a/ocp-autoconf.d/build.ocp2inc b/ocp-autoconf.d/build.ocp2inc deleted file mode 100644 index c039cda..0000000 --- a/ocp-autoconf.d/build.ocp2inc +++ /dev/null @@ -1,5 +0,0 @@ -ppx_js = [ - "%{js_of_ocaml-ppx_SRC_DIR}%/ppx.exe"; "--as-pp" -]; - -pp_js = { pp = ppx_js }; \ No newline at end of file diff --git a/ocp-autoconf.d/configure.ac b/ocp-autoconf.d/configure.ac deleted file mode 100644 index 11880ee..0000000 --- a/ocp-autoconf.d/configure.ac +++ /dev/null @@ -1,5 +0,0 @@ - -# This file will be inserted inside autoconf/configure.ac by ocp-autoconf -# If you create variables, do not forget to add them in ocp-autoconf.config -# in the 'extra_config_vars' and 'extra_bool_vars' options. - diff --git a/ocplib-jsutils.opam b/ocplib-jsutils.opam new file mode 100644 index 0000000..8d28590 --- /dev/null +++ b/ocplib-jsutils.opam @@ -0,0 +1,38 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A collection of useful libraries to build sites with js_of_ocaml" +description: + "A collection of useful libraries to build sites with js_of_ocaml" +maintainer: ["Fabrice Le Fessant "] +authors: [ + "Cagdas Bozman " + "Michael Laporte " + "Fabrice Le Fessant " + "Maxime Levillain " + "Steven de Oliveira " +] +license: "GPL-3.0-or-later" +homepage: "https://github.com/ocamlpro/ocplib-jsutils" +doc: "https://ocamlpro.github.io/ocplib-jsutils/doc" +bug-reports: "https://github.com/ocamlpro/ocplib-jsutils/issues" +depends: [ + "dune" {>= "2.5"} + "js_of_ocaml-tyxml" {>= "3.4.0"} + "base64" {>= "3.2.0"} + "lwt" {>= "4.0.0"} +] +build: [ + ["dune" "subst"] {pinned} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocamlpro/ocplib-jsutils.git" diff --git a/opam b/opam deleted file mode 100644 index e3625f9..0000000 --- a/opam +++ /dev/null @@ -1,42 +0,0 @@ -(**************************************************************) -(* *) -(* This file is managed by ocp-autoconf *) -(* Remove it from `manage_files` in 'ocp-autoconf.config' *) -(* if you want to modify it manually (or use 'opam.trailer') *) -(* *) -(**************************************************************) - -opam-version: "1.2" -maintainer: "Fabrice Le Fessant " -authors: [ - "Cagdas Bozman " - "Michael Laporte " - "Fabrice Le Fessant " -] -homepage: "http://github.com/OCamlPro/ocplib-jsutils" -dev-repo: "https://github.com/OCamlPro/ocplib-jsutils.git" -bug-reports: "https://github.com/OCamlPro/ocplib-jsutils/issues" -build: [ - [ "./configure" - "--prefix" - "%{prefix}%" - "--with-ocamldir=%{prefix}%/lib" - "--with-metadir=%{prefix}%/lib" - ] - [ make ] -] -install: [ - [ make "install" ] -] -remove: [ -] -depends: [ - "base64" - "js_of_ocaml" - "js_of_ocaml-ppx" - "js_of_ocaml-tyxml" - "lwt" - "ocamlfind" - "ocp-build" {>= "1.99.19-beta" } -] -available: [ocaml-version >= "4.02.3"] diff --git a/push-opam.sh b/push-opam.sh deleted file mode 100755 index 95b036a..0000000 --- a/push-opam.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -e - -############################################################################# -# -# This file is managed by ocp-autoconf. -# -# Remove it from `manage_files` in 'ocp-autoconf.config' if you want to -# modify it manually. -# -############################################################################# - -# To use this script: -# * Check that ocp-autoconf.config contains the correct version -# * Call 'ocp-autoconf' to generate 'opam' -# * Call './configure' to generate autoconf/Makefile.config -# * Call './push-opam -k' to check variables -# * Verify that the sources are available at the download url -# (on github, it means releasing the current commit with the version as tag) -# * Run './push-opam', go on your fork, and do a pull-request -# In case of error, use './push-opam -r' to revert changes locally and remotely - -echo Reading information from ./autoconf/Makefile.config -echo " (generated by ./configure)" -. ./autoconf/Makefile.config -echo PACKAGE_VERSION=${PACKAGE_VERSION} -echo PACKAGE_NAME=${PACKAGE_NAME} -echo OPAM_REPO=${OPAM_REPO} -echo OPAM_REPO_FORK_REMOTE=${OPAM_REPO_FORK_REMOTE} -echo OPAM_REPO_OFFICIAL_REMOTE=${OPAM_REPO_OFFICIAL_REMOTE} -echo DOWNLOAD_URL_PREFIX=${DOWNLOAD_URL_PREFIX} -echo - -VERSION=${PACKAGE_VERSION} -PACKAGE=${PACKAGE_NAME} - -case "$1" in - "") break;; - -k) exit 0;; - -r) - echo Reverting changes to opam-repo - cd ${OPAM_REPO} && \ - git checkout master && - git branch -D ${PACKAGE}.${VERSION} && - git push ${OPAM_REPO_FORK_REMOTE} :${PACKAGE}.${VERSION}; - echo You can now restart. - echo - exit 0 - ;; -esac - -if test -f ${OPAM_REPO}/.git/refs/heads/${PACKAGE}.${VERSION}; then - echo "Error: branch ${PACKAGE}.${VERSION} already exists in OPAM_REPO." - echo " Use './push-opam.sh -r' to remove it locally and remotely." - echo - exit 2 -fi - - - -if test -f ocp-autoconf.d/descr ; then :; else - echo Missing required file 'descr' - echo - exit 2 -fi - - -echo Upgrading HEAD of OPAM_REPO... -(cd ${OPAM_REPO} && git checkout master && git pull ${OPAM_REPO_OFFICIAL_REMOTE} master) -echo - -if [ ! -e ${OPAM_REPO}/packages ]; then - echo "Error: directory ${OPAM_REPO}/packages does not exist"; - echo - exit 2 -fi - -if [ -e ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION} ]; then - echo "Error: directory for ${VERSION} already exists" - echo ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION} - echo - exit 2 -fi - -URL=${DOWNLOAD_URL_PREFIX}${VERSION}.tar.gz -echo Downloading archive from ${URL}... -TMPFILE=/tmp/push-ocaml.tmp -rm -f ${TMPFILE} - -CMD="wget -q -O ${TMPFILE} ${URL}" -echo $CMD -$CMD || (echo "Error: could not download archive."; echo; exit 2) -echo - -echo "Copying files in ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}" -echo - -CMD="mkdir -p ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}" -echo $CMD -$CMD - -CMD="cp opam ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/" -echo $CMD -$CMD - -CMD="cp ocp-autoconf.d/descr ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/" -echo $CMD -$CMD || echo OK - -if test -f ocp-autoconf.d/findlib; then - CMD="cp ocp-autoconf.d/findlib ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/" - echo $CMD - $CMD || echo OK -fi - -echo Computing checksum on ${TMPFILE}... -md5sum ${TMPFILE} -MD5SUM=$(md5sum ${TMPFILE} | cut -b 1-32) -echo 'archive: "'${URL}'"' > ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/url -echo 'checksum: "'${MD5SUM}'"' >> ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/url -echo - -echo Generated url file: -cat ${OPAM_REPO}/packages/${PACKAGE}/${PACKAGE}.${VERSION}/url -echo - -(cd ${OPAM_REPO} && - git checkout -b ${PACKAGE}.${VERSION} && - git add packages/${PACKAGE}/${PACKAGE}.${VERSION} && - git commit -m "Add ${PACKAGE}.${VERSION}" packages/${PACKAGE}/${PACKAGE}.${VERSION} && - git push ${OPAM_REPO_FORK_REMOTE} ${PACKAGE}.${VERSION}) || echo "Error: cleanup with git branch -D ${PACKAGE}.${VERSION}"