Browse code

improved support for BSDI BSD/OS

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1149 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/12/01 00:56:25
Showing 7 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Nov 30 16:47:54 CET 2004 (tk)
2
+---------------------------------
3
+  * improved support for BSDI BSD/OS (access to test environment provided by
4
+    David Wu <dyw*iohk.com>)
5
+
1 6
 Tue Nov 30 12:06:12 GMT 2004 (njh)
2 7
 ----------------------------------
3 8
   * libclamav/message.c:	Better handling for  unbalanced quotes in
... ...
@@ -5,17 +10,17 @@ Tue Nov 30 12:06:12 GMT 2004 (njh)
5 5
 
6 6
 Mon Nov 29 13:25:25 GMT 2004 (njh)
7 7
 ----------------------------------
8
-* libclamav/blob.c:	Fix potential crash if a temporary file can't be
8
+  * libclamav/blob.c:	Fix potential crash if a temporary file can't be
9 9
 	created
10
-libclamav/mbox.c:	Disable the old continuation marker detection scheme
10
+  * libclamav/mbox.c:	Disable the old continuation marker detection scheme
11 11
 
12 12
 Mon Nov 29 00:23:55 CET 2004 (tk)
13 13
 ---------------------------------
14
-* clamdscan: add support for --move and --remove options
14
+  * clamdscan: add support for --move and --remove options
15 15
 
16 16
 Sun Nov 28 21:08:44 GMT 2004 (njh)
17 17
 ----------------------------------
18
-* libclamav:	Email headers of only white space are no longer treated as
18
+  * libclamav:	Email headers of only white space are no longer treated as
19 19
 		the end of the headers
20 20
 
21 21
 Sun Nov 28 16:30:18 GMT 2004 (njh)
... ...
@@ -261,6 +261,9 @@
261 261
 /* The number of bytes in type long */
262 262
 #undef SIZEOF_LONG
263 263
 
264
+/* The number of bytes in type long long */
265
+#undef SIZEOF_LONG_LONG
266
+
264 267
 /* The number of bytes in type short */
265 268
 #undef SIZEOF_SHORT
266 269
 
... ...
@@ -9116,6 +9116,76 @@ cat >>confdefs.h <<_ACEOF
9116 9116
 _ACEOF
9117 9117
 
9118 9118
 
9119
+echo "$as_me:$LINENO: checking size of long long" >&5
9120
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6
9121
+if test "${ac_cv_sizeof_long_long+set}" = set; then
9122
+  echo $ECHO_N "(cached) $ECHO_C" >&6
9123
+else
9124
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
9125
+  cat >conftest.$ac_ext <<_ACEOF
9126
+/* confdefs.h.  */
9127
+_ACEOF
9128
+cat confdefs.h >>conftest.$ac_ext
9129
+cat >>conftest.$ac_ext <<_ACEOF
9130
+/* end confdefs.h.  */
9131
+#include "confdefs.h"
9132
+#include <sys/types.h>
9133
+
9134
+
9135
+int
9136
+main ()
9137
+{
9138
+switch (0) case 0: case (sizeof (long long) == $ac_size):;
9139
+  ;
9140
+  return 0;
9141
+}
9142
+_ACEOF
9143
+rm -f conftest.$ac_objext
9144
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9145
+  (eval $ac_compile) 2>conftest.er1
9146
+  ac_status=$?
9147
+  grep -v '^ *+' conftest.er1 >conftest.err
9148
+  rm -f conftest.er1
9149
+  cat conftest.err >&5
9150
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9151
+  (exit $ac_status); } &&
9152
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
9153
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9154
+  (eval $ac_try) 2>&5
9155
+  ac_status=$?
9156
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9157
+  (exit $ac_status); }; } &&
9158
+	 { ac_try='test -s conftest.$ac_objext'
9159
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9160
+  (eval $ac_try) 2>&5
9161
+  ac_status=$?
9162
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9163
+  (exit $ac_status); }; }; then
9164
+  ac_cv_sizeof_long_long=$ac_size
9165
+else
9166
+  echo "$as_me: failed program was:" >&5
9167
+sed 's/^/| /' conftest.$ac_ext >&5
9168
+
9169
+fi
9170
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9171
+  if test x$ac_cv_sizeof_long_long != x ; then break; fi
9172
+done
9173
+
9174
+fi
9175
+
9176
+if test x$ac_cv_sizeof_long_long = x ; then
9177
+  { { echo "$as_me:$LINENO: error: cannot determine a size for long long" >&5
9178
+echo "$as_me: error: cannot determine a size for long long" >&2;}
9179
+   { (exit 1); exit 1; }; }
9180
+fi
9181
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
9182
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
9183
+
9184
+cat >>confdefs.h <<_ACEOF
9185
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
9186
+_ACEOF
9187
+
9188
+
9119 9189
 
9120 9190
 echo "$as_me:$LINENO: checking for bind in -lsocket" >&5
9121 9191
 echo $ECHO_N "checking for bind in -lsocket... $ECHO_C" >&6
... ...
@@ -11549,12 +11619,15 @@ _ACEOF
11549 11549
 
11550 11550
     disable_gethostbyname_r="yes"
11551 11551
     ;;
11552
-openbsd3.3*)
11552
+openbsd*)
11553 11553
     if test "$have_pthreads" = "yes"; then
11554 11554
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
11555 11555
 	if test "$disable_cr" = "yes"; then
11556 11556
 	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
11557
-	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
11557
+	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
11558
+	else
11559
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
11560
+	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
11558 11561
 	fi
11559 11562
 	TH_SAFE="-thread-safe"
11560 11563
 
