xref: /openbmc/bmcweb/config/meson.build (revision 57855662)
1# Gather the Configuration data
2
3conf_data = configuration_data()
4
5feature_options = [
6    'basic-auth',
7    'cookie-auth',
8    'dns-resolver',
9    'experimental-http2',
10    'experimental-redfish-multi-computer-system',
11    'google-api',
12    'host-serial-socket',
13    'http-body-limit',
14    'https_port',
15    'ibm-management-console',
16    'insecure-disable-auth',
17    'insecure-disable-csrf',
18    'insecure-disable-ssl',
19    'insecure-enable-redfish-query',
20    'insecure-ignore-content-type',
21    'insecure-push-style-notification',
22    'insecure-tftp-update',
23    'kvm',
24    'mutual-tls-auth',
25    'mutual-tls-common-name-parsing',
26    'redfish-aggregation',
27    'redfish-allow-deprecated-power-thermal',
28    'redfish-bmc-journal',
29    'redfish-cpu-log',
30    'redfish-dbus-log',
31    'redfish-dump-log',
32    'redfish-host-logger',
33    'redfish-new-powersubsystem-thermalsubsystem',
34    'redfish-oem-manager-fan-data',
35    'redfish-provisioning-feature',
36    'redfish-updateservice-use-dbus',
37    'redfish',
38    'rest',
39    'session-auth',
40    'static-hosting',
41    'tests',
42    'vm-websocket',
43    'xtoken-auth',
44]
45
46string_options = [
47    'dns-resolver',
48    'mutual-tls-common-name-parsing',
49]
50
51int_options = [
52    'http-body-limit',
53    'https_port',
54]
55
56foreach option_key : feature_options
57
58    option_key_config = option_key.to_upper()
59    option_key_config = option_key_config.replace('-', '_')
60
61    message(option_key_config)
62    opt = get_option(option_key)
63    if string_options.contains(option_key)
64    elif int_options.contains(option_key)
65    else
66        opt = opt.allowed().to_string()
67    endif
68    conf_data.set(option_key_config, opt)
69    summary(option_key, opt, section: 'Features')
70endforeach
71
72conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
73
74conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
75conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
76
77# Logging level
78loglvlopt = get_option('bmcweb-logging')
79if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
80    # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled'
81    loglvlopt = 'debug'
82endif
83loglvlopt = loglvlopt.to_upper()
84conf_data.set('LOGGING_LEVEL', loglvlopt)
85
86conf_h_dep = declare_dependency(
87    include_directories: include_directories('.'),
88    sources: configure_file(
89        input: 'bmcweb_config.h.in',
90        output: 'bmcweb_config.h',
91        configuration: conf_data,
92    ),
93)
94
95# Configure and install systemd unit files
96
97configure_file(
98    input: 'bmcweb.socket.in',
99    output: 'bmcweb.socket',
100    install_dir: systemd_system_unit_dir,
101    configuration: conf_data,
102    install: true,
103)
104
105configure_file(
106    input: 'bmcweb.service.in',
107    output: 'bmcweb.service',
108    install_dir: systemd_system_unit_dir,
109    configuration: conf_data,
110    install: true,
111)
112
113# Copy pam-webserver to etc/pam.d
114install_data(
115    'pam-webserver',
116    install_dir: '/etc/pam.d/',
117    rename: 'webserver',
118)
119