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])
11 # Checks for programs.
14 AC_PROG_GCC_TRADITIONAL
17 __dlog_backends_selected=0
20 AC_ARG_ENABLE(pipe, AS_HELP_STRING([--enable-pipe], [enable pipe (log to pipe fd received via unix socket)]),
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))
27 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
29 # backend: kmsg (requires kernel patch)
30 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
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))
37 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
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))
47 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
49 if test $__dlog_backends_selected -ne 1; then
50 AC_MSG_ERROR([Exactly one backend needs to be selected.])
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]),
58 if test "x$debug_mode" = "xyes" ; then
59 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
61 AC_ARG_ENABLE([debug_enable],
62 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
66 AC_ARG_ENABLE([fatal_on],
67 AS_HELP_STRING([--enable-fatal_on Turn on fatal assertion]),
70 if test "x$fatal_on" = "xyes" ; then
71 DEBUG_CFLAGS+=" -DFATAL_ON"
73 AC_SUBST(DEBUG_CFLAGS)
74 # Checks for libraries.
75 # Checks for header files.
77 AC_CHECK_HEADERS([stdlib.h unistd.h ])
79 # Checks for typedefs, structures, and compiler characteristics.
88 # Checks for library functions.
91 AC_CHECK_FUNCS([memset])
94 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
99 AC_CONFIG_FILES([Makefile dlog.pc])