...
 
Commits (3)
...@@ -354,18 +354,15 @@ ocaml itest-aux/remdir.ml >/dev/null 2>/dev/null || have_remdir=0 ...@@ -354,18 +354,15 @@ ocaml itest-aux/remdir.ml >/dev/null 2>/dev/null || have_remdir=0
echo "Testing threading model..." echo "Testing threading model..."
if ocamlc -vmthread >/dev/null 2>/dev/null; then if ocamlc -vmthread >/dev/null 2>/dev/null; then
: ocaml_threads="vm"
else else
echo "The -vmthread switch is not supported: Your ocaml version is too old!" ocaml_threads="none"
exit 1
fi fi
if ocamlc -config >/dev/null 2>/dev/null; then if ocamlc -config >/dev/null 2>/dev/null; then
# Good. ocamlc tells us the threading model. # Good. ocamlc tells us the threading model.
if ocamlc -config | grep 'systhread_supported: true'; then if ocamlc -config | grep 'systhread_supported: true'; then
ocaml_threads="posix" ocaml_threads="posix"
else
ocaml_threads="vm"
fi fi
else else
# Old ocamlc do not have -config. # Old ocamlc do not have -config.
...@@ -376,8 +373,6 @@ else ...@@ -376,8 +373,6 @@ else
if [ -z "$output" ]; then if [ -z "$output" ]; then
ocaml_threads="posix" ocaml_threads="posix"
else
ocaml_threads="vm"
fi fi
fi fi
......
...@@ -31,3 +31,8 @@ dnl This file is input of the m4 macro processor. ...@@ -31,3 +31,8 @@ dnl This file is input of the m4 macro processor.
` version = "[internal]"' ` version = "[internal]"'
`)' `)'
`package "none" ('
` error = "threading is not supported on this platform"'
` version = "[internal]"'
`)'
...@@ -931,6 +931,9 @@ let ocamlc which () = ...@@ -931,6 +931,9 @@ let ocamlc which () =
| _ -> `None | _ -> `None
in in
let threads = ref `None in let threads = ref `None in
let support_threads() =
if threads_default = `None then
failwith "threading is not supported on this platform" in
let add_switch name = let add_switch name =
Arg.Unit (fun () -> Arg.Unit (fun () ->
...@@ -1027,10 +1030,10 @@ let ocamlc which () = ...@@ -1027,10 +1030,10 @@ let ocamlc which () =
Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s); Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s);
"-thread", "-thread",
Arg.Unit (fun _ -> threads := threads_default); Arg.Unit (fun _ -> support_threads(); threads := threads_default);
"-vmthread", "-vmthread",
Arg.Unit (fun _ -> threads := `VM_threads); Arg.Unit (fun _ -> support_threads(); threads := `VM_threads);
"-", "-",
Arg.String (fun s -> pass_files := !pass_files @ [ Pass s ]); Arg.String (fun s -> pass_files := !pass_files @ [ Pass s ]);
......