description = "Js_of_ocaml library"
version = "dev"
archive(byte) = "js_of_ocaml.cma"
requires = "js_of_ocaml.syntax,lwt"

linkopts(javascript,-jsoo_noruntime) = "+js_of_ocaml/runtime.js"
linkopts(javascript,jsoo_classlist) += "+js_of_ocaml/classlist.js"
linkopts(javascript,pkg_graphics) += "+js_of_ocaml/graphics.js"
linkopts(javascript,pkg_num) += "+js_of_ocaml/nat.js"

package "syntax" (
  description = "Js_of_ocaml syntax extension"
  version = "[distributed with js_of_ocaml]"
  requires(syntax) = "camlp4"
  archive(syntax,preprocessor) = "pa_js.cmo"
)

package "deriving" (

  exists_if = "deriving_json.cma deriving_json.cmxa"
  description = "Runtime library for the class Json."
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "deriving_json.cma"
  archive(native) = "deriving_json.cmxa"
  requires = "bytes"
  requires(syntax) = "js_of_ocaml.deriving.syntax"

  package "syntax" (
    description = "Safe \"IO in JSON\" class for deriving."
    version = "[distributed with js_of_ocaml]"
    archive(syntax, preprocessor) = "pa_deriving_Json.cmo"
    archive(syntax, toploop) = "pa_deriving_Json.cmo"
    requires(syntax) = "deriving.syntax.common"
  )
)

package "graphics" (
  exists_if = "graphics.cma"
  description = "Graphics for js_of_ocaml."
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "graphics.cma"
  requires = "lwt,graphics,js_of_ocaml"
)

package "tyxml" (
  exists_if = "tyxml.cma"
  description = "Tyxml for js_of_ocaml."
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "tyxml.cma"
  requires = "tyxml.functor,reactiveData,react,js_of_ocaml,js_of_ocaml.weak"
)

package "log" (
  exists_if = "logger.cma"
  description = "Lwt logger for js_of_ocaml."
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "logger.cma"
  requires = "lwt,lwt.log,js_of_ocaml,js_of_ocaml.weak"
)

package "weak" (
  exists_if = "weak.js"
  description = "weak emulation for js_of_ocaml."
  version = "[distributed with js_of_ocaml]"
  linkopts(javascript) = "+js_of_ocaml/weak.js"
)

package "ocamlbuild" (
  description = "Js_of_ocaml ocamlbuild plugin"
  requires = "ocamlbuild,str"
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "ocamlbuild_js_of_ocaml.cma"
  archive(byte, plugin) = "ocamlbuild_js_of_ocaml.cma"
  archive(native) = "ocamlbuild_js_of_ocaml.cmxa"
  archive(native, plugin) = "ocamlbuild_js_of_ocaml.cmxs"
)

package "compiler" (
  description = "Js_of_ocaml compiler library"
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "compiler.cma"
  archive(byte, plugin) = "compiler.cma"
  archive(native) = "compiler.cmxa"
  archive(native, plugin) = "compiler.cmxs"
  requires = "findlib,bytes"
)

package "toplevel" (
  exists_if = "jsooTop.cmo"
  description = "Js_of_ocaml toplevel library"
  version = "[distributed with js_of_ocaml]"
  archive(byte) = "jsooTop.cmo"
  requires = "bytes,compiler-libs.bytecomp,compiler-libs.common,compiler-libs.toplevel,js_of_ocaml,js_of_ocaml.compiler"
  linkopts(javascript) = "+js_of_ocaml/toplevel.js"
)
