From a88af81133644e2d191f393043f79214ef3e871e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 7 Aug 2013 11:11:48 +0200 Subject: [PATCH 3/6] build: Find gdbus-codegen path from gio-2.0 pkg-config file --- configure.ac | 14 ++++++++++++++ src/Makefile.am | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3b4e4a3..825132c 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,20 @@ else fi AC_SUBST(DBUS_SYS_DIR) +# gdbus-codegen +if test x$cross_compiling != xyes; then + GDBUS_CODEGEN=`$PKG_CONFIG --variable gdbus_codegen gio-2.0` +else + AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen]) +fi +AC_SUBST([GDBUS_CODEGEN]) + +if test "x$GDBUS_CODEGEN" = "x"; then + ifelse([$2],,[AC_MSG_ERROR([gdbus-codegen not found.])],[$2]) +else + ifelse([$1],,[:],[$1]) +fi + GOBJECT_INTROSPECTION_CHECK([0.6.2]) AC_CONFIG_FILES([ diff --git a/src/Makefile.am b/src/Makefile.am index d72e268..6a2bb33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ libexec_PROGRAMS = geoclue dbus_built_sources = geoclue-interface.c geoclue-interface.h geoclue-interface.c: geoclue-interface.h geoclue-interface.h: Makefile.am geoclue-interface.xml - gdbus-codegen \ + $(AM_V_GEN)$(GDBUS_CODEGEN) \ --interface-prefix org.freedesktop.GeoClue2. \ --c-namespace GClue \ --generate-c-code geoclue-interface \ -- 1.8.3.1