aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-scanners/clamav/files/fix_libcurl_check.patch
blob: 163a32dfb0c47b7485884109ecc338a52977e25e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
clamav .102.2 tries to find clamav using culf_config. Use EO pkg_config instead

Upstream-Status: OE specific
Signed-off-by: Armin Kuster <akuster808@gmail.com>

Index: git/configure
===================================================================
--- git.orig/configure
+++ git/configure
@@ -29921,207 +29921,24 @@ $as_echo_n "checking for libcurl install
 
 
 # Check whether --with-libcurl was given.
+have_curl="no"
 if test "${with_libcurl+set}" = set; then :
   withval=$with_libcurl;
-find_curl="no"
-if test "X$withval" = "Xyes"; then
-    find_curl="yes"
-else
-    if test "X$withval" != "Xno"; then
-        if test -f "${withval}/bin/curl-config"; then
-            LIBCURL_HOME="$withval"
-            have_curl="yes"
-        fi
+  if test "X$withval" != "Xno"; then
+     if test  "${PKG_CONFIG} libcurl --exists"; then
+        LIBCURL_HOME="$withval"
+        CURL_LIBS=$($PKG_CONFIG libcurl --libs)
+        #CURL_CPPFLAGS=$($PKG_CONFIG libcurl --cflags)
+
+        CURL_LDFLAGS="-L$LIBCURL_HOME/lib"
+        CURL_CPPFLAGS="-I$LIBCURL_HOME/include"
+
+        have_curl="yes"
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$CURL_LDFLAGS $CURL_LIBS $SSL_LDFLAGS $SSL_LIBS"
     fi
-fi
-
-else
-  find_curl="yes"
-fi
-
-
-if test "X$find_curl" = "Xyes"; then
-    for p in /usr/local /usr ; do
-        if test -f "${p}/bin/curl-config"; then
-           LIBCURL_HOME=$p
-           have_curl="yes"
-        fi
-    done
-fi
-
-if test "X$have_curl" = "Xyes"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5
-$as_echo "$LIBCURL_HOME" >&6; }
-    if test -f "$LIBCURL_HOME/bin/curl-config"; then
-        CURL_LDFLAGS="$LDFLAGS"
-        CURL_LIBS=$($LIBCURL_HOME/bin/curl-config --libs)
-        CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags)
-    else
-        if test "$LIBCURL_HOME" != "/usr"; then
-            CURL_LDFLAGS="-L$LIBCURL_HOME/lib"
-            CURL_CPPFLAGS="-I$LIBCURL_HOME/include"
-        else
-            CURL_LDFLAGS="$LDFLAGS"
-            CURL_CPPFLAGS=""
-        fi
-        CURL_LIBS="-lcurl"
-    fi
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$CURL_LDFLAGS $CURL_LIBS $SSL_LDFLAGS $SSL_LIBS"
-
-        for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
   fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-
-    curl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
-    # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_curl_config+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $curl_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_curl_config="$curl_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in "$LIBCURL_HOME/bin"
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_curl_config="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_curl_config" && ac_cv_path_curl_config=""notfound""
-  ;;
-esac
-fi
-curl_config=$ac_cv_path_curl_config
-if test -n "$curl_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_config" >&5
-$as_echo "$curl_config" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-    awk_curl_version=`$curl_config --version | $AWK '{print $2}'`
-    curl_version=`echo $awk_curl_version | $curl_version_parse`
-
-    if test -z "$BUILD_CLAMONACC_TRUE"; then :
-                      if test $curl_version -ge 470272 ; then
-                        $enable_clamonacc="yes"
-                    else
-                        as_fn_error $? "Your libcurl (e.g. libcurl-devel) is too old. Installing ClamAV with clamonacc requires libcurl 7.45 or higher. For a quick fix, run ./configure again with --disable-clamonacc if you do not wish to use on-access scanning features. For more information on ClamAV's on-access scanner, please read our documentation: https://www.clamav.net/documents/on-access-scanning#on-access-scanning" "$LINENO" 5
-                    fi
-
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
-$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; }
-if ${ac_cv_lib_curl_curl_easy_init+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurl $CURL_LIBS
-     $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char curl_easy_init ();
-int
-main ()
-{
-return curl_easy_init ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_curl_curl_easy_init=yes
-else
-  ac_cv_lib_curl_curl_easy_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5
-$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; }
-if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then :
-
-            curl_msg="";
-            have_curl="yes";
-            CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS $CURL_LIBS";
-            CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS";
-            FRESHCLAM_LIBS="$FRESHCLAM_LIBS $CURL_LDFLAGS $CURL_LIBS";
-            FRESHCLAM_CPPFLAGS="$FRESHCLAM_CPPFLAGS $CURL_CPPFLAGS"
-
-else
-
-            as_fn_error $? "Your libcurl is misconfigured. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit." "$LINENO" 5
-
-fi
-
-
-    LDFLAGS="$save_LDFLAGS"
+  LDFLAGS="$save_LDFLAGS"
 else
     as_fn_error $? "libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit." "$LINENO" 5
 fi