FIX Issue 227: [gsignond] Dbus interface for UI
[platform/upstream/gsignond.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.60])
5 AC_INIT([gsignond], [1.0.4],[],[],[http://01.org/gsso])
6 AC_CONFIG_SRCDIR([src/daemon/main.c])
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_AUX_DIR([build-aux])
9 AC_CONFIG_MACRO_DIR([m4])
10
11 AM_INIT_AUTOMAKE([1.11 nostdinc silent-rules subdir-objects tar-pax -Wno-portability])
12
13 # Checks for programs.
14 AC_PROG_CC
15 AM_PROG_AR
16 AX_CHECK_GNU_MAKE
17 if test "x$ifGNUmake" = "x#" ; then
18         AC_MSG_ERROR("GNUmake is required")
19 fi
20
21 #libtool
22 LT_PREREQ([2.2])
23 LT_INIT([disable-static])
24
25 # Checks for libraries.
26 PKG_CHECK_MODULES([GSIGNOND], 
27                   [glib-2.0 >= 2.30
28                    gio-2.0
29                    gio-unix-2.0
30                    gmodule-2.0
31                    sqlite3])
32 AC_SUBST(GSIGNOND_CFLAGS)
33 AC_SUBST(GSIGNOND_LIBS)
34
35
36 # AM_PATH_CHECK() is deprecated, but check documentation fails to tell that :-/
37 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [have_check=yes], [have_check=no])
38 AC_SUBST(CHECK_CFLAGS)
39 AC_SUBST(CHECK_LIBS)
40
41 PKG_CHECK_MODULES([LIBSMACK], libsmack >= 1.0, [libsmack=yes], [libsmack=no])
42 AM_CONDITIONAL(HAVE_LIBSMACK, [test x$libsmack = xyes])
43 if test "x$libsmack" = xyes; then
44     AC_DEFINE(HAVE_LIBSMACK, [1], [Define if libsmack exists.])
45 fi
46
47 PKG_CHECK_MODULES([LIBECRYPTFS], libecryptfs >= 96, [libecryptfs=yes], [libecryptfs=no])
48 AM_CONDITIONAL(HAVE_LIBECRYPTFS, [test x$libecryptfs = xyes])
49 if test "x$libecryptfs" = xes; then
50     AC_DEFINE(HAVE_LIBECRYPTFS, [1], [Define if libecryptfs exists.])
51 fi
52
53 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
54
55 AC_ARG_ENABLE([coverage],
56     [AS_HELP_STRING([--enable-coverage], [compile with coverage info])])
57 AS_IF([test "x$enable_coverage" = "xyes"],
58     [CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
59
60 # allow fake installations for "distcheck"
61 AC_ARG_ENABLE(distcheck,
62               [  --enable-distcheck build for distcheck target],
63               [enable_distcheck=yes], [enable_distcheck=no])
64 echo -n "running distcheck... "
65 echo $enable_distcheck
66
67 AC_ARG_ENABLE(dbus-type,
68               [  --enable-dbus-type=dbus-type specify daemon dbus type:
69                           p2p(default): uses peer to peer dbus
70                           session: uses session message bus
71                           system: uses system message bus],
72               [enable_dbus_type=$enableval], [enable_dbus_type=p2p])
73 echo "----------------------"
74 echo " DBUS TYPE : '$enable_dbus_type'"
75 echo "----------------------"
76 if test "x$enable_dbus_type" = "xp2p" ; then
77     AC_DEFINE(USE_P2P, [1], [Use peer to peer dbus])
78 elif test "x$enable_dbus_type" = "xsession" ; then
79     AC_DEFINE(GSIGNOND_BUS_TYPE, [G_BUS_TYPE_SESSION], [Use session bus])
80     if test "x$enable_distcheck" = "xyes" ; then
81         DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
82     else
83         DBUS_SERVICES_DIR="`pkg-config --variable session_bus_services_dir dbus-1`"
84     fi
85     
86     PKG_CHECK_MODULES(GTestDBus, gio-2.0 >= 2.34, [gtestdbus=yes], [gtestdbus=no])
87     if test "x$gtestdbus" = xyes; then
88        AC_DEFINE(HAVE_GTESTDBUS, [1], [Define if GTestDBus exists.])
89     fi
90 elif test "x$enable_dbus_type" = "xsystem" ; then
91     AC_DEFINE(GSIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
92     if test "x$enable_distcheck" = "xyes" ; then
93         DBUS_SERVICES_DIR="${datadir}/dbus-1/system-services"
94     else
95         DBUS_SERVICES_DIR="`pkg-config --variable system_bus_services_dir dbus-1`"
96     fi
97 fi
98 if test "x$enable_distcheck" = "xyes" ; then
99     DBUS_INTERFACES_DIR="${datadir}/dbus-1/interfaces"
100 else
101     DBUS_INTERFACES_DIR="`pkg-config --variable interfaces_dir dbus-1`"
102 fi
103
104 AC_ARG_ENABLE(keychain,
105               [  --enable-keychain=sysctx
106                           enable keychain access with
107                           system context "sysctx"],
108               [enable_keychain=$enableval])
109 if test "x$enable_keychain" != "x" ; then
110     AC_DEFINE_UNQUOTED(KEYCHAIN_SYSCTX,
111                        ["$enable_keychain"],
112                        [Keychain system context])
113     AC_SUBST(KEYCHAIN_SYSCTX,
114              ["#KeychainSystemContext = $enable_keychain"])
115 else
116     AC_SUBST(KEYCHAIN_SYSCTX,
117              ["#KeychainSystemContext = \"\""])
118 fi
119
120 AC_ARG_ENABLE(storagedir,
121               [  --enable-storagedir=path
122                           enable storage at location "path"
123                           instead of default "/var/db"],
124               [enable_storagedir=$enableval],
125               [enable_storagedir="/var/db"])
126 AC_DEFINE_UNQUOTED(BASE_STORAGE_DIR,
127                    ["$enable_storagedir"],
128                    [Base path for user specific storage directories])
129 AC_SUBST(BASE_STORAGE_DIR,
130          ["#StoragePath = $enable_storagedir"])
131
132 AC_ARG_ENABLE(debug,
133               [  --enable-debug          enable debug features],
134               [enable_debug=yes], [enable_debug=no])
135 echo -n "enable debug features... "
136 echo $enable_debug
137 if test "x$enable_debug" = "xyes" ; then
138     AC_DEFINE(ENABLE_DEBUG, [1], [Enable debug features])
139     AC_ARG_ENABLE(sql-log,
140           [  --enable-sql-log        enable sql log feature],
141           [enable_sql_log=yes], [enable_sql_log=no])
142     echo -n "enable sql log feature... "
143     echo $enable_sql_log
144     if test "x$enable_sql_log" = "xyes" ; then
145         AC_DEFINE(ENABLE_SQL_LOG, [1], [Enable SQL log feature])
146     fi
147 fi
148
149 AC_ARG_ENABLE(acltriggers,
150               [  --enable-acltriggers    enable ACL before delete triggers],
151               [enable_acl_triggers=yes], [enable_acl_triggers=no])
152 if test "x$enable_acl_triggers" = "xyes" ; then
153     AC_DEFINE(ENABLE_DB_ACL_TRIGGERS, [1], [Enable ACL triggers])
154 fi
155
156 AM_CONDITIONAL(USE_GTESTDBUS, [test x$gtestdbus = xyes])
157 AC_SUBST(MESSAGE_BUS_TYPE, [$enable_dbus_type])
158
159 AM_CONDITIONAL(HAVE_DEBUG, [test x$enable_debug = xyes])
160 AM_CONDITIONAL(SET_PERMISSIONS, [test x$enable_distcheck != xyes])
161
162 AC_SUBST(DBUS_SERVICES_DIR)
163 AC_SUBST(DBUS_INTERFACES_DIR)
164
165 # gtk-doc
166 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
167
168 # Checks for header files.
169 AC_CHECK_HEADERS([string.h])
170
171 # Enable feature sets
172 GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -D_POSIX_C_SOURCE=\\\"200809L\\\" -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE"
173
174 # Checks for typedefs, structures, and compiler characteristics.
175 GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -Wall -DG_LOG_DOMAIN=\\\"gsignond\\\""
176 if test "x$enable_debug" = "xno" ; then
177     GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -Werror"
178 else
179     GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -DENABLE_DEBUG"
180 fi
181
182 # GSIGNOND_LIBS="$GSIGNOND_LIBS -lduma"
183
184 # Checks for library functions.
185
186 AC_OUTPUT([
187 Makefile
188 ${PACKAGE_NAME}.pc
189 ${PACKAGE_NAME}-uninstalled.pc
190 gsignond.conf
191 docs/Makefile
192 src/Makefile
193 src/common/Makefile
194 src/common/db/Makefile
195 src/daemon/Makefile
196 src/daemon/db/Makefile
197 src/daemon/dbus/Makefile
198 src/daemon/dbus/services/com.google.code.AccountsSSO.gSingleSignOn.service
199 src/daemon/plugins/Makefile
200 src/gplugind/Makefile
201 src/extensions/Makefile
202 src/extensions/test/Makefile
203 src/extensions/tizen/Makefile
204 src/plugins/Makefile
205 src/plugins/password/Makefile
206 src/plugins/ssotest/Makefile
207 src/plugins/digest/Makefile
208 test/Makefile
209 test/common/Makefile
210 test/db/Makefile
211 test/daemon/Makefile
212 test/daemon/gsignond-dbus.conf
213 test/plugins/Makefile
214 ])
215
216 if test x$enable_dbus_type != xp2p; then
217     AC_OUTPUT([
218     test/daemon/services/com.google.code.AccountsSSO.gSingleSignOn.service
219     ])
220 fi