[network-manager-pptp/lr/libnm: 8/12] properties: build also the libnm-glib version of the properties plugin



commit 3a19a862c90c01cbf12461495edbfa7705bb5070
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Jul 17 15:04:42 2015 +0200

    properties: build also the libnm-glib version of the properties plugin

 nm-pptp-service.name.in      |    5 ++++-
 properties/Makefile.am       |   30 +++++++++++++++++++++++++-----
 properties/advanced-dialog.c |    7 +++++++
 properties/nm-pptp.c         |   10 ++++++++++
 4 files changed, 46 insertions(+), 6 deletions(-)
---
diff --git a/nm-pptp-service.name.in b/nm-pptp-service.name.in
index af69a5f..e77bbdc 100644
--- a/nm-pptp-service.name.in
+++ b/nm-pptp-service.name.in
@@ -3,7 +3,10 @@ name=pptp
 service=org.freedesktop.NetworkManager.pptp
 program= LIBEXECDIR@/nm-pptp-service
 
+[libnm]
+properties= PLUGINDIR@/libnm-pptp-properties
+
 [GNOME]
 auth-dialog= LIBEXECDIR@/nm-pptp-auth-dialog
-properties= PLUGINDIR@/libnm-pptp-properties
+properties= PLUGINDIR@/libnm-pptp-properties-old
 supports-external-ui-mode=true
diff --git a/properties/Makefile.am b/properties/Makefile.am
index ca05bfd..ef35984 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -1,5 +1,5 @@
 plugindir = $(libdir)/NetworkManager
-plugin_LTLIBRARIES = libnm-pptp-properties.la
+plugin_LTLIBRARIES = libnm-pptp-properties.la libnm-pptp-properties-old.la
 
 AM_CPPFLAGS = -I${top_srcdir}
 
@@ -11,29 +11,49 @@ libnm_pptp_properties_la_SOURCES = \
        import-export.c \
        import-export.h
 
+libnm_pptp_properties_old_la_SOURCES = \
+       $(libnm_pptp_properties_la_SOURCES)
+
 uidir = $(datadir)/gnome-vpn-properties/pptp
 ui_DATA = nm-pptp-dialog.ui
 
-libnm_pptp_properties_la_CFLAGS =                       \
+common_CFLAGS =                                         \
         $(GLIB_CFLAGS)                                  \
         $(GTK_CFLAGS)                                   \
-        $(LIBNM_CFLAGS)                                 \
-        $(LIBNMA_CFLAGS)                                \
-       -I$(top_srcdir)/src                             \
+        -I$(top_srcdir)/src                             \
         -DICONDIR=\""$(datadir)/pixmaps"\"              \
         -DUIDIR=\""$(uidir)"\"                          \
         -DLOCALEDIR=\""$(datadir)/locale"\"             \
         -DG_DISABLE_DEPRECATED                          \
         -DVERSION=\"$(VERSION)\"
 
+libnm_pptp_properties_la_CFLAGS =                       \
+        $(common_CFLAGS)                                \
+        $(LIBNM_CFLAGS)                                 \
+        $(LIBNMA_CFLAGS)
+
+libnm_pptp_properties_old_la_CFLAGS =                   \
+        -DNM_PPTP_OLD                                   \
+        $(common_CFLAGS)                                \
+        $(NM_CFLAGS)                                    \
+        $(NMGTK_CFLAGS)
+
 libnm_pptp_properties_la_LIBADD = \
         $(GTK_LIBS) \
         $(LIBNM_LIBS) \
         $(LIBNMA_LIBS)
 
+libnm_pptp_properties_old_la_LIBADD = \
+        $(GTK_LIBS) \
+        $(NM_LIBS) \
+        $(NMGTK_LIBS)
+
 libnm_pptp_properties_la_LDFLAGS =   \
         -avoid-version
 
+libnm_pptp_properties_old_la_LDFLAGS =   \
+        $(libnm_pptp_properties_la_LDFLAGS)
+
 CLEANFILES = *.bak *~
 
 EXTRA_DIST =                            \
diff --git a/properties/advanced-dialog.c b/properties/advanced-dialog.c
index 10bb848..f0a4ddb 100644
--- a/properties/advanced-dialog.c
+++ b/properties/advanced-dialog.c
@@ -35,7 +35,14 @@
 #include <glib.h>
 #include <glib/gi18n-lib.h>
 
+#ifdef NM_PPTP_OLD
+#define NM_VPN_LIBNM_COMPAT
+#include <nm-connection.h>
+#include <nm-setting-vpn.h>
+
+#else /* !NM_PPTP_OLD */
 #include <NetworkManager.h>
+#endif
 
 #include "advanced-dialog.h"
 #include "nm-pptp.h"
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 242f9e4..12f3d98 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -34,7 +34,17 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
+#ifdef NM_PPTP_OLD
+#define NM_VPN_LIBNM_COMPAT
+#include <nm-vpn-plugin-ui-interface.h>
+#include <nm-setting-vpn.h>
+#include <nm-setting-connection.h>
+#include <nm-setting-ip4-config.h>
+#include <nm-ui-utils.h>
+
+#else /* !NM_PPTP_OLD */
 #include <NetworkManager.h>
+#endif
 
 #include <libnma/nma-ui-utils.h>
 


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