[libgpiod][PATCH] build: add an additional check for glib-mkenums

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

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

Some distros split glib-mkenums and other GLib build utilities into a
separate package but the glib-2.0 pkgconfig file pointing to it is
typically shipped as part of the -dev package. This can lead to a
situation where configure thinks it knows where glib-mkenums is but make
then fails because it's not really installed on the system. Check the
existence of the actual executable in addition to querying pkgconfig.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 configure.ac | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index cfa0997..60ccb1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,6 +281,9 @@ fi
 
 AM_CONDITIONAL([WITH_BINDINGS_GLIB], [test "x$with_bindings_glib" = xtrue])
 
+AC_DEFUN([GLIB_MKENUMS_NOT_FOUND],
+	 [AC_MSG_ERROR([glib-mkenums not found - needed to build GLib bindings])])
+
 if test "x$with_bindings_glib" = xtrue
 then
 	PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.80])
@@ -288,8 +291,12 @@ then
 	PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.80])
 	PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.80])
 	PKG_PROG_PKG_CONFIG([0.28])
-	PKG_CHECK_VAR([GLIB_MKENUMS], [glib-2.0], [glib_mkenums], [],
-		AC_MSG_ERROR([glib-mkenums not found - needed to build GLib bindings]))
+	PKG_CHECK_VAR([GLIB_MKENUMS], [glib-2.0], [glib_mkenums], [], GLIB_MKENUMS_NOT_FOUND)
+	AC_CHECK_PROG([has_glib_mkenums], [glib-mkenums], [true], [false])
+	if test "x$has_glib_mkenums" == xfalse
+	then
+		GLIB_MKENUMS_NOT_FOUND
+	fi
 
 	AC_CHECK_PROG([has_gi_docgen], [gi-docgen], [true], [false])
 	if test "x$has_gi_docgen" = xfalse
-- 
2.43.0





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux