/pidgin/main: b0d0998fd8b9: Remove manual GnuTLS configuration. ...

Michael McConville <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: b0d0998fd8b974b88db856b4f877d8a29f1bf70b
Author:	 Michael McConville <[email protected]>
Date:	 2015-07-22 21:38 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/b0d0998fd8b9

Description:

Remove manual GnuTLS configuration. There's still a little more to be done. For example, the current flags are confusing and should probably be replaced with --disable-gnutls and --disable-nss. The logic could be further simplified when this happens. We should also check whether we need to keep HAVE_GNUTLS_2_10 for Gadu-Gadu.

diffstat:

 ChangeLog    |    4 +-
 configure.ac |  117 +++++++++++-----------------------------------------------
 2 files changed, 24 insertions(+), 97 deletions(-)

diffs (193 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,8 +10,8 @@ version 3.0.0 (??/??/????):
 	  plugins support.
 	* Added dependency gobject-introspection, which is now required to enable
 	  non-native plugin support.
-	* Removed flags for manually configuring NSS. NSS will only be recognized
-	  through pkg-config. (Michael McConville)
+	* Removed flags for manually configuring GnuTLS and NSS. They are now only
+	  recognized through pkg-config. (Michael McConville)
 
 	libpurple:
 	* Specify a different set of encryption ciphers for TLS connections when
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1404,6 +1404,7 @@ else
 		AC_DEFINE_UNQUOTED(GG_CONFIG_GNUTLS_SYSTEM_TRUST_STORE, ["$gg_gnutls_sts"], [use the given file as GnuTLS default trust store])
 	fi
 
+	dnl # redundant - only here to stay compatible with libgadu upstream
 	PKG_CHECK_MODULES([GNUTLS_2_10], [gnutls >= 2.10.0], [
 		AC_DEFINE([HAVE_GNUTLS_2_10], [], [Defined if GnuTLS >= 2.10.0 is available.])
 	],:)
@@ -2083,134 +2084,60 @@ AC_ARG_ENABLE(nss,
 msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!"
 looked_for_gnutls="no"
 dnl #
-dnl # Check for GnuTLS if it's specified.
+dnl # Check for GnuTLS if it isn't disabled
 dnl #
 if test "x$enable_gnutls" != "xno"; then
-	enable_gnutls="no"
-	prefix=`eval echo $prefix`
 	looked_for_gnutls="yes"
 
-	AC_ARG_WITH(gnutls-includes,
-		[  --with-gnutls-includes=PREFIX   location of GnuTLS includes.],
-		[ with_gnutls_includes="$withval" ],
-		[ with_gnutls_includes="$prefix/include" ])
-
-	have_gnutls_includes="no"
-
-	if test "x$with_gnutls_includes" != "xno"; then
-		CPPFLAGS_save="$CPPFLAGS"
-
-		AC_MSG_CHECKING(for GnuTLS includes)
-		AC_MSG_RESULT("")
-
-		CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes"
-		AC_CHECK_HEADERS(gnutls/gnutls.h, [ gnutls_includes="yes" ])
-		CPPFLAGS="$CPPFLAGS_save"
-
-		if test "x$gnutls_includes" != "xno" -a \
-		        "x$gnutls_includes" != "x"; then
-			have_gnutls_includes="yes"
-
-			if test "x$with_gnutls_includes" != "xNONE/include"; then
-				GNUTLS_CFLAGS="-I$with_gnutls_includes"
-			fi
-		else
-			GNUTLS_CFLAGS=""
-		fi
-	else
-		AC_MSG_CHECKING(for GnuTLS includes)
-		AC_MSG_RESULT(no)
+	if `$PKG_CONFIG --exists gnutls`; then
+		dnl # minimum required version should almost certainly be higher
+		PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.10], [
+			have_gnutls="yes"
+		], [
+			AC_MSG_RESULT(no)
+			have_gnutls="no"
+		])
 	fi
 
-	AC_ARG_WITH(gnutls-libs,
-		[AS_HELP_STRING([--with-gnutls-libs=PREFIX], [location of GnuTLS libraries.])],
-		[ with_gnutls_libs="$withval" ])
+	if test "x$have_gnutls" = "xyes"; then
 
-	if test "x$with_gnutls_libs"     != "xno" -a \
-	        "x$have_gnutls_includes" != "xno"; then
+		AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS])
+		AC_DEFINE(HAVE_SSL, 1, [Define if you have SSL])
 
