summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNP-Hardass <[email protected]>2020-08-03 01:46:00 -0400
committerraveit65 <[email protected]>2020-10-20 10:34:23 +0200
commit8a2b582dbec78dfb2d60170c691af2948e55a960 (patch)
treec2d243b27f3bac8e1067b28692014b7590ebb601
parent54ce429fd89c0a7a09481637219945616b255ac1 (diff)
downloadmate-power-manager-8a2b582dbec78dfb2d60170c691af2948e55a960.tar.bz2
mate-power-manager-8a2b582dbec78dfb2d60170c691af2948e55a960.tar.xz
Add autotools support for libsecret
-rw-r--r--README1
-rw-r--r--configure.ac22
-rw-r--r--src/Makefile.am3
3 files changed, 26 insertions, 0 deletions
diff --git a/README b/README
index 118da69..32a8a5c 100644
--- a/README
+++ b/README
@@ -15,6 +15,7 @@ To build, MATE Power Manager requires
- Glib (2.36.0 or later)
- GTK+3 (3.14.0 or later)
+ - libsecret (0.11 or later)
- GNOME Keyring (3.0.0 or later)
- DBus (0.70 or later)
- libnotify (0.7.0 or later)
diff --git a/configure.ac b/configure.ac
index 1db3932..b4758dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,7 @@ GLIB_REQUIRED=2.50.0
GIO_REQUIRED=2.50.0
GDK_REQUIRED=3.22.0
GTK_REQUIRED=3.22.0
+LIBSECRET_REQUIRED=0.11
GNOME_KEYRING_REQUIRED=3.0.0
DBUS_REQUIRED=1.0
DBUS_GLIB_REQUIRED=0.70
@@ -135,6 +136,22 @@ fi
AM_CONDITIONAL([HAVE_TESTS], [test $have_tests = yes])
dnl ---------------------------------------------------------------------------
+dnl - Build libsecret support
+dnl ---------------------------------------------------------------------------
+AC_ARG_WITH(libsecret,
+ [AS_HELP_STRING([--with-libsecret],
+ [Enable the use of libsecret])],
+ [],
+ [with_libsecret=no])
+
+AM_CONDITIONAL([WITH_LIBSECRET],[test "$with_libsecret" = "yes"])
+
+if test "$with_libsecret" = "yes"; then
+ PKG_CHECK_MODULES(LIBSECRET, libsecret-1 >= $LIBSECRET_REQUIRED)
+ AC_DEFINE([WITH_LIBSECRET],[1],[Define if LIBSECRET support is enabled])
+fi
+
+dnl ---------------------------------------------------------------------------
dnl - Build gnome-keyring support
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(keyring,
@@ -150,6 +167,10 @@ if test "$with_keyring" = "yes"; then
AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
fi
+if test "$with_libsecret" = "yes" -a "$with_keyring" = "yes"; then
+ AC_MSG_ERROR([Please select only 1, keyring or libsecret])
+fi
+
dnl ---------------------------------------------------------------------------
dnl - Build applets
dnl ---------------------------------------------------------------------------
@@ -222,6 +243,7 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
cwarnings: ${WARN_CFLAGS}
+ libsecret support: ${with_libsecret}
gnome-keyring support: ${with_keyring}
Building extra applets: ${enable_applets}
Self test support: ${have_tests}
diff --git a/src/Makefile.am b/src/Makefile.am
index 1a966e8..47815c5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,6 +14,7 @@ AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(CAIRO_CFLAGS) \
+ $(LIBSECRET_CFLAGS) \
$(KEYRING_CFLAGS) \
$(X11_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
@@ -197,6 +198,7 @@ mate_power_manager_LDADD = \
$(X11_LIBS) \
$(GSTREAMER_LIBS) \
$(CAIRO_LIBS) \
+ $(LIBSECRET_LIBS) \
$(KEYRING_LIBS) \
$(DBUS_LIBS) \
$(X11_LIBS) \
@@ -259,6 +261,7 @@ mate_power_self_test_LDADD = \
$(GLIB_LIBS) \
$(X11_LIBS) \
$(CAIRO_LIBS) \
+ $(LIBSECRET_LIBS) \
$(KEYRING_LIBS) \
$(GSTREAMER_LIBS) \
$(UPOWER_LIBS) \