public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@kernel.org>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 02/10] build: tweak PKG_CHECK_MODULES calls
Date: Tue, 16 Jan 2024 13:51:56 +0000	[thread overview]
Message-ID: <20240116-autofoo-v1-2-626f6b54bd06@gmail.com> (raw)
In-Reply-To: <20240116-autofoo-v1-0-626f6b54bd06@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

There's no need to call AC_SUBST after a PKG_CHECK_MODULES call, since
the variables are always set. As an example: the produced Makefile.in
and Makefile are identical before/after this change.

Similarly, we don't need the "dummy=yes" and manual AC_MSG_ERROR() call
- pkg-config (or pkgconf) will produce the same and in some cases better
  error messages.
---
 configure.ac | 59 ++++++++++++-----------------------------------------------
 1 file changed, 12 insertions(+), 47 deletions(-)

diff --git a/configure.ac b/configure.ac
index 307a2f30c..7cbfa8846 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,23 +72,16 @@ AC_CHECK_LIB(dl, dlopen, dummy=yes,
 
 AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
-				AC_MSG_ERROR(GLib >= 2.28 is required))
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28)
 
 if (test "${enable_threads}" = "yes"); then
 	AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
-	PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
-				AC_MSG_ERROR(GThread >= 2.16 is required))
+	PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16)
 	GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
 	GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
 fi
 
-PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.10, dummy=yes,
-				AC_MSG_ERROR(D-Bus >= 1.10 is required))
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
+PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.10)
 
 AC_ARG_WITH([dbusconfdir], AS_HELP_STRING([--with-dbusconfdir=DIR],
 				[path to D-Bus configuration directory]),
@@ -230,10 +223,7 @@ AM_CONDITIONAL(MONITOR, test "${enable_monitor}" != "no")
 AC_ARG_ENABLE(udev, AS_HELP_STRING([--disable-udev],
 		[disable udev device support]), [enable_udev=${enableval}])
 if (test "${enable_tools}" != "no" && test "${enable_udev}" != "no"); then
-	PKG_CHECK_MODULES(UDEV, libudev >= 172, dummy=yes,
-				AC_MSG_ERROR(libudev >= 172 is required))
-	AC_SUBST(UDEV_CFLAGS)
-	AC_SUBST(UDEV_LIBS)
+	PKG_CHECK_MODULES(UDEV, libudev >= 172)
 	AC_CHECK_LIB(udev, udev_hwdb_new,
 		AC_DEFINE(HAVE_UDEV_HWDB_NEW, 1,
 			[Define to 1 if you have the udev_hwdb_new() function.]))
@@ -260,10 +250,7 @@ AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh],
 AM_CONDITIONAL(MESH, test "${enable_mesh}" = "yes")
 
 if (test "${enable_mesh}" = "yes"); then
