diff options
| author | Emilio Jesus Gallego Arias | 2018-09-27 15:46:21 +0200 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2018-09-27 15:57:54 +0200 |
| commit | 686503bfe85436e5af927a02f7e1fb0bf2f975c9 (patch) | |
| tree | 2638e6b734f50414e38b87598ea85d177e552719 /lib/system.ml | |
| parent | 64a8f3cbb2fa278ed9d7bf2e5567d4e2b9bfa9dc (diff) | |
[coqc] Use standard binary location routine from lib
Instead of rolling our own, we use the standard one that works well
when binaries are symlinked.
Diffstat (limited to 'lib/system.ml')
| -rw-r--r-- | lib/system.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system.ml b/lib/system.ml index 902a4f2506..eec007dcab 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -302,10 +302,10 @@ let with_time ~batch f x = raise e (* We use argv.[0] as we don't want to resolve symlinks *) -let get_toplevel_path top = +let get_toplevel_path ?(byte=not Dynlink.is_native) top = let open Filename in let dir = if String.equal (basename Sys.argv.(0)) Sys.argv.(0) then "" else dirname Sys.argv.(0) ^ dir_sep in let exe = if Sys.(os_type = "Win32" || os_type = "Cygwin") then ".exe" else "" in - let eff = if Dynlink.is_native then ".opt" else ".byte" in + let eff = if byte then ".byte" else ".opt" in dir ^ top ^ eff ^ exe |
