AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
+__dlog_backends_selected=0
+
# backend: journald
AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
[with_systemd_journal=yes],
have_systemd_journal=no)
if test "x$have_systemd_journal" = "xno" -a "x$with_systemd_journal" = "xyes"; then
AC_MSG_ERROR([systemd journal requested but libraries not found])
+ else
+ __dlog_backends_selected=$(($__dlog_backends_selected + 1))
fi
fi
AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
with_pipe=no)
if test "x$with_pipe" = "xyes"; then
AC_DEFINE(DLOG_BACKEND_PIPE, 1, [Define if pipe backend is selected])
+ __dlog_backends_selected=$(($__dlog_backends_selected + 1))
fi
AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
with_kmsg=no)
if test "x$with_kmsg" = "xyes"; then
AC_DEFINE(DLOG_BACKEND_KMSG, 1, [Define if kmsg backend is selected])
+ __dlog_backends_selected=$(($__dlog_backends_selected + 1))
fi
AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
with_android_logger=no)
if test "x$with_android_logger" = "xyes"; then
AC_DEFINE(DLOG_BACKEND_LOGGER, 1, [Define if (legacy) android logger backend is selected])
+ __dlog_backends_selected=$(($__dlog_backends_selected + 1))
fi
AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
+if test $__dlog_backends_selected -ne 1; then
+ AC_MSG_ERROR([Exactly one backend needs to be selected.])
+fi
+
# check binary type for dlog debug mode
AC_ARG_ENABLE([debug_mode],
AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),