chiark / gitweb /
update TODO
[elogind.git] / Makefile.am
index 53167ff20ee31ad650ee9c27418f269b4b7870e4..b526183300f5b70d168659e2da44f1aa5cafd3f2 100644 (file)
@@ -19,6 +19,14 @@ ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = po
 
+LIBSYSTEMD_LOGIN_CURRENT=0
+LIBSYSTEMD_LOGIN_REVISION=1
+LIBSYSTEMD_LOGIN_AGE=0
+
+LIBSYSTEMD_DAEMON_CURRENT=0
+LIBSYSTEMD_DAEMON_REVISION=0
+LIBSYSTEMD_DAEMON_AGE=0
+
 # Dirs of external packages
 dbuspolicydir=@dbuspolicydir@
 dbussessionservicedir=@dbussessionservicedir@
@@ -27,6 +35,7 @@ dbusinterfacedir=@dbusinterfacedir@
 udevrulesdir=@udevrulesdir@
 pamlibdir=@pamlibdir@
 pkgconfigdatadir=$(datadir)/pkgconfig
+pkgconfiglibdir=$(libdir)/pkgconfig
 polkitpolicydir=$(datadir)/polkit-1/actions
 bashcompletiondir=$(sysconfdir)/bash_completion.d
 
@@ -35,6 +44,7 @@ pkgsysconfdir=$(sysconfdir)/systemd
 userunitdir=$(prefix)/lib/systemd/user
 tmpfilesdir=$(prefix)/lib/tmpfiles.d
 usergeneratordir=$(pkglibexecdir)/user-generators
+pkgincludedir=$(includedir)/systemd
 
 # And these are the special ones for /
 rootdir=@rootdir@
@@ -183,6 +193,14 @@ systemgenerator_PROGRAMS += \
        systemd-cryptsetup-generator
 endif
 
+lib_LTLIBRARIES = \
+       libsystemd-daemon.la \
+       libsystemd-login.la
+
+pkginclude_HEADERS = \
+       src/sd-daemon.h \
+       src/sd-login.h
+
 noinst_PROGRAMS = \
        test-engine \
        test-job-type \
@@ -192,7 +210,9 @@ noinst_PROGRAMS = \
        test-daemon \
        test-cgroup \
        test-env-replace \
-       test-strv
+       test-strv \
+        test-login \
+        test-install
 
 if HAVE_PAM
 pamlib_LTLIBRARIES = \
@@ -220,11 +240,11 @@ dist_dbussystemservice_DATA = \
 
 dist_udevrules_DATA = \
         src/70-uaccess.rules \
-        src/71-seat.rules \
-       src/99-systemd.rules
+        src/71-seat.rules
 
 nodist_udevrules_DATA = \
-        src/73-seat-late.rules
+        src/73-seat-late.rules \
+        src/99-systemd.rules
 
 dbusinterface_DATA = \
        org.freedesktop.systemd1.Manager.xml \
@@ -408,10 +428,15 @@ EXTRA_DIST = \
        units/fsck@.service.in \
        units/fsck-root.service.in \
        units/quotacheck.service.in \
-        units/user@.service.in \
+       units/user@.service.in \
        systemd.pc.in \
+       libsystemd-daemon.pc.in \
+       libsystemd-login.pc.in \
+       src/libsystemd-daemon.sym \
+       src/libsystemd-login.sym \
        introspect.awk \
-        src/73-seat-late.rules.in
+       src/73-seat-late.rules.in \
+        src/99-systemd.rules.in
 
 if ENABLE_BINFMT
 EXTRA_DIST += \
@@ -474,6 +499,10 @@ dist_doc_DATA = \
 pkgconfigdata_DATA = \
        systemd.pc
 
+pkgconfiglib_DATA = \
+        libsystemd-daemon.pc \
+        libsystemd-login.pc
+
 # Passed through intltool only
 polkitpolicy_in_files = \
         src/org.freedesktop.hostname1.policy.in \
