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