From: Richard W.M. Jones Date: Sun, 18 Mar 2012 11:32:55 +0000 (+0000) Subject: Add Config.have_ocamlc, Config.have_ocamlopt, Config.ocamlfind. X-Git-Tag: 0.7.1~2 X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=commitdiff_plain;h=cb8bbd5621366d5adc82e59bff62bd8cc50d8e85 Add Config.have_ocamlc, Config.have_ocamlopt, Config.ocamlfind. Use Config.ocamlfind instead of running ocamlfind directly. --- diff --git a/lib/config.ml.in b/lib/config.ml.in index 4ecc3a4..06fb4ec 100644 --- a/lib/config.ml.in +++ b/lib/config.ml.in @@ -19,4 +19,9 @@ let package_name = "@PACKAGE_NAME@" let package_version = "@PACKAGE_VERSION@" +let have_ocamlc = "@OCAMLC@" <> "no" +let have_ocamlopt = "@OCAMLOPT@" <> "no" + +let ocamlfind = "@OCAMLFIND@" + let mailx = "@MAILX@" diff --git a/lib/config.mli b/lib/config.mli index 79fb955..895c4bc 100644 --- a/lib/config.mli +++ b/lib/config.mli @@ -16,7 +16,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +(** This module contains config information from the ./configure script. *) + val package_name : string val package_version : string +(** Package name, version. *) + +val have_ocamlc : bool +val have_ocamlopt : bool +(** Flags indicating if we have ocamlc (OCaml bytecode) and/or ocamlopt + (OCaml native code) compilers. *) + +val ocamlfind : string +(** Name of the [ocamlfind] program. *) val mailx : string +(** mailx program. *) diff --git a/tools/whenjobs.ml b/tools/whenjobs.ml index 9449abc..49a398d 100644 --- a/tools/whenjobs.ml +++ b/tools/whenjobs.ml @@ -311,8 +311,8 @@ and upload_file () = let files = get_multijobs_filenames () in List.iter ( fun file -> - let cmd = sprintf "ocamlfind ocamlc -I +camlp4 -I %s -package unix,camlp4.lib -pp 'camlp4o %s/pa_when.cmo' -c %s" - !libdir !libdir file in + let cmd = sprintf "%s c -I +camlp4 -I %s -package unix,camlp4.lib -pp 'camlp4o %s/pa_when.cmo' -c %s" + Config.ocamlfind !libdir !libdir file in if Sys.command cmd <> 0 then ( eprintf "whenjobs: %s: could not compile jobs script, see earlier errors\n" file;