2023-04-30 23:36:33 +05:30
|
|
|
# Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
|
2019-12-07 15:27:12 +05:30
|
|
|
# All rights reserved.
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-12-07 15:27:12 +05:30
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
# 3. Neither the name of the University nor the names of its contributors
|
|
|
|
# may be used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
2018-08-03 01:53:26 +05:30
|
|
|
#
|
2019-12-07 15:27:12 +05:30
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
2018-08-03 01:53:26 +05:30
|
|
|
|
2023-04-22 12:29:35 +05:30
|
|
|
AC_INIT([sysklogd], [2.5.0-rc1], [https://github.com/troglobit/sysklogd/issues],,
|
2021-11-17 11:21:45 +05:30
|
|
|
[https://github.com/troglobit/sysklogd])
|
2019-12-09 22:37:50 +05:30
|
|
|
AC_CONFIG_AUX_DIR(aux)
|
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
|
|
|
|
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])
|
|
|
|
|
2021-11-22 19:01:33 +05:30
|
|
|
# Check for utmp.h
|
|
|
|
AC_CHECK_HEADERS([utmp.h])
|
|
|
|
|
|
|
|
# Check for fork()
|
|
|
|
AC_CHECK_FUNCS([fork])
|
|
|
|
|
|
|
|
# Check for setsid()
|
|
|
|
AC_CHECK_FUNCS([setsid])
|
|
|
|
|
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
|
2019-11-12 20:21:33 +05:30
|
|
|
AC_ARG_WITH(suspend-time,
|
2019-11-13 16:22:15 +05:30
|
|
|
AS_HELP_STRING([--with-suspend-time=SEC], [Retry delay for sending to remote, default: 180]),
|
2019-11-12 20:21:33 +05:30
|
|
|
[suspend_time=$withval], [suspend_time='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])
|
|
|
|
|
2019-11-18 16:38:26 +05:30
|
|
|
AC_ARG_WITH(logger,
|
2019-11-18 22:24:35 +05:30
|
|
|
AS_HELP_STRING([--without-logger], [Build without extended logger tool, default: enabled]),
|
2019-11-18 16:38:26 +05:30
|
|
|
[logger=$withval], [logger='yes'])
|
|
|
|
|
2019-11-18 22:24:35 +05:30
|
|
|
AS_IF([test "x$logger" != "xno"], with_logger="yes", with_logger="no")
|
|
|
|
AM_CONDITIONAL([ENABLE_LOGGER], [test "x$with_logger" != "xno"])
|
|
|
|
|
2019-11-12 20:21:33 +05:30
|
|
|
AS_IF([test "x$suspend_time" != "xno"],[
|
|
|
|
AS_IF([test "x$suspend_time" = "xyes"],[
|
|
|
|
AC_MSG_ERROR([Must supply argument])])
|
|
|
|
]
|
2019-11-13 16:22:15 +05:30
|
|
|
AC_DEFINE_UNQUOTED(INET_SUSPEND_TIME, $suspend_time, [Retry delay for sending to remote syslog servers, default: 180]),
|
2019-11-12 20:21:33 +05:30
|
|
|
suspend_time=180)
|
2018-08-03 12:16:04 +05:30
|
|
|
|
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])])
|
2019-11-18 22:24:35 +05:30
|
|
|
with_systemd=no], [with_systemd="$def_systemd"])])
|
2018-08-05 22:45:44 +05:30
|
|
|
AS_IF([test "x$with_systemd" != "xno"],
|
|
|
|
[AC_SUBST([systemddir], [$with_systemd])])
|
|
|
|
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" != "xno"])
|
|
|
|
|
2021-02-21 17:37:56 +05:30
|
|
|
# Expand $sbindir and @$sysconfdir early, for systemd unit file
|
2018-08-05 22:45:44 +05:30
|
|
|
# NOTE: This does *not* take prefix/exec_prefix override at "make
|
|
|
|
# install" into account, unfortunately.
|
2021-01-27 12:14:03 +05:30
|
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
2018-08-05 22:45:44 +05:30
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
|
|
SBINDIR=`eval echo $sbindir`
|
|
|
|
SBINDIR=`eval echo $SBINDIR`
|
|
|
|
AC_SUBST(SBINDIR)
|
2021-02-21 17:37:56 +05:30
|
|
|
SYSCONFDIR=`eval echo $sysconfdir`
|
|
|
|
AC_SUBST(SYSCONFDIR)
|
2018-08-05 22:45:44 +05:30
|
|
|
|
2019-11-27 02:12:36 +05:30
|
|
|
# Workaround for as-of-yet unreleased runstatedir support, planned for
|
|
|
|
# autoconf 2.70, which some major distros have backported.
|
|
|
|
AS_IF([test -z "$runstatedir"], runstatedir="$localstatedir/run")
|
|
|
|
AC_SUBST(runstatedir)
|
|
|
|
|
2018-08-03 01:53:26 +05:30
|
|
|
AC_OUTPUT
|
2019-11-12 20:21:33 +05:30
|
|
|
|
2019-11-25 16:44:18 +05:30
|
|
|
# Expand directories for configuration summary, unexpanded defaults:
|
|
|
|
# runstatedir => ${localstatedir}/run
|
|
|
|
RUNSTATEDIR=`eval echo $runstatedir`
|
|
|
|
RUNSTATEDIR=`eval echo $RUNSTATEDIR`
|
|
|
|
|
2019-11-12 20:21:33 +05:30
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
------------------ Summary ------------------
|
|
|
|
$PACKAGE_NAME version $PACKAGE_VERSION
|
|
|
|
Prefix.........: $prefix
|
2019-11-25 16:44:18 +05:30
|
|
|
Sysconfdir.....: $SYSCONFDIR
|
|
|
|
Runstatedir....: $RUNSTATEDIR
|
2019-11-12 20:21:33 +05:30
|
|
|
C Compiler.....: $CC $CFLAGS $CPPFLAGS $LDFLAGS $LIBS
|
|
|
|
|
|
|
|
Optional features:
|
2019-11-18 22:24:35 +05:30
|
|
|
logger.........: $with_logger
|
2019-11-12 20:21:33 +05:30
|
|
|
suspend time...: $suspend_time sec
|
|
|
|
systemd........: $with_systemd
|
|
|
|
|
|
|
|
------------- Compiler version --------------
|
|
|
|
$($CC --version || true)
|
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
Check the above options and compile with:
|
|
|
|
${MAKE-make}
|
|
|
|
|
|
|
|
EOF
|