diff --git a/src/driver.ml b/src/driver.ml index 2916f16f0..423d27831 100644 --- a/src/driver.ml +++ b/src/driver.ml @@ -1257,6 +1257,7 @@ let standalone_run_as_ppx_rewriter () = ;; let standalone () = + Compiler_specifics.read_clflags_from_env (); try if Array.length Caml.Sys.argv >= 2 && match Caml.Sys.argv.(1) with diff --git a/src/gen-compiler_specifics b/src/gen-compiler_specifics index e28fd3fc5..56fd839ae 100644 --- a/src/gen-compiler_specifics +++ b/src/gen-compiler_specifics @@ -7,8 +7,11 @@ let () = let oc = open_out_bin Sys.argv.(2) in let pr fmt = fprintf oc (fmt ^^ "\n") in pr "module O = Ocaml_common"; - if ver < (4, 08) then - pr "let get_load_path () = !Ocaml_common.Config.load_path" - else + if ver < (4, 08) then ( + pr "let get_load_path () = !Ocaml_common.Config.load_path"; + pr "let read_clflags_from_env () = ()" + ) else ( pr "let get_load_path () = Ocaml_common.Load_path.get_paths ()"; + pr "let read_clflags_from_env () = Ocaml_common.Compmisc.read_clflags_from_env ()" + ); close_out oc