Implement virt-uptime command.
[virt-tools.git] / configure.ac
1 # virt-tools
2 # Copyright (C) 2009 Red Hat Inc.
3 #
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.
8 #
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.
13 #
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.
17
18 AC_INIT([virt-tools],0.1.0)
19 AM_INIT_AUTOMAKE([foreign])
20
21 AC_CONFIG_MACRO_DIR([m4])
22
23 AC_CHECK_PROG([PERL],[perl],[perl],[no])
24 if test "x$PERL" = "xno"; then
25     AC_MSG_FAILURE([Perl must be installed])
26 fi
27
28 AM_PROG_MKDIR_P
29
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=""
34
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
38         AC_MSG_RESULT([no])
39         missing_perl_modules=yes
40     else
41         AC_MSG_RESULT([yes])
42     fi
43 done
44 if test "x$missing_perl_modules" = "xyes"; then
45     AC_MSG_FAILURE([some Perl modules are missing])
46 fi
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
50         AC_MSG_RESULT([no])
51     else
52         AC_MSG_RESULT([yes])
53     fi
54 done
55
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])
63
64 AC_CONFIG_FILES([linux/50-virt-tools:linux/50-virt-tools.in],
65                 [chmod +x linux/50-virt-tools])
66
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])
75
76 AC_CONFIG_FILES([Makefile
77                  virt-tools.spec
78                  daemon/Makefile linux/Makefile tools/Makefile])
79 AC_OUTPUT