Find libbpf with pkg-config
This commit is contained in:
parent
7d13891066
commit
1e75be3b5d
|
@ -157,7 +157,7 @@ In order to build optional eBPF program to direct an incoming QUIC UDP
|
||||||
datagram to a correct socket for nghttpx, the following libraries are
|
datagram to a correct socket for nghttpx, the following libraries are
|
||||||
required:
|
required:
|
||||||
|
|
||||||
* libbpf-dev
|
* libbpf-dev >= 0.4.0
|
||||||
|
|
||||||
Compiling libnghttp2 C source code requires a C99 compiler. gcc 4.8
|
Compiling libnghttp2 C source code requires a C99 compiler. gcc 4.8
|
||||||
is known to be adequate. In order to compile the C++ source code, gcc
|
is known to be adequate. In order to compile the C++ source code, gcc
|
||||||
|
|
42
configure.ac
42
configure.ac
|
@ -205,8 +205,6 @@ AC_ARG_VAR([JEMALLOC_LIBS], [linker flags for jemalloc, skipping any checks])
|
||||||
AC_ARG_VAR([LIBTOOL_LDFLAGS],
|
AC_ARG_VAR([LIBTOOL_LDFLAGS],
|
||||||
[libtool specific flags (e.g., -static-libtool-libs)])
|
[libtool specific flags (e.g., -static-libtool-libs)])
|
||||||
|
|
||||||
AC_ARG_VAR([LIBBPF_LIBS], [linker flags for libbpf, skipping any checks])
|
|
||||||
|
|
||||||
AC_ARG_VAR([BPFCFLAGS], [C compiler flags for bpf program])
|
AC_ARG_VAR([BPFCFLAGS], [C compiler flags for bpf program])
|
||||||
|
|
||||||
dnl Checks for programs
|
dnl Checks for programs
|
||||||
|
@ -554,37 +552,15 @@ fi
|
||||||
# libbpf (for src)
|
# libbpf (for src)
|
||||||
have_libbpf=no
|
have_libbpf=no
|
||||||
if test "x${request_libbpf}" != "xno"; then
|
if test "x${request_libbpf}" != "xno"; then
|
||||||
if test "x${LIBBPF_LIBS}" = "x"; then
|
PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.4.0], [have_libbpf=yes],
|
||||||
save_CFLAGS=$CFLAGS
|
[have_libbpf=no])
|
||||||
save_LDFLAGS=$LDFLAGS
|
if test "x${have_libbpf}" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_LIBBPF], [1], [Define to 1 if you have `libbpf` library.])
|
||||||
LDFLAGS="-lbpf"
|
# Add the include path for Debian
|
||||||
AC_MSG_CHECKING([for libbpf])
|
EXTRABPFCFLAGS="-I/usr/include/$host_cpu-$host_os"
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_SUBST([EXTRABPFCFLAGS])
|
||||||
#include <bpf/bpf.h>
|
|
||||||
#include <bpf/libbpf.h>
|
|
||||||
]], [[
|
|
||||||
bpf_object__open_file("placeholder.o", NULL);
|
|
||||||
]])],
|
|
||||||
[AC_MSG_RESULT([yes]); have_libbpf=yes],
|
|
||||||
[AC_MSG_RESULT([no]); have_libbpf=no])
|
|
||||||
|
|
||||||
if test "x${have_libbpf}" = "xyes"; then
|
|
||||||
AC_DEFINE([HAVE_LIBBPF], [1], [Define to 1 if you have `libbpf` library.])
|
|
||||||
LIBBPF_LIBS=$LDFLAGS
|
|
||||||
AC_SUBST([LIBBPF_LIBS])
|
|
||||||
if test "x${BPFCFLAGS}" = "x"; then
|
|
||||||
BPFCFLAGS="-Wall -O2"
|
|
||||||
fi
|
|
||||||
# Add the include path for Debian
|
|
||||||
EXTRABPFCFLAGS="-I/usr/include/$host_cpu-$host_os"
|
|
||||||
AC_SUBST([EXTRABPFCFLAGS])
|
|
||||||
fi
|
|
||||||
|
|
||||||
CFLAGS=$save_CFLAGS
|
|
||||||
LDFLAGS=$save_LDFLAGS
|
|
||||||
else
|
else
|
||||||
have_libbpf=yes
|
AC_MSG_NOTICE($LIBBPF_PKG_ERRORS)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1203,7 +1179,7 @@ AC_MSG_NOTICE([summary of build options:
|
||||||
libngtcp2: ${have_libngtcp2} (CFLAGS='${LIBNGTCP2_CFLAGS}' LIBS='${LIBNGTCP2_LIBS}')
|
libngtcp2: ${have_libngtcp2} (CFLAGS='${LIBNGTCP2_CFLAGS}' LIBS='${LIBNGTCP2_LIBS}')
|
||||||
libngtcp2_crypto_openssl: ${have_libngtcp2_crypto_openssl} (CFLAGS='${LIBNGTCP2_CRYPTO_OPENSSL_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_OPENSSL_LIBS}')
|
libngtcp2_crypto_openssl: ${have_libngtcp2_crypto_openssl} (CFLAGS='${LIBNGTCP2_CRYPTO_OPENSSL_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_OPENSSL_LIBS}')
|
||||||
libnghttp3: ${have_libnghttp3} (CFLAGS='${LIBNGHTTP3_CFLAGS}' LIBS='${LIBNGHTTP3_LIBS}')
|
libnghttp3: ${have_libnghttp3} (CFLAGS='${LIBNGHTTP3_CFLAGS}' LIBS='${LIBNGHTTP3_LIBS}')
|
||||||
libbpf: ${have_libbpf} (LIBS='${LIBBPF_LIBS}')
|
libbpf: ${have_libbpf} (CFLAGS='${LIBBPF_CFLAGS}' LIBS='${LIBBPF_LIBS}')
|
||||||
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
|
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
|
||||||
Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
|
Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
|
||||||
Jemalloc: ${have_jemalloc} (CFLAGS='${JEMALLOC_CFLAGS}' LIBS='${JEMALLOC_LIBS}')
|
Jemalloc: ${have_jemalloc} (CFLAGS='${JEMALLOC_CFLAGS}' LIBS='${JEMALLOC_LIBS}')
|
||||||
|
|
Loading…
Reference in New Issue