Post-release version bump
[platform/upstream/folks.git] / configure.ac
index da9db72..c77c047 100644 (file)
@@ -3,7 +3,7 @@ m4_define([folks_released], [0])
 
 m4_define([folks_major_version], [0])
 m4_define([folks_minor_version], [9])
-m4_define([folks_micro_version], [1])
+m4_define([folks_micro_version], [3])
 m4_define([folks_nano_version], [1])
 
 # If library source has changed since last release, increment revision
@@ -11,9 +11,9 @@ m4_define([folks_nano_version], [1])
 #  increment current and set revision to 0
 # If public symbols have been added since last release, increment age
 # If public symbols have been removed since last release, set age to 0
-m4_define([folks_lt_current], [38])
+m4_define([folks_lt_current], [39])
 m4_define([folks_lt_revision], [1])
-m4_define([folks_lt_age], [13])
+m4_define([folks_lt_age], [14])
 
 # Display the nano_version only if it's not '0'
 m4_define([folks_base_version],
@@ -53,6 +53,11 @@ LT_INIT
 PKG_PROG_PKG_CONFIG([0.21])
 GLIB_GSETTINGS
 
+# Always look for .pc files in /folks so backend support libraries can be
+# introspected properly
+PKG_CONFIG_PATH=$(pwd)/folks:$PKG_CONFIG_PATH
+AC_SUBST([PKG_CONFIG_PATH])
+
 AC_SUBST([CFLAGS])
 AC_SUBST([CPPFLAGS])
 AC_SUBST([LDFLAGS])
@@ -67,8 +72,12 @@ AC_SUBST([LT_AGE])
 FOLKS_MAJOR_MINOR_VERSION=folks_major_minor_version
 AC_SUBST([FOLKS_MAJOR_MINOR_VERSION])
 
-API_VERSION=0.6
-AC_SUBST([API_VERSION])
+API_VERSION_MAJOR=0
+AC_SUBST([API_VERSION_MAJOR])
+API_VERSION_MINOR=6
+AC_SUBST([API_VERSION_MINOR])
+API_VERSION_DOT=$API_VERSION_MAJOR.$API_VERSION_MINOR
+AC_SUBST([API_VERSION_DOT])
 
 AC_ARG_ENABLE(tracker-backend,
         AC_HELP_STRING([--enable-tracker-backend],
@@ -128,6 +137,12 @@ AS_IF([test "x$enable_telepathy_backend" = "xyes"], [
 
 AM_CONDITIONAL([ENABLE_TELEPATHY], [test "x$enable_telepathy_backend" = "xyes"])
 
+AC_ARG_ENABLE(zeitgeist,
+        AC_HELP_STRING([--enable-zeitgeist],
+                       [ build Zeitgeist support in the Telepathy backend]),
+        enable_zeitgeist=$enableval,
+        enable_zeitgeist=auto)
+
 # Automatically check the dependencies for the libsocialweb backend
 SW_CLIENT_REQUIRED=0.25.20
 AC_ARG_ENABLE(libsocialweb-backend,
@@ -177,9 +192,9 @@ VALA_REQUIRED=0.17.6
 VALADOC_REQUIRED=0.3.1
 TRACKER_SPARQL_MAJOR=0.16
 TRACKER_SPARQL_REQUIRED=0.15.2
-EBOOK_REQUIRED=3.7.90
+EBOOK_REQUIRED=3.8.1
 EDATASERVER_REQUIRED=3.5.3.1
-ZEITGEIST_REQUIRED=0.3.14
+ZEITGEIST_REQUIRED=0.9.14
 GEE_REQUIRED=0.8.4
 
 AC_SUBST([TRACKER_SPARQL_MAJOR])
@@ -189,19 +204,40 @@ PKG_CHECK_MODULES([GLIB],
                    gobject-2.0 >= $GLIB_REQUIRED])
 PKG_CHECK_MODULES([GMODULE], [gmodule-no-export-2.0])
 PKG_CHECK_MODULES([GIO], [gio-2.0 >= $GLIB_REQUIRED])
-PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
+# FIXME: get rid of this when our dependencies stop using dbus-1 (GNOME#696177)
+PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1 dbus-1])
 
 PKG_CHECK_MODULES([GEE], [gee-0.8 >= $GEE_REQUIRED])
 
 TP_GLIB_REQUIRED=0.19.0
+
 AS_IF([test x$enable_telepathy_backend = xyes], [
-        PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= $TP_GLIB_REQUIRED])
-        PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-1.0 >= $ZEITGEIST_REQUIRED],
-                          have_zeitgeist="yes",have_zeitgeist="no")])
+        PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= $TP_GLIB_REQUIRED])])
+case "x$enable_zeitgeist" in
+  xyes)
+    AS_IF([test x$enable_telepathy_backend = xyes],
+          [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-2.0 >= $ZEITGEIST_REQUIRED],
+           ,
+           [AC_MSG_ERROR([Zeitgeist support requires Zeitgeist development package])])])
+    have_zeitgeist=yes
+    ;;
+  xauto)
+    AS_IF([test x$enable_telepathy_backend = xyes],
+          [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-2.0 >= $ZEITGEIST_REQUIRED],
+                             have_zeitgeist="yes",have_zeitgeist="no")],
+          [have_zeitgeist=no])
+    ;;
+  xno)
+    have_zeitgeist=no
+    ;;
+  x*)
+    AC_MSG_ERROR([Unknown --enable-zeitgeist argument: $enable_zeitgeist])
+esac
+
 AS_IF([test "x$have_zeitgeist" == "xyes"], [
    ZEITGEIST_VALAFLAGS="-D HAVE_ZEITGEIST"
    AC_SUBST([ZEITGEIST_VALAFLAGS])
-   ZEITGEIST_PKG="--pkg zeitgeist-1.0"
+   ZEITGEIST_PKG="--pkg zeitgeist-2.0"
    AC_SUBST([ZEITGEIST_PKG])
 ])
 
@@ -293,8 +329,10 @@ AS_IF([test "x$enable_vala" = "xyes"], [
 
         # require GLib >= 2.24 so GLib.Array, etc. reffing is handled
         # automatically
-        VALAFLAGS="$VALAFLAGS --target-glib=2.24"
-        AC_SUBST([VALAFLAGS])
+        AM_VALAFLAGS="--target-glib=2.24"
+        # within the libfolks tree, select inline code paths
+        AM_VALAFLAGS="$AM_VALAFLAGS -D FOLKS_COMPILATION"
+        AC_SUBST([AM_VALAFLAGS])
         AC_SUBST([VAPIGENFLAGS])
         AC_SUBST([VAPIDIR])
 
@@ -304,7 +342,7 @@ AS_IF([test "x$enable_vala" = "xyes"], [
         AS_IF([test x$enable_telepathy_backend = xyes], [
           VALA_CHECK_PACKAGES([telepathy-glib])
          AS_IF([test "x$have_zeitgeist" == "xyes"], [
-             VALA_CHECK_PACKAGES([zeitgeist-1.0])
+             VALA_CHECK_PACKAGES([zeitgeist-2.0])
          ])
         ])
 
@@ -343,51 +381,6 @@ AC_DEFINE([MODULE_VERSION], "folks_module_version", [Module interface version])
 BACKEND_DIR='$(libdir)/folks/$(FOLKS_MODULE_VERSION)/backends'
 AC_SUBST([BACKEND_DIR])
 
-BACKEND_KF='$(top_builddir)/backends/key-file/.libs/key-file.so'
-AC_SUBST([BACKEND_KF])
-BACKEND_TP='$(top_builddir)/backends/telepathy/.libs/telepathy.so'
-AC_SUBST([BACKEND_TP])
-
-AS_IF([test x$have_libsocialweb_backend = xyes], [
-  BACKEND_LIBSOCIALWEB='$(top_builddir)/backends/libsocialweb/.libs/libsocialweb.so'
-  AC_SUBST([BACKEND_LIBSOCIALWEB])
-])
-
-AS_IF([test x$enable_tracker_backend = xyes], [
-  BACKEND_TRACKER='$(top_builddir)/backends/tracker/.libs/tracker.so'
-  AC_SUBST([BACKEND_TRACKER])
-])
-
-AS_IF([test x$enable_eds_backend = xyes], [
-  BACKEND_EDS='$(top_builddir)/backends/eds/.libs/eds.so'
-  AC_SUBST([BACKEND_EDS])
-])
-
-if test x$enable_ofono_backend = xyes; then
-  BACKEND_OFONO='$(top_builddir)/backends/ofono/.libs/ofono.so'
-  AC_SUBST([BACKEND_OFONO])
-fi
-
-# All of the backend libraries in our tree; to be used by the tests
-BACKEND_UNINST_PATH='$(BACKEND_KF):$(BACKEND_TP)'
-AS_IF([test x$have_libsocialweb_backend = xyes], [
-  LIBSOCIALWEB_BACKEND_UNINST_PATH='$(BACKEND_LIBSOCIALWEB)'
-  BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$LIBSOCIALWEB_BACKEND_UNINST_PATH"
-])
-AS_IF([test x$enable_tracker_backend = xyes], [
-  TRACKER_BACKEND_UNINST_PATH='$(BACKEND_TRACKER)'
-  BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$TRACKER_BACKEND_UNINST_PATH"
-])
-AS_IF([test x$enable_eds_backend = xyes], [
-  EDS_BACKEND_UNINST_PATH='$(BACKEND_EDS)'
-  BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$EDS_BACKEND_UNINST_PATH"
-])
-AS_IF([test x$enable_ofono_backend = xyes], [
-  OFONO_BACKEND_UNINST_PATH='$(BACKEND_OFONO)'
-  BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$OFONO_BACKEND_UNINST_PATH"
-])
-AC_SUBST([BACKEND_UNINST_PATH])
-
 # -----------------------------------------------------------
 # Tools
 # -----------------------------------------------------------
@@ -437,8 +430,6 @@ AM_CONDITIONAL([ENABLE_INSPECT_TOOL], [test "$with_inspect_tool" = "yes"])
 AC_ARG_ENABLE([tests],
               AS_HELP_STRING([--enable-tests],[Enable building of tests]),
               [enable_tests=$enableval], [enable_tests=yes])
-AS_IF([test "$enable_tests" = "yes" -a "$enable_telepathy_backend" = "no"],
-      [AC_MSG_ERROR([The Telepathy backend must be enabled to build tests])])
 AM_CONDITIONAL([ENABLE_TESTS], [test x$enable_tests = xyes])
 
 # -----------------------------------------------------------
@@ -480,7 +471,38 @@ IT_PROG_INTLTOOL([0.50.0])
 # but we need it for dbus-glib. Porting to GDBus will solve this (#653198)
 AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated])
 
-AS_COMPILER_FLAG([-Wall], [ERROR_CFLAGS="-Wall"], [ERROR_CFLAGS=""])
+# C_ERROR_CFLAGS are only used for C code from telepathy-glib for now,
+# while ERROR_CFLAGS are used for everything.
+
+ERROR_CFLAGS=
+
+AC_ARG_ENABLE([fatal-warnings],
+              AS_HELP_STRING([--disable-fatal-warnings],
+                             [Make various warnings non-fatal]),
+              [enable_fatal_warnings=$enableval], [enable_fatal_warnings=yes])
+
+AC_DEFUN([FOLKS_ADD_WARNING],
+  [
+    AS_COMPILER_FLAG([-Werror=$2],
+      [
+        AS_IF([test "x$enable_fatal_warnings" = xyes],
+          [$1="[$]$1 -Werror=$2"],
+         [$1="[$]$1 -W$2"])
+      ])
+  ])
+
+# It isn't 1970 any more. Require that we write proper ISO C with declarations,
+# avoiding hard-to-trace bugs on platforms where sizeof(int) != sizeof(void *).
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [implicit])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [missing-declarations])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [missing-parameter-type])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [missing-prototypes])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [nested-externs])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [old-style-declaration])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [old-style-definition])
+FOLKS_ADD_WARNING([ERROR_CFLAGS], [strict-prototypes])
+
+AS_COMPILER_FLAG([-Wall], [C_ERROR_CFLAGS="-Wall"], [C_ERROR_CFLAGS=""])
 AS_COMPILER_FLAG([-Werror], [werror=yes], [werror=no])
 
 AC_ARG_ENABLE([debug],
@@ -528,7 +550,7 @@ m4_if(folks_released, [1], [],
             -a x$winit_self = xyes -a x$wformat = xyes -a \
             x$wmissing_include_dirs = xyes -a x$waggregate_return = xyes -a \
             x$wdeclaration_after_statement = xyes; then
-            ERROR_CFLAGS="$ERROR_CFLAGS -Wextra \
+            C_ERROR_CFLAGS="$C_ERROR_CFLAGS -Wextra \
                 -Wno-missing-field-initializers \
                 -Wno-unused-parameter ${flag}strict-prototypes \
                 ${flag}missing-prototypes ${flag}implicit-function-declaration \
@@ -538,17 +560,18 @@ m4_if(folks_released, [1], [],
         fi
     ])
 
-AS_COMPILER_FLAG([-D_POSIX_SOURCE], [ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE"])
-AS_COMPILER_FLAG([-std=c99], [ERROR_CFLAGS="$ERROR_CFLAGS -std=c99"])
-AS_COMPILER_FLAG([-Wshadow], [ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow"])
-AS_COMPILER_FLAG([-Wmissing-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-D_POSIX_SOURCE], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -D_POSIX_SOURCE"])
+AS_COMPILER_FLAG([-std=c99], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -std=c99"])
+AS_COMPILER_FLAG([-Wshadow], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -Wshadow"])
+AS_COMPILER_FLAG([-Wmissing-prototypes], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                           -Wmissing-prototypes"])
-AS_COMPILER_FLAG([-Wmissing-declarations], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-Wmissing-declarations], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                             -Wmissing-declarations"])
-AS_COMPILER_FLAG([-Wstrict-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-Wstrict-prototypes], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                          -Wstrict-prototypes"])
 
 AC_SUBST([ERROR_CFLAGS])
+AC_SUBST([C_ERROR_CFLAGS])
 
 # -----------------------------------------------------------
 # Code coverage flags
@@ -574,10 +597,6 @@ AC_SUBST([CODE_COVERAGE_CFLAGS])
 AC_SUBST([CODE_COVERAGE_LDFLAGS])
 
 # Vala-related flags
-AC_ARG_ENABLE([fatal-warnings],
-              AS_HELP_STRING([--disable-fatal-warnings],
-                             [Make warnings from valac and g-ir-scanner non-fatal]),
-              [enable_fatal_warnings=$enableval], [enable_fatal_warnings=yes])
 AS_IF([test "x$enable_vala" = "xyes" && test "x$enable_fatal_warnings" = "xyes"],
       [ERROR_INTROSPECTION_SCANNER_ARGS="\
                         $ERROR_INTROSPECTION_SCANNER_ARGS --warn-error"
@@ -653,11 +672,9 @@ AC_CONFIG_FILES([
     tests/lib/eds/Makefile
     tests/lib/key-file/Makefile
     tests/lib/libsocialweb/Makefile
-    tests/lib/libsocialweb/session.conf
     tests/lib/telepathy/Makefile
     tests/lib/tracker/Makefile
     tests/lib/telepathy/contactlist/Makefile
-    tests/lib/telepathy/contactlist/session.conf
     tests/tools/Makefile
     tools/Makefile
     tools/inspect/Makefile