mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
30 lines
623 B
Plaintext
30 lines
623 B
Plaintext
![]() |
#!/bin/bash
|
||
|
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||
|
# This is not an autoconf generated configure
|
||
|
#
|
||
|
|
||
|
# Output file which is input to Makefile
|
||
|
CONFIG=config.mk
|
||
|
|
||
|
# Assume tc is in $PATH
|
||
|
TC=tc
|
||
|
|
||
|
check_tc_libbpf()
|
||
|
{
|
||
|
tc_version=$($TC -V)
|
||
|
if echo $tc_version | grep -q libbpf; then
|
||
|
libbpf_version=${tc_version##*libbpf }
|
||
|
echo "HAVE_TC_LIBBPF:=y" >> $CONFIG
|
||
|
echo "BPF_CFLAGS += -DHAVE_TC_LIBBPF" >> $CONFIG
|
||
|
echo "yes ($libbpf_version)"
|
||
|
else
|
||
|
echo "no"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
echo "# Generated config" > $CONFIG
|
||
|
echo "Detecting available features on system"
|
||
|
|
||
|
echo -n " - libbpf support in tc tool: "
|
||
|
check_tc_libbpf
|