[balsa/oauth2-support: 1/2] prepare for OAuth2 support




commit d5e2546c9a45859bee9abffde51d32a965135f41
Author: Albrecht Dreß <albrecht dress arcor de>
Date:   Mon Aug 31 21:35:02 2020 +0200

    prepare for OAuth2 support
    
    add configuration option for OAuth2, which additionally adds a
    dependency on libsoup and json-glib
    
    Signed-off-by: Albrecht Dreß <albrecht dress arcor de>

 configure.ac      | 20 ++++++++++++++++++++
 meson.build       | 13 +++++++++++++
 meson_options.txt |  5 +++++
 3 files changed, 38 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 602eef569..156706295 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,11 @@ AC_ARG_WITH(gss,
                   [Enable GSS (default=no)]),
                   [with_gss=$withval],[with_gss=no])
 
+AC_ARG_WITH(oauth2,
+   AC_HELP_STRING([--with-oauth2],
+                  [Enable OAuth2 authentication (needs libsoup and json-glib, default=no)]),
+                  [with_oauth2=$withval],[with_oauth2=no])
+
 AC_ARG_WITH(html-widget,
             AC_HELP_STRING([--with-html-widget=(no|webkit2)],
                            [select the HTML renderer (default webkit2)]),
@@ -398,6 +403,20 @@ if test "x$with_gss" != xno  ; then
    fi
 fi
 
+# OAuth2 configuration
+AC_MSG_CHECKING(whether to include OAuth2 support)
+if test "x$with_oauth2" != xno  ; then
+    PKG_CHECK_MODULES(OAUTH2, [libsoup-2.4 json-glib-1.0])
+    AC_DEFINE(HAVE_OAUTH2,1,[Defined when OAuth2 is available.])
+    BALSA_CFLAGS="$BALSA_CFLAGS $OAUTH2_CFLAGS"
+    BALSA_LIBS="$BALSA_LIBS $OAUTH2_LIBS"
+    LIBNETCLIENT_CFLAGS="$LIBNETCLIENT_CFLAGS $OAUTH2_CFLAGS"
+    LIBNETCLIENT_LIBS="$LIBNETCLIENT_LIBS $OAUTH2_LIBS"
+else
+    AC_MSG_RESULT([no])
+fi
+
+
 # gcr configuration
 if test x$with_gcr != xno; then
     PKG_CHECK_MODULES(GCR, [ gcr-3 ])
@@ -650,6 +669,7 @@ echo "              Use Canberra: $with_canberra"
 echo "             Use Autocrypt: $autocrypt"
 echo "                  Use LDAP: $with_ldap"
 echo "                   Use GSS: $with_gss"
+echo "            OAuth2 support: $with_oauth2"
 echo "                Use SQLite: $with_sqlite"
 echo "             Spell checker: $use_spell_checker"
 echo "         Use GtkSourceView: $with_gtksourceview"
diff --git a/meson.build b/meson.build
index b7190fe34..4d85d13ed 100644
--- a/meson.build
+++ b/meson.build
@@ -51,6 +51,7 @@ autocrypt     = get_option('autocrypt')
 canberra      = get_option('canberra')
 compface      = get_option('compface')
 gss           = get_option('gss')
+oauth2        = get_option('oauth2')
 html_widget   = get_option('html-widget')
 gtksourceview = get_option('gtksourceview')
 spell_checker = get_option('spell-checker')
@@ -310,6 +311,18 @@ if gss
   libnetclient_deps += krb5_dep
 endif # gss
 
+# OAuth2 configuration
+#
+if oauth2
+  oauth2_dep = dependency('libsoup-2.4 json-glib-1.0')
+  if oauth2_dep.found()
+    conf.set('HAVE_GCR', 1,
+      description : 'Defined when OAuth2 is available')
+  endif
+  balsa_deps        += oauth2_dep
+  libnetclient_deps += oauth2_dep
+endif #oauth2
+
 # gcr configuration
 #
 if gcr
diff --git a/meson_options.txt b/meson_options.txt
index 09bcf2af4..6428816cf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -33,6 +33,11 @@ option('gss',
   value       : false,
   description : 'Enable GSS (default=false)')
 
+option('oauth2',
+  type        : 'boolean',
+  value       : false,
+  description : 'Enable OAuth2 authentication (needs libsoup and json-glib, default=no)')
+
 option('html-widget',
   type        : 'combo',
   choices     : ['webkit2', 'no'],


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