Commit 80bae68b authored by Gerd Stolpmann's avatar Gerd Stolpmann

Merge branch 'gerd/optional-vmthreads' into 'master'

no longer requiring that ocaml supports -vmthread

See merge request !22
parents 6bffc31c 580165c2
......@@ -354,18 +354,15 @@ ocaml itest-aux/remdir.ml >/dev/null 2>/dev/null || have_remdir=0
echo "Testing threading model..."
if ocamlc -vmthread >/dev/null 2>/dev/null; then
:
ocaml_threads="vm"
else
echo "The -vmthread switch is not supported: Your ocaml version is too old!"
exit 1
ocaml_threads="none"
fi
if ocamlc -config >/dev/null 2>/dev/null; then
# Good. ocamlc tells us the threading model.
if ocamlc -config | grep 'systhread_supported: true'; then
ocaml_threads="posix"
else
ocaml_threads="vm"
fi
else
# Old ocamlc do not have -config.
......@@ -376,8 +373,6 @@ else
if [ -z "$output" ]; then
ocaml_threads="posix"
else
ocaml_threads="vm"
fi
fi
......
......@@ -31,3 +31,8 @@ dnl This file is input of the m4 macro processor.
` version = "[internal]"'
`)'
`package "none" ('
` error = "threading is not supported on this platform"'
` version = "[internal]"'
`)'
......@@ -931,6 +931,9 @@ let ocamlc which () =
| _ -> `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 =
Arg.Unit (fun () ->
......@@ -1027,10 +1030,10 @@ let ocamlc which () =
Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s);
"-thread",
Arg.Unit (fun _ -> threads := threads_default);
Arg.Unit (fun _ -> support_threads(); threads := threads_default);
"-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 ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment