aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2013-08-04 13:51:27 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-08-14 13:30:35 +0200
commitb8838b88829bdffd849eb115bd1a74932d6adabb (patch)
treeb6c381ae1a8e61cdf8c0c34c7c5b93b8d6887e81
parentd1d28687852a2e683e9c3f4ca0b6404a248c1b7c (diff)
libmm-glib: Generate GObject introspection information
Bug #705641.
-rw-r--r--configure.ac4
-rw-r--r--libmm-glib/Makefile.am75
-rw-r--r--libmm-glib/mm-helper-types.h10
3 files changed, 83 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 27bec405..4e029aff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,9 @@ AC_SUBST(GLIB_GENMARSHAL)
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)
+# GObject Introspection
+GOBJECT_INTROSPECTION_CHECK([0.9.6])
+
# DBus system directory
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
if test -n "$with_dbus_sys_dir" ; then
@@ -308,6 +311,7 @@ echo "
systemd unit directory: ${with_systemdsystemunitdir}
PolicyKit support: ${with_polkit}
+ GObject Introspection: ${found_introspection}
Documentation: ${enable_gtk_doc}
MBIM support: ${with_mbim}
QMI support: ${with_qmi}
diff --git a/libmm-glib/Makefile.am b/libmm-glib/Makefile.am
index 70594995..2e151a84 100644
--- a/libmm-glib/Makefile.am
+++ b/libmm-glib/Makefile.am
@@ -66,13 +66,17 @@ libmm_glib_la_SOURCES = \
mm-cdma-manual-activation-properties.c
libmm_glib_la_CPPFLAGS = \
- $(LIBMM_GLIB_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I${top_srcdir}/libmm-glib/generated \
-I${top_builddir}/libmm-glib/generated \
- -DLIBMM_GLIB_COMPILATION
+ -DLIBMM_GLIB_COMPILATION \
+ $(AM_CPPFLAGS)
+
+libmm_glib_la_CFLAGS = \
+ $(LIBMM_GLIB_CFLAGS) \
+ $(AM_CFLAGS)
libmm_glib_la_LIBADD = \
${top_builddir}/libmm-glib/generated/libmm-generated.la \
@@ -113,3 +117,70 @@ include_HEADERS = \
mm-network-timezone.h \
mm-firmware-properties.h \
mm-cdma-manual-activation-properties.h
+
+CLEANFILES =
+
+# Introspection
+
+if HAVE_INTROSPECTION
+
+GENERATED_H = \
+ mm-enums-types.h \
+ mm-errors-types.h \
+ mm-gdbus-manager.h \
+ mm-gdbus-sim.h \
+ mm-gdbus-sms.h \
+ mm-gdbus-bearer.h \
+ mm-gdbus-modem.h
+
+GENERATED_C = \
+ mm-enums-types.c \
+ mm-errors-types.c \
+ mm-errors-quarks.c \
+ mm-gdbus-manager.c \
+ mm-gdbus-sim.c \
+ mm-gdbus-sms.c \
+ mm-gdbus-bearer.c \
+ mm-gdbus-modem.c
+
+PUBLIC_H = \
+ ModemManager-names.h \
+ ModemManager-enums.h \
+ ModemManager-errors.h \
+ ModemManager-version.h \
+ ModemManager.h
+
+INTROSPECTION_GIRS = ModemManager-1.0.gir
+INTROSPECTION_SCANNER_ARGS = --warn-all
+INTROSPECTION_COMPILER_ARGS =
+
+ModemManager-1.0.gir: libmm-glib.la
+ModemManager_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gio-2.0
+ModemManager_1_0_gir_CFLAGS = $(libmm_glib_la_CPPFLAGS)
+ModemManager_1_0_gir_LIBS = libmm-glib.la
+ModemManager_1_0_gir_EXPORT_PACKAGES = libmm-glib
+ModemManager_1_0_gir_SCANNERFLAGS = \
+ --c-include "libmm-glib.h" \
+ --identifier-prefix=MM \
+ --identifier-prefix=Mm \
+ --symbol-prefix=mm
+ModemManager_1_0_gir_FILES = \
+ $(include_HEADERS) \
+ $(filter-out %.h,$(libmm_glib_la_SOURCES)) \
+ $(filter %.c,$(libmm_glib_la_SOURCES)) \
+ $(addprefix generated/,$(GENERATED_H)) \
+ $(addprefix generated/,$(GENERATED_C)) \
+ $(addprefix $(srcdir)/../include/,$(PUBLIC_H)) \
+ $(NULL)
+
+girdir = $(datadir)/gir-1.0
+nodist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+nodist_typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(nodist_gir_DATA) $(nodist_typelib_DATA)
+
+endif # HAVE_INTROSPECTION
+
+-include $(INTROSPECTION_MAKEFILE)
diff --git a/libmm-glib/mm-helper-types.h b/libmm-glib/mm-helper-types.h
index c235ff63..1f99d1ea 100644
--- a/libmm-glib/mm-helper-types.h
+++ b/libmm-glib/mm-helper-types.h
@@ -37,10 +37,11 @@
*
* #MMModemModeCombination is a simple struct holding a pair of #MMModemMode values.
*/
-typedef struct _MMModemModeCombination {
+typedef struct _MMModemModeCombination MMModemModeCombination;
+struct _MMModemModeCombination {
MMModemMode allowed;
MMModemMode preferred;
-} MMModemModeCombination;
+};
/**
* MMModemPortInfo:
@@ -49,10 +50,11 @@ typedef struct _MMModemModeCombination {
*
* Information of a given port.
*/
-typedef struct _MMModemPortInfo {
+typedef struct _MMModemPortInfo MMModemPortInfo;
+struct _MMModemPortInfo {
gchar *name;
MMModemPortType type;
-} MMModemPortInfo;
+};
void mm_modem_port_info_array_free (MMModemPortInfo *array,
guint array_size);