@@ -57,11 +57,13 @@ let get_dirs context ~prefix_from_command_line ~from_command_line =
5757 ~hints:
5858 [ Pp. concat
5959 ~sep: Pp. space
60- [ Pp. text " It can be specified with"
61- ; User_message. command " --prefix"
62- ; Pp. textf " or by setting"
63- ; User_message. command (sprintf " --%s" name)
64- ]
60+ ([ Pp. text " It can be specified with" ; User_message. command " --prefix" ]
61+ @
62+ if String. equal name " prefix"
63+ then []
64+ else
65+ [ Pp. textf " or by setting" ; User_message. command (sprintf " --%s" name) ]
66+ )
6567 |> Pp. hovbox
6668 ]
6769 in
@@ -73,6 +75,7 @@ let get_dirs context ~prefix_from_command_line ~from_command_line =
7375 ; doc_root = must_be_defined " docdir" roots.doc_root
7476 ; share_root = must_be_defined " datadir" roots.share_root
7577 ; man = must_be_defined " mandir" roots.man
78+ ; prefix = must_be_defined " prefix" roots.prefix
7679 }
7780;;
7881
@@ -624,7 +627,7 @@ let run
624627 if relocatable
625628 then (
626629 match prefix_from_command_line with
627- | Some dir -> Some (Path. of_string dir)
630+ | Some dir -> Some (Path. of_string_allow_outside_workspace dir)
628631 | None ->
629632 User_error. raise
630633 [ Pp. concat
@@ -853,16 +856,18 @@ let make ~what =
853856 let common, config = Common. init builder in
854857 Scheduler_setup. no_build_no_rpc ~config (fun () ->
855858 let from_command_line =
856- { Install.Roots. lib_root = libdir_from_command_line
857- ; etc_root = etcdir_from_command_line
858- ; doc_root = docdir_from_command_line
859- ; man = mandir_from_command_line
860- ; bin = bindir_from_command_line
861- ; sbin = sbindir_from_command_line
862- ; libexec_root = libexecdir_from_command_line
863- ; share_root = datadir_from_command_line
859+ let path_of_string = Option. map ~f: Path. of_string in
860+ { Install.Roots. lib_root = path_of_string libdir_from_command_line
861+ ; etc_root = path_of_string etcdir_from_command_line
862+ ; doc_root = path_of_string docdir_from_command_line
863+ ; man = path_of_string mandir_from_command_line
864+ ; bin = path_of_string bindir_from_command_line
865+ ; sbin = path_of_string sbindir_from_command_line
866+ ; libexec_root = path_of_string libexecdir_from_command_line
867+ ; share_root = path_of_string datadir_from_command_line
868+ ; prefix =
869+ Option. map ~f: Path. of_string_allow_outside_workspace prefix_from_command_line
864870 }
865- |> Install.Roots. map ~f: (Option. map ~f: Path. of_string)
866871 |> Install.Roots. complete
867872 in
868873 run
0 commit comments