summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-07-18 09:25:57 +0900
committerLukáš Nykrýn <lnykryn@redhat.com>2019-05-03 12:50:30 +0200
commit1a368abf7a3d72ecda504a69602b33b6869a485c (patch)
tree180400af8e62f57c49bdc7f498f743e239d7a2a8 /meson.build
parentc405c3035b595970e65ac9586909618525372c45 (diff)
downloadsystemd-1a368abf7a3d72ecda504a69602b33b6869a485c.tar.gz
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. (cherry picked from commit 08540a9591efe105439be81fc43d6dc65b715978) Resolves: #1696224
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 c1013d525b..863e8eb399 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
@@ -2943,7 +2969,6 @@ foreach tuple : [
['idn'],
['libidn2'],
['libidn'],
- ['nss-systemd'],
['libiptc'],
['elfutils'],
['binfmt'],
@@ -2978,7 +3003,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],