ysulsky avatar ysulsky committed 2c2e249

minor fixes and stricter compile options throughout the tree

Comments (0)

Files changed (18)

base/async/core/oasis.sh

 <lib/*.ml{,i}>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/async/extra/oasis.sh

 <lib/*.ml{,i}>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/async/oasis.sh

 # <lib_test/*.ml{,i}>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/async/unix/lib/reader.ml

 
 let gen_read_sexp ?parse_pos t parse =
   Deferred.create (fun result ->
-    let rec loop ~cont_state parse_fun =
+    let rec loop parse_fun =
       nonempty_buffer t (function
         | `Eof ->
           begin
           | Sexp.Done (sexp, parse_pos) ->
               consume t (parse_pos.Sexp.Parse_pos.buf_pos - t.pos);
               Ivar.fill result (`Ok (sexp, parse_pos));
-          | Sexp.Cont (cont_state, parse_fun) ->
+          | Sexp.Cont (_, parse_fun) ->
               t.available <- 0;
-              loop ~cont_state parse_fun)
+              loop parse_fun)
     in
     let parse ~pos ~len buf =
       (* [parse_pos] will be threaded through the entire reading process by
       in
       parse ?parse_pos:(Some parse_pos) ?len:(Some len) buf
     in
-    loop ~cont_state:Sexp.Cont_state.Parsing_whitespace parse)
+    loop parse)
 ;;
 
 type 'a read = ?parse_pos : Sexp.Parse_pos.t -> 'a

base/async/unix/oasis.sh

 <lib/*.ml{,i}>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/bin_prot/oasis.sh

 <syntax/pa_bin_prot.ml>: syntax_camlp4o
 EOF
 
-make_myocamlbuild $HERE/myocamlbuild.ml <<EOF
+make_myocamlbuild "$HERE/myocamlbuild.ml" <<EOF
 (* We probably will want to set this up in the \`configure\` script at some
    point. *)
 let is_darwin =
   begin
     function
       | After_rules as e ->
+          setup_standard_build_flags ();
+
           dep ["ocaml"; "ocamldep"; "mlh"] ["lib/int_codes.mlh"];
 
           flag ["ocamldep"; "ocaml"; "use_pa_bin_prot"]
 
           flag ["compile"; "ocaml"] (S [A "-w"; A "@Ae" ]);
 
-          let cflags =
-            let flags =
-              [
-                "-pipe";
-                "-g";
-                "-fPIC";
-                "-O2";
-                "-fomit-frame-pointer";
-                "-fsigned-char";
-                "-Wall";
-                "-pedantic";
-                "-Wextra";
-                "-Wunused";
-(*                "-Werror"; *)
-                "-Wno-long-long";
-              ]
-            in
-            let flags = if is_darwin then "-DOS_DARWIN" :: flags else flags in
-            let f flag = [A "-ccopt"; A flag] in
-            List.concat (List.map f flags)
-          in
-          flag ["compile"; "c"] (S cflags);
+          if is_darwin then
+            flag ["compile"; "c"] (S [A "-ccopt"; A "-DOS_DARWIN"]);
 
           dispatch_default e
       | e -> dispatch_default e

base/compare/oasis.sh

 <syntax/pa_compare.ml>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 mkdir -p $HERE/lib
 echo >$HERE/lib/comparelib_dummy.ml
 

base/core/extended/oasis.sh

 EOF
 
 make_myocamlbuild "$HERE/myocamlbuild.ml" <<EOF
-$useful_ocaml_functions
-
 let dispatch = function
   | After_rules as e ->
+    setup_standard_build_flags ();
 
     dep  ["ocaml"; "ocamldep"; "mlh"] (select_files "lib/" ".mlh");
 
     flag ["mlh"; "ocaml"; "ocamldep"] (S[A"-ppopt"; A"-Ilib/"]);
     flag ["mlh"; "ocaml"; "compile"]  (S[A"-ppopt"; A"-Ilib/"]);
 
-    begin match getconf "LFS64_CFLAGS" with
-    | None -> ()
-    | Some flags -> flag ["compile"; "c"] (S[A"-ccopt"; A flags])
-    end;
-
-    let cflags =
-      let flags =
-        [
-          "-pipe";
-          "-g";
-          "-fPIC";
-          "-O2";
-          "-fomit-frame-pointer";
-          "-fsigned-char";
-          "-Wall";
-          "-pedantic";
-          "-Wextra";
-          "-Wunused";
-(*          "-Werror"; *)
-          "-Wno-long-long";
-        ]
-      in
-      let f flag = [A "-ccopt"; A flag] in
-      List.concat (List.map f flags)
-    in
-    flag ["compile"; "c"] (S cflags);
-    flag ["compile"; "ocaml"] (S [A "-w"; A "@Ae" ]);
-
     dispatch_default e
   | e -> dispatch_default e
 
 EOF
 
 make_setup_ml "$HERE/setup.ml" <<EOF
-$useful_ocaml_functions
-
 let linux_possible = test "uname | grep -q -i linux"
 let timers_possible =
   match getconf "_POSIX_TIMERS" with

base/core/lib_test/backtrace_manual_test.ml

 open Core.Std
 
+let backtrace_get = Or_error.ok_exn Backtrace.get
+
 let f n =
   if n = 2 then (
-    Printf.eprintf "%s%!" (Backtrace.to_string (Backtrace.get ()))
+    Printf.eprintf "%s%!" (Backtrace.to_string (backtrace_get ()))
   )
   else Printf.printf "foo\n%!"
 

base/core/oasis.sh

 EOF
 
 make_myocamlbuild "$HERE/myocamlbuild.ml" <<EOF
-$useful_ocaml_functions
-
 let dispatch = function
   | After_rules as e ->
+    setup_standard_build_flags ();
 
     dep  ["ocaml"; "ocamldep"; "mlh"] (select_files "lib/" ".mlh");
 
     flag ["mlh"; "ocaml"; "ocamldep"] (S[A"-ppopt"; A"-Ilib/"]);
     flag ["mlh"; "ocaml"; "compile"]  (S[A"-ppopt"; A"-Ilib/"]);
 
-    begin match getconf "LFS64_CFLAGS" with
-    | None -> ()
-    | Some flags -> flag ["compile"; "c"] (S[A"-ccopt"; A flags])
-    end;
-
     if test "ld -lrt -shared -o /dev/null 2>/dev/null" then begin
       flag ["ocamlmklib"; "c"]                      (S[A"-lrt"]);
       flag ["use_libcore_stubs"; "link"] (S[A"-cclib"; A"-lrt"]);
     end;
 
-    let cflags =
-      let flags =
-        [
-          "-pipe";
-          "-g";
-          "-fPIC";
-          "-O2";
-          "-fomit-frame-pointer";
-          "-fsigned-char";
-          "-Wall";
-          "-pedantic";
-          "-Wextra";
-          "-Wunused";
-(*          "-Werror"; *)
-          "-Wno-long-long";
-        ]
-      in
-      let f flag = [A "-ccopt"; A flag] in
-      List.concat (List.map f flags)
-    in
-    flag ["compile"; "c"] (S cflags);
-    flag ["compile"; "ocaml"] (S [A "-w"; A "@Ae" ]);
-
     dispatch_default e
   | e -> dispatch_default e
 
 EOF
 
 make_setup_ml "$HERE/setup.ml" <<EOF
-$useful_ocaml_functions
-
 let linux_possible = test "uname | grep -q -i linux"
 let timers_possible =
   match getconf "_POSIX_TIMERS" with

base/fieldslib/oasis.sh

 <syntax/pa_fields_conv.ml>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/pa_ounit/oasis.sh

 <syntax/pa_ounit.ml>: syntax_camlp4o,pkg_camlp4.extend
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 oasis setup

base/pipebang/oasis.sh

 <lib/pa_pipebang.ml>: syntax_camlp4o,pkg_camlp4.extend
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 oasis setup

base/sexplib/oasis.sh

   begin
     function
       | After_rules as e ->
+          setup_standard_build_flags ();
           flag ["ocamldep"; "ocaml"; "use_pa_sexp_conv"]
             (S [A "-ppopt"; P "syntax/pa_sexp_conv.cma"]);
           flag ["compile"; "ocaml"; "use_pa_sexp_conv"]
             (S [A "-ppopt"; P "syntax/pa_sexp_conv.cma"]);
-          flag ["compile"; "ocaml"] (S [A "-w"; A "@Ae" ]);
           dispatch_default e
       | e -> dispatch_default e
   end

base/type_conv/oasis.sh

 <lib/pa_type_conv.ml>: syntax_camlp4o
 EOF
 
-make_myocamlbuild $HERE/myocamlbuild.ml <<EOF
-Ocamlbuild_plugin.dispatch
-  begin
-    function
-      | After_rules as e ->
-          flag ["compile"; "ocaml"] (S [A "-w"; A "@Ae" ]);
-          dispatch_default e
-      | e -> dispatch_default e
-  end
-;;
-EOF
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
 
 cd $HERE
 oasis setup

base/typehash/oasis.sh

 <syntax/pa_typehash.ml>: syntax_camlp4o,pkg_camlp4.extend
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 oasis setup

base/variantslib/oasis.sh

 <syntax/*.ml{,i}>: syntax_camlp4o
 EOF
 
+make_myocamlbuild_default "$HERE/myocamlbuild.ml"
+
 cd $HERE
 rm -f setup.ml
 oasis setup
     cat >>"$1"
 }
 
-function make_myocamlbuild {
-    cat >"$1" <<EOF
-(* OASIS_START *)
-(* OASIS_STOP *)
-EOF
-    cat >>"$1"
-}
-
-function make_setup_ml {
-    cat >"$1" <<EOF
-(* OASIS_START *)
-(* OASIS_STOP *)
-let _ = setup
-
-EOF
-    cat >> "$1"
-    cat >> "$1" <<EOF
-
-let () = BaseSetup.setup setup_t
-EOF
-}
-
 useful_ocaml_functions='
 let protectx x ~f ~finally =
   let r = try f x with exn -> finally x; raise exn in
   List.map (Filename.concat dir)
     (List.filter (endswith ext)
       (Array.to_list (Sys.readdir dir)))
+;;
 '
 
+function make_setup_ml {
+    cat >"$1" <<EOF
+(* OASIS_START *)
+(* OASIS_STOP *)
+let _ = setup
+
+$useful_ocaml_functions
+
+EOF
+    cat >> "$1"
+    cat >> "$1" <<EOF
+
+let () = BaseSetup.setup setup_t
+EOF
+}
+
+function make_myocamlbuild {
+    cat >"$1" <<EOF
+(* OASIS_START *)
+(* OASIS_STOP *)
+
+$useful_ocaml_functions
+
+let setup_standard_build_flags () =
+    begin match getconf "LFS64_CFLAGS" with
+    | None -> ()
+    | Some flags -> flag ["compile"; "c"] (S[A"-ccopt"; A flags])
+    end;
+    let cflags =
+      let flags =
+        [
+          "-pipe";
+          "-g";
+          "-fPIC";
+          "-O2";
+          "-fomit-frame-pointer";
+          "-fsigned-char";
+          "-Wall";
+          "-pedantic";
+          "-Wextra";
+          "-Wunused";
+(*          "-Werror"; *)
+          "-Wno-long-long";
+        ]
+      in
+      let f flag = [A "-ccopt"; A flag] in
+      List.concat (List.map f flags)
+    in
+    flag ["compile"; "c"] (S cflags);
+    flag ["compile"; "ocaml"] (S [A "-w"; A "@Aemr-28"; A "-strict-sequence" ])
+;;
+
+EOF
+    cat >>"$1"
+}
+
+function make_myocamlbuild_default {
+    make_myocamlbuild "$1" <<EOF
+let dispatch = function
+  | After_rules as e ->
+    setup_standard_build_flags ();
+    dispatch_default e
+  | e -> dispatch_default e
+
+let () = Ocamlbuild_plugin.dispatch dispatch
+EOF
+}
+
 HERE=$(cd "$(dirname -- "$0")"; pwd);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.