+# -----------------------------------------------------------
+# Call interface
+# -----------------------------------------------------------
+AC_ARG_WITH(call,
+ AC_HELP_STRING([--enable-call=@<:@no/yes/auto@:>@],
+ [build with Call interface support]),,
+ [with_call=auto])
+if test "x$with_call" != "xno" ; then
+ PKG_CHECK_MODULES(EMPATHY_CALL,
+ [
+ farsight2-0.10
+ telepathy-farstream
+ clutter-1.0
+ clutter-gtk-1.0
+ clutter-gst-1.0
+ ], have_call="yes", have_call="no" )
+
+ if test "x$have_call" = "xyes"; then
+ AC_DEFINE(HAVE_CALL, 1, [Define if you have Call channel support])
+ fi
+else
+ have_call=no
+fi
+
+if test "x$with_call" = "xyes" -a "x$have_call" != "xyes"; then
+ AC_MSG_ERROR([Could not find Call handler dependencies.])
+fi
+AM_CONDITIONAL(HAVE_CALL, test "x$have_call" = "xyes")
+
+
+# -----------------------------------------------------------
+# Call support in tp-logger
+# -----------------------------------------------------------
+AC_ARG_WITH(call-logs,
+ AC_HELP_STRING([--enable-call-logs=@<:@no/yes/auto@:>@],
+ [build with call logs support]),,
+ [with_call_logs=auto])
+if test "x$with_call_logs" != "xno" ; then
+ SAVE_CFLAGS=$CFLAGS
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CFLAGS="$CFLAGS $EMPATHY_CFLAGS"
+ CPPFLAGS="$CPPFLAGS $EMPATHY_CFLAGS"
+
+ AC_CHECK_HEADER(telepathy-logger/call-event.h,
+ have_call_logs="yes", have_call_logs="no")
+
+ CFLAGS=$SAVE_CFLAGS
+ CPPFLAGS=$SAVE_CPPFLAGS
+
+ if test "x$have_call_logs" = "xyes"; then
+ AC_DEFINE(HAVE_CALL_LOGS, 1, [Define if you have call log support])
+ fi
+else
+ have_call_logs=no
+fi
+
+if test "x$with_call_logs" = "xyes" -a "x$have_call_logs" != "xyes"; then
+ AC_MSG_ERROR([Call logs support requested but telepathy-logger wasn't
+ built with --enable-call])
+fi
+