meson: generate ENABLE_* names automatically

After previous changes, the naming of configuration options and internal
defines is consistent.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-10-03 13:15:27 +02:00
parent 1ec57f3394
commit a9149d876b
1 changed files with 35 additions and 36 deletions

View File

@ -1036,42 +1036,41 @@ else
endif endif
conf.set10('ENABLE_REMOTE', have) conf.set10('ENABLE_REMOTE', have)
foreach pair : [['utmp', 'ENABLE_UTMP'], foreach term : ['utmp',
['hibernate', 'ENABLE_HIBERNATE'], 'hibernate',
['environment-d', 'ENABLE_ENVIRONMENT_D'], 'environment-d',
['binfmt', 'ENABLE_BINFMT'], 'binfmt',
['coredump', 'ENABLE_COREDUMP'], 'coredump',
['resolve', 'ENABLE_RESOLVE'], 'resolve',
['logind', 'ENABLE_LOGIND'], 'logind',
['hostnamed', 'ENABLE_HOSTNAMED'], 'hostnamed',
['localed', 'ENABLE_LOCALED'], 'localed',
['machined', 'ENABLE_MACHINED'], 'machined',
['networkd', 'ENABLE_NETWORKD'], 'networkd',
['timedated', 'ENABLE_TIMEDATED'], 'timedated',
['timesyncd', 'ENABLE_TIMESYNCD'], 'timesyncd',
['myhostname', 'ENABLE_MYHOSTNAME'], 'myhostname',
['firstboot', 'ENABLE_FIRSTBOOT'], 'firstboot',
['randomseed', 'ENABLE_RANDOMSEED'], 'randomseed',
['backlight', 'ENABLE_BACKLIGHT'], 'backlight',
['vconsole', 'ENABLE_VCONSOLE'], 'vconsole',
['quotacheck', 'ENABLE_QUOTACHECK'], 'quotacheck',
['sysusers', 'ENABLE_SYSUSERS'], 'sysusers',
['tmpfiles', 'ENABLE_TMPFILES'], 'tmpfiles',
['hwdb', 'ENABLE_HWDB'], 'hwdb',
['rfkill', 'ENABLE_RFKILL'], 'rfkill',
['ldconfig', 'ENABLE_LDCONFIG'], 'ldconfig',
['efi', 'ENABLE_EFI'], 'efi',
['tpm', 'ENABLE_TPM'], 'tpm',
['ima', 'ENABLE_IMA'], 'ima',
['smack', 'ENABLE_SMACK'], 'smack',
['gshadow', 'ENABLE_GSHADOW'], 'gshadow',
['idn', 'ENABLE_IDN'], 'idn',
['nss-systemd', 'ENABLE_NSS_SYSTEMD'], 'nss-systemd']
] have = get_option(term)
name = 'ENABLE_' + term.underscorify().to_upper()
have = get_option(pair[0]) conf.set10(name, have)
conf.set10(pair[1], have) m4_defines += have ? ['-D' + name] : []
m4_defines += have ? ['-D' + pair[1]] : []
endforeach endforeach
want_tests = get_option('tests') want_tests = get_option('tests')