Commit c0066a49 authored by Maximilien Colange's avatar Maximilien Colange

Handle link of libxml from ocamlbuild plugin, to avoid ordering problems.

Should fix link bugs on Ubuntu.
parent 2332564e
......@@ -11,8 +11,6 @@ UTAP_INCLUDEDIR=@abs_top_srcdir@/utap/src
CXX_FLAGS=-std=c++11 @TIAMO_MACROS@ -I$(UTAP_INCLUDEDIR) -I@abs_top_srcdir@/src
XML_LINK_FLAGS=$(foreach i,$(XML_LIBS),-cclib $i)
SUFFIXES = .native .ml
all-local: tiamo
......@@ -23,7 +21,7 @@ tiamo: src/main.native
src/main.native: src/timedAutomatonBuilder.o
.ml.native:
CXX_FLAGS="$(CXX_FLAGS)" $(OCAMLBUILD) -cflags "-I $(INCLUDEDIR)" -lflags "$(INCLUDEDIR)/udbml.cmxa $(XML_LINK_FLAGS) -cclib -L$(INCLUDEDIR)" $@
XML_LINK_FLAGS="$(XML_LIBS)" CXX_FLAGS="$(CXX_FLAGS)" $(OCAMLBUILD) -cflags "-I $(INCLUDEDIR)" -lflags "$(INCLUDEDIR)/udbml.cmxa -cclib -L$(INCLUDEDIR)" $@
.c.o:
CXX_FLAGS="$(CXX_FLAGS)" $(OCAMLBUILD) -cflags "-I $(INCLUDEDIR)" $@
......
......@@ -41,11 +41,21 @@ let _ =
flag ["c++";"noassert"] (ocaml_cxx_flags ["-DNDEBUG"]);
(* hard-coding the C file and utap library seems the easiest way
* to avoid problems in object ordering at link time.
* Unfortunately, the dependency is not handled through ocamlbuild,
* but in the Makefile directly.
*)
flag ["ocaml"; "link"; "native"] (S[P"src/timedAutomatonBuilder.o"; A"-cclib"; A("-L"^(Pathname.pwd / "utap/src")); A"-cclib"; A"-lutap"]);
* to avoid problems in object ordering at link time.
* Unfortunately, the dependency is not handled through ocamlbuild,
* but in the Makefile directly.
*)
let xml_flags =
try
Sys.getenv "XML_LINK_FLAGS"
with Not_found -> "-lxml2"
in
flag ["ocaml"; "link"; "native"]
(S[ P"src/timedAutomatonBuilder.o";
A"-cclib"; A("-L"^(Pathname.pwd / "utap/src"));
A"-cclib"; A"-lutap";
A"-cclib"; A xml_flags
]);
| _ -> ()
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment