Merge branch 'handle-stdout'
[SXSI/xpathcomp.git] / myocamlbuild.ml
index d0277af..6121130 100644 (file)
@@ -17,8 +17,10 @@ let cxx_link_flags = ref  [ _S cxx_lpaths; _S cxx_libs]
 let native_link_flags = ref (List.map (fun s -> s ^ ".cmxa") ocaml_link)
 let byte_link_flags =  ref ("-custom" :: (List.map (fun s -> s ^ ".cma") ocaml_link))
 let link_flags = [ A"-linkpkg" ]
+let libs_files = List.map (fun s -> "file:" ^ s) cxx_libs_objects
 
-let native_compile_flags = ref [A"-fno-PIC"]
+
+let native_compile_flags = if Sys.word_size = 64 then ref [A"-fno-PIC"] else ref []
 let compile_flags = ref []
 
 let dwsize = sprintf "-DWORDSIZE%i" Sys.word_size
@@ -125,7 +127,7 @@ let () = dispatch begin
        compile_flags @= [A "-noassert"];
        pp_macro_options @= [ A "-unsafe" ];
        native_compile_flags @= [ A "-inline"; A ocaml_inline ];
-       cxx_flags @= [ A "-O3" ]
+       cxx_flags @= [ A "-O3"; A "-DNDEBUG" ]
       end;
 
       let dir_path = Pathname.pwd / src_path in
@@ -140,7 +142,6 @@ let () = dispatch begin
 
     | After_rules ->
       dep [ "link" ] cstub_lib;
-
       rule "c++: cpp & depends -> o" ~prod:"%.o" ~deps:[ "%.cpp" ] cxx_compile;
       let syntax_flags = S ([ A "-syntax"; A "camlp4o";
                            S (ppopt [A "-printer" ; A"Camlp4OCamlAstDumper"]);