@@ -497,8 +526,7 @@ EXTRA_DIST += \
 
 noinst_LTLIBRARIES = \
        libsystemd-basic.la \
-       libsystemd-core.la \
-       libsystemd-daemon.la
+       libsystemd-core.la
 
 libsystemd_basic_la_SOURCES = \
        src/util.c \
@@ -517,7 +545,8 @@ libsystemd_basic_la_CFLAGS = \
        $(SELINUX_CFLAGS)
 
 libsystemd_basic_la_LIBADD = \
-       $(SELINUX_LIBS)
+       $(SELINUX_LIBS) \
+       $(CAP_LIBS)
 
 libsystemd_core_la_SOURCES = \
        src/unit.c \
@@ -569,7 +598,8 @@ libsystemd_core_la_SOURCES = \
        src/cgroup-util.c \
        src/condition.c \
         src/dbus-common.c \
-        src/sd-daemon.c
+        src/sd-daemon.c \
+        src/install.c
 
 libsystemd_core_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -585,10 +615,8 @@ libsystemd_core_la_LIBADD = \
        $(UDEV_LIBS) \
        $(LIBWRAP_LIBS) \
        $(PAM_LIBS) \
-       $(AUDIT_LIBS)
-
-libsystemd_daemon_la_SOURCES = \
-       src/sd-daemon.c
+       $(AUDIT_LIBS) \
+       $(CAP_LIBS)
 
 # This is needed because automake is buggy in how it generates the
 # rules for C programs, but not Vala programs.  We therefore can't
@@ -626,7 +654,8 @@ EXTRA_DIST += \
         src/logind-session.h \
         src/logind-user.h \
         src/logind-acl.h \
-        src/dbus-loop.h
+        src/dbus-loop.h \
+        src/spawn-agent.h
 
 MANPAGES = \
        man/systemd.1 \
@@ -801,6 +830,29 @@ test_strv_CFLAGS = \
 test_strv_LDADD = \
        libsystemd-basic.la
 
+test_login_SOURCES = \
+       src/test-login.c
+
+test_login_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_login_LDADD = \
+       libsystemd-basic.la \
+        libsystemd-login.la
+
+test_install_SOURCES = \
+       src/test-install.c \
+        src/install.c \
+        src/path-lookup.c \
+        src/unit-name.c
+
+test_install_CFLAGS = \
+       $(AM_CFLAGS) \
+        $(DBUS_CFLAGS)
+
+test_install_LDADD = \
+       libsystemd-basic.la
+
 systemd_logger_SOURCES = \
        src/logger.c \
        src/tcpwrap.c
@@ -946,6 +998,8 @@ systemd_uaccess_CFLAGS = \
 
 systemd_uaccess_LDADD = \
        libsystemd-basic.la \
+       libsystemd-daemon.la \
+       libsystemd-login.la \
         $(UDEV_LIBS) \
         $(ACL_LIBS)
 
@@ -1156,7 +1210,9 @@ systemctl_SOURCES = \
        src/cgroup-util.c \
        src/exit-status.c \
        src/unit-name.c \
-        src/pager.c
+        src/pager.c \
+        src/install.c \
+        src/spawn-agent.c
 
 systemctl_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1339,6 +1395,61 @@ pam_systemd_la_LIBADD = \
        $(PAM_LIBS) \
         $(DBUS_LIBS)
 
