(library
 (name config)
 (synopsis "Rocq Configuration Variables")
 (public_name rocq-runtime.config)
 (modules coq_config)
 (wrapped false))

(deprecated_library_name
  (old_public_name coq-core.config)
  (new_public_name rocq-runtime.config))

(library
 (name byte_config)
 (synopsis "Rocq Configuration Variables (for bytecode only)")
 (public_name rocq-runtime.config.byte)
 (modules coq_byte_config)
 (wrapped false)
 (libraries compiler-libs.toplevel)
 (modes byte))

(deprecated_library_name
  (old_public_name coq-core.config.byte)
  (new_public_name rocq-runtime.config.byte))

(executable (name list_plugins) (modules list_plugins))
(rule (targets plugin_list)
  (deps (source_tree %{project_root}/plugins))
  (action (with-stdout-to %{targets} (chdir %{project_root} (run config/list_plugins.exe)))))

; add "-native-compiler yes" to the arguments of configure to enable native
(rule
 (targets coq_config.ml coq_byte_config.ml coq_config.py dune.c_flags)
 (mode fallback)
 (deps
   %{project_root}/dev/ocamldebug-coq.run
   %{project_root}/dev/header.c
   ; Needed to generate include lists for coq_makefile
   plugin_list)
 (action (chdir %{project_root} (run %{project_root}/tools/configure/configure.exe -quiet -relocatable))))
