-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmeson.build
103 lines (95 loc) · 2.62 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
project(
'obmc-console',
'c',
default_options: [
'buildtype=debugoptimized',
'warning_level=3',
'werror=true',
'c_std=gnu17',
'tests=' + (meson.is_subproject() ? 'false' : 'true'),
],
version: '1.1.0',
meson_version: '>=1.1.0',
)
add_project_arguments('-D_GNU_SOURCE', language: 'c')
systemdsystemunitdir = dependency('systemd').get_variable('systemdsystemunitdir')
install_data(
'conf/obmc-console@.service.in',
'conf/obmc-console@.socket.in',
rename: ['obmc-console@.service', 'obmc-console@.socket'],
install_dir: systemdsystemunitdir,
)
if get_option('ssh').allowed()
install_data(
'conf/obmc-console-ssh@.service.in',
rename: ['obmc-console-ssh@.service'],
install_dir: systemdsystemunitdir,
)
endif
if get_option('concurrent-servers')
install_data(
'conf/client.2200.conf.in',
rename: ['client.2200.conf'],
install_dir: systemdsystemunitdir,
)
else
if get_option('ssh').allowed()
install_data(
'conf/obmc-console-ssh.socket.in',
rename: ['obmc-console-ssh.socket'],
install_dir: systemdsystemunitdir,
)
install_data(
'conf/obmc-console-ssh@.service.d/use-socket.conf.in',
rename: ['use-socket.conf'],
install_dir: systemdsystemunitdir / 'obmc-console-ssh@.service.d',
)
endif
endif
udev = dependency('udev', required: get_option('udev'))
if udev.found()
install_data(
'conf/80-obmc-console-uart.rules.in',
rename: ['80-obmc-console-uart.rules'],
install_dir: udev.get_variable('udevdir') / 'rules.d',
)
endif
iniparser_dep = dependency('iniparser')
server = executable(
'obmc-console-server',
'config.c',
'console-dbus.c',
'console-server.c',
'console-socket.c',
'console-mux.c',
'log-handler.c',
'ringbuffer.c',
'socket-handler.c',
'tty-handler.c',
'util.c',
c_args: [
'-DLOCALSTATEDIR="@0@"'.format(get_option('localstatedir')),
'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')),
],
dependencies: [
dependency('libsystemd'),
iniparser_dep,
dependency('libgpiod'),
meson.get_compiler('c').find_library('rt'),
],
install_dir: get_option('sbindir'),
install: true,
)
client = executable(
'obmc-console-client',
'config.c',
'console-client.c',
'console-socket.c',
'util.c',
c_args: ['-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
dependencies: [iniparser_dep],
install: true,
)
if get_option('tests')
subdir('test')
endif