linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus
@ 2024-09-04 14:01 Bartosz Golaszewski
  2024-09-04 14:09 ` Kent Gibson
  2024-09-05  7:32 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-09-04 14:01 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij; +Cc: linux-gpio, Bartosz Golaszewski, Douglas Silva

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

GLib bindings are required to build the D-Bus daemon. Enable them
automatically if --enable-dbus is passed to configure.

Fixes: a5ab76da1e0a ("dbus: add the D-Bus daemon, command-line client and tests")
Reported-by: Douglas Silva <doug.hs@proton.me>
Suggested-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
v1 -> v2:
- make the changes actually work

 configure.ac | 52 +++++++++++++++++++++++++---------------------------
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1ac1002..92d3408 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,10 +250,35 @@ then
 	fi
 fi
 
+AC_ARG_ENABLE([dbus],
+	[AS_HELP_STRING([--enable-dbus], [build dbus daemon [default=no]])],
+	[if test "x$enableval" == xyes; then with_dbus=true; fi],
+	[with_dbus=false])
+AM_CONDITIONAL([WITH_DBUS], [test "x$with_dbus" = xtrue])
+
 AC_ARG_ENABLE([bindings-glib],
 	[AS_HELP_STRING([--enable-bindings-glib],[enable GLib 2.0 bindings [default=no]])],
 	[if test "x$enableval" = xyes; then with_bindings_glib=true; fi],
 	[with_bindings_glib=false])
+
+AC_DEFUN([FUNC_NOT_FOUND_DBUS],
+	[ERR_NOT_FOUND([$1()], [dbus daemon])])
+
+if test "x$with_dbus" = xtrue
+then
+	AC_CHECK_FUNC([daemon], [], [FUNC_NOT_FOUND_DBUS([daemon])])
+	AC_CHECK_FUNC([strverscmp], [], [FUNC_NOT_FOUND_DBUS([strverscmp])])
+	PKG_CHECK_MODULES([GUDEV], [gudev-1.0 >= 230])
+	AC_CHECK_PROG([has_gdbus_codegen], [gdbus-codegen], [true], [false])
+	if test "x$has_gdbus_codegen" = xfalse
+	then
+		AC_MSG_ERROR([gdbus-codegen not found - needed to build dbus daemon])
+	fi
+
+	# Imply GLib bindings for D-Bus
+	with_bindings_glib=true
+fi
+
 AM_CONDITIONAL([WITH_BINDINGS_GLIB], [test "x$with_bindings_glib" = xtrue])
 
 if test "x$with_bindings_glib" = xtrue
@@ -280,33 +305,6 @@ m4_ifdef([GOBJECT_INTROSPECTION_CHECK],
 	[GOBJECT_INTROSPECTION_CHECK([0.6.2])],
 	[AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")])
 
-# Depends on GLib bindings so must come after
-AC_ARG_ENABLE([dbus],
-	[AS_HELP_STRING([--enable-dbus], [build dbus daemon [default=no]])],
-	[if test "x$enableval" == xyes; then with_dbus=true; fi],
-	[with_dbus=false])
-AM_CONDITIONAL([WITH_DBUS], [test "x$with_dbus" = xtrue])
-
-AC_DEFUN([FUNC_NOT_FOUND_DBUS],
-	[ERR_NOT_FOUND([$1()], [dbus daemon])])
-
-if test "x$with_dbus" = xtrue && test "x$with_bindings_glib" != xtrue
-then
-	AC_MSG_ERROR([GLib bindings are required to build the dbus daemon - use --enable-bindings-glib])
-fi
-
-if test "x$with_dbus" = xtrue
-then
-	AC_CHECK_FUNC([daemon], [], [FUNC_NOT_FOUND_DBUS([daemon])])
-	AC_CHECK_FUNC([strverscmp], [], [FUNC_NOT_FOUND_DBUS([strverscmp])])
-	PKG_CHECK_MODULES([GUDEV], [gudev-1.0 >= 230])
-	AC_CHECK_PROG([has_gdbus_codegen], [gdbus-codegen], [true], [false])
-	if test "x$has_gdbus_codegen" = xfalse
-	then
-		AC_MSG_ERROR([gdbus-codegen not found - needed to build dbus daemon])
-	fi
-fi
-
 AC_ARG_ENABLE([systemd],
 	[AS_HELP_STRING([--enable-systemd], [enable systemd support [default=no]])],
 	[if test "x$enableval" == xyes; then with_systemd=true; fi],
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus
  2024-09-04 14:01 [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus Bartosz Golaszewski
@ 2024-09-04 14:09 ` Kent Gibson
  2024-09-05  7:32 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Kent Gibson @ 2024-09-04 14:09 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, linux-gpio, Bartosz Golaszewski, Douglas Silva

On Wed, Sep 04, 2024 at 04:01:27PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> GLib bindings are required to build the D-Bus daemon. Enable them
> automatically if --enable-dbus is passed to configure.
>
> Fixes: a5ab76da1e0a ("dbus: add the D-Bus daemon, command-line client and tests")
> Reported-by: Douglas Silva <doug.hs@proton.me>
> Suggested-by: Kent Gibson <warthog618@gmail.com>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> v1 -> v2:
> - make the changes actually work
>

That works for me.

Tested-by: Kent Gibson <warthog618@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus
  2024-09-04 14:01 [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus Bartosz Golaszewski
  2024-09-04 14:09 ` Kent Gibson
@ 2024-09-05  7:32 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-09-05  7:32 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-gpio, Douglas Silva

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Wed, 04 Sep 2024 16:01:27 +0200, Bartosz Golaszewski wrote:
> GLib bindings are required to build the D-Bus daemon. Enable them
> automatically if --enable-dbus is passed to configure.
> 
> 

Applied, thanks!

[1/1] build: imply --enable-bindings-glib for --enable-dbus
      commit: d78d43bcfffdf5c96702a668a5df3a116aa4c8d7

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-05  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 14:01 [libgpiod][PATCH v2] build: imply --enable-bindings-glib for --enable-dbus Bartosz Golaszewski
2024-09-04 14:09 ` Kent Gibson
2024-09-05  7:32 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).