summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-07-18 02:25:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-07-23 14:03:05 +0200
commit08540a9591efe105439be81fc43d6dc65b715978 (patch)
treef8de726a1c697826b93d530280bf1ca88e53c899 /meson.build
parentmeson: drop redundant messages (diff)
downloadsystemd-08540a9591efe105439be81fc43d6dc65b715978.tar.xz
systemd-08540a9591efe105439be81fc43d6dc65b715978.zip
meson: allow building resolved and machined without nss modules
This adds -Dnss-resolve= and -Dnss-mymachines= meson options. By using this option, e.g., resolved can be built without nss-resolve. When no nss modules are built, then test-nss is neither built. Also, This changes the option name -Dmyhostname= to -Dnss-myhostname= for consistency to other nss related options. Closes #9596.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build40
1 files changed, 34 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index 910e73406f..e72d8c685a 100644
--- a/meson.build
+++ b/meson.build
@@ -1216,7 +1216,6 @@ foreach term : ['utmp',
'networkd',
'timedated',
'timesyncd',
- 'myhostname',
'firstboot',
'randomseed',
'backlight',
@@ -1233,12 +1232,39 @@ foreach term : ['utmp',
'smack',
'gshadow',
'idn',
+ 'nss-myhostname',
'nss-systemd']
have = get_option(term)
name = 'ENABLE_' + term.underscorify().to_upper()
conf.set10(name, have)
endforeach
+foreach tuple : [['nss-mymachines', 'machined'],
+ ['nss-resolve', 'resolve']]
+ want = get_option(tuple[0])
+ if want != 'false'
+ have = get_option(tuple[1])
+ if want == 'true' and not have
+ error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
+ endif
+ else
+ have = false
+ endif
+ name = 'ENABLE_' + tuple[0].underscorify().to_upper()
+ conf.set10(name, have)
+endforeach
+
+enable_nss = false
+foreach term : ['ENABLE_NSS_MYHOSTNAME',
+ 'ENABLE_NSS_MYMACHINES',
+ 'ENABLE_NSS_RESOLVE',
+ 'ENABLE_NSS_SYSTEMD']
+ if conf.get(term) == 1
+ enable_nss = true
+ endif
+endforeach
+conf.set10('ENABLE_NSS', enable_nss)
+
conf.set10('ENABLE_TIMEDATECTL', get_option('timedated') or get_option('timesyncd'))
want_tests = get_option('tests')
@@ -1417,10 +1443,10 @@ test_dlopen = executable(
link_with : [libbasic],
dependencies : [libdl])
-foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
+foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
['systemd', 'ENABLE_NSS_SYSTEMD'],
- ['mymachines', 'ENABLE_MACHINED'],
- ['resolve', 'ENABLE_RESOLVE']]
+ ['mymachines', 'ENABLE_NSS_MYMACHINES'],
+ ['resolve', 'ENABLE_NSS_RESOLVE']]
condition = tuple[1] == '' or conf.get(tuple[1]) == 1
if condition
@@ -2946,7 +2972,6 @@ foreach tuple : [
['idn'],
['libidn2'],
['libidn'],
- ['nss-systemd'],
['libiptc'],
['elfutils'],
['binfmt'],
@@ -2981,7 +3006,10 @@ foreach tuple : [
['blkid'],
['dbus'],
['glib'],
- ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
+ ['nss-myhostname', conf.get('ENABLE_NSS_MYHOSTNAME') == 1],
+ ['nss-mymachines', conf.get('ENABLE_NSS_MYMACHINES') == 1],
+ ['nss-resolve', conf.get('ENABLE_NSS_RESOLVE') == 1],
+ ['nss-systemd', conf.get('ENABLE_NSS_SYSTEMD') == 1],
['hwdb'],
['tpm'],
['man pages', want_man],