Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable various parts of -thread handling for 5.x #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/findlib/findlib_config.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*
*)

let ocaml_has_meta_files =
let ocaml_major =
String.sub Sys.ocaml_version 0 (String.index Sys.ocaml_version '.') in
int_of_string ocaml_major >= 5;;

let config_file = "@CONFIGFILE@";;

let ocaml_stdlib = "@STDLIB@";;
Expand Down
12 changes: 9 additions & 3 deletions src/findlib/frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,8 @@ let ocamlc which () =
predicates := "mt" :: "mt_vm" :: !predicates;

| `POSIX_threads ->
pass_options := !pass_options @ [ "-thread" ];
if not Findlib_config.ocaml_has_meta_files then
pass_options := !pass_options @ [ "-thread" ];
predicates := "mt" :: "mt_posix" :: !predicates;
);

Expand Down Expand Up @@ -1253,7 +1254,11 @@ let ocamlc which () =
tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo");
);

let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in
let exclude_list =
if Findlib_config.ocaml_has_meta_files then
[ stdlibdir ]
else
[ stdlibdir; threads_dir; vmthreads_dir ] in
(* Don't generate -I options for these directories because there is
* also some magic in ocamlc/ocamlopt that would not work otherwise
*)
Expand Down Expand Up @@ -1311,7 +1316,8 @@ let ocamlc which () =
else
[] in
let pkg_dir =
if pkg = "threads" then (* MAGIC *)
if not Findlib_config.ocaml_has_meta_files && pkg = "threads" then
(* MAGIC for pre-5.x days *)
match !threads with
`None -> stdlibdir
| `VM_threads -> vmthreads_dir
Expand Down