forked from hyperhq/runv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
119 lines (93 loc) · 2.71 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([runv], [0.7.0], [hyper.sh])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
# Checks for programs.
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
AC_CANONICAL_BUILD
case $build_os in
darwin*)
AM_CONDITIONAL([ON_DARWIN], [ true ])
;;
*)
AM_CONDITIONAL([ON_DARWIN], [ false ])
;;
esac
# 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
# Platform specific setup
AC_CANONICAL_HOST
case $host_os in
linux*) AM_CONDITIONAL([ON_LINUX], [ true ]) ;;
*) AM_CONDITIONAL([ON_LINUX], [ false ]) ;;
esac
# Check for which host we are on and setup a few things
# specifically based on the host
AC_CHECK_PROG([has_virtualbox], [vboxmanage], [yes], [no])
case $host_os in
darwin* )
# Do something specific for mac
if test "x$has_virtualbox" != "xyes" ; then
AC_MSG_ERROR(Unable to find vboxmanage binary in PATH)
fi
;;
linux*)
# Do something specific for linux
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
# Checks for libraries.
LIBVIRT_REQUIRED="1.2.2"
AC_ARG_WITH([libvirt],
[AS_HELP_STRING([--without-libvirt],
[run runv with libvirt])],
[with_libvirt=no],[with_libvirt=yes])
if test "$with_libvirt" = yes; then
PKG_CHECK_MODULES([LIBVIRT], [libvirt >= $LIBVIRT_REQUIRED], [], [with_libvirt=no])
fi
AM_CONDITIONAL([WITH_LIBVIRT], [test "x$with_libvirt" == "xyes"])
# 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 runv 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])
AC_OUTPUT
AC_MSG_RESULT([
${PACKAGE} ${VERSION}
build OS: ${build_os}
prefix: ${prefix}
has go: ${has_go}
with xen: ${with_xen}
with libvirt: ${with_libvirt}
has virtualbox: ${has_virtualbox}
])