-	PKG_CHECK_MODULES(JSONC, json-c >= 0.13, dummy=yes,
-				AC_MSG_ERROR(json-c >= 0.13 is required))
-	AC_SUBST(JSON_CFLAGS)
-	AC_SUBST(JSON_LIBS)
+	PKG_CHECK_MODULES(JSONC, json-c >= 0.13)
 fi
 
 AC_ARG_ENABLE(midi, AS_HELP_STRING([--enable-midi],
@@ -271,19 +258,13 @@ AC_ARG_ENABLE(midi, AS_HELP_STRING([--enable-midi],
 AM_CONDITIONAL(MIDI, test "${enable_midi}" = "yes")
 
 if (test "${enable_midi}" = "yes"); then
-	PKG_CHECK_MODULES(ALSA, alsa, dummy=yes,
-			AC_MSG_ERROR(ALSA lib is required for MIDI support))
-	AC_SUBST(ALSA_CFLAGS)
-	AC_SUBST(ALSA_LIBS)
+	PKG_CHECK_MODULES(ALSA, alsa)
 fi
 
 AC_ARG_ENABLE(obex, AS_HELP_STRING([--disable-obex],
 		[disable OBEX profile support]), [enable_obex=${enableval}])
 if (test "${enable_obex}" != "no"); then
-	PKG_CHECK_MODULES(ICAL, libical, dummy=yes,
-					AC_MSG_ERROR(libical is required))
-	AC_SUBST(ICAL_CFLAGS)
-	AC_SUBST(ICAL_LIBS)
+	PKG_CHECK_MODULES(ICAL, libical)
 fi
 AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no")
 
@@ -295,10 +276,7 @@ AC_ARG_ENABLE([external_ell], AS_HELP_STRING([--enable-external-ell],
 				[enable external Embedded Linux library]),
 					[enable_external_ell=${enableval}])
 if (test "${enable_external_ell}" = "yes"); then
-	PKG_CHECK_MODULES(ELL, ell >= 0.39, dummy=yes,
-		AC_MSG_ERROR(Embedded Linux library >= 0.39 is required))
-	AC_SUBST(ELL_CFLAGS)
-	AC_SUBST(ELL_LIBS)
+	PKG_CHECK_MODULES(ELL, ell >= 0.39)
 fi
 if (test "${enable_external_ell}" != "yes" &&
 		(test "${enable_btpclient}" = "yes" || test "${enable_mesh}" = "yes")); then
@@ -442,17 +420,11 @@ AC_ARG_ENABLE(android, AS_HELP_STRING([--enable-android],
 AM_CONDITIONAL(ANDROID, test "${enable_android}" = "yes")
 
 if (test "${enable_android}" = "yes"); then
-	PKG_CHECK_MODULES(SBC, sbc >= 1.2, dummy=yes,
-			AC_MSG_ERROR(SBC library >= 1.2 is required))
-	AC_SUBST(SBC_CFLAGS)
-	AC_SUBST(SBC_LIBS)
+	PKG_CHECK_MODULES(SBC, sbc >= 1.2)
 fi
 
 if (test "${enable_android}" = "yes"); then
-	PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2, dummy=yes,
-			AC_MSG_ERROR(SPEEXDSP library >= 1.2 is required))
-	AC_SUBST(SPEEXDSP_CFLAGS)
-	AC_SUBST(SPEEXDSP_LIBS)
+	PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2)
 fi
 
 AC_DEFINE_UNQUOTED(ANDROID_STORAGEDIR, "${storagedir}/android",
@@ -466,15 +438,8 @@ if (test -z "${plugin_phonebook}"); then
 fi
 
 if (test "${plugin_phonebook}" = "ebook"); then
-	PKG_CHECK_MODULES(LIBEBOOK, [libebook-1.2 >= 3.3], dummy=yes,
-			AC_MSG_ERROR(libebook >= 3.3 is required))
-	AC_SUBST(LIBEBOOK_CFLAGS)
-	AC_SUBST(LIBEBOOK_LIBS)
-	PKG_CHECK_MODULES(LIBEDATESERVER, [libedataserver-1.2 >= 3.3],
-			dummy=yes,
-			AC_MSG_ERROR(libedataserver >= 3.3 is required))
-	AC_SUBST(LIBEDATESERVER_CFLAGS)
-	AC_SUBST(LIBEDATESERVER_LIBS)
+	PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= 3.3)
+	PKG_CHECK_MODULES(LIBEDATESERVER, libedataserver-1.2 >= 3.3)
 fi
 AC_SUBST(PLUGIN_PHONEBOOK, [${plugin_phonebook}])
 

-- 
2.43.0


  parent reply	other threads:[~2024-01-16 13:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 13:51 [PATCH BlueZ 00/10] Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service Emil Velikov via B4 Relay
2024-01-16 13:51 ` [PATCH BlueZ 01/10] build: remove unused AM_CONDITIONAL Emil Velikov via B4 Relay
2024-01-16 15:41   ` Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service bluez.test.bot
2024-01-16 13:51 ` Emil Velikov via B4 Relay [this message]
2024-01-16 13:51 ` [PATCH BlueZ 03/10] build: require libudev 196, circa 2012 Emil Velikov via B4 Relay
2024-01-16 13:51 ` [PATCH BlueZ 04/10] build: remove dummy {conf,state}{dir,_DATA} Emil Velikov via B4 Relay
2024-01-16 18:40   ` Luiz Augusto von Dentz
2024-01-17  8:39     ` Emil Velikov
2024-01-18 16:12       ` Emil Velikov
2024-01-18 17:05         ` Luiz Augusto von Dentz
2024-01-19 11:09           ` Emil Velikov
2024-01-19 15:09             ` Luiz Augusto von Dentz
2024-01-16 13:51 ` [PATCH BlueZ 05/10] build: remove unused variable builtin_nodist Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 06/10] build: remove .service files from DEPENDENCIES lists Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 07/10] build: remove explicit DEPENDENCIES handling Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 08/10] build: manage .service.in files via configure.ac Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 09/10] build: enable gc/dead code removal Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 10/10] build: install dbus-org.bluez.obex.service symlink Emil Velikov via B4 Relay
2024-01-16 19:02 ` [PATCH BlueZ 00/10] Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116-autofoo-v1-2-626f6b54bd06@gmail.com \
    --to=devnull+emil.l.velikov.gmail.com@kernel.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox