peer to peer dbus support added
[platform/upstream/libgsignon-glib.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.64])
3 AC_INIT([libsignon-glib],
4         [1.9],
5         [http://code.google.com/p/accounts-sso/issues/entry],
6         [libsignon-glib],
7         [http://code.google.com/p/accounts-sso/])
8
9 AC_CONFIG_AUX_DIR([build-aux])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_SRCDIR([libsignon-glib.pc.in])
12 AC_CONFIG_MACRO_DIR([m4])
13
14 AM_INIT_AUTOMAKE([1.11 -Wall check-news nostdinc silent-rules subdir-objects])
15
16 AC_PROG_CC
17 AC_PROG_CC_STDC
18 AM_PROG_CC_C_O
19 AM_PROG_AR
20
21 LT_PREREQ([2.2])
22 LT_INIT([disable-static])
23
24 # Gobject Introspection
25 GOBJECT_INTROSPECTION_CHECK([1.30.0])
26
27 PKG_CHECK_MODULES(
28     [DEPS],
29     [gio-2.0 >= 2.30
30      gio-unix-2.0
31      glib-2.0 >= 2.32
32      gobject-2.0])
33 AC_SUBST(DEPS_CFLAGS)
34 AC_SUBST(DEPS_LIBS)
35
36 AC_ARG_ENABLE(dbus-type,
37               [--enable-dbus-type=dbus-type specify daemon dbus type:
38                                   p2p(default): uses peer to peer dbus
39                                   session: uses session message bus
40                                   system: uses system message bus],
41               [enable_dbus_type=$enableval], [enable_dbus_type=p2p])
42
43 echo "----------------------"
44 echo " DBUS TYPE : '$enable_dbus_type'"
45 echo "-----------------------"
46 if test "x$enable_dbus_type" = "xp2p" ; then
47     AC_DEFINE(USE_P2P, [1], [Use peer to peer dbus])
48     AC_DEFINE(SIGNOND_BUS_ADDRESS, ["unix:abstract=gsignond"], [signond daemon server socket address])
49 elif test "x$enable_dbus_type" = "xsession" ; then
50     AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SESSION], [Use session bus])
51 elif test "x$enable_dbus_type" = "xsystem" ; then
52     AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
53 fi
54
55 # Build tests.
56
57 CHECK_REQUIRED="check >= 0.9.4"
58
59 AC_ARG_ENABLE([tests],
60   [AS_HELP_STRING([--disable-tests], [build with testing support disabled])])
61
62 AS_IF([test "x$enable_tests" != "xno"],
63   [PKG_CHECK_EXISTS([$CHECK_REQUIRED], [have_check=yes], [have_check=no])],
64   [have_check=no])
65
66 AS_IF([test "x$have_check" = "xyes"],
67   [PKG_CHECK_MODULES([CHECK], [$CHECK_REQUIRED])
68    AC_SUBST([CHECK_CFLAGS])
69    AC_SUBST([CHECK_LIBS])],
70   [AS_IF([test "x$enable_tests" = "xyes"],
71     [AC_MSG_ERROR([tests enabled but required dependencies were not found])])])
72
73 AM_CONDITIONAL([ENABLE_TESTS], [test "x$have_check" = "xyes"])
74
75 GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
76
77 AC_ARG_ENABLE([cast-checks],
78     [AS_HELP_STRING([--disable-cast-checks], [compile with GLib cast checks disabled])])
79 AS_IF([test "x$enable_cast_checks" = "xno"],
80     [CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"])
81
82 AC_ARG_ENABLE([asserts],
83     [AS_HELP_STRING([--disable-asserts], [compile with GLib assertions disabled])])
84 AS_IF([test "x$enable_asserts" = "xno"],
85     [CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS"])
86
87 AC_ARG_ENABLE([checks],
88     [AS_HELP_STRING([--disable-checks], [compile with GLib checks disabled])])
89 AS_IF([test "x$checks" = "xno"],
90     [CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"])
91
92 AC_ARG_ENABLE([debug],
93     [AS_HELP_STRING([--enable-debug], [enable printing of debug messages])])
94 AS_IF([test "x$enable_debug" = "xyes"],
95     [CFLAGS="$CFLAGS -DENABLE_DEBUG"])
96
97 AC_ARG_ENABLE([coverage],
98     [AS_HELP_STRING([--enable-coverage], [compile with coverage info])])
99 AS_IF([test "x$enable_coverage" = "xyes"],
100     [CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage"])
101
102 # Python support.
103 PYGOBJECT_REQUIRED=2.90
104
105 AC_ARG_ENABLE([python],
106               [AS_HELP_STRING([--enable-python], [Build with python support])])
107
108 AS_IF([test "x$enable_python" != "xno"],
109     [PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
110                       [have_python=yes], [have_python=no])])
111
112 AS_IF([test "x$have_python" = "xyes"],
113     [AM_PATH_PYTHON
114      AC_SUBST([pyoverridesdir], [`$PYTHON -c "import gi;print (gi._overridesdir)" 2>/dev/null`])])
115
116 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$have_python" = "xyes"])
117
118 AC_CONFIG_FILES([
119         Makefile
120         libsignon-glib/Makefile
121         libsignon-glib.pc
122         docs/Makefile
123         docs/reference/Makefile
124         docs/reference/version.xml
125         tests/Makefile
126         pygobject/Makefile
127 ])
128 AC_OUTPUT