Andrew Jeffery | d0a8556 | 2023-04-18 06:22:39 +0930 | [diff] [blame] | 1 | project('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 Jeffery | 19c74d5 | 2023-04-19 11:43:23 +0930 | [diff] [blame] | 13 | add_project_arguments('-D_GNU_SOURCE', language: 'c') |
| 14 | |
Andrew Jeffery | d0a8556 | 2023-04-18 06:22:39 +0930 | [diff] [blame] | 15 | systemdsystemunitdir = dependency('systemd').get_variable('systemdsystemunitdir') |
| 16 | install_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 | |
| 27 | if get_option('concurrent-servers') |
| 28 | install_data('conf/client.2200.conf.in', |
| 29 | rename: [ 'client.2200.conf' ], |
| 30 | install_dir: systemdsystemunitdir) |
| 31 | else |
| 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') |
| 38 | endif |
| 39 | |
| 40 | udev = dependency('udev', required: get_option('udev')) |
| 41 | if 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') |
| 45 | endif |
| 46 | |
| 47 | executable('obmc-console-server', |
| 48 | 'config.c', |
Ninad Palsule | e258e51 | 2023-04-26 22:17:57 -0500 | [diff] [blame] | 49 | 'console-dbus.c', |
Andrew Jeffery | d0a8556 | 2023-04-18 06:22:39 +0930 | [diff] [blame] | 50 | '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 Jeffery | 86e3fd7 | 2023-04-21 16:14:17 +0930 | [diff] [blame] | 65 | install_dir: get_option('sbindir'), |
Andrew Jeffery | d0a8556 | 2023-04-18 06:22:39 +0930 | [diff] [blame] | 66 | install: true) |
| 67 | |
| 68 | executable('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 | |
| 78 | subdir('test') |