diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index c31f27f350..9d5ad54719 100644 --- a/configure.ac +++ b/configure.ac @@ -376,6 +376,50 @@ elif test "$hostname_persist" = gentoo; then AC_DEFINE(HOSTNAME_PERSIST_GENTOO, 1, [Enable Gentoo hostname persist method]) fi +AC_ARG_WITH(systemd-journal, AS_HELP_STRING([--with-systemd-journal=yes|no], [Use systemd journal for logging])) +have_systemd_journal=no +if test "$with_systemd_journal" != "no"; then + PKG_CHECK_MODULES(SYSTEMD_JOURNAL, + [libsystemd >= 209], + [have_systemd_journal=yes], + [PKG_CHECK_MODULES(SYSTEMD_JOURNAL, + [libsystemd-journal], + [have_systemd_journal=yes], + [have_systemd_journal=no])]) + if test "$have_systemd_journal" != "yes"; then + if test "$with_systemd_journal" = "yes"; then + AC_MSG_ERROR([Missing systemd-journald support]) + fi + fi +fi +if test "$have_systemd_journal" = "yes"; then + AC_SUBST(SYSTEMD_JOURNAL_CFLAGS) + AC_SUBST(SYSTEMD_JOURNAL_LIBS) + AC_DEFINE([SYSTEMD_JOURNAL], 1, [Define to 1 if libsystemd-journald is available]) +else + AC_DEFINE([SYSTEMD_JOURNAL], 0, [Define to 1 if libsystemd-journald is available]) +fi + +AC_ARG_WITH(config-logging-backend-default, AS_HELP_STRING([--with-logging-backend-default=backend], [Default value for logging.backend]), nm_config_logging_backend_default="$withval", nm_config_logging_backend_default="") +if test "$nm_config_logging_backend_default" != 'debug' \ + -a "$nm_config_logging_backend_default" != 'syslog' \ + -a "$nm_config_logging_backend_default" != 'journal' \ + -a "$nm_config_logging_backend_default" != 'journal-syslog-style'; then + # unknown backend. Reset to default. Silently accept the invalid value to + # be future proof. + nm_config_logging_backend_default='' +fi +if test "$nm_config_logging_backend_default" = ""; then + if test "$have_systemd_journal" = "yes"; then + nm_config_logging_backend_default='journal-syslog-style' + else + nm_config_logging_backend_default='syslog' + fi +fi +AC_DEFINE_UNQUOTED(NM_CONFIG_LOGGING_BACKEND_DEFAULT, "$nm_config_logging_backend_default", [Default configuration option for logging.backend]) +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT="$nm_config_logging_backend_default" +AC_SUBST(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT) + # Session tracking support AC_ARG_WITH(systemd-logind, AS_HELP_STRING([--with-systemd-logind=yes|no], [Support systemd session tracking])) @@ -1091,6 +1135,7 @@ else fi echo " polkit agent: ${enable_polkit_agent}" echo " selinux: $have_selinux" +echo " systemd-journald: $have_systemd_journal (logging.backend: ${nm_config_logging_backend_default})" echo " hostname persist: ${hostname_persist}" echo |