chiark / gitweb /
nss-myhostname: integrate into systemd buildsystem
[elogind.git] / Makefile.am
index 6daf960a83e2bd728b1fa312fcbf6b81f48bc75a..91bc49dc5bdcc14dc8bb447f0b436223562cc240 100644 (file)
@@ -168,7 +168,7 @@ AM_LDFLAGS = $(OUR_LDFLAGS)
 
 # ------------------------------------------------------------------------------
 
-define move-to-rootlibdir =
+define move-to-rootlibdir
        if test "$(libdir)" != "$(rootlibdir)"; then \
                $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
                so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
@@ -3549,6 +3549,27 @@ pamlib_LTLIBRARIES = \
        pam_systemd.la
 endif
 
+if HAVE_MYHOSTNAME
+libnss_myhostname_la_SOURCES = \
+       src/nss-myhostname/nss-myhostname.c \
+       src/nss-myhostname/ifconf.h \
+       src/nss-myhostname/netlink.c
+
+libnss_myhostname_la_CFLAGS = \
+       $(AM_CFLAGS)
+
+libnss_myhostname_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -module \
+       -export-dynamic \
+       -avoid-version \
+       -shared \
+       -shrext .so.2
+
+lib_LTLIBRARIES += \
+       libnss_myhostname.la
+endif
+
 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
 libsystemd-login-install-hook:
        libname=libsystemd-login.so && $(move-to-rootlibdir)