python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / sngrep / 0002-configure.ac-switch-to-pkg-config-to-find-openssl.patch
blobb51581f5c1ac5a75767c355abff47e4407ca5233
1 From 22b08ab1a45eb3773b3c90dc37a31a7574520daa Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 4 Mar 2017 14:56:53 +0100
4 Subject: [PATCH 2/2] configure.ac: switch to pkg-config to find openssl
6 Using AC_CHECK_LIB() doesn't work properly for static linking, because
7 it doesn't return information on transitive dependencies of
8 libraries. For example, if library A internally uses library B, then
9 with dynamic linking, doing -lA is sufficient. However, with static
10 linking, one must do -lA -lB, and AC_CHECK_LIB() will only give the -lA
11 information. This for example causes a build failure when building
12 sngrep statically with openssl enabled:
14 checking for SSL_new in -lssl... no
15 configure: error: You need to have libssl installed to compile sngrep
17 due to undefined symbols in the OpenSSL library.
19 The proper solution for this is to discover the library using
20 pkg-config, because pkg-config properly returns the list of necessary
21 libraries, as it understands the concept of "list of libraries needed
22 when dynamic linking" and "list of libraries needed for static linking".
24 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
25 Upstream-status: https://github.com/irontec/sngrep/pull/176
26 ---
27 configure.ac | 9 +--------
28 src/Makefile.am | 4 ++++
29 2 files changed, 5 insertions(+), 8 deletions(-)
31 diff --git a/configure.ac b/configure.ac
32 index 42e00e9..9f8e6d2 100644
33 --- a/configure.ac
34 +++ b/configure.ac
35 @@ -129,14 +129,7 @@ AS_IF([test "x$WITH_OPENSSL" == "xyes"], [
36 AS_IF([test "x$WITH_GNUTLS" == "xyes"], [
37 AC_MSG_ERROR([ GnuTLS and OpenSSL can not be enabled at the same time ])
38 ], [])
40 - AC_CHECK_LIB([ssl], [SSL_new], [], [
41 - AC_MSG_ERROR([ You need to have libssl installed to compile sngrep])
42 - ])
44 - AC_CHECK_LIB([crypto], [EVP_get_cipherbyname], [], [
45 - AC_MSG_ERROR([ You need to have libcrypto installed to compile sngrep])
46 - ])
47 + PKG_CHECK_MODULES([SSL], [libssl libcrypto])
48 AC_DEFINE([WITH_OPENSSL],[],[Compile With Openssl compatibility])
49 ], [])
51 diff --git a/src/Makefile.am b/src/Makefile.am
52 index 961f4a0..3a471b7 100644
53 --- a/src/Makefile.am
54 +++ b/src/Makefile.am
55 @@ -1,6 +1,8 @@
56 AUTOMAKE_OPTIONS=subdir-objects
57 bin_PROGRAMS=sngrep
58 sngrep_SOURCES=capture.c
59 +sngrep_CFLAGS=
60 +sngrep_LDADD=
61 if USE_EEP
62 sngrep_SOURCES+=capture_eep.c
63 endif
64 @@ -9,6 +11,8 @@ sngrep_SOURCES+=capture_gnutls.c
65 endif
66 if WITH_OPENSSL
67 sngrep_SOURCES+=capture_openssl.c
68 +sngrep_CFLAGS+=$(SSL_CFLAGS)
69 +sngrep_LDADD+=$(SSL_LIBS)
70 endif
71 sngrep_SOURCES+=address.c packet.c sip.c sip_call.c sip_msg.c sip_attr.c main.c
72 sngrep_SOURCES+=option.c group.c filter.c keybinding.c media.c setting.c rtp.c
73 --
74 2.7.4