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.1])
22 dnl Make sure the user has created the link to nfs-utils source.
23 if ! test -e $srcdir/daemon/nfs-utils \
24 -o -f $srcdir/daemon/nfs-utils/utils/nfsd/nfsd.c; then
25 AC_MSG_ERROR([$srcdir/daemon/nfs-utils must be a symlink to the unpacked nfs-utils sources.
26 See the README file for more information.])
29 dnl Check for basic C environment.
35 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
40 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h])
42 dnl Check for rpcgen and XDR library. rpcgen is optional.
43 AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no])
44 AM_CONDITIONAL([RPCGEN],[test "x$RPCGEN" != "xno"])
45 AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
46 AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
49 dnl Check for QEMU. We only check for the basic 'qemu' program here
50 dnl (ie. the i386 full system qemu). But at runtime we might choose
51 dnl a different qemu to run, eg. qemu-system-ppc. What we run depends
52 dnl on several factors explained in the README.
53 AC_PATH_PROG([QEMU],[qemu],[no],
54 [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
55 test "x$QEMU" = "xno" && AC_MSG_ERROR([No 'qemu' program found])
56 AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.])
58 dnl Check for mkinitrd, cpio.
59 AC_PATH_PROG([MKINITRD],[mkinitrd],[no],
60 [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
61 test "x$MKINITRD" = "xno" && AC_MSG_ERROR([No 'mkinitrd' program found])
62 AC_CHECK_PROG([CPIO],[cpio],[cpio],[no])
63 test "x$CPIO" = "xno" && AC_MSG_ERROR([No 'cpio' program found])
65 dnl Produce output files.
66 AC_CONFIG_HEADERS([config.h])
67 AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile])