added docs to spec file
[profile/ivi/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([libgsignon-glib],
4         [2.0.0],
5         [http://code.google.com/p/accounts-sso/issues/entry],
6         [libgsignon-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([libgsignon-glib.pc.in])
12 AC_CONFIG_MACRO_DIR([m4])
13
14 AM_INIT_AUTOMAKE([1.11 nostdinc silent-rules subdir-objects tar-pax -Wno-portability])
15
16 AC_PROG_CC
17 AC_PROG_CC_STDC
18 AM_PROG_CC_C_O
19 AM_PROG_AR
20 AX_CHECK_GNU_MAKE
21 if test "x$ifGNUmake" = "x#" ; then
22     AC_MSG_ERROR("GNUmake is required")
23 fi
24
25 LT_PREREQ([2.2])
26 LT_INIT([disable-static])
27
28 # Gobject Introspection
29 GOBJECT_INTROSPECTION_CHECK([1.30.0])
30
31 PKG_CHECK_MODULES(
32     [DEPS],
33     [gio-2.0 >= 2.30
34      gio-unix-2.0
35      glib-2.0 >= 2.32
36      gobject-2.0])
37 AC_SUBST(DEPS_CFLAGS)
38 AC_SUBST(DEPS_LIBS)
39
40 AC_ARG_ENABLE(dbus-type,
41               [  --enable-dbus-type=dbus-type specify daemon dbus type:
42                           p2p(default): uses peer to peer dbus
43                           session: uses session message bus
44                           system: uses system message bus],
45               [enable_dbus_type=$enableval], [enable_dbus_type=p2p])
46
47 echo "----------------------"
48 echo " DBUS TYPE : '$enable_dbus_type'"
49 echo "-----------------------"
50 if test "x$enable_dbus_type" = "xp2p" ; then
51     AC_DEFINE(USE_P2P, [1], [Use peer to peer dbus])
52     AC_DEFINE(SIGNOND_BUS_ADDRESS, ["unix:path=%s/gsignond/bus-sock"], [signond daemon server socket address])
53 elif test "x$enable_dbus_type" = "xsession" ; then
54     AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SESSION], [Use session bus])
55
56     # Build tests.
57     PKG_CHECK_MODULES(GTestDBus, glib-2.0 >= 2.34, [gtestdbus=yes], [gtestdbus=no])
58     if test "x$gtestdbus" = xyes; then
59         AC_DEFINE(HAVE_GTESTDBUS, [1], [Define if GTestDBus exists.])
60     else
61         AC_DEFINE(HAVE_GTESTDBUS, [0], [GTestDBus does not exist.])
62     fi
63 elif test "x$enable_dbus_type" = "xsystem" ; then
64     AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
65 fi
66 if test "x$enable_dbus_type" != "xp2p" ; then
67     DBUS_INTERFACES_DIR="`pkg-config --variable interfaces_dir dbus-1`"
68 fi
69
70 AM_CONDITIONAL(HAVE_GTESTDBUS, [test x$gtestdbus = xyes])
71
72 CHECK_REQUIRED="check >= 0.9.4"
73
74 AC_ARG_ENABLE([tests],
75   [AS_HELP_STRING([--disable-tests], [build with testing support disabled])])
76
77 AS_IF([test "x$enable_tests" != "xno"],
78   [PKG_CHECK_EXISTS([$CHECK_REQUIRED], [have_check=yes], [have_check=no])],
79   [have_check=no])
80
81 AS_IF([test "x$have_check" = "xyes"],
82   [PKG_CHECK_MODULES([CHECK], [$CHECK_REQUIRED])
83    AC_SUBST([CHECK_CFLAGS])
84    AC_SUBST([CHECK_LIBS])],
85   [AS_IF([test "x$enable_tests" = "xyes"],
86     [AC_MSG_ERROR([tests enabled but required dependencies were not found])])])
87
88 AM_CONDITIONAL([ENABLE_TESTS], [test "x$have_check" = "xyes"])
89
90 m4_ifdef([GTK_DOC_CHECK], [
91 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
92 ],[
93 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
94 ])
95
96 AC_ARG_ENABLE([cast-checks],
97     [AS_HELP_STRING([--disable-cast-checks], [compile with GLib cast checks disabled])])
98 AS_IF([test "x$enable_cast_checks" = "xno"],
99     [CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"])
100
101 AC_ARG_ENABLE([asserts],
102     [AS_HELP_STRING([--disable-asserts], [compile with GLib assertions disabled])])
103 AS_IF([test "x$enable_asserts" = "xno"],
104     [CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS"])
105
106 AC_ARG_ENABLE([checks],
107     [AS_HELP_STRING([--disable-checks], [compile with GLib checks disabled])])
108 AS_IF([test "x$checks" = "xno"],
109     [CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"])
110
111 AC_ARG_ENABLE([debug],
112     [AS_HELP_STRING([--enable-debug], [enable printing of debug messages])])
113 AS_IF([test "x$enable_debug" = "xyes"],
114     [CFLAGS="$CFLAGS -DENABLE_DEBUG"])
115
116 AC_ARG_ENABLE([coverage],
117     [AS_HELP_STRING([--enable-coverage], [compile with coverage info])])
118 AS_IF([test "x$enable_coverage" = "xyes"],
119     [CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage"])
120
121 # Python support.
122 PYGOBJECT_REQUIRED=2.90
123
124 AC_ARG_ENABLE([python],
125               [AS_HELP_STRING([--enable-python], [Build with python support])])
126
127 AS_IF([test "x$enable_python" != "xno"],
128     [PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
129                       [have_python=yes], [have_python=no])])
130
131 AS_IF([test "x$have_python" = "xyes"],
132     [AM_PATH_PYTHON
133      AC_SUBST([pyoverridesdir], [`$PYTHON -c "import gi;print (gi._overridesdir)" 2>/dev/null`])])
134
135 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$have_python" = "xyes"])
136
137 AC_CONFIG_FILES([
138         Makefile
139         libgsignon-glib/Makefile
140         libgsignon-glib.pc
141         docs/Makefile
142         docs/reference/Makefile
143         docs/reference/version.xml
144         tests/Makefile
145         pygobject/Makefile
146 ])
147 AC_OUTPUT