Remove journal backend
[platform/core/system/dlog.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.61)
5 AC_INIT([dlog], [1.0], yk.yun@samsung.com)
6 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7
8 # Init XO
9 PLATFORM_INIT
10
11 # Checks for programs.
12 dnl AC_PROG_CXX
13 AC_PROG_CC
14 AC_PROG_GCC_TRADITIONAL
15 AC_PROG_LIBTOOL
16
17 __dlog_backends_selected=0
18
19 # backend: pipe
20 AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe (log to pipe fd received via unix socket)]),
21         [with_pipe=yes],
22         with_pipe=no)
23 if test "x$with_pipe" = "xyes"; then
24         AC_DEFINE(DLOG_BACKEND_PIPE, 1, [Define if pipe backend is selected])
25         __dlog_backends_selected=$(($__dlog_backends_selected + 1))
26 fi
27 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
28
29 # backend: kmsg (requires kernel patch)
30 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
31         [with_kmsg=yes],
32         with_kmsg=no)
33 if test "x$with_kmsg" = "xyes"; then
34         AC_DEFINE(DLOG_BACKEND_KMSG, 1, [Define if kmsg backend is selected])
35         __dlog_backends_selected=$(($__dlog_backends_selected + 1))
36 fi
37 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
38
39 # backend: android logger (requires kernel's CONFIG_ANDROID_LOGGER)
40 AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger (kernels CONFIG_ANDROID_LOGGER)]),
41         [with_android_logger=yes],
42         with_android_logger=no)
43 if test "x$with_android_logger" = "xyes"; then
44         AC_DEFINE(DLOG_BACKEND_LOGGER, 1, [Define if (legacy) android logger backend is selected])
45         __dlog_backends_selected=$(($__dlog_backends_selected + 1))
46 fi
47 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
48
49 if test $__dlog_backends_selected -ne 1; then
50         AC_MSG_ERROR([Exactly one backend needs to be selected.])
51 fi
52
53 # check binary type for dlog debug mode
54 AC_ARG_ENABLE([debug_mode],
55         AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
56                 [debug_mode=yes],
57                 debug_mode=no)
58 if test "x$debug_mode" = "xyes" ; then
59         DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
60 fi
61 AC_ARG_ENABLE([debug_enable],
62         AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
63                 [debug_enable=yes],
64             debug_enable=no)
65 # check for fatal_on
66 AC_ARG_ENABLE([fatal_on],
67         AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
68                 [fatal_on=yes],
69             fatal_on=no)
70 if test "x$fatal_on" = "xyes" ; then
71         DEBUG_CFLAGS+=" -DFATAL_ON"
72 fi
73 AC_SUBST(DEBUG_CFLAGS)
74 # Checks for libraries.
75 # Checks for header files.
76 AC_HEADER_STDC
77 AC_CHECK_HEADERS([stdlib.h unistd.h ])
78
79 # Checks for typedefs, structures, and compiler characteristics.
80 AC_HEADER_STDBOOL
81 AC_C_CONST
82 AC_C_INLINE
83 AC_STRUCT_TM
84 AC_TYPE_PID_T
85 AC_TYPE_SIZE_T
86 AC_TYPE_SSIZE_T
87
88 # Checks for library functions.
89 AC_FUNC_MALLOC
90 AC_FUNC_STAT
91 AC_CHECK_FUNCS([memset])
92
93 PKG_PROG_PKG_CONFIG
94 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
95
96 AC_SUBST(TZ_SYS_ETC)
97
98 # output files
99 AC_CONFIG_FILES([Makefile dlog.pc])
100 AC_OUTPUT