refactoring: print 'serialized' instead of 'flatbuffers'
[platform/core/system/libdbuspolicy.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([dbuspolicy],
3         [1.1.0],
4         [dev@lists.tizen.org],
5         [dbuspolicy],
6         [http://review.tizen.org])
7 AC_CONFIG_SRCDIR([src/libdbuspolicy1.cpp])
8 AC_CONFIG_AUX_DIR([build-aux])
9 AM_INIT_AUTOMAKE([
10         check-news
11         foreign
12         1.11
13         -Wall
14         -Wno-portability
15         silent-rules
16         tar-pax
17         no-dist-gzip
18         dist-xz
19         subdir-objects
20 ])
21 AC_PROG_CC_STDC
22 AC_PROG_CXX
23 AC_USE_SYSTEM_EXTENSIONS
24 AC_SYS_LARGEFILE
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_SILENT_RULES([yes])
27 LT_INIT([
28         disable-static
29         pic-only
30 ])
31 AC_PREFIX_DEFAULT([/usr])
32
33 AC_PROG_SED
34 AC_PROG_MKDIR_P
35
36 AC_ARG_ENABLE([logging],
37         AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
38         [], enable_logging=yes)
39 AS_IF([test "x$enable_logging" = "xyes"], [
40         AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
41 ])
42
43 AC_ARG_ENABLE([debug],
44         AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
45         [], [enable_debug=no])
46 AS_IF([test "x$enable_debug" = "xyes"], [
47         AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
48 ])
49
50 AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [Add API function that allows to change credentials during execution]),
51                                          [with_tests=yes],
52                                          with_tests=no)
53 AM_CONDITIONAL([ENABLE_STANDALONE_TESTS], [test x$with_tests = xyes])
54 if test "x$with_tests" = "xyes"; then
55    AC_DEFINE(LIBDBUSPOLICY_TESTS_API, 1, [Define if tests are enabled])
56 fi
57
58
59 AC_ARG_ENABLE([doxygen],
60         AS_HELP_STRING([--enable-doxygen], [enable doxygen documentation @<:@default=disabled@:>@]),
61         [], [enable_doxygen=no])
62 AM_CONDITIONAL([ENABLE_DOXYGEN], [test x$enable_doxygen = xyes])
63 AS_IF([test "x$enable_doxygen" = "xyes"], [
64         AC_CHECK_PROGS([DOXYGEN], [doxygen])
65         if test -z "$DOXYGEN"
66                 then AC_MSG_ERROR([Doxygen not found!])
67                 enable_doxygen=no
68         fi
69 ])
70
71 AC_CHECK_FUNCS([ \
72         __secure_getenv \
73         secure_getenv\
74 ])
75
76 my_CFLAGS="\
77 -Wall \
78 -Wextra \
79 -Werror \
80 "
81 AC_SUBST([my_CFLAGS])
82
83 my_CXXFLAGS="\
84 -Wall \
85 -Wextra \
86 -Werror \
87 -std=c++14 \
88 "
89
90 AC_SUBST([my_CXXFLAGS])
91 PKG_CHECK_MODULES([CYNARA], [cynara-client >= 0.4.2 cynara-session >= 0.4.2],
92      [AC_DEFINE([ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in libdbuspolicy])],
93      [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])])
94 PKG_CHECK_MODULES([DLOG], [dlog])
95
96 AC_SUBST([CYNARA_CFLAGS])
97 AC_SUBST([CYNARA_LIBS])
98
99 AC_SUBST([DLOG_CFLAGS])
100 AC_SUBST([DLOG_LIBS])
101
102 AC_CONFIG_HEADERS(config.h)
103 AC_CONFIG_FILES([
104         Makefile
105 ])
106
107 AC_OUTPUT
108 AC_MSG_RESULT([
109         $PACKAGE $VERSION
110         =====
111
112         prefix:                 ${prefix}
113         sysconfdir:             ${sysconfdir}
114         libdir:                 ${libdir}
115         includedir:             ${includedir}
116
117         compiler:               ${CC}
118         cflags:                 ${CFLAGS} ${CYNARA_CFLAGS}
119         ldflags:                ${LDFLAGS} ${CYMARA_LIBS}
120
121         logging:                ${enable_logging}
122         debug:                  ${enable_debug}
123         doxygen:                ${enable_doxygen}
124 ])