-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.ac
61 lines (49 loc) · 1.53 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
AC_INIT([unyte_ebpf_loadbalancer], m4_esyscmd_s(cat VERSION), [[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
AC_PREFIX_DEFAULT([/usr/local])
AM_PROG_AR
LT_INIT
AC_LANG([C])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC([gcc])
AC_PROG_LN_S
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], [pkg-config directory to install the .pc file.])],
[ with_pkgconfigdir=$with_pkgconfigdir ],
[ with_pkgconfigdir=$libdir/pkgconfig ]
)
PKGCONFIG_USER=$with_pkgconfigdir
AC_SUBST([PKGCONFIG_USER])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug logs in eBPF program.])],
[ debug_enabled=yes ],
[ debug_enabled=no ]
)
AM_CONDITIONAL(DEBUG, test "x$debug_enabled" = "xyes")
dnl eBPF example
AC_CHECK_LIB(bpf, bpf_object__find_map_by_name, [], [
echo "*** Error! You need to install libbpf first. ***"
exit -1
])
AC_CHECK_PROG([CCLANG], [clang], [yes])
AS_IF([ test "x$CCLANG" != xyes ], [
echo "*** Error! eBPF needs CLANG as dependency. Please install it first. ***"
exit -1
])
AC_CHECK_PROG([BPFTOOL], [bpftool], [yes])
AS_IF([ test "x$BPFTOOL" != xyes ], [
echo "*** Error! eBPF needs bpftool as dependency. Please install it first. ***"
exit -1
])
AC_CHECK_FILE([/sys/kernel/btf/vmlinux], [], [
echo "*** Error! eBPF needs vmlinux to compile the eBPF program. ***"
exit -1
])
AC_CONFIG_FILES([
Makefile
src/Makefile
unyte-reuseport-loadbalancer.pc
])
AC_OUTPUT