From 763cc368b529c879050ffb98340779148e152b29 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Tue, 12 May 2015 00:32:11 +0200 Subject: [PATCH 3/3] Make network panel optional --- configure.ac | 60 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index 7816942..13e8f45 100644 --- a/configure.ac +++ b/configure.ac @@ -247,32 +247,40 @@ AS_IF([test "$enable_wayland" != "no"], PKG_CHECK_MODULES(WAYLAND, gdk-wayland-3.0) ]) -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 - 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 - -# Work-around for https://bugzilla.gnome.org/show_bug.cgi?id=723769 -PKG_CHECK_MODULES(NM_UNSTABLE_CHECK, libnm-util >= 0.9.9.0, nm_unstable=yes, nm_unstable=no) -if test x$nm_unstable = xyes; then - AC_DEFINE(HAVE_NM_UNSTABLE, 1, [Define to 1 if NetworkManager is available]) -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, 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 + 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]) + ]) + + # Work-around for https://bugzilla.gnome.org/show_bug.cgi?id=723769 + PKG_CHECK_MODULES(NM_UNSTABLE_CHECK, [libnm-util >= 0.9.9.0], + [ + nm_unstable=yes + AC_DEFINE(HAVE_NM_UNSTABLE, 1, [Define to 1 if NetworkManager is available]) + ], + [nm_unstable=no]) + ]) +AM_CONDITIONAL(BUILD_NETWORK, [test "$have_networkmanager" = "yes"]) AM_CONDITIONAL(HAVE_NM_UNSTABLE, [test x$nm_unstable = xyes]) # Check for gnome-bluetooth -- 2.3.6