Limit memory to 30000MB for ARM mach_virt.
[supernested.git] / configure.ac
1 dnl supernested configure.ac
2 dnl (C) Copyright 2014 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
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 dnl
18 dnl Written by Richard W.M. Jones <rjones@redhat.com>
19
20 AC_INIT([supermin],[0.1])
21 AM_INIT_AUTOMAKE(foreign)
22
23 AC_PROG_INSTALL
24
25 AC_CANONICAL_HOST
26
27 # Define $(SED).
28 m4_ifdef([AC_PROG_SED],[
29     AC_PROG_SED
30 ],[
31     dnl ... else hope for the best
32     AC_SUBST([SED], "sed")
33 ])
34
35 # Define $(AWK).
36 AC_PROG_AWK
37
38 dnl Check for supermin 5.
39 AC_PATH_PROG(SUPERMIN,[supermin],[no])
40
41 if test "x$SUPERMIN" = "xno" ; then
42     AC_MSG_ERROR([supermin not found])
43 fi
44
45 if ! $SUPERMIN --version | grep -q 'supermin 5'; then
46     AC_MSG_ERROR([incorrect supermin version, must be supermin 5])
47 fi
48
49 dnl Get the distro that supermin thinks it is using.
50 AC_MSG_CHECKING([for the distro])
51 DISTRO="$(
52     $SUPERMIN --list-drivers |
53     $AWK '$2 == "detected" { gsub ("/", "-", $1); print $1; exit }'
54     )"
55 AC_MSG_RESULT([$DISTRO])
56 AC_SUBST([DISTRO])
57 if test -z "$DISTRO"; then
58     AC_MSG_ERROR([cannot get supermin distro from '$SUPERMIN --list-drivers' output])
59 fi
60
61 dnl Check for a usable qemu KVM binary.
62 qemu_system="$(
63     echo qemu-system-$host_cpu |
64     $SED -e 's/-i@<:@456@:>@86/-i386/g' \
65          -e 's/-arm.*/-arm/g'
66     )"
67 qemu_choices="$qemu_system qemu-kvm kvm"
68 AC_PATH_PROGS([QEMU],[$qemu_choices],[no])
69
70 if test "x$QEMU" = "xno" ; then
71     AC_MSG_ERROR([no qemu KVM binary found.  I looked for one of: $qemu_choices])
72 fi
73
74 dnl Check for guestfish.
75 AC_PATH_PROG(GUESTFISH,[guestfish],[no])
76
77 if test "x$GUESTFISH" = "xno" ; then
78     AC_MSG_ERROR([guestfish not found])
79 fi
80
81 AC_CONFIG_FILES([build-supernested.sh], [chmod +x,-w build-supernested.sh])
82 AC_CONFIG_FILES([init], [chmod +x,-w init])
83 AC_CONFIG_FILES([run-supernested.sh], [chmod +x,-w run-supernested.sh])
84 AC_CONFIG_FILES([Makefile])
85 AC_OUTPUT