aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-09-28 19:46:12 +0200
committerAleksander Morgado <aleksander@aleksander.es>2016-09-29 15:43:05 +0200
commit58c955f5f23e874e4f8c2a4b389e46c0775e7f07 (patch)
tree568f004df95780b881d22284d642f93e5673221c /configure.ac
parentae9ede926a1747216b54e22398edde203ec9a03c (diff)
core: allow building and running without udev
Instead of relying on the udev daemon and GUDev to manage the devices reported by the kernel, we can now run ModemManager relying solely on the kernel events reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan' option is implicit for the ModemManager daemon when udev is disabled in the build. Additionally, a new custom implementation of the kernel device object is provided, which uses sysfs to load the properties and attributes required in each kernel device, instead of using a GUdevDevice. The udev rule files are kept in place, and a simple custom parser is provided which preloads all rules in memory once and then applies them to the different kernel objects reported via ReportKernelEvent(), e.g. to set port type hints. A simple unit test setup is prepared to validate the udev rules during the `check' Makefile target.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 25 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index dd3111d7..c74d0153 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,6 @@ dnl Build dependencies
dnl
GLIB_MIN_VERSION=2.36.0
-GUDEV_MIN_VERSION=147
PKG_CHECK_MODULES(MM,
glib-2.0 >= $GLIB_MIN_VERSION
@@ -121,10 +120,6 @@ PKG_CHECK_MODULES(MMCLI,
AC_SUBST(MMCLI_CFLAGS)
AC_SUBST(MMCLI_LIBS)
-PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= $GUDEV_MIN_VERSION)
-AC_SUBST(GUDEV_CFLAGS)
-AC_SUBST(GUDEV_LIBS)
-
dnl Some required utilities
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)
@@ -183,6 +178,30 @@ fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$SYSTEMD_UNIT_DIR" -a "$SYSTEMD_UNIT_DIR" != xno ])
dnl-----------------------------------------------------------------------------
+dnl udev support (enabled by default)
+dnl
+
+GUDEV_VERSION=147
+
+AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev], [Build without udev support]), [], [with_udev=yes])
+AM_CONDITIONAL(WITH_UDEV, test "x$with_udev" = "xyes")
+case $with_udev in
+ yes)
+ PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= $GUDEV_VERSION], [have_gudev=yes],[have_gudev=no])
+ if test "x$have_gudev" = "xno"; then
+ AC_MSG_ERROR([Couldn't find gudev >= $GUDEV_VERSION. Install it, or otherwise configure using --without-udev to disable udev support.])
+ else
+ AC_DEFINE(WITH_UDEV, 1, [Define if you want udev support])
+ AC_SUBST(GUDEV_CFLAGS)
+ AC_SUBST(GUDEV_LIBS)
+ fi
+ ;;
+ *)
+ with_udev=no
+ ;;
+esac
+
+dnl-----------------------------------------------------------------------------
dnl Suspend/resume support
dnl
@@ -396,6 +415,7 @@ echo "
systemd unit directory: ${with_systemdsystemunitdir}
Features:
+ udev support: ${with_udev}
policykit support: ${with_polkit}
mbim support: ${with_mbim}
qmi support: ${with_qmi}