[dovecot-cvs] dovecot acconfig.h,1.13,1.14 configure.in,1.44,1.45

cras at procontrol.fi cras at procontrol.fi
Wed Nov 20 16:05:15 EET 2002


Update of /home/cvs/dovecot
In directory danu:/tmp/cvs-serv18612

Modified Files:
	acconfig.h configure.in 
Log Message:
Support for OpenSSL.



Index: acconfig.h
===================================================================
RCS file: /home/cvs/dovecot/acconfig.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- acconfig.h	29 Oct 2002 06:29:17 -0000	1.13
+++ acconfig.h	20 Nov 2002 14:05:13 -0000	1.14
@@ -9,6 +9,8 @@
 
 /* Build with SSL/TLS support */
 #undef HAVE_SSL
+#undef HAVE_GNUTLS
+#undef HAVE_OPENSSL
 
 /* build with IPv6 support */
 #undef HAVE_IPV6

Index: configure.in
===================================================================
RCS file: /home/cvs/dovecot/configure.in,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- configure.in	4 Nov 2002 06:11:27 -0000	1.44
+++ configure.in	20 Nov 2002 14:05:13 -0000	1.45
@@ -102,14 +102,24 @@
 		AC_DEFINE(BUILD_RAWLOG)
 	fi)
 
-AC_ARG_WITH(gnutls,
-[  --with-gnutls           Build with GNUTLS (default)],
+AC_ARG_WITH(ssl,
+[  --with-ssl=[gnutls|openssl] Build with GNUTLS (default) or OpenSSL],
 	if test x$withval = xno; then
 		want_gnutls=no
+		want_openssl=no
+	elif test x$withval = xgnutls; then
+		want_gnutls=yes
+		want_openssl=no
+	elif test x$withval = xopenssl; then
+		want_gnutls=no
+		want_openssl=yes
 	else
 		want_gnutls=yes
-	fi,
-	want_gnutls=yes)
+		want_openssl=yes
+	fi, [
+		want_gnutls=yes
+		want_openssl=yes
+	])
 
 dnl **
 dnl ** just some generic stuff...
@@ -346,22 +356,42 @@
 ])
 
 dnl **
-dnl ** SSL (gnutls)
+dnl ** SSL
 dnl **
 
 if test $want_gnutls = yes; then
-  AC_CHECK_LIB(gnutls, gnutls_global_init, [
-    AC_DEFINE(HAVE_SSL)
-    SSL_LIBS="-lgnutls -lgcrypt"
-    AC_SUBST(SSL_LIBS)
-    have_ssl=yes
-  ], [
-    have_ssl=no
-  ], -lgcrypt)
+	AC_CHECK_LIB(gnutls, gnutls_global_init, [
+		AC_DEFINE(HAVE_SSL)
+		AC_DEFINE(HAVE_GNUTLS)
+		SSL_LIBS="-lgnutls -lgcrypt"
+		AC_SUBST(SSL_LIBS)
+		have_ssl="yes (GNUTLS)"
+		have_gnutls=yes
+	], [
+		have_ssl=no
+	], -lgcrypt)
 else
-  have_ssl=no
+	have_ssl=no
+fi
+
+if test "$want_openssl" = "yes" -a "$have_ssl" = "no"; then
+	AC_CHECK_LIB(ssl, SSL_read, [
+		AC_CHECK_LIB(crypto, X509_new, [
+			AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [
+				AC_DEFINE(HAVE_SSL)
+				AC_DEFINE(HAVE_OPENSSL)
+				SSL_LIBS="-lssl -lcrypto"
+				AC_SUBST(SSL_LIBS)
+				have_ssl="yes (OpenSSL)"
+				have_openssl=yes
+			])
+		])
+	])
 fi
 
+AM_CONDITIONAL(SSL_GNUTLS, test "$have_gnutls" = "yes")
+AM_CONDITIONAL(SSL_OPENSSL, test "$have_openssl" = "yes")
+
 dnl **
 dnl ** shadow/pam support
 dnl **
@@ -481,7 +511,7 @@
 dnl **
 
 capability="IMAP4rev1"
-if test "$have_ssl" = "yes"; then
+if test "$have_ssl" != "no"; then
 	capability="$capability STARTTLS"
 fi
 AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability")




More information about the dovecot-cvs mailing list