+# -----------------------------------------------------------
+# Connectivity integration
+# -----------------------------------------------------------
+AC_ARG_WITH(connectivity,
+ AS_HELP_STRING([--with-connectivity=@<:@nm/connman/auto/no@:>@],
+ [build with connectivity support]), ,
+ with_connectivity=auto)
+
+if test "x$with_connectivity" = "xno"; then
+ have_nm=no
+ have_connman=no
+
+elif test "x$with_connectivity" = "xconnman"; then
+
+ PKG_CHECK_MODULES(CONNMAN,
+ [
+ dbus-glib-1
+ ], have_connman="yes", have_connman="no")
+
+ if test "x$have_connman" = "xyes"; then
+ AC_DEFINE(HAVE_CONNMAN, 1, [Define if you have connman dependencies])
+ have_nm=no
+ fi
+
+else
+
+ PKG_CHECK_MODULES(NETWORK_MANAGER,
+ [
+ libnm_glib >= $NETWORK_MANAGER_REQUIRED
+ ], have_nm="yes", have_nm="no")
+
+ if test "x$have_nm" = "xyes"; then
+ AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
+ have_connman=no
+ fi
+fi
+
+if test "x$with_connectivity" = "xconnman" -a "x$have_connman" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find connman dependencies.])
+fi
+
+if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find libnm-glib dependencies.])
+fi
+
+AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
+AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
+
+# -----------------------------------------------------------
+# Webkit
+# -----------------------------------------------------------
+AC_ARG_ENABLE(webkit,
+ AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
+ [build with webkit support]), ,
+ enable_webkit=auto)
+
+if test "x$enable_webkit" != "xno"; then
+ PKG_CHECK_MODULES(WEBKIT,
+ [
+ webkit-1.0 >= $WEBKIT_REQUIRED
+ ], have_webkit="yes", have_webkit="no")
+
+ if test "x$have_webkit" = "xyes"; then
+ AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
+ fi
+else
+ have_webkit=no
+fi
+
+if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find webkit dependencies.])
+fi
+AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
+