Browse Source

Correct little mistake in _oasis file

Leo 10 years ago
parent
commit
9db5db5620
5 changed files with 282 additions and 236 deletions
  1. 3 3
      README.md
  2. 1 4
      _oasis
  3. 2 2
      configure
  4. 66 52
      myocamlbuild.ml
  5. 210 175
      setup.ml

+ 3 - 3
README.md

@@ -1,13 +1,13 @@
 <!--- OASIS_START --->
 <!--- OASIS_START --->
-<!--- DO NOT EDIT (digest: 0ca605b95a7a33ed1adef17372475264) --->
+<!--- DO NOT EDIT (digest: f75668d8c51e2897d85573696c9f54a7) --->
 
 
 OcLaunch - Launch commands automatically
 OcLaunch - Launch commands automatically
 ========================================
 ========================================
 
 
 OcLaunch is a command-line tool to launch successively (each time the program
 OcLaunch is a command-line tool to launch successively (each time the program
 is called) commands. It is designed to be used with any program, interactive
 is called) commands. It is designed to be used with any program, interactive
-or not. Feedback is welcomed at leowzukw@vmail.me. Help at
+or not. Feedback is welcome at leowzukw@vmail.me. Help at
-https://gitlab.com/WzukW/oclaunch/wikis/home.
+https://gitlab.com/WzukW/oclaunch/wikis/home. Try it, it works automatically!
 
 
 See the file [INSTALL.md](INSTALL.md) for building and installation
 See the file [INSTALL.md](INSTALL.md) for building and installation
 instructions.
 instructions.

+ 1 - 4
_oasis

@@ -14,10 +14,7 @@ XStdFilesREADME: true
 XStdFilesINSTALL: true
 XStdFilesINSTALL: true
 XStdFilesAUTHORS: true
 XStdFilesAUTHORS: true
 AlphaFeatures: stdfiles_markdown, compiled_setup_ml
 AlphaFeatures: stdfiles_markdown, compiled_setup_ml
-Description: OcLaunch is a command-line tool to launch successively (each time
+Description: OcLaunch is a command-line tool to launch successively (each time the program is called) commands. It is designed to be used with any program, interactive or not. Feedback is welcome at leowzukw@vmail.me. Help at https://gitlab.com/WzukW/oclaunch/wikis/home. Try it, it works automatically!
-the program is called) commands. It is designed to be used with any program,
-interactive or not. Feedback is welcome at leowzukw@vmail.me. Help at
-https://gitlab.com/WzukW/oclaunch/wikis/home. Try it, it works automatically!
 
 
 PreBuildCommand: atdgen -t ./src/settings.atd
 PreBuildCommand: atdgen -t ./src/settings.atd
 PreBuildCommand: atdgen -j ./src/settings.atd
 PreBuildCommand: atdgen -j ./src/settings.atd

+ 2 - 2
configure

@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/bin/sh
 
 
 # OASIS_START
 # OASIS_START
-# DO NOT EDIT (digest: 82230d61386befb40bc7377608e1f16e)
+# DO NOT EDIT (digest: 6f7b8221311e800a7093dc3b793f67ca)
 set -e
 set -e
 
 
 FST=true
 FST=true
@@ -23,5 +23,5 @@ for i in "$@"; do
   esac
   esac
 done
 done
 
 
-make configure CONFIGUREFLAGS="$@"
+make configure CONFIGUREFLAGS="$*"
 # OASIS_STOP
 # OASIS_STOP

+ 66 - 52
myocamlbuild.ml

