From: kim Date: Mon, 13 Feb 2012 15:22:52 +0000 (+0000) Subject: Change configure script to use separate libraries. X-Git-Url: http://git.nguyen.vg/gitweb/?a=commitdiff_plain;h=9975bb31b2447755c6853875b8d738aed8873859;hp=a6baedc6c67cb1de0587a779f8bcddf276b0bf4c;p=SXSI%2Fxpathcomp.git Change configure script to use separate libraries. git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/branches/xpathcomp/trace-refactor@1210 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/configure b/configure index 791a088..4e72824 100755 --- a/configure +++ b/configure @@ -18,23 +18,44 @@ Conf.check_prog "camlp4" "ocamlfind query camlp4";; Conf.check_prog "ulex" "ocamlfind query ulex";; Conf.check_prog "expat" "ocamlfind query expat";; +Conf.check "bp" (Conf.absolute) ("%s/../bp/libbp.a") (Sys.file_exists);; +Conf.check "libcds" (Conf.absolute) ("%s/../libcds/lib/libcds.a") (Sys.file_exists);; Conf.check "XMLTree" (Conf.absolute) ("%s/../XMLTree/libXMLTree.a") (Sys.file_exists);; - -let libXMLTreeI = [ Conf.absolute "-I%s/../XMLTree"; - Conf.absolute "-I%s/../XMLTree/libcds/includes"; - Conf.absolute "-I%s/../XMLTree/TextCollection" ] -;; -let libXMLTreeL = [ Conf.absolute "-L%s/../XMLTree" ];; -let libXMLTreel = [ "-lXMLTree" ];; +Conf.check "TextCollection" (Conf.absolute) ("%s/../TextCollection/libTextCollection.a") (Sys.file_exists);; + + +let libs_I= [ + Conf.absolute "-I%s/../bp"; + 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/../bp"; + 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 = [ + "-lXMLTree" + "-lTextCollection"; + "-lbp"; + "-lcds"; +] let _,ocamlI,_ = Conf.exec "ocamlc -where";; let ocamlI = [ "-I" ^ ocamlI ];; Conf.def_str "cxx_cmd" "g++";; -Conf.def_list "cxx_includes" (libXMLTreeI @ ocamlI);; -Conf.def_list "cxx_lpaths" libXMLTreeL;; -Conf.def_list "cxx_libs" libXMLTreel;; +Conf.def_list "cxx_includes" (libs_I @ ocamlI);; +Conf.def_list "cxx_lpaths" libs_L;; +Conf.def_list "cxx_libs" libs_l;; diff --git a/utils/conf.ml b/utils/conf.ml index 49ab1a2..86e30bd 100644 --- a/utils/conf.ml +++ b/utils/conf.ml @@ -13,7 +13,7 @@ module Conf = ignore (Sys.command "cp myocamlbuild_config.ml.in myocamlbuild_config.ml"); o_chan := open_out_gen [ Open_append ] 0 "myocamlbuild_config.ml"; o_fmt := formatter_of_out_channel !o_chan - + ;; let finish () =