]> jfr.im git - irc/irssi/irssi.git/commitdiff
Always build irssi with TLS support.
authorAlexander Færøy <redacted>
Sun, 16 Oct 2016 11:13:02 +0000 (13:13 +0200)
committerAlexander Færøy <redacted>
Sun, 16 Oct 2016 12:55:48 +0000 (14:55 +0200)
This patch removes the optional checks for whether to build irssi with
TLS support or not. This will allow us to ship a default configuration
file where we connect to TLS enabled IRC servers out of the box.

NEWS
configure.ac
src/core/network-openssl.c
src/core/servers.c

diff --git a/NEWS b/NEWS
index a76771e730a7f496160a88d9960cd712b702061f..ca6ecce3274f708d000fa3117a8fa848c6c743cd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ v0.8.21-head 2016-xx-xx  The Irssi team <staff@irssi.org>
        + autolog_ignore_targets and activity_hide_targets learn a new syntax
              tag/* and * to ignore whole networks or everything.
        + /hilight got a -matchcase flag to hilight case sensitively (#421).
+       + Always build irssi with TLS support.
        - IP addresses are no longer stored when resolve_reverse_lookup is
          used.
        - /names and $[...] now uses utf8 string operations (#40, #411).
index ee03eb823f86df4de088a930a57d4ea3ab8cfb6a..629dd5904a79a2663ab1cc988bee763987a78e98 100644 (file)
@@ -153,14 +153,6 @@ AC_ARG_ENABLE(true-color,
        fi,
        want_truecolor=no)
 
-dnl **
-dnl ** SSL Library checks (OpenSSL)
-dnl **
-
-AC_ARG_ENABLE(ssl,
-[  --disable-ssl           Disable Secure Sockets Layer support],,
-       enable_ssl=yes)
-
 dnl **
 dnl ** just some generic stuff...
 dnl **
@@ -238,6 +230,11 @@ if test "x$want_socks" = "xyes"; then
        ])
 fi
 
+dnl **
+dnl ** OpenSSL checks
+dnl **
+AC_CHECK_LIB([ssl], [SSL_library_init])
+
 dnl **
 dnl ** fe-text checks
 dnl **
@@ -279,27 +276,7 @@ if test -z "$GLIB_LIBS"; then
   AC_ERROR([GLIB is required to build irssi.])
 fi
 
-LIBS="$LIBS $GLIB_LIBS"
-
-have_openssl=no
-if test "$enable_ssl" = "yes"; then
-  PKG_CHECK_MODULES(SSL, openssl, :, :)
-  if test "$SSL_LIBS"; then
-    CFLAGS="$CFLAGS $SSL_CFLAGS"
-    have_openssl=yes
-  else
-    AC_CHECK_LIB(ssl, SSL_read, [
-      AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [
-       SSL_LIBS="-lssl -lcrypto"
-       have_openssl=yes
-      ])
-    ],, -lcrypto)
-  fi
-  if test "$have_openssl" = "yes"; then
-    AC_DEFINE(HAVE_OPENSSL,, Build with OpenSSL support)
-    LIBS="$LIBS $SSL_LIBS"
-  fi
-fi
+LIBS="$LIBS $GLIB_LIBS -lssl -lcrypto"
 
 dnl **
 dnl ** curses checks
@@ -569,12 +546,6 @@ if test "x$want_dane" = "xyes"; then
                AC_DEFINE([HAVE_DANE], [], [DANE support])
                have_dane=yes
        ], [], [-lssl -lcrypto -lsres -lpthread])
-
-       if test x$have_dane = "xyes" ; then
-               if test x$have_openssl = "xno" ; then
-                       AC_ERROR([SSL is required to build Irssi with DANE support enabled.])
-               fi
-       fi
 fi
 
 if test "x$want_truecolor" = "xyes"; then
@@ -695,16 +666,6 @@ echo "Install prefix ................... : $prefix"
 
 echo
 
-echo "Building with SSL support ........ : $have_openssl"
-if test "x$have_openssl" = "xno" -a "x$enable_ssl" = "xyes"; then
-  if test -f /etc/debian_version; then
-    echo " - Try: sudo apt-get install libssl-dev"
-  elif test -f /etc/redhat-release; then
-    echo " - Try installing openssl-devel"
-  else
-    echo " - Try installing OpenSSL development headers"
-  fi
-fi
 echo "Building with 64bit DCC support .. : $offt_64bit"
 echo "Building with DANE support ....... : $have_dane"
 echo "Building with true color support.. : $want_truecolor"
index a18e6fc7304511cac56e11c3ffecbcf8eec60ab2..014f0a284e72cc88913b423bc84c0611c9fd3024 100644 (file)
@@ -23,8 +23,6 @@
 #include "misc.h"
 #include "servers.h"
 
-#ifdef HAVE_OPENSSL
-
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
@@ -620,13 +618,5 @@ int irssi_ssl_handshake(GIOChannel *handle)
        return ret ? 0 : -1;
 }
 
-#else /* HAVE_OPENSSL */
 
-GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, SERVER_REC *server)
-{
-       g_warning("Connection failed: SSL support not enabled in this build.");
-       errno = ENOSYS;
-       return NULL;
-}
 
-#endif /* ! HAVE_OPENSSL */
index d6297c4d1b1d54fceddcc8d6dd100d17f09ec6bb..dfcbcde006066c30149a5c593746532d9b031e3d 100644 (file)
@@ -167,7 +167,6 @@ static void server_connect_callback_init(SERVER_REC *server, GIOChannel *handle)
        server_connect_finished(server);
 }
 
-#ifdef HAVE_OPENSSL
 static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *handle)
 {
        int error;
@@ -198,7 +197,6 @@ static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *han
 
        server_connect_finished(server);
 }
-#endif
 
 static void server_real_connect(SERVER_REC *server, IPADDR *ip,
                                const char *unix_socket)
@@ -247,11 +245,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
                g_free(errmsg2);
        } else {
                server->handle = net_sendbuffer_create(handle, 0);
-#ifdef HAVE_OPENSSL
                if (server->connrec->use_ssl)
                        server_connect_callback_init_ssl(server, handle);
                else
-#endif
                server->connect_tag =
                        g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
                                    (GInputFunction)