Skip to content

Commit 559e1e7

Browse files
committed
Use a better heuristic to determine whether we're on a Mac, issue 69
1 parent e85f6ca commit 559e1e7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/boot/driver/main.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ let _ =
88

99
let (targ:Common.target) =
1010
match Sys.os_type with
11-
"Unix" ->
12-
(* FIXME (issue #69): this is an absurd heuristic. *)
13-
if Sys.file_exists "/System/Library"
14-
then MacOS_x86_macho
15-
else Linux_x86_elf
11+
"Unix" when Unix.system "test `uname -s` = 'Darwin'" = Unix.WEXITED 0 ->
12+
MacOS_x86_macho
13+
| "Unix" -> Linux_x86_elf
1614
| "Win32" -> Win32_x86_pe
1715
| "Cygwin" -> Win32_x86_pe
1816
| _ -> Linux_x86_elf

0 commit comments

Comments
 (0)