[network-manager-openvpn/lr/libnm] !fixup build: split the plugin into two halves



commit 0f7392e7fc62766d074198784cab4c58ac531636
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Jul 16 16:22:24 2015 +0200

    !fixup build: split the plugin into two halves

 nm-openvpn-service.name.in |    2 +-
 properties/Makefile.am     |   71 ++++++++++++++++++++------------------------
 properties/auth-helpers.c  |    4 +-
 properties/auth-helpers.h  |    4 +--
 properties/import-export.c |    4 +--
 properties/import-export.h |    4 +--
 properties/nm-openvpn.c    |    6 +--
 7 files changed, 40 insertions(+), 55 deletions(-)
---
diff --git a/nm-openvpn-service.name.in b/nm-openvpn-service.name.in
index 5d2aedd..6091c8b 100644
--- a/nm-openvpn-service.name.in
+++ b/nm-openvpn-service.name.in
@@ -4,7 +4,7 @@ service=org.freedesktop.NetworkManager.openvpn
 program= LIBEXECDIR@/nm-openvpn-service
 
 [libnm]
-properties= PLUGINDIR@/libnm-openvpn-properties-new
+properties= PLUGINDIR@/libnm-openvpn-properties
 
 [GNOME]
 auth-dialog= LIBEXECDIR@/nm-openvpn-auth-dialog
diff --git a/properties/Makefile.am b/properties/Makefile.am
index faede75..b71bb47 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -1,69 +1,62 @@
 SUBDIRS = . tests
 
 plugindir = $(libdir)/NetworkManager
-plugin_LTLIBRARIES = libnm-openvpn-properties-new.la libnm-openvpn-properties-old.la
+plugin_LTLIBRARIES = libnm-openvpn-properties.la libnm-openvpn-properties-old.la
 
-libnm_openvpn_properties_new_la_SOURCES = \
-       nm-openvpn.c \
-       nm-openvpn.h \
-       auth-helpers.c \
-       auth-helpers.h \
-       import-export.c \
-       import-export.h
+libnm_openvpn_properties_la_SOURCES =                   \
+        nm-openvpn.c                                    \
+        nm-openvpn.h                                    \
+        auth-helpers.c                                  \
+        auth-helpers.h                                  \
+        import-export.c                                 \
+        import-export.h
 
-libnm_openvpn_properties_old_la_SOURCES = \
-       nm-openvpn.c \
-       nm-openvpn.h \
-       auth-helpers.c \
-       auth-helpers.h \
-       import-export.c \
-       import-export.h
+libnm_openvpn_properties_old_la_SOURCES =               \
+        $(libnm_openvpn_properties_la_SOURCES)
 
 uidir = $(datadir)/gnome-vpn-properties/openvpn
 ui_DATA = nm-openvpn-dialog.ui
 
-libnm_openvpn_properties_new_la_CFLAGS =                \
-        -DNM_OPENVPN_NEW                                \
+common_CFLAGS =                                         \
         $(GLIB_CFLAGS)                                  \
         $(GTK_CFLAGS)                                   \
         -I$(top_srcdir)/src                             \
-        $(LIBNM_CFLAGS)                                 \
-        $(LIBNMA_CFLAGS)                                \
         -DICONDIR=\""$(datadir)/pixmaps"\"              \
         -DUIDIR=\""$(uidir)"\"                          \
         -DLOCALEDIR=\"$(datadir)/locale\"               \
         -DVERSION=\"$(VERSION)\"
 
+libnm_openvpn_properties_la_CFLAGS =                    \
+        $(common_CFLAGS)                                \
+        $(LIBNM_CFLAGS)                                 \
+        $(LIBNMA_CFLAGS)
+
 libnm_openvpn_properties_old_la_CFLAGS =                \
         -DNM_OPENVPN_OLD                                \
-        $(GLIB_CFLAGS)                                  \
-        $(GTK_CFLAGS)                                   \
+        $(common_CFLAGS)                                \
         $(NM_CFLAGS)                                    \
-        $(NMGTK_CFLAGS)                                 \
-        -I$(top_srcdir)/src                             \
-        -DICONDIR=\""$(datadir)/pixmaps"\"              \
-        -DUIDIR=\""$(uidir)"\"                          \
-        -DLOCALEDIR=\"$(datadir)/locale\"               \
-        -DVERSION=\"$(VERSION)\"
+        $(NMGTK_CFLAGS)
 
