Permalink
Browse files

[variable .opam] add the variable "make" for opam-repository

According to #132, we use the option `--makecmd <program_to_run>` to substitute variables that are behind `%{make}%` (that are used in .opam, see #132).
By default, we take `gmake` for BSD and `make` otherwise.
  • Loading branch information...
1 parent 745f1d7 commit c340757dcecfd91c3037ed5195bded4ad5e39dc1 @tuong tuong committed Sep 10, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 src/client.ml
  2. +2 −0 src/globals.ml.in
  3. +2 −0 src/opam.ml
View
@@ -298,6 +298,7 @@ let install_conf_ocaml_config t =
[
("user", (Unix.getpwuid (Unix.getuid ())).Unix.pw_name);
("group", (Unix.getgrgid (Unix.getgid ())).Unix.gr_name);
+ ("make", !Globals.makecmd);
] in
let config = File.Dot_config.create vars in
View
@@ -99,4 +99,6 @@ let os = match Sys.os_type with
| "Cygwin" -> Cygwin
| _ -> assert false
+let makecmd = ref (match os with FreeBSD | OpenBSD -> "gmake" | _ -> "make") (* WARNING check the result of "which gmake", "which make", ... *)
+
let default_cores = 1
View
@@ -54,6 +54,8 @@ let global_args = [
"--quiet" , Arg.Clear quiet, " Not display the stdout/stderr of subprocesses";
"--version" , Arg.Unit version, " Display version information";
"--yes" , Arg.Set Globals.yes, " Answer yes to all questions";
+ "--makecmd" , Arg.Set_string Globals.makecmd,
+ Printf.sprintf " Set the 'make' program used when compiling packages (default is %s)" !Globals.makecmd;
"--root" , Arg.Set_string Globals.root_path,
(Printf.sprintf " Change root path (default is %s)" Globals.default_opam_path);
]

0 comments on commit c340757

Please sign in to comment.