aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-04-04 09:17:08 -0700
committerDan Williams <dcbw@redhat.com>2010-04-04 09:17:08 -0700
commit2f1fbfb52039813283add147f79f287d6dc3f3df (patch)
tree5a4a73477dda06eb14ea8f49229a52ca144b3eb6
parentf39afdd5f7c5d6ed56dd7a00ddb13de12dcda5b8 (diff)
core: only enable location API for dbus-glib >= 0.86
-rw-r--r--configure.ac15
-rw-r--r--src/Makefile.am23
-rw-r--r--src/mm-modem-location.c10
3 files changed, 41 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 3a6cb71c..cd7b8ebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,19 @@ esac
NM_COMPILER_WARNINGS
+
+dnl
+dnl dbus-glib >= 0.86 is required for Location API support
+dnl
+with_location_api=no
+PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.86, with_location_api="yes", with_location_api="no")
+if test x"$with_location_api" = xyes; then
+ AC_DEFINE(LOCATION_API, 1, [Define if you have dbus-glib 0.86 or higher])
+else
+ AC_MSG_WARN([dbus-glib >= 0.86 is required for Location API support])
+fi
+AM_CONDITIONAL(WITH_LOCATION_API, test "x$with_location_api" = "xyes")
+
AC_CONFIG_FILES([
Makefile
marshallers/Makefile
@@ -140,4 +153,6 @@ echo Building PPP-enabled tests: ${have_pppd_headers}
echo
echo Building with PolicyKit support: ${with_polkit}
echo
+echo Building with Location API support: ${with_location_api}
+echo
diff --git a/src/Makefile.am b/src/Makefile.am
index 29d2635e..fd72239f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,6 +50,10 @@ auth_sources += \
mm-auth-provider-polkit.h
endif
+loc_sources = \
+ mm-modem-location.c \
+ mm-modem-location.h
+
modem_manager_SOURCES = \
main.c \
mm-callback-info.c \
@@ -88,8 +92,6 @@ modem_manager_SOURCES = \
mm-modem-gsm-sms.h \
mm-modem-simple.c \
mm-modem-simple.h \
- mm-modem-location.c \
- mm-modem-location.h \
mm-options.c \
mm-options.h \
mm-plugin.c \
@@ -120,9 +122,6 @@ mm-modem-gsm-network-glue.h: $(top_srcdir)/introspection/mm-modem-gsm-network.xm
mm-modem-gsm-sms-glue.h: $(top_srcdir)/introspection/mm-modem-gsm-sms.xml
dbus-binding-tool --prefix=mm_modem_gsm_sms --mode=glib-server --output=$@ $<
-mm-modem-location-glue.h: $(top_srcdir)/introspection/mm-modem-location.xml
- dbus-binding-tool --prefix=mm_modem_location --mode=glib-server --output=$@ $<
-
BUILT_SOURCES = \
mm-manager-glue.h \
mm-modem-glue.h \
@@ -130,7 +129,17 @@ BUILT_SOURCES = \
mm-modem-cdma-glue.h \
mm-modem-gsm-card-glue.h \
mm-modem-gsm-network-glue.h \
- mm-modem-gsm-sms-glue.h \
- mm-modem-location-glue.h
+ mm-modem-gsm-sms-glue.h
+
+if WITH_LOCATION_API
+mm-modem-location-glue.h: $(top_srcdir)/introspection/mm-modem-location.xml
+ dbus-binding-tool --prefix=mm_modem_location --mode=glib-server --output=$@ $<
+
+modem_manager_SOURCES += $(loc_sources)
+
+BUILT_SOURCES += mm-modem-location-glue.h
+else
+EXTRA_DIST = $(loc_sources)
+endif
CLEANFILES = $(BUILT_SOURCES)
diff --git a/src/mm-modem-location.c b/src/mm-modem-location.c
index 886d0326..00182950 100644
--- a/src/mm-modem-location.c
+++ b/src/mm-modem-location.c
@@ -314,6 +314,16 @@ mm_modem_location_get_type (void)
g_type_interface_add_prerequisite (loc_type, G_TYPE_OBJECT);
dbus_g_object_type_install_info (loc_type, &dbus_glib_mm_modem_location_object_info);
+
+ /* Register some shadow properties to handle Enabled and Capabilities
+ * since these could be used by other interfaces.
+ */
+ dbus_g_object_type_register_shadow_property (loc_type,
+ "Enabled",
+ MM_MODEM_LOCATION_ENABLED);
+ dbus_g_object_type_register_shadow_property (loc_type,
+ "Capabilities",
+ MM_MODEM_LOCATION_CAPABILITIES);
}
return loc_type;