blob: 674e30294d05c802ae559dd6ad86f66e1335ae4d [file] [log] [blame]
Ben Tyner73ac3682020-01-09 10:46:47 -06001# async gpio monitor needs boost library
Patrick Williamsc322c322025-02-01 08:38:07 -05002boost_args = [
3 '-DBOOST_ASIO_DISABLE_THREADS',
4 '-DBOOST_ERROR_CODE_HEADER_ONLY',
5 '-DBOOST_SYSTEM_NO_DEPRECATED',
6]
Ben Tyner73ac3682020-01-09 10:46:47 -06007
Ben Tyner73ac3682020-01-09 10:46:47 -06008# dependency to link gpiod support
Patrick Williamsc322c322025-02-01 08:38:07 -05009libgpiod = dependency('libgpiod', version: '>=1.4.1')
Ben Tyner73ac3682020-01-09 10:46:47 -060010
Ben Tynera9f85592022-06-28 18:28:12 -050011# get openpower-hw-diags build configuration
Ben Tyner276e9812021-09-02 10:48:20 -050012attn_conf = configuration_data()
13
Ben Tynera9f85592022-06-28 18:28:12 -050014# conditionally define ENABLE_PHAL_TRUE
Patrick Williams7619ab72023-11-29 06:44:58 -060015if (get_option('phal').allowed())
Ben Tyner276e9812021-09-02 10:48:20 -050016 attn_conf.set('ENABLE_PHAL_TRUE', '')
Ben Tyner897a6f72021-07-30 10:59:23 -050017else
Ben Tyner276e9812021-09-02 10:48:20 -050018 attn_conf.set('ENABLE_PHAL_TRUE', '#')
Ben Tyner897a6f72021-07-30 10:59:23 -050019endif
20
Ben Tynera9f85592022-06-28 18:28:12 -050021# attention handler default config override
22attn_conf.set('ATTN_CONFIG', get_option('attn_config'))
23
24# install attention handler unit file
Ben Tynerdb37c892020-02-19 13:08:48 -060025configure_file(
Ben Tyner276e9812021-09-02 10:48:20 -050026 configuration: attn_conf,
27 input: 'attn_handler.service.in',
Ben Tynerdb37c892020-02-19 13:08:48 -060028 output: 'attn_handler.service',
Ben Tyner276e9812021-09-02 10:48:20 -050029 install: true,
Patrick Williamsc322c322025-02-01 08:38:07 -050030 install_dir: dependency('systemd').get_variable('systemdsystemunitdir'),
Ben Tynerdb37c892020-02-19 13:08:48 -060031)
Ben Tyner0205f3b2020-02-24 10:24:47 -060032
Ben Tynera9f85592022-06-28 18:28:12 -050033# install attention handler config file
34configure_file(
35 configuration: attn_conf,
36 input: 'attn_config.in',
37 output: 'attn_config',
38 install: true,
Patrick Williamsc322c322025-02-01 08:38:07 -050039 install_dir: join_paths(get_option('sysconfdir'), 'default'),
Ben Tynera9f85592022-06-28 18:28:12 -050040)
41
Zane Shelleyc2528942020-12-02 15:42:42 -060042# Source files.
43attn_src = files(
Ben Tyner188f1092021-02-01 09:33:06 -060044 'attention.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060045 'attn_common.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060046 'attn_config.cpp',
Ben Tyner188f1092021-02-01 09:33:06 -060047 'attn_dbus.cpp',
Ben Tyner7029e522021-08-09 19:18:24 -050048 'attn_dump.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060049 'attn_handler.cpp',
Ben Tyner46b5e2b2022-02-16 13:11:23 -060050 'attn_logging.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060051 'attn_main.cpp',
52 'attn_monitor.cpp',
53 'bp_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060054 'ti_handler.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060055 'vital_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060056)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060057
Ben Tynerf5210bb2021-01-05 12:58:10 -060058# for custom/raw PEL creation
59pel_src = files(
Ben Tynerfeeea832021-04-06 10:08:11 -050060 'pel/extended_user_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060061 'pel/pel_minimal.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060062 'pel/primary_src.cpp',
Patrick Williamsc322c322025-02-01 08:38:07 -050063 'pel/private_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060064 'pel/user_header.cpp',
65)
66
Zane Shelleyc2528942020-12-02 15:42:42 -060067# Library dependencies.
Patrick Williamsc322c322025-02-01 08:38:07 -050068attn_deps = [libgpiod, libpdbg_dep, phosphor_logging_dep, sdbusplus_dep]
Zane Shelleyc2528942020-12-02 15:42:42 -060069
Ben Tynerb9715172021-09-29 08:46:19 -050070# conditional library dependencies
Patrick Williams7619ab72023-11-29 06:44:58 -060071if get_option('phal').allowed()
Patrick Williamsc322c322025-02-01 08:38:07 -050072 attn_deps += libphal_dep
Ben Tynerb9715172021-09-29 08:46:19 -050073endif
74
Zane Shelleyc2528942020-12-02 15:42:42 -060075# Create static library.
76attn_lib = static_library(
77 'attn_lib',
78 attn_src,
Ben Tynerf5210bb2021-01-05 12:58:10 -060079 pel_src,
Patrick Williamsc322c322025-02-01 08:38:07 -050080 include_directories: incdir,
81 dependencies: attn_deps,
82 cpp_args: [boost_args],
83 install: false,
Zane Shelleyc2528942020-12-02 15:42:42 -060084)