X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=configure;h=40d1517f9af6d63bd00da1829a7222b1b8286b2c;hb=d48d9af331bfa911b7a7c6b11144d90b25ae1705;hp=c985457a9f2137b810734c5b7eeaf6fcb1967277;hpb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;p=SXSI%2Fxpathcomp.git diff --git a/configure b/configure index c985457..40d1517 100755 --- a/configure +++ b/configure @@ -12,37 +12,57 @@ Conf.check "Ocaml version >= 3.11.0" Conf.version version (fun c -> c >= (3,11,0 Conf.check_prog ~required:false "Ocaml native compiler" "ocamlopt -version";; Conf.check_prog "ocamlbuild" "ocamlbuild -version";; Conf.check_prog "ocamlfind" "ocamlfind printconf";; -Conf.check_prog "pkg-config" "pkg-config --version";; -Conf.check_prog "libxml++-2.6" "pkg-config --exists libxml++-2.6" ;; +Conf.check_prog "camlp4" "ocamlfind query camlp4";; Conf.check_prog "ulex" "ocamlfind query ulex";; -Conf.check "XMLTree" (Conf.absolute) ("%s/src/XMLTree/libXMLTree.a") (Sys.file_exists);; +Conf.check_prog "expat" "ocamlfind query expat";; -let _, libxmlI, _ = Conf.exec "pkg-config --cflags-only-I libxml++-2.6";; -let libxmlI = Conf.explode (libxmlI);; +Conf.check "libbp" (Conf.absolute) ("%s/../libbp/libbp.a") (Sys.file_exists);; +Conf.check "libcds" (Conf.absolute) ("%s/../libcds/lib/libcds.a") (Sys.file_exists);; +Conf.check "libxml-tree" (Conf.absolute) ("%s/../XMLTree/libxml-tree.a") (Sys.file_exists);; +Conf.check "TextCollection" (Conf.absolute) ("%s/../TextCollection/libTextCollection.a") (Sys.file_exists);; -let _, libxmlL, _ = Conf.exec "pkg-config --libs-only-L libxml++-2.6";; -let libxmlL = Conf.explode (libxmlL);; -let _, libxmll, _ = Conf.exec "pkg-config --libs-only-l libxml++-2.6";; -let libxmll = Conf.explode (libxmll);; +let libs_files = [ + (Conf.absolute) ("%s/../libbp/libbp.a"); + (Conf.absolute) ("%s/../libcds/lib/libcds.a"); + (Conf.absolute) ("%s/../XMLTree/libxml-tree.a"); + (Conf.absolute) ("%s/../TextCollection/libTextCollection.a"); +] -let libXMLTreeI = [ Conf.absolute "-I%s/src/XMLTree"; - Conf.absolute "-I%s/src/XMLTree/libcds/includes"; - Conf.absolute "-I%s/src/XMLTree/TextCollection" ] -;; -let libXMLTreeL = [ Conf.absolute "-L%s/src/XMLTree" ];; -let libXMLTreel = [ "-lXMLTree" ];; +let libs_I= [ + Conf.absolute "-I%s/../libbp"; + Conf.absolute "-I%s/../libcds/includes"; + Conf.absolute "-I%s/../XMLTree"; + Conf.absolute "-I%s/../TextCollection"; + Conf.absolute "-I%s/.."; + ] + +let libs_L = [ + Conf.absolute "-L%s/../libbp"; + Conf.absolute "-L%s/../libcds/lib"; + Conf.absolute "-L%s/../XMLTree"; + Conf.absolute "-L%s/../TextCollection"; + Conf.absolute "-L%s/.."; + ] + +(* Order is relevant *) +let libs_l = [ + "-lxml-tree"; + "-lTextCollection"; + "-lbp"; + "-lcds" +] let _,ocamlI,_ = Conf.exec "ocamlc -where";; let ocamlI = [ "-I" ^ ocamlI ];; Conf.def_str "cxx_cmd" "g++";; -Conf.def_list "cxx_includes" (libxmlI @ libXMLTreeI @ ocamlI);; -Conf.def_list "cxx_lpaths" (libxmlL @ libXMLTreeL);; -Conf.def_list "cxx_libs" ( libXMLTreel @ libxmll );; - +Conf.def_list "cxx_includes" (libs_I @ ocamlI);; +Conf.def_list "cxx_lpaths" libs_L;; +Conf.def_list "cxx_libs" libs_l;; +Conf.def_list "cxx_libs_objects" libs_files;; Conf.finish ();;