From f7f731bf29f153b64c16a07d4bf30fd1a31252eb Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 28 Jul 2021 16:02:37 +0100 Subject: [PATCH] Add a flag to selectively enable includion of the startup script. --- Makefile.am | 2 ++ README.md | 4 ++-- configure.ac | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 906e01a..cb907f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,8 +19,10 @@ endif install-exec-hook: if BUILD_FOR_LINUX +if INSTALL_SYSTEMD_STARTUP [ -e $(DESTDIR)/lib/systemd/system ] || mkdir -p $(DESTDIR)/lib/systemd/system cp nqptp.service $(DESTDIR)/lib/systemd/system +endif endif # no installer for FreeBSD yet diff --git a/README.md b/README.md index a9e3c74..2bf1b74 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,11 @@ Note that you will need superuser privileges to install, enable and start the da $ git clone https://github.com/mikebrady/nqptp.git $ cd nqptp $ autoreconf -fi -$ ./configure +$ ./configure --with-systemd-startup $ make # make install ``` -The `make install` installs a `systemd` startup script. You should enable it and start it in the normal way: +The `make install` installs a `systemd` startup script as requested. You should enable it and start it in the normal way: ``` # systemctl enable nqptp diff --git a/configure.ac b/configure.ac index a4a97b6..92e597e 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,12 @@ if test -n "$GIT" && test -e ".git/index" ; then fi AM_CONDITIONAL([USE_GIT_VERSION], [test -n "$GIT" && test -e ".git/index" ]) + +# Check to see if we should include the systemd stuff to define it as a service +AC_ARG_WITH([systemd-startup],[AS_HELP_STRING([--with-systemd-startup],[install a systemd startup script during a make install])]) +AM_CONDITIONAL([INSTALL_SYSTEMD_STARTUP], [test "x$with_systemd_startup" = "xyes"]) + + AC_CONFIG_SRCDIR([nqptp.c]) AC_CONFIG_HEADERS([config.h]) -- 2.47.2