-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
73 lines (65 loc) · 1.96 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
project('ld-so-daemon',
'c',
version: '0.0.0-alpha',
meson_version: '>=0.52.1',
license: ['LGPL-2.1-or-later', 'BSD-3-Clause'],
)
conf = configuration_data()
prefixdir = get_option('prefix')
libdir = prefixdir / 'lib'
sysconfdir = prefixdir / get_option('sysconfdir')
client_exe = 'ld-so-client'
client_path = prefixdir / 'lib' / client_exe
conf.set_quoted('LIBDIR', libdir)
conf.set_quoted('SYSCONFDIR', sysconfdir)
conf.set_quoted('CLIENT', client_path)
config_h = configure_file(
output: 'config.h',
configuration: conf)
libsystemd = dependency('libsystemd')
libselinux = dependency('libselinux')
server = executable('ld-so-server',
'ld-so-server.c',
dependencies: [libsystemd, libselinux],
install: true,
)
if get_option('b_coverage') != true
client = executable(client_exe,
'ld-so-client.c',
c_args: ['-nostdlib', '-nostartfiles', '-shared'],
link_args: ['-nostdlib', '-nostartfiles', '-shared'],
install: true,
pie: true,
)
test_1_lib = shared_library('test_1_lib',
'hello_world_lib.c',
c_args: ['-nostdlib', '-nostartfiles', '-shared', '-fPIC'],
link_args: ['-nostdlib', '-nostartfiles', '-shared', '-fPIC'],
)
test_1 = executable('test_1',
'hello_world.c',
link_with: test_1_lib,
c_args: ['-nostdlib', '-nostartfiles', '-shared', '-fPIC'],
link_args: ['-nostdlib', '-nostartfiles', '-shared', '-fPIC'],
pie: true,
)
gen = meson.source_root() / 'generator.py'
test_profile = 'TEST'
mytarget = custom_target('targetname',
output: test_profile,
input: test_1,
build_by_default: true,
capture: true,
command: [gen, '@0@/test_1'.format(meson.build_root())]
)
endif
test_2 = executable('test_2',
'ld-so-server.c',
dependencies: [libsystemd, libselinux],
c_args: [
'-DPROFILE_DIR="."',
'-DFORCE_UNIT="@0@/TEST"'.format(meson.build_root()),
'-DFORCE_CLIENT="@0@"'.format(meson.build_root() / client_exe)
]
)