nm: Allow disabling libnm-glib
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 30 Nov 2017 12:24:37 +0000 (13:24 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 6 Dec 2017 10:13:03 +0000 (11:13 +0100)
The distros are eventually going to drop it, allow omitting it.

Closes strongswan/strongswan#86.

src/frontends/gnome/Makefile.am
src/frontends/gnome/configure.ac
src/frontends/gnome/properties/Makefile.am

index 08d42c5..2b022bf 100644 (file)
@@ -12,6 +12,7 @@ appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files = NetworkManager-strongswan.appdata.xml.in
 @INTLTOOL_XML_RULE@
 
+if WITH_LIBNM_GLIB
 # Install a file with full path to plugins for an old gnome-shell
 # https://bugzilla.gnome.org/show_bug.cgi?id=693590
 install-data-hook:
@@ -26,6 +27,7 @@ install-data-hook:
 
 uninstall-hook:
         rm -f $(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-strongswan-service.name
+endif
 
 nm-strongswan-service.name: $(srcdir)/nm-strongswan-service.name.in
        $(AM_V_GEN) \
index 52ff0a5..7eb38a6 100644 (file)
@@ -46,14 +46,6 @@ AM_GLIB_GNU_GETTEXT
 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0)
 PKG_CHECK_MODULES(LIBSECRET, libsecret-1)
 
-PKG_CHECK_MODULES(LIBNM_GLIB, NetworkManager >= 1.1.0 libnm-util libnm-glib libnm-glib-vpn)
-PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.1.0)
-PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)
-
-PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.0)
-LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
-LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
-
 AC_ARG_WITH(
        [charon],
        AS_HELP_STRING([--with-charon=file],[path to the strongSwan charon NetworkManager backend"]),
@@ -64,6 +56,24 @@ AC_ARG_ENABLE(
        [nm-absolute-paths],
        AS_HELP_STRING([--enable-nm-absolute-paths],[use absolute paths for NM plugins in the .name file])
 )
+AC_ARG_WITH(
+       [libnm-glib],
+       AS_HELP_STRING([--without-libnm-glib], [Build NetworkManager-strongswan without libnm-glib comatibility]),
+       [with_libnm_glib=no],
+       [with_libnm_glib=yes]
+)
+
+AM_CONDITIONAL(WITH_LIBNM_GLIB, test "$with_libnm_glib" != no)
+
+PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.0)
+LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
+LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
+PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)
+
+if test x"$with_libnm_glib" != xno; then
+       PKG_CHECK_MODULES(LIBNM_GLIB, NetworkManager >= 1.1.0 libnm-util libnm-glib libnm-glib-vpn)
+       PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.1.0)
+fi
 
 nm_libexecdir=$($PKG_CONFIG --variable=libgnome_serverdir NetworkManager)
 AC_SUBST(nm_libexecdir)
index 1f138db..317305d 100644 (file)
@@ -1,5 +1,8 @@
 nm_plugin_LTLIBRARIES = libnm-vpn-plugin-strongswan.la
+
+if WITH_LIBNM_GLIB
 nm_plugin_LTLIBRARIES += libnm-strongswan-properties.la
+endif
 
 libnm_vpn_plugin_strongswan_la_SOURCES = \
        nm-strongswan.c \