blob: bf296cd2575f5e4b0b6ffe8f58be8f045205184a [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
Andrew Jeffery19c74d52023-04-19 11:43:23 +093013add_project_arguments('-D_GNU_SOURCE', language: 'c')
14
Andrew Jefferyd0a85562023-04-18 06:22:39 +093015systemdsystemunitdir = dependency('systemd').get_variable('systemdsystemunitdir')
16install_data('conf/obmc-console@.service.in',
17 'conf/obmc-console@.socket.in',
18 'conf/obmc-console-ssh@.service.in',
19 rename: [
20 'obmc-console@.service',
21 'obmc-console@.socket',
22 'obmc-console-ssh@.service'
23 ],
24 install_dir: systemdsystemunitdir,
25 )
26
27if get_option('concurrent-servers')
28 install_data('conf/client.2200.conf.in',
29 rename: [ 'client.2200.conf' ],
30 install_dir: systemdsystemunitdir)
31else
32 install_data('conf/obmc-console-ssh.socket.in',
33 rename: [ 'obmc-console-ssh.socket' ],
34 install_dir: systemdsystemunitdir)
35 install_data('conf/obmc-console-ssh@.service.d/use-socket.conf.in',
36 rename: [ 'use-socket.conf' ],
37 install_dir: systemdsystemunitdir / 'obmc-console-ssh@.service.d')
38endif
39
40udev = dependency('udev', required: get_option('udev'))
41if udev.found()
42 install_data('conf/80-obmc-console-uart.rules.in',
43 rename: [ '80-obmc-console-uart.rules' ],
44 install_dir: udev.get_variable('udevdir') / 'rules.d')
45endif
46
47executable('obmc-console-server',
48 'config.c',
Ninad Palsulee258e512023-04-26 22:17:57 -050049 'console-dbus.c',
Andrew Jefferyd0a85562023-04-18 06:22:39 +093050 'console-server.c',
51 'console-socket.c',
52 'log-handler.c',
53 'ringbuffer.c',
54 'socket-handler.c',
55 'tty-handler.c',
56 'util.c',
57 c_args: [
58 '-DLOCALSTATEDIR="@0@"'.format(get_option('localstatedir')),
59 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))
60 ],
61 dependencies: [
62 dependency('libsystemd'),
63 meson.get_compiler('c').find_library('rt')
64 ],
Andrew Jeffery86e3fd72023-04-21 16:14:17 +093065 install_dir: get_option('sbindir'),
Andrew Jefferyd0a85562023-04-18 06:22:39 +093066 install: true)
67
68executable('obmc-console-client',
69 'config.c',
70 'console-client.c',
71 'console-socket.c',
72 'util.c',
73 c_args: [
74 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))
75 ],
76 install: true)
77
78subdir('test')