diff --git a/Makefile.in b/Makefile.in index 646c73d5..b8758482 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,6 +14,7 @@ libdir := @libdir@ includedir := @includedir@ sbindir := @sbindir@ localstatedir := @localstatedir@ +systemdsystemunitdir := @systemdsystemunitdir@ CXX := @CXX@ CXXFLAGS := -I$(srcdir)/include -Iinclude @CPPFLAGS@ @CXXFLAGS@ LDFLAGS := @LDFLAGS@ @@ -125,6 +126,9 @@ install: znc $(LIBZNC) fi @$(MAKE) -C man install DESTDIR=$(DESTDIR) + @HAVE_SYSTEMD_TRUE@test -d $(DESTDIR)$(systemdsystemunitdir) || $(INSTALL) -d $(DESTDIR)$(systemdsystemunitdir) + @HAVE_SYSTEMD_TRUE@$(INSTALL_DATA) znc.service $(DESTDIR)$(systemdsystemunitdir) + uninstall: rm $(DESTDIR)$(bindir)/znc rm $(DESTDIR)$(bindir)/znc-config diff --git a/configure.ac b/configure.ac index 8373756a..19786d1e 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,14 @@ AC_ARG_ENABLE([add-networks], AS_HELP_STRING([--enable-add-networks], [allow non-admins to add networks]), [ if test x"$enableval" = "xyes" ; then appendCXX "-DENABLE_ADD_NETWORK" ; fi ]) +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +if test "x$with_systemdsystemunitdir" != xno; then + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +fi +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) + if test "$DEBUG" != "no"; then appendCXX -ggdb3 AC_DEFINE([_DEBUG], [1], [Define for debugging])