[gtk-vnc] Rework introspection support so it works on FreeBSD.



commit 6359563b7b83e958be53dd6efbbac899802edfc3
Author: Koop Mast <kwm rainbow-runner nl>
Date:   Sat Dec 14 23:36:24 2013 +0100

    Rework introspection support so it works on FreeBSD.
    
    Based on the following documentation.
    
    https://wiki.gnome.org/Projects/GObjectIntrospection/AutotoolsIntegration

 configure.ac    |   44 +----------------
 src/Makefile.am |  142 +++++++++++++++++++++---------------------------------
 2 files changed, 57 insertions(+), 129 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ff38b17..ecb33cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,9 +42,6 @@ GTHREAD_REQUIRED=2.0.0
 PYTHON_REQUIRED=2.4
 CAIRO_REQUIRED=1.2.0
 
-GOBJECT_INTROSPECTION_REQUIRED=0.6.2
-GOBJECT_INTROSPECTION_DESIRED=0.9.4
-
 dnl *******************************************************************************
 dnl Get the version information at compile-time
 dnl *******************************************************************************
@@ -385,44 +382,7 @@ AM_CONDITIONAL(WITH_PYTHON, [test "$WITH_PYTHON" = "yes"])
 
 AM_CONDITIONAL(WITH_EXAMPLES, [test "$WITH_EXAMPLES" = "yes"])
 
