tests: enable redirection tests for zero-copy
[platform/core/system/dlog.git] / configure.ac
old mode 100755 (executable)
new mode 100644 (file)
index d59834f..20fcb45
@@ -2,71 +2,15 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT([dlog], [1.0], yk.yun@samsung.com)
+AC_INIT([dlog], [8.0], [cw00.choi@samsung.com, k.lewandowsk@samsung.com, m.bloch@samsung.com])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+LT_INIT
 
-# Init XO
-PLATFORM_INIT
-
-# Checks for programs.
-dnl AC_PROG_CXX
 AC_PROG_CC
-AC_PROG_GCC_TRADITIONAL
-AC_PROG_LIBTOOL
-
-__dlog_backends_selected=0
-
-# backend: pipe
-AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe (log to pipe fd received via unix socket)]),
-       [with_pipe=yes],
-       with_pipe=no)
-if test "x$with_pipe" = "xyes"; then
-       AC_DEFINE(DLOG_BACKEND_PIPE, 1, [Define if pipe backend is selected])
-       __dlog_backends_selected=$(($__dlog_backends_selected + 1))
-fi
-AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
-
-# backend: kmsg (requires kernel patch)
-AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
-       [with_kmsg=yes],
-       with_kmsg=no)
-if test "x$with_kmsg" = "xyes"; then
-       AC_DEFINE(DLOG_BACKEND_KMSG, 1, [Define if kmsg backend is selected])
-       __dlog_backends_selected=$(($__dlog_backends_selected + 1))
-fi
-AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
-
-# backend: android logger (requires kernel's CONFIG_ANDROID_LOGGER)
-AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger (kernels CONFIG_ANDROID_LOGGER)]),
-       [with_android_logger=yes],
-       with_android_logger=no)
-if test "x$with_android_logger" = "xyes"; then
-       AC_DEFINE(DLOG_BACKEND_LOGGER, 1, [Define if (legacy) android logger backend is selected])
-       __dlog_backends_selected=$(($__dlog_backends_selected + 1))
-fi
-AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
-
-if test $__dlog_backends_selected -ne 1; then
-       AC_MSG_ERROR([Exactly one backend needs to be selected.])
-fi
+AC_PROG_CXX
 
-# check binary type for dlog debug mode
-AC_ARG_ENABLE([debug_mode],
-       AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
-               [debug_mode=yes],
-               debug_mode=no)
-if test "x$debug_mode" = "xyes" ; then
-       DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
-fi
-AC_ARG_ENABLE([debug_enable],
-       AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
-               [debug_enable=yes],
-           debug_enable=no)
 AC_SUBST(DEBUG_CFLAGS)
-# Checks for libraries.
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h unistd.h ])
+AC_CHECK_HEADERS([stdlib.h unistd.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
@@ -85,8 +29,85 @@ AC_CHECK_FUNCS([memset])
 PKG_PROG_PKG_CONFIG
 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
 
-AC_SUBST(TZ_SYS_ETC)
+AC_ARG_ENABLE([server-user],
+        AS_HELP_STRING([--enable-server-user=USER], [user dlog_server should run with]),
+        [dlog_server_user=$enableval],
+        [dlog_server_user=log])
+AC_DEFINE_UNQUOTED([DLOG_SERVER_USER], "$dlog_server_user")
+AC_SUBST([DLOG_SERVER_USER], "$dlog_server_user")
+
+AC_ARG_ENABLE([server-group],
+        AS_HELP_STRING([--enable-server-group=GROUP], [group dlog_server should run with]),
+        [dlog_server_group=$enableval],
+        [dlog_server_group=log])
+AC_DEFINE_UNQUOTED([DLOG_SERVER_GROUP], "$dlog_server_group")
+AC_SUBST([DLOG_SERVER_GROUP], "$dlog_server_group")
+
+critical_logfile_path_default=${localstatedir}/log/dlog/critical
+AC_ARG_ENABLE([critical-logfile],
+       AS_HELP_STRING([--critical-log-path=PATH], [path of the critical log file (default: $critical_logfile_path_default)]),
+       [critical_logfile=$enableval],
+       [critical_logfile=$critical_logfile_path_default])
+AC_DEFINE_UNQUOTED([DLOG_CRITICAL_LOGFILE_PATH], "$critical_logfile")
+AC_SUBST([DLOG_CRITICAL_LOGFILE_PATH], "$critical_logfile")
+
+critical_logfile_size_default=1048576 # 1 MB
+AC_ARG_ENABLE([critical-logsize],
+       AS_HELP_STRING([--critical-log-size=SIZE], [size of the critical log file in bytes (default: $critical_logfile_size_default)]),
+       [critical_logsize=$enableval],
+       [critical_logsize=$critical_logfile_size_default])
+AC_DEFINE_UNQUOTED([DLOG_CRITICAL_LOGFILE_SIZE], [$critical_logsize])
+AC_SUBST([DLOG_CRITICAL_LOGFILE_SIZE], [$critical_logsize])
+
+AC_ARG_ENABLE([android-monotonic],
+        AS_HELP_STRING([--enable-android-monotonic], [use monotonic send timestamp with log message when using android backend (EXPERIMENTAL)]),
+        [android_monotonic=true],
+        [android_monotonic=false])
+if test x$android_monotonic = xtrue; then
+       AC_DEFINE_UNQUOTED([USE_ANDROID_MONOTONIC])
+fi
+
+AC_ARG_ENABLE([lowmem-notification],
+       AS_HELP_STRING([--enable-lowmem-notification], [enable low memory notification feature in dlog_logger]),
+       [lowmem_notification=true],
+       [lowmem_notification=false])
+if test "${lowmem_notification}" = "true"; then
+       PKG_CHECK_MODULES([VCONF], [vconf])
+       PKG_CHECK_MODULES([GIO], [gio-2.0])
+
+       AC_SUBST(LOWMEM_NOTIFICATION, "true")
+       AC_DEFINE_UNQUOTED([LOWMEM_NOTIFICATION])
+else
+       AC_SUBST(LOWMEM_NOTIFICATION, "false")
+fi
 
 # output files
-AC_CONFIG_FILES([Makefile dlog.pc])
+AC_SUBST([datadir])
+AC_SUBST([libexecdir])
+AC_CONFIG_FILES([Makefile dlog.pc dlogutil.pc dlog-redirect-stdout.pc]
+                [dlog_test:tests/dlog_test.in]
+                [run-unittest.sh:tests/dlog_coverage.in]
+                [dlog_test_header:tests/dlog_test_header.in]
+                [dlog_test_daemon_early_quit:tests/dlog_test_daemon_early_quit.in]
+                [dlog_test_stdout_redirect:tests/dlog_test_stdout_redirect.in]
+                [dlog_test_tid_filtering_secure_logging:tests/dlog_test_tid_filtering_secure_logging.in]
+                [dlog_test_backend_autodetection:tests/dlog_test_backend_autodetection.in]
+                [dlog_test_logger_buffering_logging:tests/dlog_test_logger_buffering_logging.in]
+                [dlog_cpu:tests/dlog_cpu.in]
+                [README.testsuite:tests/README.testsuite.in]
+                [units/dlog_logger.service]
+                [units/dlog_cleanup.service])
+
 AC_OUTPUT
+
+AC_MSG_RESULT([
+        $PACKAGE $VERSION
+        =====
+
+        compiler:               ${CC}
+        cflags:                 ${CFLAGS}
+        ldflags:                ${LDFLAGS}
+
+        server's user:          ${dlog_server_user}
+        server's group:         ${dlog_server_group}
+])