[vinagre] Check for glib-genmarshal and glib-mkenums



commit 81b5fa91e61018d00ac6581fa1f4b3446fde7856
Author: David King <amigadave amigadave com>
Date:   Mon Mar 7 17:18:09 2011 +0100

    Check for glib-genmarshal and glib-mkenums
    
    Check the GLib pkg-config file for glib-genmarshal and glib-mkenums,
    AC_SUBST the variables and use them in vinagre/Makefile.am.

 configure.ac        |   16 ++++++++++++++++
 vinagre/Makefile.am |    8 ++++----
 2 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1646ade..965a3ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,8 @@ GNOME_MAINTAINER_MODE_DEFINES
 LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
 
+PKG_PROG_PKG_CONFIG([0.16])
+
 # TODO: Bump before release with GTK+ 3 support.
 # TODO: Use in name of pkg-config file, plugin path and where appropriate.
 AC_SUBST([VINAGRE_API_VERSION], [1.0])
@@ -33,6 +35,20 @@ GTK_VNC_DEPS="gtk-vnc-2.0 >= 0.4.3"
 XML2_DEPS="libxml-2.0 >= 2.6.31"
 PEAS_DEPS="libpeas-1.0 >= 0.7.2 libpeas-gtk-1.0 >= 0.7.2"
 
+AC_MSG_CHECKING([for glib-genmarshal script])
+GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+AS_IF([test "x$GLIB_GENMARSHAL" = "x"],
+  [AC_MSG_ERROR([glib-genmarshal not listed in glib-2.0 pkg-config file])],
+  [AC_SUBST([GLIB_GENMARSHAL])
+    AC_MSG_RESULT([$GLIB_GENMARSHAL])])
+
+AC_MSG_CHECKING([for glib-mkenums script])
+GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+AS_IF([test "x$GLIB_MKENUMS" = "x"],
+  [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
+  [AC_SUBST([GLIB_MKENUMS])
+    AC_MSG_RESULT([$GLIB_MKENUMS])])
+
 # Whether to enable support for SSH.
 SSH_DEPS="vte-2.90 >= 0.20 $XML2_DEPS"
 
diff --git a/vinagre/Makefile.am b/vinagre/Makefile.am
index c21366e..fd16c19 100644
--- a/vinagre/Makefile.am
+++ b/vinagre/Makefile.am
@@ -207,7 +207,7 @@ vinagre_enum_headers = \
 	$(NULL)
 
 vinagre-enums.c: $(vinagre_enum_headers)
-	$(AM_V_GEN)glib-mkenums    --fhead "#include <glib-object.h>\n" \
+	$(AM_V_GEN)$(GLIB_MKENUMS) --fhead "#include <glib-object.h>\n" \
 			--fhead "#include \"vinagre-enums.h\"\n\n" \
 			--fprod "\n/* enumerations from \"@filename \" */" \
 			--fprod "\n#include \"@filename \"\n" \
@@ -222,7 +222,7 @@ vinagre-enums.c: $(vinagre_enum_headers)
 		$(vinagre_enum_headers) > $@
 
 vinagre-enums.h: $(vinagre_enum_headers)
-	$(AM_V_GEN)glib-mkenums    --fhead "#ifndef __VINAGRE_ENUMS_H__\n" \
+	$(AM_V_GEN)$(GLIB_MKENUMS) --fhead "#ifndef __VINAGRE_ENUMS_H__\n" \
 			--fhead "#define __VINAGRE_ENUMS_H__ 1\n\n" \
 			--fhead "G_BEGIN_DECLS\n\n" \
 			--ftail "G_END_DECLS\n\n" \
@@ -244,11 +244,11 @@ vinagre-marshal.list: $(handwritten_sources) Makefile.am
 	fi
 
 %-marshal.h: %-marshal.list Makefile
-	$(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+	$(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
 
 %-marshal.c: %-marshal.list Makefile
 	$(AM_V_GEN)echo "#include \"vinagre-marshal.h\"" > $@ && \
-	glib-genmarshal --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+	$(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
 
 BUILT_SOURCES = \
 	vinagre-enums.c \



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