Now using febootstrap.
[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.2])
19 AM_INIT_AUTOMAKE
20 AC_PROG_LIBTOOL
21
22 dnl Check for basic C environment.
23 AC_PROG_CC
24 AC_PROG_INSTALL
25 AC_PROG_CPP
26
27 AC_C_PROTOTYPES
28 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
29
30 AC_PROG_CC_C_O
31
32 dnl Headers.
33 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h])
34
35 dnl Check for rpcgen and XDR library.  rpcgen is optional.
36 AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no])
37 AM_CONDITIONAL([RPCGEN],[test "x$RPCGEN" != "xno"])
38 AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
39         AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
40         ])
41
42 dnl Check for febootstrap.
43 AC_CHECK_PROG([FEBOOTSTRAP],[febootstrap],[febootstrap],[no])
44 test "x$FEBOOTSTRAP" = "xno" && AC_MSG_ERROR([febootstrap must be installed])
45
46 dnl Check for QEMU.  We only check for the basic 'qemu' program here
47 dnl (ie. the i386 full system qemu).  But at runtime we might choose
48 dnl a different qemu to run, eg. qemu-system-ppc.
49 AC_PATH_PROG([QEMU],[qemu],[no],
50         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
51 test "x$QEMU" = "xno" && AC_MSG_ERROR([qemu must be installed])
52 AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.])
53
54 dnl Run in subdirs.
55 AC_CONFIG_SUBDIRS([daemon])
56
57 dnl Produce output files.
58 AC_CONFIG_HEADERS([config.h])
59 AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile])
60 AC_OUTPUT