@@ -1,7 +1,7 @@
 (* OASIS_START *)
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 4f240f06ff7a70bb4e3be1240a180aab) *)
+(* DO NOT EDIT (digest: 2b686a81cec9fb16d1640bda36a68fbd) *)
 module OASISGettext = struct
 module OASISGettext = struct
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/oasis/OASISGettext.ml" *)
+(* # 22 "src/oasis/OASISGettext.ml" *)
 
 
 
 
   let ns_ str =
   let ns_ str =
@@ -30,7 +30,7 @@ module OASISGettext = struct
 end
 end
 
 
 module OASISExpr = struct
 module OASISExpr = struct
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/oasis/OASISExpr.ml" *)
+(* # 22 "src/oasis/OASISExpr.ml" *)
 
 
 
 
 
 
@@ -39,10 +39,10 @@ module OASISExpr = struct
   open OASISGettext
   open OASISGettext
 
 
 
 
-  type test = string 
+  type test = string
 
 
 
 
-  type flag = string 
+  type flag = string
 
 
 
 
   type t =
   type t =
@@ -52,10 +52,10 @@ module OASISExpr = struct
     | EOr of t * t
     | EOr of t * t
     | EFlag of flag
     | EFlag of flag
     | ETest of test * string
     | ETest of test * string
-    
 
 
 
 
-  type 'a choices = (t * 'a) list 
+
+  type 'a choices = (t * 'a) list
 
 
 
 
   let eval var_get t =
   let eval var_get t =
@@ -131,7 +131,7 @@ end
 
 
 # 132 "myocamlbuild.ml"
 # 132 "myocamlbuild.ml"
 module BaseEnvLight = struct
 module BaseEnvLight = struct
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/base/BaseEnvLight.ml" *)
+(* # 22 "src/base/BaseEnvLight.ml" *)
 
 
 
 
   module MapString = Map.Make(String)
   module MapString = Map.Make(String)
@@ -236,7 +236,7 @@ end
 
 
 # 237 "myocamlbuild.ml"
 # 237 "myocamlbuild.ml"
 module MyOCamlbuildFindlib = struct
 module MyOCamlbuildFindlib = struct
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
+(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
 
 
 
 
   (** OCamlbuild extension, copied from
   (** OCamlbuild extension, copied from
@@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
     *)
     *)
   open Ocamlbuild_plugin
   open Ocamlbuild_plugin
 
 
+  type conf =
+    { no_automatic_syntax: bool;
+    }
 
 
   (* these functions are not really officially exported *)
   (* these functions are not really officially exported *)
   let run_and_read =
   let run_and_read =
@@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
 
 
   (* This lists all supported packages. *)
   (* This lists all supported packages. *)
   let find_packages () =
   let find_packages () =
-    List.map before_space (split_nl & run_and_read "ocamlfind list")
+    List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))
 
 
 
 
   (* Mock to list available syntaxes. *)
   (* Mock to list available syntaxes. *)
@@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
   ]
   ]
 
 
 
 
-  let dispatch =
+  let dispatch conf =
     function
     function
       | After_options ->
       | After_options ->
           (* By using Before_options one let command line options have an higher
           (* By using Before_options one let command line options have an higher
@@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
            * -linkpkg *)
            * -linkpkg *)
           flag ["ocaml"; "link"; "program"] & A"-linkpkg";
           flag ["ocaml"; "link"; "program"] & A"-linkpkg";
 
 
-          (* For each ocamlfind package one inject the -package option when
+          if not (conf.no_automatic_syntax) then begin
-           * compiling, computing dependencies, generating documentation and
+            (* For each ocamlfind package one inject the -package option when
-           * linking. *)
+             * compiling, computing dependencies, generating documentation and
-          List.iter
+             * linking. *)
-            begin fun pkg ->
+            List.iter
-              let base_args = [A"-package"; A pkg] in
+              begin fun pkg ->
-              (* TODO: consider how to really choose camlp4o or camlp4r. *)
+                let base_args = [A"-package"; A pkg] in
-              let syn_args = [A"-syntax"; A "camlp4o"] in
+                (* TODO: consider how to really choose camlp4o or camlp4r. *)
-              let args =
+                let syn_args = [A"-syntax"; A "camlp4o"] in
-              (* Heuristic to identify syntax extensions: whether they end in
+                let (args, pargs) =
-                 ".syntax"; some might not.
+                  (* Heuristic to identify syntax extensions: whether they end in
-               *)
+                     ".syntax"; some might not.
-                if Filename.check_suffix pkg "syntax" ||
+                  *)
-                   List.mem pkg well_known_syntax then
+                  if Filename.check_suffix pkg "syntax" ||
-                  syn_args @ base_args
+                     List.mem pkg well_known_syntax then
-                else
+                    (syn_args @ base_args, syn_args)
-                  base_args
+                  else
-              in
+                    (base_args, [])
-              flag ["ocaml"; "compile";  "pkg_"^pkg] & S args;
+                in
-              flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
+                flag ["ocaml"; "compile";  "pkg_"^pkg] & S args;
-              flag ["ocaml"; "doc";      "pkg_"^pkg] & S args;
+                flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
-              flag ["ocaml"; "link";     "pkg_"^pkg] & S base_args;
+                flag ["ocaml"; "doc";      "pkg_"^pkg] & S args;
-              flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
+                flag ["ocaml"; "link";     "pkg_"^pkg] & S base_args;
-            end
+                flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
-            (find_packages ());
+
+                (* TODO: Check if this is allowed for OCaml < 3.12.1 *)
+                flag ["ocaml"; "compile";  "package("^pkg^")"] & S pargs;
+                flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
+                flag ["ocaml"; "doc";      "package("^pkg^")"] & S pargs;
+                flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
+              end
+              (find_packages ());
+          end;
 
 
           (* Like -package but for extensions syntax. Morover -syntax is useless
           (* Like -package but for extensions syntax. Morover -syntax is useless
            * when linking. *)
            * when linking. *)
