slave: Use slightly modified event_callback.
[guestfs-browser.git] / configure.ac
1 dnl Guestfs Browser.
2 dnl Copyright (C) 2010-2011 Red Hat Inc.
3 dnl
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License along
15 dnl with this program; if not, write to the Free Software Foundation, Inc.,
16 dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 AC_INIT([guestfs-browser],[0.2.2])
19 AM_INIT_AUTOMAKE([foreign])
20 AC_CONFIG_MACRO_DIR([m4])
21
22 dnl Check for C compiler.
23 AC_PROG_CC_STDC
24 AC_PROG_INSTALL
25 AC_PROG_CPP
26 AC_C_PROTOTYPES
27 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
28 AM_PROG_CC_C_O
29 AC_SYS_LARGEFILE
30
31 AC_PROG_SED
32
33 dnl Check for OCaml compiler.
34 AC_PROG_OCAML
35 if test "$OCAMLC" = "no"; then
36     AC_MSG_ERROR([You must install the OCaml compiler (ocamlc or ocamlopt)])
37 fi
38
39 dnl Choose native code if available, but allow the user to specify
40 dnl bytecode only (useful for debugging).
41 AC_ARG_WITH([native],
42         [AS_HELP_STRING([--without-native],
43                 [disable native compilation (slow, but useful for debugging)])],
44         [],
45         [with_native=yes])
46 AM_CONDITIONAL([HAVE_OCAMLOPT],
47         [test "x$with_native" != "xno" && test "x$OCAMLBEST" = "xopt"])
48
49 dnl Check for OCaml findlib.
50 AC_PROG_FINDLIB
51 if test "$OCAMLFIND" = "no"; then
52     AC_MSG_ERROR([You must install OCaml findlib (ocamlfind)])
53 fi
54
55 dnl Check for camlp4.
56 AC_PROG_CAMLP4
57 if test "$CAMLP4" = "no"; then
58     AC_MSG_ERROR([You must install the OCaml 'camlp4' preprocessor package])
59 fi
60
61 dnl Check for all OCaml packages.
62 AC_CHECK_OCAML_PKG([lablgtk2])
63 if test "$OCAML_PKG_lablgtk2" = "no"; then
64     AC_MSG_ERROR([Please install OCaml module 'lablgtk2'.])
65 fi
66
67 AC_CHECK_OCAML_PKG([libvirt])
68 if test "$OCAML_PKG_libvirt" = "no"; then
69     AC_MSG_ERROR([Please install OCaml module 'libvirt'.])
70 fi
71
72 AC_CHECK_OCAML_PKG([guestfs])
73 if test "$OCAML_PKG_guestfs" = "no"; then
74     AC_MSG_ERROR([Please install OCaml module 'guestfs'.])
75 fi
76
77 AC_CHECK_OCAML_PKG([hivex])
78 if test "$OCAML_PKG_hivex" = "no"; then
79     AC_MSG_ERROR([Please install OCaml module 'hivex'.])
80 fi
81
82 AC_CHECK_OCAML_PKG([xml-light])
83 if test "$OCAML_PKG_xml_light" = "no"; then
84     AC_MSG_ERROR([Please install OCaml module 'xml-light'.])
85 fi
86
87 AC_CHECK_OCAML_PKG([calendar])
88 if test "$OCAML_PKG_calendar" = "no"; then
89     AC_MSG_ERROR([Please install OCaml module 'calendar'.])
90 fi
91
92 AC_CHECK_OCAML_PKG([camomile])
93 if test "$OCAML_PKG_camomile" = "no"; then
94     AC_MSG_ERROR([Please install OCaml module 'camomile' (>= 0.8, including the data module if that is separate).])
95 fi
96
97 AC_CHECK_OCAML_PKG([bitstring])
98 if test "$OCAML_PKG_bitstring" = "no"; then
99     AC_MSG_ERROR([Please install OCaml module 'bitstring'.])
100 fi
101
102 AC_CHECK_OCAML_PKG([extlib])
103 if test "$OCAML_PKG_extlib" = "no"; then
104     AC_MSG_ERROR([Please install OCaml module 'extlib'.])
105 fi
106
107 dnl Check for gdk_pixbuf_mlsource program.
108 AC_PATH_PROGS([GDK_PIXBUF_MLSOURCE], [gdk_pixbuf_mlsource])
109
110 dnl Optional programs.
111
112 dnl XXX Other desktop environments?
113 AC_CHECK_PROGS([OPENER], [gnome-open], [no])
114
115 AC_CHECK_PROG([HIVEXREGEDIT], [hivexregedit], [hivexregedit], [no])
116
117 AC_CHECK_PROG([PERLDOC],[perldoc],[perldoc],[no])
118 if test "x$PERLDOC" = "xno" ; then
119     AC_MSG_WARN([perldoc not found - install perl to make man pages])
120 fi
121 AM_CONDITIONAL([HAVE_PERLDOC],[test "x$PERLDOC" != "xno"])
122
123 AC_CONFIG_HEADERS([config.h])
124 AC_CONFIG_FILES([Makefile])
125 AC_OUTPUT