make nss-systemd support conditional (#6155)
authorWaldemar Brodkorb <wbx-github@users.noreply.github.com>
Sat, 24 Jun 2017 17:30:26 +0000 (19:30 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 24 Jun 2017 17:30:26 +0000 (13:30 -0400)
This allows the nss-systemd module to be disabled on minimal installations.

Makefile-man.am
Makefile.am
configure.ac
man/nss-systemd.xml
man/rules/meson.build
meson.build
meson_options.txt

index f21cc52..d51236e 100644 (file)
@@ -23,7 +23,6 @@ MANPAGES += \
        man/localtime.5 \
        man/machine-id.5 \
        man/machine-info.5 \
-       man/nss-systemd.8 \
        man/os-release.5 \
        man/sd-bus-errors.3 \
        man/sd-bus.3 \
@@ -259,7 +258,6 @@ MANPAGES_ALIAS += \
        man/SD_WARNING.3 \
        man/init.1 \
        man/journald.conf.d.5 \
-       man/libnss_systemd.so.2.8 \
        man/poweroff.8 \
        man/reboot.8 \
        man/sd_bus_creds_get_audit_login_uid.3 \
@@ -617,7 +615,6 @@ man/SD_NOTICE.3: man/sd-daemon.3
 man/SD_WARNING.3: man/sd-daemon.3
 man/init.1: man/systemd.1
 man/journald.conf.d.5: man/journald.conf.5
-man/libnss_systemd.so.2.8: man/nss-systemd.8
 man/poweroff.8: man/halt.8
 man/reboot.8: man/halt.8
 man/sd_bus_creds_get_audit_login_uid.3: man/sd_bus_creds_get_pid.3
@@ -1131,9 +1128,6 @@ man/init.html: man/systemd.html
 man/journald.conf.d.html: man/journald.conf.html
        $(html-alias)
 
-man/libnss_systemd.so.2.html: man/nss-systemd.html
-       $(html-alias)
-
 man/poweroff.html: man/halt.html
        $(html-alias)
 
@@ -2170,6 +2164,17 @@ man/systemd-networkd.html: man/systemd-networkd.service.html
 
 endif
 
+if ENABLE_NSS_SYSTEMD
+MANPAGES += \
+       man/nss-systemd.8
+MANPAGES_ALIAS += \
+       man/libnss_systemd.so.2.8
+man/libnss_systemd.so.2.8: man/nss-systemd.8
+man/libnss_systemd.so.2.html: man/nss-systemd.html
+       $(html-alias)
+
+endif
+
 if ENABLE_QUOTACHECK
 MANPAGES += \
        man/systemd-quotacheck.service.8
index 07b425e..4838df6 100644 (file)
@@ -5280,6 +5280,7 @@ manual_tests += \
        test-nss
 
 # ------------------------------------------------------------------------------
+if ENABLE_NSS_SYSTEMD
 libnss_systemd_la_SOURCES = \
        src/nss-systemd/nss-systemd.sym \
        src/nss-systemd/nss-systemd.c
@@ -5299,6 +5300,7 @@ libnss_systemd_la_LIBADD = \
 
 rootlib_LTLIBRARIES += \
        libnss_systemd.la
+endif
 
 # ------------------------------------------------------------------------------
 if HAVE_MYHOSTNAME
index 90e79d7..379f617 100644 (file)
@@ -1059,6 +1059,15 @@ fi
 AM_CONDITIONAL(ENABLE_IDN, [test "$have_idn" = "yes"])
 
 # ------------------------------------------------------------------------------
+have_nss_systemd=no
+AC_ARG_ENABLE(nss-systemd, AS_HELP_STRING([--disable-nss-systemd], [disable nss-systemd support]))
+if test "x$enable_nss_systemd" != "xno"; then
+        have_nss_systemd=yes
+        AC_DEFINE(ENABLE_NSS_SYSTEMD, [1], [nss-systemd is enabled])
+fi
+AM_CONDITIONAL(ENABLE_NSS_SYSTEMD, [test "$have_nss_systemd" = "yes"])
+
+# ------------------------------------------------------------------------------
 have_libiptc=no
 AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [disable optional LIBIPTC support]))
 if test "x$enable_libiptc" != "xno"; then
@@ -1801,6 +1810,7 @@ AC_MSG_RESULT([
         dbus:                              ${have_dbus}
         glib:                              ${have_glib}
         nss-myhostname:                    ${have_myhostname}
+        nss-systemd:                       ${have_nss_systemd}
         hwdb:                              ${enable_hwdb}
         tpm:                               ${have_tpm}
         Python:                            ${have_python}
index 71aed4d..34811f0 100644 (file)
@@ -21,7 +21,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="nss-systemd">
+<refentry id="nss-systemd" conditional='ENABLE_NSS_SYSTEMD'>
 
   <refentryinfo>
     <title>nss-systemd</title>
index 1508b01..9f7201a 100644 (file)
@@ -39,7 +39,7 @@ manpages = [
  ['nss-myhostname', '8', ['libnss_myhostname.so.2'], 'HAVE_MYHOSTNAME'],
  ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_MACHINED'],
  ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_RESOLVED'],
- ['nss-systemd', '8', ['libnss_systemd.so.2'], ''],
+ ['nss-systemd', '8', ['libnss_systemd.so.2'], 'ENABLE_NSS_SYSTEMD'],
  ['os-release', '5', [], ''],
  ['pam_systemd', '8', [], 'HAVE_PAM'],
  ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVED'],
index 301c8a9..be33ea1 100644 (file)
@@ -1014,6 +1014,7 @@ foreach pair : [['utmp',          'HAVE_UTMP'],
                 ['smack',         'HAVE_SMACK'],
                 ['gshadow',       'ENABLE_GSHADOW'],
                 ['idn',           'ENABLE_IDN'],
+                ['nss-systemd',   'ENABLE_NSS_SYSTEMD'],
                ]
 
         if get_option(pair[0])
@@ -1162,7 +1163,7 @@ test_dlopen = executable(
         dependencies : [libdl])
 
 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
-                 ['systemd',    ''               ],
+                 ['systemd',    'ENABLE_NSS_SYSTEMD'],
                  ['mymachines', 'ENABLE_MACHINED'],
                  ['resolve',    'ENABLE_RESOLVED']]
 
@@ -2455,6 +2456,7 @@ foreach tuple : [
         ['idn'],
         ['libidn2'],
         ['libidn'],
+        ['nss-systemd'],
         ['libiptc'],
         ['elfutils'],
         ['binfmt'],
index 0de2177..1594fec 100644 (file)
@@ -203,6 +203,8 @@ option('libidn2', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'libidn2 support')
 option('libidn', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'libidn support')
+option('nss-systemd', type : 'boolean',
+       description : 'enable nss-systemd')
 option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'libiptc support')
 option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],