Configure support for libsecret
[moonshot-ui.git] / configure.ac
index 11329d7..55cf276 100644 (file)
@@ -12,6 +12,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
+AC_SUBST([KEYRING_VALAFLAGS],[])
 
 AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
 AM_SILENT_RULES([yes])
@@ -61,6 +62,17 @@ case "$host" in
     win32=no
     linux=yes
 
+    PKG_CHECK_MODULES([KEYRING],
+       [libsecret-1],
+       [KEYRING_VALAFLAGS=" --pkg libsecret-1 --define LIBSECRET_KEYRING"],
+       [
+               PKG_CHECK_MODULES([KEYRING], [gnome-keyring-1],
+               [KEYRING_VALAFLAGS="--pkg moonshot-gnome-keyring --define GNOME_KEYRING"],
+               [AC_ERROR(["Neither gnome-keyring not libsecret is found])
+               ])
+    ])
+       
+       
     # We require dbus-glib for the client library even if we are using GDBus
     # in the server. The reason we can't always use dbus-glib in the server is
     # because Vala drops support for it, but as it ships with DBus there is very