dlog_logger: add a ghetto vtable to readers
[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], [6.0], [hyotaek.shim@samsung.com, k.lewandowsk@samsung.com])
6 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7 LT_INIT
8
9 AC_PROG_CC
10 AC_PROG_CXX
11
12 AC_SUBST(DEBUG_CFLAGS)
13 AC_CHECK_HEADERS([stdlib.h unistd.h])
14
15 # Checks for typedefs, structures, and compiler characteristics.
16 AC_HEADER_STDBOOL
17 AC_C_CONST
18 AC_C_INLINE
19 AC_STRUCT_TM
20 AC_TYPE_PID_T
21 AC_TYPE_SIZE_T
22 AC_TYPE_SSIZE_T
23
24 # Checks for library functions.
25 AC_FUNC_MALLOC
26 AC_FUNC_STAT
27 AC_CHECK_FUNCS([memset])
28
29 PKG_PROG_PKG_CONFIG
30 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
31
32 AC_ARG_ENABLE([server-user],
33         AS_HELP_STRING([--enable-server-user=USER], [user dlog_server should run with]),
34         [dlog_server_user=$enableval],
35         [dlog_server_user=log])
36 AC_DEFINE_UNQUOTED([DLOG_SERVER_USER], "$dlog_server_user")
37 AC_SUBST([DLOG_SERVER_USER], "$dlog_server_user")
38
39 AC_ARG_ENABLE([server-group],
40         AS_HELP_STRING([--enable-server-group=GROUP], [group dlog_server should run with]),
41         [dlog_server_group=$enableval],
42         [dlog_server_group=log])
43 AC_DEFINE_UNQUOTED([DLOG_SERVER_GROUP], "$dlog_server_group")
44 AC_SUBST([DLOG_SERVER_GROUP], "$dlog_server_group")
45
46 critical_logfile_path_default=${localstatedir}/log/dlog/critical
47 AC_ARG_ENABLE([critical-logfile],
48         AS_HELP_STRING([--critical-log-path=PATH], [path of the critical log file (default: $critical_logfile_path_default)]),
49         [critical_logfile=$enableval],
50         [critical_logfile=$critical_logfile_path_default])
51 AC_DEFINE_UNQUOTED([DLOG_CRITICAL_LOGFILE_PATH], "$critical_logfile")
52 AC_SUBST([DLOG_CRITICAL_LOGFILE_PATH], "$critical_logfile")
53
54 critical_logfile_size_default=1048576 # 1 MB
55 AC_ARG_ENABLE([critical-logsize],
56         AS_HELP_STRING([--critical-log-size=SIZE], [size of the critical log file in bytes (default: $critical_logfile_size_default)]),
57         [critical_logsize=$enableval],
58         [critical_logsize=$critical_logfile_size_default])
59 AC_DEFINE_UNQUOTED([DLOG_CRITICAL_LOGFILE_SIZE], [$critical_logsize])
60 AC_SUBST([DLOG_CRITICAL_LOGFILE_SIZE], [$critical_logsize])
61
62 AC_ARG_ENABLE([android-monotonic],
63         AS_HELP_STRING([--enable-android-monotonic], [use monotonic send timestamp with log message when using android backend (EXPERIMENTAL)]),
64         [android_monotonic=true],
65         [android_monotonic=false])
66 if test x$android_monotonic = xtrue; then
67         AC_DEFINE_UNQUOTED([USE_ANDROID_MONOTONIC])
68 fi
69
70 AC_ARG_ENABLE([lowmem-notification],
71         AS_HELP_STRING([--enable-lowmem-notification], [enable low memory notification feature in dlog_logger]),
72         [lowmem_notification=true],
73         [lowmem_notification=false])
74 if test "${lowmem_notification}" = "true"; then
75         PKG_CHECK_MODULES([VCONF], [vconf])
76         PKG_CHECK_MODULES([GIO], [gio-2.0])
77
78         AC_SUBST(LOWMEM_NOTIFICATION, "true")
79         AC_DEFINE_UNQUOTED([LOWMEM_NOTIFICATION])
80 else
81         AC_SUBST(LOWMEM_NOTIFICATION, "false")
82 fi
83
84 # output files
85 AC_SUBST([datadir])
86 AC_SUBST([libexecdir])
87 AC_CONFIG_FILES([Makefile dlog.pc dlogutil.pc dlog-redirect-stdout.pc]
88                 [dlog_test:tests/dlog_test.in]
89                 [dlog_test_header:tests/dlog_test_header.in]
90                 [dlog_cpu:tests/dlog_cpu.in]
91                 [README.testsuite:tests/README.testsuite.in]
92                 [units/dlog_logger.service]
93                 [units/dlog_cleanup.service])
94
95 AC_OUTPUT
96
97 AC_MSG_RESULT([
98         $PACKAGE $VERSION
99         =====
100
101         compiler:               ${CC}
102         cflags:                 ${CFLAGS}
103         ldflags:                ${LDFLAGS}
104
105         server's user:          ${dlog_server_user}
106         server's group:         ${dlog_server_group}
107 ])