aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2015-11-25 17:56:41 +0100
committerPierre-Marie Pédrot2015-11-25 18:02:19 +0100
commitef8718a7fd3bcd960d954093d8c636525e6cc492 (patch)
tree4a636aab8c8f18fb7ccb80e814ccc311059b5164
parente92aeed3abcf7d42045deb9fb3a450d3527eadc9 (diff)
Heuristic to check the version of lablgtk2 in configure.ml.
When not using ocamlfind, we use a grep-based heuristic to check that lablgtk2 is recent enough. This is an extension of an already-used heuristic.
-rw-r--r--configure.ml17
1 files changed, 13 insertions, 4 deletions
diff --git a/configure.ml b/configure.ml
index 500796f5d1..3a55fb5707 100644
--- a/configure.ml
+++ b/configure.ml
@@ -765,9 +765,18 @@ let get_lablgtkdir () =
let check_lablgtk_version src dir = match src with
| Manual | Stdlib ->
- let test = sprintf "grep -q -w convert_with_fallback %S/glib.mli" dir in
- let ans = Sys.command test = 0 in
- printf "Warning: could not check the version of lablgtk2.\n";
+ let test accu f =
+ if accu then
+ let test = sprintf "grep -q -w %s %S/glib.mli" f dir in
+ Sys.command test = 0
+ else false
+ in
+ let heuristics = [
+ "convert_with_fallback";
+ "wrap_poll_func"; (** Introduced in lablgtk 2.16 *)
+ ] in
+ let ans = List.fold_left test true heuristics in
+ if ans then printf "Warning: could not check the version of lablgtk2.\n";
(ans, "an unknown version")
| OCamlFind ->
let v, _ = tryrun "ocamlfind" ["query"; "-format"; "%v"; "lablgtk2"] in
@@ -798,8 +807,8 @@ let check_coqide () =
if !Prefs.coqide = Some No then set_ide No "CoqIde manually disabled";
let dir, via = get_lablgtkdir () in
if dir = "" then set_ide No "LablGtk2 not found";
- let found = sprintf "LablGtk2 found (%s)" (get_source via) in
let (ok, version) = check_lablgtk_version via dir in
+ let found = sprintf "LablGtk2 found (%s, %s)" (get_source via) version in
if not ok then set_ide No (found^", but too old (required >= 2.16, found " ^ version ^ ")");
(* We're now sure to produce at least one kind of coqide *)
lablgtkdir := shorten_camllib dir;