* configure.ac: Changed version to 0.3.2.9.
[virt-top.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(ocaml-libvirt,0.3.2.9)
4
5 dnl Check for basic C environment.
6 AC_PROG_CC
7 AC_PROG_INSTALL
8 AC_PROG_CPP
9
10 AC_C_PROTOTYPES
11 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
12
13 AC_PROG_CC_C_O
14
15 dnl Check for libvirt development environment.
16 AC_ARG_WITH(libvirt,
17         AC_HELP_STRING([--with-libvirt=PATH],[Set path to installed libvirt]),
18         [if test "x$withval" != "x"; then
19            CFLAGS="$CFLAGS -I$withval/include"
20            LDFLAGS="$LDFLAGS -L$withval/lib"
21          fi
22         ])
23 AC_CHECK_LIB(virt,virConnectOpen,
24         [],
25         AC_MSG_ERROR([You must install libvirt library]))
26 AC_CHECK_HEADER([libvirt/libvirt.h],
27         [],
28         AC_MSG_ERROR([You must install libvirt development package]))
29
30 dnl Check for libvirt >= 0.2.1 (our minimum supported version).
31 dnl See: http://libvirt.org/hvsupport.html
32 AC_CHECK_FUNC(virConnectGetCapabilities,
33         [],
34         AC_MSG_ERROR([You must have libvirt >= 0.2.1]))
35
36 dnl Check for optional libvirt functions added since 0.2.1.
37 dnl See: http://libvirt.org/hvsupport.html
38 AC_CHECK_FUNCS([virConnectGetHostname virConnectGetURI virDomainBlockStats virDomainGetSchedulerParameters virDomainGetSchedulerType virDomainInterfaceStats virDomainMigrate virDomainSetSchedulerParameters])
39
40 dnl Check for optional ncurses.
41 AC_CHECK_LIB(ncurses,initscr)
42
43 dnl Check for basic OCaml environment & findlib.
44 AC_PROG_OCAML
45 AC_PROG_FINDLIB
46
47 dnl Check for required OCaml packages.
48 AC_CHECK_OCAML_PKG(unix)
49 if test "x$pkg_unix" != "xyes"; then
50    AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
51 fi
52 AC_CHECK_OCAML_PKG(extlib)
53 if test "x$pkg_extlib" != "xyes"; then
54    AC_MSG_ERROR([Cannot find required OCaml package 'extlib'])
55 fi
56
57 dnl Check for optional OCaml packages.
58 AC_CHECK_OCAML_PKG(lablgtk2)
59 AC_CHECK_OCAML_PKG(curses)
60 AC_CHECK_OCAML_PKG(gettext)
61 AC_CHECK_OCAML_PKG(xml-light)
62 AC_CHECK_OCAML_PKG(csv)
63
64 AC_SUBST(pkg_lablgtk2)
65 AC_SUBST(pkg_curses)
66 AC_SUBST(pkg_gettext)
67 AC_SUBST(pkg_xml_light)
68 AC_SUBST(pkg_csv)
69
70 dnl Check for optional perldoc (for building manual pages).
71 AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
72
73 dnl Summary.
74 echo "------------------------------------------------------------"
75 echo "Thanks for downloading" $PACKAGE_STRING
76 echo "  OCaml libvirt bindings   . yes"
77 echo "  example programs   . . . . yes"
78 echo "  mlvirsh    . . . . . . . . yes"
79 echo -n "  mlvirtmanager    . . . . . "
80 if test "x$pkg_lablgtk2" = "xyes"; then
81    echo "yes"
82 else
83    echo "no (needs optional lablgtk2)"
84 fi
85 echo -n "  virt-top     . . . . . . . "
86 if test "x$pkg_curses" = "xyes"; then
87    echo "yes"
88 else
89    echo "no (needs optional ocaml-curses)"
90 fi
91 echo -n "  virt-df      . . . . . . . "
92 if test "x$pkg_xml_light" = "xyes"; then
93    echo "yes"
94 else
95    echo "no (needs optional xml-light)"
96 fi
97 echo "------------------------------------------------------------"
98
99 dnl Produce output files.
100 AC_CONFIG_HEADERS([config.h])
101 AC_CONFIG_FILES([META
102         libvirt/libvirt_version.ml
103         Makefile
104         libvirt/Makefile
105         examples/Makefile
106         mlvirsh/Makefile
107         mlvirtmanager/Makefile
108         virt-top/Makefile
109         virt-df/Makefile
110         ])
111 AC_OUTPUT