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

Fix ocaml-system and ocaml scripts for Windows #3337

Merged
merged 1 commit into from
May 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions src/client/opamAdminRepoUpgrade.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@ let wrapper_conf_script =
\ exit 1)\n\
\ else\n\
\ let oc = open_out \"%{_:name}%.config\" in\n\
\ let ocaml = Sys.executable_name in\n\
\ let ocamlc = ocaml^\"c\" in\n\
\ let exe = \".exe\" in\n\
\ let (ocaml, suffix) =\n\
\ let s = Sys.executable_name in\n\
\ if Filename.check_suffix s exe then\n\
\ (Filename.chop_suffix s exe, exe)\n\
\ else\n\
\ (s, \"\")\n\
\ in\n\
\ let ocamlc = ocaml^\"c\"^suffix in\n\
\ let libdir =\n\
\ let ic = Unix.open_process_in (ocamlc^\" -where\") in\n\
\ set_binary_mode_in ic false;\n\
\ let r = input_line ic in\n\
\ if Unix.close_process_in ic <> Unix.WEXITED 0 then \n\
\ failwith \"Bad return from 'ocamlc -where'\";\n\
Expand All @@ -65,9 +73,9 @@ let wrapper_conf_script =
"\\\"\";\n\
\ p \"variables {\";\n\
\ p \" native: %%b\"\n\
\ (Sys.file_exists (ocaml^\"opt\"));\n\
\ (Sys.file_exists (ocaml^\"opt\"^suffix));\n\
\ p \" native-tools: %%b\"\n\
\ (Sys.file_exists (ocamlc^\".opt\"));\n\
\ (Sys.file_exists (ocamlc^\".opt\"^suffix));\n\
\ p \" native-dynlink: %%b\"\n\
\ (Sys.file_exists (Filename.concat libdir \"dynlink.cmxa\"));\n\
\ p \" stubsdir: %%S\"\n\
Expand All @@ -82,7 +90,15 @@ let wrapper_conf_script =

let system_conf_script =
"let () =\n\
\ let ocamlc = Sys.executable_name ^ \"c\" in\n\
\ let exe = \".exe\" in\n\
\ let ocamlc =\n\
\ let (base, suffix) =\n\
\ let s = Sys.executable_name in\n\
\ if Filename.check_suffix s exe then\n\
\ (Filename.chop_suffix s exe, exe)\n\
\ else\n\
\ (s, \"\") in\n\
\ base ^ \"c\" ^ suffix in\n\
\ if Sys.ocaml_version <> \"%{_:version}%\" then\n\
\ (Printf.eprintf\n\
\ \"ERROR: The compiler found at %%s has version %%s,\\n\\\n\
Expand Down