Don't explicitely use camlp4lib.cmxa but rely on ocamlfind to include it.
[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 "XMLTree" (Conf.absolute) ("%s/src/XMLTree/libXMLTree.a") (Sys.file_exists);;
22
23 let libXMLTreeI = [ Conf.absolute "-I%s/src/XMLTree";
24                           Conf.absolute "-I%s/src/XMLTree/libcds/includes";
25                           Conf.absolute "-I%s/src/XMLTree/TextCollection" ]
26 ;;
27 let libXMLTreeL = [ Conf.absolute "-L%s/src/XMLTree" ];;
28 let libXMLTreel = [ "-lXMLTree" ];;
29
30 let _,ocamlI,_ = Conf.exec "ocamlc -where";;
31 let ocamlI = [ "-I" ^ ocamlI ];;
32
33 Conf.def_str "cxx_cmd" "g++";;
34
35 Conf.def_list "cxx_includes" (libXMLTreeI @ ocamlI);;
36 Conf.def_list "cxx_lpaths" libXMLTreeL;;
37 Conf.def_list "cxx_libs" libXMLTreel;;
38
39
40
41 Conf.finish ();;