@@ -415,7 +426,7 @@ module MyOCamlbuildFindlib = struct
 end
 end
 
 
 module MyOCamlbuildBase = struct
 module MyOCamlbuildBase = struct
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
+(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
 
 
 
 
   (** Base functions for writing myocamlbuild.ml
   (** Base functions for writing myocamlbuild.ml
@@ -430,13 +441,13 @@ module MyOCamlbuildBase = struct
   module OC = Ocamlbuild_pack.Ocaml_compiler
   module OC = Ocamlbuild_pack.Ocaml_compiler
 
 
 
 
-  type dir = string 
+  type dir = string
-  type file = string 
+  type file = string
-  type name = string 
+  type name = string
-  type tag = string 
+  type tag = string
 
 
 
 
-(* # 62 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
+(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
 
 
 
 
   type t =
   type t =
@@ -448,7 +459,7 @@ module MyOCamlbuildBase = struct
          * directory.
          * directory.
          *)
          *)
         includes:  (dir * dir list) list;
         includes:  (dir * dir list) list;
-      } 
+      }
 
 
 
 
   let env_filename =
   let env_filename =
@@ -546,12 +557,13 @@ module MyOCamlbuildBase = struct
 
 
                    (* When ocaml link something that use the C library, then one
                    (* When ocaml link something that use the C library, then one
                       need that file to be up to date.
                       need that file to be up to date.
+                      This holds both for programs and for libraries.
                     *)
                     *)
-                   dep ["link"; "ocaml"; "program"; tag_libstubs lib]
+  		 dep ["link"; "ocaml"; tag_libstubs lib]
-                     [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
+  		     [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
 
 
-                   dep  ["compile"; "ocaml"; "program"; tag_libstubs lib]
+  		 dep  ["compile"; "ocaml"; tag_libstubs lib]
-                     [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
+  		      [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
 
 
                    (* TODO: be more specific about what depends on headers *)
                    (* TODO: be more specific about what depends on headers *)
                    (* Depends on .h files *)
                    (* Depends on .h files *)
@@ -580,25 +592,27 @@ module MyOCamlbuildBase = struct
             ()
             ()
 
 
 
 
-  let dispatch_default t =
+  let dispatch_default conf t =
     dispatch_combine
     dispatch_combine
       [
       [
         dispatch t;
         dispatch t;
-        MyOCamlbuildFindlib.dispatch;
+        MyOCamlbuildFindlib.dispatch conf;
       ]
       ]
 
 
 
 
 end
 end
 
 
 
 
-# 594 "myocamlbuild.ml"
+# 606 "myocamlbuild.ml"
 open Ocamlbuild_plugin;;
 open Ocamlbuild_plugin;;
 let package_default =
 let package_default =
   {MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []}
   {MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []}
   ;;
   ;;
 
 
-let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
+let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
+
+let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
 
 
-# 603 "myocamlbuild.ml"
+# 617 "myocamlbuild.ml"
 (* OASIS_STOP *)
 (* OASIS_STOP *)
 Ocamlbuild_plugin.dispatch dispatch_default;;
 Ocamlbuild_plugin.dispatch dispatch_default;;

File diff suppressed because it is too large
+ 210 - 175
setup.ml