compile with findlib < 1.4
This commit is contained in:
parent
5b5839c039
commit
893cd5f327
|
@ -30,16 +30,25 @@ let () =
|
||||||
(* Use -linkpkg for creating toplevels *)
|
(* Use -linkpkg for creating toplevels *)
|
||||||
flag ["ocaml"; "link"; "toplevel"] & A"-linkpkg";
|
flag ["ocaml"; "link"; "toplevel"] & A"-linkpkg";
|
||||||
|
|
||||||
(* Optcomp *)
|
|
||||||
flag ["ocaml"; "compile"; "pa_optcomp"] & S[A"-ppopt"; A "syntax/pa_optcomp.cmo"];
|
|
||||||
flag ["ocaml"; "ocamldep"; "pa_optcomp"] & S[A"-ppopt"; A "syntax/pa_optcomp.cmo"];
|
|
||||||
flag ["ocaml"; "doc"; "pa_optcomp"] & S[A"-ppopt"; A "syntax/pa_optcomp.cmo"];
|
|
||||||
dep ["ocaml"; "ocamldep"; "pa_optcomp"] ["syntax/pa_optcomp.cmo"];
|
|
||||||
|
|
||||||
let env = BaseEnvLight.load () in
|
let env = BaseEnvLight.load () in
|
||||||
let path = BaseEnvLight.var_get "compiler_libs" env in
|
let path = BaseEnvLight.var_get "compiler_libs" env in
|
||||||
let stdlib = BaseEnvLight.var_get "standard_library" env in
|
let stdlib = BaseEnvLight.var_get "standard_library" env in
|
||||||
|
|
||||||
|
let findlib_version = BaseEnvLight.var_get "findlib_version" env in
|
||||||
|
let findlib_version =
|
||||||
|
Scanf.sscanf findlib_version "%d.%d" (Printf.sprintf "findlib_version=(%d, %d)")
|
||||||
|
in
|
||||||
|
|
||||||
|
(* Optcomp *)
|
||||||
|
let args =
|
||||||
|
S[A"-ppopt"; A"syntax/pa_optcomp.cmo";
|
||||||
|
A"-ppopt"; A"-let"; A"-ppopt"; A findlib_version]
|
||||||
|
in
|
||||||
|
flag ["ocaml"; "compile"; "pa_optcomp"] args;
|
||||||
|
flag ["ocaml"; "ocamldep"; "pa_optcomp"] args;
|
||||||
|
flag ["ocaml"; "doc"; "pa_optcomp"] args;
|
||||||
|
dep ["ocaml"; "ocamldep"; "pa_optcomp"] ["syntax/pa_optcomp.cmo"];
|
||||||
|
|
||||||
(* Add directories for compiler-libraries: *)
|
(* Add directories for compiler-libraries: *)
|
||||||
let paths = List.filter Sys.file_exists [path; path / "typing"; path / "parsing"; path / "utils"] in
|
let paths = List.filter Sys.file_exists [path; path / "typing"; path / "parsing"; path / "utils"] in
|
||||||
let paths = List.map (fun path -> S [A "-I"; A path]) paths in
|
let paths = List.map (fun path -> S [A "-I"; A path]) paths in
|
||||||
|
|
|
@ -600,11 +600,13 @@ let () =
|
||||||
|
|
||||||
let topfind_log, set_topfind_log = S.create ~eq:(fun _ _ -> false) []
|
let topfind_log, set_topfind_log = S.create ~eq:(fun _ _ -> false) []
|
||||||
|
|
||||||
|
#if findlib_version >= (1, 4)
|
||||||
let () =
|
let () =
|
||||||
let real_log = !Topfind.log in
|
let real_log = !Topfind.log in
|
||||||
Topfind.log := fun str ->
|
Topfind.log := fun str ->
|
||||||
set_topfind_log (str :: S.value topfind_log);
|
set_topfind_log (str :: S.value topfind_log);
|
||||||
if S.value topfind_verbose then real_log str
|
if S.value topfind_verbose then real_log str
|
||||||
|
#endif
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
Hashtbl.add
|
Hashtbl.add
|
||||||
|
|
|
@ -48,7 +48,8 @@ val set_hide_reserved : bool -> unit
|
||||||
(** Modifies {!hide_reserved}. *)
|
(** Modifies {!hide_reserved}. *)
|
||||||
|
|
||||||
val topfind_verbose : bool signal
|
val topfind_verbose : bool signal
|
||||||
(** If [false] (the default) messages from findlib are hidden. *)
|
(** If [false] (the default) messages from findlib are hidden. This is only effective
|
||||||
|
with findlib >= 1.4. *)
|
||||||
|
|
||||||
val get_topfind_verbose : unit -> bool
|
val get_topfind_verbose : unit -> bool
|
||||||
(** Returns the value of {!topfind_verbose}. *)
|
(** Returns the value of {!topfind_verbose}. *)
|
||||||
|
@ -57,7 +58,8 @@ val set_topfind_verbose : bool -> unit
|
||||||
(** Modifies {!topfind_verbose}. *)
|
(** Modifies {!topfind_verbose}. *)
|
||||||
|
|
||||||
val topfind_log : string list signal
|
val topfind_log : string list signal
|
||||||
(** List of messages logged by findlib since the beginning of the session. *)
|
(** List of messages logged by findlib since the beginning of the session. This
|
||||||
|
requires findlib >= 1.4. *)
|
||||||
|
|
||||||
val show_box : bool signal
|
val show_box : bool signal
|
||||||
(** If [true] (the default) the completion bar is displayed. *)
|
(** If [true] (the default) the completion bar is displayed. *)
|
||||||
|
|
Loading…
Reference in New Issue