+libsystemd_daemon_la_SOURCES = \
+       src/sd-daemon.c
+
+libsystemd_daemon_la_CFLAGS = \
+        $(AM_CFLAGS) \
+       -fvisibility=hidden \
+        -DSD_EXPORT_SYMBOLS
+
+libsystemd_daemon_la_LDFLAGS = \
+        -shared \
+        -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
+        -Wl,--version-script=$(top_srcdir)/src/libsystemd-daemon.sym
+
+# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
+libsystemd-daemon-install-hook:
+       if test "$(libdir)" != "$(rootlibdir)"; then \
+               mkdir -p $(DESTDIR)$(rootlibdir) && \
+               so_img_name=$$(readlink $(DESTDIR)$(libdir)/libsystemd-daemon.so) && \
+               so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+               ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libsystemd-daemon.so && \
+               mv $(DESTDIR)$(libdir)/libsystemd-daemon.so.* $(DESTDIR)$(rootlibdir); \
+       fi
+
+libsystemd-daemon-uninstall-hook:
+       rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
+
+libsystemd_login_la_SOURCES = \
+        src/sd-login.c \
+        src/cgroup-util.c
+
+libsystemd_login_la_CFLAGS = \
+        $(AM_CFLAGS) \
+       -fvisibility=hidden
+
+libsystemd_login_la_LDFLAGS = \
+        -shared \
+        -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
+        -Wl,--version-script=$(top_srcdir)/src/libsystemd-login.sym
+
+libsystemd_login_la_LIBADD = \
+       libsystemd-basic.la
+
+# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
+libsystemd-login-install-hook:
+       if test "$(libdir)" != "$(rootlibdir)"; then \
+               mkdir -p $(DESTDIR)$(rootlibdir) && \
+               so_img_name=$$(readlink $(DESTDIR)$(libdir)/libsystemd-login.so) && \
+               so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+               ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libsystemd-login.so && \
+               mv $(DESTDIR)$(libdir)/libsystemd-login.so.* $(DESTDIR)$(rootlibdir); \
+       fi
+
+libsystemd-login-uninstall-hook:
+       rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
+
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
        $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
@@ -1355,6 +1466,9 @@ SED_PROCESS = \
                -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
                -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
                -e 's,@prefix\@,$(prefix),g' \
+               -e 's,@exec_prefix\@,$(exec_prefix),g' \
+               -e 's,@libdir\@,$(libdir),g' \
+               -e 's,@includedir\@,$(includedir),g' \
                < $< > $@ || rm $@
 
 units/%: units/%.in Makefile
@@ -1392,8 +1506,10 @@ CLEANFILES = \
        $(nodist_man_MANS) \
        ${XML_IN_FILES:.xml.in=.html} \
        $(pkgconfigdata_DATA) \
+       $(pkgconfiglib_DATA) \
        $(nodist_polkitpolicy_DATA) \
-        src/73-seat-late.rules
+        src/73-seat-late.rules \
+        src/99-systemd.rules
 
 if HAVE_VALAC
 CLEANFILES += \
@@ -1469,22 +1585,22 @@ endif
 DBUS_PREPROCESS = $(CPP) -P $(DBUS_CFLAGS) -imacros dbus/dbus-protocol.h
 
 org.freedesktop.systemd1.%.xml: systemd
-       $(AM_V_GEN)$(OBJCOPY) -O binary -j introspect.$* $< $@.tmp && \
+       $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.$* $< $@.tmp && \
                $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
                $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
 
 org.freedesktop.hostname1.xml: systemd-hostnamed
-       $(AM_V_GEN)$(OBJCOPY) -O binary -j introspect.hostname1 $< $@.tmp && \
+       $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.hostname1 $< $@.tmp && \
                $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
                $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
 
 org.freedesktop.locale1.xml: systemd-localed
-       $(AM_V_GEN)$(OBJCOPY) -O binary -j introspect.locale1 $< $@.tmp && \
+       $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.locale1 $< $@.tmp && \
                $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
                $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
 
 org.freedesktop.timedate1.xml: systemd-timedated
-       $(AM_V_GEN)$(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
+       $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
                $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
                $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
 
@@ -1748,6 +1864,10 @@ if HAVE_SYSV_COMPAT
                $(LN_S) ../var-lock.mount var-lock.mount )
 endif
 
+install-exec-hook: libsystemd-daemon-install-hook libsystemd-login-install-hook
+
+uninstall-hook: libsystemd-daemon-uninstall-hook libsystemd-login-uninstall-hook
+
 DISTCHECK_CONFIGURE_FLAGS = \
        --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
        --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \