Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 1 | # async gpio monitor needs boost library |
| 2 | boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', |
| 3 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 4 | '-DBOOST_SYSTEM_NO_DEPRECATED'] |
| 5 | |
Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 6 | # dependency to link gpiod support |
| 7 | libgpiod = dependency('libgpiod', version : '>=1.4.1') |
| 8 | |
Ben Tyner | a9f8559 | 2022-06-28 18:28:12 -0500 | [diff] [blame] | 9 | # get openpower-hw-diags build configuration |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 10 | attn_conf = configuration_data() |
| 11 | |
Ben Tyner | a9f8559 | 2022-06-28 18:28:12 -0500 | [diff] [blame] | 12 | # conditionally define ENABLE_PHAL_TRUE |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 13 | if (get_option('phal').enabled()) |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 14 | attn_conf.set('ENABLE_PHAL_TRUE', '') |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 15 | else |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 16 | attn_conf.set('ENABLE_PHAL_TRUE', '#') |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 17 | endif |
| 18 | |
Ben Tyner | a9f8559 | 2022-06-28 18:28:12 -0500 | [diff] [blame] | 19 | # attention handler default config override |
| 20 | attn_conf.set('ATTN_CONFIG', get_option('attn_config')) |
| 21 | |
| 22 | # install attention handler unit file |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 23 | configure_file( |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 24 | configuration: attn_conf, |
| 25 | input: 'attn_handler.service.in', |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 26 | output: 'attn_handler.service', |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 27 | install: true, |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 28 | install_dir: |
Patrick Williams | 4158600 | 2023-04-12 08:01:25 -0500 | [diff] [blame^] | 29 | dependency('systemd').get_variable('systemdsystemunitdir') |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 30 | ) |
Ben Tyner | 0205f3b | 2020-02-24 10:24:47 -0600 | [diff] [blame] | 31 | |
Ben Tyner | a9f8559 | 2022-06-28 18:28:12 -0500 | [diff] [blame] | 32 | # install attention handler config file |
| 33 | configure_file( |
| 34 | configuration: attn_conf, |
| 35 | input: 'attn_config.in', |
| 36 | output: 'attn_config', |
| 37 | install: true, |
| 38 | install_dir: join_paths(get_option('sysconfdir'), 'default') |
| 39 | ) |
| 40 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 41 | # Source files. |
| 42 | attn_src = files( |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 43 | 'attention.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 44 | 'attn_common.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 45 | 'attn_config.cpp', |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 46 | 'attn_dbus.cpp', |
Ben Tyner | 7029e52 | 2021-08-09 19:18:24 -0500 | [diff] [blame] | 47 | 'attn_dump.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 48 | 'attn_handler.cpp', |
Ben Tyner | 46b5e2b | 2022-02-16 13:11:23 -0600 | [diff] [blame] | 49 | 'attn_logging.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 50 | 'attn_main.cpp', |
| 51 | 'attn_monitor.cpp', |
| 52 | 'bp_handler.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 53 | 'ti_handler.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 54 | 'vital_handler.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 55 | ) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 56 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 57 | # for custom/raw PEL creation |
| 58 | pel_src = files( |
Ben Tyner | feeea83 | 2021-04-06 10:08:11 -0500 | [diff] [blame] | 59 | 'pel/extended_user_header.cpp', |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 60 | 'pel/pel_minimal.cpp', |
| 61 | 'pel/private_header.cpp', |
| 62 | 'pel/primary_src.cpp', |
| 63 | 'pel/user_header.cpp', |
| 64 | ) |
| 65 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 66 | # Library dependencies. |
| 67 | attn_deps = [ |
| 68 | libgpiod, |
| 69 | libpdbg_dep, |
| 70 | sdbusplus_dep, |
| 71 | ] |
| 72 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 73 | # conditional library dependencies |
| 74 | if get_option('phal').enabled() |
| 75 | attn_deps += libphal_dep |
| 76 | endif |
| 77 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 78 | # Create static library. |
| 79 | attn_lib = static_library( |
| 80 | 'attn_lib', |
| 81 | attn_src, |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 82 | pel_src, |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 83 | include_directories : incdir, |
| 84 | dependencies : attn_deps, |
Zane Shelley | 9cdfa24 | 2022-03-24 13:24:46 -0500 | [diff] [blame] | 85 | cpp_args : [boost_args], |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 86 | install : false, |
| 87 | ) |