Add option to change kernel build search paths
authorBrenden Blanco <bblanco@plumgrid.com>
Tue, 8 Mar 2016 07:27:59 +0000 (23:27 -0800)
committerBrenden Blanco <bblanco@plumgrid.com>
Tue, 8 Mar 2016 07:34:00 +0000 (23:34 -0800)
commit3e2f9d9d6250d3f8a076bbf1a953cf4f0d21f75a
tree1ff8c31c9c769c289ccb28f5f0194d4c20c5f6ba
parentef3128afeac7ad3dc0be5302b1f7ffad6756e9bb
Add option to change kernel build search paths

Some linux distributions structure the /lib/modules directories
differently, causing complexities. Add cmake overrides to be able to
compile different behavior.

If your distro sets up `/lib/modules/$(uname -r)/{source,build}` with
header files split between the two (debian does this), then add
-DBCC_KERNEL_HAS_SOURCE_DIR=1 to the cmake command line.

If your distro just has something other than build/, but things are
still in one subdirectory, then add -DBCC_KERNEL_MODULES_SUFFIX=foo to
the cmake command line.

Also, fix one implicit declaration warning introduced by the new
bpf_get_stackid() helper.

Fixes: #397
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
CMakeLists.txt
src/cc/export/helpers.h
src/cc/frontends/clang/CMakeLists.txt
src/cc/frontends/clang/loader.cc