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
18 AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
19 [with_systemd_journal=yes],
20 with_systemd_journal=no)
21 if test "x$with_systemd_journal" != "xno"; then
22 PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal],
23 [AC_DEFINE(DLOG_BACKEND_JOURNAL, 1, [Define if systemd journal is selected])
24 have_systemd_journal=yes],
25 have_systemd_journal=no)
26 if test "x$have_systemd_journal" = "xno" -a "x$with_systemd_journal" = "xyes"; then
27 AC_MSG_ERROR([systemd journal requested but libraries not found])
30 AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
33 AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe (log to pipe fd received via unix socket)]),
36 if test "x$with_pipe" = "xyes"; then
37 AC_DEFINE(DLOG_BACKEND_PIPE, 1, [Define if pipe backend is selected])
39 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
41 # backend: kmsg (requires kernel patch)
42 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
45 if test "x$with_kmsg" = "xyes"; then
46 AC_DEFINE(DLOG_BACKEND_KMSG, 1, [Define if kmsg backend is selected])
48 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
50 # backend: android logger (requires kernel's CONFIG_ANDROID_LOGGER)
51 AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger (kernels CONFIG_ANDROID_LOGGER)]),
52 [with_android_logger=yes],
53 with_android_logger=no)
54 if test "x$with_android_logger" = "xyes"; then
55 AC_DEFINE(DLOG_BACKEND_LOGGER, 1, [Define if (legacy) android logger backend is selected])
57 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
59 # check binary type for dlog debug mode
60 AC_ARG_ENABLE([debug_mode],
61 AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
64 if test "x$debug_mode" = "xyes" ; then
65 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
67 AC_ARG_ENABLE([debug_enable],
68 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
72 AC_ARG_ENABLE([fatal_on],
73 AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
76 if test "x$fatal_on" = "xyes" ; then
77 DEBUG_CFLAGS+=" -DFATAL_ON"
79 AC_SUBST(DEBUG_CFLAGS)
80 # Checks for libraries.
81 # Checks for header files.
83 AC_CHECK_HEADERS([stdlib.h unistd.h ])
85 # Checks for typedefs, structures, and compiler characteristics.
94 # Checks for library functions.
97 AC_CHECK_FUNCS([memset])
100 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
105 AC_CONFIG_FILES([Makefile dlog.pc])