openbsd-ports/net/pidgin/patches/patch-configure_ac

164 lines
5.4 KiB
Plaintext
Raw Normal View History

2010-08-18 17:35:59 -04:00
$OpenBSD: patch-configure_ac,v 1.22 2010/08/18 21:36:00 steven Exp $
--- configure.ac.orig Tue Aug 10 03:35:42 2010
+++ configure.ac Sun Aug 15 21:45:59 2010
@@ -994,7 +994,7 @@ else
if test "$ac_silc_libs" != "no"; then
SILC_LIBS="-L$ac_silc_libs"
fi
- SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
+ SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -pthread $LIBDL"
AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS)
if test "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes"; then
2010-08-18 17:35:59 -04:00
@@ -1719,6 +1719,11 @@ AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_C
dnl These two are inverses of each other <-- stolen from evolution!
+AC_ARG_ENABLE(openssl,
+ [ --enable-openssl=[yes,no] attempt to use OpenSSL for SSL support [default=yes]],
+ [enable_openssl="$enableval"],
+ [enable_openssl="yes"])
+
AC_ARG_ENABLE(gnutls,
[ --enable-gnutls=[yes,no] attempt to use GnuTLS for SSL support [default=yes]],
[enable_gnutls="$enableval"],
2010-08-18 17:35:59 -04:00
@@ -1729,10 +1734,98 @@ AC_ARG_ENABLE(nss,
[enable_nss="$enableval"],
[enable_nss="yes"])
-msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!"
+msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without OpenSSL, GnuTLS or NSS."
+
+
+dnl # Check for OpenSSL if it's specified.
+dnl #
+looked_for_openssl="no"
+if test "x$enable_openssl" != "xno"; then
+ enable_openssl="no"
+ prefix=`eval echo $prefix`
+ looked_for_openssl="yes"
+
+ AC_ARG_WITH(openssl-includes,
+ [ --with-openssl-includes=PREFIX location of OpenSSL includes.],
+ [ with_openssl_includes="$withval" ],
+ [ with_openssl_includes="$prefix/include" ])
+
+ have_openssl_includes="no"
+
+ if test "x$with_openssl_includes" != "xno"; then
+ CPPFLAGS_save="$CPPFLAGS"
+
+ AC_MSG_CHECKING(for OpenSSL includes)
+ AC_MSG_RESULT("")
+
+ CPPFLAGS="$CPPFLAGS -I$with_openssl_includes"
+ AC_CHECK_HEADERS(openssl/ssl.h, [ openssl_includes="yes" ])
+ CPPFLAGS="$CPPFLAGS_save"
+
+ if test "x$openssl_includes" != "xno" -a \
+ "x$openssl_includes" != "x"; then
+ have_openssl_includes="yes"
+
+ OPENSSL_CFLAGS="-I$with_openssl_includes"
+ else
+ OPENSSL_CFLAGS=""
+ fi
+ else
+ AC_MSG_CHECKING(for OpenSSL includes)
+ AC_MSG_RESULT(no)
+ fi
+
+ AC_ARG_WITH(openssl-libs,
+ [AC_HELP_STRING([--with-openssl-libs=PREFIX], [location of OpenSSL libraries.])],
+ [ with_openssl_libs="$withval" ])
+
+ if test "x$with_openssl_libs" != "xno" -a \
+ "x$have_openssl_includes" != "xno"; then
+
+ LIBS_save="$LIBS"
+
+ case $with_openssl_libs in
+ ""|-L*) ;;
+ *) with_openssl_libs="-L$with_openssl_libs" ;;
+ esac
+
+ AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs,
+ [
+ LIBS="$LIBS $with_openssl_libs -lssl -lcrypto"
+ AC_TRY_LINK_FUNC(SSL_library_init, openssl_libs="yes", openssl_libs="no")
+ LIBS="$LIBS_save"
+ ])
+
+ if test "x$openssl_libs" != "xno"; then
+ AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have OpenSSL])
+ AC_DEFINE(HAVE_SSL)
+ msg_openssl="OpenSSL"
+ OPENSSL_LIBS="$with_openssl_libs -lssl -lcrypto"
+
+ enable_openssl="yes"
+ else
+ OPENSSL_CFLAGS=""
+ OPENSSL_LIBS=""
+ fi
+ else
+ AC_MSG_CHECKING(for OpenSSL libraries)
+ AC_MSG_RESULT(no)
+ fi
+else
+ OPENSSL_CFLAGS=""
+ OPENSSL_LIBS=""
+fi
+
+AC_SUBST(OPENSSL_CFLAGS)
+AC_SUBST(OPENSSL_LIBS)
+
+AM_CONDITIONAL(USE_OPENSSL, test "x$enable_openssl" = "xyes")
+
+
+dnl #
looked_for_gnutls="no"
dnl #
-dnl # Check for GnuTLS if it's specified.
+dnl # Check for GnuTLS if it's specified, or if OpenSSL checks failed.
dnl #
if test "x$enable_gnutls" != "xno"; then
enable_gnutls="no"
2010-08-18 17:35:59 -04:00
@@ -2130,17 +2223,32 @@ fi
AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
-if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
+if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x" -a "x$msg_openssl" != "x"; then
+ msg_ssl="$msg_nss, $msg_gnutls and $msg_openssl"
+elif test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
msg_ssl="$msg_nss and $msg_gnutls"
+elif test "x$msg_nss" != "x" -a "x$msg_openssl" != "x"; then
+ msg_ssl="$msg_nss and $msg_openssl"
+elif test "x$msg_gnutls" != "x" -a "x$msg_openssl" != "x"; then
+ msg_ssl="$msg_gnutls and $msg_openssl"
elif test "x$msg_nss" != "x"; then
msg_ssl=$msg_nss
elif test "x$msg_gnutls" != "x"; then
msg_ssl=$msg_gnutls
-elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
+elif test "x$msg_openssl" != "x"; then
+ msg_ssl=$msg_openssl
+elif test "x$looked_for_openssl" = "xyes" -a "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
AC_MSG_ERROR([
-Neither GnuTLS or NSS SSL development headers found.
-Use --disable-nss --disable-gnutls if you do not need SSL support.
-MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!
+OpenSSL, GnuTLS or NSS SSL development headers found.
+Use --disable-openssl --disable-nss --disable-gnutls if you do not need SSL support.
+MSN, Yahoo!, Novell Groupwise and Google Talk will not work without OpenSSL, GnuTLS or NSS.
+])
+
+elif test "x$looked_for_openssl" = "xyes" -a "$force_deps" = "xyes" ; then
+ AC_MSG_ERROR([
+OpenSSL SSL development headers not found.
+Use --disable-openssl if you do not need SSL support.
+MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
])
elif test "x$looked_for_gnutls" = "xyes" -a "x$force_deps" = "xyes" ; then
AC_MSG_ERROR([