Browse code

bb11867/11885 - Fix clamsubmit build issues.

Steven Morgan authored on 2017/08/10 05:11:32
Showing 5 changed files
... ...
@@ -32,7 +32,7 @@ clamsubmit_SOURCES = \
32 32
 AM_CFLAGS=@WERR_CFLAGS@ @CLAMSUBMIT_CFLAGS@
33 33
 DEFS = @DEFS@ -DCL_NOTHREADS
34 34
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
35
-LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@
35
+LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ @JSON_LIBS@
36 36
 
37 37
 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=clamsubmit$(EXEEXT)
38 38
 CLEANFILES=*.gcda *.gcno
... ...
@@ -354,7 +354,7 @@ LIBPRELUDE_LDFLAGS = @LIBPRELUDE_LDFLAGS@
354 354
 LIBPRELUDE_LIBS = @LIBPRELUDE_LIBS@
355 355
 LIBPRELUDE_PREFIX = @LIBPRELUDE_PREFIX@
356 356
 LIBPRELUDE_PTHREAD_CFLAGS = @LIBPRELUDE_PTHREAD_CFLAGS@
357
-LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@
357
+LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ @JSON_LIBS@
358 358
 LIBTOOL = @LIBTOOL@
359 359
 LIPO = @LIPO@
360 360
 LN_S = @LN_S@
... ...
@@ -24214,11 +24214,7 @@ fi
24214 24214
 
24215 24215
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking LFS safe fts implementation" >&5
24216 24216
 $as_echo_n "checking LFS safe fts implementation... " >&6; }
24217
-if test "$cross_compiling" = yes; then :
24218
-  have_LFS_fts=no
24219
-
24220
-else
24221
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24217
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24222 24218
 /* end confdefs.h.  */
24223 24219
 
24224 24220
 #include <fts.h>
... ...
@@ -24230,15 +24226,12 @@ int main(void) {
24230 24230
 }
24231 24231
 
24232 24232
 _ACEOF
24233
-if ac_fn_c_try_run "$LINENO"; then :
24233
+if ac_fn_c_try_compile "$LINENO"; then :
24234 24234
   have_LFS_fts=yes
24235 24235
 else
24236 24236
   have_LFS_fts=no
24237 24237
 fi
24238
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24239
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
24240
-fi
24241
-
24238
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24242 24239
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_LFS_fts" >&5
24243 24240
 $as_echo "$have_LFS_fts" >&6; }
24244 24241
  if test "x$have_LFS_fts" = "xyes"; then
... ...
@@ -24602,28 +24595,37 @@ $as_echo_n "checking for libcurl installation... " >&6; }
24602 24602
 # Check whether --with-libcurl was given.
24603 24603
 if test "${with_libcurl+set}" = set; then :
24604 24604
   withval=$with_libcurl;
24605
-if test "$withval"; then
24606
-    LIBCURL_HOME="$withval"
24607
-fi
24608
-
24605
+find_curl="no"
24606
+if test "X$withval" = "Xyes"; then
24607
+    find_curl="yes"
24609 24608
 else
24610
-
24611
-LIBCURL_HOME=/usr/local
24612
-if test ! -f "$LIBCURL_HOME/include/curl/curl.h"
24613
-then
24614
-    LIBCURL_HOME=/usr
24609
+    if test "X$withval" != "Xno"; then
24610
+        LIBCURL_HOME="$withval"
24611
+    fi
24615 24612
 fi
24616
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5
24617
-$as_echo "$LIBCURL_HOME" >&6; }
24618 24613
 
24614
+else
24615
+  find_curl="yes"
24619 24616
 fi
24620 24617
 
24621 24618
 
24622
-if test ! -f "$LIBCURL_HOME/include/curl/curl.h"
24623
-then
24624
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&5
24625
-$as_echo "$as_me: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&2;}
24619
+if test "X$find_curl" = "Xyes"; then
24620
+    LIBCURL_HOME=/usr/local
24621
+fi
24622
+if test -f "$LIBCURL_HOME/include/curl/curl.h"; then
24623
+    have_curl="yes"
24626 24624
 else
24625
+    if test "X$find_curl" = "Xyes"; then
24626
+        LIBCURL_HOME=/usr
24627
+        if test -f "$LIBCURL_HOME/include/curl/curl.h"; then
24628
+            have_curl="yes"
24629
+        fi
24630
+    fi
24631
+fi
24632
+
24633
+if test "X$have_curl" = "Xyes"; then
24634
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5
24635
+$as_echo "$LIBCURL_HOME" >&6; }
24627 24636
     if test -f "$LIBCURL_HOME/bin/curl-config"; then
24628 24637
         CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs)
24629 24638
         CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags)
... ...
@@ -24636,7 +24638,6 @@ else
24636 24636
             CURL_CPPFLAGS=""
24637 24637
         fi
24638 24638
     fi
24639
-
24640 24639
     save_LDFLAGS="$LDFLAGS"
24641 24640
     LDFLAGS="$CURL_LDFLAGS"
24642 24641
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
... ...
@@ -24683,6 +24684,9 @@ $as_echo "$as_me: WARNING: Your libcurl is misconfigured. Please use the web int
24683 24683
 fi
24684 24684
 
24685 24685
     LDFLAGS="$save_LDFLAGS"
24686
+else
24687
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found or not requested by ./configure. Please use the web interface for submitting FPs/FNs." >&5
24688
+$as_echo "$as_me: WARNING: libcurl not found or not requested by ./configure. Please use the web interface for submitting FPs/FNs." >&2;}
24686 24689
 fi
24687 24690
 
24688 24691
 
... ...
@@ -27624,7 +27628,7 @@ else
27624 27624
   ENABLE_YARA_FALSE=
27625 27625
 fi
27626 27626
 
27627
- if test "X$have_curl" = "Xyes" && test "X$have_json" = "Xyes"; then
27627
+ if test "X$have_curl" != "Xno" && test "X$have_json" != "Xno"; then
27628 27628
   ENABLE_CLAMSUBMIT_TRUE=
27629 27629
   ENABLE_CLAMSUBMIT_FALSE='#'
27630 27630
 else
... ...
@@ -202,7 +202,7 @@ AM_CONDITIONAL([ENABLE_LLVM],
202 202
 AM_CONDITIONAL([ENABLE_YARA],
203 203
 	       [test "$enable_yara" != "no"])
204 204
 AM_CONDITIONAL([ENABLE_CLAMSUBMIT],
205
-	       [test "X$have_curl" = "Xyes" && test "X$have_json" = "Xyes"])
205
+	       [test "X$have_curl" != "Xno" && test "X$have_json" != "Xno"])
206 206
 no_recursion="yes";
207 207
 
208 208
 AC_OUTPUT([libclamav/Makefile])
... ...
@@ -6,22 +6,33 @@ AC_ARG_WITH([libcurl],
6 6
 [AS_HELP_STRING([--with-libcurl@<:@=DIR@:>@], [path to directory containing libcurl
7 7
                 @<:@default=/usr/local or /usr if not found in /usr/local@:>@])],
8 8
 [
9
-if test "$withval"; then
10
-    LIBCURL_HOME="$withval"
11
-fi
12
-], [
13
-LIBCURL_HOME=/usr/local
14
-if test ! -f "$LIBCURL_HOME/include/curl/curl.h"
15
-then
16
-    LIBCURL_HOME=/usr
9
+find_curl="no"
10
+if test "X$withval" = "Xyes"; then
11
+    find_curl="yes"
12
+else
13
+    if test "X$withval" != "Xno"; then
14
+        LIBCURL_HOME="$withval"
15
+    fi
17 16
 fi
18
-AC_MSG_RESULT([$LIBCURL_HOME])
19
-])
17
+],
18
+[find_curl="yes"])
20 19
 
21
-if test ! -f "$LIBCURL_HOME/include/curl/curl.h"
22
-then
23
-    AC_MSG_WARN([libcurl not found. Please use the web interface for submitting FPs/FNs.])
20
+if test "X$find_curl" = "Xyes"; then
21
+    LIBCURL_HOME=/usr/local
22
+fi
23
+if test -f "$LIBCURL_HOME/include/curl/curl.h"; then
24
+    have_curl="yes"
24 25
 else
26
+    if test "X$find_curl" = "Xyes"; then
27
+        LIBCURL_HOME=/usr
28
+        if test -f "$LIBCURL_HOME/include/curl/curl.h"; then
29
+            have_curl="yes"
30
+        fi
31
+    fi
32
+fi
33
+
34
+if test "X$have_curl" = "Xyes"; then
35
+    AC_MSG_RESULT([$LIBCURL_HOME])
25 36
     if test -f "$LIBCURL_HOME/bin/curl-config"; then
26 37
         CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs)
27 38
         CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags)
... ...
@@ -34,12 +45,13 @@ else
34 34
             CURL_CPPFLAGS=""
35 35
         fi
36 36
     fi
37
-
38 37
     save_LDFLAGS="$LDFLAGS"
39 38
     LDFLAGS="$CURL_LDFLAGS"
40 39
     AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"],
41
-            [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])], [$CURL_LDFLAGS])
40
+        [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])], [$CURL_LDFLAGS])
42 41
     LDFLAGS="$save_LDFLAGS"
42
+else
43
+    AC_MSG_WARN([libcurl not found or not requested by ./configure. Please use the web interface for submitting FPs/FNs.])
43 44
 fi
44 45
 
45 46
 AC_SUBST([CLAMSUBMIT_LIBS])