These days pkg-config does the right thing pretty much automatically so
the usage of the autoconf macros can be simplified a bit. This
functionality exists from pkg-config 0.24, which is already pretty old,
so we specify that as a minimum version for that utility.
---
configure.ac | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5680d65b..044700b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ AM_MAINTAINER_MODE
AC_PREFIX_DEFAULT(/usr/local)
-PKG_PROG_PKG_CONFIG
+PKG_PROG_PKG_CONFIG([0.24])
COMPILER_FLAGS
@@ -60,15 +60,8 @@ AC_CHECK_FUNC(signalfd, dummy=yes,
AC_CHECK_LIB(dl, dlopen, dummy=yes,
AC_MSG_ERROR(dynamic linking loader is required))
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32, dummy=yes,
- AC_MSG_ERROR(GLib >= 2.32 is required))
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
- AC_MSG_ERROR(D-Bus >= 1.4 is required))
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32)
+PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4)
AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
[path to D-Bus config directory]), [path_dbusconf=${withval}],
@@ -115,8 +108,7 @@ AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
[disable udev modem detection support]),
[enable_udev=${enableval}])
if (test "${enable_udev}" != "no"); then
- PKG_CHECK_MODULES(UDEV, libudev >= 143, [enable_udev="yes"],
- AC_MSG_ERROR(libudev >= 143 is required))
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [enable_udev="yes"])
UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
if (test -z "${UDEV_DATADIR}"); then
UDEV_DATADIR="${sysconfdir}/udev/rules.d"
@@ -125,8 +117,6 @@ if (test "${enable_udev}" != "no"); then
fi
AC_SUBST(UDEV_DATADIR)
fi
-AC_SUBST(UDEV_CFLAGS)
-AC_SUBST(UDEV_LIBS)
AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
AC_ARG_ENABLE(atmodem, AC_HELP_STRING([--disable-atmodem],
@@ -169,10 +159,7 @@ AC_ARG_ENABLE(bluez4, AC_HELP_STRING([--enable-bluez4],
[enable_bluez4=${enableval}])
if (test "${enable_bluez4}" = "yes"); then
- PKG_CHECK_MODULES(BLUEZ, bluez >= 4.99 bluez < 5, dummy=yes,
- AC_MSG_ERROR(Bluetooth library >= 4.99 and < 5 is required))
- AC_SUBST(BLUEZ_CFLAGS)
- AC_SUBST(BLUEZ_LIBS)
+ PKG_CHECK_MODULES(BLUEZ, bluez >= 4.99 bluez < 5)
fi
AM_CONDITIONAL(BLUEZ4, test "${enable_bluetooth}" != "no" && test "${enable_bluez4}" = "yes")
@@ -217,10 +204,7 @@ AC_ARG_ENABLE(ell, AC_HELP_STRING([--enable-ell],
if (test "${enable_ell}" = "yes"); then
AC_DEFINE(HAVE_ELL, 1, [Defined if Ell is enabled])
- PKG_CHECK_MODULES(ELL, ell >= 0.2, dummy=yes,
- AC_MSG_ERROR(ell library >= 0.2 is required))
- AC_SUBST(ELL_CFLAGS)
- AC_SUBST(ELL_LIBS)
+ PKG_CHECK_MODULES(ELL, ell >= 0.2)
fi
AM_CONDITIONAL(MBIMMODEM, test "${enable_ell}" != "no" && test "${enable_mbimmodem}" = "yes")
--
2.17.1