2 # Copyright (C) 2009 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 AC_INIT([libguestfs],0.1.0)
19 AM_INIT_AUTOMAKE([foreign])
21 AC_CONFIG_MACRO_DIR([m4])
23 AC_CHECK_PROG([PERL],[perl],[perl],[no])
24 if test "x$PERL" = "xno"; then
25 AC_MSG_FAILURE([Perl must be installed])
28 dnl Check for Perl modules that must be present to compile and
29 dnl test the Perl bindings.
30 missing_perl_modules=no
31 required_perl_modules="Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker Sys::Virt"
32 optional_perl_modules="Sys::Guestfs"
34 for pm in $required_perl_modules; do
35 AC_MSG_CHECKING([for $pm])
36 if ! $PERL -M$pm -e1 >/dev/null 2>&1; then
38 missing_perl_modules=yes
43 if test "x$missing_perl_modules" = "xyes"; then
44 AC_MSG_FAILURE([some Perl modules are missing])
46 for pm in $optional_perl_modules; do
47 AC_MSG_CHECKING([for $pm])
48 if ! $PERL -M$pm -e1 >/dev/null 2>&1; then
55 dnl Check for pod2man and pod2text.
56 AC_CHECK_PROG([POD2MAN],[pod2man],[pod2man],[no])
57 test "x$POD2MAN" = "xno" &&
58 AC_MSG_ERROR([pod2man must be installed])
59 AC_CHECK_PROG([POD2TEXT],[pod2text],[pod2text],[no])
60 test "x$POD2TEXT" = "xno" &&
61 AC_MSG_ERROR([pod2text must be installed])
63 AC_CONFIG_FILES([tools/virt-tools-get-key:tools/virt-tools-get-key.pl],
64 [chmod +x tools/virt-tools-get-key])
65 AC_CONFIG_FILES([tools/virt-tools-get-transport:tools/virt-tools-get-transport.pl],
66 [chmod +x tools/virt-tools-get-transport])
67 AC_CONFIG_FILES([tools/virt-uname:tools/virt-uname.pl],
68 [chmod +x tools/virt-uname])
69 AC_CONFIG_FILES([tools/virt-ifconfig:tools/virt-ifconfig.pl],
70 [chmod +x tools/virt-ifconfig])
71 AC_CONFIG_FILES([Makefile
72 daemon/Makefile docs/Makefile linux/Makefile tools/Makefile])