Skip to content

Commit

Permalink
Add 'ocp-get config -ocp [packages]+' to get the options to give to o…
Browse files Browse the repository at this point in the history
…cp-build to make it happy with external packages.
  • Loading branch information
samoht committed Mar 28, 2012
1 parent 9a54b40 commit 9456ac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/client.ml
Expand Up @@ -42,7 +42,7 @@ sig
(** Displays a general summary of a package. *)
val info : name -> unit

type config_request = Include | Bytelink | Asmlink
type config_request = Include | Bytelink | Asmlink | Ocp

(** Depending on request, returns options or directories where the package is installed. *)
val config : bool (* true : recursive search *) -> config_request -> name list -> unit
Expand Down Expand Up @@ -670,7 +670,7 @@ module Client : CLIENT = struct
updateArchive t.servers (name, version) spec_b archive k;
Server.updateArchive local_server (name, version) spec_b archive k

type config_request = Include | Bytelink | Asmlink
type config_request = Include | Bytelink | Asmlink | Ocp

let config is_rec req names =
log "config %s" (String.concat "," (List.map Namespace.string_of_name names));
Expand All @@ -695,7 +695,10 @@ module Client : CLIENT = struct
let one (name, version) =
let path = match Path.ocaml_options_of_library t.home name with I s -> s in
match req with
| Include ->Globals.msg "-I %s" path
| Include -> Globals.msg "-I %s" path
| Ocp ->
Globals.msg "begin library %S\n generated=true\n dirname=%S\nend\n\n"
(Namespace.string_of_name name) path
| link ->
let config = File.PConfig.find_err (Path.pconfig t.home (name, version)) in
let libraries = File.PConfig.library_names config in
Expand Down
2 changes: 2 additions & 0 deletions src/ocp_get.ml
Expand Up @@ -114,6 +114,7 @@ let config =
let set_include () = command := Some Client.Include in
let set_asmlink () = command := Some Client.Asmlink in
let set_bytelink () = command := Some Client.Bytelink in
let set_ocp () = command := Some Client.Ocp in
{
name = "config";
usage = "[package]+";
Expand All @@ -124,6 +125,7 @@ let config =
("-I", Arg.Unit set_include , " Display include options");
("-bytelink", Arg.Unit set_bytelink, " Display bytecode link options");
("-asmlink" , Arg.Unit set_asmlink , " Display native link options");
("-ocp" , Arg.Unit set_ocp , " Display ocp-build configuration");
];
anon;
main =
Expand Down

0 comments on commit 9456ac7

Please sign in to comment.