From d222e82d83cf7e6ff0bce550f89d4639e70414e0 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 3 Aug 2018 09:06:39 +0200 Subject: [PATCH] Add --with-syslogd-pidfile=FILE configure option This enables the same functionality as the old build system, only slightly more flexible since you don't need to edit the Makefile. Signed-off-by: Joachim Nilsson --- configure.ac | 10 ++++++++++ src/Makefile.am | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c561dc6..754775f 100644 --- a/configure.ac +++ b/configure.ac @@ -32,10 +32,20 @@ AC_ARG_WITH(klogd-delay, AS_HELP_STRING([--with-klogd-delay=SEC], [when started at the same time as syslogd, default: 0]), [klogd_delay=$withval], [klogd_delay='no']) +AC_ARG_WITH(syslogd-pidfile, + AS_HELP_STRING([--with-syslogd-pidfile=FILE], [custom PID file, default: syslogd.pid]), + [syslogd_pidfile=$withval], [syslogd_pidfile='no']) + AS_IF([test "x$klogd_delay" != "xno"],[ AS_IF([test "x$klogd_delay" = "xyes"],[ AC_MSG_ERROR([Must supply argument])]) ] AC_DEFINE_UNQUOTED(KLOGD_DELAY, $klogd_delay, [Delay klogd startup N seconds, default: 0])) +AS_IF([test "x$syslogd_pidfile" != "xno"],[ + AS_IF([test "x$syslogd_pidfile" = "xyes"],[ + AC_MSG_ERROR([Must supply argument])]) + ] + AC_DEFINE_UNQUOTED(SYSLOGD_PIDNAME, "$syslogd_pidfile", [Custom syslogd PID file])) + AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index ccb2ed9..186268c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,8 +21,7 @@ sbin_PROGRAMS = syslogd klogd AM_CFLAGS = -fomit-frame-pointer -fno-strength-reduce -Wno-unused-result syslogd_SOURCES = syslogd.c pidfile.c pidfile.h -syslogd_CPPFLAGS = -DSYSV -DFSSTND -DSYSLOG_INET -DINET6 -DNO_SCCS \ - -DSYSLOG_UNIXAF -DSYSLOGD_PIDNAME=\"syslogd.pid\" +syslogd_CPPFLAGS = -DSYSV -DFSSTND -DSYSLOG_INET -DINET6 -DNO_SCCS -DSYSLOG_UNIXAF klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \ ksym.c ksyms.h ksym_mod.c module.h