endforeach
foreach header : [
+ 'gshadow.h',
+ 'nss.h',
'sys/sdt.h',
'threads.h',
'valgrind/memcheck.h',
cc.has_header(header))
endforeach
+foreach ident : [
+ ['NI_IDN', 'netdb.h']
+ ]
+
+ if meson.version().version_compare('>=1.3.0')
+ have = cc.has_define(ident[0],
+ prefix : '''#include <@0@>'''.format(ident[1]),
+ args : '-D_GNU_SOURCE')
+ else
+ have = cc.has_header_symbol(ident[1], ident[0])
+ endif
+ conf.set10('HAVE_' + ident[0], have)
+endforeach
+
#####################################################################
fallback_hostname = get_option('fallback-hostname')
conf.set10('DEFAULT_MOUNTFSD_TRUSTED_DIRECTORIES', get_option('default-mountfsd-trusted-directories'))
-foreach term : ['analyze',
- 'backlight',
- 'binfmt',
- 'compat-mutable-uid-boundaries',
- 'coredump',
- 'efi',
- 'environment-d',
- 'firstboot',
- 'gshadow',
- 'hibernate',
- 'hostnamed',
- 'hwdb',
- 'idn',
- 'ima',
- 'ipe',
- 'initrd',
- 'kernel-install',
- 'ldconfig',
- 'localed',
- 'logind',
- 'machined',
- 'mountfsd',
- 'networkd',
- 'nsresourced',
- 'nss-myhostname',
- 'nss-systemd',
- 'oomd',
- 'portabled',
- 'pstore',
- 'quotacheck',
- 'randomseed',
- 'resolve',
- 'rfkill',
- 'smack',
- 'sysext',
- 'sysusers',
- 'timedated',
- 'timesyncd',
- 'tmpfiles',
- 'tpm',
- 'userdb',
- 'utmp',
- 'vconsole',
- 'xdg-autostart']
- have = get_option(term)
- name = 'ENABLE_' + term.underscorify().to_upper()
+foreach tuple : [
+ ['analyze'],
+ ['backlight'],
+ ['binfmt'],
+ ['compat-mutable-uid-boundaries'],
+ ['coredump'],
+ ['efi'],
+ ['environment-d'],
+ ['firstboot'],
+ ['gshadow', conf.get('HAVE_GSHADOW_H') == 1, 'gshadow.h not found'],
+ ['hibernate'],
+ ['hostnamed'],
+ ['hwdb'],
+ ['idn', conf.get('HAVE_NI_IDN') == 1, 'NI_IDN is not defined'],
+ ['ima'],
+ ['ipe'],
+ ['initrd'],
+ ['kernel-install'],
+ ['ldconfig'],
+ ['localed'],
+ ['logind'],
+ ['machined'],
+ ['mountfsd'],
+ ['networkd'],
+ ['nsresourced'],
+ ['nss-myhostname', conf.get('HAVE_NSS_H') == 1, 'nss.h not found'],
+ ['nss-systemd', conf.get('HAVE_NSS_H') == 1, 'nss.h not found'],
+ ['oomd'],
+ ['portabled'],
+ ['pstore'],
+ ['quotacheck'],
+ ['randomseed'],
+ ['resolve'],
+ ['rfkill'],
+ ['smack'],
+ ['sysext'],
+ ['sysusers'],
+ ['timedated'],
+ ['timesyncd'],
+ ['tmpfiles'],
+ ['tpm'],
+ ['utmp'],
+ ['userdb'],
+ ['vconsole'],
+ ['xdg-autostart'],
+ ]
+
+ have = get_option(tuple[0])
+ if have and tuple.length() >= 3 and not tuple[1]
+ warning('@0@ support is requested but @1@, disabling it'.format(tuple[0], tuple[2]))
+ have = false
+ endif
+
+ name = 'ENABLE_' + tuple[0].underscorify().to_upper()
conf.set10(name, have)
endforeach
foreach tuple : [['nss-mymachines', 'machined'],
['nss-resolve', 'resolve']]
want = get_option(tuple[0])
- if want.allowed()
- have = get_option(tuple[1])
- if want.enabled() and not have
+ if want.enabled()
+ if conf.get('HAVE_NSS_H') != 1
+ error('@0@ is requested but nss.h not found'.format(tuple[0]))
+ endif
+ if not get_option(tuple[1])
error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
endif
+ have = true
+ elif want.allowed()
+ have = get_option(tuple[1]) and conf.get('HAVE_NSS_H') == 1
else
have = false
endif