git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@246 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/02/06 22:46:08... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Fri Feb 6 14:36:36 CET 2004 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * support for clamav-config.h instead of multiple defines (Thomas Lamy) |
|
4 |
+ * libclamav: more flexible file type recognition (Thomas Lamy) |
|
5 |
+ |
|
1 | 6 |
Fri Feb 6 13:20:51 GMT 2004 (njh) |
2 | 7 |
---------------------------------- |
3 | 8 |
* libclamav: Added new bounce message |
... | ... |
@@ -120,6 +120,7 @@ EXTRA_DIST = FAQ contrib test examples BUGS |
120 | 120 |
subdir = . |
121 | 121 |
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
122 | 122 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
123 |
+CONFIG_HEADER = clamav-config.h |
|
123 | 124 |
CONFIG_CLEAN_FILES = |
124 | 125 |
DIST_SOURCES = |
125 | 126 |
|
... | ... |
@@ -128,11 +129,12 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ |
128 | 128 |
install-exec-recursive installdirs-recursive install-recursive \ |
129 | 129 |
uninstall-recursive check-recursive installcheck-recursive |
130 | 130 |
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ |
131 |
- Makefile.in NEWS TODO acinclude.m4 aclocal.m4 config.guess \ |
|
132 |
- config.sub configure configure.in depcomp install-sh ltmain.sh \ |
|
133 |
- missing mkinstalldirs |
|
131 |
+ Makefile.in NEWS TODO acinclude.m4 aclocal.m4 \ |
|
132 |
+ clamav-config.h.in config.guess config.sub configure \ |
|
133 |
+ configure.in depcomp install-sh ltmain.sh missing mkinstalldirs |
|
134 | 134 |
DIST_SUBDIRS = $(SUBDIRS) |
135 |
-all: all-recursive |
|
135 |
+all: clamav-config.h |
|
136 |
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive |
|
136 | 137 |
|
137 | 138 |
.SUFFIXES: |
138 | 139 |
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) |
... | ... |
@@ -149,6 +151,23 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENC |
149 | 149 |
$(ACLOCAL_M4): configure.in acinclude.m4 |
150 | 150 |
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) |
151 | 151 |
|
152 |
+clamav-config.h: stamp-h1 |
|
153 |
+ @if test ! -f $@; then \ |
|
154 |
+ rm -f stamp-h1; \ |
|
155 |
+ $(MAKE) stamp-h1; \ |
|
156 |
+ else :; fi |
|
157 |
+ |
|
158 |
+stamp-h1: $(srcdir)/clamav-config.h.in $(top_builddir)/config.status |
|
159 |
+ @rm -f stamp-h1 |
|
160 |
+ cd $(top_builddir) && $(SHELL) ./config.status clamav-config.h |
|
161 |
+ |
|
162 |
+$(srcdir)/clamav-config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) |
|
163 |
+ cd $(top_srcdir) && $(AUTOHEADER) |
|
164 |
+ touch $(srcdir)/clamav-config.h.in |
|
165 |
+ |
|
166 |
+distclean-hdr: |
|
167 |
+ -rm -f clamav-config.h |
|
168 |
+ |
|
152 | 169 |
mostlyclean-libtool: |
153 | 170 |
-rm -f *.lo |
154 | 171 |
|
... | ... |
@@ -228,7 +247,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) |
228 | 228 |
END { for (i in files) print i; }'`; \ |
229 | 229 |
mkid -fID $$unique |
230 | 230 |
|
231 |
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ |
|
231 |
+TAGS: tags-recursive $(HEADERS) $(SOURCES) clamav-config.h.in $(TAGS_DEPENDENCIES) \ |
|
232 | 232 |
$(TAGS_FILES) $(LISP) |
233 | 233 |
tags=; \ |
234 | 234 |
here=`pwd`; \ |
... | ... |
@@ -237,7 +256,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ |
237 | 237 |
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ |
238 | 238 |
fi; \ |
239 | 239 |
done; \ |
240 |
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ |
|
240 |
+ list='$(SOURCES) $(HEADERS) clamav-config.h.in $(LISP) $(TAGS_FILES)'; \ |
|
241 | 241 |
unique=`for i in $$list; do \ |
242 | 242 |
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ |
243 | 243 |
done | \ |
... | ... |
@@ -357,7 +376,7 @@ distcleancheck: distclean |
357 | 357 |
exit 1; } >&2 |
358 | 358 |
check-am: all-am |
359 | 359 |
check: check-recursive |
360 |
-all-am: Makefile |
|
360 |
+all-am: Makefile clamav-config.h |
|
361 | 361 |
installdirs: installdirs-recursive |
362 | 362 |
installdirs-am: |
363 | 363 |
|
... | ... |
@@ -391,7 +410,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am |
391 | 391 |
|
392 | 392 |
distclean: distclean-recursive |
393 | 393 |
-rm -f config.status config.cache config.log |
394 |
-distclean-am: clean-am distclean-generic distclean-libtool \ |
|
394 |
+distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ |
|
395 | 395 |
distclean-tags |
396 | 396 |
|
397 | 397 |
dvi: dvi-recursive |
... | ... |
@@ -426,7 +445,7 @@ uninstall-info: uninstall-info-recursive |
426 | 426 |
|
427 | 427 |
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ |
428 | 428 |
clean-generic clean-libtool clean-recursive dist dist-all \ |
429 |
- dist-gzip distcheck distclean distclean-generic \ |
|
429 |
+ dist-gzip distcheck distclean distclean-generic distclean-hdr \ |
|
430 | 430 |
distclean-libtool distclean-recursive distclean-tags \ |
431 | 431 |
distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ |
432 | 432 |
info-recursive install install-am install-data install-data-am \ |
... | ... |
@@ -81,7 +81,7 @@ dnl there is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for |
81 | 81 |
dnl PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever created |
82 | 82 |
dnl (the prefix is a bit different, since we add an extra -target- and -host-) |
83 | 83 |
dnl |
84 |
-dnl @version: $Id: aclocal.m4,v 1.17 2004/02/01 01:18:56 kojm Exp $ |
|
84 |
+dnl @version: $Id: aclocal.m4,v 1.18 2004/02/06 13:46:07 kojm Exp $ |
|
85 | 85 |
dnl @author Guido Draheim <guidod@gmx.de> STATUS: used often |
86 | 86 |
|
87 | 87 |
AC_DEFUN([AC_CREATE_TARGET_H], |
... | ... |
@@ -4041,7 +4041,7 @@ dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) |
4041 | 4041 |
dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers) |
4042 | 4042 |
dnl |
4043 | 4043 |
dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu> |
4044 |
-dnl @version $Id: aclocal.m4,v 1.17 2004/02/01 01:18:56 kojm Exp $ |
|
4044 |
+dnl @version $Id: aclocal.m4,v 1.18 2004/02/06 13:46:07 kojm Exp $ |
|
4045 | 4045 |
dnl |
4046 | 4046 |
AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], |
4047 | 4047 |
[changequote(<<, >>)dnl |
... | ... |
@@ -4809,3 +4809,81 @@ AC_CONFIG_COMMANDS_PRE( |
4809 | 4809 |
Usually this means the macro was only invoked conditionally.]) |
4810 | 4810 |
fi])]) |
4811 | 4811 |
|
4812 |
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- |
|
4813 |
+ |
|
4814 |
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. |
|
4815 |
+ |
|
4816 |
+# This program is free software; you can redistribute it and/or modify |
|
4817 |
+# it under the terms of the GNU General Public License as published by |
|
4818 |
+# the Free Software Foundation; either version 2, or (at your option) |
|
4819 |
+# any later version. |
|
4820 |
+ |
|
4821 |
+# This program is distributed in the hope that it will be useful, |
|
4822 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
4823 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
4824 |
+# GNU General Public License for more details. |
|
4825 |
+ |
|
4826 |
+# You should have received a copy of the GNU General Public License |
|
4827 |
+# along with this program; if not, write to the Free Software |
|
4828 |
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
|
4829 |
+# 02111-1307, USA. |
|
4830 |
+ |
|
4831 |
+AC_PREREQ([2.52]) |
|
4832 |
+ |
|
4833 |
+# serial 6 |
|
4834 |
+ |
|
4835 |
+# When config.status generates a header, we must update the stamp-h file. |
|
4836 |
+# This file resides in the same directory as the config header |
|
4837 |
+# that is generated. We must strip everything past the first ":", |
|
4838 |
+# and everything past the last "/". |
|
4839 |
+ |
|
4840 |
+# _AM_DIRNAME(PATH) |
|
4841 |
+# ----------------- |
|
4842 |
+# Like AS_DIRNAME, only do it during macro expansion |
|
4843 |
+AC_DEFUN([_AM_DIRNAME], |
|
4844 |
+ [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, |
|
4845 |
+ m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, |
|
4846 |
+ m4_if(regexp([$1], [^/.*]), -1, |
|
4847 |
+ [.], |
|
4848 |
+ patsubst([$1], [^\(/\).*], [\1])), |
|
4849 |
+ patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), |
|
4850 |
+ patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl |
|
4851 |
+])# _AM_DIRNAME |
|
4852 |
+ |
|
4853 |
+ |
|
4854 |
+# The stamp files are numbered to have different names. |
|
4855 |
+# We could number them on a directory basis, but that's additional |
|
4856 |
+# complications, let's have a unique counter. |
|
4857 |
+m4_define([_AM_STAMP_Count], [0]) |
|
4858 |
+ |
|
4859 |
+ |
|
4860 |
+# _AM_STAMP(HEADER) |
|
4861 |
+# ----------------- |
|
4862 |
+# The name of the stamp file for HEADER. |
|
4863 |
+AC_DEFUN([_AM_STAMP], |
|
4864 |
+[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl |
|
4865 |
+AS_ESCAPE(_AM_DIRNAME(patsubst([$1], |
|
4866 |
+ [:.*])))/stamp-h[]_AM_STAMP_Count]) |
|
4867 |
+ |
|
4868 |
+ |
|
4869 |
+# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) |
|
4870 |
+# ------------------------------------------------------------ |
|
4871 |
+# We used to try to get a real timestamp in stamp-h. But the fear is that |
|
4872 |
+# that will cause unnecessary cvs conflicts. |
|
4873 |
+AC_DEFUN([_AM_CONFIG_HEADER], |
|
4874 |
+[# Add the stamp file to the list of files AC keeps track of, |
|
4875 |
+# along with our hook. |
|
4876 |
+AC_CONFIG_HEADERS([$1], |
|
4877 |
+ [# update the timestamp |
|
4878 |
+echo 'timestamp for $1' >"_AM_STAMP([$1])" |
|
4879 |
+$2], |
|
4880 |
+ [$3]) |
|
4881 |
+])# _AM_CONFIG_HEADER |
|
4882 |
+ |
|
4883 |
+ |
|
4884 |
+# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) |
|
4885 |
+# -------------------------------------------------------------- |
|
4886 |
+AC_DEFUN([AM_CONFIG_HEADER], |
|
4887 |
+[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) |
|
4888 |
+])# AM_CONFIG_HEADER |
|
4889 |
+ |
... | ... |
@@ -132,6 +132,7 @@ INCLUDES = -I../clamd -I../libclamav -I../clamscan |
132 | 132 |
EXTRA_DIST = clamav-milter.c clamd.sh clamav-milter.sh INSTALL |
133 | 133 |
subdir = clamav-milter |
134 | 134 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
135 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
135 | 136 |
CONFIG_CLEAN_FILES = |
136 | 137 |
@BUILD_CLAMD_FALSE@@HAVE_MILTER_TRUE@sbin_PROGRAMS = |
137 | 138 |
@BUILD_CLAMD_FALSE@@HAVE_MILTER_FALSE@sbin_PROGRAMS = |
... | ... |
@@ -151,7 +152,7 @@ clamav_milter_OBJECTS = $(am_clamav_milter_OBJECTS) |
151 | 151 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ ../clamscan/getopt.o |
152 | 152 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_FALSE@clamav_milter_DEPENDENCIES = |
153 | 153 |
clamav_milter_LDFLAGS = |
154 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
154 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
155 | 155 |
CPPFLAGS = @CPPFLAGS@ |
156 | 156 |
LDFLAGS = @LDFLAGS@ |
157 | 157 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -153,6 +153,7 @@ LIBS = -L../libclamav -lclamav @CLAMD_LIBS@ |
153 | 153 |
INCLUDES = -I../clamscan -I../libclamav |
154 | 154 |
subdir = clamd |
155 | 155 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
156 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
156 | 157 |
CONFIG_CLEAN_FILES = |
157 | 158 |
@BUILD_CLAMD_TRUE@sbin_PROGRAMS = clamd$(EXEEXT) |
158 | 159 |
@BUILD_CLAMD_FALSE@sbin_PROGRAMS = |
... | ... |
@@ -169,7 +170,7 @@ clamd_OBJECTS = $(am_clamd_OBJECTS) |
169 | 169 |
@BUILD_CLAMD_TRUE@clamd_DEPENDENCIES = ../clamscan/getopt.o |
170 | 170 |
@BUILD_CLAMD_FALSE@clamd_DEPENDENCIES = |
171 | 171 |
clamd_LDFLAGS = |
172 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
172 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
173 | 173 |
CPPFLAGS = @CPPFLAGS@ |
174 | 174 |
LDFLAGS = @LDFLAGS@ |
175 | 175 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <stdlib.h> |
21 | 25 |
#include <string.h> |
... | ... |
@@ -27,7 +31,6 @@ |
27 | 27 |
#include "defaults.h" |
28 | 28 |
#include "str.h" |
29 | 29 |
|
30 |
- |
|
31 | 30 |
struct cfgstruct *parsecfg(const char *cfgfile) |
32 | 31 |
{ |
33 | 32 |
char buff[LINE_LENGTH], *name, *arg; |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <stdlib.h> |
21 | 25 |
#include <unistd.h> |
... | ... |
@@ -35,11 +39,14 @@ |
35 | 35 |
#include "options.h" |
36 | 36 |
#include "cfgfile.h" |
37 | 37 |
#include "others.h" |
38 |
+/* Fixes gcc warning */ |
|
39 |
+#include "../libclamav/others.h" |
|
38 | 40 |
#include "tcpserver.h" |
39 | 41 |
#include "localserver.h" |
40 | 42 |
#include "others.h" |
41 | 43 |
#include "defaults.h" |
42 | 44 |
|
45 |
+ |
|
43 | 46 |
void help(void); |
44 | 47 |
void daemonize(void); |
45 | 48 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002, 2003 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#ifdef CLAMUKO |
20 | 24 |
|
21 | 25 |
#include <stdio.h> |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <string.h> |
21 | 25 |
#include <sys/types.h> |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002, 2003 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <stdlib.h> |
21 | 25 |
#include <string.h> |
... | ... |
@@ -130,6 +130,7 @@ INCLUDES = -I../clamscan -I../clamd -I../libclamav |
130 | 130 |
LIBS = -L../libclamav -lclamav @FRESHCLAM_LIBS@ |
131 | 131 |
subdir = clamdscan |
132 | 132 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
133 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
133 | 134 |
CONFIG_CLEAN_FILES = |
134 | 135 |
@BUILD_CLAMD_TRUE@bin_PROGRAMS = clamdscan$(EXEEXT) |
135 | 136 |
@BUILD_CLAMD_FALSE@bin_PROGRAMS = |
... | ... |
@@ -145,7 +146,7 @@ clamdscan_OBJECTS = $(am_clamdscan_OBJECTS) |
145 | 145 |
clamdscan_LDFLAGS = |
146 | 146 |
|
147 | 147 |
DEFS = @DEFS@ |
148 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
148 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
149 | 149 |
CPPFLAGS = @CPPFLAGS@ |
150 | 150 |
LDFLAGS = @LDFLAGS@ |
151 | 151 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <string.h> |
21 | 25 |
#include <stdlib.h> |
... | ... |
@@ -29,6 +33,7 @@ |
29 | 29 |
#include "defaults.h" |
30 | 30 |
#include "client.h" |
31 | 31 |
|
32 |
+ |
|
32 | 33 |
void help(void); |
33 | 34 |
|
34 | 35 |
/* this local macro takes care about freeing memory at exit */ |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <unistd.h> |
21 | 25 |
#include <sys/types.h> |
... | ... |
@@ -139,6 +139,7 @@ LIBS = -L../libclamav -lclamav |
139 | 139 |
INCLUDES = -I.. -I../libclamav |
140 | 140 |
subdir = clamscan |
141 | 141 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
142 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
142 | 143 |
CONFIG_CLEAN_FILES = |
143 | 144 |
bin_PROGRAMS = clamscan$(EXEEXT) |
144 | 145 |
PROGRAMS = $(bin_PROGRAMS) |
... | ... |
@@ -150,7 +151,7 @@ clamscan_OBJECTS = $(am_clamscan_OBJECTS) |
150 | 150 |
clamscan_LDADD = $(LDADD) |
151 | 151 |
clamscan_DEPENDENCIES = |
152 | 152 |
clamscan_LDFLAGS = |
153 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
153 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
154 | 154 |
CPPFLAGS = @CPPFLAGS@ |
155 | 155 |
LDFLAGS = @LDFLAGS@ |
156 | 156 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002 - 2004 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +16,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <stdlib.h> |
21 | 25 |
#include <string.h> |
... | ... |
@@ -1671,8 +1671,6 @@ do |
1671 | 1671 |
done |
1672 | 1672 |
|
1673 | 1673 |
|
1674 |
- |
|
1675 |
- |
|
1676 | 1674 |
am__api_version="1.6" |
1677 | 1675 |
# Find a good install program. We prefer a C program (faster), |
1678 | 1676 |
# so one script is as good as another. But avoid the broken or |
... | ... |
@@ -2028,6 +2026,13 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" |
2028 | 2028 |
|
2029 | 2029 |
|
2030 | 2030 |
|
2031 |
+# Add the stamp file to the list of files AC keeps track of, |
|
2032 |
+# along with our hook. |
|
2033 |
+ac_config_headers="$ac_config_headers clamav-config.h" |
|
2034 |
+ |
|
2035 |
+ |
|
2036 |
+ |
|
2037 |
+ |
|
2031 | 2038 |
LC_CURRENT=1 |
2032 | 2039 |
LC_REVISION=3 |
2033 | 2040 |
LC_AGE=0 |
... | ... |
@@ -4535,7 +4540,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes |
4535 | 4535 |
case $host in |
4536 | 4536 |
*-*-irix6*) |
4537 | 4537 |
# Find out which ABI we are using. |
4538 |
- echo '#line 4538 "configure"' > conftest.$ac_ext |
|
4538 |
+ echo '#line 4543 "configure"' > conftest.$ac_ext |
|
4539 | 4539 |
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
4540 | 4540 |
(eval $ac_compile) 2>&5 |
4541 | 4541 |
ac_status=$? |
... | ... |
@@ -5071,7 +5076,7 @@ chmod -w . |
5071 | 5071 |
save_CFLAGS="$CFLAGS" |
5072 | 5072 |
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" |
5073 | 5073 |
compiler_c_o=no |
5074 |
-if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then |
|
5074 |
+if { (eval echo configure:5079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then |
|
5075 | 5075 |
# The compiler can only warn and ignore the option if not recognized |
5076 | 5076 |
# So say no if there are warnings |
5077 | 5077 |
if test -s out/conftest.err; then |
... | ... |
@@ -6864,7 +6869,7 @@ else |
6864 | 6864 |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
6865 | 6865 |
lt_status=$lt_dlunknown |
6866 | 6866 |
cat > conftest.$ac_ext <<EOF |
6867 |
-#line 6867 "configure" |
|
6867 |
+#line 6872 "configure" |
|
6868 | 6868 |
#include "confdefs.h" |
6869 | 6869 |
|
6870 | 6870 |
#if HAVE_DLFCN_H |
... | ... |
@@ -6962,7 +6967,7 @@ else |
6962 | 6962 |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
6963 | 6963 |
lt_status=$lt_dlunknown |
6964 | 6964 |
cat > conftest.$ac_ext <<EOF |
6965 |
-#line 6965 "configure" |
|
6965 |
+#line 6970 "configure" |
|
6966 | 6966 |
#include "confdefs.h" |
6967 | 6967 |
|
6968 | 6968 |
#if HAVE_DLFCN_H |
... | ... |
@@ -7691,10 +7696,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
7691 | 7691 |
|
7692 | 7692 |
|
7693 | 7693 |
|
7694 |
+ |
|
7694 | 7695 |
cat >>confdefs.h <<\_ACEOF |
7695 | 7696 |
#define SCANBUFF 131072 |
7696 | 7697 |
_ACEOF |
7697 | 7698 |
|
7699 |
+ |
|
7698 | 7700 |
cat >>confdefs.h <<\_ACEOF |
7699 | 7701 |
#define FILEBUFF 8192 |
7700 | 7702 |
_ACEOF |
... | ... |
@@ -8426,7 +8433,8 @@ echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 |
8426 | 8426 |
|
8427 | 8427 |
fi |
8428 | 8428 |
if test $ac_cv_header_zlib_h = yes; then |
8429 |
- LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; cat >>confdefs.h <<\_ACEOF |
|
8429 |
+ LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; |
|
8430 |
+cat >>confdefs.h <<\_ACEOF |
|
8430 | 8431 |
#define HAVE_ZLIB_H 1 |
8431 | 8432 |
_ACEOF |
8432 | 8433 |
|
... | ... |
@@ -8547,7 +8555,8 @@ echo "${ECHO_T}$ac_cv_header_bzlib_h" >&6 |
8547 | 8547 |
|
8548 | 8548 |
fi |
8549 | 8549 |
if test $ac_cv_header_bzlib_h = yes; then |
8550 |
- LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; cat >>confdefs.h <<\_ACEOF |
|
8550 |
+ LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; |
|
8551 |
+cat >>confdefs.h <<\_ACEOF |
|
8551 | 8552 |
#define HAVE_BZLIB_H 1 |
8552 | 8553 |
_ACEOF |
8553 | 8554 |
|
... | ... |
@@ -8610,7 +8619,8 @@ fi |
8610 | 8610 |
echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_bzReadOpen" >&5 |
8611 | 8611 |
echo "${ECHO_T}$ac_cv_lib_bz2_bzReadOpen" >&6 |
8612 | 8612 |
if test $ac_cv_lib_bz2_bzReadOpen = yes; then |
8613 |
- cat >>confdefs.h <<\_ACEOF |
|
8613 |
+ |
|
8614 |
+cat >>confdefs.h <<\_ACEOF |
|
8614 | 8615 |
#define NOBZ2PREFIX 1 |
8615 | 8616 |
_ACEOF |
8616 | 8617 |
|
... | ... |
@@ -8620,7 +8630,8 @@ fi |
8620 | 8620 |
|
8621 | 8621 |
|
8622 | 8622 |
|
8623 |
-for ac_func in setsid memcpy |
|
8623 |
+ |
|
8624 |
+for ac_func in setsid memcpy snprintf |
|
8624 | 8625 |
do |
8625 | 8626 |
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` |
8626 | 8627 |
echo "$as_me:$LINENO: checking for $ac_func" >&5 |
... | ... |
@@ -8943,7 +8954,8 @@ fi |
8943 | 8943 |
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5 |
8944 | 8944 |
echo "${ECHO_T}$ac_cv_lib_gmp___gmpz_init" >&6 |
8945 | 8945 |
if test $ac_cv_lib_gmp___gmpz_init = yes; then |
8946 |
- LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; cat >>confdefs.h <<\_ACEOF |
|
8946 |
+ LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; |
|
8947 |
+cat >>confdefs.h <<\_ACEOF |
|
8947 | 8948 |
#define HAVE_GMP 1 |
8948 | 8949 |
_ACEOF |
8949 | 8950 |
|
... | ... |
@@ -9004,7 +9016,8 @@ fi |
9004 | 9004 |
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp_mpz_init" >&5 |
9005 | 9005 |
echo "${ECHO_T}$ac_cv_lib_gmp_mpz_init" >&6 |
9006 | 9006 |
if test $ac_cv_lib_gmp_mpz_init = yes; then |
9007 |
- LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; cat >>confdefs.h <<\_ACEOF |
|
9007 |
+ LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; |
|
9008 |
+cat >>confdefs.h <<\_ACEOF |
|
9008 | 9009 |
#define HAVE_GMP 1 |
9009 | 9010 |
_ACEOF |
9010 | 9011 |
|
... | ... |
@@ -9118,7 +9131,8 @@ echo "${ECHO_T}$ac_cv_header_syslog_h" >&6 |
9118 | 9118 |
|
9119 | 9119 |
fi |
9120 | 9120 |
if test $ac_cv_header_syslog_h = yes; then |
9121 |
- cat >>confdefs.h <<\_ACEOF |
|
9121 |
+ |
|
9122 |
+cat >>confdefs.h <<\_ACEOF |
|
9122 | 9123 |
#define CLAMD_USE_SYSLOG 1 |
9123 | 9124 |
_ACEOF |
9124 | 9125 |
|
... | ... |
@@ -9172,10 +9186,12 @@ else |
9172 | 9172 |
clamav_group="clamav" |
9173 | 9173 |
fi; |
9174 | 9174 |
|
9175 |
+ |
|
9175 | 9176 |
cat >>confdefs.h <<_ACEOF |
9176 | 9177 |
#define CLAMAVUSER "$clamav_user" |
9177 | 9178 |
_ACEOF |
9178 | 9179 |
|
9180 |
+ |
|
9179 | 9181 |
cat >>confdefs.h <<_ACEOF |
9180 | 9182 |
#define CLAMAVGROUP "$clamav_group" |
9181 | 9183 |
_ACEOF |
... | ... |
@@ -9198,7 +9214,8 @@ fi; |
9198 | 9198 |
# Check whether --enable-debug or --disable-debug was given. |
9199 | 9199 |
if test "${enable_debug+set}" = set; then |
9200 | 9200 |
enableval="$enable_debug" |
9201 |
- cat >>confdefs.h <<\_ACEOF |
|
9201 |
+ |
|
9202 |
+cat >>confdefs.h <<\_ACEOF |
|
9202 | 9203 |
#define CL_DEBUG 1 |
9203 | 9204 |
_ACEOF |
9204 | 9205 |
|
... | ... |
@@ -9207,7 +9224,8 @@ fi; |
9207 | 9207 |
# Check whether --enable-bigstack or --disable-bigstack was given. |
9208 | 9208 |
if test "${enable_bigstack+set}" = set; then |
9209 | 9209 |
enableval="$enable_bigstack" |
9210 |
- cat >>confdefs.h <<\_ACEOF |
|
9210 |
+ |
|
9211 |
+cat >>confdefs.h <<\_ACEOF |
|
9211 | 9212 |
#define C_BIGSTACK 1 |
9212 | 9213 |
_ACEOF |
9213 | 9214 |
|
... | ... |
@@ -9226,12 +9244,14 @@ fi; |
9226 | 9226 |
# Check whether --with-db1 or --without-db1 was given. |
9227 | 9227 |
if test "${with_db1+set}" = set; then |
9228 | 9228 |
withval="$with_db1" |
9229 |
- cat >>confdefs.h <<_ACEOF |
|
9229 |
+ |
|
9230 |
+cat >>confdefs.h <<_ACEOF |
|
9230 | 9231 |
#define DB1NAME "$withval" |
9231 | 9232 |
_ACEOF |
9232 | 9233 |
|
9233 | 9234 |
else |
9234 |
- cat >>confdefs.h <<\_ACEOF |
|
9235 |
+ |
|
9236 |
+cat >>confdefs.h <<\_ACEOF |
|
9235 | 9237 |
#define DB1NAME "main.cvd" |
9236 | 9238 |
_ACEOF |
9237 | 9239 |
|
... | ... |
@@ -9241,12 +9261,14 @@ fi; |
9241 | 9241 |
# Check whether --with-db2 or --without-db2 was given. |
9242 | 9242 |
if test "${with_db2+set}" = set; then |
9243 | 9243 |
withval="$with_db2" |
9244 |
- cat >>confdefs.h <<_ACEOF |
|
9244 |
+ |
|
9245 |
+cat >>confdefs.h <<_ACEOF |
|
9245 | 9246 |
#define DB2NAME "$withval" |
9246 | 9247 |
_ACEOF |
9247 | 9248 |
|
9248 | 9249 |
else |
9249 |
- cat >>confdefs.h <<\_ACEOF |
|
9250 |
+ |
|
9251 |
+cat >>confdefs.h <<\_ACEOF |
|
9250 | 9252 |
#define DB2NAME "daily.cvd" |
9251 | 9253 |
_ACEOF |
9252 | 9254 |
|
... | ... |
@@ -9286,6 +9308,7 @@ fi |
9286 | 9286 |
|
9287 | 9287 |
CFGDIR=$cfg_dir |
9288 | 9288 |
|
9289 |
+ |
|
9289 | 9290 |
cat >>confdefs.h <<_ACEOF |
9290 | 9291 |
#define CONFDIR "$cfg_dir" |
9291 | 9292 |
_ACEOF |
... | ... |
@@ -9317,7 +9340,8 @@ then |
9317 | 9317 |
if test -r /dev/urandom ; then |
9318 | 9318 |
echo "$as_me:$LINENO: result: /dev/(u)random detected." >&5 |
9319 | 9319 |
echo "${ECHO_T}/dev/(u)random detected." >&6 |
9320 |
- cat >>confdefs.h <<\_ACEOF |
|
9320 |
+ |
|
9321 |
+cat >>confdefs.h <<\_ACEOF |
|
9321 | 9322 |
#define C_URANDOM 1 |
9322 | 9323 |
_ACEOF |
9323 | 9324 |
|
... | ... |
@@ -9330,24 +9354,28 @@ fi |
9330 | 9330 |
|
9331 | 9331 |
case "$target_os" in |
9332 | 9332 |
linux*) |
9333 |
- cat >>confdefs.h <<\_ACEOF |
|
9333 |
+ |
|
9334 |
+cat >>confdefs.h <<\_ACEOF |
|
9334 | 9335 |
#define C_LINUX 1 |
9335 | 9336 |
_ACEOF |
9336 | 9337 |
|
9337 | 9338 |
if test "$have_pthreads" = "yes"; then |
9338 | 9339 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9339 | 9340 |
TH_SAFE="-thread-safe" |
9340 |
- cat >>confdefs.h <<\_ACEOF |
|
9341 |
+ |
|
9342 |
+cat >>confdefs.h <<\_ACEOF |
|
9341 | 9343 |
#define CL_THREAD_SAFE 1 |
9342 | 9344 |
_ACEOF |
9343 | 9345 |
|
9344 |
- cat >>confdefs.h <<\_ACEOF |
|
9346 |
+ |
|
9347 |
+cat >>confdefs.h <<\_ACEOF |
|
9345 | 9348 |
#define _REENTRANT 1 |
9346 | 9349 |
_ACEOF |
9347 | 9350 |
|
9348 | 9351 |
CLAMD_LIBS="-lpthread" |
9349 | 9352 |
if test "$want_clamuko" = "yes"; then |
9350 |
- cat >>confdefs.h <<\_ACEOF |
|
9353 |
+ |
|
9354 |
+cat >>confdefs.h <<\_ACEOF |
|
9351 | 9355 |
#define CLAMUKO 1 |
9352 | 9356 |
_ACEOF |
9353 | 9357 |
|
... | ... |
@@ -9356,7 +9384,8 @@ _ACEOF |
9356 | 9356 |
fi |
9357 | 9357 |
;; |
9358 | 9358 |
cygwin*) |
9359 |
- cat >>confdefs.h <<\_ACEOF |
|
9359 |
+ |
|
9360 |
+cat >>confdefs.h <<\_ACEOF |
|
9360 | 9361 |
#define C_CYGWIN 1 |
9361 | 9362 |
_ACEOF |
9362 | 9363 |
|
... | ... |
@@ -9368,11 +9397,13 @@ _ACEOF |
9368 | 9368 |
if test "$have_pthreads" = "yes"; then |
9369 | 9369 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9370 | 9370 |
TH_SAFE="-thread-safe" |
9371 |
- cat >>confdefs.h <<\_ACEOF |
|
9371 |
+ |
|
9372 |
+cat >>confdefs.h <<\_ACEOF |
|
9372 | 9373 |
#define CL_THREAD_SAFE 1 |
9373 | 9374 |
_ACEOF |
9374 | 9375 |
|
9375 |
- cat >>confdefs.h <<\_ACEOF |
|
9376 |
+ |
|
9377 |
+cat >>confdefs.h <<\_ACEOF |
|
9376 | 9378 |
#define _REENTRANT 1 |
9377 | 9379 |
_ACEOF |
9378 | 9380 |
|
... | ... |
@@ -9384,16 +9415,19 @@ solaris*) |
9384 | 9384 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9385 | 9385 |
CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv" |
9386 | 9386 |
TH_SAFE="-thread-safe" |
9387 |
- cat >>confdefs.h <<\_ACEOF |
|
9387 |
+ |
|
9388 |
+cat >>confdefs.h <<\_ACEOF |
|
9388 | 9389 |
#define CL_THREAD_SAFE 1 |
9389 | 9390 |
_ACEOF |
9390 | 9391 |
|
9391 |
- cat >>confdefs.h <<\_ACEOF |
|
9392 |
+ |
|
9393 |
+cat >>confdefs.h <<\_ACEOF |
|
9392 | 9394 |
#define _REENTRANT 1 |
9393 | 9395 |
_ACEOF |
9394 | 9396 |
|
9395 | 9397 |
fi |
9396 |
- cat >>confdefs.h <<\_ACEOF |
|
9398 |
+ |
|
9399 |
+cat >>confdefs.h <<\_ACEOF |
|
9397 | 9400 |
#define C_SOLARIS 1 |
9398 | 9401 |
_ACEOF |
9399 | 9402 |
|
... | ... |
@@ -9403,16 +9437,19 @@ freebsd*) |
9403 | 9403 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r" |
9404 | 9404 |
CLAMD_LIBS="-pthread -lc_r" |
9405 | 9405 |
TH_SAFE="-thread-safe" |
9406 |
- cat >>confdefs.h <<\_ACEOF |
|
9406 |
+ |
|
9407 |
+cat >>confdefs.h <<\_ACEOF |
|
9407 | 9408 |
#define CL_THREAD_SAFE 1 |
9408 | 9409 |
_ACEOF |
9409 | 9410 |
|
9410 |
- cat >>confdefs.h <<\_ACEOF |
|
9411 |
+ |
|
9412 |
+cat >>confdefs.h <<\_ACEOF |
|
9411 | 9413 |
#define _REENTRANT 1 |
9412 | 9414 |
_ACEOF |
9413 | 9415 |
|
9414 | 9416 |
fi |
9415 |
- cat >>confdefs.h <<\_ACEOF |
|
9417 |
+ |
|
9418 |
+cat >>confdefs.h <<\_ACEOF |
|
9416 | 9419 |
#define C_BSD 1 |
9417 | 9420 |
_ACEOF |
9418 | 9421 |
|
... | ... |
@@ -9447,16 +9484,19 @@ openbsd*) |
9447 | 9447 |
CLAMD_LIBS="-pthread -lc_r" |
9448 | 9448 |
fi |
9449 | 9449 |
TH_SAFE="-thread-safe" |
9450 |
- cat >>confdefs.h <<\_ACEOF |
|
9450 |
+ |
|
9451 |
+cat >>confdefs.h <<\_ACEOF |
|
9451 | 9452 |
#define CL_THREAD_SAFE 1 |
9452 | 9453 |
_ACEOF |
9453 | 9454 |
|
9454 |
- cat >>confdefs.h <<\_ACEOF |
|
9455 |
+ |
|
9456 |
+cat >>confdefs.h <<\_ACEOF |
|
9455 | 9457 |
#define _REENTRANT 1 |
9456 | 9458 |
_ACEOF |
9457 | 9459 |
|
9458 | 9460 |
fi |
9459 |
- cat >>confdefs.h <<\_ACEOF |
|
9461 |
+ |
|
9462 |
+cat >>confdefs.h <<\_ACEOF |
|
9460 | 9463 |
#define C_BSD 1 |
9461 | 9464 |
_ACEOF |
9462 | 9465 |
|
... | ... |
@@ -9465,7 +9505,8 @@ netbsd*) |
9465 | 9465 |
echo "$as_me:$LINENO: result: NetBSD detected. Disabling thread support." >&5 |
9466 | 9466 |
echo "${ECHO_T}NetBSD detected. Disabling thread support." >&6 |
9467 | 9467 |
have_pthreads="no" |
9468 |
- cat >>confdefs.h <<\_ACEOF |
|
9468 |
+ |
|
9469 |
+cat >>confdefs.h <<\_ACEOF |
|
9469 | 9470 |
#define C_BSD 1 |
9470 | 9471 |
_ACEOF |
9471 | 9472 |
|
... | ... |
@@ -9474,7 +9515,8 @@ bsd*) |
9474 | 9474 |
echo "$as_me:$LINENO: result: Unknown BSD detected. Disabling thread support." >&5 |
9475 | 9475 |
echo "${ECHO_T}Unknown BSD detected. Disabling thread support." >&6 |
9476 | 9476 |
have_pthreads="no" |
9477 |
- cat >>confdefs.h <<\_ACEOF |
|
9477 |
+ |
|
9478 |
+cat >>confdefs.h <<\_ACEOF |
|
9478 | 9479 |
#define C_BSD 1 |
9479 | 9480 |
_ACEOF |
9480 | 9481 |
|
... | ... |
@@ -9483,17 +9525,20 @@ beos*) |
9483 | 9483 |
echo "$as_me:$LINENO: result: BeOS detected. Disabling thread support." >&5 |
9484 | 9484 |
echo "${ECHO_T}BeOS detected. Disabling thread support." >&6 |
9485 | 9485 |
have_pthreads="no" |
9486 |
- cat >>confdefs.h <<\_ACEOF |
|
9486 |
+ |
|
9487 |
+cat >>confdefs.h <<\_ACEOF |
|
9487 | 9488 |
#define C_BEOS 1 |
9488 | 9489 |
_ACEOF |
9489 | 9490 |
|
9490 | 9491 |
;; |
9491 | 9492 |
darwin*) |
9492 |
- cat >>confdefs.h <<\_ACEOF |
|
9493 |
+ |
|
9494 |
+cat >>confdefs.h <<\_ACEOF |
|
9493 | 9495 |
#define C_BSD 1 |
9494 | 9496 |
_ACEOF |
9495 | 9497 |
|
9496 |
- cat >>confdefs.h <<\_ACEOF |
|
9498 |
+ |
|
9499 |
+cat >>confdefs.h <<\_ACEOF |
|
9497 | 9500 |
#define C_DARWIN 1 |
9498 | 9501 |
_ACEOF |
9499 | 9502 |
|
... | ... |
@@ -9502,26 +9547,25 @@ _ACEOF |
9502 | 9502 |
sco*) |
9503 | 9503 |
FRESHCLAM_LIBS="-lsocket" |
9504 | 9504 |
CLAMD_LIBS="-lsocket" |
9505 |
- cat >>confdefs.h <<\_ACEOF |
|
9506 |
-#define NO_SNPRINTF 1 |
|
9507 |
-_ACEOF |
|
9508 |
- |
|
9509 |
- ;; |
|
9505 |
+ ;; |
|
9510 | 9506 |
hpux*) |
9511 | 9507 |
if test "$have_pthreads" = "yes"; then |
9512 | 9508 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9513 | 9509 |
CLAMD_LIBS="-lpthread" |
9514 | 9510 |
TH_SAFE="-thread-safe" |
9515 |
- cat >>confdefs.h <<\_ACEOF |
|
9511 |
+ |
|
9512 |
+cat >>confdefs.h <<\_ACEOF |
|
9516 | 9513 |
#define CL_THREAD_SAFE 1 |
9517 | 9514 |
_ACEOF |
9518 | 9515 |
|
9519 |
- cat >>confdefs.h <<\_ACEOF |
|
9516 |
+ |
|
9517 |
+cat >>confdefs.h <<\_ACEOF |
|
9520 | 9518 |
#define _REENTRANT 1 |
9521 | 9519 |
_ACEOF |
9522 | 9520 |
|
9523 | 9521 |
fi |
9524 |
- cat >>confdefs.h <<\_ACEOF |
|
9522 |
+ |
|
9523 |
+cat >>confdefs.h <<\_ACEOF |
|
9525 | 9524 |
#define C_HPUX 1 |
9526 | 9525 |
_ACEOF |
9527 | 9526 |
|
... | ... |
@@ -9531,16 +9575,19 @@ aix*) |
9531 | 9531 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9532 | 9532 |
CLAMD_LIBS="-lpthread" |
9533 | 9533 |
TH_SAFE="-thread-safe" |
9534 |
- cat >>confdefs.h <<\_ACEOF |
|
9534 |
+ |
|
9535 |
+cat >>confdefs.h <<\_ACEOF |
|
9535 | 9536 |
#define CL_THREAD_SAFE 1 |
9536 | 9537 |
_ACEOF |
9537 | 9538 |
|
9538 |
- cat >>confdefs.h <<\_ACEOF |
|
9539 |
+ |
|
9540 |
+cat >>confdefs.h <<\_ACEOF |
|
9539 | 9541 |
#define _REENTRANT 1 |
9540 | 9542 |
_ACEOF |
9541 | 9543 |
|
9542 | 9544 |
fi |
9543 |
- cat >>confdefs.h <<\_ACEOF |
|
9545 |
+ |
|
9546 |
+cat >>confdefs.h <<\_ACEOF |
|
9544 | 9547 |
#define C_AIX 1 |
9545 | 9548 |
_ACEOF |
9546 | 9549 |
|
... | ... |
@@ -9550,24 +9597,23 @@ irix*) |
9550 | 9550 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
9551 | 9551 |
CLAMD_LIBS="-lpthread" |
9552 | 9552 |
TH_SAFE="-thread-safe" |
9553 |
- cat >>confdefs.h <<\_ACEOF |
|
9553 |
+ |
|
9554 |
+cat >>confdefs.h <<\_ACEOF |
|
9554 | 9555 |
#define CL_THREAD_SAFE 1 |
9555 | 9556 |
_ACEOF |
9556 | 9557 |
|
9557 |
- cat >>confdefs.h <<\_ACEOF |
|
9558 |
+ |
|
9559 |
+cat >>confdefs.h <<\_ACEOF |
|
9558 | 9560 |
#define _REENTRANT 1 |
9559 | 9561 |
_ACEOF |
9560 | 9562 |
|
9561 | 9563 |
fi |
9562 |
- cat >>confdefs.h <<\_ACEOF |
|
9563 |
-#define C_IRIX 1 |
|
9564 |
-_ACEOF |
|
9565 | 9564 |
|
9566 |
- cat >>confdefs.h <<\_ACEOF |
|
9567 |
-#define NO_SNPRINTF 1 |
|
9565 |
+cat >>confdefs.h <<\_ACEOF |
|
9566 |
+#define C_IRIX 1 |
|
9568 | 9567 |
_ACEOF |
9569 | 9568 |
|
9570 |
- ;; |
|
9569 |
+ ;; |
|
9571 | 9570 |
|
9572 | 9571 |
*) |
9573 | 9572 |
;; |
... | ... |
@@ -9601,7 +9647,8 @@ fi |
9601 | 9601 |
|
9602 | 9602 |
if test "$have_pthreads" = "yes" |
9603 | 9603 |
then |
9604 |
- cat >>confdefs.h <<\_ACEOF |
|
9604 |
+ |
|
9605 |
+cat >>confdefs.h <<\_ACEOF |
|
9605 | 9606 |
#define BUILD_CLAMD 1 |
9606 | 9607 |
_ACEOF |
9607 | 9608 |
|
... | ... |
@@ -10133,13 +10180,15 @@ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} |
10133 | 10133 |
esac |
10134 | 10134 |
|
10135 | 10135 |
if test $ac_cv_c_bigendian = yes; then |
10136 |
- cat >>confdefs.h <<\_ACEOF |
|
10136 |
+ |
|
10137 |
+cat >>confdefs.h <<\_ACEOF |
|
10137 | 10138 |
#define WORDS_BIGENDIAN 1 |
10138 | 10139 |
_ACEOF |
10139 | 10140 |
|
10140 | 10141 |
else |
10141 |
- cat >>confdefs.h <<\_ACEOF |
|
10142 |
-#define WORDS_LITTLEENDIAN 1 |
|
10142 |
+ |
|
10143 |
+cat >>confdefs.h <<\_ACEOF |
|
10144 |
+#define WORDS_BIGENDIAN 0 |
|
10143 | 10145 |
_ACEOF |
10144 | 10146 |
|
10145 | 10147 |
fi |
... | ... |
@@ -10239,7 +10288,8 @@ fi |
10239 | 10239 |
|
10240 | 10240 |
echo "$as_me:$LINENO: result: $have_pragma_pack" >&5 |
10241 | 10241 |
echo "${ECHO_T}$have_pragma_pack" >&6 |
10242 |
- cat >>confdefs.h <<\_ACEOF |
|
10242 |
+ |
|
10243 |
+cat >>confdefs.h <<\_ACEOF |
|
10243 | 10244 |
#define HAVE_PRAGMA_PACK 1 |
10244 | 10245 |
_ACEOF |
10245 | 10246 |
|
... | ... |
@@ -10251,7 +10301,8 @@ echo "$as_me: error: Need to know how to pack structures with this compiler" >&2 |
10251 | 10251 |
{ (exit 1); exit 1; }; } |
10252 | 10252 |
fi |
10253 | 10253 |
if test "$have_attrib_packed" = yes; then |
10254 |
- cat >>confdefs.h <<\_ACEOF |
|
10254 |
+ |
|
10255 |
+cat >>confdefs.h <<\_ACEOF |
|
10255 | 10256 |
#define HAVE_ATTRIB_PACKED 1 |
10256 | 10257 |
_ACEOF |
10257 | 10258 |
|
... | ... |
@@ -10332,38 +10383,7 @@ s/^[^=]*=[ ]*$//; |
10332 | 10332 |
}' |
10333 | 10333 |
fi |
10334 | 10334 |
|
10335 |
-# Transform confdefs.h into DEFS. |
|
10336 |
-# Protect against shell expansion while executing Makefile rules. |
|
10337 |
-# Protect against Makefile macro expansion. |
|
10338 |
-# |
|
10339 |
-# If the first sed substitution is executed (which looks for macros that |
|
10340 |
-# take arguments), then we branch to the quote section. Otherwise, |
|
10341 |
-# look for a macro that doesn't take arguments. |
|
10342 |
-cat >confdef2opt.sed <<\_ACEOF |
|
10343 |
-t clear |
|
10344 |
-: clear |
|
10345 |
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g |
|
10346 |
-t quote |
|
10347 |
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g |
|
10348 |
-t quote |
|
10349 |
-d |
|
10350 |
-: quote |
|
10351 |
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g |
|
10352 |
-s,\[,\\&,g |
|
10353 |
-s,\],\\&,g |
|
10354 |
-s,\$,$$,g |
|
10355 |
-p |
|
10356 |
-_ACEOF |
|
10357 |
-# We use echo to avoid assuming a particular line-breaking character. |
|
10358 |
-# The extra dot is to prevent the shell from consuming trailing |
|
10359 |
-# line-breaks from the sub-command output. A line-break within |
|
10360 |
-# single-quotes doesn't work because, if this script is created in a |
|
10361 |
-# platform that uses two characters for line-breaks (e.g., DOS), tr |
|
10362 |
-# would break. |
|
10363 |
-ac_LF_and_DOT=`echo; echo .` |
|
10364 |
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` |
|
10365 |
-rm -f confdef2opt.sed |
|
10366 |
- |
|
10335 |
+DEFS=-DHAVE_CONFIG_H |
|
10367 | 10336 |
|
10368 | 10337 |
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then |
10369 | 10338 |
{ { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. |
... | ... |
@@ -10694,10 +10714,15 @@ Usage: $0 [OPTIONS] [FILE]... |
10694 | 10694 |
--recheck update $as_me by reconfiguring in the same conditions |
10695 | 10695 |
--file=FILE[:TEMPLATE] |
10696 | 10696 |
instantiate the configuration file FILE |
10697 |
+ --header=FILE[:TEMPLATE] |
|
10698 |
+ instantiate the configuration header FILE |
|
10697 | 10699 |
|
10698 | 10700 |
Configuration files: |
10699 | 10701 |
$config_files |
10700 | 10702 |
|
10703 |
+Configuration headers: |
|
10704 |
+$config_headers |
|
10705 |
+ |
|
10701 | 10706 |
Configuration commands: |
10702 | 10707 |
$config_commands |
10703 | 10708 |
|
... | ... |
@@ -10812,6 +10837,7 @@ do |
10812 | 10812 |
"etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; |
10813 | 10813 |
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; |
10814 | 10814 |
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; |
10815 |
+ "clamav-config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS clamav-config.h" ;; |
|
10815 | 10816 |
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 |
10816 | 10817 |
echo "$as_me: error: invalid argument: $ac_config_target" >&2;} |
10817 | 10818 |
{ (exit 1); exit 1; }; };; |
... | ... |
@@ -10824,6 +10850,7 @@ done |
10824 | 10824 |
# bizarre bug on SunOS 4.1.3. |
10825 | 10825 |
if $ac_need_defaults; then |
10826 | 10826 |
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files |
10827 |
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers |
|
10827 | 10828 |
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands |
10828 | 10829 |
fi |
10829 | 10830 |
|
... | ... |
@@ -11164,6 +11191,229 @@ _ACEOF |
11164 | 11164 |
cat >>$CONFIG_STATUS <<\_ACEOF |
11165 | 11165 |
|
11166 | 11166 |
# |
11167 |
+# CONFIG_HEADER section. |
|
11168 |
+# |
|
11169 |
+ |
|
11170 |
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where |
|
11171 |
+# NAME is the cpp macro being defined and VALUE is the value it is being given. |
|
11172 |
+# |
|
11173 |
+# ac_d sets the value in "#define NAME VALUE" lines. |
|
11174 |
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' |
|
11175 |
+ac_dB='[ ].*$,\1#\2' |
|
11176 |
+ac_dC=' ' |
|
11177 |
+ac_dD=',;t' |
|
11178 |
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". |
|
11179 |
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' |
|
11180 |
+ac_uB='$,\1#\2define\3' |
|
11181 |
+ac_uC=' ' |
|
11182 |
+ac_uD=',;t' |
|
11183 |
+ |
|
11184 |
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue |
|
11185 |
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". |
|
11186 |
+ case $ac_file in |
|
11187 |
+ - | *:- | *:-:* ) # input from stdin |
|
11188 |
+ cat >$tmp/stdin |
|
11189 |
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` |
|
11190 |
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; |
|
11191 |
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` |
|
11192 |
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; |
|
11193 |
+ * ) ac_file_in=$ac_file.in ;; |
|
11194 |
+ esac |
|
11195 |
+ |
|
11196 |
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 |
|
11197 |
+echo "$as_me: creating $ac_file" >&6;} |
|
11198 |
+ |
|
11199 |
+ # First look for the input files in the build tree, otherwise in the |
|
11200 |
+ # src tree. |
|
11201 |
+ ac_file_inputs=`IFS=: |
|
11202 |
+ for f in $ac_file_in; do |
|
11203 |
+ case $f in |
|
11204 |
+ -) echo $tmp/stdin ;; |
|
11205 |
+ [\\/$]*) |
|
11206 |
+ # Absolute (can't be DOS-style, as IFS=:) |
|
11207 |
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 |
|
11208 |
+echo "$as_me: error: cannot find input file: $f" >&2;} |
|
11209 |
+ { (exit 1); exit 1; }; } |
|
11210 |
+ echo $f;; |
|
11211 |
+ *) # Relative |
|
11212 |
+ if test -f "$f"; then |
|
11213 |
+ # Build tree |
|
11214 |
+ echo $f |
|
11215 |
+ elif test -f "$srcdir/$f"; then |
|
11216 |
+ # Source tree |
|
11217 |
+ echo $srcdir/$f |
|
11218 |
+ else |
|
11219 |
+ # /dev/null tree |
|
11220 |
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 |
|
11221 |
+echo "$as_me: error: cannot find input file: $f" >&2;} |
|
11222 |
+ { (exit 1); exit 1; }; } |
|
11223 |
+ fi;; |
|
11224 |
+ esac |
|
11225 |
+ done` || { (exit 1); exit 1; } |
|
11226 |
+ # Remove the trailing spaces. |
|
11227 |
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in |
|
11228 |
+ |
|
11229 |
+_ACEOF |
|
11230 |
+ |
|
11231 |
+# Transform confdefs.h into two sed scripts, `conftest.defines' and |
|
11232 |
+# `conftest.undefs', that substitutes the proper values into |
|
11233 |
+# config.h.in to produce config.h. The first handles `#define' |
|
11234 |
+# templates, and the second `#undef' templates. |
|
11235 |
+# And first: Protect against being on the right side of a sed subst in |
|
11236 |
+# config.status. Protect against being in an unquoted here document |
|
11237 |
+# in config.status. |
|
11238 |
+rm -f conftest.defines conftest.undefs |
|
11239 |
+# Using a here document instead of a string reduces the quoting nightmare. |
|
11240 |
+# Putting comments in sed scripts is not portable. |
|
11241 |
+# |
|
11242 |
+# `end' is used to avoid that the second main sed command (meant for |
|
11243 |
+# 0-ary CPP macros) applies to n-ary macro definitions. |
|
11244 |
+# See the Autoconf documentation for `clear'. |
|
11245 |
+cat >confdef2sed.sed <<\_ACEOF |
|
11246 |
+s/[\\&,]/\\&/g |
|
11247 |
+s,[\\$`],\\&,g |
|
11248 |
+t clear |
|
11249 |
+: clear |
|
11250 |
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp |
|
11251 |
+t end |
|
11252 |
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp |
|
11253 |
+: end |
|
11254 |
+_ACEOF |
|
11255 |
+# If some macros were called several times there might be several times |
|
11256 |
+# the same #defines, which is useless. Nevertheless, we may not want to |
|
11257 |
+# sort them, since we want the *last* AC-DEFINE to be honored. |
|
11258 |
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines |
|
11259 |
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs |
|
11260 |
+rm -f confdef2sed.sed |
|
11261 |
+ |
|
11262 |
+# This sed command replaces #undef with comments. This is necessary, for |
|
11263 |
+# example, in the case of _POSIX_SOURCE, which is predefined and required |
|
11264 |
+# on some systems where configure will not decide to define it. |
|
11265 |
+cat >>conftest.undefs <<\_ACEOF |
|
11266 |
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, |
|
11267 |
+_ACEOF |
|
11268 |
+ |
|
11269 |
+# Break up conftest.defines because some shells have a limit on the size |
|
11270 |
+# of here documents, and old seds have small limits too (100 cmds). |
|
11271 |
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS |
|
11272 |
+echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS |
|
11273 |
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS |
|
11274 |
+echo ' :' >>$CONFIG_STATUS |
|
11275 |
+rm -f conftest.tail |
|
11276 |
+while grep . conftest.defines >/dev/null |
|
11277 |
+do |
|
11278 |
+ # Write a limited-size here document to $tmp/defines.sed. |
|
11279 |
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS |
|
11280 |
+ # Speed up: don't consider the non `#define' lines. |
|
11281 |
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS |
|
11282 |
+ # Work around the forget-to-reset-the-flag bug. |
|
11283 |
+ echo 't clr' >>$CONFIG_STATUS |
|
11284 |
+ echo ': clr' >>$CONFIG_STATUS |
|
11285 |
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS |
|
11286 |
+ echo 'CEOF |
|
11287 |
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out |
|
11288 |
+ rm -f $tmp/in |
|
11289 |
+ mv $tmp/out $tmp/in |
|
11290 |
+' >>$CONFIG_STATUS |
|
11291 |
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail |
|
11292 |
+ rm -f conftest.defines |
|
11293 |
+ mv conftest.tail conftest.defines |
|
11294 |
+done |
|
11295 |
+rm -f conftest.defines |
|
11296 |
+echo ' fi # egrep' >>$CONFIG_STATUS |
|
11297 |
+echo >>$CONFIG_STATUS |
|
11298 |
+ |
|
11299 |
+# Break up conftest.undefs because some shells have a limit on the size |
|
11300 |
+# of here documents, and old seds have small limits too (100 cmds). |
|
11301 |
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS |
|
11302 |
+rm -f conftest.tail |
|
11303 |
+while grep . conftest.undefs >/dev/null |
|
11304 |
+do |
|
11305 |
+ # Write a limited-size here document to $tmp/undefs.sed. |
|
11306 |
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS |
|
11307 |
+ # Speed up: don't consider the non `#undef' |
|
11308 |
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS |
|
11309 |
+ # Work around the forget-to-reset-the-flag bug. |
|
11310 |
+ echo 't clr' >>$CONFIG_STATUS |
|
11311 |
+ echo ': clr' >>$CONFIG_STATUS |
|
11312 |
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS |
|
11313 |
+ echo 'CEOF |
|
11314 |
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out |
|
11315 |
+ rm -f $tmp/in |
|
11316 |
+ mv $tmp/out $tmp/in |
|
11317 |
+' >>$CONFIG_STATUS |
|
11318 |
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail |
|
11319 |
+ rm -f conftest.undefs |
|
11320 |
+ mv conftest.tail conftest.undefs |
|
11321 |
+done |
|
11322 |
+rm -f conftest.undefs |
|
11323 |
+ |
|
11324 |
+cat >>$CONFIG_STATUS <<\_ACEOF |
|
11325 |
+ # Let's still pretend it is `configure' which instantiates (i.e., don't |
|
11326 |
+ # use $as_me), people would be surprised to read: |
|
11327 |
+ # /* config.h. Generated by config.status. */ |
|
11328 |
+ if test x"$ac_file" = x-; then |
|
11329 |
+ echo "/* Generated by configure. */" >$tmp/config.h |
|
11330 |
+ else |
|
11331 |
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h |
|
11332 |
+ fi |
|
11333 |
+ cat $tmp/in >>$tmp/config.h |
|
11334 |
+ rm -f $tmp/in |
|
11335 |
+ if test x"$ac_file" != x-; then |
|
11336 |
+ if cmp -s $ac_file $tmp/config.h 2>/dev/null; then |
|
11337 |
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 |
|
11338 |
+echo "$as_me: $ac_file is unchanged" >&6;} |
|
11339 |
+ else |
|
11340 |
+ ac_dir=`(dirname "$ac_file") 2>/dev/null || |
|
11341 |
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ |
|
11342 |
+ X"$ac_file" : 'X\(//\)[^/]' \| \ |
|
11343 |
+ X"$ac_file" : 'X\(//\)$' \| \ |
|
11344 |
+ X"$ac_file" : 'X\(/\)' \| \ |
|
11345 |
+ . : '\(.\)' 2>/dev/null || |
|
11346 |
+echo X"$ac_file" | |
|
11347 |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } |
|
11348 |
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } |
|
11349 |
+ /^X\(\/\/\)$/{ s//\1/; q; } |
|
11350 |
+ /^X\(\/\).*/{ s//\1/; q; } |
|
11351 |
+ s/.*/./; q'` |
|
11352 |
+ { case "$ac_dir" in |
|
11353 |
+ [\\/]* | ?:[\\/]* ) as_incr_dir=;; |
|
11354 |
+ *) as_incr_dir=.;; |
|
11355 |
+esac |
|
11356 |
+as_dummy="$ac_dir" |
|
11357 |
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do |
|
11358 |
+ case $as_mkdir_dir in |
|
11359 |
+ # Skip DOS drivespec |
|
11360 |
+ ?:) as_incr_dir=$as_mkdir_dir ;; |
|
11361 |
+ *) |
|
11362 |
+ as_incr_dir=$as_incr_dir/$as_mkdir_dir |
|
11363 |
+ test -d "$as_incr_dir" || |
|
11364 |
+ mkdir "$as_incr_dir" || |
|
11365 |
+ { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 |
|
11366 |
+echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} |
|
11367 |
+ { (exit 1); exit 1; }; } |
|
11368 |
+ ;; |
|
11369 |
+ esac |
|
11370 |
+done; } |
|
11371 |
+ |
|
11372 |
+ rm -f $ac_file |
|
11373 |
+ mv $tmp/config.h $ac_file |
|
11374 |
+ fi |
|
11375 |
+ else |
|
11376 |
+ cat $tmp/config.h |
|
11377 |
+ rm -f $tmp/config.h |
|
11378 |
+ fi |
|
11379 |
+ # Run the commands associated with the file. |
|
11380 |
+ case $ac_file in |
|
11381 |
+ clamav-config.h ) # update the timestamp |
|
11382 |
+echo 'timestamp for clamav-config.h' >"./stamp-h1" |
|
11383 |
+ ;; |
|
11384 |
+ esac |
|
11385 |
+done |
|
11386 |
+_ACEOF |
|
11387 |
+cat >>$CONFIG_STATUS <<\_ACEOF |
|
11388 |
+ |
|
11389 |
+# |
|
11167 | 11390 |
# CONFIG_COMMANDS section. |
11168 | 11391 |
# |
11169 | 11392 |
for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue |
... | ... |
@@ -17,10 +17,10 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
|
18 | 18 |
AC_INIT(clamscan/clamscan.c) |
19 | 19 |
AC_CREATE_TARGET_H(target.h) |
20 |
-AC_CANONICAL_SYSTEM |
|
21 |
- |
|
22 | 20 |
AM_INIT_AUTOMAKE(clamav, "devel-`date +%Y%m%d`") |
23 | 21 |
dnl AM_INIT_AUTOMAKE(clamav, `date +%Y%m%d`) |
22 |
+AM_CONFIG_HEADER(clamav-config.h) |
|
23 |
+ |
|
24 | 24 |
LC_CURRENT=1 |
25 | 25 |
LC_REVISION=3 |
26 | 26 |
LC_AGE=0 |
... | ... |
@@ -48,8 +48,8 @@ dnl AC_SUBST(LT_AGE) |
48 | 48 |
|
49 | 49 |
dnl BUFFSIZE must be at least 16 kb !!! |
50 | 50 |
|
51 |
-AC_DEFINE(SCANBUFF, 131072) |
|
52 |
-AC_DEFINE(FILEBUFF, 8192) |
|
51 |
+AC_DEFINE(SCANBUFF, 131072, [scan buffer size]) |
|
52 |
+AC_DEFINE(FILEBUFF, 8192, [file i/o buffer size]) |
|
53 | 53 |
|
54 | 54 |
AC_HEADER_STDC |
55 | 55 |
AC_CHECK_HEADERS(stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h) |
... | ... |
@@ -61,7 +61,7 @@ AC_COMPILE_CHECK_SIZEOF(long) |
61 | 61 |
have_pthreads=no |
62 | 62 |
AC_CHECK_HEADER(pthread.h,[have_pthreads=yes],) |
63 | 63 |
|
64 |
-AC_CHECK_HEADER(zlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; AC_DEFINE(HAVE_ZLIB_H)],[echo "Please install zlib and zlib-devel packages."; exit 1]) |
|
64 |
+AC_CHECK_HEADER(zlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; AC_DEFINE(HAVE_ZLIB_H,1,zlib installed)],[echo "Please install zlib and zlib-devel packages."; exit 1]) |
|
65 | 65 |
|
66 | 66 |
want_bzip2="yes" |
67 | 67 |
AC_ARG_ENABLE(bzip2, |
... | ... |
@@ -70,11 +70,11 @@ want_bzip2="no",) |
70 | 70 |
|
71 | 71 |
if test "$want_bzip2" = "yes" |
72 | 72 |
then |
73 |
- AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H)],) |
|
74 |
- AC_CHECK_LIB(bz2, bzReadOpen, AC_DEFINE(NOBZ2PREFIX),) |
|
73 |
+ AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H,1,have bzip2)],) |
|
74 |
+ AC_CHECK_LIB(bz2, bzReadOpen, AC_DEFINE(NOBZ2PREFIX,1,bzip funtions do not have bz2 prefix),) |
|
75 | 75 |
fi |
76 | 76 |
|
77 |
-AC_CHECK_FUNCS(setsid memcpy) |
|
77 |
+AC_CHECK_FUNCS(setsid memcpy snprintf) |
|
78 | 78 |
AC_FUNC_SETPGRP |
79 | 79 |
|
80 | 80 |
have_milter="no" |
... | ... |
@@ -91,10 +91,10 @@ want_dsig="no",) |
91 | 91 |
|
92 | 92 |
if test "$want_dsig" = "yes" |
93 | 93 |
then |
94 |
- AC_CHECK_LIB(gmp, __gmpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP)], [AC_CHECK_LIB(gmp, mpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP)], [echo "WARNING: GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !"; want_dsig="no"])]) |
|
94 |
+ AC_CHECK_LIB(gmp, __gmpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], [AC_CHECK_LIB(gmp, mpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], [echo "WARNING: GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !"; want_dsig="no"])]) |
|
95 | 95 |
fi |
96 | 96 |
|
97 |
-AC_CHECK_HEADER(syslog.h,AC_DEFINE(CLAMD_USE_SYSLOG),) |
|
97 |
+AC_CHECK_HEADER(syslog.h,AC_DEFINE(CLAMD_USE_SYSLOG,1,[use syslog]),) |
|
98 | 98 |
|
99 | 99 |
dnl AC_CHECK_LIB(c, strtok_r,, AC_DEFINE(NO_STRTOK_R)) |
100 | 100 |
dnl AC_CHECK_LIB(c, mkstemp, AC_DEFINE(HAVE_MKSTEMP),) |
... | ... |
@@ -126,8 +126,8 @@ AC_ARG_WITH(group, |
126 | 126 |
[ --with-group=gid name of the clamav group (default=clamav).], |
127 | 127 |
clamav_group="$withval", clamav_group="clamav") |
128 | 128 |
|
129 |
-AC_DEFINE_UNQUOTED(CLAMAVUSER,"$clamav_user",) |
|
130 |
-AC_DEFINE_UNQUOTED(CLAMAVGROUP,"$clamav_group",) |
|
129 |
+AC_DEFINE_UNQUOTED(CLAMAVUSER,"$clamav_user",[name of the clamav user]) |
|
130 |
+AC_DEFINE_UNQUOTED(CLAMAVGROUP,"$clamav_group",[name of the clamav group]) |
|
131 | 131 |
|
132 | 132 |
test_clamav=yes |
133 | 133 |
AC_ARG_ENABLE(clamav, |
... | ... |
@@ -141,11 +141,11 @@ want_clamuko=no,) |
141 | 141 |
|
142 | 142 |
AC_ARG_ENABLE(debug, |
143 | 143 |
[ --enable-debug Enable debug messages.], |
144 |
-AC_DEFINE(CL_DEBUG),) |
|
144 |
+AC_DEFINE(CL_DEBUG,1,[enable debugging]),) |
|
145 | 145 |
|
146 | 146 |
AC_ARG_ENABLE(bigstack, |
147 | 147 |
[ --enable-bigstack Increase thread stack size.], |
148 |
-AC_DEFINE(C_BIGSTACK),) |
|
148 |
+AC_DEFINE(C_BIGSTACK,1,[Increase thread stack size.]),) |
|
149 | 149 |
|
150 | 150 |
dnl database directory |
151 | 151 |
AC_ARG_WITH(dbdir, |
... | ... |
@@ -155,12 +155,12 @@ db_dir="$withval", db_dir="_default_") |
155 | 155 |
dnl main.cvd |
156 | 156 |
AC_ARG_WITH(db1, |
157 | 157 |
[ --with-db1=name Name of the main database (main.cvd).], |
158 |
-AC_DEFINE_UNQUOTED(DB1NAME,"$withval",), AC_DEFINE(DB1NAME, "main.cvd")) |
|
158 |
+AC_DEFINE_UNQUOTED(DB1NAME,"$withval",[Name of the main database]), AC_DEFINE(DB1NAME, "main.cvd",[Name of the main database])) |
|
159 | 159 |
|
160 | 160 |
dnl daily.cvd |
161 | 161 |
AC_ARG_WITH(db2, |
162 | 162 |
[ --with-db2=name Name of the daily database (daily.cvd).], |
163 |
-AC_DEFINE_UNQUOTED(DB2NAME,"$withval",), AC_DEFINE(DB2NAME, "daily.cvd")) |
|
163 |
+AC_DEFINE_UNQUOTED(DB2NAME,"$withval",[Name of the daily database]), AC_DEFINE(DB2NAME, "daily.cvd",[Name of the daily database])) |
|
164 | 164 |
|
165 | 165 |
dnl I had problems with $pkgdatadir, that's why I'm using these funny checks |
166 | 166 |
if test "$db_dir" = "_default_" |
... | ... |
@@ -193,7 +193,7 @@ fi |
193 | 193 |
|
194 | 194 |
CFGDIR=$cfg_dir |
195 | 195 |
AC_SUBST(CFGDIR) |
196 |
-AC_DEFINE_UNQUOTED(CONFDIR,"$cfg_dir",) |
|
196 |
+AC_DEFINE_UNQUOTED(CONFDIR,"$cfg_dir",[where to look for the config file]) |
|
197 | 197 |
|
198 | 198 |
dnl Do not overwrite the current config file |
199 | 199 |
AM_CONDITIONAL(INSTALL_CLAMAV_CONF, test ! -r "$cfg_dir/clamav.conf") |
... | ... |
@@ -203,7 +203,7 @@ if test "$test_urandom" = "yes" |
203 | 203 |
then |
204 | 204 |
if test -r /dev/urandom ; then |
205 | 205 |
AC_MSG_RESULT(/dev/(u)random detected.) |
206 |
- AC_DEFINE(C_URANDOM) |
|
206 |
+ AC_DEFINE(C_URANDOM,1,[use /dev/urandom]) |
|
207 | 207 |
else |
208 | 208 |
AC_MSG_RESULT(/dev/(u)random not detected - using weak software rand()) |
209 | 209 |
fi |
... | ... |
@@ -216,22 +216,22 @@ dnl TH_SAFE="" |
216 | 216 |
|
217 | 217 |
case "$target_os" in |
218 | 218 |
linux*) |
219 |
- AC_DEFINE(C_LINUX) |
|
219 |
+ AC_DEFINE(C_LINUX,1,[target is linux]) |
|
220 | 220 |
if test "$have_pthreads" = "yes"; then |
221 | 221 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
222 | 222 |
TH_SAFE="-thread-safe" |
223 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
224 |
- AC_DEFINE(_REENTRANT) |
|
223 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
224 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
225 | 225 |
CLAMD_LIBS="-lpthread" |
226 | 226 |
if test "$want_clamuko" = "yes"; then |
227 |
- AC_DEFINE(CLAMUKO) |
|
227 |
+ AC_DEFINE(CLAMUKO,1,[enable clamuko]) |
|
228 | 228 |
fi |
229 | 229 |
CLAMSCAN_LIBS="-lpthread" |
230 | 230 |
fi |
231 | 231 |
;; |
232 | 232 |
cygwin*) |
233 | 233 |
dnl It probably won't work. |
234 |
- AC_DEFINE(C_CYGWIN) |
|
234 |
+ AC_DEFINE(C_CYGWIN,1,[os is cygwin]) |
|
235 | 235 |
if test "$test_clamav" = "yes"; then |
236 | 236 |
if test ! -r /etc/passwd; then |
237 | 237 |
test_clamav="no" |
... | ... |
@@ -240,8 +240,8 @@ cygwin*) |
240 | 240 |
if test "$have_pthreads" = "yes"; then |
241 | 241 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
242 | 242 |
TH_SAFE="-thread-safe" |
243 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
244 |
- AC_DEFINE(_REENTRANT) |
|
243 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
244 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
245 | 245 |
fi |
246 | 246 |
;; |
247 | 247 |
solaris*) |
... | ... |
@@ -250,20 +250,20 @@ solaris*) |
250 | 250 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
251 | 251 |
CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv" |
252 | 252 |
TH_SAFE="-thread-safe" |
253 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
254 |
- AC_DEFINE(_REENTRANT) |
|
253 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
254 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
255 | 255 |
fi |
256 |
- AC_DEFINE(C_SOLARIS) |
|
256 |
+ AC_DEFINE(C_SOLARIS,1,[os is solaris]) |
|
257 | 257 |
;; |
258 | 258 |
freebsd*) |
259 | 259 |
if test "$have_pthreads" = "yes"; then |
260 | 260 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r" |
261 | 261 |
CLAMD_LIBS="-pthread -lc_r" |
262 | 262 |
TH_SAFE="-thread-safe" |
263 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
264 |
- AC_DEFINE(_REENTRANT) |
|
263 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
264 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
265 | 265 |
fi |
266 |
- AC_DEFINE(C_BSD) |
|
266 |
+ AC_DEFINE(C_BSD,1,[os is solaris]) |
|
267 | 267 |
;; |
268 | 268 |
openbsd3.3*) |
269 | 269 |
if test "$have_pthreads" = "yes"; then |
... | ... |
@@ -286,29 +286,29 @@ openbsd*) |
286 | 286 |
CLAMD_LIBS="-pthread -lc_r" |
287 | 287 |
fi |
288 | 288 |
TH_SAFE="-thread-safe" |
289 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
290 |
- AC_DEFINE(_REENTRANT) |
|
289 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
290 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
291 | 291 |
fi |
292 |
- AC_DEFINE(C_BSD) |
|
292 |
+ AC_DEFINE(C_BSD,1,[os is bsd flavor]) |
|
293 | 293 |
;; |
294 | 294 |
netbsd*) |
295 | 295 |
AC_MSG_RESULT(NetBSD detected. Disabling thread support.) |
296 | 296 |
have_pthreads="no" |
297 |
- AC_DEFINE(C_BSD) |
|
297 |
+ AC_DEFINE(C_BSD,1,[os is bsd flavor]) |
|
298 | 298 |
;; |
299 | 299 |
bsd*) |
300 | 300 |
AC_MSG_RESULT(Unknown BSD detected. Disabling thread support.) |
301 | 301 |
have_pthreads="no" |
302 |
- AC_DEFINE(C_BSD) |
|
302 |
+ AC_DEFINE(C_BSD,1,[os is bsd flavor]) |
|
303 | 303 |
;; |
304 | 304 |
beos*) |
305 | 305 |
AC_MSG_RESULT(BeOS detected. Disabling thread support.) |
306 | 306 |
have_pthreads="no" |
307 |
- AC_DEFINE(C_BEOS) |
|
307 |
+ AC_DEFINE(C_BEOS,1,[os is beos]) |
|
308 | 308 |
;; |
309 | 309 |
darwin*) |
310 |
- AC_DEFINE(C_BSD) |
|
311 |
- AC_DEFINE(C_DARWIN) |
|
310 |
+ AC_DEFINE(C_BSD,1,[os is bsd flavor]) |
|
311 |
+ AC_DEFINE(C_DARWIN,1,[os is darwin]) |
|
312 | 312 |
use_netinfo="yes" |
313 | 313 |
dnl have_pthreads="no" |
314 | 314 |
dnl AC_MSG_RESULT(Darwin detected. Disabling thread support.) |
... | ... |
@@ -317,38 +317,38 @@ sco*) |
317 | 317 |
dnl njh@bandsman.sco.uk: SCO Unix port |
318 | 318 |
FRESHCLAM_LIBS="-lsocket" |
319 | 319 |
CLAMD_LIBS="-lsocket" |
320 |
- AC_DEFINE(NO_SNPRINTF) |
|
320 |
+ dnl AC_DEFINE(NO_SNPRINTF) |
|
321 | 321 |
;; |
322 | 322 |
hpux*) |
323 | 323 |
if test "$have_pthreads" = "yes"; then |
324 | 324 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
325 | 325 |
CLAMD_LIBS="-lpthread" |
326 | 326 |
TH_SAFE="-thread-safe" |
327 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
328 |
- AC_DEFINE(_REENTRANT) |
|
327 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
328 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
329 | 329 |
fi |
330 |
- AC_DEFINE(C_HPUX) |
|
330 |
+ AC_DEFINE(C_HPUX,1,[os is hpux]) |
|
331 | 331 |
;; |
332 | 332 |
aix*) |
333 | 333 |
if test "$have_pthreads" = "yes"; then |
334 | 334 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
335 | 335 |
CLAMD_LIBS="-lpthread" |
336 | 336 |
TH_SAFE="-thread-safe" |
337 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
338 |
- AC_DEFINE(_REENTRANT) |
|
337 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
338 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
339 | 339 |
fi |
340 |
- AC_DEFINE(C_AIX) |
|
340 |
+ AC_DEFINE(C_AIX,1,[os is aix]) |
|
341 | 341 |
;; |
342 | 342 |
irix*) |
343 | 343 |
if test "$have_pthreads" = "yes"; then |
344 | 344 |
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" |
345 | 345 |
CLAMD_LIBS="-lpthread" |
346 | 346 |
TH_SAFE="-thread-safe" |
347 |
- AC_DEFINE(CL_THREAD_SAFE) |
|
348 |
- AC_DEFINE(_REENTRANT) |
|
347 |
+ AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) |
|
348 |
+ AC_DEFINE(_REENTRANT,1,[thread safe]) |
|
349 | 349 |
fi |
350 |
- AC_DEFINE(C_IRIX) |
|
351 |
- AC_DEFINE(NO_SNPRINTF) |
|
350 |
+ AC_DEFINE(C_IRIX,1,[os is irix]) |
|
351 |
+ dnl AC_DEFINE(NO_SNPRINTF,1,no snprintf available) |
|
352 | 352 |
;; |
353 | 353 |
|
354 | 354 |
*) |
... | ... |
@@ -365,7 +365,7 @@ AM_CONDITIONAL(HAVE_MILTER, test "$have_milter" = "yes") |
365 | 365 |
|
366 | 366 |
if test "$have_pthreads" = "yes" |
367 | 367 |
then |
368 |
- AC_DEFINE(BUILD_CLAMD) |
|
368 |
+ AC_DEFINE(BUILD_CLAMD, 1, "build clamd") |
|
369 | 369 |
fi |
370 | 370 |
|
371 | 371 |
if test "$have_milter" = "yes" |
... | ... |
@@ -420,9 +420,9 @@ fi |
420 | 420 |
AC_C_CONST |
421 | 421 |
AC_C_BIGENDIAN |
422 | 422 |
if test $ac_cv_c_bigendian = yes; then |
423 |
- AC_DEFINE(WORDS_BIGENDIAN) |
|
423 |
+ AC_DEFINE(WORDS_BIGENDIAN,1,endianess) |
|
424 | 424 |
else |
425 |
- AC_DEFINE(WORDS_LITTLEENDIAN) |
|
425 |
+ AC_DEFINE(WORDS_BIGENDIAN,0,endianess) |
|
426 | 426 |
fi |
427 | 427 |
|
428 | 428 |
dnl check for __attribute__((packed)) |
... | ... |
@@ -446,14 +446,14 @@ if test "$have_attrib_packed" = no; then |
446 | 446 |
[have_pragma_pack=no]) |
447 | 447 |
]) |
448 | 448 |
AC_MSG_RESULT($have_pragma_pack) |
449 |
- AC_DEFINE(HAVE_PRAGMA_PACK) |
|
449 |
+ AC_DEFINE(HAVE_PRAGMA_PACK, 1, "pragma pack") |
|
450 | 450 |
fi |
451 | 451 |
|
452 | 452 |
if test "$have_attrib_packed" = no -a "$have_pragma_pack" = no ; then |
453 | 453 |
AC_MSG_ERROR(Need to know how to pack structures with this compiler) |
454 | 454 |
fi |
455 | 455 |
if test "$have_attrib_packed" = yes; then |
456 |
- AC_DEFINE(HAVE_ATTRIB_PACKED) |
|
456 |
+ AC_DEFINE(HAVE_ATTRIB_PACKED, 1, "attrib packed") |
|
457 | 457 |
fi |
458 | 458 |
|
459 | 459 |
AC_OUTPUT([ |
... | ... |
@@ -24,9 +24,11 @@ CLAMAVGROUP = @CLAMAVGROUP@ |
24 | 24 |
|
25 | 25 |
install: |
26 | 26 |
$(mkinstalldirs) $(DESTDIR)$(DBINST) |
27 |
- @$(INSTALL_DATA) main.cvd $(DESTDIR)$(DBINST) |
|
28 |
- @$(INSTALL_DATA) daily.cvd $(DESTDIR)$(DBINST) |
|
29 |
- @$(INSTALL_DATA) mirrors.txt $(DESTDIR)$(DBINST) |
|
27 |
+ test -f $(DESTDIR)$(DBINST)/main.cvd || @$(INSTALL_DATA) main.cvd $(DESTDIR)$(DBINST) |
|
28 |
+ test -f $(DESTDIR)$(DBINST)/daily.cvd || @$(INSTALL_DATA) daily.cvd $(DESTDIR)$(DBINST) |
|
29 |
+ test -f $(DESTDIR)$(DBINST)/mirrors.txt || @$(INSTALL_DATA) mirrors.txt $(DESTDIR)$(DBINST) |
|
30 |
+ test -f $(DESTDIR)$(DBINST)/viruses.db && rm -f $(DESTDIR)$(DBINST)/viruses.db || true |
|
31 |
+ test -f $(DESTDIR)$(DBINST)/viruses.db2 && rm -f $(DESTDIR)$(DBINST)/viruses.db2 || true |
|
30 | 32 |
@if test `id -u` -eq 0 && test -n "${CLAMAVUSER}" && test -n "${CLAMAVGROUP}"; then \ |
31 | 33 |
chmod 775 $(DESTDIR)$(DBINST); \ |
32 | 34 |
chown ${CLAMAVUSER} $(DESTDIR)$(DBINST); \ |
... | ... |
@@ -121,6 +121,7 @@ EXTRA_DIST = main.cvd daily.cvd mirrors.txt |
121 | 121 |
DBINST = @DBDIR@ |
122 | 122 |
subdir = database |
123 | 123 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
124 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
124 | 125 |
CONFIG_CLEAN_FILES = |
125 | 126 |
DIST_SOURCES = |
126 | 127 |
DIST_COMMON = Makefile.am Makefile.in |
... | ... |
@@ -247,9 +248,11 @@ uninstall-am: uninstall-info-am |
247 | 247 |
|
248 | 248 |
install: |
249 | 249 |
$(mkinstalldirs) $(DESTDIR)$(DBINST) |
250 |
- @$(INSTALL_DATA) main.cvd $(DESTDIR)$(DBINST) |
|
251 |
- @$(INSTALL_DATA) daily.cvd $(DESTDIR)$(DBINST) |
|
252 |
- @$(INSTALL_DATA) mirrors.txt $(DESTDIR)$(DBINST) |
|
250 |
+ test -f $(DESTDIR)$(DBINST)/main.cvd || @$(INSTALL_DATA) main.cvd $(DESTDIR)$(DBINST) |
|
251 |
+ test -f $(DESTDIR)$(DBINST)/daily.cvd || @$(INSTALL_DATA) daily.cvd $(DESTDIR)$(DBINST) |
|
252 |
+ test -f $(DESTDIR)$(DBINST)/mirrors.txt || @$(INSTALL_DATA) mirrors.txt $(DESTDIR)$(DBINST) |
|
253 |
+ test -f $(DESTDIR)$(DBINST)/viruses.db && rm -f $(DESTDIR)$(DBINST)/viruses.db || true |
|
254 |
+ test -f $(DESTDIR)$(DBINST)/viruses.db2 && rm -f $(DESTDIR)$(DBINST)/viruses.db2 || true |
|
253 | 255 |
@if test `id -u` -eq 0 && test -n "${CLAMAVUSER}" && test -n "${CLAMAVGROUP}"; then \ |
254 | 256 |
chmod 775 $(DESTDIR)$(DBINST); \ |
255 | 257 |
chown ${CLAMAVUSER} $(DESTDIR)$(DBINST); \ |
... | ... |
@@ -119,6 +119,7 @@ EXTRA_DIST = clamdoc.pdf DMS Spanish Japanese html man FreeBSD-HowTo Portugese T |
119 | 119 |
man_MANS = man/clamscan.1 man/freshclam.1 man/sigtool.1 man/clamd.8 man/clamav.conf.5 man/clamdscan.1 man/clamav-milter.8 |
120 | 120 |
subdir = docs |
121 | 121 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
122 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
122 | 123 |
CONFIG_CLEAN_FILES = |
123 | 124 |
DIST_SOURCES = |
124 | 125 |
|
... | ... |
@@ -121,6 +121,7 @@ EXTRA_DIST = clamav.conf freshclam.conf |
121 | 121 |
CFGINST = @CFGDIR@ |
122 | 122 |
subdir = etc |
123 | 123 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
124 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
124 | 125 |
CONFIG_CLEAN_FILES = |
125 | 126 |
DIST_SOURCES = |
126 | 127 |
DIST_COMMON = Makefile.am Makefile.in |
... | ... |
@@ -137,6 +137,7 @@ INCLUDES = -I../clamscan -I../clamd -I../libclamav |
137 | 137 |
LIBS = -L../libclamav -lclamav @FRESHCLAM_LIBS@ |
138 | 138 |
subdir = freshclam |
139 | 139 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
140 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
140 | 141 |
CONFIG_CLEAN_FILES = |
141 | 142 |
bin_PROGRAMS = freshclam$(EXEEXT) |
142 | 143 |
PROGRAMS = $(bin_PROGRAMS) |
... | ... |
@@ -149,7 +150,7 @@ freshclam_OBJECTS = $(am_freshclam_OBJECTS) |
149 | 149 |
@BUILD_CLAMD_FALSE@freshclam_DEPENDENCIES = ../clamscan/getopt.o \ |
150 | 150 |
@BUILD_CLAMD_FALSE@ ../clamscan/others.o |
151 | 151 |
freshclam_LDFLAGS = |
152 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
152 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
153 | 153 |
CPPFLAGS = @CPPFLAGS@ |
154 | 154 |
LDFLAGS = @LDFLAGS@ |
155 | 155 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -20,6 +20,10 @@ |
20 | 20 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#if HAVE_CONFIG_H |
|
24 |
+#include "clamav-config.h" |
|
25 |
+#endif |
|
26 |
+ |
|
23 | 27 |
#include <stdio.h> |
24 | 28 |
#include <stdlib.h> |
25 | 29 |
#include <unistd.h> |
... | ... |
@@ -505,8 +509,8 @@ int get_database(const char *dbfile, int socketfd, const char *file, const char |
505 | 505 |
mprintf("Downloading %s [%c]\r", dbfile, rotation[rot]); |
506 | 506 |
fflush(stdout); |
507 | 507 |
/* rot = ++rot % 4; -> operation on `rot' may be undefined (why ?) */ |
508 |
- rot %= 4; |
|
509 | 508 |
rot++; |
509 |
+ rot %= 4; |
|
510 | 510 |
} |
511 | 511 |
|
512 | 512 |
mprintf("Downloading %s [*]\n", dbfile); |
... | ... |
@@ -181,6 +181,7 @@ libclamav_la_SOURCES = \ |
181 | 181 |
lib_LTLIBRARIES = libclamav.la |
182 | 182 |
subdir = libclamav |
183 | 183 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
184 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
184 | 185 |
CONFIG_CLEAN_FILES = |
185 | 186 |
LTLIBRARIES = $(lib_LTLIBRARIES) |
186 | 187 |
|
... | ... |
@@ -193,7 +194,7 @@ am_libclamav_la_OBJECTS = matcher.lo md5.lo others.lo readdb.lo cvd.lo \ |
193 | 193 |
libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS) |
194 | 194 |
|
195 | 195 |
DEFS = @DEFS@ |
196 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
196 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
197 | 197 |
CPPFLAGS = @CPPFLAGS@ |
198 | 198 |
LDFLAGS = @LDFLAGS@ |
199 | 199 |
LIBS = @LIBS@ |
... | ... |
@@ -17,7 +17,11 @@ |
17 | 17 |
* |
18 | 18 |
* $LOG$ |
19 | 19 |
*/ |
20 |
-static char const rcsid[] = "$Id: blob.c,v 1.3 2004/01/14 10:08:59 nigelhorne Exp $"; |
|
20 |
+static char const rcsid[] = "$Id: blob.c,v 1.4 2004/02/06 13:46:08 kojm Exp $"; |
|
21 |
+ |
|
22 |
+#if HAVE_CONFIG_H |
|
23 |
+#include "clamav-config.h" |
|
24 |
+#endif |
|
21 | 25 |
|
22 | 26 |
#include <stdlib.h> |
23 | 27 |
#include <string.h> |
... | ... |
@@ -33,6 +37,7 @@ static char const rcsid[] = "$Id: blob.c,v 1.3 2004/01/14 10:08:59 nigelhorne Ex |
33 | 33 |
#include "blob.h" |
34 | 34 |
#include "others.h" |
35 | 35 |
|
36 |
+ |
|
36 | 37 |
/*#define OPTIMIZE_SPACE /* for machines short of RAM */ |
37 | 38 |
|
38 | 39 |
#ifndef CL_DEBUG |
... | ... |
@@ -21,6 +21,10 @@ |
21 | 21 |
#ifndef __CLTYPES_H |
22 | 22 |
#define __CLTYPES_H |
23 | 23 |
|
24 |
+#if HAVE_CONFIG_H |
|
25 |
+#include "clamav-config.h" |
|
26 |
+#endif |
|
27 |
+ |
|
24 | 28 |
#ifdef HAVE_STDINT_H |
25 | 29 |
#include <stdint.h> |
26 | 30 |
#elif defined HAVE_SYS_INT_TYPES_H /*solaris*/ |
... | ... |
@@ -39,9 +43,9 @@ |
39 | 39 |
typedef unsigned short uint16_t; typedef signed short int16_t; |
40 | 40 |
# endif |
41 | 41 |
|
42 |
-# if defined SIZEOF_INT == 4 |
|
42 |
+# if SIZEOF_INT == 4 |
|
43 | 43 |
typedef unsigned int uint32_t; typedef signed int int32_t; |
44 |
-# elif defined SIZEOF_LONG == 4 |
|
44 |
+# elif SIZEOF_LONG == 4 |
|
45 | 45 |
typedef unsigned long uint32_t; typedef signed long int32_t; |
46 | 46 |
# else |
47 | 47 |
# error unable to typedef int32_t from either int or long |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2003 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2003 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* untgz() is based on public domain minitar utility by Charles G. Waldman |
5 | 5 |
* |
... | ... |
@@ -18,6 +18,10 @@ |
18 | 18 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | 19 |
*/ |
20 | 20 |
|
21 |
+#if HAVE_CONFIG_H |
|
22 |
+#include "clamav-config.h" |
|
23 |
+#endif |
|
24 |
+ |
|
21 | 25 |
#include <stdio.h> |
22 | 26 |
#include <string.h> |
23 | 27 |
#include <stdlib.h> |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2003 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2003 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* Number encoding rutines are based on yyyRSA by Erik Thiele |
5 | 5 |
* |
... | ... |
@@ -18,6 +18,10 @@ |
18 | 18 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | 19 |
*/ |
20 | 20 |
|
21 |
+#if HAVE_CONFIG_H |
|
22 |
+#include "clamav-config.h" |
|
23 |
+#endif |
|
24 |
+ |
|
21 | 25 |
#ifdef HAVE_GMP |
22 | 26 |
|
23 | 27 |
#include <stdio.h> |
... | ... |
@@ -17,6 +17,9 @@ |
17 | 17 |
* |
18 | 18 |
* Change History: |
19 | 19 |
* $Log: mbox.c,v $ |
20 |
+ * Revision 1.39 2004/02/06 13:46:08 kojm |
|
21 |
+ * Support for clamav-config.h |
|
22 |
+ * |
|
20 | 23 |
* Revision 1.38 2004/02/04 13:29:48 nigelhorne |
21 | 24 |
* Handle partial writes - and print when write fails |
22 | 25 |
* |
... | ... |
@@ -105,7 +108,11 @@ |
105 | 105 |
* Compilable under SCO; removed duplicate code with message.c |
106 | 106 |
* |
107 | 107 |
*/ |
108 |
-static char const rcsid[] = "$Id: mbox.c,v 1.38 2004/02/04 13:29:48 nigelhorne Exp $"; |
|
108 |
+static char const rcsid[] = "$Id: mbox.c,v 1.39 2004/02/06 13:46:08 kojm Exp $"; |
|
109 |
+ |
|
110 |
+#if HAVE_CONFIG_H |
|
111 |
+#include "clamav-config.h" |
|
112 |
+#endif |
|
109 | 113 |
|
110 | 114 |
#ifndef CL_DEBUG |
111 | 115 |
/*#define NDEBUG /* map CLAMAV debug onto standard */ |
... | ... |
@@ -21,7 +21,7 @@ |
21 | 21 |
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ |
22 | 22 |
|
23 | 23 |
#ifdef HAVE_CONFIG_H |
24 |
-# include <config.h> |
|
24 |
+# include <clamav-config.h> |
|
25 | 25 |
#endif |
26 | 26 |
|
27 | 27 |
#include <sys/types.h> |
... | ... |
@@ -37,16 +37,16 @@ |
37 | 37 |
|
38 | 38 |
#include "md5.h" |
39 | 39 |
|
40 |
+/* Not needed, since endianess is already taken care of by configure |
|
40 | 41 |
#ifdef _LIBC |
41 | 42 |
# include <endian.h> |
42 | 43 |
# if __BYTE_ORDER == __BIG_ENDIAN |
43 | 44 |
# define WORDS_BIGENDIAN 1 |
44 | 45 |
# endif |
45 |
-/* We need to keep the namespace clean so define the MD5 function |
|
46 |
- protected using leading __ . */ |
|
47 | 46 |
#endif |
47 |
+*/ |
|
48 | 48 |
|
49 |
-#ifdef WORDS_BIGENDIAN |
|
49 |
+#if WORDS_BIGENDIAN |
|
50 | 50 |
# define SWAP(n) \ |
51 | 51 |
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) |
52 | 52 |
#else |
... | ... |
@@ -17,6 +17,9 @@ |
17 | 17 |
* |
18 | 18 |
* Change History: |
19 | 19 |
* $Log: message.c,v $ |
20 |
+ * Revision 1.27 2004/02/06 13:46:08 kojm |
|
21 |
+ * Support for clamav-config.h |
|
22 |
+ * |
|
20 | 23 |
* Revision 1.26 2004/02/06 13:10:34 nigelhorne |
21 | 24 |
* Now integrates with winzip |
22 | 25 |
* |
... | ... |
@@ -75,7 +78,11 @@ |
75 | 75 |
* uuencodebegin() no longer static |
76 | 76 |
* |
77 | 77 |
*/ |
78 |
-static char const rcsid[] = "$Id: message.c,v 1.26 2004/02/06 13:10:34 nigelhorne Exp $"; |
|
78 |
+static char const rcsid[] = "$Id: message.c,v 1.27 2004/02/06 13:46:08 kojm Exp $"; |
|
79 |
+ |
|
80 |
+#if HAVE_CONFIG_H |
|
81 |
+#include "clamav-config.h" |
|
82 |
+#endif |
|
79 | 83 |
|
80 | 84 |
#ifndef CL_DEBUG |
81 | 85 |
/*#define NDEBUG /* map CLAMAV debug onto standard */ |
... | ... |
@@ -20,6 +20,10 @@ |
20 | 20 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#if HAVE_CONFIG_H |
|
24 |
+#include "clamav-config.h" |
|
25 |
+#endif |
|
26 |
+ |
|
23 | 27 |
#include <sys/types.h> |
24 | 28 |
#include <sys/stat.h> |
25 | 29 |
#include <fcntl.h> |
... | ... |
@@ -38,13 +42,13 @@ |
38 | 38 |
|
39 | 39 |
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
40 | 40 |
|
41 |
-#ifdef WORDS_LITTLEENDIAN |
|
42 |
-#define ole2_endian_convert_16(v) (v) |
|
43 |
-#else |
|
41 |
+#if WORDS_BIGENDIAN |
|
44 | 42 |
static uint16_t ole2_endian_convert_16(uint16_t v) |
45 | 43 |
{ |
46 | 44 |
return ((v >> 8) + (v << 8)); |
47 | 45 |
} |
46 |
+#else |
|
47 |
+#define ole2_endian_convert_16(v) (v) |
|
48 | 48 |
#endif |
49 | 49 |
|
50 | 50 |
#ifdef WORDS_LITTLEENDIAN |
... | ... |
@@ -1,5 +1,6 @@ |
1 | 1 |
/* |
2 | 2 |
* Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
3 |
+ * With enhancements from Thomas Lamy <Thomas.Lamy@in-online.net> |
|
3 | 4 |
* |
4 | 5 |
* This program is free software; you can redistribute it and/or modify |
5 | 6 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -16,6 +17,10 @@ |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 | 18 |
|
19 |
+#if HAVE_CONFIG_H |
|
20 |
+#include "clamav-config.h" |
|
21 |
+#endif |
|
22 |
+ |
|
19 | 23 |
#include <stdio.h> |
20 | 24 |
#include <string.h> |
21 | 25 |
#include <stdlib.h> |
... | ... |
@@ -28,8 +33,8 @@ |
28 | 28 |
#ifdef CL_THREAD_SAFE |
29 | 29 |
# include <pthread.h> |
30 | 30 |
pthread_mutex_t cli_scanrar_mutex = PTHREAD_MUTEX_INITIALIZER; |
31 |
-int cli_scanrar_inuse = 0; |
|
32 | 31 |
#endif |
32 |
+int cli_scanrar_inuse = 0; |
|
33 | 33 |
|
34 | 34 |
#include "clamav.h" |
35 | 35 |
#include "others.h" |
... | ... |
@@ -52,17 +57,56 @@ int cli_scanrar_inuse = 0; |
52 | 52 |
#define SCAN_OLE2 (options & CL_OLE2) |
53 | 53 |
#define DISABLE_RAR (options & CL_DISABLERAR) |
54 | 54 |
|
55 |
+ |
|
56 |
+typedef enum { |
|
57 |
+ CL_UNKNOWN_TYPE = 0, |
|
58 |
+ CL_MAILFILE, |
|
59 |
+ CL_GZFILE, |
|
60 |
+ CL_ZIPFILE, |
|
61 |
+ CL_BZFILE, |
|
62 |
+ CL_RARFILE, |
|
63 |
+ CL_OLE2FILE |
|
64 |
+} cl_file_t; |
|
65 |
+ |
|
66 |
+struct cl_magic_s { |
|
67 |
+ int offset; |
|
68 |
+ char *magic; |
|
69 |
+ size_t length; |
|
70 |
+ char *descr; |
|
71 |
+ cl_file_t type; |
|
72 |
+}; |
|
73 |
+ |
|
55 | 74 |
#define MAGIC_BUFFER_SIZE 14 |
56 |
-#define RAR_MAGIC_STR "Rar!" |
|
57 |
-#define ZIP_MAGIC_STR "PK\003\004" |
|
58 |
-#define GZIP_MAGIC_STR "\037\213" |
|
59 |
-#define MAIL_MAGIC_STR "From " |
|
60 |
-#define RAWMAIL_MAGIC_STR "Received: " |
|
61 |
-#define MAILDIR_MAGIC_STR "Return-Path: " |
|
62 |
-#define DELIVERED_MAGIC_STR "Delivered-To: " |
|
63 |
-#define XUIDL_MAGIC_STR "X-UIDL: " |
|
64 |
-#define BZIP_MAGIC_STR "BZh" |
|
65 |
-#define OLE2_MAGIC_STR "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" |
|
75 |
+static const struct cl_magic_s cl_magic[] = { |
|
76 |
+ {0, "Rar!", 4, "RAR file", CL_RARFILE}, |
|
77 |
+ {0, "PK\003\004", 4, "ZIP file", CL_ZIPFILE}, |
|
78 |
+ {0, "\037\213", 2, "GZip file", CL_GZFILE}, |
|
79 |
+ {0, "BZh", 3, "BZip file", CL_BZFILE}, |
|
80 |
+ {0, "From ", 5, "MBox file", CL_MAILFILE}, |
|
81 |
+ {0, "Received: ", 10, "Raw mail", CL_MAILFILE}, |
|
82 |
+ {0, "Return-Path: ", 13, "Maildir file", CL_MAILFILE}, |
|
83 |
+ {0, "Delivered-To: ", 14, "Mail file", CL_MAILFILE}, |
|
84 |
+ {0, "X-UIDL: ", 8, "Mail file", CL_MAILFILE}, |
|
85 |
+ {0, "\320\317\021\340\241\261\032\341", |
|
86 |
+ 8, "OLE2 container", CL_OLE2FILE}, |
|
87 |
+ {-1, NULL, 0, NULL, CL_UNKNOWN_TYPE} |
|
88 |
+}; |
|
89 |
+ |
|
90 |
+cl_file_t cl_filetype(const char *buf, size_t buflen) |
|
91 |
+{ |
|
92 |
+ int i; |
|
93 |
+ |
|
94 |
+ for (i = 0; cl_magic[i].magic; i++) { |
|
95 |
+ if (buflen >= cl_magic[i].offset+cl_magic[i].length) { |
|
96 |
+ if (memcmp(buf+cl_magic[i].offset, cl_magic[i].magic, cl_magic[i].length) == 0) { |
|
97 |
+ cli_dbgmsg("Recognized %s file\n", cl_magic[i].descr); |
|
98 |
+ return cl_magic[i].type; |
|
99 |
+ } |
|
100 |
+ } |
|
101 |
+ } |
|
102 |
+ cli_dbgmsg("cl_filetype(): File type not recognized\n"); |
|
103 |
+ return CL_UNKNOWN_TYPE; |
|
104 |
+} |
|
66 | 105 |
|
67 | 106 |
int cli_magic_scandesc(int desc, char **virname, long int *scanned, const struct cl_node *root, const struct cl_limits *limits, int options, int *reclev); |
68 | 107 |
|
... | ... |
@@ -70,7 +114,7 @@ int cli_scandesc(int desc, char **virname, long int *scanned, const struct |
70 | 70 |
cl_node *root) |
71 | 71 |
{ |
72 | 72 |
char *buffer, *buff, *endbl, *pt; |
73 |
- int bytes, buffsize, length; |
|
73 |
+ int bytes, buffsize, length, ret; |
|
74 | 74 |
|
75 | 75 |
/* prepare the buffer */ |
76 | 76 |
buffsize = root->maxpatlen + SCANBUFF; |
... | ... |
@@ -96,9 +140,9 @@ cl_node *root) |
96 | 96 |
if(bytes < SCANBUFF) |
97 | 97 |
length -= SCANBUFF - bytes; |
98 | 98 |
|
99 |
- if(cl_scanbuff(pt, length, virname, root) == CL_VIRUS) { |
|
99 |
+ if((ret = cl_scanbuff(pt, length, virname, root)) != CL_CLEAN) { |
|
100 | 100 |
free(buffer); |
101 |
- return CL_VIRUS; |
|
101 |
+ return ret; |
|
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
if(bytes == SCANBUFF) |
... | ... |
@@ -204,15 +248,17 @@ int cli_scanrar(int desc, char **virname, long int *scanned, const struct cl_nod |
204 | 204 |
} |
205 | 205 |
|
206 | 206 |
lseek(fd, 0, SEEK_SET); |
207 |
- if((ret = cli_magic_scandesc(fd, virname, scanned, root, limits, options, reclev)) == CL_VIRUS ) { |
|
208 |
- cli_dbgmsg("RAR -> Found %s virus.\n", *virname); |
|
207 |
+ if((ret = cli_magic_scandesc(fd, virname, scanned, root, limits, options, reclev)) == CL_CLEAN ) { |
|
208 |
+ if(ret == CL_VIRUS) |
|
209 |
+ cli_dbgmsg("RAR -> Found %s virus.\n", *virname); |
|
210 |
+ |
|
209 | 211 |
fclose(tmp); |
210 | 212 |
urarlib_freelist(rarlist); |
211 | 213 |
#ifdef CL_THREAD_SAFE |
212 | 214 |
pthread_mutex_unlock(&cli_scanrar_mutex); |
213 | 215 |
cli_scanrar_inuse = 0; |
214 | 216 |
#endif |
215 |
- return CL_VIRUS; |
|
217 |
+ return ret; |
|
216 | 218 |
} |
217 | 219 |
|
218 | 220 |
} else { |
... | ... |
@@ -699,6 +745,7 @@ int cli_magic_scandesc(int desc, char **virname, long int *scanned, const struct |
699 | 699 |
char magic[MAGIC_BUFFER_SIZE+1]; |
700 | 700 |
int ret = CL_CLEAN; |
701 | 701 |
int bread = 0; |
702 |
+ cl_file_t type; |
|
702 | 703 |
|
703 | 704 |
|
704 | 705 |
if(!root) { |
... | ... |
@@ -728,54 +775,49 @@ int cli_magic_scandesc(int desc, char **virname, long int *scanned, const struct |
728 | 728 |
(*reclev)--; |
729 | 729 |
return ret; |
730 | 730 |
} |
731 |
-#ifdef CL_THREAD_SAFE |
|
732 |
- /* this check protects against recursive deadlock */ |
|
733 |
- if(!DISABLE_RAR && SCAN_ARCHIVE && !cli_scanrar_inuse && !strncmp(magic, RAR_MAGIC_STR, strlen(RAR_MAGIC_STR))) { |
|
734 |
- cli_dbgmsg("Recognized rar file.\n"); |
|
735 |
- ret = cli_scanrar(desc, virname, scanned, root, limits, options, reclev); |
|
736 |
- } |
|
737 |
-#else |
|
738 |
- if(!DISABLE_RAR && SCAN_ARCHIVE && !strncmp(magic, RAR_MAGIC_STR, strlen(RAR_MAGIC_STR))) { |
|
739 |
- cli_dbgmsg("Recognized rar file.\n"); |
|
740 |
- ret = cli_scanrar(desc, virname, scanned, root, limits, options, reclev); |
|
741 |
- } |
|
742 |
-#endif |
|
743 |
-#ifdef HAVE_ZLIB_H |
|
744 |
- else if(SCAN_ARCHIVE && !strncmp(magic, ZIP_MAGIC_STR, strlen(ZIP_MAGIC_STR))) { |
|
745 |
- cli_dbgmsg("Recognized zip file.\n"); |
|
746 |
- ret = cli_scanzip(desc, virname, scanned, root, limits, options, reclev); |
|
747 |
- } else if(SCAN_ARCHIVE && !strncmp(magic, GZIP_MAGIC_STR, strlen(GZIP_MAGIC_STR))) { |
|
748 |
- cli_dbgmsg("Recognized gzip file.\n"); |
|
749 |
- ret = cli_scangzip(desc, virname, scanned, root, limits, options, reclev); |
|
750 |
- } |
|
751 |
-#endif |
|
731 |
+ |
|
732 |
+ type = cl_filetype(magic, bread); |
|
733 |
+ |
|
734 |
+ switch(type) { |
|
735 |
+ case CL_RARFILE: |
|
736 |
+ if(!DISABLE_RAR && SCAN_ARCHIVE && !cli_scanrar_inuse) { |
|
737 |
+ ret = cli_scanrar(desc, virname, scanned, root, limits, options, reclev); |
|
738 |
+ } |
|
739 |
+ break; |
|
740 |
+ |
|
741 |
+ case CL_ZIPFILE: |
|
742 |
+ if(SCAN_ARCHIVE) { |
|
743 |
+ ret = cli_scanzip(desc, virname, scanned, root, limits, options, reclev); |
|
744 |
+ } |
|
745 |
+ break; |
|
746 |
+ |
|
747 |
+ case CL_GZFILE: |
|
748 |
+ if(SCAN_ARCHIVE) { |
|
749 |
+ ret = cli_scangzip(desc, virname, scanned, root, limits, options, reclev); |
|
750 |
+ } |
|
751 |
+ break; |
|
752 |
+ |
|
752 | 753 |
#ifdef HAVE_BZLIB_H |
753 |
- else if(SCAN_ARCHIVE && !strncmp(magic, BZIP_MAGIC_STR, strlen(BZIP_MAGIC_STR))) { |
|
754 |
- cli_dbgmsg("Recognized bzip file.\n"); |
|
755 |
- ret = cli_scanbzip(desc, virname, scanned, root, limits, options, reclev); |
|
756 |
- } |
|
754 |
+ case CL_BZFILE: |
|
755 |
+ if(SCAN_ARCHIVE) { |
|
756 |
+ ret = cli_scanbzip(desc, virname, scanned, root, limits, options, reclev); |
|
757 |
+ } |
|
758 |
+ break; |
|
757 | 759 |
#endif |
758 |
- else if(SCAN_OLE2 && !strncmp(magic, OLE2_MAGIC_STR, 8)) { |
|
759 |
- cli_dbgmsg("Recognized OLE2 file.\n"); |
|
760 |
- ret = cli_scanole2(desc, virname, scanned, root, limits, options, reclev); |
|
761 |
- } |
|
762 |
- else if(SCAN_MAIL && !strncmp(magic, MAIL_MAGIC_STR, strlen(MAIL_MAGIC_STR))) { |
|
763 |
- cli_dbgmsg("Recognized mail file.\n"); |
|
764 |
- ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
765 |
- } |
|
766 |
- else if(SCAN_MAIL && !strncmp(magic, RAWMAIL_MAGIC_STR, strlen(RAWMAIL_MAGIC_STR))) { |
|
767 |
- cli_dbgmsg("Recognized raw mail file.\n"); |
|
768 |
- ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
769 |
- } else if(SCAN_MAIL && !strncasecmp(magic, MAILDIR_MAGIC_STR, strlen(MAILDIR_MAGIC_STR))) { |
|
770 |
- cli_dbgmsg("Recognized Maildir mail file.\n"); |
|
771 |
- ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
772 |
- } else if(SCAN_MAIL && !strncmp(magic, DELIVERED_MAGIC_STR, strlen(DELIVERED_MAGIC_STR))) { |
|
773 |
- cli_dbgmsg("Recognized (Delivered-To) mail file.\n"); |
|
774 |
- ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
775 |
- } else if(SCAN_MAIL && !strncmp(magic, XUIDL_MAGIC_STR, strlen(XUIDL_MAGIC_STR))) { |
|
776 |
- cli_dbgmsg("Recognized (X-UIDL) mail file.\n"); |
|
777 |
- ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
760 |
+ |
|
761 |
+ case CL_MAILFILE: |
|
762 |
+ if (SCAN_MAIL) { |
|
763 |
+ ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
|
764 |
+ } |
|
765 |
+ break; |
|
766 |
+ |
|
767 |
+ case CL_OLE2FILE: |
|
768 |
+ if(SCAN_OLE2) { |
|
769 |
+ ret = cli_scanole2(desc, virname, scanned, root, limits, options, reclev); |
|
770 |
+ } |
|
771 |
+ break; |
|
778 | 772 |
} |
773 |
+ |
|
779 | 774 |
(*reclev)--; |
780 | 775 |
} |
781 | 776 |
|
... | ... |
@@ -63,6 +63,10 @@ |
63 | 63 |
************************************************************************** */ |
64 | 64 |
|
65 | 65 |
/* -- include files ------------------------------------------------------- */ |
66 |
+#if HAVE_CONFIG_H |
|
67 |
+#include "clamav-config.h" |
|
68 |
+#endif |
|
69 |
+ |
|
66 | 70 |
#include "unrarlib.h" /* include global configuration */ |
67 | 71 |
#include "others.h" |
68 | 72 |
/* ------------------------------------------------------------------------ */ |
... | ... |
@@ -130,6 +130,7 @@ DEFS = @DEFS@ |
130 | 130 |
LIBS = -L../libclamav -lclamav @FRESHCLAM_LIBS@ |
131 | 131 |
subdir = sigtool |
132 | 132 |
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
133 |
+CONFIG_HEADER = $(top_builddir)/clamav-config.h |
|
133 | 134 |
CONFIG_CLEAN_FILES = |
134 | 135 |
bin_PROGRAMS = sigtool$(EXEEXT) |
135 | 136 |
PROGRAMS = $(bin_PROGRAMS) |
... | ... |
@@ -138,7 +139,7 @@ am_sigtool_OBJECTS = options.$(OBJEXT) sigtool.$(OBJEXT) |
138 | 138 |
sigtool_OBJECTS = $(am_sigtool_OBJECTS) |
139 | 139 |
sigtool_DEPENDENCIES = ../clamscan/getopt.o ../clamscan/others.o |
140 | 140 |
sigtool_LDFLAGS = |
141 |
-DEFAULT_INCLUDES = -I. -I$(srcdir) |
|
141 |
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |
|
142 | 142 |
CPPFLAGS = @CPPFLAGS@ |
143 | 143 |
LDFLAGS = @LDFLAGS@ |
144 | 144 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2002, 2003 Tomasz Kojm <zolw@konarski.edu.pl> |
|
2 |
+ * Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -18,6 +18,11 @@ |
18 | 18 |
|
19 | 19 |
/* some things may need to be tuned here (look at jmp variables) */ |
20 | 20 |
|
21 |
+#if HAVE_CONFIG_H |
|
22 |
+#include "clamav-config.h" |
|
23 |
+#endif |
|
24 |
+ |
|
25 |
+ |
|
21 | 26 |
#include <stdio.h> |
22 | 27 |
#include <stdlib.h> |
23 | 28 |
#include <string.h> |