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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2018-08-03 09:06:39 +02:00
parent 38651d9322
commit d222e82d83
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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