aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-03-05 20:01:08 +0100
committerGuido Günther <agx@sigxcpu.org>2014-03-05 20:17:34 +0100
commitbde2ccae927c98caf9b9428f59a4c86aea863139 (patch)
treeef842fe77f29b151b805bfd03a8538cc32d8b312
parent54f96f2de1d96cce42a21e7062b0842772e77a2e (diff)
Don't open code GObject Introspetion
-rw-r--r--configure.ac37
-rw-r--r--src/Makefile.am64
2 files changed, 43 insertions, 58 deletions
diff --git a/configure.ac b/configure.ac
index 1e744c4..ee6e38f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,31 +46,7 @@ PKG_CHECK_MODULES(GIO2, gio-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
-AC_ARG_ENABLE([introspection],
- AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
- [], [enable_introspection=check])
-
-if test "x$enable_introspection" != "xno" ; then
- PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
- [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
- [enable_introspection=yes],
- [
- if test "x$enable_introspection" = "xcheck"; then
- enable_introspection=no
- else
- AC_MSG_ERROR([gobject-introspection is not available])
- fi
- ])
- if test "x$enable_introspection" = "xyes" ; then
- AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
- AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
- AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
- AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
- AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
- fi
-fi
-AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
-
+GOBJECT_INTROSPECTION_CHECK($GOBJECT_INTROSPECTION_REQUIRED)
GTK_DOC_CHECK([1.10])
@@ -101,3 +77,14 @@ AC_CONFIG_FILES(Makefile
)
AC_OUTPUT
+echo "
+ LibPlanFahr $VERSION
+ ==============================================
+
+ compiler: ${CC}
+ cflags: ${CFLAGS}
+ Debug: ${enable_debug}
+
+ GObject Introspection: ${found_introspection}
+ Documentation: ${enable_gtk_doc}
+"
diff --git a/src/Makefile.am b/src/Makefile.am
index 9956d9d..c98bb93 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,7 @@ libplanfahr_0_0_la_CFLAGS = \
libplanfahr_0_0_la_LIBADD = \
$(GIO2_LIBS) \
$(GOBJECT2_LIBS) \
- $(GTHREAD2_LIBS)
+ $(GTHREAD2_LIBS) \
$(NULL)
libplanfahr_0_0_la_DEPENDENCIES = \
@@ -59,41 +59,39 @@ libplanfahr_0_0_la_LDFLAGS = \
-Wl,--version-script=$(srcdir)/libplanfahr.sym \
-version-info $(LIBPLANFAHR_VERSION_INFO)
-if WITH_GOBJECT_INTROSPECTION
-
-Lpf-0.0.gir: libplanfahr-0.0.la $(G_IR_SCANNER) Makefile.am
- $(AM_V_GEN)$(G_IR_SCANNER) \
- --quiet \
- --warn-all \
- --namespace Lpf \
- --nsversion 0.0 \
- --include GObject-2.0 \
- --include Gio-2.0 \
- --symbol-prefix=lpf \
- --library=$(builddir)/libplanfahr-0.0.la \
- --output $@ \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- --verbose \
- --c-include="libplanfahr/libplanfahr.h" \
- --pkg=gthread-2.0 \
- --pkg-export=libplanfahr-0.0 \
- $(srcdir)/libplanfahr.h \
- $(PLANFAHR_SOURCE_FILES:%=$(srcdir)/%) \
- $(PLANFAHR_HEADER_FILES:%=$(srcdir)/%)
+if HAVE_INTROSPECTION
+
+INTROSPECTION_GIRS = Lpf-0.0.gir
+INTROSPECTION_SCANNER_ARGS = --warn-all
+INTROSPECTION_COMPILER_ARGS =
+
+Lpf-0.0.gir: libplanfahr-0.0.la
+Lpf_0_0_gir_INCLUDES = GObject-2.0 Gio-2.0
+Lpf_0_0_gir_CFLAGS = $(libplanfahr_0_0_la_CFLAGS)
+Lpf_0_0_gir_LIBS = $(builddir)/libplanfahr-0.0.la
+Lpf_0_0_gir_EXPORT_PACKAGES = libplanfahr-0.0
+Lpf_0_0_gir_SCANNERFLAGS = \
+ --c-include="libplanfahr/libplanfahr.h" \
+ --namespace=Lpf \
+ --symbol-prefix=lpf \
+ --pkg=gthread-2.0 \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ $(NULL)
+Lpf_0_0_gir_FILES = \
+ $(srcdir)/libplanfahr.h \
+ $(PLANFAHR_SOURCE_FILES:%=$(srcdir)/%) \
+ $(PLANFAHR_HEADER_FILES:%=$(srcdir)/%) \
+ $(NULL)
girdir = $(datadir)/gir-1.0
-gir_DATA = Lpf-0.0.gir
+nodist_gir_DATA = $(INTROSPECTION_GIRS)
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = Lpf-0.0.typelib
-
-%.typelib: %.gir
- $(AM_V_GEN)$(G_IR_COMPILER) \
- --includedir=$(builddir) \
- --includedir=$(girdir) \
- -o $@ $<
+typelibdir = $(libdir)/girepository-1.0
+nodist_typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES = $(gir_DATA) $(typelibs_DATA)
-endif # WITH_GOBJECT_INTROSPECTION
+endif # HAVE_INTROSPECTION
+
+-include $(INTROSPECTION_MAKEFILE)