-libnm_openvpn_properties_new_la_LIBADD = \
-        $(GTK_LIBS) \
-        $(NM_LIBS) \
-        $(NMGTK_LIBS) \
+common_LIBADD =                                         \
+        $(GTK_LIBS)                                     \
         $(top_builddir)/common/libnm-openvpn-common.la
 
-libnm_openvpn_properties_old_la_LIBADD = \
-        $(GTK_LIBS) \
-        $(NM_LIBS) \
-        $(NMGTK_LIBS) \
-        $(top_builddir)/common/libnm-openvpn-common.la
+libnm_openvpn_properties_la_LIBADD =                    \
+        $(common_LIBADD)                                \
+        $(LIBNM_LIBS)                                   \
+        $(LIBNMA_LIBS)
 
-libnm_openvpn_properties_new_la_LDFLAGS =   \
-        -avoid-version
+libnm_openvpn_properties_old_la_LIBADD =                \
+        $(common_LIBADD)                                \
+        $(NM_LIBS)                                      \
+        $(NMGTK_LIBS)
 
-libnm_openvpn_properties_old_la_LDFLAGS =   \
+libnm_openvpn_properties_la_LDFLAGS =                   \
         -avoid-version
 
+libnm_openvpn_properties_old_la_LDFLAGS =               \
+        $(libnm_openvpn_properties_la_LDFLAGS)
+
 CLEANFILES = *.bak *~
 
 EXTRA_DIST =                            \
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 4c82040..721950b 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -45,9 +45,9 @@
 
 #define OPENVPN_EDITOR_PLUGIN_ERROR                     NM_SETTING_VPN_ERROR
 #define OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY    NM_SETTING_VPN_ERROR_INVALID_PROPERTY
-#endif
 
-#ifdef NM_OPENVPN_NEW
+#else /* !NM_OPENVPN_OLD */
+
 #include <NetworkManager.h>
 #include <nma-ui-utils.h>
 
diff --git a/properties/auth-helpers.h b/properties/auth-helpers.h
index c606d79..88b1529 100644
--- a/properties/auth-helpers.h
+++ b/properties/auth-helpers.h
@@ -28,9 +28,7 @@
 #ifdef NM_OPENVPN_OLD
 #include <nm-connection.h>
 #include <nm-setting-vpn.h>
-#endif
-
-#ifdef NM_OPENVPN_NEW
+#else /* !NM_OPENVPN_OLD */
 #include <NetworkManager.h>
 #endif
 
diff --git a/properties/import-export.c b/properties/import-export.c
index 4d40b78..b39b5ed 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -45,9 +45,7 @@
 
 #define OPENVPN_EDITOR_PLUGIN_ERROR                     NM_SETTING_VPN_ERROR
 #define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN    NM_SETTING_VPN_ERROR_UNKNOWN
-#endif
-
-#ifdef NM_OPENVPN_NEW
+#else /* !NM_OPENVPN_OLD */
 #include <NetworkManager.h>
 
 #define OPENVPN_EDITOR_PLUGIN_ERROR                     NM_CONNECTION_ERROR
diff --git a/properties/import-export.h b/properties/import-export.h
index 5266333..0293288 100644
--- a/properties/import-export.h
+++ b/properties/import-export.h
@@ -26,9 +26,7 @@
 
 #ifdef NM_OPENVPN_OLD
 #include <nm-connection.h>
-#endif
-
-#ifdef NM_OPENVPN_NEW
+#else /* !NM_OPENVPN_OLD */
 #include <NetworkManager.h>
 #endif
 
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index f283418..d3e0453 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -69,9 +69,7 @@
 #define OPENVPN_EDITOR_PLUGIN_ERROR_MISSING_PROPERTY    NM_SETTING_VPN_ERROR_MISSING_PROPERTY
 #define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN    NM_SETTING_VPN_ERROR_UNKNOWN
 #define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE   NM_SETTING_VPN_ERROR_UNKNOWN
-#endif
-
-#ifdef NM_OPENVPN_NEW
+#else /* !NM_OPENVPN_OLD */
 #include <NetworkManager.h>
 
 #define OPENVPN_EDITOR_PLUGIN_ERROR                     NM_CONNECTION_ERROR
@@ -93,7 +91,7 @@
 
 /************** plugin class **************/
 
-#ifdef NM_OPENVPN_NEW
+#ifndef NM_OPENVPN_OLD
 enum {
        PROP_0,
        PROP_NAME,


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