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([virt-tools],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])
30 dnl Check for required and optional Perl modules.
31 missing_perl_modules=no
32 required_perl_modules="Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker Sys::Virt Sys::Guestfs Locale::TextDomain"
33 optional_perl_modules=""
35 for pm in $required_perl_modules; do
36 AC_MSG_CHECKING([for $pm])
37 if ! $PERL -M$pm -e1 >/dev/null 2>&1; then
39 missing_perl_modules=yes
44 if test "x$missing_perl_modules" = "xyes"; then
45 AC_MSG_FAILURE([some Perl modules are missing])
47 for pm in $optional_perl_modules; do
48 AC_MSG_CHECKING([for $pm])
49 if ! $PERL -M$pm -e1 >/dev/null 2>&1; then
56 dnl Check for pod2man and pod2text.
57 AC_CHECK_PROG([POD2MAN],[pod2man],[pod2man],[no])
58 test "x$POD2MAN" = "xno" &&
59 AC_MSG_ERROR([pod2man must be installed])
60 AC_CHECK_PROG([POD2TEXT],[pod2text],[pod2text],[no])
61 test "x$POD2TEXT" = "xno" &&
62 AC_MSG_ERROR([pod2text must be installed])
64 AC_CONFIG_FILES([linux/50-virt-tools:linux/50-virt-tools.in],
65 [chmod +x linux/50-virt-tools])
67 AC_CONFIG_FILES([tools/virt-tools-get-key:tools/virt-tools-get-key.pl],
68 [chmod +x tools/virt-tools-get-key])
69 AC_CONFIG_FILES([tools/virt-tools-get-transport:tools/virt-tools-get-transport.pl],
70 [chmod +x tools/virt-tools-get-transport])
71 AC_CONFIG_FILES([tools/virt-uname:tools/virt-uname.pl],
72 [chmod +x tools/virt-uname])
73 AC_CONFIG_FILES([tools/virt-ifconfig:tools/virt-ifconfig.pl],
74 [chmod +x tools/virt-ifconfig])
76 AC_CONFIG_FILES([Makefile
78 daemon/Makefile linux/Makefile tools/Makefile])