Markus Mottl avatar Markus Mottl committed 56aabac

Improved C-flags

Comments (0)

Files changed (4)

base/bin_prot/oasis.sh

 # remove this part when oasis supports Pack: true
 $(tag_for_pack Bin_prot $HERE/lib/*.ml)
 
-<lib/{size,write_ml,read_ml,unsafe_read_c,type_class}.ml{i,}>: pp(cpp -undef -traditional -Werror -I.)
+<lib/{size,write_ml,read_ml,unsafe_read_c,type_class}.ml{i,}>: pp(cpp -undef -traditional -I.)
 <lib/{write,read}_ml.ml{,i}>:mlh
 <lib_test/*.ml{,i}>: syntax_camlp4o,pkg_type_conv.syntax
 <syntax/pa_bin_prot.ml>: syntax_camlp4o
                 "-pedantic";
                 "-Wextra";
                 "-Wunused";
-                "-Werror";
+(*                "-Werror"; *)
                 "-Wno-long-long";
               ]
             in

base/core/extended/oasis.sh

 "lib/core_command.ml": pkg_camlp4.macro
 EOF
 
+make_myocamlbuild $HERE/myocamlbuild.ml <<EOF
+Ocamlbuild_plugin.dispatch
+  begin
+    function
+      | After_rules as e ->
+          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);
+          dispatch_default e
+      | e -> dispatch_default e
+  end
+;;
+EOF
+
 if [[ ! -e $HERE/lib/version_defaults.mlh ]]; then
     cat >$HERE/lib/version_defaults.mlh <<EOF
 DEFINE DEFAULT_VERSION = "No version info."

base/core/oasis.sh

 <lib/{core_int63,bigstring,core_mutex,core_unix,bigstring_marshal,linux_ext,backtrace}.ml{,i}>:pkg_camlp4.macro
 EOF
 
+make_myocamlbuild $HERE/myocamlbuild.ml <<EOF
+Ocamlbuild_plugin.dispatch
+  begin
+    function
+      | After_rules as e ->
+          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);
+          dispatch_default e
+      | e -> dispatch_default e
+  end
+;;
+EOF
+
 cd $HERE
 rm -f setup.ml
 oasis setup

base/sexplib/oasis.sh

 # remove this part when oasis supports Pack: true
 $(tag_for_pack Sexplib $HERE/lib/*.ml{,l,y})
 
-<lib/pre_sexp.ml>: pp(cpp -undef -traditional -Werror -I$HERE/syntax)
+<lib/pre_sexp.ml>: pp(cpp -undef -traditional -I$HERE/syntax)
 <lib_test/*.ml{,i}>: syntax_camlp4o, pkg_type_conv.syntax
 <lib_test/conv_test.byte>: use_sexplib, pkg_unix, pkg_num, pkg_bigarray
 <syntax/pa_sexp_conv.ml>: syntax_camlp4o
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.