2011-07-25 13:30:42 +00:00
|
|
|
(*
|
|
|
|
* setup.ml
|
|
|
|
* --------
|
2012-10-17 09:33:37 +00:00
|
|
|
* Copyright : (c) 2012, Jeremie Dimino <jeremie@dimino.org>
|
2011-07-25 13:30:42 +00:00
|
|
|
* Licence : BSD3
|
|
|
|
*
|
|
|
|
* This file is a part of utop.
|
|
|
|
*)
|
|
|
|
|
|
|
|
(* OASIS_START *)
|
2012-04-25 06:05:14 +00:00
|
|
|
#use "topfind";;
|
|
|
|
#require "oasis.dynrun";;
|
|
|
|
open OASISDynRun;;
|
2011-07-25 13:30:42 +00:00
|
|
|
(* OASIS_STOP *)
|
|
|
|
|
2011-08-03 17:00:52 +00:00
|
|
|
let search_compiler_libs () =
|
2012-04-25 06:08:51 +00:00
|
|
|
prerr_endline "I: Searching for OCaml compiler libraries";
|
2011-08-03 17:00:52 +00:00
|
|
|
let stdlib = BaseEnv.var_get "standard_library" in
|
|
|
|
let ( / ) = Filename.concat in
|
|
|
|
try
|
|
|
|
List.find (fun path -> Sys.file_exists (path / "types.cmi") || Sys.file_exists (path / "typing" / "types.cmi")) [
|
|
|
|
stdlib;
|
|
|
|
stdlib / "compiler-libs";
|
|
|
|
stdlib / "compiler-lib";
|
|
|
|
stdlib / ".." / "compiler-libs";
|
|
|
|
stdlib / ".." / "compiler-lib";
|
|
|
|
]
|
|
|
|
with Not_found ->
|
2012-04-25 06:08:51 +00:00
|
|
|
prerr_endline "E: Cannot find compiler libraries! See the README for details.";
|
2011-08-03 17:00:52 +00:00
|
|
|
exit 1
|
|
|
|
|
|
|
|
let compiler_libs =
|
|
|
|
BaseEnv.var_define
|
|
|
|
~short_desc:(fun () -> "compiler libraries")
|
|
|
|
"compiler_libs"
|
2011-11-22 19:28:08 +00:00
|
|
|
search_compiler_libs
|
2011-08-03 17:00:52 +00:00
|
|
|
|
|
|
|
let () = setup ()
|