Commit 657202df authored by Jussi Kukkonen's avatar Jussi Kukkonen

libconic-enable hostip-backend

hostip position backend now works with libconic if it is present:
It queries the position from hostip.info whenever there is a new
network connection and saves it. Saved data is considered valid
as long as the connection is alive. This means that
   a) current_position method has no network latency
   b) position_changed events are fired
parent 55f65a6f
......@@ -18,8 +18,8 @@ $(service_DATA): $(service_in_files) Makefile
done
AM_CPPFLAGS = $(YAHOO_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS) ../../geoclue/libgeoclue.la
AM_CPPFLAGS = $(YAHOO_CFLAGS) $(CONIC_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS) $(CONIC_LIBS) ../../geoclue/libgeoclue.la
EXTRA_DIST = \
geoclue_position_server_hostip.h \
......
......@@ -22,9 +22,18 @@
#define DBUS_API_SUBJECT_TO_CHANGE
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <glib.h>
#ifdef HAVE_LIBCONIC
#include <conicconnection.h>
#endif
#define GEOCLUE_POSITION_DBUS_SERVICE "org.foinse_project.geoclue.position.hostip"
#define GEOCLUE_POSITION_DBUS_PATH "/org/foinse_project/geoclue/position/hostip"
#define GEOCLUE_POSITION_DBUS_INTERFACE "org.foinse_project.geoclue.position"
......@@ -39,8 +48,15 @@ GType geoclue_position_get_type (void);
struct GeocluePosition
{
GObject parent;
GMainLoop* loop;
GMainLoop* loop;
gdouble current_lat;
gdouble current_lon;
gboolean is_current_valid;
#ifdef HAVE_LIBCONIC
ConIcConnection* net_connection;
DBusConnection* dbus_connection;
#endif
};
struct GeocluePositionClass
......
......@@ -64,10 +64,18 @@ if test "x$ac_cv_libgps" != xyes; then
AC_MSG_ERROR([Install gpsd Debian package or its source-code equivalent])
fi
dnl check for libgpsbt
dnl check for libgpsbt and libgpsmgr
AC_CHECK_LIB(gpsmgr, gpsmgr_is_gpsd_running)
AC_CHECK_LIB(gpsbt, gpsbt_start)
dnl check for libconic
PKG_CHECK_MODULES(CONIC, conic, [have_libconic=yes], [have_libconic=no])
AC_SUBST(CONIC_CFLAGS)
AC_SUBST(CONIC_LIBS)
if test "x$have_libconic" = "xyes"; then
AC_DEFINE(HAVE_LIBCONIC, 1, [define if libconic is installed])
fi
PKG_CHECK_MODULES(HTTPXML, libsoup-2.2 libxml-2.0)
AC_SUBST(HTTPXML_CFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment