board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / irssi / 0001-Get-back-to-using-pkg-config-to-check-for-OpenSSL.patch
blob0ce44f935417cdd3e6cadecff8783749d60ecfe5
1 From ed0c2c1b9504a99a6dcc3c0f5de3b3a1c0232758 Mon Sep 17 00:00:00 2001
2 From: Rodrigo Rebello <rprebello@gmail.com>
3 Date: Mon, 20 Mar 2017 13:17:42 -0300
4 Subject: [PATCH] Get back to using pkg-config to check for OpenSSL
6 Commit 6300dfec7 removed the option to disable SSL support from the
7 configure script since it became a requirement, but it also removed the
8 use of pkg-config for finding the OpenSSL library and its dependencies.
10 This had the unfortunate consequence of breaking the correct detection
11 of library flags in many static linking scenarios. In some cases, for
12 example, OpenSSL might have been built with zlib, which requires `-lz`
13 to be passed to the linker when doing a static link of the irssi
14 executable. Thus, pkg-config becomes an invaluable tool in such
15 situations, since no guessing work is needed as the OpenSSL .pc file
16 provides all the necessary flags.
18 So, this patch re-inserts the PKG_CHECK_MODULES macro in the configure
19 script when looking for OpenSSL. The test using AC_CHECK_LIB remains,
20 but only as a last resort in case the one using pkg-config fails.
22 Also, because the macro AM_PATH_GLIB_2_0 contains an unconditional call
23 to PKG_PROG_PKG_CONFIG, the OpenSSL checks are moved so that they come
24 after the Glib ones in order to avoid doubly checking for the pkg-config
25 binary (PKG_CHECK_MODULES skips that check if it has been performed
26 before, but PKG_PROG_PKG_CONFIG does not).
28 Upstream status: submitted
29 https://github.com/irssi/irssi/pull/677
31 Signed-off-by: Rodrigo Rebello <rprebello@gmail.com>
32 ---
33 configure.ac | 21 +++++++++++++++------
34 1 file changed, 15 insertions(+), 6 deletions(-)
36 diff --git a/configure.ac b/configure.ac
37 index 02b33497..9f191d3f 100644
38 --- a/configure.ac
39 +++ b/configure.ac
40 @@ -231,11 +231,6 @@ if test "x$want_socks" = "xyes"; then
43 dnl **
44 -dnl ** OpenSSL checks
45 -dnl **
46 -AC_CHECK_LIB([ssl], [SSL_library_init])
48 -dnl **
49 dnl ** fe-text checks
50 dnl **
52 @@ -276,7 +271,21 @@ if test -z "$GLIB_LIBS"; then
53 AC_ERROR([GLIB is required to build irssi.])
56 -LIBS="$LIBS $GLIB_LIBS -lssl -lcrypto"
57 +LIBS="$LIBS $GLIB_LIBS"
59 +dnl **
60 +dnl ** OpenSSL checks
61 +dnl **
62 +PKG_CHECK_MODULES([OPENSSL], [openssl], [
63 + CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
64 + LIBS="$LIBS $OPENSSL_LIBS"
65 +], [
66 + AC_CHECK_LIB([ssl], [SSL_library_init], [
67 + LIBS="$LIBS -lssl -lcrypto"
68 + ], [
69 + AC_MSG_ERROR([The OpenSSL library was not found])
70 + ])
71 +])
73 dnl **
74 dnl ** curses checks
75 --
76 2.11.0