forked from hyperhq/hyperd
/
configure.ac
73 lines (57 loc) · 1.8 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([hyper], [0.2], [hyper.sh])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([hypervisor/xen/hyperxl.c])
AC_CONFIG_HEADERS([hypervisor/xen/config.h])
# Checks for programs.
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
# Checks for go tool chain
AC_CHECK_PROG([has_go], [go], [yes], [no])
if test "x$has_go" != "xyes" ; then
AC_MSG_ERROR(Unable to find go binary in PATH)
fi
AC_CHECK_PROG([has_godep], [godep], [yes], [no])
if test "x$has_godep" != "xyes" ; then
AC_MSG_ERROR(Unable to find godep binary in PATH)
fi
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h libxl.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_PID_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([strdup])
AC_ARG_WITH([xen],
[AS_HELP_STRING([--without-xen],
[run hyperd with xen (libxl, need xen 4.5 or higher)])],
[with_xen=no],[with_xen=yes])
if test "x$with_xen" != "xno" ; then
# Checks for libxl
AC_CHECK_HEADERS([libxl.h libxl_utils.h], [libxl_found=yes], [libxl_found=no])
if test "x$libxl_found" != "xyes"; then
with_xen=no
fi
fi
if test "x$with_xen" != "xno" ; then
AC_DEFINE_UNQUOTED([WITH_XEN], 1, [run hyperd with xen])
fi
AM_CONDITIONAL([WITH_XEN], [test "x$with_xen" == "xyes"])
AC_CONFIG_FILES([Makefile
hypervisor/Makefile
hypervisor/xen/Makefile])
AC_OUTPUT
AC_MSG_RESULT([
${PACKAGE} ${VERSION}
prefix: ${prefix}
has go: ${has_go}
has godep: ${has_go}
with xen: ${with_xen}
])