-AC_ARG_ENABLE([introspection],
-        AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
-        [], [enable_introspection=check])
-
-has_symbol_prefix=no
-if test "x$enable_introspection" != "xno" ; then
-        PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
-                          [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_DESIRED],
-                          [
-                             enable_introspection=yes
-                             has_symbol_prefix=yes
-                          ],
-                          [
-                          PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
-                              [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
-                              [
-                                 enable_introspection=yes
-                                 has_symbol_prefix=no
-                              ],
-                              [
-                                 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"])
-AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"])
+GOBJECT_INTROSPECTION_CHECK([0.9.4])
 
 if test "x$with_gtk" = "x3.0"; then
         default_vala=check
@@ -433,7 +393,7 @@ fi
 AC_ARG_ENABLE([vala],
               AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
               [], [enable_vala="$default_vala"])
-if test "x$enable_introspection" = "xyes" ; then
+if test "x$found_introspection" = "xyes" ; then
         if test "x$enable_vala" != "xno" ; then
                 AC_PATH_PROG(VAPIGEN, vapigen, no)
                 if test "x$VAPIGEN" != "xno"; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 102a2e9..306044b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -337,8 +337,17 @@ else
 EXTRA_DIST += vnc.override vncmodule.c
 endif
 
-if WITH_GOBJECT_INTROSPECTION
-
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --symbol-prefix=vnc \
+                       --identifier-prefix=Vnc \
+                       --add-include-path=$(top_srcdir) \
+                       --add-include-path=$(srcdir) \
+                       --add-include-path=$(builddir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(top_srcdir) \
+                       --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
 GVNC_INTROSPECTION_SRCS = \
                        $(srcdir)/vncpixelformat.h \
                        $(srcdir)/vncaudioformat.h $(srcdir)/vncaudioformat.c \
@@ -367,99 +376,58 @@ GTK_VNC_INTROSPECTION_SRCS += \
                        $(srcdir)/vncimageframebuffer.h $(srcdir)/vncimageframebuffer.c
 endif
 
-if G_IR_SCANNER_SYMBOL_PREFIX
-PREFIX_ARGS = --symbol-prefix=vnc --identifier-prefix=Vnc
-else
-PREFIX_ARGS = --strip-prefix=Vnc
-endif
-
-GVnc-1.0.gir: libgvnc-1.0.la $(G_IR_SCANNER) Makefile.am
-       $(AM_V_GEN)$(G_IR_SCANNER) \
-                --namespace GVnc \
-                --nsversion 1.0 \
-               --include GObject-2.0 \
-               $(PREFIX_ARGS) \
-                --library=$(builddir)/libgvnc-1.0.la \
-                --add-include-path=$(top_srcdir) \
-                --add-include-path=$(srcdir) \
-                --add-include-path=$(builddir) \
-               --c-include="gvnc.h" \
-                --output $@ \
-                -I$(top_srcdir) \
-                -I$(srcdir) \
-               --verbose \
-               --pkg=gobject-2.0 \
-                --pkg-export=gvnc-1.0 \
-                $(GVNC_INTROSPECTION_SRCS)
-
-GVncPulse-1.0.gir: GVnc-1.0.gir libgvncpulse-1.0.la $(G_IR_SCANNER) Makefile.am
-       $(AM_V_GEN)$(G_IR_SCANNER) -v \
-                --namespace GVncPulse \
-                --nsversion 1.0 \
-               --include GObject-2.0 \
-               --include-uninstalled $(builddir)/GVnc-1.0.gir \
-               $(PREFIX_ARGS) \
-                --library=$(builddir)/libgvnc-1.0.la \
-                --library=$(builddir)/libgvncpulse-1.0.la \
-                --add-include-path=$(top_srcdir) \
-                --add-include-path=$(srcdir) \
-                --add-include-path=$(builddir) \
-               --c-include="gvncpulse.h" \
-                --output $@ \
-                -I$(top_srcdir) \
-                -I$(srcdir) \
-               --verbose \
-               --pkg=gobject-2.0 \
-               --pkg=libpulse-simple \
-                --pkg-export=gvncpulse-1.0 \
-                $(GVNCPULSE_INTROSPECTION_SRCS)
-
-GtkVnc-$(GTK_VNC_API_VERSION).gir: GVnc-1.0.gir libgtk-vnc-$(GTK_VNC_API_VERSION).la $(G_IR_SCANNER) 
Makefile.am
-       $(AM_V_GEN)$(G_IR_SCANNER) \
-                --namespace GtkVnc \
-                --nsversion $(GTK_VNC_API_VERSION) \
-               --include GObject-2.0 \
-               --include Gtk-$(GTK_API_VERSION) \
-               --include-uninstalled $(builddir)/GVnc-1.0.gir \
-               $(PREFIX_ARGS) \
-                --library=$(builddir)/libgvnc-1.0.la \
-                --library=$(builddir)/libgtk-vnc-$(GTK_VNC_API_VERSION).la \
-                --add-include-path=$(top_srcdir) \
-                --add-include-path=$(srcdir) \
-                --add-include-path=$(builddir) \
-               --c-include="gtk-vnc.h" \
-                --output $@ \
-                -I$(top_srcdir) \
-                -I$(srcdir) \
-               --verbose \
-               --pkg=gobject-2.0 \
-               --pkg=gtk+-$(GTK_API_VERSION) \
-                --pkg-export=gtk-vnc-$(GTK_VNC_API_VERSION) \
-                $(GTK_VNC_INTROSPECTION_SRCS)
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = GVnc-1.0.gir GtkVnc-$(GTK_VNC_API_VERSION).gir
+GVnc-1.0.gir: libgvnc-1.0.la
+GVnc_1_0_gir_INCLUDES = GObject-2.0
+GVnc_1_0_gir_PACKAGES = gobject-2.0
+GVnc_1_0_gir_EXPORT_PACKAGES = gvnc-1.0
+GVnc_1_0_gir_LIBS = libgvnc-1.0.la
+GVnc_1_0_gir_FILES = $(GVNC_INTROSPECTION_SRCS)
+GVnc_1_0_gir_CFLAGS = $(libgvnc_1_0_la_CFLAGS) -I$(srcdir)
+GVnc_1_0_gir_SCANNERFLAGS = --c-include="gvnc.h"
+INTROSPECTION_GIRS += GVnc-1.0.gir
 
 if HAVE_PULSEAUDIO
-gir_DATA += GVncPulse-1.0.gir
+GVncPulse-1.0.gir: libgvncpulse-1.0.la
+GVncPulse_1_0_gir_INCLUDES = GObject-2.0 GVnc-1.0
+GVncPulse_1_0_gir_PACKAGES = gobject-2.0 libpulse-simple
+GVncPulse_1_0_gir_EXPORT_PACKAGES = gvnc-1.0
+GVncPulse_1_0_gir_LIBS = libgvnc-1.0.la libgvncpulse-1.0.la
+GVncPulse_1_0_gir_FILES = $(GVNCPULSE_INTROSPECTION_SRCS)
+GVncPulse_1_0_gir_CFLAGS = $(libgvnc_1_0_la_CFLAGS) $(libgvncpulse_1_0_la_CFLAGS) -I$(srcdir)
+GVncPulse_1_0_gir_SCANNERFLAGS = --c-include="gvncpulse.h"
+INTROSPECTION_GIRS += GVncPulse-1.0.gir
 endif
 
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = GVnc-1.0.typelib GtkVnc-$(GTK_VNC_API_VERSION).typelib
-
-if HAVE_PULSEAUDIO
-typelibs_DATA += GVncPulse-1.0.typelib
+if HAVE_GTK_2
+GtkVnc-1.0.gir: libgtk-vnc-$(GTK_VNC_API_VERSION).la
+GtkVnc_1_0_gir_INCLUDES = GObject-2.0 GVnc-1.0
+GtkVnc_1_0_gir_PACKAGES = gobject-2.0 gtk+-$(GTK_API_VERSION)
+GtkVnc_1_0_gir_EXPORT_PACKAGES = gtk-vnc-$(GTK_VNC_API_VERSION)
+GtkVnc_1_0_gir_LIBS = libgvnc-1.0.la libgtk-vnc-$(GTK_VNC_API_VERSION).la
+GtkVnc_1_0_gir_FILES = $(GTK_VNC_INTROSPECTION_SRCS)
+GtkVnc_1_0_gir_CFLAGS = $(libgvnc_1_0_la_CFLAGS) $(libgvncpulse_1_0_la_CFLAGS) -I$(srcdir)
+GtkVnc_1_0_gir_SCANNERFLAGS = --c-include="gtk-vnc.h"
+INTROSPECTION_GIRS += GtkVnc-1.0.gir
+else
+GtkVnc-2.0.gir: libgtk-vnc-2.0.la
+GtkVnc_2_0_gir_INCLUDES = GObject-2.0 GVnc-1.0
+GtkVnc_2_0_gir_PACKAGES = gobject-2.0 gtk+-$(GTK_API_VERSION)
+GtkVnc_2_0_gir_EXPORT_PACKAGES = gtk-vnc-$(GKT_VNC_API_VERSION)
+GtkVnc_2_0_gir_LIBS = libgvnc-1.0.la libgtk-vnc-$(GTK_VNC_API_VERSION).la
+GtkVnc_2_0_gir_FILES = $(GTK_VNC_INTROSPECTION_SRCS)
+GtkVnc_2_0_gir_CFLAGS = $(libgvnc_1_0_la_CFLAGS) $(libgvncpulse_1_0_la_CFLAGS) -I$(srcdir)
+GtkVnc_2_0_gir_SCANNERFLAGS = --c-include="gtk-vnc.h"
+INTROSPECTION_GIRS += GtkVnc-2.0.gir
 endif
 
-%.typelib: %.gir
-       $(AM_V_GEN)$(G_IR_COMPILER) \
-               --includedir=$(srcdir) \
-               --includedir=$(builddir) \
-               --includedir=$(girdir) \
-               -o $@ $<
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
 
-endif # WITH_GOBJECT_INTROSPECTION
+endif # HAVE_INTROSPECTION
 
 -include $(top_srcdir)/git.mk


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]