make ppx_tools dependency optional
This commit is contained in:
parent
80f4b60058
commit
57f8ac4437
4
_oasis
4
_oasis
|
@ -33,6 +33,10 @@ Flag camlp4
|
||||||
Description: camlp4 support
|
Description: camlp4 support
|
||||||
Default: false
|
Default: false
|
||||||
|
|
||||||
|
Flag interact
|
||||||
|
Description: enable UTop_main.interact (requires ppx_tools)
|
||||||
|
Default: false
|
||||||
|
|
||||||
Library utop
|
Library utop
|
||||||
Path: src/lib
|
Path: src/lib
|
||||||
Modules:
|
Modules:
|
||||||
|
|
2
_tags
2
_tags
|
@ -1,6 +1,6 @@
|
||||||
# -*- conf -*-
|
# -*- conf -*-
|
||||||
|
|
||||||
<src/**/*.ml{,i}>: cppo_V_OCAML, package(compiler-libs)
|
<src/**/*.ml{,i}>: cppo_V_OCAML, cppo_interact, package(compiler-libs)
|
||||||
<src/camlp5/**/*.ml{,i}>: use_camlp5
|
<src/camlp5/**/*.ml{,i}>: use_camlp5
|
||||||
|
|
||||||
<**/*.ml>: warn(-3-40)
|
<**/*.ml>: warn(-3-40)
|
||||||
|
|
|
@ -89,6 +89,14 @@ let () =
|
||||||
~prod:"src/top/uTop_top_full.byte"
|
~prod:"src/top/uTop_top_full.byte"
|
||||||
(fun _ _ -> cp "src/top/uTop_top.top" "src/top/uTop_top_full.byte");
|
(fun _ _ -> cp "src/top/uTop_top.top" "src/top/uTop_top_full.byte");
|
||||||
|
|
||||||
|
|
||||||
|
let interact_enabled = BaseEnvLight.var_get "interact" env = "true" in
|
||||||
|
flag ["cppo"; "cppo_interact"] (
|
||||||
|
if interact_enabled then
|
||||||
|
S [A "-D"; A "ENABLE_INTERACT"]
|
||||||
|
else
|
||||||
|
N);
|
||||||
|
|
||||||
rule "format lifter"
|
rule "format lifter"
|
||||||
~prod:"src/lib/uTop_cmt_lifter.ml"
|
~prod:"src/lib/uTop_cmt_lifter.ml"
|
||||||
(fun _ _ ->
|
(fun _ _ ->
|
||||||
|
@ -96,7 +104,7 @@ let () =
|
||||||
Scanf.sscanf (BaseEnvLight.var_get "ocaml_version" env)
|
Scanf.sscanf (BaseEnvLight.var_get "ocaml_version" env)
|
||||||
"%u.%u" (fun a b -> (a, b))
|
"%u.%u" (fun a b -> (a, b))
|
||||||
in
|
in
|
||||||
if ocaml_version < (4, 02) then
|
if ocaml_version < (4, 02) || not interact_enabled then
|
||||||
Echo ([], "src/lib/uTop_cmt_lifter.ml")
|
Echo ([], "src/lib/uTop_cmt_lifter.ml")
|
||||||
else
|
else
|
||||||
Cmd (S [ P "ocamlfind"
|
Cmd (S [ P "ocamlfind"
|
||||||
|
|
1
opam
1
opam
|
@ -30,5 +30,6 @@ depends: [
|
||||||
]
|
]
|
||||||
depopts: [
|
depopts: [
|
||||||
"camlp4"
|
"camlp4"
|
||||||
|
"ppx_tools"
|
||||||
]
|
]
|
||||||
available: [ ocaml-version >= "4.01" ]
|
available: [ ocaml-version >= "4.01" ]
|
||||||
|
|
|
@ -1373,6 +1373,15 @@ type value = V : string * _ -> value
|
||||||
let interact ~search_path ~unit ~loc:(fname, lnum, cnum, _) ~values =
|
let interact ~search_path ~unit ~loc:(fname, lnum, cnum, _) ~values =
|
||||||
failwith "UTop_main.interact is not supported on OCaml 4.01"
|
failwith "UTop_main.interact is not supported on OCaml 4.01"
|
||||||
|
|
||||||
|
#elif not defined ENABLE_INTERACT
|
||||||
|
|
||||||
|
let interact ~search_path ~unit ~loc:(fname, lnum, cnum, _) ~values =
|
||||||
|
failwith "\
|
||||||
|
UTop_main.interact wasn't enabled at compile time.
|
||||||
|
If you installed utop through opam, just do this to enable this feature:
|
||||||
|
|
||||||
|
$ opam install ppx_tools"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
exception Found of Env.t
|
exception Found of Env.t
|
||||||
|
|
Loading…
Reference in New Issue