2019-11-03 21:51:06 +05:30
|
|
|
# Copyright (c) 2018-2019 Joachim Nilsson <troglobit@gmail.com>
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-11-03 21:51:06 +05:30
|
|
|
# This file is part of the sysklogd package, a kernel and system log daemon.
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-11-03 21:51:06 +05:30
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-11-03 21:51:06 +05:30
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-11-03 21:51:06 +05:30
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2018-08-03 01:53:26 +05:30
|
|
|
|
2019-10-12 22:22:04 +05:30
|
|
|
AC_INIT([sysklogd], [2.0-beta1], [https://github.com/troglobit/sysklogd/issues],,
|
|
|
|
[https://github.com/troglobit/sysklogd])
|
2019-11-03 20:23:36 +05:30
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
|
|
|
|
LT_INIT([pic-only])
|
2018-08-03 01:53:26 +05:30
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
|
2019-11-03 22:00:59 +05:30
|
|
|
AC_CONFIG_MACRO_DIRS([m4])
|
2018-08-03 01:53:26 +05:30
|
|
|
AC_CONFIG_SRCDIR([src/syslogd.c])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
2019-10-29 15:38:23 +05:30
|
|
|
AC_CONFIG_FILES([Makefile
|
2019-11-05 12:43:55 +05:30
|
|
|
example/Makefile
|
2019-10-29 15:38:23 +05:30
|
|
|
man/Makefile
|
|
|
|
src/Makefile
|
2019-10-31 13:09:09 +05:30
|
|
|
src/libsyslog.pc
|
2019-10-29 15:38:23 +05:30
|
|
|
test/Makefile
|
|
|
|
klogd.service
|
|
|
|
syslogd.service])
|
2018-08-03 01:53:26 +05:30
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
2018-08-05 22:45:44 +05:30
|
|
|
# Check for required packages
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
2019-10-25 17:54:35 +05:30
|
|
|
# Check for usually missing API's, which we can replace
|
2019-11-03 01:27:07 +05:30
|
|
|
AC_REPLACE_FUNCS([pidfile strlcpy strlcat utimensat])
|
2019-10-25 17:54:35 +05:30
|
|
|
AC_CONFIG_LIBOBJ_DIR([lib])
|
|
|
|
|
2019-11-04 15:25:52 +05:30
|
|
|
# Check for other library functions
|
|
|
|
AC_CHECK_FUNCS([getprogname strtobytes])
|
|
|
|
|
2019-10-25 17:54:35 +05:30
|
|
|
# Command line options
|
2018-09-25 13:40:28 +05:30
|
|
|
AC_ARG_WITH(suspend-time,
|
|
|
|
AS_HELP_STRING([--with-suspend-time=SEC], [Retry timeout for remote syslogd servers, default: 180]),
|
|
|
|
[suspend_time=$withval], [suspend_time='no'])
|
|
|
|
|
2018-08-03 12:16:04 +05:30
|
|
|
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'])
|
|
|
|
|
2018-08-03 12:36:39 +05:30
|
|
|
AC_ARG_WITH(syslogd-pidfile,
|
|
|
|
AS_HELP_STRING([--with-syslogd-pidfile=FILE], [custom PID file, default: syslogd.pid]),
|
|
|
|
[syslogd_pidfile=$withval], [syslogd_pidfile='no'])
|
|
|
|
|
2018-08-05 22:45:44 +05:30
|
|
|
AC_ARG_WITH(systemd,
|
|
|
|
[AS_HELP_STRING([--with-systemd=DIR], [Directory for systemd service files])],,
|
|
|
|
[with_systemd=auto])
|
|
|
|
|
2018-09-25 13:40:28 +05:30
|
|
|
AS_IF([test "x$suspend_time" != "xno"],[
|
|
|
|
AS_IF([test "x$suspend_time" = "xyes"],[
|
|
|
|
AC_MSG_ERROR([Must supply argument])])
|
|
|
|
]
|
|
|
|
AC_DEFINE_UNQUOTED(INET_SUSPEND_TIME, $suspend_time, [Retry timeout for remote syslgod servers, default: 180]))
|
|
|
|
|
2018-08-03 12:16:04 +05:30
|
|
|
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]))
|
|
|
|
|
2018-08-03 12:36:39 +05:30
|
|
|
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]))
|
|
|
|
|
2018-08-05 22:45:44 +05:30
|
|
|
# Check where to install the systemd .service file
|
|
|
|
AS_IF([test "x$with_systemd" = "xyes" -o "x$with_systemd" = "xauto"], [
|
|
|
|
def_systemd=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
|
|
|
AS_IF([test "x$def_systemd" = "x"],
|
|
|
|
[AS_IF([test "x$with_systemd" = "xyes"],
|
|
|
|
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
|
|
|
|
with_systemd=no], [with_systemd="$def_systemd"])]
|
|
|
|
)
|
|
|
|
AS_IF([test "x$with_systemd" != "xno"],
|
|
|
|
[AC_SUBST([systemddir], [$with_systemd])])
|
|
|
|
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" != "xno"])
|
|
|
|
|
|
|
|
# Expand $sbindir early, into $SBINDIR, for systemd unit file
|
|
|
|
# NOTE: This does *not* take prefix/exec_prefix override at "make
|
|
|
|
# install" into account, unfortunately.
|
|
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
|
|
SBINDIR=`eval echo $sbindir`
|
|
|
|
SBINDIR=`eval echo $SBINDIR`
|
|
|
|
AC_SUBST(SBINDIR)
|
|
|
|
|
2018-08-03 01:53:26 +05:30
|
|
|
AC_OUTPUT
|