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])
9 AC_CONFIG_MACRO_DIR([m4])
13 # Checks for programs.
15 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
17 AC_PROG_GCC_TRADITIONAL
20 # check for libsystemd-journal
21 AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
22 [with_systemd_journal=yes],
23 with_systemd_journal=no)
24 if test "x$with_systemd_journal" != "xno"; then
25 PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal],
26 [AC_DEFINE(HAVE_SYSTEMD_JOURNAL, 1, [Define if systemd journal is available])
27 have_systemd_journal=yes],
28 have_systemd_journal=no)
29 if test "x$have_systemd_journal" = "xno" -a "x$with_systemd_journal" = "xyes"; then
30 AC_MSG_ERROR([systemd journal requested but libraries not found])
33 AM_CONDITIONAL(HAVE_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
34 AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$with_systemd_journal" = "xyes"])
35 if test "x$have_systemd_journal" = "xyes" ; then
36 systemd_journal=systemd-journal
38 AC_SUBST(systemd_journal)
40 # check binary type for dlog debug mode
41 AC_ARG_ENABLE([dlog_debug_mode],
42 AS_HELP_STRING([--enable-debug_mode Turn on dlog_debug_mode]),
43 [dlog_debug_mode=yes],
45 if test "x$dlog_debug_mode" = "xyes" ; then
46 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
48 AC_ARG_ENABLE([debug_enable],
49 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
53 AC_ARG_ENABLE([fatal_on],
54 AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
57 if test "x$fatal_on" = "xyes" ; then
58 DEBUG_CFLAGS+=" -DFATAL_ON"
60 AC_SUBST(DEBUG_CFLAGS)
61 dnl AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
62 # Checks for libraries.
63 # Checks for header files.
65 AC_CHECK_HEADERS([stdlib.h unistd.h ])
67 # Checks for typedefs, structures, and compiler characteristics.
76 # Checks for library functions.
79 AC_CHECK_FUNCS([memset])
82 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
85 AC_CONFIG_FILES([Makefile dlog.pc])