Pass ocamlc explicitly to configurator using DUNE_CONFIGURATOR
This commit is contained in:
parent
7a3917b9e3
commit
d65845abb8
|
@ -419,13 +419,14 @@ module Pkg_config = struct
|
||||||
end
|
end
|
||||||
|
|
||||||
let main ?(args=[]) ~name f =
|
let main ?(args=[]) ~name f =
|
||||||
let ocamlc = ref None in
|
let ocamlc = ref (Sys.getenv_opt "DUNE_CONFIGURATOR") in
|
||||||
let verbose = ref false in
|
let verbose = ref false in
|
||||||
let dest_dir = ref None in
|
let dest_dir = ref None in
|
||||||
let args =
|
let args =
|
||||||
Arg.align
|
Arg.align
|
||||||
([ "-ocamlc", Arg.String (fun s -> ocamlc := Some s),
|
([ "-ocamlc", Arg.String (fun s -> ocamlc := Some s),
|
||||||
"PATH ocamlc command to use"
|
"PATH ocamlc command to use. \
|
||||||
|
This value is set automatically when configurator is invoked by dune."
|
||||||
; "-verbose", Arg.Set verbose,
|
; "-verbose", Arg.Set verbose,
|
||||||
" be verbose"
|
" be verbose"
|
||||||
; "-dest-dir", Arg.String (fun s -> dest_dir := Some s),
|
; "-dest-dir", Arg.String (fun s -> dest_dir := Some s),
|
||||||
|
|
|
@ -303,6 +303,7 @@ let create ~(kind : Kind.t) ~path ~env ~name ~merlin ~targets () =
|
||||||
"lib")
|
"lib")
|
||||||
; extend_var "MANPATH"
|
; extend_var "MANPATH"
|
||||||
(Config.local_install_man_dir ~context:name)
|
(Config.local_install_man_dir ~context:name)
|
||||||
|
; "DUNE_CONFIGURATOR", (Path.to_string ocamlc)
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
Env.extend env ~vars:(Env.Map.of_list_exn vars)
|
Env.extend env ~vars:(Env.Map.of_list_exn vars)
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
module Configurator = Configurator.V1
|
module Configurator = Configurator.V1
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
begin match Sys.getenv_opt "DUNE_CONFIGURATOR" with
|
||||||
|
| None -> failwith "DUNE_CONFIGURATOR is not passed"
|
||||||
|
| Some _ -> print_endline "DUNE_CONFIGURATOR is present"
|
||||||
|
end;
|
||||||
Configurator.main ~name:"config" (fun t ->
|
Configurator.main ~name:"config" (fun t ->
|
||||||
match Configurator.ocaml_config_var t "version" with
|
match Configurator.ocaml_config_var t "version" with
|
||||||
| None -> failwith "version is absent"
|
| None -> failwith "version is absent"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Show that config values are present
|
Show that config values are present
|
||||||
$ jbuilder exec config/run.exe
|
$ jbuilder exec config/run.exe
|
||||||
|
DUNE_CONFIGURATOR is present
|
||||||
version is present
|
version is present
|
||||||
|
|
||||||
We're able to compile C program sucessfully
|
We're able to compile C program sucessfully
|
||||||
|
|
Loading…
Reference in New Issue