diff --git a/clamsubmit/Makefile.am b/clamsubmit/Makefile.am index aa1952f88..c1db392f9 100644 --- a/clamsubmit/Makefile.am +++ b/clamsubmit/Makefile.am @@ -32,7 +32,7 @@ clamsubmit_SOURCES = \ AM_CFLAGS=@WERR_CFLAGS@ @CLAMSUBMIT_CFLAGS@ DEFS = @DEFS@ -DCL_NOTHREADS AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@ -LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ +LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ @JSON_LIBS@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=clamsubmit$(EXEEXT) CLEANFILES=*.gcda *.gcno diff --git a/clamsubmit/Makefile.in b/clamsubmit/Makefile.in index 7fcf8c4c1..5ff99ec64 100644 --- a/clamsubmit/Makefile.in +++ b/clamsubmit/Makefile.in @@ -354,7 +354,7 @@ LIBPRELUDE_LDFLAGS = @LIBPRELUDE_LDFLAGS@ LIBPRELUDE_LIBS = @LIBPRELUDE_LIBS@ LIBPRELUDE_PREFIX = @LIBPRELUDE_PREFIX@ LIBPRELUDE_PTHREAD_CFLAGS = @LIBPRELUDE_PTHREAD_CFLAGS@ -LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ +LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMSUBMIT_LIBS@ @THREAD_LIBS@ @JSON_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ diff --git a/configure b/configure index c26c5b5fa..4d4ce830d 100755 --- a/configure +++ b/configure @@ -24214,11 +24214,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking LFS safe fts implementation" >&5 $as_echo_n "checking LFS safe fts implementation... " >&6; } -if test "$cross_compiling" = yes; then : - have_LFS_fts=no - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -24230,15 +24226,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : have_LFS_fts=yes else have_LFS_fts=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_LFS_fts" >&5 $as_echo "$have_LFS_fts" >&6; } if test "x$have_LFS_fts" = "xyes"; then @@ -24602,28 +24595,37 @@ $as_echo_n "checking for libcurl installation... " >&6; } # Check whether --with-libcurl was given. if test "${with_libcurl+set}" = set; then : withval=$with_libcurl; -if test "$withval"; then - LIBCURL_HOME="$withval" +find_curl="no" +if test "X$withval" = "Xyes"; then + find_curl="yes" +else + if test "X$withval" != "Xno"; then + LIBCURL_HOME="$withval" + fi fi else - -LIBCURL_HOME=/usr/local -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - LIBCURL_HOME=/usr + find_curl="yes" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5 + + +if test "X$find_curl" = "Xyes"; then + LIBCURL_HOME=/usr/local +fi +if test -f "$LIBCURL_HOME/include/curl/curl.h"; then + have_curl="yes" +else + if test "X$find_curl" = "Xyes"; then + LIBCURL_HOME=/usr + if test -f "$LIBCURL_HOME/include/curl/curl.h"; then + have_curl="yes" + fi + fi +fi + +if test "X$have_curl" = "Xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5 $as_echo "$LIBCURL_HOME" >&6; } - -fi - - -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&5 -$as_echo "$as_me: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&2;} -else if test -f "$LIBCURL_HOME/bin/curl-config"; then CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) @@ -24636,7 +24638,6 @@ else CURL_CPPFLAGS="" fi fi - save_LDFLAGS="$LDFLAGS" LDFLAGS="$CURL_LDFLAGS" { $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 fi LDFLAGS="$save_LDFLAGS" +else + { $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 +$as_echo "$as_me: WARNING: libcurl not found or not requested by ./configure. Please use the web interface for submitting FPs/FNs." >&2;} fi @@ -27624,7 +27628,7 @@ else ENABLE_YARA_FALSE= fi - if test "X$have_curl" = "Xyes" && test "X$have_json" = "Xyes"; then + if test "X$have_curl" != "Xno" && test "X$have_json" != "Xno"; then ENABLE_CLAMSUBMIT_TRUE= ENABLE_CLAMSUBMIT_FALSE='#' else diff --git a/configure.ac b/configure.ac index 94c63a203..4d78cbd27 100644 --- a/configure.ac +++ b/configure.ac @@ -202,7 +202,7 @@ AM_CONDITIONAL([ENABLE_LLVM], AM_CONDITIONAL([ENABLE_YARA], [test "$enable_yara" != "no"]) AM_CONDITIONAL([ENABLE_CLAMSUBMIT], - [test "X$have_curl" = "Xyes" && test "X$have_json" = "Xyes"]) + [test "X$have_curl" != "Xno" && test "X$have_json" != "Xno"]) no_recursion="yes"; AC_OUTPUT([libclamav/Makefile]) diff --git a/m4/reorganization/libs/curl.m4 b/m4/reorganization/libs/curl.m4 index 6f29cbf54..e0185568a 100644 --- a/m4/reorganization/libs/curl.m4 +++ b/m4/reorganization/libs/curl.m4 @@ -6,22 +6,33 @@ AC_ARG_WITH([libcurl], [AS_HELP_STRING([--with-libcurl@<:@=DIR@:>@], [path to directory containing libcurl @<:@default=/usr/local or /usr if not found in /usr/local@:>@])], [ -if test "$withval"; then - LIBCURL_HOME="$withval" -fi -], [ -LIBCURL_HOME=/usr/local -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - LIBCURL_HOME=/usr -fi -AC_MSG_RESULT([$LIBCURL_HOME]) -]) - -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - AC_MSG_WARN([libcurl not found. Please use the web interface for submitting FPs/FNs.]) +find_curl="no" +if test "X$withval" = "Xyes"; then + find_curl="yes" else + if test "X$withval" != "Xno"; then + LIBCURL_HOME="$withval" + fi +fi +], +[find_curl="yes"]) + +if test "X$find_curl" = "Xyes"; then + LIBCURL_HOME=/usr/local +fi +if test -f "$LIBCURL_HOME/include/curl/curl.h"; then + have_curl="yes" +else + if test "X$find_curl" = "Xyes"; then + LIBCURL_HOME=/usr + if test -f "$LIBCURL_HOME/include/curl/curl.h"; then + have_curl="yes" + fi + fi +fi + +if test "X$have_curl" = "Xyes"; then + AC_MSG_RESULT([$LIBCURL_HOME]) if test -f "$LIBCURL_HOME/bin/curl-config"; then CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) @@ -34,12 +45,13 @@ else CURL_CPPFLAGS="" fi fi - save_LDFLAGS="$LDFLAGS" LDFLAGS="$CURL_LDFLAGS" AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"], - [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])], [$CURL_LDFLAGS]) + [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])], [$CURL_LDFLAGS]) LDFLAGS="$save_LDFLAGS" +else + AC_MSG_WARN([libcurl not found or not requested by ./configure. Please use the web interface for submitting FPs/FNs.]) fi AC_SUBST([CLAMSUBMIT_LIBS])