aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRoshan Pius <rpius@chromium.org>2014-12-19 10:22:18 -0800
committerAleksander Morgado <aleksander@aleksander.es>2014-12-19 20:32:12 +0100
commitbec32bd8d570b66fcfcf1325af8c80752a784b61 (patch)
treecaaa98be5a8441eacab61a27965b66e5565d8a38 /configure.ac
parentb84db57fe24652238a06c8aaff70f769ccfa6a0e (diff)
libqmi-glib,proxy: Change ownership of QMI devices to the configured user.
Adding a udev rule to change ownership of all QMI devices to the configured user specified at compile time using --enable-qmi-username flag.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 25 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 754cbae..c1ca6ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,9 +81,25 @@ GTK_DOC_CHECK(1.0)
# QMI username
AC_ARG_ENABLE(qmi-username,
- AS_HELP_STRING([--enable-qmi-username=<username>], [user allowed to access QMI devices]),,
- enable_qmi_username="root")
-AC_DEFINE_UNQUOTED(QMI_USERNAME, "$enable_qmi_username", [Define the QMI username])
+ AS_HELP_STRING([--enable-qmi-username=<username>], [user allowed to access QMI devices]))
+if test -n "$enable_qmi_username" ; then
+ QMI_USERNAME="$enable_qmi_username"
+else
+ QMI_USERNAME="root"
+fi
+AM_CONDITIONAL([INSTALL_QMI_UDEV_RULES], [test "x$enable_qmi_username" = "x$QMI_USERNAME"])
+AC_SUBST(QMI_USERNAME)
+AC_DEFINE_UNQUOTED(QMI_USERNAME, "$QMI_USERNAME", [Define the QMI username])
+AM_COND_IF([INSTALL_QMI_UDEV_RULES], [AC_CONFIG_FILES([src/qmi-proxy/76-qmi-proxy-device-ownership.rules])])
+
+# udev base directory
+AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is]))
+if test -n "$with_udev_base_dir" ; then
+ UDEV_BASE_DIR="$with_udev_base_dir"
+else
+ UDEV_BASE_DIR="/lib/udev"
+fi
+AC_SUBST(UDEV_BASE_DIR)
dnl Man page
AC_PATH_PROG(HELP2MAN, help2man, false)
@@ -116,9 +132,10 @@ echo "
libqmi (libqmi-glib, qmicli) $VERSION
==============================================
- compiler: ${CC}
- cflags: ${CFLAGS}
- Maintainer mode: ${USE_MAINTAINER_MODE}
- Documentation: ${enable_gtk_doc}
- QMI username: ${enable_qmi_username}
+ compiler: ${CC}
+ cflags: ${CFLAGS}
+ Maintainer mode: ${USE_MAINTAINER_MODE}
+ udev base directory: ${UDEV_BASE_DIR}
+ Documentation: ${enable_gtk_doc}
+ QMI username: ${QMI_USERNAME}
"