Big refactoring of libxml-tree, part (1) (everything compiles)
[SXSI/xpathcomp.git] / myocamlbuild.ml
index bbe7fc0..d0277af 100644 (file)
@@ -9,9 +9,8 @@ let print_list l =
 let _A x = A x
 let _S ?(extra=N) l = S (List.map (fun e -> (S [extra; _A e] )) l)
 ;;
-
+let cxx_flags_for_ml = [ _S ~extra:(_A "-ccopt") cxx_flags ]
 let cxx_flags = ref [ _S cxx_flags ]
-
 let project_dirs = [ src_path; include_path ]
 let cxx_include_flags = _S cxx_includes
 let cxx_link_flags = ref  [ _S cxx_lpaths; _S cxx_libs]
@@ -106,8 +105,8 @@ let () = dispatch begin
       Options.ocamldoc := ocamlfind (A"ocamldoc");
       Options.ocamlmktop := ocamlfind (A"ocamlmktop");
 
-      if (List.mem "trace" !Options.tags) then begin
-       pp_macro_options @= [ A "-DTRACE" ];
+      if not (List.mem "log" !Options.tags) then begin
+       pp_macro_options @= [ A "-DNLOG" ];
       end;
       if (List.mem "profile" !Options.tags) then begin
        pp_macro_options @= [ A "-DPROFILE" ];
@@ -148,10 +147,10 @@ let () = dispatch begin
                            S (ppopt !pp_macro_options) ])
       in
       flag [ "ocaml"; "ocamldep"] syntax_flags;
-      flag [ "ocaml"; "compile" ] (S[ A "-cc"; A cxx_cmd; syntax_flags; S !compile_flags ]);
+      flag [ "ocaml"; "compile" ] (S[ A "-cc"; A cxx_cmd; S cxx_flags_for_ml ;  syntax_flags; S !compile_flags ]);
       flag [ "ocaml"; "native"; "compile" ] (S !native_compile_flags);
       flag [ "ocaml"; "link" ]
-       (S [ S link_flags ; A "-cc"; A cxx_cmd; A "-cclib" ;
+       (S [ S link_flags ; A "-cc"; A cxx_cmd; S cxx_flags_for_ml; A "-cclib" ;
             Quote (S [ _S cstub_lib;  S !cxx_link_flags]) ]);
       flag [ "ocaml"; "byte"; "link" ] (_S !byte_link_flags);
       flag [ "ocaml"; "native"; "link" ] (_S !native_link_flags);