Commit 5cb8de7a authored by Brenden Blanco's avatar Brenden Blanco

Merge pull request #477 from ragnard/nixos

Add support for nixos
parents 7a82fa65 dbc21eae
...@@ -39,6 +39,12 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS}) ...@@ -39,6 +39,12 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS})
include_directories("${DIR}/../tools/clang/include") include_directories("${DIR}/../tools/clang/include")
ENDFOREACH() ENDFOREACH()
# Set to a string path if system places kernel lib directory in
# non-default location.
if(NOT DEFINED BCC_KERNEL_MODULES_DIR)
set(BCC_KERNEL_MODULES_DIR "/lib/modules")
endif()
# Set to non-zero if system installs kernel headers with split source and build # Set to non-zero if system installs kernel headers with split source and build
# directories in /lib/modules/`uname -r`/. This is the case for debian and # directories in /lib/modules/`uname -r`/. This is the case for debian and
# suse, to the best of my knowledge. # suse, to the best of my knowledge.
......
# Copyright (c) PLUMgrid, Inc. # Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License") # Licensed under the Apache License, Version 2.0 (the "License")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL_MODULES_DIR='\"${BCC_KERNEL_MODULES_DIR}\"'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL_MODULES_SUFFIX='\"${BCC_KERNEL_MODULES_SUFFIX}\"'") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL_MODULES_SUFFIX='\"${BCC_KERNEL_MODULES_SUFFIX}\"'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL_HAS_SOURCE_DIR=${BCC_KERNEL_HAS_SOURCE_DIR}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL_HAS_SOURCE_DIR=${BCC_KERNEL_HAS_SOURCE_DIR}")
add_library(clang_frontend loader.cc b_frontend_action.cc kbuild_helper.cc) add_library(clang_frontend loader.cc b_frontend_action.cc kbuild_helper.cc)
...@@ -68,6 +68,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector<string> *cflags) { ...@@ -68,6 +68,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector<string> *cflags) {
cflags->push_back("-I" + kdir_ + "/build/./arch/"+arch+"/include/uapi"); cflags->push_back("-I" + kdir_ + "/build/./arch/"+arch+"/include/uapi");
cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include/generated/uapi"); cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include/generated/uapi");
cflags->push_back("-I" + kdir_ + "/build/include/uapi"); cflags->push_back("-I" + kdir_ + "/build/include/uapi");
cflags->push_back("-I" + kdir_ + "/build/include/generated");
cflags->push_back("-I" + kdir_ + "/build/include/generated/uapi"); cflags->push_back("-I" + kdir_ + "/build/include/generated/uapi");
} }
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <vector> #include <vector>
#include <unistd.h> #include <unistd.h>
#define KERNEL_MODULES_DIR "/lib/modules"
namespace ebpf { namespace ebpf {
struct FileDeleter { struct FileDeleter {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment