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])
7 AC_CONFIG_HEADERS([config.h:config.hin])
12 # Checks for programs.
15 AC_PROG_GCC_TRADITIONAL
18 # check for libsystemd-journal
19 AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
20 [with_systemd_journal=yes],
21 with_systemd_journal=no)
24 AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe]),
28 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg]),
32 AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger]),
33 [with_android_logger=yes],
34 with_android_logger=no)
36 if test "x$with_systemd_journal" != "xno"; then
37 PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal],
38 [AC_DEFINE(HAVE_SYSTEMD_JOURNAL, 1, [Define if systemd journal is available])
39 have_systemd_journal=yes],
40 have_systemd_journal=no)
41 if test "x$have_systemd_journal" = "xno" -a "x$with_systemd_journal" = "xyes"; then
42 AC_MSG_ERROR([systemd journal requested but libraries not found])
45 AM_CONDITIONAL(HAVE_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
46 AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$with_systemd_journal" = "xyes"])
47 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
48 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
49 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
51 if test "x$have_systemd_journal" = "xyes" ; then
52 systemd_journal=systemd-journal
54 AC_SUBST(systemd_journal)
56 # check binary type for dlog debug mode
57 AC_ARG_ENABLE([debug_mode],
58 AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
61 if test "x$debug_mode" = "xyes" ; then
62 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
64 AC_ARG_ENABLE([debug_enable],
65 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
69 AC_ARG_ENABLE([fatal_on],
70 AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
73 if test "x$fatal_on" = "xyes" ; then
74 DEBUG_CFLAGS+=" -DFATAL_ON"
76 AC_SUBST(DEBUG_CFLAGS)
77 # Checks for libraries.
78 # Checks for header files.
80 AC_CHECK_HEADERS([stdlib.h unistd.h ])
82 # Checks for typedefs, structures, and compiler characteristics.
91 # Checks for library functions.
94 AC_CHECK_FUNCS([memset])
97 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
102 AC_CONFIG_FILES([Makefile dlog.pc]