2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([dlog], [1.0], yk.yun@samsung.com)
6 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
11 # Checks for programs.
14 AC_PROG_GCC_TRADITIONAL
17 __dlog_backends_selected=0
20 AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
21 [with_systemd_journal=yes],
22 with_systemd_journal=no)
23 if test "x$with_systemd_journal" != "xno"; then
24 PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal],
25 [AC_DEFINE(DLOG_BACKEND_JOURNAL, 1, [Define if systemd journal is selected])
26 have_systemd_journal=yes],
27 have_systemd_journal=no)
28 if test "x$have_systemd_journal" = "xno" -a "x$with_systemd_journal" = "xyes"; then
29 AC_MSG_ERROR([systemd journal requested but libraries not found])
31 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
34 AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
37 AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe (log to pipe fd received via unix socket)]),
40 if test "x$with_pipe" = "xyes"; then
41 AC_DEFINE(DLOG_BACKEND_PIPE, 1, [Define if pipe backend is selected])
42 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
44 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
46 # backend: kmsg (requires kernel patch)
47 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
50 if test "x$with_kmsg" = "xyes"; then
51 AC_DEFINE(DLOG_BACKEND_KMSG, 1, [Define if kmsg backend is selected])
52 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
54 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
56 # backend: android logger (requires kernel's CONFIG_ANDROID_LOGGER)
57 AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger (kernels CONFIG_ANDROID_LOGGER)]),
58 [with_android_logger=yes],
59 with_android_logger=no)
60 if test "x$with_android_logger" = "xyes"; then
61 AC_DEFINE(DLOG_BACKEND_LOGGER, 1, [Define if (legacy) android logger backend is selected])
62 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
64 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
66 if test $__dlog_backends_selected -ne 1; then
67 AC_MSG_ERROR([Exactly one backend needs to be selected.])
70 # check binary type for dlog debug mode
71 AC_ARG_ENABLE([debug_mode],
72 AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
75 if test "x$debug_mode" = "xyes" ; then
76 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
78 AC_ARG_ENABLE([debug_enable],
79 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
83 AC_ARG_ENABLE([fatal_on],
84 AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
87 if test "x$fatal_on" = "xyes" ; then
88 DEBUG_CFLAGS+=" -DFATAL_ON"
90 AC_SUBST(DEBUG_CFLAGS)
91 # Checks for libraries.
92 # Checks for header files.
94 AC_CHECK_HEADERS([stdlib.h unistd.h ])
96 # Checks for typedefs, structures, and compiler characteristics.
105 # Checks for library functions.
108 AC_CHECK_FUNCS([memset])
111 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
116 AC_CONFIG_FILES([Makefile dlog.pc])