core: only enable location API for dbus-glib >= 0.86
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+16
-7
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user