blob: 5a2834b962b81b158d9076d930e3b712b46af6b6 [file] [log] [blame]
Ben Tyner73ac3682020-01-09 10:46:47 -06001# async gpio monitor needs boost library
2boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
3 '-DBOOST_ERROR_CODE_HEADER_ONLY',
4 '-DBOOST_SYSTEM_NO_DEPRECATED']
5
Ben Tyner73ac3682020-01-09 10:46:47 -06006# dependency to link gpiod support
7libgpiod = dependency('libgpiod', version : '>=1.4.1')
8
Ben Tynera9f85592022-06-28 18:28:12 -05009# get openpower-hw-diags build configuration
Ben Tyner276e9812021-09-02 10:48:20 -050010attn_conf = configuration_data()
11
Ben Tynera9f85592022-06-28 18:28:12 -050012# conditionally define ENABLE_PHAL_TRUE
Ben Tyner897a6f72021-07-30 10:59:23 -050013if (get_option('phal').enabled())
Ben Tyner276e9812021-09-02 10:48:20 -050014 attn_conf.set('ENABLE_PHAL_TRUE', '')
Ben Tyner897a6f72021-07-30 10:59:23 -050015else
Ben Tyner276e9812021-09-02 10:48:20 -050016 attn_conf.set('ENABLE_PHAL_TRUE', '#')
Ben Tyner897a6f72021-07-30 10:59:23 -050017endif
18
Ben Tynera9f85592022-06-28 18:28:12 -050019# attention handler default config override
20attn_conf.set('ATTN_CONFIG', get_option('attn_config'))
21
22# install attention handler unit file
Ben Tynerdb37c892020-02-19 13:08:48 -060023configure_file(
Ben Tyner276e9812021-09-02 10:48:20 -050024 configuration: attn_conf,
25 input: 'attn_handler.service.in',
Ben Tynerdb37c892020-02-19 13:08:48 -060026 output: 'attn_handler.service',
Ben Tyner276e9812021-09-02 10:48:20 -050027 install: true,
Ben Tynerdb37c892020-02-19 13:08:48 -060028 install_dir:
Patrick Williams41586002023-04-12 08:01:25 -050029 dependency('systemd').get_variable('systemdsystemunitdir')
Ben Tynerdb37c892020-02-19 13:08:48 -060030)
Ben Tyner0205f3b2020-02-24 10:24:47 -060031
Ben Tynera9f85592022-06-28 18:28:12 -050032# install attention handler config file
33configure_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 Shelleyc2528942020-12-02 15:42:42 -060041# Source files.
42attn_src = files(
Ben Tyner188f1092021-02-01 09:33:06 -060043 'attention.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060044 'attn_common.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060045 'attn_config.cpp',
Ben Tyner188f1092021-02-01 09:33:06 -060046 'attn_dbus.cpp',
Ben Tyner7029e522021-08-09 19:18:24 -050047 'attn_dump.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060048 'attn_handler.cpp',
Ben Tyner46b5e2b2022-02-16 13:11:23 -060049 'attn_logging.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060050 'attn_main.cpp',
51 'attn_monitor.cpp',
52 'bp_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060053 'ti_handler.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060054 'vital_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060055)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060056
Ben Tynerf5210bb2021-01-05 12:58:10 -060057# for custom/raw PEL creation
58pel_src = files(
Ben Tynerfeeea832021-04-06 10:08:11 -050059 'pel/extended_user_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060060 'pel/pel_minimal.cpp',
61 'pel/private_header.cpp',
62 'pel/primary_src.cpp',
63 'pel/user_header.cpp',
64)
65
Zane Shelleyc2528942020-12-02 15:42:42 -060066# Library dependencies.
67attn_deps = [
68 libgpiod,
69 libpdbg_dep,
70 sdbusplus_dep,
71]
72
Ben Tynerb9715172021-09-29 08:46:19 -050073# conditional library dependencies
74if get_option('phal').enabled()
75 attn_deps += libphal_dep
76endif
77
Zane Shelleyc2528942020-12-02 15:42:42 -060078# Create static library.
79attn_lib = static_library(
80 'attn_lib',
81 attn_src,
Ben Tynerf5210bb2021-01-05 12:58:10 -060082 pel_src,
Zane Shelleyc2528942020-12-02 15:42:42 -060083 include_directories : incdir,
84 dependencies : attn_deps,
Zane Shelley9cdfa242022-03-24 13:24:46 -050085 cpp_args : [boost_args],
Zane Shelleyc2528942020-12-02 15:42:42 -060086 install : false,
87)