<<< Date Index >>>     <<< Thread Index >>>

For 1.5.8: configure.in: --with-gnutls option



Hello,

  I attach a configure.in snippet to implement a --with-gnutls option.
  It's mostly a copy of the code for --with-ssl, it works here and I
  think it'd be nice to include it.

  Also included a small init.h fix to sync the #defines with globals.h
  and a minor whitespace correction in configure.in, to align the
  --disable-inodesort option with the rest.

  Thanks.

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
Russian roulette in bash: ((RANDOM%6)) || rm -rf ~
--- a/configure.in
+++ b/configure.in
@@ -558,6 +558,32 @@
 
 dnl -- end imap dependencies --
 
+AC_ARG_WITH(gnutls, [  --with-gnutls[=PFX]           Compile in GnuTLS support 
for POP/IMAP],
+[       if test "$with_gnutls" != "no"
+        then
+          if test "$need_socket" != "yes"; then
+           AC_MSG_ERROR([SSL support is only useful with POP or IMAP support])
+          fi
+
+          if test "$with_gnutls" != "yes"
+          then
+           LDFLAGS="$LDFLAGS -L$withval/lib"
+           CPPFLAGS="$CPPFLAGS -I$withval/include"
+          fi
+          saved_LIBS="$LIBS"
+
+          AC_CHECK_LIB(gnutls, gnutls_check_version,, AC_MSG_ERROR([Unable to 
find GnuTLS library]))
+
+          AC_DEFINE(USE_GNUTLS,1,[ Define if you want support for GnuTLS. ])
+          LIBS="$saved_LIBS"
+          MUTTLIBS="$MUTTLIBS -lgnutls"
+          MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_gnutls.o"
+          dnl  need_gnutls=yes
+
+        fi
+])
+dnl  AM_CONDITIONAL(USE_GNUTLS, test x$need_gnutls = xyes)
+
 AC_ARG_WITH(ssl, [  --with-ssl[=PFX]           Compile in SSL support for 
POP/IMAP],
 [       if test "$with_ssl" != "no"
         then
@@ -713,7 +739,7 @@
 fi
 
 mutt_cv_inodesort=yes
-AC_ARG_ENABLE(inodesort,  [   --disable-inodesort      Do NOT read files in 
maildir folders sorted by inode. ],
+AC_ARG_ENABLE(inodesort,  [  --disable-inodesort        Do NOT read files in 
maildir folders sorted by inode. ],
        [if test $enableval = no ; then mutt_cv_inodesort=no; fi])
 
 if test $mutt_cv_inodesort = yes; then
--- a/init.h
+++ b/init.h
@@ -1935,12 +1935,14 @@
   ** SSL authentication process.
   */
   { "ssl_use_tlsv1", DT_BOOL, R_NONE, OPTTLSV1, 1 },
+#if defined(USE_SSL) || defined(USE_NSS)
   /*
   ** .pp
   ** This variables specifies whether to attempt to use TLSv1 in the
   ** SSL authentication process.
   */
   { "ssl_client_cert", DT_PATH, R_NONE, UL &SslClientCert, 0 },
+#endif
   /*
   ** .pp
   ** The file containing a client certificate and its associated private