aboutsummaryrefslogtreecommitdiff
path: root/topbin
diff options
context:
space:
mode:
Diffstat (limited to 'topbin')
-rw-r--r--topbin/coqc_bin.ml13
-rw-r--r--topbin/coqproofworker_bin.ml14
-rw-r--r--topbin/coqqueryworker_bin.ml13
-rw-r--r--topbin/coqtacticworker_bin.ml13
-rw-r--r--topbin/coqtop_bin.ml16
-rw-r--r--topbin/coqtop_byte_bin.ml34
-rw-r--r--topbin/dune43
7 files changed, 146 insertions, 0 deletions
diff --git a/topbin/coqc_bin.ml b/topbin/coqc_bin.ml
new file mode 100644
index 0000000000..d711c81124
--- /dev/null
+++ b/topbin/coqc_bin.ml
@@ -0,0 +1,13 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+(* Main coqc initialization *)
+let _ =
+ Coqc.main ()
diff --git a/topbin/coqproofworker_bin.ml b/topbin/coqproofworker_bin.ml
new file mode 100644
index 0000000000..7ae91cfbd3
--- /dev/null
+++ b/topbin/coqproofworker_bin.ml
@@ -0,0 +1,14 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+module W = AsyncTaskQueue.MakeWorker(Stm.ProofTask) ()
+
+let () =
+ WorkerLoop.start ~init:W.init_stdout ~loop:W.main_loop
diff --git a/topbin/coqqueryworker_bin.ml b/topbin/coqqueryworker_bin.ml
new file mode 100644
index 0000000000..98c8581213
--- /dev/null
+++ b/topbin/coqqueryworker_bin.ml
@@ -0,0 +1,13 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+module W = AsyncTaskQueue.MakeWorker(Stm.QueryTask) ()
+
+let () = WorkerLoop.start ~init:W.init_stdout ~loop:W.main_loop
diff --git a/topbin/coqtacticworker_bin.ml b/topbin/coqtacticworker_bin.ml
new file mode 100644
index 0000000000..2634baa83f
--- /dev/null
+++ b/topbin/coqtacticworker_bin.ml
@@ -0,0 +1,13 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+module W = AsyncTaskQueue.MakeWorker(Stm.TacTask) ()
+
+let () = WorkerLoop.start ~init:W.init_stdout ~loop:W.main_loop
diff --git a/topbin/coqtop_bin.ml b/topbin/coqtop_bin.ml
new file mode 100644
index 0000000000..4490db59e7
--- /dev/null
+++ b/topbin/coqtop_bin.ml
@@ -0,0 +1,16 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+let drop_setup () = Mltop.remove ()
+
+(* Main coqtop initialization *)
+let _ =
+ drop_setup ();
+ Coqtop.(start_coq coqtop_toplevel)
diff --git a/topbin/coqtop_byte_bin.ml b/topbin/coqtop_byte_bin.ml
new file mode 100644
index 0000000000..abe397830f
--- /dev/null
+++ b/topbin/coqtop_byte_bin.ml
@@ -0,0 +1,34 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+let drop_setup () =
+ begin try
+ (* Enable rectypes in the toplevel if it has the directive #rectypes *)
+ begin match Hashtbl.find Toploop.directive_table "rectypes" with
+ | Toploop.Directive_none f -> f ()
+ | _ -> ()
+ end
+ with
+ | Not_found -> ()
+ end;
+ let ppf = Format.std_formatter in
+ Mltop.(set_top
+ { load_obj = (fun f -> if not (Topdirs.load_file ppf f)
+ then CErrors.user_err Pp.(str ("Could not load plugin "^f))
+ );
+ use_file = Topdirs.dir_use ppf;
+ add_dir = Topdirs.dir_directory;
+ ml_loop = (fun () -> Toploop.loop ppf);
+ })
+
+(* Main coqtop initialization *)
+let _ =
+ drop_setup ();
+ Coqtop.(start_coq coqtop_toplevel)
diff --git a/topbin/dune b/topbin/dune
new file mode 100644
index 0000000000..e35a3de54b
--- /dev/null
+++ b/topbin/dune
@@ -0,0 +1,43 @@
+(install
+ (section bin)
+ (package coq)
+ (files (coqtop_bin.exe as coqtop)))
+
+(executable
+ (name coqtop_bin)
+ (public_name coqtop.opt)
+ (package coq)
+ (modules coqtop_bin)
+ (libraries coq.toplevel)
+ (link_flags -linkall))
+
+(executable
+ (name coqtop_byte_bin)
+ (public_name coqtop.byte)
+ (package coq)
+ (modules coqtop_byte_bin)
+ (libraries compiler-libs.toplevel coq.toplevel)
+ (modes byte)
+ (link_flags -linkall))
+
+(executable
+ (name coqc_bin)
+ (public_name coqc)
+ (package coq)
+ (modules coqc_bin)
+ (libraries coq.toplevel)
+ (link_flags -linkall))
+
+; Workers
+(executables
+ (names coqqueryworker_bin coqtacticworker_bin coqproofworker_bin)
+ (public_names coqqueryworker.opt coqtacticworker.opt coqproofworker.opt)
+ (package coq)
+ (modules :standard \ coqtop_byte_bin coqtop_bin coqc_bin)
+ (libraries coq.toplevel)
+ (link_flags -linkall))
+
+; Workers installed targets
+(alias
+ (name topworkers)
+ (deps %{bin:coqqueryworker.opt} %{bin:coqtacticworker.opt} %{bin:coqproofworker.opt}))