Browse code

clamonacc - rework and fixup configure script to more cleanly and correctly include/exclude clamonacc

Mickey Sola authored on 2019/06/13 05:14:59
Showing 5 changed files
... ...
@@ -25,6 +25,10 @@ EXTRA_DIST = examples shared libclamav.pc.in COPYING.bzip2 COPYING.lzma COPYING.
25 25
 
26 26
 bin_SCRIPTS=clamav-config
27 27
 
28
+if BUILD_CLAMONACC
29
+SUBDIRS += clamonacc
30
+endif
31
+
28 32
 if ENABLE_CLAMSUBMIT
29 33
 SUBDIRS += clamsubmit
30 34
 endif
... ...
@@ -18,8 +18,6 @@
18 18
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 19
 #  MA 02110-1301, USA.
20 20
 
21
-if BUILD_CLAMONACC
22
-
23 21
 bin_PROGRAMS = clamonacc
24 22
 
25 23
 clamonacc_CPPFLAGS="-g"
... ...
@@ -74,4 +72,3 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/clamd -I$(top_srcdir)/shared -I$(t
74 74
 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=clamonacc$(EXEEXT)
75 75
 CLEANFILES=*.gcda *.gcno
76 76
 
77
-endif
... ...
@@ -145,14 +145,14 @@ m4_include([m4/reorganization/code_checks/fts.m4])
145 145
 m4_include([m4/reorganization/prelude.m4])
146 146
 m4_include([m4/reorganization/bsd.m4])
147 147
 
148
+dnl Clamonacc loading
149
+m4_include([m4/reorganization/clamonacc.m4])
150
+
148 151
 dnl Freshclam dependencies
149 152
 m4_include([m4/reorganization/libs/curl.m4])
150 153
 m4_include([m4/reorganization/substitutions.m4])
151 154
 m4_include([m4/reorganization/strni.m4])
152 155
 
153
-dnl Clamonacc loading
154
-m4_include([m4/reorganization/clamonacc.m4])
155
-
156 156
 if test "x$use_internal_mspack" = "xyes"; then
157 157
     mspack_msg="Internal"
158 158
     AC_SYS_LARGEFILE
... ...
@@ -192,7 +192,6 @@ clamd/Makefile
192 192
 clamd/clamav-daemon.service
193 193
 clamd/clamav-daemon.socket
194 194
 clamdscan/Makefile
195
-clamonacc/Makefile
196 195
 clamsubmit/Makefile
197 196
 clamav-milter/Makefile
198 197
 freshclam/clamav-freshclam.service
... ...
@@ -226,6 +225,9 @@ docs/man/clamsubmit.1
226 226
 clamav-types.h
227 227
 ])
228 228
 
229
+AM_COND_IF([BUILD_CLAMONACC],
230
+           [AC_CONFIG_FILES([clamonacc/Makefile])])
231
+
229 232
 # Define variables needed to generate clamav-types.h.
230 233
 m4_include([m4/reorganization/types.m4])
231 234
 
... ...
@@ -6,27 +6,18 @@ if test "$enable_clamonacc" != "no"; then
6 6
 	AC_CANONICAL_HOST
7 7
 
8 8
         case "${host_os}" in
9
-
10 9
         	linux*)
11
-			LIBCURL_CHECK_CONFIG(
12
-			[],
13
-			[7.40.0],
14
-			[$enable_clamonacc="yes"], 
15
-			[AC_MSG_ERROR([Your libcurl (e.g. libcurl-devel) is too old. ClamAV requires libcurl 7.40 or higher.]])
16
-			)
17
-			dnl AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
18
-			dnl	int x;
19
-			dnl	curl_easy_setopt(NULL,CURLOPT_URL,NULL);
20
-			dnl	x=CURLOPT_UNIX_SOCKET_PATH;
21
-			dnl	if (x) {;}]])],$enable_clamonacc="yes", AC_MSG_ERROR([Your libcurl (e.g. libcurl-devel) is too old. ClamAV requires libcurl 7.40 or higher.]))
10
+			AM_CONDITIONAL([BUILD_CLAMONACC], [test x$enable_clamonacc != xno])
22 11
 			;;
23 12
 		*)
24 13
 			if test "$enable_clamonacc" == "yes"; then
25 14
 				AC_MSG_ERROR([Clamonacc was explicitly requested, but the platform ($host_os) you are trying to build on is not currently supported for this tool.])
26 15
 			fi
16
+			AM_CONDITIONAL([BUILD_CLAMONACC], [test x$enable_clamonacc == xno])
27 17
                         ;;
28 18
 	esac
19
+else
20
+	AM_CONDITIONAL([BUILD_CLAMONACC], [test x$enable_clamonacc == xyes])
29 21
 fi
30 22
 
31 23
 
32
-AM_CONDITIONAL([BUILD_CLAMONACC], [test x$enable_clamonacc == xyes])
... ...
@@ -49,6 +49,14 @@ if test "X$have_curl" = "Xyes"; then
49 49
     save_LDFLAGS="$LDFLAGS"
50 50
     LDFLAGS="$CURL_LDFLAGS $CURL_LIBS"
51 51
 
52
+	AM_COND_IF([BUILD_CLAMONACC], 
53
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
54
+				int x;
55
+				curl_easy_setopt(NULL,CURLOPT_URL,NULL);
56
+				x=CURLOPT_UNIX_SOCKET_PATH;
57
+                                x=CURLINFO_ACTIVESOCKET;
58
+				if (x) {;}]])],$enable_clamonacc="yes", AC_MSG_ERROR([Your libcurl (e.g. libcurl-devel) is too old. ClamAV requires libcurl 7.45 or higher.])))
59
+
52 60
     AC_CHECK_LIB(
53 61
         [curl],
54 62
         [curl_easy_init],