blob: 4b862b49eba5375f714417a0ac51c6a08d1b608c [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',
36 'redfish',
37 'rest',
38 'session-auth',
39 'static-hosting',
40 'tests',
41 'vm-websocket',
42 'xtoken-auth',
43]
44
45string_options = [
46 'dns-resolver',
47 'mutual-tls-common-name-parsing',
48]
49
50int_options = [
51 'http-body-limit',
52 'https_port',
53]
54
55foreach option_key : feature_options
56
57 option_key_config = option_key.to_upper()
58 option_key_config = option_key_config.replace('-', '_')
59
60 message(option_key_config)
61 opt = get_option(option_key)
62 if string_options.contains(option_key)
63 elif int_options.contains(option_key)
64 else
65 opt = opt.allowed().to_string()
66 endif
67 conf_data.set(option_key_config, opt)
68 summary(option_key, opt, section: 'Features')
69endforeach
70
Nan Zhou307386e2022-10-12 20:29:34 +000071conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
Nan Zhou307386e2022-10-12 20:29:34 +000072
Ed Tanous36c0f2a2024-02-09 13:50:26 -080073conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
74conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
75
Myung Bae662aa6e2023-01-10 14:20:28 -060076# Logging level
77loglvlopt = get_option('bmcweb-logging')
78if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
Ed Tanous25b54db2024-04-17 15:40:31 -070079 # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled'
Ed Tanousf2caadc2024-01-02 18:34:36 -080080 loglvlopt = 'debug'
Myung Bae662aa6e2023-01-10 14:20:28 -060081endif
Ed Tanouse7245fe2023-07-24 17:01:38 -070082loglvlopt = loglvlopt.to_upper()
Ed Tanous25b54db2024-04-17 15:40:31 -070083conf_data.set('LOGGING_LEVEL', loglvlopt)
Myung Bae662aa6e2023-01-10 14:20:28 -060084
Nan Zhou307386e2022-10-12 20:29:34 +000085conf_h_dep = declare_dependency(
86 include_directories: include_directories('.'),
87 sources: configure_file(
88 input: 'bmcweb_config.h.in',
89 output: 'bmcweb_config.h',
Ed Tanousf2caadc2024-01-02 18:34:36 -080090 configuration: conf_data,
91 ),
Nan Zhou307386e2022-10-12 20:29:34 +000092)
93
94# Configure and install systemd unit files
95
Ed Tanousf2caadc2024-01-02 18:34:36 -080096configure_file(
97 input: 'bmcweb.socket.in',
98 output: 'bmcweb.socket',
99 install_dir: systemd_system_unit_dir,
100 configuration: conf_data,
101 install: true,
102)
Nan Zhou307386e2022-10-12 20:29:34 +0000103
Ed Tanousf2caadc2024-01-02 18:34:36 -0800104configure_file(
105 input: 'bmcweb.service.in',
106 output: 'bmcweb.service',
107 install_dir: systemd_system_unit_dir,
108 configuration: conf_data,
109 install: true,
110)
Nan Zhou307386e2022-10-12 20:29:34 +0000111
112# Copy pam-webserver to etc/pam.d
Ed Tanous0a9c11e2023-05-25 14:32:49 -0700113install_data(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800114 'pam-webserver',
115 install_dir: '/etc/pam.d/',
116 rename: 'webserver',
Ed Tanous0a9c11e2023-05-25 14:32:49 -0700117)