diff --git a/configure.ac b/configure.ac
index 0c0098c..3439fc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,12 +180,30 @@ AM_CONDITIONAL(HAVE_INTROSPECTION, false)
 GDESKTOP_PREFIX=`$PKG_CONFIG --variable prefix gsettings-desktop-schemas`
 AC_SUBST(GDESKTOP_PREFIX)
 
-PKG_CHECK_MODULES(NETWORK_MANAGER, NetworkManager >= $NETWORK_MANAGER_REQUIRED_VERSION
-                  libnm-glib >= $NETWORK_MANAGER_REQUIRED_VERSION
-                  libnm-glib-vpn >= $NETWORK_MANAGER_REQUIRED_VERSION
-                  libnm-util >= $NETWORK_MANAGER_REQUIRED_VERSION
-                  libnm-gtk >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION,
-                  [have_networkmanager=yes], have_networkmanager=no)
+# Check for NetworkManager support
+AC_ARG_ENABLE(networkmanager,
+	AC_HELP_STRING([--disable-networkmanager],
+		[disable networkmanager support (enabled by default)]),
+	[case "${enableval}" in
+		yes) WANT_NETWORKMANAGER=yes ;;
+		no)  WANT_NETWORKMANAGER=no ;;
+		*) AC_MSG_ERROR(bad value ${enableval} for --disable-networkmanager) ;;
+	esac],
+	[WANT_NETWORKMANAGER=yes]) dnl Default value
+
+if test "x$WANT_NETWORKMANAGER" = xyes ; then
+   	PKG_CHECK_MODULES(NETWORK_MANAGER, NetworkManager >= $NETWORK_MANAGER_REQUIRED_VERSION
+                          libnm-glib >= $NETWORK_MANAGER_REQUIRED_VERSION
+                          libnm-glib-vpn >= $NETWORK_MANAGER_REQUIRED_VERSION
+                          libnm-util >= $NETWORK_MANAGER_REQUIRED_VERSION
+                          libnm-gtk >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION,
+                          [have_networkmanager=yes],
+			  AC_MSG_ERROR(Network Manager not found))
+else
+	have_networkmanager=no
+fi
+
+
 if test "x$have_networkmanager" = xno ; then
         AC_MSG_WARN(*** Network panel will not be built (NetworkManager not found) ***)
 else
@@ -201,8 +219,24 @@ if test x${have_networkmanager} = xyes; then
 fi
 
 # Check for libmm-glib for ModemManager1 support
-PKG_CHECK_MODULES(MM_GLIB, mm-glib,
-                  [have_libmm_glib=yes], have_libmm_glib=no)
+AC_ARG_ENABLE(modemmanager,
+	AC_HELP_STRING([--disable-modemmanager],
+		[disable modemmanager support]),
+	[case "${enableval}" in
+		yes) WANT_MODEMMANAGER=yes ;;
+		no)  WANT_MODEMMANAGER=no ;;
+		*) AC_MSG_ERROR(bad value ${enableval} for --disable-modemmanager) ;;
+	esac],
+	[WANT_MODEMMANAGER=no]) dnl Default value
+
+if test "x$WANT_MODEMMANAGER" = xyes && test "x$have_networkmanager" = yes ; then
+	PKG_CHECK_MODULES(MM_GLIB, mm-glib,
+                  [have_libmm_glib=yes],
+		  AC_MSG_ERROR(No ModemManager1 support (libmm-glib) not found))
+else
+	have_libmm_glib=no
+fi
+
 if test "x$have_libmm_glib" = xno ; then
   AC_MSG_WARN(*** Network panel will not be built with ModemManager1 support (libmm-glib not found) ***)
 else
