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.2])
21 AC_CONFIG_MACRO_DIR([m4])
25 dnl Check for basic C environment.
31 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
36 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h])
38 dnl Check for rpcgen and XDR library. rpcgen is optional.
39 AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no])
40 AM_CONDITIONAL([RPCGEN],[test "x$RPCGEN" != "xno"])
41 AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
42 AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
45 dnl Check for QEMU. We only check for the basic 'qemu' program here
46 dnl (ie. the i386 full system qemu). But at runtime we might choose
47 dnl a different qemu to run, eg. qemu-system-ppc.
48 AC_PATH_PROG([QEMU],[qemu],[no],
49 [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
50 test "x$QEMU" = "xno" && AC_MSG_ERROR([qemu must be installed])
51 AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.])
53 dnl Check for febootstrap etc.
54 AC_CHECK_PROG([FEBOOTSTRAP],
55 [febootstrap],[febootstrap],[no])
56 test "x$FEBOOTSTRAP" = "xno" && \
57 AC_MSG_ERROR([febootstrap must be installed])
58 AC_CHECK_PROG([FEBOOTSTRAP_RUN],
59 [febootstrap-run],[febootstrap-run],[no])
60 test "x$FEBOOTSTRAP_RUN" = "xno" && \
61 AC_MSG_ERROR([febootstrap-run must be installed])
62 AC_CHECK_PROG([FEBOOTSTRAP_MINIMIZE],
63 [febootstrap-minimize],[febootstrap-minimize],[no])
64 test "x$FEBOOTSTRAP_MINIMIZE" = "xno" && \
65 AC_MSG_ERROR([febootstrap-minimize must be installed])
66 AC_CHECK_PROG([FEBOOTSTRAP_TO_INITRAMFS],
67 [febootstrap-to-initramfs],[febootstrap-to-initramfs],[no])
68 test "x$FEBOOTSTRAP_TO_INITRAMFS" = "xno" && \
69 AC_MSG_ERROR([febootstrap-to-initramfs must be installed])
71 dnl --with-repo to specify a Fedora repository.
73 [AS_HELP_STRING([--with-repo],
74 [set name of Fedora repository @<:@default=fedora-10@:>@])],
76 [with_repo=fedora-10])
80 dnl --with-mirror to specify a local Fedora mirror.
82 [AS_HELP_STRING([--with-mirror],
83 [set URI of a local Fedora mirror])],
90 AC_CONFIG_SUBDIRS([daemon])
92 dnl Produce output files.
93 AC_CONFIG_HEADERS([config.h])
94 AC_CONFIG_FILES([Makefile src/Makefile fish/Makefile examples/Makefile
95 make-initramfs.sh update-initramfs.sh])
99 chmod +x make-initramfs.sh update-initramfs.sh