Gbp-Pq: Name with-ebpf-includes.patch
AC_SUBST(LLC)
],
[AC_MSG_ERROR([clang needed to build ebpf files])])
+ AC_ARG_WITH(ebpf_includes,
+ [ --with-ebpf-includes=DIR include directory for building eBPF programs],
+ [AC_SUBST([ebpf_includes],["$withval"])],
+ [AC_SUBST([ebpf_includes],["/usr/include/${build_alias}"])])
])
# enable debug output
if BUILD_EBPF
# Maintaining a local copy of UAPI linux/bpf.h
-BPF_CFLAGS = -Iinclude
+BPF_CFLAGS = -Iinclude -I$(ebpf_includes)
BPF_TARGETS = lb.bpf
BPF_TARGETS += filter.bpf
$(BPF_TARGETS): %.bpf: %.c
# From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm)
${CLANG} -Wall $(BPF_CFLAGS) -O2 \
- -I/usr/include/$(build_cpu)-$(build_os)/ \
-D__KERNEL__ -D__ASM_SYSREG_H \
-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
# From LLVM-IR to BPF-bytecode in ELF-obj file