[network-manager-openvpn/lr/libnm: 9/11] build: allow build without libnm-glib



commit defa685d1e42b1213e0932e97e335ddeb47eb60c
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Jul 23 17:21:55 2015 +0200

    build: allow build without libnm-glib

 common/Makefile.am     |    5 ++++-
 configure.ac           |   23 ++++++++++++++---------
 properties/Makefile.am |    5 ++++-
 3 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/common/Makefile.am b/common/Makefile.am
index 74a7681..9f663ab 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,4 +1,7 @@
-noinst_LTLIBRARIES=libnm-openvpn-common.la libnm-openvpn-common-old.la
+noinst_LTLIBRARIES=libnm-openvpn-common.la
+if WITH_LIBNM_GLIB
+noinst_LTLIBRARIES += libnm-openvpn-common-old.la
+endif
 
 libnm_openvpn_common_la_CPPFLAGS = \
        $(LIBNM_CFLAGS) \
diff --git a/configure.ac b/configure.ac
index e40fdd4..97edd33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,8 @@ dnl GNOME support
 dnl
 AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-openvpn without GNOME support, 
e.g. vpn service only]))
 AM_CONDITIONAL(WITH_GNOME, test x"$with_gnome" != xno)
+AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [Build NetworkManager-openvpn without 
libnm-glib comatibility]))
+AM_CONDITIONAL(WITH_LIBNM_GLIB, test x"$with_libnm_glib" != xno)
 
 GETTEXT_PACKAGE=NetworkManager-openvpn
 AC_SUBST(GETTEXT_PACKAGE)
@@ -62,21 +64,24 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"
 
 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.74)
 
-PKG_CHECK_MODULES(LIBNM_GLIB,
-       NetworkManager >= 1.1.0
-       libnm-util >= 1.1.0
-       libnm-glib >= 1.1.0
-       libnm-glib-vpn >= 1.1.0)
-LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_1_0"
-LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_1_0"
-
 if test x"$with_gnome" != xno; then
        PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.4)
        GTK_CFLAGS="$GTK_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4"
 
-       PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.1.0)
        PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)
        PKG_CHECK_MODULES(LIBSECRET, libsecret-unstable)
+
+       if test x"$with_libnm_glib" != xno; then
+               PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.1.0)
+               PKG_CHECK_MODULES(LIBNM_GLIB,
+                       NetworkManager >= 1.1.0
+                       libnm-util >= 1.1.0
+                       libnm-glib >= 1.1.0
+                       libnm-glib-vpn >= 1.1.0);
+
+               LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_1_0"
+               LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_1_0"
+       fi
 fi
 
 PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.0)
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 861b9e3..18ccf70 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -1,7 +1,10 @@
 SUBDIRS = . tests
 
 plugindir = $(libdir)/NetworkManager
-plugin_LTLIBRARIES = libnm-openvpn-properties.la libnm-openvpn-properties-old.la
+plugin_LTLIBRARIES = libnm-openvpn-properties.la
+if WITH_LIBNM_GLIB
+plugin_LTLIBRARIES += libnm-openvpn-properties-old.la
+endif
 
 libnm_openvpn_properties_la_SOURCES =                   \
         nm-openvpn.c                                    \


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