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



commit c4e7569c5983db3a291510c924a320782e26d9b4
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
    
    Conflicts:
        configure.ac
        panels/network/connection-editor/net-connection-editor.c

 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 12f04b9..100529b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -210,6 +210,13 @@ else
 fi
 AM_CONDITIONAL(HAVE_MM_GLIB, test "x$have_libmm_glib" = "xyes")
 
+# 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.5.5,
                  [have_bluetooth=yes], have_bluetooth=no)
diff --git a/panels/network/Makefile.am b/panels/network/Makefile.am
index ca01562..4f2b469 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                            \
@@ -52,6 +50,12 @@ libnetwork_la_SOURCES =                                      \
        rfkill-glib.h                                   \
        rfkill.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)
@@ -74,6 +78,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 43ae828..9ab449a 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
         { "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]