blob: 81f13a2eabcbf4fd3253112274d98d54a5c3273e [file] [log] [blame]
Andrew Jefferyd0a85562023-04-18 06:22:39 +09301project('obmc-console', 'c',
2 default_options: [
3 'buildtype=debugoptimized',
4 'warning_level=3',
5 'werror=true',
6 'c_std=gnu17',
7 'tests=' + (meson.is_subproject() ? 'false' : 'true'),
8 ],
9 version: '1.0.0',
10 meson_version: '>=0.63.0',
11)
12
13systemdsystemunitdir = dependency('systemd').get_variable('systemdsystemunitdir')
14install_data('conf/obmc-console@.service.in',
15 'conf/obmc-console@.socket.in',
16 'conf/obmc-console-ssh@.service.in',
17 rename: [
18 'obmc-console@.service',
19 'obmc-console@.socket',
20 'obmc-console-ssh@.service'
21 ],
22 install_dir: systemdsystemunitdir,
23 )
24
25if get_option('concurrent-servers')
26 install_data('conf/client.2200.conf.in',
27 rename: [ 'client.2200.conf' ],
28 install_dir: systemdsystemunitdir)
29else
30 install_data('conf/obmc-console-ssh.socket.in',
31 rename: [ 'obmc-console-ssh.socket' ],
32 install_dir: systemdsystemunitdir)
33 install_data('conf/obmc-console-ssh@.service.d/use-socket.conf.in',
34 rename: [ 'use-socket.conf' ],
35 install_dir: systemdsystemunitdir / 'obmc-console-ssh@.service.d')
36endif
37
38udev = dependency('udev', required: get_option('udev'))
39if udev.found()
40 install_data('conf/80-obmc-console-uart.rules.in',
41 rename: [ '80-obmc-console-uart.rules' ],
42 install_dir: udev.get_variable('udevdir') / 'rules.d')
43endif
44
45executable('obmc-console-server',
46 'config.c',
47 'console-server.c',
48 'console-socket.c',
49 'log-handler.c',
50 'ringbuffer.c',
51 'socket-handler.c',
52 'tty-handler.c',
53 'util.c',
54 c_args: [
55 '-DLOCALSTATEDIR="@0@"'.format(get_option('localstatedir')),
56 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))
57 ],
58 dependencies: [
59 dependency('libsystemd'),
60 meson.get_compiler('c').find_library('rt')
61 ],
62 install: true)
63
64executable('obmc-console-client',
65 'config.c',
66 'console-client.c',
67 'console-socket.c',
68 'util.c',
69 c_args: [
70 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))
71 ],
72 install: true)
73
74subdir('test')