diff options
| author | glondu | 2007-09-28 18:00:45 +0000 |
|---|---|---|
| committer | glondu | 2007-09-28 18:00:45 +0000 |
| commit | 98173ac0762d6e1d8b47606f77d4ac1527fe8f9b (patch) | |
| tree | 9020e6baacbfc8b914cbf96b66a73b6a446309e4 | |
| parent | 0971ccd6f98b5405c0b83474a50a4d1737e6bd6f (diff) | |
On Linux, we read /proc/self/exe to get the executable's path instead
of just relying on $0. This is needed, e.g. when coqtop -byte is being
called via a link which is in $PATH, but coqtop.byte is not in $PATH.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10153 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | toplevel/coqtop.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index d64fb38e5f..933b23c53e 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -131,7 +131,9 @@ let set_opt () = re_exec_version := "opt" let re_exec is_ide = let s = !re_exec_version in let is_native = (Mltop.get()) = Mltop.Native in - let prog = Sys.argv.(0) in + let prog = + try Unix.readlink "/proc/self/exe" + with Unix.Unix_error _ -> Sys.argv.(0) in if (is_native && s = "byte") || ((not is_native) && s = "opt") then begin let s = if s = "" then if is_native then "opt" else "byte" else s in |
