Build environment set up for libguestfs.
[libguestfs.git] / configure.ac
1 # libguestfs
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([libguestfs],[0.1])
19 AM_INIT_AUTOMAKE
20
21 dnl Make sure the user has created the link to nfs-utils source.
22 if ! test -e $srcdir/daemon/nfs-utils \
23     -o -f $srcdir/daemon/nfs-utils/utils/nfsd/nfsd.c; then
24   AC_MSG_ERROR([$srcdir/daemon/nfs-utils must be a symlink to the unpacked nfs-utils sources.
25 See the README file for more information.])
26 fi
27
28 dnl Check for basic C environment.
29 AC_PROG_CC
30 AC_PROG_INSTALL
31 AC_PROG_CPP
32
33 AC_C_PROTOTYPES
34 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
35
36 AC_PROG_CC_C_O
37
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])
43         ])
44
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.  What we run depends
48 dnl on several factors explained in the README.
49 AC_PATH_PROG([QEMU],[qemu],[no],
50         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
51 test "x$QEMU" = "xno" && AC_MSG_ERROR([No 'qemu' program found])
52
53 dnl Check for mkinitrd, cpio.
54 AC_PATH_PROG([MKINITRD],[mkinitrd],[no],
55         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
56 test "x$MKINITRD" = "xno" && AC_MSG_ERROR([No 'mkinitrd' program found])
57 AC_CHECK_PROG([CPIO],[cpio],[cpio],[no])
58 test "x$CPIO" = "xno" && AC_MSG_ERROR([No 'cpio' program found])
59
60 dnl Produce output files.
61 AC_CONFIG_HEADERS([config.h])
62 AC_CONFIG_FILES([Makefile])
63 AC_OUTPUT