-
Notifications
You must be signed in to change notification settings - Fork 39
/
configure.ac
63 lines (47 loc) · 1.63 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
odnl> Do not add anything above
AC_INIT([libebpfflow],[1.0.1])
dnl> Do not add anything above
AC_PROG_CPP
AC_PROG_CXX
# Use C++ language for tests
AC_LANG(C++)
# libbpfcc-dev
# AC_CHECK_LIB([bcc], [printf])
#if test "x$ac_cv_lib_bcc_printf" != x""yes; then
# echo "Please install the bcc-dev(el) package and try again"
# exit
#fi
# Libs required for compilation test below
#LIBS="${LIBS} -lbcc"
AC_MSG_CHECKING([eBPF library new API version])
AC_TRY_COMPILE([
#include <bcc/BPF.h>
], [ ebpf::BPF *bpf;
bpf->attach_kprobe((const char*)"", NULL, 0, BPF_PROBE_ENTRY);
], [ AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_NEW_EBPF, 1, [new BPF API]) ], [AC_MSG_RESULT(no)])
DATE=`date +"%y%m%d"`
VERSION="1.0.${DATE}"
AC_DEFINE_UNQUOTED(EBPF_FLOW_VERSION, "${VERSION}", "Library version")
AC_CHECK_LIB([json-c], [json_object_new_object])
if test "x$ac_cv_lib_json_c_json_object_new_object" != "xyes"; then
echo "Please install the json-c package and try again"
exit
fi
AC_CHECK_LIB([curl], [curl_easy_init])
if test "x$ac_cv_lib_curl_curl_easy_init" != "xyes"; then
echo "Please install the libcurl (libcurl4-openssl-dev) package and try again"
exit
fi
AC_CHECK_LIB([zmq], [zmq_socket_monitor])
if test "x$ac_cv_lib_zmq_zmq_socket_monitor" != "xyes"; then :
echo "Please install the ZMQ package and try again"
exit
fi
if ! which pkg-config >/dev/null ; then
AC_MSG_ERROR([Missing pkg-config: please check README.md])
fi
AC_CHECK_LIB([json-c], json_object_new_double_s, AC_DEFINE_UNQUOTED(HAVE_DOUBLES, 1, [json-c has json_object_new_double_s]))
AC_SUBST(EBPF_LIBRARY_VERSION)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT