# Specifications for the "camlp4" preprocessor:
requires = ""
version = "[distributed with Ocaml]"
description = "Base for Camlp4 syntax extensions"
directory = "%%camlp4_dir%%"

# For the toploop:
archive(byte,toploop,camlp4o) = "camlp4o.cma"
archive(byte,toploop,camlp4r) = "camlp4r.cma"

# Scheme-like syntax:
# Do #predicates "syntax,camlp4scheme", followed by #require "camlp4"
archive(byte,toploop,camlp4scheme) = "camlp4sch.cma"

# Standard ML-like syntax:
# Do #predicates "syntax,camlp4sml", followed by #require "camlp4"
archive(byte,toploop,camlp4sml) = "gramlib.cma camlp4_top.cma pa_sml.cmo"

# Lisp-like syntax:
# Do #predicates "syntax,camlp4lisp", followed by #require "camlp4"
archive(byte,toploop,camlp4lisp) = "gramlib.cma camlp4_top.cma pa_lisp.cmo"

# For the preprocessor itself:
archive(syntax,preprocessor,camlp4o) = "pa_o.cmo pa_op.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp4r) = "pa_r.cmo pa_rp.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp4sml) = "pa_sml.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp4scheme) = "pa_scheme.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp4lisp) = "pa_lisp.cmo pr_dump.cmo"
preprocessor = "%%camlp4_cmd%% -nolib"

package "gramlib" (
  requires(toploop) = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Grammar library to create syntax extensions"
  archive(byte) = "gramlib.cma"
  archive(byte,toploop) = ""  # already contained in camlp4*.cma
  archive(native) = "gramlib.cmxa"
)

package "quotations" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Quotations to create AST nodes"
  archive(syntax,preprocessor) = "q_MLast.cmo"
  archive(syntax,toploop) = "q_MLast.cmo"
)

package "phony_quotations" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Phony quotations"
  archive(syntax,preprocessor) = "q_phony.cmo"
  archive(syntax,toploop) = "q_phony.cmo"
)

package "extend" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: EXTEND the camlp4 grammar"
  archive(syntax,preprocessor) = "pa_extend.cmo"
  archive(syntax,toploop) = "pa_extend.cmo"
)

package "extfun" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Extensible functions"
  archive(syntax,preprocessor) = "pa_extfun.cmo"
  archive(syntax,toploop) = "pa_extfun.cmo"
)

package "fstream" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Functional stream parsers"
  archive(syntax,preprocessor) = "pa_fstream.cmo"
  archive(syntax,toploop) = "pa_fstream.cmo"
)

package "macro" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Conditional compilation"
  archive(syntax,preprocessor) = "pa_macro.cmo"
  archive(syntax,toploop) = "pa_macro.cmo"
)

package "unit_constraints" (
  requires = "camlp4"
  version = "[distributed with Ocaml]"
  description = "Syntax extension: Type constraints of type unit (revised syntax only)"
  archive(syntax,preprocessor,camlp4r) = "pa_ru.cmo"
  archive(syntax,toploop,camlp4r) = "pa_ru.cmo"
  error(syntax,-camlp4r) = "Not available"
)
