[gnome-control-center] network: Fix build with NM 0.9.8.x



commit f31dbd02717801ed971d99468ea5d54178fdf4ec
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 12 13:36:53 2014 +0100

    network: Fix build with NM 0.9.8.x
    
    Team support was only added in the 0.9.9.x branch for the 0.9.10
    stable release. It's not available in any releases (beta or stable
    ones) yet.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723769

 configure.ac                                       |    7 +++++++
 panels/network/Makefile.am                         |   10 +++++++---
 .../connection-editor/net-connection-editor.c      |    2 ++
 3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 76ba9f5..5c01569 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,6 +198,13 @@ if test x${have_networkmanager} = xyes; then
   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
+AM_CONDITIONAL(HAVE_NM_UNSTABLE, [test x$nm_unstable = xyes])
+
 # Check for gnome-bluetooth
 PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.11.1,
                  [have_bluetooth=yes], have_bluetooth=no)
diff --git a/panels/network/Makefile.am b/panels/network/Makefile.am
index 75c9b46..d1b2b00 100644
--- a/panels/network/Makefile.am
+++ b/panels/network/Makefile.am
@@ -34,8 +34,6 @@ libnetwork_la_SOURCES =                                       \
        net-device-mobile.h                             \
        net-device-bond.c                               \
        net-device-bond.h                               \
-       net-device-team.c                               \
-       net-device-team.h                               \
        net-device-bridge.c                             \
        net-device-bridge.h                             \
        net-virtual-device.c                            \
@@ -49,6 +47,12 @@ libnetwork_la_SOURCES =                                      \
        cc-network-panel.c                              \
        cc-network-panel.h
 
+TEAM_FILES = net-device-team.c net-device-team.h
+EXTRA_DIST = $(TEAM_FILES)
+if HAVE_NM_UNSTABLE
+libnetwork_la_SOURCES += $(TEAM_FILES)
+endif
+
 libnetwork_la_LIBADD = $(PANEL_LIBS) $(NETWORK_PANEL_LIBS) $(NETWORK_MANAGER_LIBS) 
$(builddir)/connection-editor/libconnection-editor.la
 
 libnetwork_la_LDFLAGS = $(PANEL_LDFLAGS)
@@ -66,6 +70,6 @@ desktop_in_files = gnome-network-panel.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
 CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(BUILT_SOURCES)
-EXTRA_DIST = $(resource_files) network.gresource.xml
+EXTRA_DIST += $(resource_files) network.gresource.xml
 
 -include $(top_srcdir)/git.mk
diff --git a/panels/network/connection-editor/net-connection-editor.c 
b/panels/network/connection-editor/net-connection-editor.c
index dcf57cf..cecc8e7 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -594,7 +594,9 @@ typedef struct {
 static const NetConnectionType connection_types[] = {
         { N_("VPN"), nm_setting_vpn_get_type },
         { N_("Bond"), nm_setting_bond_get_type },
+#ifdef HAVE_NM_UNSTABLE
         { N_("Team"), nm_setting_team_get_type },
+#endif /* NM_UNSTABLE */
         { N_("Bridge"), nm_setting_bridge_get_type },
         { N_("VLAN"), nm_setting_vlan_get_type }
 };


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