summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2010-01-15 15:18:26 +0000
committerRichard Hughes <richard@hughsie.com>2010-01-15 15:18:26 +0000
commit0d7bf34ed6702c60028fa80e5d481621e9741d09 (patch)
treec299f0186d1e5b132d43ad96e306e186b28a913a
parente93895a257b1215fa0ab0e3667e900df7709fa60 (diff)
downloadupower-0d7bf34ed6702c60028fa80e5d481621e9741d09.tar.gz
Add initial GObject introspection support
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac7
-rw-r--r--devkit-power-gobject/Makefile.am28
3 files changed, 34 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 5e9b8c0..6e1f46a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
+
SUBDIRS = devkit-power-gobject src doc tools policy po $(UDEV_RULES)
DIST_SUBDIRS = devkit-power-gobject src doc tools policy po rules
@@ -32,7 +34,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = devkit-power-gobject.pc
# xsltproc barfs on 'make distcheck'; disable for now
-DISTCHECK_CONFIGURE_FLAGS=--disable-man-pages --disable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS=--disable-man-pages --disable-gtk-doc --enable-introspection
clean-local :
rm -f *~
diff --git a/configure.ac b/configure.ac
index c86b00f..6a9f71d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,13 @@
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.59c)
+AC_PREREQ(2.62)
AC_INIT(DeviceKit-power, 015, http://lists.freedesktop.org/mailman/listinfo/devkit-devel)
AM_INIT_AUTOMAKE(DeviceKit-power, 015)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
+AC_CONFIG_MACRO_DIR([m4])
+
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
# enable nice build output on automake1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -53,7 +56,7 @@ AC_PATH_PROG([XSLTPROC], [xsltproc])
fi
AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)
-GTK_DOC_CHECK([1.3])
+GTK_DOC_CHECK([1.9])
# udev rules go in /lib, not /usr/lib
if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
diff --git a/devkit-power-gobject/Makefile.am b/devkit-power-gobject/Makefile.am
index 7068604..52492b2 100644
--- a/devkit-power-gobject/Makefile.am
+++ b/devkit-power-gobject/Makefile.am
@@ -8,6 +8,11 @@ INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
lib_LTLIBRARIES = \
libdevkit-power-gobject.la
@@ -62,8 +67,27 @@ libdevkit_power_gobject_la_CFLAGS = \
EXTRA_DIST = \
dkp-version.h.in
+CLEANFILES = $(BUILT_SOURCES)
+
+if HAVE_INTROSPECTION
+introspection_sources = $(libdevkit_power_gobject_la_SOURCES)
+
+DeviceKitPowerGlib-1.0.gir: libdevkit-power-gobject.la
+DeviceKitPowerGlib_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
+DeviceKitPowerGlib_1_0_gir_CFLAGS = $(INCLUDES) -DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE
+DeviceKitPowerGlib_1_0_gir_LIBS = libdevkit-power-gobject.la
+DeviceKitPowerGlib_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
+INTROSPECTION_GIRS += DeviceKitPowerGlib-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepositry-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
+endif
+
clean-local:
rm -f *~
-CLEANFILES = $(BUILT_SOURCES)
-