From 1ad9510963dc634cb1805ca9e4726004130fc7e3 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Tue, 12 May 2015 00:32:11 +0200 Subject: [PATCH 4/5] Make network panel optional Signed-off-by: Gilles Dartiguelongue --- configure.ac | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index fe947d7..6ecda91 100644 --- a/configure.ac +++ b/configure.ac @@ -241,24 +241,31 @@ AS_IF([test "$enable_wayland" != "no"], PKG_CHECK_MODULES(WAYLAND, gdk-wayland-3.0) ]) -PKG_CHECK_MODULES(NETWORK_MANAGER, - libnm >= $NETWORK_MANAGER_REQUIRED_VERSION - libnma >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION - mm-glib >= $MODEM_MANAGER_REQUIRED_VERSION, - [have_networkmanager=yes], have_networkmanager=no) -if test "x$have_networkmanager" = xno ; then - AC_MSG_WARN(*** Network panel will not be built (NetworkManager or ModemManager not found) ***) -else - AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel]) -fi -AM_CONDITIONAL(BUILD_NETWORK, [test x$have_networkmanager = xyes]) -if test x${have_networkmanager} = xyes; then - AC_DEFINE(HAVE_NETWORK_MANAGER, 1, [Define to 1 if NetworkManager is available]) - NM_VPN_CONFIG_DIR=`$PKG_CONFIG --variable configdir NetworkManager`/VPN - NM_VPN_MODULE_DIR=`$PKG_CONFIG --variable plugindir NetworkManager` - AC_SUBST(NM_VPN_CONFIG_DIR) - AC_SUBST(NM_VPN_MODULE_DIR) -fi +AC_ARG_ENABLE([networkmanager], + AS_HELP_STRING([--disable-networkmanager], [Disable network panel]), + [], + [enable_networkmanager=auto]) +AS_IF([test "$enable_networkmanager" != "no"], + [ + PKG_CHECK_MODULES(NETWORK_MANAGER, + libnm >= $NETWORK_MANAGER_REQUIRED_VERSION + libnma >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION + mm-glib >= $MODEM_MANAGER_REQUIRED_VERSION, + [have_networkmanager=yes], [have_networkmanager=no]) + + AS_IF([test "$have_networkmanager" = "no"], + [ + AC_MSG_WARN([*** Network panel will not be built (NetworkManager or ModemManager not found) ***]) + ], [ + AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel]) + AC_DEFINE(HAVE_NETWORK_MANAGER, 1, [Define to 1 if NetworkManager is available]) + NM_VPN_CONFIG_DIR=`$PKG_CONFIG --variable configdir NetworkManager`/VPN + NM_VPN_MODULE_DIR=`$PKG_CONFIG --variable plugindir NetworkManager` + AC_SUBST([NM_VPN_CONFIG_DIR]) + AC_SUBST([NM_VPN_MODULE_DIR]) + ]) + ]) +AM_CONDITIONAL(BUILD_NETWORK, [test "$have_networkmanager" = "yes"]) # Check for power panel if test x${have_networkmanager} = xyes; then -- 2.10.1