Encapsulate serialization results around with <xml_result>...</xml_result>
[SXSI/xpathcomp.git] / configure
1 #!/usr/bin/env ocaml
2
3 #directory "utils";;
4 #use "conf.ml";;
5
6 Conf.start ();;
7
8 Conf.check_prog "C compiler" "gcc --version";;
9 Conf.check_prog "C++ compiler" "g++ --version";;
10 let _,version, _ = Conf.prog "Ocaml bytecode compiler" "ocamlc -version";;
11 Conf.check "Ocaml version >= 3.11.0" Conf.version version (fun c -> c >= (3,11,0));;
12 Conf.check_prog ~required:false "Ocaml native compiler" "ocamlopt -version";;
13 Conf.check_prog "ocamlbuild" "ocamlbuild -version";;
14 Conf.check_prog "ocamlfind" "ocamlfind printconf";;
15 Conf.check_prog "pkg-config" "pkg-config --version";;
16
17 Conf.check_prog "camlp4" "ocamlfind query camlp4";;
18 Conf.check_prog "ulex" "ocamlfind query ulex";;
19 Conf.check_prog "expat" "ocamlfind query expat";;
20
21 Conf.check "bp" (Conf.absolute) ("%s/../bp/libbp.a") (Sys.file_exists);;
22 Conf.check "libcds" (Conf.absolute) ("%s/../libcds/lib/libcds.a") (Sys.file_exists);;
23 Conf.check "libxml-tree" (Conf.absolute) ("%s/../XMLTree/libxml-tree.a") (Sys.file_exists);;
24 Conf.check "TextCollection" (Conf.absolute) ("%s/../TextCollection/libTextCollection.a") (Sys.file_exists);;
25
26
27 let libs_files = [
28     (Conf.absolute) ("%s/../bp/libbp.a");
29     (Conf.absolute) ("%s/../libcds/lib/libcds.a");
30     (Conf.absolute) ("%s/../XMLTree/libxml-tree.a");
31     (Conf.absolute) ("%s/../TextCollection/libTextCollection.a");
32 ]
33
34 let libs_I= [
35     Conf.absolute "-I%s/../bp";
36     Conf.absolute "-I%s/../libcds/includes";
37     Conf.absolute "-I%s/../XMLTree";
38     Conf.absolute "-I%s/../TextCollection";
39     Conf.absolute "-I%s/..";
40      ]
41
42 let libs_L = [
43     Conf.absolute "-L%s/../bp";
44     Conf.absolute "-L%s/../libcds/lib";
45     Conf.absolute "-L%s/../XMLTree";
46     Conf.absolute "-L%s/../TextCollection";
47     Conf.absolute "-L%s/..";
48    ]
49
50 (* Order is relevant *)
51 let libs_l = [
52      "-lxml-tree";
53      "-lTextCollection";
54      "-lbp";
55      "-lcds"
56 ]
57
58 let _,ocamlI,_ = Conf.exec "ocamlc -where";;
59 let ocamlI = [ "-I" ^ ocamlI ];;
60
61 Conf.def_str "cxx_cmd" "g++";;
62
63 Conf.def_list "cxx_includes" (libs_I @ ocamlI);;
64 Conf.def_list "cxx_lpaths" libs_L;;
65 Conf.def_list "cxx_libs" libs_l;;
66 Conf.def_list "cxx_libs_objects" libs_files;;
67
68
69 Conf.finish ();;