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 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
26 AM_CONDITIONAL(WITH_PIPE, [test "x$with_pipe" = "xyes"])
28 # backend: kmsg (requires kernel patch)
29 AC_ARG_ENABLE(kmsg, AS_HELP_STRING([--enable-kmsg], [enable kmsg (requires kmsg extension patch)]),
32 if test "x$with_kmsg" = "xyes"; then
33 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
35 AM_CONDITIONAL(WITH_KMSG, [test "x$with_kmsg" = "xyes"])
37 # backend: android logger (requires kernel's CONFIG_ANDROID_LOGGER)
38 AC_ARG_ENABLE(android_logger, AS_HELP_STRING([--enable-android-logger], [enable android logger (kernels CONFIG_ANDROID_LOGGER)]),
39 [with_android_logger=yes],
40 with_android_logger=no)
41 if test "x$with_android_logger" = "xyes"; then
42 __dlog_backends_selected=$(($__dlog_backends_selected + 1))
44 AM_CONDITIONAL(WITH_ANDROID_LOGGER, [test "x$with_android_logger" = "xyes"])
46 if test $__dlog_backends_selected -ne 1; then
47 AC_MSG_ERROR([Exactly one backend needs to be selected.])
50 # check binary type for dlog debug mode
51 AC_ARG_ENABLE([debug_mode],
52 AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
55 if test "x$debug_mode" = "xyes" ; then
56 DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
58 AC_ARG_ENABLE([debug_enable],
59 AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
62 AC_SUBST(DEBUG_CFLAGS)
63 # Checks for libraries.
64 # Checks for header files.
66 AC_CHECK_HEADERS([stdlib.h unistd.h ])
68 # Checks for typedefs, structures, and compiler characteristics.
77 # Checks for library functions.
80 AC_CHECK_FUNCS([memset])
83 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
88 AC_CONFIG_FILES([Makefile dlog.pc])