From a720c3b5efdcd9b580110441bb22be91a4a16732 Mon Sep 17 00:00:00 2001 From: Rodrigo Rebello Date: Mon, 20 Mar 2017 13:17:42 -0300 Subject: [PATCH 1/2] Get back to using pkg-config to check for OpenSSL Commit 6300dfec7 removed the option to disable SSL support from the configure script since it became a requirement, but it also removed the use of pkg-config for finding the OpenSSL library and its dependencies. This had the unfortunate consequence of breaking the correct detection of library flags in many static linking scenarios. In some cases, for example, OpenSSL might have been built with zlib, which requires `-lz` to be passed to the linker when doing a static link of the irssi executable. Thus, pkg-config becomes an invaluable tool in such situations, since no guessing work is needed as the OpenSSL .pc file provides all the necessary flags. So, this commit re-inserts the PKG_CHECK_MODULES macro in the configure script when looking for OpenSSL. The test using AC_CHECK_LIB remains, but only as a last resort in case the one using pkg-config fails. Also, because the macro AM_PATH_GLIB_2_0 contains an unconditional call to PKG_PROG_PKG_CONFIG, the OpenSSL checks are moved so that they come after the Glib ones in order to avoid doubly checking for the pkg-config binary (PKG_CHECK_MODULES skips that check if it has been performed before, but PKG_PROG_PKG_CONFIG does not). --- configure.ac | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8d1ba706..dd5064c9 100644 --- a/configure.ac +++ b/configure.ac @@ -243,11 +243,6 @@ 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 ** @@ -289,7 +284,21 @@ if test -z "$GLIB_LIBS"; then AC_ERROR([GLIB is required to build irssi.]) fi -LIBS="$LIBS $GLIB_LIBS -lssl -lcrypto" +LIBS="$LIBS $GLIB_LIBS" + +dnl ** +dnl ** OpenSSL checks +dnl ** +PKG_CHECK_MODULES([OPENSSL], [openssl], [ + CFLAGS="$CFLAGS $OPENSSL_CFLAGS" + LIBS="$LIBS $OPENSSL_LIBS" +], [ + AC_CHECK_LIB([ssl], [SSL_library_init], [ + LIBS="$LIBS -lssl -lcrypto" + ], [ + AC_MSG_ERROR([The OpenSSL library was not found]) + ]) +]) dnl ** dnl ** curses checks From 449b8a4589f1fcadae44387999260ed5f8c6c2bf Mon Sep 17 00:00:00 2001 From: Rodrigo Rebello Date: Mon, 20 Mar 2017 15:47:24 -0300 Subject: [PATCH 2/2] Remove outdated information from INSTALL Disabling SSL support is no longer an option. --- INSTALL | 4 ---- 1 file changed, 4 deletions(-) diff --git a/INSTALL b/INSTALL index 629a75c6..d2a0acc2 100644 --- a/INSTALL +++ b/INSTALL @@ -30,10 +30,6 @@ configure options Build the irssi proxy (see startup-HOWTO). - --disable-ssl - - Disable SSL support. - --with-perl=[yes|no|module] Enable Perl support