This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
/
configure.ac
55 lines (44 loc) · 2.72 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
AC_INIT([kernel-fuzzer], [1.0])
AM_INIT_AUTOMAKE([1.14 foreign subdir-objects])
LT_INIT
AC_CONFIG_SRCDIR(src/main.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIRS([m4])
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_C99
AM_SANITY_CHECK
AC_ARG_ENABLE([xen],
[AS_HELP_STRING([--disable-xen],
[Build tools that work on Xen only @<:@no@:>@])],
[with_xen=$enableval],
[with_xen=yes])
AS_IF([test x"$with_xen" = x"yes"], [
PKG_CHECK_MODULES([LIBXC], [xencontrol >= 4.15.0 xencontrol < 4.17.0],[AC_DEFINE([XEN_416],[1],[Xen 4.16])],[
PKG_CHECK_MODULES([LIBXC], [xencontrol >= 4.17.0],[AC_DEFINE([XEN_417],[1],[Xen 4.17])],[AC_MSG_ERROR(libxc not found. Install missing package and re-run)])
])
PKG_CHECK_MODULES([LIBXL], [xenlight >= 4.15.0],[],[AC_MSG_ERROR(libxenlight not found. Install missing package and re-run)])
PKG_CHECK_MODULES([XENFMEM], [xenforeignmemory >= 1.3],[],[AC_MSG_ERROR(libxenforeignmemory not found. Install missing package and re-run)])
AC_CHECK_HEADERS([libxl.h], [], [AC_MSG_ERROR(libxl.h not found. Install missing package and re-run)])
AC_CHECK_HEADERS([xen/xen.h], [], [AC_MSG_ERROR(xen/xen.h not found. Install missing package and re-run)])
AC_CHECK_HEADERS([xenstore.h], [], [AC_MSG_ERROR(xenstore.h not found. Install missing package and re-run)])
AC_CHECK_LIB(xenstore, xs_open, [], [AC_MSG_ERROR([xenstore not found])])
AC_DEFINE([HAVE_XEN], 1, [Have Xen])
# Build static libxdc if the submodule is checked out
AC_CHECK_FILES([libxdc/libxdc.h libxdc/src/decoder.c], [static_libxdc=yes], [static_libxdc=no])
# Check if its installed and then just link dynamically
AS_IF([test x"$static_libxdc" = x"yes"], [], [
AC_CHECK_HEADERS([libxdc.h], [], [AC_MSG_ERROR(libxdc not found. Check out git submodule or install dynamically.)])
AC_CHECK_LIB(xdc, [libxdc_init], [], [AC_MSG_ERROR(libxdc not found. Check out git submodule or install dynamically.)])
])
],[])
AM_CONDITIONAL([WITH_XEN], [test x"$with_xen" = xyes])
AM_CONDITIONAL([STATIC_LIBXDC], [test x"$static_libxdc" = "xyes"])
PKG_CHECK_MODULES([VMI], [libvmi],[],[AC_MSG_ERROR(LibVMI not found. Install missing package and re-run)])
PKG_CHECK_MODULES([CAPSTONE], [capstone >= 4.0.2],[],[AC_MSG_ERROR(Capstone not found. Install missing package and re-run)])
PKG_CHECK_MODULES([GLIB], [glib-2.0],[],[AC_MSG_ERROR(glib-2.0 not found. Install missing package and re-run)])
PKG_CHECK_MODULES([UNWIND], [libunwind-generic],[],[AC_MSG_ERROR(libunwind not found. Install missing package and re-run)])
AC_CHECK_HEADERS([math.h], [], [AC_MSG_ERROR([math.h not usable. Install missing package and re-run])])
AC_CHECK_LIB(m, ceil, [], [AC_MSG_ERROR([libm not found])])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT