summaryrefslogtreecommitdiff
path: root/config/meson.build
blob: 9f66d0eaa4f2bf6e86762cb6b38d6d6b810ec0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Gather the Configuration data

conf_data = configuration_data()

feature_options = [
    'basic-auth',
    'cookie-auth',
    'dns-resolver',
    'experimental-http2',
    'experimental-redfish-multi-computer-system',
    'google-api',
    'host-serial-socket',
    'http-body-limit',
    'https_port',
    'ibm-management-console',
    'insecure-disable-auth',
    'insecure-disable-csrf',
    'insecure-disable-ssl',
    'insecure-enable-redfish-query',
    'insecure-ignore-content-type',
    'insecure-push-style-notification',
    'insecure-tftp-update',
    'kvm',
    'mutual-tls-auth',
    'mutual-tls-common-name-parsing',
    'redfish-aggregation',
    'redfish-allow-deprecated-power-thermal',
    'redfish-bmc-journal',
    'redfish-cpu-log',
    'redfish-dbus-log',
    'redfish-dump-log',
    'redfish-host-logger',
    'redfish-new-powersubsystem-thermalsubsystem',
    'redfish-oem-manager-fan-data',
    'redfish-provisioning-feature',
    'redfish-updateservice-use-dbus',
    'redfish',
    'rest',
    'session-auth',
    'static-hosting',
    'tests',
    'vm-websocket',
    'xtoken-auth',
]

string_options = [
    'dns-resolver',
    'mutual-tls-common-name-parsing',
]

int_options = [
    'http-body-limit',
    'https_port',
]

foreach option_key : feature_options

    option_key_config = option_key.to_upper()
    option_key_config = option_key_config.replace('-', '_')

    message(option_key_config)
    opt = get_option(option_key)
    if string_options.contains(option_key)
    elif int_options.contains(option_key)
    else
        opt = opt.allowed().to_string()
    endif
    conf_data.set(option_key_config, opt)
    summary(option_key, opt, section: 'Features')
endforeach

conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))

conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)

# Logging level
loglvlopt = get_option('bmcweb-logging')
if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
    # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled'
    loglvlopt = 'debug'
endif
loglvlopt = loglvlopt.to_upper()
conf_data.set('LOGGING_LEVEL', loglvlopt)

conf_h_dep = declare_dependency(
    include_directories: include_directories('.'),
    sources: configure_file(
        input: 'bmcweb_config.h.in',
        output: 'bmcweb_config.h',
        configuration: conf_data,
    ),
)

# Configure and install systemd unit files

configure_file(
    input: 'bmcweb.socket.in',
    output: 'bmcweb.socket',
    install_dir: systemd_system_unit_dir,
    configuration: conf_data,
    install: true,
)

configure_file(
    input: 'bmcweb.service.in',
    output: 'bmcweb.service',
    install_dir: systemd_system_unit_dir,
    configuration: conf_data,
    install: true,
)

# Copy pam-webserver to etc/pam.d
install_data(
    'pam-webserver',
    install_dir: '/etc/pam.d/',
    rename: 'webserver',
)