[PATCH 10/15] build: new `--with-modem-manager-1' to check for new ModemManager1 support



The new switch will run in 'auto' mode when not explicitly specified. In this
case the new ModemManager1 support will only be available if it finds libmm-glib
through pkg-config.

Other than the 'auto' mode, 'yes' and 'no' are allowed in order to specify
explicit requirements.
---
 configure.ac | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/configure.ac b/configure.ac
index 5770234..e75a155 100644
--- a/configure.ac
+++ b/configure.ac
@@ -560,6 +560,31 @@ else
 fi
 AC_SUBST(PPPD_PLUGIN_DIR)
 
+# ModemManager1 with libmm-glib
+AC_ARG_WITH(modem-manager-1, AS_HELP_STRING([--with-modem-manager-1], [Enable new ModemManager1 interface support]),,[with_modem_manager_1=auto])
+if (test "${with_modem_manager_1}" != "no"); then
+    PKG_CHECK_MODULES(MM_GLIB,
+                      [mm-glib],
+                      [have_libmm_glib=yes],
+                      [have_libmm_glib=no])
+    AC_SUBST(MM_GLIB_CFLAGS)
+    AC_SUBST(MM_GLIB_LIBS)
+
+    if (test "${have_libmm_glib}" = "no"); then
+        if (test "${with_modem_manager_1}" = "yes"); then
+            AC_MSG_ERROR([Couldn't find libmm-glib])
+        fi
+    else
+        with_modem_manager_1="yes"
+    fi
+fi
+
+if (test "${with_modem_manager_1}" = "yes"); then
+    AC_DEFINE(WITH_MODEM_MANAGER_1, 1, [Define if you have ModemManager1 support])
+else
+	AC_DEFINE(WITH_MODEM_MANAGER_1, 0, [Define if you have ModemManager1 support])
+fi
+AM_CONDITIONAL(WITH_MODEM_MANAGER_1, test "${with_modem_manager_1}" = "yes")
 
 # dhclient support
 AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support]))
@@ -905,6 +930,12 @@ else
 	echo PPP support: no
 fi
 
+if test "${with_modem_manager_1}" = "yes"; then
+	echo ModemManager1 support: yes
+else
+	echo ModemManager1 support: no
+fi
+
 if test "${enable_concheck}" = "yes"; then
 	echo Connectivity checking support: yes
 else
-- 
1.7.11.7



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]