updated spec files
[profile/ivi/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], [0.0.1],[],[],[http://code.google.com/p/accounts-sso/])
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 # allow fake installations for "distcheck"
56 AC_ARG_ENABLE(distcheck,
57               [  --enable-distcheck build for distcheck target],
58               [enable_distcheck=yes], [enable_distcheck=no])
59 echo -n "running distcheck... "
60 echo $enable_distcheck
61
62 AC_ARG_ENABLE(dbus-type,
63               [  --enable-dbus-type=dbus-type specify daemon dbus type:
64                           p2p(default): uses peer to peer dbus
65                           session: uses session message bus
66                           system: uses system message bus],
67               [enable_dbus_type=$enableval], [enable_dbus_type=p2p])
68 echo "----------------------"
69 echo " DBUS TYPE : '$enable_dbus_type'"
70 echo "----------------------"
71 if test "x$enable_dbus_type" = "xp2p" ; then
72     AC_DEFINE(USE_P2P, [1], [Use peer to peer dbus])
73 elif test "x$enable_dbus_type" = "xsession" ; then
74     AC_DEFINE(GSIGNOND_BUS_TYPE, [G_BUS_TYPE_SESSION], [Use session bus])
75     if test "x$enable_distcheck" = "xyes" ; then
76         DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
77     else
78         DBUS_SERVICES_DIR="`pkg-config --variable session_bus_services_dir dbus-1`"
79     fi
80     
81     PKG_CHECK_MODULES(GTestDBus, gio-2.0 >= 2.34, [gtestdbus=yes], [gtestdbus=no])
82     if test "x$gtestdbus" = xyes; then
83        AC_DEFINE(HAVE_GTESTDBUS, [1], [Define if GTestDBus exists.])
84     fi
85 elif test "x$enable_dbus_type" = "xsystem" ; then
86     AC_DEFINE(GSIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
87     if test "x$enable_distcheck" = "xyes" ; then
88         DBUS_SERVICES_DIR="${datadir}/dbus-1/system-services"
89     else
90         DBUS_SERVICES_DIR="`pkg-config --variable system_bus_services_dir dbus-1`"
91     fi
92 fi
93 if test "x$enable_dbus_type" != "xp2p" ; then
94     if test "x$enable_distcheck" = "xyes" ; then
95         DBUS_INTERFACES_DIR="${datadir}/dbus-1/interfaces"
96     else
97         DBUS_INTERFACES_DIR="`pkg-config --variable interfaces_dir dbus-1`"
98     fi
99 fi
100
101 AC_ARG_ENABLE(debug,
102               [  --enable-debug          enable debug features],
103               [enable_debug=yes], [enable_debug=no])
104 echo -n "enable debug features... "
105 echo $enable_debug
106 if test "x$enable_debug" = "xyes" ; then
107     AC_DEFINE(ENABLE_DEBUG, [1], [Enable debug features])
108     AC_ARG_ENABLE(sql-log,
109           [  --enable-sql-log          enable sql log feature],
110           [enable_sql_log=yes], [enable_sql_log=no])
111     echo -n "enable sql log feature... "
112     echo $enable_sql_log
113     if test "x$enable_sql_log" = "xyes" ; then
114         AC_DEFINE(ENABLE_SQL_LOG, [1], [Enable SQL log feature])
115     fi
116 fi
117
118 AM_CONDITIONAL(USE_GTESTDBUS, [test x$gtestdbus = xyes])
119 AC_SUBST(MESSAGE_BUS_TYPE, [$enable_dbus_type])
120
121 AC_SUBST(DBUS_SERVICES_DIR)
122 AC_SUBST(DBUS_INTERFACES_DIR)
123
124 # gtk-doc
125 GTK_DOC_CHECK
126
127 # Checks for header files.
128 AC_CHECK_HEADERS([string.h])
129
130 # Enable feature sets
131 GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -D_POSIX_C_SOURCE=\\\"200809L\\\" -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE"
132
133 # Checks for typedefs, structures, and compiler characteristics.
134 GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -Wall -Werror -DG_LOG_DOMAIN=\\\"gsignond\\\""
135 # GSIGNOND_LIBS="$GSIGNOND_LIBS -lduma"
136
137 # Checks for library functions.
138
139 AC_OUTPUT([
140 Makefile
141 ${PACKAGE_NAME}.pc
142 ${PACKAGE_NAME}-uninstalled.pc
143 src/Makefile
144 src/common/Makefile
145 src/common/db/Makefile
146 src/daemon/Makefile
147 src/daemon/db/Makefile
148 src/daemon/dbus/Makefile
149 src/daemon/dbus/services/com.google.code.AccountsSSO.gSingleSignOn.service
150 src/daemon/plugins/Makefile
151 src/daemon/plugins/plugind/Makefile
152 src/extensions/Makefile
153 src/extensions/test/Makefile
154 src/extensions/tizen/Makefile
155 src/plugins/Makefile
156 src/plugins/password/Makefile
157 src/plugins/ssotest/Makefile
158 src/plugins/digest/Makefile
159 test/Makefile
160 test/common/Makefile
161 test/db/Makefile
162 test/daemon/Makefile
163 test/daemon/gsignond-dbus.conf
164 test/plugins/Makefile
165 ])
166
167 if test x$enable_dbus_type != xp2p; then
168     AC_OUTPUT([
169     test/daemon/services/com.google.code.AccountsSSO.gSingleSignOn.service
170     ])
171 fi