Skip to content

Commit 5d90c14

Browse files
author
Julia Kartseva
committed
bpf: add meson build rule for allow_bind program
Use introduced tools/build-bpf.py to compile BPF program from sources. The target *.h header file with hexdump will reside in the build/ folder.
1 parent dce011d commit 5d90c14

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: LGPL-2.1+
2+
3+
allow_bind_hexdump_h = custom_target(
4+
'allow-bind-hexdump.h',
5+
input : 'allow-bind.c',
6+
output : 'allow-bind-hexdump.h',
7+
command : [build_bpf_py,
8+
'--clang_exec', clang.path(),
9+
'--llc_exec', llc.path(),
10+
'@INPUT@', '@OUTPUT@'])

src/core/bpf/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: LGPL-2.1+
2+
3+
build_bpf_py = find_program('../../../tools/build-bpf.py')
4+
5+
subdir('allow_bind')

src/core/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ libcore_sources = '''
132132
unit.h
133133
'''.split()
134134

135+
if conf.get('BUILD_BPF') == 1
136+
subdir('bpf')
137+
libcore_sources += [allow_bind_hexdump_h]
138+
endif
139+
135140
load_fragment_gperf_gperf = custom_target(
136141
'load-fragment-gperf.gperf',
137142
input : 'load-fragment-gperf.gperf.m4',

0 commit comments

Comments
 (0)