File: syslog.m4

package info (click to toggle)
inn2 2.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,720 kB
  • ctags: 8,983
  • sloc: ansic: 92,499; sh: 13,509; perl: 12,921; makefile: 2,985; yacc: 842; python: 342; lex: 255
file content (43 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
dnl syslog.m4 -- Options and probes for syslog behavior.
dnl $Id: syslog.m4 8596 2009-08-21 08:30:01Z iulius $
dnl
dnl Normally, INN just logs everything to the news facility, but some systems
dnl don't have that so we have to probe and see if we should use local1
dnl instead.  And we also provide an option to change the facility to use.
dnl
dnl INN_LOG_FACILITY sets the output variable SYSLOG_FACILITY and also defines
dnl LOG_INN_SERVER and LOG_INN_PROG in config.h.

dnl Set up the --with-syslog-facility option.  The result is stored in the
dnl inn_syslog_facility variable for later use.
AC_DEFUN([INN_ARG_SYSLOG],
[AC_ARG_WITH([syslog-facility],
    [AS_HELP_STRING([--with-syslog-facility=LOG_FAC],
        [Syslog facility @<:@LOG_NEWS or LOG_LOCAL1@:>@])],
    SYSLOG_FACILITY=$with_syslog_facility,
    SYSLOG_FACILITY=none)])

dnl Source used by INN_LOG_FACILITY.
AC_DEFUN([_INN_LOG_FACILITY], [[
#include <syslog.h>
#ifndef LOG_NEWS
error:  LOG_NEWS not available!
#endif
]])

dnl Determine the facility for syslog messages.  Default to LOG_NEWS for
dnl syslog facility if it's available, but if it's not, fall back on
dnl LOG_LOCAL1.  Honor the existing SYSLOG_FACILITY value if already set by
dnl INN_ARG_SYSLOG.
AC_DEFUN([INN_LOG_FACILITY],
[AC_CACHE_CHECK([log facility for news], [inn_cv_log_facility],
    [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_INN_LOG_FACILITY])],
        [inn_cv_log_facility=LOG_NEWS],
        [inn_cv_log_facility=LOG_LOCAL1])])
 AS_IF([test x"$SYSLOG_FACILITY" = xnone],
    [SYSLOG_FACILITY=$inn_cv_log_facility])
 AC_DEFINE_UNQUOTED([LOG_INN_SERVER], [$SYSLOG_FACILITY],
    [Syslog facility to use for innd logs.])
 AC_DEFINE_UNQUOTED([LOG_INN_PROG], [$SYSLOG_FACILITY],
    [Syslog facility to use for INN program logs.])
 AC_SUBST(SYSLOG_FACILITY)])