aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2021-12-16 19:24:05 -0800
committerConnor O'Brien <connoro@google.com>2022-01-05 16:24:16 -0800
commitd92368896a608268507d8223e35c3ef214fd9181 (patch)
tree27085371ebe9bfb03fb49ff1378e65c770d067bb /Android.bp
parentde15ea6933606c3d11c5040535b8d5c9fb1f0c7f (diff)
downloadlibbpf-d92368896a608268507d8223e35c3ef214fd9181.tar.gz
Export libbpf headers from bpf/ directory
The Makefile for libbpf installs some of the headers from src/ under bpf/, and dwarves now relies on this fact when it includes btf.h and libbpf.h. Add a genrule to copy the headers to bpf/ and export them with libbpf. Test: build pahole Signed-off-by: Connor O'Brien <connoro@google.com> Change-Id: I31b56aa20f1a73ad70cf94e224e0ea8761f25512
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp25
1 files changed, 25 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index c2b845e..ec55963 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12,6 +12,29 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+genrule {
+ name: "libbpf_headers",
+ srcs: [
+ "src/*.h",
+ ],
+ cmd: "mkdir -p $(genDir)/bpf && cp $(in) $(genDir)/bpf/",
+ out: [
+ "bpf/bpf_core_read.h",
+ "bpf/bpf_endian.h",
+ "bpf/bpf.h",
+ "bpf/bpf_helper_defs.h",
+ "bpf/bpf_helpers.h",
+ "bpf/bpf_tracing.h",
+ "bpf/btf.h",
+ "bpf/libbpf_common.h",
+ "bpf/libbpf.h",
+ "bpf/libbpf_legacy.h",
+ "bpf/libbpf_version.h",
+ "bpf/skel_internal.h",
+ "bpf/xsk.h",
+ ],
+}
+
cc_library_host_static {
name: "libbpf",
srcs: [
@@ -24,6 +47,8 @@ cc_library_host_static {
export_include_dirs: [
"include/uapi",
],
+ generated_headers: ["libbpf_headers"],
+ export_generated_headers: ["libbpf_headers"],
cflags: [
"-DCOMPAT_NEED_REALLOCARRAY",
"-Wno-missing-field-initializers",