#!/usr/bin/env ocaml #directory "utils";; #use "conf.ml";; Conf.start ();; Conf.check_prog "C compiler" "gcc --version";; Conf.check_prog "C++ compiler" "g++ --version";; let _,version, _ = Conf.prog "Ocaml bytecode compiler" "ocamlc -version";; 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 "camlp4" "ocamlfind query camlp4";; Conf.check_prog "ulex" "ocamlfind query ulex";; Conf.check_prog "expat" "ocamlfind query expat";; 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 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 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" (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 ();;