-		LIBS_save="$LIBS"
-
-		case $with_gnutls_libs in
-			""|-L*) ;;
-			*) with_gnutls_libs="-L$with_gnutls_libs" ;;
-		esac
-
-		AC_CACHE_CHECK([for GnuTLS libraries], ac_cv_gnutls_libs,
-		[
-			LIBS="$LIBS $with_gnutls_libs -lgnutls"
-			AC_LINK_IFELSE([AC_LANG_CALL([], [gnutls_init])], ac_cv_gnutls_libs="yes", ac_cv_gnutls_libs="no")
-			LIBS="$LIBS_save"
-		])
-
-		if test "x$ac_cv_gnutls_libs" != "xno"; then
-			AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS])
-			AC_DEFINE(HAVE_SSL)
-			msg_gnutls="GnuTLS"
-			GNUTLS_LIBS="$with_gnutls_libs -lgnutls"
-
-			enable_gnutls="yes"
-		else
-			GNUTLS_CFLAGS=""
-			GNUTLS_LIBS=""
-		fi
-	else
-		AC_MSG_CHECKING(for GnuTLS libraries)
-		AC_MSG_RESULT(no)
+		msg_gnutls="GnuTLS"
 	fi
-else
-	GNUTLS_CFLAGS=""
-	GNUTLS_LIBS=""
 fi
 
-AC_SUBST(GNUTLS_CFLAGS)
-AC_SUBST(GNUTLS_LIBS)
-
-if test "x$enable_gnutls" = "xyes"; then
-	AC_MSG_CHECKING(for gnutls_priority_set_direct and gnutls_priority_set)
-	LIBS_save="$LIBS"
-	LIBS="$LIBS $GNUTLS_LIBS"
-	CPPFLAGS_save="$CPPFLAGS"
-	CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
-	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
-                                        [[gnutls_session s; gnutls_priority_set_direct(s, NULL, NULL); gnutls_priority_set(s, NULL);]])],
-	               [AC_DEFINE([HAVE_GNUTLS_PRIORITY_FUNCS], 1,
-                                  [Define if your gnutls has gnutls_priority_set_direct and friends])
-	                AC_MSG_RESULT(yes)],
-	               [AC_MSG_RESULT(no)])
-	CPPFLAGS="$CPPFLAGS_save"
-        LIBS="$LIBS_save"
-fi
-
-
-AM_CONDITIONAL(USE_GNUTLS, test "x$enable_gnutls" = "xyes")
+AM_CONDITIONAL(USE_GNUTLS, test "x$have_gnutls" = "xyes")
 
 
 dnl #
-dnl # Check for NSS if it's specified, or if GnuTLS checks failed.
+dnl # Check for NSS if it isn't disabled
 dnl #
 looked_for_nss="no"
 if test "x$enable_nss" != "xno"; then
 	looked_for_nss="yes"
 
-	enable_nss="no"
-
 	if `$PKG_CONFIG --exists mozilla-nss`; then
+		dnl # TODO: set required minimum version
 		PKG_CHECK_MODULES(NSS, mozilla-nss, [
 			have_nss="yes"
 		], [
 			AC_MSG_RESULT(no)
 			have_nss="no"
 		])
+		dnl # TODO: do we still need these?
 		mozilla_nspr="mozilla-nspr"
 		mozilla_nss="mozilla-nss"
 	elif `$PKG_CONFIG --exists nss`; then
+		dnl # TODO: set required minimum version
 		PKG_CHECK_MODULES(NSS, nss, [
 			have_nss="yes"
 		], [
 			AC_MSG_RESULT(no)
 			have_nss="no"
 		])
+		dnl # TODO: do we still need these?
 		mozilla_nspr="nspr"
 		mozilla_nss="nss"
 	fi
@@ -2221,11 +2148,11 @@ if test "x$enable_nss" != "xno"; then
 		AC_DEFINE(HAVE_SSL, 1, [Define if you have SSL])
 
 		msg_nss="Mozilla NSS"
-		enable_nss="yes"
 	fi
 fi
 
-AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
+AM_CONDITIONAL(USE_NSS, test "x$have_nss" = "xyes")
+
 
 if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
 	msg_ssl="$msg_nss and $msg_gnutls"

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.