blob: 9f66d0eaa4f2bf6e86762cb6b38d6d6b810ec0d1 [file] [log] [blame]
Nan Zhou307386e2022-10-12 20:29:34 +00001# Gather the Configuration data
2
3conf_data = configuration_data()
Ed Tanous25b54db2024-04-17 15:40:31 -07004
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',
Jagpal Singh Gill57855662024-04-17 10:44:27 -070036 'redfish-updateservice-use-dbus',
Ed Tanous25b54db2024-04-17 15:40:31 -070037 '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
Nan Zhou307386e2022-10-12 20:29:34 +000072conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
Nan Zhou307386e2022-10-12 20:29:34 +000073
Ed Tanous36c0f2a2024-02-09 13:50:26 -080074conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
75conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
76
Myung Bae662aa6e2023-01-10 14:20:28 -060077# Logging level
78loglvlopt = get_option('bmcweb-logging')
79if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
Ed Tanous25b54db2024-04-17 15:40:31 -070080 # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled'
Ed Tanousf2caadc2024-01-02 18:34:36 -080081 loglvlopt = 'debug'
Myung Bae662aa6e2023-01-10 14:20:28 -060082endif
Ed Tanouse7245fe2023-07-24 17:01:38 -070083loglvlopt = loglvlopt.to_upper()
Ed Tanous25b54db2024-04-17 15:40:31 -070084conf_data.set('LOGGING_LEVEL', loglvlopt)
Myung Bae662aa6e2023-01-10 14:20:28 -060085
Nan Zhou307386e2022-10-12 20:29:34 +000086conf_h_dep = declare_dependency(
87 include_directories: include_directories('.'),
88 sources: configure_file(
89 input: 'bmcweb_config.h.in',
90 output: 'bmcweb_config.h',
Ed Tanousf2caadc2024-01-02 18:34:36 -080091 configuration: conf_data,
92 ),
Nan Zhou307386e2022-10-12 20:29:34 +000093)
94
95# Configure and install systemd unit files
96
Ed Tanousf2caadc2024-01-02 18:34:36 -080097configure_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)
Nan Zhou307386e2022-10-12 20:29:34 +0000104
Ed Tanousf2caadc2024-01-02 18:34:36 -0800105configure_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)
Nan Zhou307386e2022-10-12 20:29:34 +0000112
113# Copy pam-webserver to etc/pam.d
Ed Tanous0a9c11e2023-05-25 14:32:49 -0700114install_data(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800115 'pam-webserver',
116 install_dir: '/etc/pam.d/',
117 rename: 'webserver',
Ed Tanous0a9c11e2023-05-25 14:32:49 -0700118)