Support architectures without natdynlink
This commit is contained in:
parent
ae674faa78
commit
d5d861b40c
|
@ -31,6 +31,7 @@ type t =
|
||||||
; findlib : Findlib.t
|
; findlib : Findlib.t
|
||||||
; arch_sixtyfour : bool
|
; arch_sixtyfour : bool
|
||||||
; opam_var_cache : (string, string) Hashtbl.t
|
; opam_var_cache : (string, string) Hashtbl.t
|
||||||
|
; natdynlink_supported : bool
|
||||||
; ocamlc_config : (string * string) list
|
; ocamlc_config : (string * string) list
|
||||||
; version : string
|
; version : string
|
||||||
; stdlib_dir : Path.t
|
; stdlib_dir : Path.t
|
||||||
|
@ -197,6 +198,7 @@ let create ~(kind : Kind.t) ~path ~env ~name ~merlin =
|
||||||
in
|
in
|
||||||
let get_path var = Path.absolute (get var) in
|
let get_path var = Path.absolute (get var) in
|
||||||
let stdlib_dir = get_path "standard_library" in
|
let stdlib_dir = get_path "standard_library" in
|
||||||
|
let natdynlink_supported = Path.exists (Path.relative stdlib_dir "dynlink.cmxa") in
|
||||||
return
|
return
|
||||||
{ name
|
{ name
|
||||||
; kind
|
; kind
|
||||||
|
@ -221,6 +223,8 @@ let create ~(kind : Kind.t) ~path ~env ~name ~merlin =
|
||||||
|
|
||||||
; opam_var_cache
|
; opam_var_cache
|
||||||
|
|
||||||
|
; natdynlink_supported
|
||||||
|
|
||||||
; stdlib_dir
|
; stdlib_dir
|
||||||
; ocamlc_config = String_map.bindings ocamlc_config
|
; ocamlc_config = String_map.bindings ocamlc_config
|
||||||
; version = get "version"
|
; version = get "version"
|
||||||
|
|
|
@ -70,6 +70,9 @@ type t =
|
||||||
|
|
||||||
; opam_var_cache : (string, string) Hashtbl.t
|
; opam_var_cache : (string, string) Hashtbl.t
|
||||||
|
|
||||||
|
; (** Native dynlink *)
|
||||||
|
natdynlink_supported : bool
|
||||||
|
|
||||||
; (** Output of [ocamlc -config] *)
|
; (** Output of [ocamlc -config] *)
|
||||||
ocamlc_config : (string * string) list
|
ocamlc_config : (string * string) list
|
||||||
; version : string
|
; version : string
|
||||||
|
|
|
@ -1407,6 +1407,7 @@ module Gen(P : Params) = struct
|
||||||
List.iter Mode.all ~f:(fun mode ->
|
List.iter Mode.all ~f:(fun mode ->
|
||||||
build_lib lib ~flags ~dir ~mode ~modules ~dep_graph);
|
build_lib lib ~flags ~dir ~mode ~modules ~dep_graph);
|
||||||
|
|
||||||
|
if ctx.natdynlink_supported then
|
||||||
Option.iter ctx.ocamlopt ~f:(fun ocamlopt ->
|
Option.iter ctx.ocamlopt ~f:(fun ocamlopt ->
|
||||||
let src = lib_archive lib ~dir ~ext:(Mode.compiled_lib_ext Native) in
|
let src = lib_archive lib ~dir ~ext:(Mode.compiled_lib_ext Native) in
|
||||||
let dst = lib_archive lib ~dir ~ext:".cmxs" in
|
let dst = lib_archive lib ~dir ~ext:".cmxs" in
|
||||||
|
@ -1833,10 +1834,16 @@ module Gen(P : Params) = struct
|
||||||
(match ctx.ocamlopt with
|
(match ctx.ocamlopt with
|
||||||
| None -> []
|
| None -> []
|
||||||
| Some _ ->
|
| Some _ ->
|
||||||
|
let files =
|
||||||
[ lib_archive ~dir lib ~ext:".cmxa"
|
[ lib_archive ~dir lib ~ext:".cmxa"
|
||||||
; lib_archive ~dir lib ~ext:ctx.ext_lib
|
; lib_archive ~dir lib ~ext:ctx.ext_lib
|
||||||
; lib_archive ~dir lib ~ext:".cmxs"
|
]
|
||||||
])
|
in
|
||||||
|
if ctx.natdynlink_supported then
|
||||||
|
files @ [ lib_archive ~dir lib ~ext:".cmxs" ]
|
||||||
|
else
|
||||||
|
files
|
||||||
|
)
|
||||||
; (match lib.js_of_ocaml with
|
; (match lib.js_of_ocaml with
|
||||||
| None -> []
|
| None -> []
|
||||||
| Some { javascript_files = l; _ } ->
|
| Some { javascript_files = l; _ } ->
|
||||||
|
|
Loading…
Reference in New Issue