]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/clamav/0003-m4-reorganization-libs-curl.m4-fix-curl-config-detec.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / clamav / 0003-m4-reorganization-libs-curl.m4-fix-curl-config-detec.patch
1 From 6b6ff53b5931c162be13504a1efc53fc5212f9d1 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3 Date: Mon, 7 May 2018 22:57:34 +0200
4 Subject: [PATCH] m4/reorganization/libs/curl.m4: fix curl-config detection
5  logic
6
7 The current logic in curl.m4 doesn't behave properly when
8 --without-libcurl is passed to the ./configure script.
9
10 Indeed, in this case what happens is that:
11
12  (1) Since --without-libcurl is passed, LIBCURL_HOME is set to nothing
13
14  (2) find_curl is set to "no"
15
16  (3) Due to find_curl being "no", LIBCURL_HOME is not set to
17      /usr/local and remains empty
18
19  (4) We test if $LIBCURL_HOME/bin/curl_config exists, which is
20      equivalent to testing if /bin/curl-config exists. So curl.m4 is
21      looking at /bin/curl-config, which is irrelevant in a
22      cross-compilation context: it is not because the build machine
23      has libcurl installed that it is available for the target.
24
25      Due to this mistake, it sets have_curl="yes"
26
27 Due to this, the ./configure script assumes it can build the
28 clamsubmit program, which fails at build time because curl/curl.h
29 doesn't exist.
30
31 To fix this, this commit rewrites the curl-config detection logic with
32 a simpler loop. If find_curl=yes, it means we have to find libcurl
33 ourselves, so we iterate over /usr/local and /usr, and check if a
34 bin/curl-config binary is available there. If so, we use this path as
35 LIBCURL_HOME and set have_curl="yes".
36
37 This preserves the existing behavior, while fixing the situation where
38 --without-libcurl is passed, but /bin/curl-config exists.
39
40 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
41 Upstream-status: https://github.com/Cisco-Talos/clamav-devel/pull/87
42 ---
43  m4/reorganization/libs/curl.m4 | 15 +++++----------
44  1 file changed, 5 insertions(+), 10 deletions(-)
45
46 diff --git a/m4/reorganization/libs/curl.m4 b/m4/reorganization/libs/curl.m4
47 index 2a5966ee7..b6a9c2137 100644
48 --- a/m4/reorganization/libs/curl.m4
49 +++ b/m4/reorganization/libs/curl.m4
50 @@ -19,17 +19,12 @@ fi
51  [find_curl="yes"])
52  
53  if test "X$find_curl" = "Xyes"; then
54 -    LIBCURL_HOME=/usr/local
55 -fi
56 -if test -f "$LIBCURL_HOME/bin/curl-config"; then
57 -    have_curl="yes"
58 -else
59 -    if test "X$find_curl" = "Xyes"; then
60 -        LIBCURL_HOME=/usr
61 -        if test -f "$LIBCURL_HOME/bin/curl-config"; then
62 -            have_curl="yes"
63 +    for p in /usr/local /usr ; do
64 +        if test -f "${p}/bin/curl-config"; then
65 +           LIBCURL_HOME=$p
66 +           have_curl="yes"
67          fi
68 -    fi
69 +    done
70  fi
71  
72  if test "X$have_curl" = "Xyes"; then
73 -- 
74 2.14.3
75