Look for `ARCH_SIXTYFOUR` in both `config.h` and `m.h`.

This commit is contained in:
Xavier Clerc 2017-11-02 12:31:14 +00:00
parent 0d4c1ede99
commit 72a3cb008f
1 changed files with 9 additions and 5 deletions

View File

@ -113,11 +113,15 @@ let sexp_of_t t =
let compare a b = compare a.name b.name
let get_arch_sixtyfour stdlib_dir =
let config_h = Path.relative stdlib_dir "caml/config.h" in
List.exists (Io.lines_of_file (Path.to_string config_h)) ~f:(fun line ->
match String.extract_blank_separated_words line with
| ["#define"; "ARCH_SIXTYFOUR"] -> true
| _ -> false)
let files = ["caml/config.h"; "caml/m.h"] in
let get_arch_sixtyfour_from file =
let config_h = Path.relative stdlib_dir file in
List.exists (Io.lines_of_file (Path.to_string config_h)) ~f:(fun line ->
match String.extract_blank_separated_words line with
| ["#define"; "ARCH_SIXTYFOUR"] -> true
| _ -> false)
in
List.exists ~f:get_arch_sixtyfour_from files
let opam_config_var ~env ~cache var =
match Hashtbl.find cache var with