Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Regenerating files with the current version of OASIS.

Ignore-this: f3a2c48c92e0a69f9b0d39e67f5a5b64

darcs-hash:20120107165700-6f87a-b9861888e528e9f4c6585cd584fc836f764181f9
  • Loading branch information...
commit 2bb6a71716786f82005724ff6bd26824c51dd060 1 parent 153c57c
@Chris00 Chris00 authored
View
2  _oasis
@@ -100,7 +100,7 @@ Library oasis
OASISTest_intern,
OASISSchema_intern
CompiledObject: Best
- BuildDepends: fileutils (>= 0.4.2), unix, pcre, extlib,
+ BuildDepends: fileutils (>= 0.4.2), unix, pcre, extlib,
findlib, odn (>= 0.0.3), ocamlgraph
BuildTools+: ocamlmod, ocamlyacc, ocamllex, ocamlify
XMETADescription: _oasis file functions
View
23 configure
@@ -1,8 +1,27 @@
#!/bin/sh
# OASIS_START
-# DO NOT EDIT (digest: ed33e59fe00e48bc31edf413bbc8b8d6)
+# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7)
set -e
-ocaml setup.ml -configure $*
+FST=true
+for i in "$@"; do
+ if $FST; then
+ set --
+ FST=false
+ fi
+
+ case $i in
+ --*=*)
+ ARG=${i%%=*}
+ VAL=${i##*=}
+ set -- "$@" "$ARG" "$VAL"
+ ;;
+ *)
+ set -- "$@" "$i"
+ ;;
+ esac
+done
+
+ocaml setup.ml -configure "$@"
# OASIS_STOP
View
16 myocamlbuild.ml
@@ -113,9 +113,9 @@ rule "ocamlify: %.mlify & %.mlify.depends -> %.ml"
;;
(* OASIS_START *)
-(* DO NOT EDIT (digest: 46e7404b32052dea3bbf853b122b0abd) *)
+(* DO NOT EDIT (digest: 3c9143f422672e7bd51ae346993043f6) *)
module OASISGettext = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISGettext.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISGettext.ml"
let ns_ str =
str
@@ -138,7 +138,7 @@ module OASISGettext = struct
end
module OASISExpr = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISExpr.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISExpr.ml"
@@ -229,7 +229,7 @@ end
module BaseEnvLight = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseEnvLight.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseEnvLight.ml"
module MapString = Map.Make(String)
@@ -326,7 +326,7 @@ end
module MyOCamlbuildFindlib = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
(** OCamlbuild extension, copied from
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
@@ -425,6 +425,7 @@ module MyOCamlbuildFindlib = struct
* the "threads" package using the previous plugin.
*)
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
+ flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
@@ -434,7 +435,7 @@ module MyOCamlbuildFindlib = struct
end
module MyOCamlbuildBase = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
(** Base functions for writing myocamlbuild.ml
@author Sylvain Le Gall
@@ -449,7 +450,7 @@ module MyOCamlbuildBase = struct
type name = string
type tag = string
-# 55 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
+# 55 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
type t =
{
@@ -579,6 +580,7 @@ let package_default =
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
+# 470 "myocamlbuild.ml"
(* OASIS_STOP *)
open Ocamlbuild_plugin;;
View
702 setup.ml
@@ -20,14 +20,14 @@
(********************************************************************************)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 37311d085094006ec60659ae8bad4c0f) *)
+(* DO NOT EDIT (digest: a7f4a96b5a8be13bf761399eb6a3e18d) *)
(*
Regenerated by OASIS v0.2.1~alpha1
Visit http://oasis.forge.ocamlcore.org for more information and
documentation about functions used in this file.
*)
module OASISGettext = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISGettext.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISGettext.ml"
let ns_ str =
str
@@ -50,7 +50,7 @@ module OASISGettext = struct
end
module OASISContext = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISContext.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISContext.ml"
open OASISGettext
@@ -62,10 +62,11 @@ module OASISContext = struct
type t =
{
- verbose: bool;
- debug: bool;
- ignore_plugins: bool;
- printf: level -> string -> unit;
+ verbose: bool;
+ debug: bool;
+ ignore_plugins: bool;
+ ignore_unknown_fields: bool;
+ printf: level -> string -> unit;
}
let printf lvl str =
@@ -76,19 +77,16 @@ module OASISContext = struct
| `Info -> s_ "I: "
| `Debug -> s_ "D: "
in
- match lvl with
- | `Error ->
- prerr_endline (beg^str)
- | _ ->
- print_endline (beg^str)
+ prerr_endline (beg^str)
let default =
ref
{
- verbose = true;
- debug = false;
- ignore_plugins = false;
- printf = printf;
+ verbose = true;
+ debug = false;
+ ignore_plugins = false;
+ ignore_unknown_fields = false;
+ printf = printf;
}
let quiet =
@@ -109,7 +107,7 @@ module OASISContext = struct
end
module OASISUtils = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISUtils.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISUtils.ml"
module MapString = Map.Make(String)
@@ -248,7 +246,7 @@ module OASISUtils = struct
end
module PropList = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/PropList.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/PropList.ml"
open OASISGettext
@@ -258,18 +256,23 @@ module PropList = struct
exception No_printer of name
exception Unknown_field of name * name
- let string_of_exception =
- function
- | Not_set (nm, Some rsn) ->
- Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn
- | Not_set (nm, None) ->
- Printf.sprintf (f_ "Field '%s' is not set") nm
- | No_printer nm ->
- Printf.sprintf (f_ "No default printer for value %s") nm
- | Unknown_field (nm, schm) ->
- Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm
- | e ->
- raise e
+ let () =
+ Printexc.register_printer
+ (function
+ | Not_set (nm, Some rsn) ->
+ Some
+ (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn)
+ | Not_set (nm, None) ->
+ Some
+ (Printf.sprintf (f_ "Field '%s' is not set") nm)
+ | No_printer nm ->
+ Some
+ (Printf.sprintf (f_ "No default printer for value %s") nm)
+ | Unknown_field (nm, schm) ->
+ Some
+ (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm)
+ | _ ->
+ None)
module Data =
struct
@@ -283,7 +286,7 @@ module PropList = struct
let clear t =
Hashtbl.clear t
-# 66 "/home/gildor/programmation/oasis/src/oasis/PropList.ml"
+# 71 "/home/trch/software/OCaml/oasis/trunk/src/oasis/PropList.ml"
end
module Schema =
@@ -524,7 +527,7 @@ module PropList = struct
end
module OASISMessage = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISMessage.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISMessage.ml"
open OASISGettext
@@ -556,24 +559,10 @@ module OASISMessage = struct
let error ~ctxt fmt =
generic_message ~ctxt `Error fmt
-
- let string_of_exception e =
- try
- PropList.string_of_exception e
- with
- | Failure s ->
- s
- | e ->
- Printexc.to_string e
-
- (* TODO
- let register_exn_printer f =
- *)
-
end
module OASISVersion = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISVersion.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISVersion.ml"
open OASISGettext
@@ -761,7 +750,7 @@ module OASISVersion = struct
end
module OASISLicense = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISLicense.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISLicense.ml"
(** License for _oasis fields
@author Sylvain Le Gall
@@ -794,7 +783,7 @@ module OASISLicense = struct
end
module OASISExpr = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISExpr.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISExpr.ml"
@@ -884,7 +873,7 @@ module OASISExpr = struct
end
module OASISTypes = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISTypes.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISTypes.ml"
@@ -961,7 +950,7 @@ module OASISTypes = struct
type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list
-# 102 "/home/gildor/programmation/oasis/src/oasis/OASISTypes.ml"
+# 102 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISTypes.ml"
type 'a conditional = 'a OASISExpr.choices
@@ -1118,7 +1107,7 @@ module OASISTypes = struct
end
module OASISUnixPath = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISUnixPath.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISUnixPath.ml"
type unix_filename = string
type unix_dirname = string
@@ -1185,10 +1174,19 @@ module OASISUnixPath = struct
with Not_found ->
f
+ let capitalize_file f =
+ let dir = dirname f in
+ let base = basename f in
+ concat dir (String.capitalize base)
+
+ let uncapitalize_file f =
+ let dir = dirname f in
+ let base = basename f in
+ concat dir (String.uncapitalize base)
end
module OASISSection = struct
-# 1 "/home/gildor/programmation/oasis/src/oasis/OASISSection.ml"
+# 1 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISSection.ml"
open OASISTypes
let section_kind_common =
@@ -1242,12 +1240,12 @@ module OASISSection = struct
end
module OASISBuildSection = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISBuildSection.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISBuildSection.ml"
end
module OASISExecutable = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISExecutable.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISExecutable.ml"
open OASISTypes
@@ -1278,7 +1276,7 @@ module OASISExecutable = struct
end
module OASISLibrary = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISLibrary.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISLibrary.ml"
open OASISTypes
open OASISUtils
@@ -1288,38 +1286,67 @@ module OASISLibrary = struct
let generated_unix_files ~ctxt (cs, bs, lib)
source_file_exists is_native ext_lib ext_dll =
- (* The headers that should be compiled along *)
- let headers =
- List.fold_left
- (fun hdrs modul ->
- try
- let base_fn =
- List.find
- (fun fn ->
- source_file_exists (fn^".ml") ||
- source_file_exists (fn^".mli") ||
- source_file_exists (fn^".mll") ||
- source_file_exists (fn^".mly"))
- (List.map
- (OASISUnixPath.concat bs.bs_path)
- [modul;
- String.uncapitalize modul;
- String.capitalize modul])
- in
- [base_fn^".cmi"] :: hdrs
- with Not_found ->
+
+ (* Look for a module file, considering capitalization or not. *)
+ let find_module modul =
+ let possible_base_fn =
+ List.map
+ (OASISUnixPath.concat bs.bs_path)
+ [modul;
+ OASISUnixPath.uncapitalize_file modul;
+ OASISUnixPath.capitalize_file modul]
+ in
+ try
+ begin
+ [List.find
+ (fun fn ->
+ source_file_exists (fn^".ml") ||
+ source_file_exists (fn^".mli") ||
+ source_file_exists (fn^".mll") ||
+ source_file_exists (fn^".mly"))
+ possible_base_fn]
+ end
+ with Not_found ->
+ begin
OASISMessage.warning
~ctxt
(f_ "Cannot find source file matching \
module '%s' in library %s")
modul cs.cs_name;
- (List.map (OASISUnixPath.concat bs.bs_path)
- [modul^".cmi";
- String.uncapitalize modul ^ ".cmi";
- String.capitalize modul ^ ".cmi"])
- :: hdrs)
- []
+ possible_base_fn
+ end
+ in
+
+ let find_modules lst ext =
+ List.map
+ (fun nm ->
+ List.map
+ (fun base_fn -> base_fn ^"."^ext)
+ (find_module nm))
+ lst
+ in
+
+ (* The headers that should be compiled along *)
+ let headers =
+ find_modules
lib.lib_modules
+ "cmi"
+ in
+
+ (* The .cmx that be compiled along *)
+ let cmxs =
+ let should_be_built =
+ match bs.bs_compiled_object with
+ | Native -> true
+ | Best -> is_native ()
+ | Byte -> false
+ in
+ if should_be_built then
+ find_modules
+ (lib.lib_modules @ lib.lib_internal_modules)
+ "cmx"
+ else
+ []
in
let acc_nopath =
@@ -1363,7 +1390,7 @@ module OASISLibrary = struct
(List.rev_map
(OASISUnixPath.concat bs.bs_path))
acc_nopath)
- headers
+ (headers @ cmxs)
type group_t =
@@ -1569,33 +1596,33 @@ module OASISLibrary = struct
end
module OASISFlag = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISFlag.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISFlag.ml"
end
module OASISPackage = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISPackage.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISPackage.ml"
end
module OASISSourceRepository = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISSourceRepository.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISSourceRepository.ml"
end
module OASISTest = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISTest.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISTest.ml"
end
module OASISDocument = struct
-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISDocument.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/oasis/OASISDocument.ml"
end
module BaseEnvLight = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseEnvLight.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseEnvLight.ml"
module MapString = Map.Make(String)
@@ -1692,7 +1719,7 @@ end
module BaseContext = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseContext.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseContext.ml"
open OASISContext
@@ -1703,7 +1730,7 @@ module BaseContext = struct
end
module BaseMessage = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseMessage.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseMessage.ml"
(** Message to user, overrid for Base
@author Sylvain Le Gall
@@ -1719,12 +1746,10 @@ module BaseMessage = struct
let error fmt = error ~ctxt:!default fmt
- let string_of_exception = string_of_exception
-
end
module BaseFilePath = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseFilePath.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseFilePath.ml"
open Filename
@@ -1756,7 +1781,7 @@ module BaseFilePath = struct
end
module BaseEnv = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseEnv.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseEnv.ml"
open OASISGettext
open OASISUtils
@@ -1896,9 +1921,9 @@ module BaseEnv = struct
let default =
[
- OFileLoad, lazy (MapString.find name !env_from_file);
+ OFileLoad, (fun () -> MapString.find name !env_from_file);
ODefault, dflt;
- OGetEnv, lazy (Sys.getenv name);
+ OGetEnv, (fun () -> Sys.getenv name);
]
in
@@ -1917,11 +1942,11 @@ module BaseEnv = struct
let var_get_low lst =
let errors, res =
List.fold_left
- (fun (errors, res) (_, v) ->
+ (fun (errors, res) (o, v) ->
if res = None then
begin
try
- errors, Some (Lazy.force v)
+ errors, Some (v ())
with
| Not_found ->
errors, res
@@ -1935,12 +1960,7 @@ module BaseEnv = struct
([], None)
(List.sort
(fun (o1, _) (o2, _) ->
- if o1 < o2 then
- 1
- else if o1 = o2 then
- 0
- else
- -1)
+ Pervasives.compare o2 o1)
lst)
in
match res, errors with
@@ -1962,7 +1982,7 @@ module BaseEnv = struct
FieldRO.create
~schema
~name
- ~parse:(fun ?(context=ODefault) s -> [context, lazy s])
+ ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s])
~print:var_get_low
~default
~update:(fun ?context x old_x -> x @ old_x)
@@ -1984,7 +2004,8 @@ module BaseEnv = struct
dflt =
if Schema.mem schema name then
begin
- Schema.set schema env ~context:ODefault name (Lazy.force dflt);
+ (* TODO: look suspsicious, we want to memorize dflt not dflt () *)
+ Schema.set schema env ~context:ODefault name (dflt ());
fun () -> var_get name
end
else
@@ -2010,7 +2031,7 @@ module BaseEnv = struct
~cli:CLIAuto
~arg_help:"Print even non-printable variable. (debug)"
"print_hidden"
- (lazy "false")
+ (fun () -> "false")
let var_all () =
List.rev
@@ -2030,7 +2051,6 @@ module BaseEnv = struct
env_from_file := BaseEnvLight.load ?allow_empty ?filename ()
let unload () =
- (* TODO: reset lazy values *)
env_from_file := MapString.empty;
Data.clear env
@@ -2038,8 +2058,13 @@ module BaseEnv = struct
let chn =
open_out_bin filename
in
- Schema.iter
- (fun nm def _ ->
+ let output nm value =
+ Printf.fprintf chn "%s=%S\n" nm value
+ in
+ let mp_todo =
+ (* Dump data from schema *)
+ Schema.fold
+ (fun mp_todo nm def _ ->
if def.dump then
begin
try
@@ -2049,11 +2074,18 @@ module BaseEnv = struct
env
nm
in
- Printf.fprintf chn "%s = %S\n" nm value
+ output nm value
with Not_set _ ->
()
- end)
- schema;
+ end;
+ MapString.remove nm mp_todo)
+ !env_from_file
+ schema
+ in
+ (* Dump data defined outside of schema *)
+ MapString.iter output mp_todo;
+
+ (* End of the dump *)
close_out chn
let print () =
@@ -2211,7 +2243,7 @@ module BaseEnv = struct
end
module BaseExec = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseExec.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseExec.ml"
open OASISGettext
open OASISUtils
@@ -2271,7 +2303,7 @@ module BaseExec = struct
end
module BaseFileUtil = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseFileUtil.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseFileUtil.ml"
open OASISGettext
@@ -2449,7 +2481,7 @@ module BaseFileUtil = struct
end
module BaseArgExt = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseArgExt.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseArgExt.ml"
open OASISUtils
open OASISGettext
@@ -2477,7 +2509,7 @@ module BaseArgExt = struct
end
module BaseCheck = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseCheck.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseCheck.ml"
open BaseEnv
open BaseMessage
@@ -2487,24 +2519,24 @@ module BaseCheck = struct
let prog_best prg prg_lst =
var_redefine
prg
- (lazy
- (let alternate =
- List.fold_left
- (fun res e ->
- match res with
- | Some _ ->
- res
- | None ->
- try
- Some (BaseFileUtil.which e)
- with Not_found ->
- None)
- None
- prg_lst
- in
- match alternate with
- | Some prg -> prg
- | None -> raise Not_found))
+ (fun () ->
+ let alternate =
+ List.fold_left
+ (fun res e ->
+ match res with
+ | Some _ ->
+ res
+ | None ->
+ try
+ Some (BaseFileUtil.which e)
+ with Not_found ->
+ None)
+ None
+ prg_lst
+ in
+ match alternate with
+ | Some prg -> prg
+ | None -> raise Not_found)
let prog prg =
prog_best prg [prg]
@@ -2527,33 +2559,33 @@ module BaseCheck = struct
var_redefine
~hide:true
var
- (lazy
- (let version_str =
- match fversion () with
- | "[Distributed with OCaml]" ->
- begin
- try
- (var_get "ocaml_version")
- with Not_found ->
- warning
- (f_ "Variable ocaml_version not defined, fallback \
- to default");
- Sys.ocaml_version
- end
- | res ->
- res
- in
- let version =
- OASISVersion.version_of_string version_str
- in
- if OASISVersion.comparator_apply version cmp then
- version_str
- else
- failwithf
- (f_ "Cannot satisfy version constraint on %s: %s (version: %s)")
- var_prefix
- (OASISVersion.string_of_comparator cmp)
- version_str))
+ (fun () ->
+ let version_str =
+ match fversion () with
+ | "[Distributed with OCaml]" ->
+ begin
+ try
+ (var_get "ocaml_version")
+ with Not_found ->
+ warning
+ (f_ "Variable ocaml_version not defined, fallback \
+ to default");
+ Sys.ocaml_version
+ end
+ | res ->
+ res
+ in
+ let version =
+ OASISVersion.version_of_string version_str
+ in
+ if OASISVersion.comparator_apply version cmp then
+ version_str
+ else
+ failwithf
+ (f_ "Cannot satisfy version constraint on %s: %s (version: %s)")
+ var_prefix
+ (OASISVersion.string_of_comparator cmp)
+ version_str)
()
let package_version pkg =
@@ -2584,7 +2616,7 @@ module BaseCheck = struct
let vl =
var_redefine
var
- (lazy (findlib_dir pkg))
+ (fun () -> findlib_dir pkg)
()
in
(
@@ -2603,7 +2635,7 @@ module BaseCheck = struct
end
module BaseOCamlcConfig = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseOCamlcConfig.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseOCamlcConfig.ml"
open BaseEnv
@@ -2660,18 +2692,23 @@ module BaseOCamlcConfig = struct
mp
in
+ let cache =
+ lazy
+ (var_protect
+ (Marshal.to_string
+ (split_field
+ SMap.empty
+ (BaseExec.run_read_output
+ (ocamlc ()) ["-config"]))
+ []))
+ in
var_redefine
"ocamlc_config_map"
~hide:true
~dump:false
- (lazy
- (var_protect
- (Marshal.to_string
- (split_field
- SMap.empty
- (BaseExec.run_read_output
- (ocamlc ()) ["-config"]))
- [])))
+ (fun () ->
+ (* TODO: update if ocamlc change !!! *)
+ Lazy.force cache)
let var_define nm =
(* Extract data from ocamlc -config *)
@@ -2680,32 +2717,40 @@ module BaseOCamlcConfig = struct
(ocamlc_config_map ())
0
in
- let nm_config =
+ let chop_version_suffix s =
+ try
+ String.sub s 0 (String.index s '+')
+ with _ ->
+ s
+ in
+
+ let nm_config, value_config =
match nm with
- | "ocaml_version" -> "version"
- | _ -> nm
+ | "ocaml_version" ->
+ "version", chop_version_suffix
+ | _ -> nm, (fun x -> x)
in
var_redefine
nm
- (lazy
- (try
- let map =
- avlbl_config_get ()
- in
- let value =
- SMap.find nm_config map
- in
- value
- with Not_found ->
- failwithf
- (f_ "Cannot find field '%s' in '%s -config' output")
- nm
- (ocamlc ())))
+ (fun () ->
+ try
+ let map =
+ avlbl_config_get ()
+ in
+ let value =
+ SMap.find nm_config map
+ in
+ value_config value
+ with Not_found ->
+ failwithf
+ (f_ "Cannot find field '%s' in '%s -config' output")
+ nm
+ (ocamlc ()))
end
module BaseStandardVar = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseStandardVar.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseStandardVar.ml"
open OASISGettext
@@ -2734,13 +2779,13 @@ module BaseStandardVar = struct
var_define
~short_desc:(fun () -> s_ "Package name")
"pkg_name"
- (lazy (pkg_get ()).name)
+ (fun () -> (pkg_get ()).name)
let pkg_version =
var_define
~short_desc:(fun () -> s_ "Package version")
"pkg_version"
- (lazy
+ (fun () ->
(OASISVersion.string_of_version (pkg_get ()).version))
let c = BaseOCamlcConfig.var_define
@@ -2789,174 +2834,173 @@ module BaseStandardVar = struct
let prefix =
p "prefix"
(fun () -> s_ "Install architecture-independent files dir")
- (lazy
- (match os_type () with
- | "Win32" ->
- let program_files =
- Sys.getenv "PROGRAMFILES"
- in
- program_files/(pkg_name ())
- | _ ->
- "/usr/local"))
+ (fun () ->
+ match os_type () with
+ | "Win32" ->
+ let program_files =
+ Sys.getenv "PROGRAMFILES"
+ in
+ program_files/(pkg_name ())
+ | _ ->
+ "/usr/local")
let exec_prefix =
p "exec_prefix"
(fun () -> s_ "Install architecture-dependent files in dir")
- (lazy "$prefix")
+ (fun () -> "$prefix")
let bindir =
p "bindir"
(fun () -> s_ "User executables")
- (lazy ("$exec_prefix"/"bin"))
+ (fun () -> "$exec_prefix"/"bin")
let sbindir =
p "sbindir"
(fun () -> s_ "System admin executables")
- (lazy ("$exec_prefix"/"sbin"))
+ (fun () -> "$exec_prefix"/"sbin")
let libexecdir =
p "libexecdir"
(fun () -> s_ "Program executables")
- (lazy ("$exec_prefix"/"libexec"))
+ (fun () -> "$exec_prefix"/"libexec")
let sysconfdir =
p "sysconfdir"
(fun () -> s_ "Read-only single-machine data")
- (lazy ("$prefix"/"etc"))
+ (fun () -> "$prefix"/"etc")
let sharedstatedir =
p "sharedstatedir"
(fun () -> s_ "Modifiable architecture-independent data")
- (lazy ("$prefix"/"com"))
+ (fun () -> "$prefix"/"com")
let localstatedir =
p "localstatedir"
(fun () -> s_ "Modifiable single-machine data")
- (lazy ("$prefix"/"var"))
+ (fun () -> "$prefix"/"var")
let libdir =
p "libdir"
(fun () -> s_ "Object code libraries")
- (lazy ("$exec_prefix"/"lib"))
+ (fun () -> "$exec_prefix"/"lib")
let datarootdir =
p "datarootdir"
(fun () -> s_ "Read-only arch-independent data root")
- (lazy ("$prefix"/"share"))
+ (fun () -> "$prefix"/"share")
let datadir =
p "datadir"
(fun () -> s_ "Read-only architecture-independent data")
- (lazy ("$datarootdir"))
+ (fun () -> "$datarootdir")
let infodir =
p "infodir"
(fun () -> s_ "Info documentation")
- (lazy ("$datarootdir"/"info"))
+ (fun () -> "$datarootdir"/"info")
let localedir =
p "localedir"
(fun () -> s_ "Locale-dependent data")
- (lazy ("$datarootdir"/"locale"))
+ (fun () -> "$datarootdir"/"locale")
let mandir =
p "mandir"
(fun () -> s_ "Man documentation")
- (lazy ("$datarootdir"/"man"))
+ (fun () -> "$datarootdir"/"man")
let docdir =
p "docdir"
(fun () -> s_ "Documentation root")
- (lazy ("$datarootdir"/"doc"/"$pkg_name"))
+ (fun () -> "$datarootdir"/"doc"/"$pkg_name")
let htmldir =
p "htmldir"
(fun () -> s_ "HTML documentation")
- (lazy ("$docdir"))
+ (fun () -> "$docdir")
let dvidir =
p "dvidir"
(fun () -> s_ "DVI documentation")
- (lazy ("$docdir"))
+ (fun () -> "$docdir")
let pdfdir =
p "pdfdir"
(fun () -> s_ "PDF documentation")
- (lazy ("$docdir"))
+ (fun () -> "$docdir")
let psdir =
p "psdir"
(fun () -> s_ "PS documentation")
- (lazy ("$docdir"))
+ (fun () -> "$docdir")
let destdir =
p "destdir"
(fun () -> s_ "Prepend a path when installing package")
- (lazy
- (raise
- (PropList.Not_set
- ("destdir",
- Some (s_ "undefined by construct")))))
+ (fun () ->
+ raise
+ (PropList.Not_set
+ ("destdir",
+ Some (s_ "undefined by construct"))))
let findlib_version =
var_define
"findlib_version"
- (lazy
- (BaseCheck.package_version "findlib"))
+ (fun () ->
+ BaseCheck.package_version "findlib")
let is_native =
var_define
"is_native"
- (lazy
- (try
- let _s : string =
- ocamlopt ()
- in
- "true"
- with PropList.Not_set _ ->
- let _s : string =
- ocamlc ()
- in
- "false"))
+ (fun () ->
+ try
+ let _s : string =
+ ocamlopt ()
+ in
+ "true"
+ with PropList.Not_set _ ->
+ let _s : string =
+ ocamlc ()
+ in
+ "false")
let ext_program =
var_define
"suffix_program"
- (lazy
- (match os_type () with
- | "Win32" -> ".exe"
- | _ -> ""
- ))
+ (fun () ->
+ match os_type () with
+ | "Win32" -> ".exe"
+ | _ -> "")
let rm =
var_define
~short_desc:(fun () -> s_ "Remove a file.")
"rm"
- (lazy
- (match os_type () with
- | "Win32" -> "del"
- | _ -> "rm -f"))
+ (fun () ->
+ match os_type () with
+ | "Win32" -> "del"
+ | _ -> "rm -f")
let rmdir =
var_define
~short_desc:(fun () -> s_ "Remove a directory.")
"rmdir"
- (lazy
- (match os_type () with
- | "Win32" -> "rd"
- | _ -> "rm -rf"))
+ (fun () ->
+ match os_type () with
+ | "Win32" -> "rd"
+ | _ -> "rm -rf")
let debug =
var_define
~short_desc:(fun () -> s_ "Compile with ocaml debug flag on.")
"debug"
- (lazy "true")
+ (fun () -> "true")
let profile =
var_define
~short_desc:(fun () -> s_ "Compile with ocaml profile flag on.")
"profile"
- (lazy "false")
+ (fun () -> "false")
let init pkg =
rpkg := Some pkg
@@ -2964,7 +3008,7 @@ module BaseStandardVar = struct
end
module BaseFileAB = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseFileAB.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseFileAB.ml"
open BaseEnv
open OASISGettext
@@ -3012,7 +3056,7 @@ module BaseFileAB = struct
end
module BaseLog = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseLog.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseLog.ml"
open OASISUtils
@@ -3131,7 +3175,7 @@ module BaseLog = struct
end
module BaseBuilt = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseBuilt.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseBuilt.ml"
open OASISTypes
open OASISGettext
@@ -3278,7 +3322,7 @@ module BaseBuilt = struct
end
module BaseCustom = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseCustom.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseCustom.ml"
open BaseEnv
open BaseMessage
@@ -3328,7 +3372,7 @@ module BaseCustom = struct
end
module BaseDynVar = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseDynVar.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseDynVar.ml"
open OASISTypes
@@ -3349,22 +3393,22 @@ module BaseDynVar = struct
(f_ "Filename of executable '%s'")
cs.cs_name)
cs.cs_name
- (lazy
- (let fn_opt =
- fold
- BExec cs.cs_name
- (fun _ fn -> Some fn)
- None
- in
- match fn_opt with
- | Some fn -> fn
- | None ->
- raise
- (PropList.Not_set
- (cs.cs_name,
- Some (Printf.sprintf
- (f_ "Executable '%s' not yet built.")
- cs.cs_name))))))
+ (fun () ->
+ let fn_opt =
+ fold
+ BExec cs.cs_name
+ (fun _ fn -> Some fn)
+ None
+ in
+ match fn_opt with
+ | Some fn -> fn
+ | None ->
+ raise
+ (PropList.Not_set
+ (cs.cs_name,
+ Some (Printf.sprintf
+ (f_ "Executable '%s' not yet built.")
+ cs.cs_name)))))
| Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ ->
())
@@ -3372,7 +3416,7 @@ module BaseDynVar = struct
end
module BaseTest = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseTest.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseTest.ml"
open BaseEnv
open BaseMessage
@@ -3454,7 +3498,7 @@ module BaseTest = struct
end
module BaseDoc = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseDoc.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseDoc.ml"
open BaseEnv
open BaseMessage
@@ -3484,7 +3528,7 @@ module BaseDoc = struct
end
module BaseSetup = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseSetup.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseSetup.ml"
open BaseEnv
open BaseMessage
@@ -3545,13 +3589,30 @@ module BaseSetup = struct
(* Run configure *)
BaseCustom.hook
t.package.conf_custom
- (t.configure t.package)
- args;
+ (fun () ->
+ (* Reload if preconf has changed it *)
+ begin
+ try
+ unload ();
+ load ();
+ with _ ->
+ ()
+ end;
+
+ (* Run plugin's configure *)
+ t.configure t.package args;
+
+ (* Dump to allow postconf to change it *)
+ dump ())
+ ();
(* Reload environment *)
unload ();
load ();
+ (* Save environment *)
+ print ();
+
(* Replace data in file *)
BaseFileAB.replace t.package.files_ab
@@ -3871,13 +3932,14 @@ module BaseSetup = struct
~cli:CLIEnable
?short_desc
(OASISUtils.varname_of_string cs.cs_name)
- (lazy (string_of_bool
- (var_choose
- ~name:(Printf.sprintf
- (f_ "default value of flag %s")
- cs.cs_name)
- ~printer:string_of_bool
- choices))))
+ (fun () ->
+ string_of_bool
+ (var_choose
+ ~name:(Printf.sprintf
+ (f_ "default value of flag %s")
+ cs.cs_name)
+ ~printer:string_of_bool
+ choices)))
in
match hlp with
| Some hlp ->
@@ -3896,13 +3958,13 @@ module BaseSetup = struct
!act_ref t (Array.of_list (List.rev !extra_args_ref))
with e when !catch_exn ->
- error "%s" (string_of_exception e);
+ error "%s" (Printexc.to_string e);
exit 1
end
module BaseDev = struct
-# 21 "/home/gildor/programmation/oasis/src/base/BaseDev.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/base/BaseDev.ml"
@@ -3960,7 +4022,7 @@ end
module InternalConfigurePlugin = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/internal/InternalConfigurePlugin.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/internal/InternalConfigurePlugin.ml"
(** Configure using internal scheme
@author Sylvain Le Gall
@@ -4001,7 +4063,7 @@ module InternalConfigurePlugin = struct
in
let warn_exception e =
- warning "%s" (string_of_exception e)
+ warning "%s" (Printexc.to_string e)
in
(* Check tools *)
@@ -4154,13 +4216,8 @@ module InternalConfigurePlugin = struct
())
pkg.sections;
- (* Save and print environment *)
- if SetString.empty = !errors then
- begin
- dump ();
- print ()
- end
- else
+ (* Check errors *)
+ if SetString.empty != !errors then
begin
List.iter
(fun e -> error "%s" e)
@@ -4176,7 +4233,7 @@ module InternalConfigurePlugin = struct
end
module InternalInstallPlugin = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/internal/InternalInstallPlugin.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/internal/InternalInstallPlugin.ml"
(** Install using internal scheme
@author Sylvain Le Gall
@@ -4306,10 +4363,10 @@ module InternalInstallPlugin = struct
(Filename.concat path)
[modul^".mli";
modul^".ml";
- String.uncapitalize modul^".mli";
- String.capitalize modul^".mli";
- String.uncapitalize modul^".ml";
- String.capitalize modul^".ml"])
+ OASISUnixPath.uncapitalize_file modul^".mli";
+ OASISUnixPath.capitalize_file modul^".mli";
+ OASISUnixPath.uncapitalize_file modul^".ml";
+ OASISUnixPath.capitalize_file modul^".ml"])
:: acc
with Not_found ->
begin
@@ -4407,6 +4464,34 @@ module InternalInstallPlugin = struct
findlib_name;
res
in
+ let files =
+ (* Make filename shorter to avoid hitting command max line length
+ * too early, esp. on Windows.
+ *)
+ let remove_prefix p n =
+ let plen = String.length p in
+ let nlen = String.length n in
+ if plen <= nlen && String.sub n 0 plen = p then
+ begin
+ let fn_sep =
+ if Sys.os_type = "Win32" then
+ '\\'
+ else
+ '/'
+ in
+ let cutpoint = plen +
+ (if plen < nlen && n.[plen] = fn_sep then
+ 1
+ else
+ 0)
+ in
+ String.sub n cutpoint (nlen - cutpoint)
+ end
+ else
+ n
+ in
+ List.map (remove_prefix (Sys.getcwd ())) files
+ in
info
(f_ "Installing findlib library '%s'")
findlib_name;
@@ -4580,7 +4665,7 @@ end
module OCamlbuildCommon = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/OCamlbuildCommon.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/OCamlbuildCommon.ml"
(** Functions common to OCamlbuild build and doc plugin
*)
@@ -4596,7 +4681,7 @@ module OCamlbuildCommon = struct
var_define
~short_desc:(fun () -> "OCamlbuild additional flags")
"ocamlbuildflags"
- (lazy "")
+ (fun () -> "")
(** Fix special arguments depending on environment *)
let fix_args args extra_argv =
@@ -4680,7 +4765,7 @@ module OCamlbuildCommon = struct
end
module OCamlbuildPlugin = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/OCamlbuildPlugin.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/OCamlbuildPlugin.ml"
(** Build using ocamlbuild
@author Sylvain Le Gall
@@ -4852,7 +4937,7 @@ module OCamlbuildPlugin = struct
end
module OCamlbuildDocPlugin = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml"
(* Create documentation using ocamlbuild .odocl files
@author Sylvain Le Gall
@@ -4901,7 +4986,7 @@ end
module CustomPlugin = struct
-# 21 "/home/gildor/programmation/oasis/src/plugins/custom/CustomPlugin.ml"
+# 21 "/home/trch/software/OCaml/oasis/trunk/src/plugins/custom/CustomPlugin.ml"
(** Generate custom configure/build/doc/test/install system
@author
@@ -5537,7 +5622,7 @@ let setup_t =
bs_nativeopt = [(OASISExpr.EBool true, [])];
},
{
- lib_modules = ["SubCommand"; "ArgExt"];
+ lib_modules = ["SubCommand"; "ArgExt"; "Pager"];
lib_internal_modules = ["CLIData"];
lib_findlib_parent = Some "oasis";
lib_findlib_name = None;
@@ -5749,5 +5834,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
+# 5819 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
View
3  src/api-oasis.odocl
@@ -20,7 +20,7 @@
################################################################################
# OASIS_START
-# DO NOT EDIT (digest: 304ccf550e57cee563dcb02d4aa29efd)
+# DO NOT EDIT (digest: c4fa65e571a4e2300f14fcab3668f031)
oasis/FormatExt
oasis/FormatMarkdown
oasis/ODNFunc
@@ -73,4 +73,5 @@ base/BaseMessage
base/BaseContext
cli/SubCommand
cli/ArgExt
+cli/Pager
# OASIS_STOP
View
3  src/cli/cli.mllib
@@ -20,8 +20,9 @@
################################################################################
# OASIS_START
-# DO NOT EDIT (digest: c97b5334077d02b442cc0ea78d2aca2a)
+# DO NOT EDIT (digest: 50d3a189d7e6256264a84b5ba2a3d58c)
SubCommand
ArgExt
+Pager
CLIData
# OASIS_STOP
Please sign in to comment.
Something went wrong with that request. Please try again.