... ...
@@ -11575,16 +11648,11 @@ _ACEOF
11575 11575
 
11576 11576
     disable_gethostbyname_r="yes"
11577 11577
     ;;
11578
-openbsd*)
11578
+bsdi*)
11579 11579
     if test "$have_pthreads" = "yes"; then
11580 11580
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
11581
-	if test "$disable_cr" = "yes"; then
11582
-	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
11583
-	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
11584
-	else
11585
-	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
11586
-	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
11587
-	fi
11581
+	CLAMD_LIBS="$CLAMD_LIBS -pthread"
11582
+	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
11588 11583
 	TH_SAFE="-thread-safe"
11589 11584
 
11590 11585
 cat >>confdefs.h <<\_ACEOF
... ...
@@ -45,6 +45,7 @@ AC_TYPE_OFF_T
45 45
 AC_COMPILE_CHECK_SIZEOF(short)
46 46
 AC_COMPILE_CHECK_SIZEOF(int)
47 47
 AC_COMPILE_CHECK_SIZEOF(long)
48
+AC_COMPILE_CHECK_SIZEOF(long long)
48 49
 
49 50
 AC_CHECK_LIB(socket, bind, [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; LDFLAGS="$LDFLAGS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
50 51
 AC_CHECK_LIB(nsl, gethostent, [LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; LDFLAGS="$LDFLAGS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl"])
... ...
@@ -355,35 +356,33 @@ freebsd*)
355 355
     AC_DEFINE(C_BSD,1,[os is freebsd])
356 356
     disable_gethostbyname_r="yes"
357 357
     ;;
358
-openbsd3.3*)
358
+openbsd*)
359 359
     if test "$have_pthreads" = "yes"; then
360 360
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
361 361
 	if test "$disable_cr" = "yes"; then
362 362
 	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
363
-	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
363
+	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
364
+	else
365
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
366
+	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
364 367
 	fi
365 368
 	TH_SAFE="-thread-safe"
366 369
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
367 370
 	AC_DEFINE(_REENTRANT,1,[thread safe])
368 371
     fi
369
-    AC_DEFINE(C_BSD,1,[os is bsd flavor])
372
+    AC_DEFINE(C_BSD,1,[os is OpenBSD])
370 373
     disable_gethostbyname_r="yes"
371 374
     ;;
372
-openbsd*)
375
+bsdi*)
373 376
     if test "$have_pthreads" = "yes"; then
374 377
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
375
-	if test "$disable_cr" = "yes"; then
376
-	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
377
-	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
378
-	else
379
-	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
380
-	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
381
-	fi
378
+	CLAMD_LIBS="$CLAMD_LIBS -pthread"
379
+	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
382 380
 	TH_SAFE="-thread-safe"
383 381
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
384 382
 	AC_DEFINE(_REENTRANT,1,[thread safe])
385 383
     fi
386
-    AC_DEFINE(C_BSD,1,[os is bsd flavor])
384
+    AC_DEFINE(C_BSD,1,[os is BSDI BSD/OS])
387 385
     disable_gethostbyname_r="yes"
388 386
     ;;
389 387
 netbsd*)
... ...
@@ -395,7 +394,7 @@ netbsd*)
395 395
 	AC_DEFINE(_REENTRANT,1,[thread safe])
396 396
 	ADDITIONAL_LIBS="$LIBS -lpthread"
397 397
      fi
398
-    AC_DEFINE(C_BSD,1,[os is bsd flavor])
398
+    AC_DEFINE(C_BSD,1,[os is NetBSD])
399 399
     disable_gethostbyname_r="yes"
400 400
     ;;
401 401
 bsd*)
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.8.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -387,7 +387,7 @@ clean-libLTLIBRARIES:
387 387
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
388 388
 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
389 389
 	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
390
-	  test "$$dir" = "$$p" && dir=.; \
390
+	  test "$$dir" != "$$p" || dir=.; \
391 391
 	  echo "rm -f \"$${dir}/so_locations\""; \
392 392
 	  rm -f "$${dir}/so_locations"; \
393 393
 	done
... ...
@@ -830,9 +830,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
830 830
 	  done | \
831 831
 	  $(AWK) '    { files[$$0] = 1; } \
832 832
 	       END { for (i in files) print i; }'`; \
833
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
834
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
835
-	     $$tags $$unique
833
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
834
+	  test -n "$$unique" || unique=$$empty_fix; \
835
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
836
+	    $$tags $$unique; \
837
+	fi
836 838
 ctags: CTAGS
837 839
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
838 840
 		$(TAGS_FILES) $(LISP)
... ...
@@ -44,6 +44,7 @@
44 44
 #include "others.h"
45 45
 #include "mspack/mspack.h"
46 46
 #include "mspack/lzx.h"
47
+#include "cltypes.h"
47 48
 
48 49
 #define FALSE (0)
49 50
 #define TRUE (1)
... ...
@@ -51,6 +51,16 @@
51 51
 #   error unable to typedef int32_t from either int or long
52 52
     typedef unsigned long uint32_t;     typedef signed long int32_t;
53 53
 # endif
54
+
55
+# if SIZEOF_LONG == 8
56
+    typedef unsigned long uint64_t;      typedef signed long int64_t;
57
+# elif SIZEOF_LONG_LONG == 8
58
+    typedef unsigned long long uint64_t;     typedef signed long long int64_t;
59
+# else
60
+#   error unable to typedef int64_t from either long or long long
61
+    typedef unsigned long long uint64_t;     typedef signed long long int64_t;
62
+# endif
63
+
54 64
 #endif
55 65
 
56 66
 /*