1 dnl supernested configure.ac
2 dnl (C) Copyright 2014 Red Hat Inc.
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.
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.
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.
18 dnl Written by Richard W.M. Jones <rjones@redhat.com>
20 AC_INIT([supermin],[0.1])
21 AM_INIT_AUTOMAKE(foreign)
28 m4_ifdef([AC_PROG_SED],[
31 dnl ... else hope for the best
32 AC_SUBST([SED], "sed")
38 dnl Check for supermin 5.
39 AC_PATH_PROG(SUPERMIN,[supermin],[no])
41 if test "x$SUPERMIN" = "xno" ; then
42 AC_MSG_ERROR([supermin not found])
45 if ! $SUPERMIN --version | grep -q 'supermin 5'; then
46 AC_MSG_ERROR([incorrect supermin version, must be supermin 5])
49 dnl Get the distro that supermin thinks it is using.
50 AC_MSG_CHECKING([for the distro])
52 supermin --list-drivers |
53 $AWK '$2 == "detected" { gsub ("/", "-", $1); print $1; exit }'
55 AC_MSG_RESULT([$DISTRO])
57 if test -z "$DISTRO"; then
58 AC_MSG_ERROR([cannot get supermin distro from 'supermin --list-drivers' output])
61 dnl Check for a usable qemu KVM binary.
63 echo qemu-system-$host_cpu |
64 $SED -e 's/-i@<:@456@:>@86/-i386/g' \
67 qemu_choices="$qemu_system qemu-kvm kvm"
68 AC_PATH_PROGS([QEMU],[$qemu_choices],[no])
70 if test "x$QEMU" = "xno" ; then
71 AC_MSG_ERROR([no qemu KVM binary found. I looked for one of: $qemu_choices])
74 dnl Check for guestfish.
75 AC_PATH_PROG(GUESTFISH,[guestfish],[no])
77 if test "x$GUESTFISH" = "xno" ; then
78 AC_MSG_ERROR([guestfish not found])
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])