Skip to content

Commit

Permalink
Allow to override host platform and rpi3 support.
Browse files Browse the repository at this point in the history
Closes #20.
  • Loading branch information
dbuenzli committed Jul 1, 2016
1 parent 53121c9 commit 640cbb0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ open Command

(* Platform detection *)

let os = run_and_read "uname -s"
let darwin = os = "Darwin\n"
let linux = os = "Linux\n"
let freebsd = os = "FreeBSD\n"
let os =
String.trim @@
try Sys.getenv "TGLS_HOST_OS"
with Not_found -> run_and_read "uname -s"

let darwin = os = "Darwin"
let linux = os = "Linux"
let freebsd = os = "FreeBSD"

let rpi =
linux &&
try ignore (run_and_read "cat /proc/cpuinfo | grep -q BCM2708"); true
try ignore (run_and_read "cat /proc/cpuinfo | grep -q 'BCM270.'"); true
with Failure _ -> false

(* pkg-config invocation. N.B. we don't fail if we don't have the package. *)
Expand Down

0 comments on commit 640cbb0

Please sign in to comment.