Browse code

Draft of bytecode loader.

Török Edvin authored on 2009/06/26 22:30:46
Showing 33 changed files
... ...
@@ -18,7 +18,7 @@
18 18
 
19 19
 ACLOCAL_AMFLAGS=-I m4
20 20
 
21
-SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop
21
+SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop clambc
22 22
 EXTRA_DIST = FAQ examples BUGS shared libclamav.pc.in libclamunrar_iface/Makefile.am libclamunrar_iface/Makefile.in UPGRADE COPYING.bzip2 COPYING.lzma COPYING.unrar COPYING.LGPL COPYING.file COPYING.zlib COPYING.getopt COPYING.regex COPYING.sha256
23 23
 
24 24
 bin_SCRIPTS=clamav-config
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -282,7 +282,7 @@ top_build_prefix = @top_build_prefix@
282 282
 top_builddir = @top_builddir@
283 283
 top_srcdir = @top_srcdir@
284 284
 ACLOCAL_AMFLAGS = -I m4
285
-SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop
285
+SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop clambc
286 286
 EXTRA_DIST = FAQ examples BUGS shared libclamav.pc.in libclamunrar_iface/Makefile.am libclamunrar_iface/Makefile.in UPGRADE COPYING.bzip2 COPYING.lzma COPYING.unrar COPYING.LGPL COPYING.file COPYING.zlib COPYING.getopt COPYING.regex COPYING.sha256
287 287
 bin_SCRIPTS = clamav-config
288 288
 pkgconfigdir = $(libdir)/pkgconfig
... ...
@@ -453,7 +453,7 @@ clean-libtool:
453 453
 	-rm -rf .libs _libs
454 454
 
455 455
 distclean-libtool:
456
-	-rm -f libtool
456
+	-rm -f libtool config.lt
457 457
 install-pkgconfigDATA: $(pkgconfig_DATA)
458 458
 	@$(NORMAL_INSTALL)
459 459
 	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
... ...
@@ -547,7 +547,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
547 547
 	unique=`for i in $$list; do \
548 548
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
549 549
 	  done | \
550
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
550
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
551 551
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
552 552
 	mkid -fID $$unique
553 553
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
1
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
2 2
 
3 3
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 4
 # 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
... ...
@@ -13,13 +13,13 @@
13 13
 
14 14
 m4_ifndef([AC_AUTOCONF_VERSION],
15 15
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
-m4_if(AC_AUTOCONF_VERSION, [2.63],,
16
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17 17
 [m4_warning([this file was generated for autoconf 2.63.
18 18
 You have another version of autoconf.  It may work, but is not guaranteed to.
19 19
 If you have problems, you may need to regenerate the build system entirely.
20 20
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21 21
 
22
-# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
22
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23 23
 #
24 24
 # This file is free software; the Free Software Foundation
25 25
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
34 34
 [am__api_version='1.10'
35 35
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36 36
 dnl require some minimum version.  Point them to the right macro.
37
-m4_if([$1], [1.10.1], [],
37
+m4_if([$1], [1.10.2], [],
38 38
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39 39
 ])
40 40
 
... ...
@@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
48 48
 # AM_SET_CURRENT_AUTOMAKE_VERSION
49 49
 # -------------------------------
50 50
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
51
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52 52
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
53
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
54 54
 m4_ifndef([AC_AUTOCONF_VERSION],
55 55
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
56
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57 57
 
58 58
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59 59
 
... ...
@@ -303,19 +303,28 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
303 303
 
304 304
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
305 305
 
306
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
306
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
307 307
 # Free Software Foundation, Inc.
308 308
 #
309 309
 # This file is free software; the Free Software Foundation
310 310
 # gives unlimited permission to copy and/or distribute it,
311 311
 # with or without modifications, as long as this notice is preserved.
312 312
 
313
-#serial 3
313
+#serial 4
314 314
 
315 315
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
316 316
 # ------------------------------
317 317
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
318
-[for mf in $CONFIG_FILES; do
318
+[# Autoconf 2.62 quotes --file arguments for eval, but not when files
319
+# are listed without --file.  Let's play safe and only enable the eval
320
+# if we detect the quoting.
321
+case $CONFIG_FILES in
322
+*\'*) eval set x "$CONFIG_FILES" ;;
323
+*)   set x $CONFIG_FILES ;;
324
+esac
325
+shift
326
+for mf
327
+do
319 328
   # Strip MF so we end up with the name of the file.
320 329
   mf=`echo "$mf" | sed -e 's/:.*$//'`
321 330
   # Check whether this is an Automake generated Makefile or not.
... ...
@@ -647,13 +656,13 @@ esac
647 647
 
648 648
 # Helper functions for option handling.                     -*- Autoconf -*-
649 649
 
650
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
650
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
651 651
 #
652 652
 # This file is free software; the Free Software Foundation
653 653
 # gives unlimited permission to copy and/or distribute it,
654 654
 # with or without modifications, as long as this notice is preserved.
655 655
 
656
-# serial 3
656
+# serial 4
657 657
 
658 658
 # _AM_MANGLE_OPTION(NAME)
659 659
 # -----------------------
... ...
@@ -670,7 +679,7 @@ AC_DEFUN([_AM_SET_OPTION],
670 670
 # ----------------------------------
671 671
 # OPTIONS is a space-separated list of Automake options.
672 672
 AC_DEFUN([_AM_SET_OPTIONS],
673
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
673
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
674 674
 
675 675
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
676 676
 # -------------------------------------------
... ...
@@ -247,7 +247,7 @@
247 247
 /* Define to 1 if you have the <mach-o/dyld.h> header file. */
248 248
 #undef HAVE_MACH_O_DYLD_H
249 249
 
250
-/* have mallinfo */
250
+/* Define to 1 if you have the `mallinfo' function. */
251 251
 #undef HAVE_MALLINFO
252 252
 
253 253
 /* Define to 1 if you have the <malloc.h> header file. */
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -297,8 +297,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
297 297
 	@for dep in $?; do \
298 298
 	  case '$(am__configure_deps)' in \
299 299
 	    *$$dep*) \
300
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
301
-		&& exit 0; \
300
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
301
+	        && { if test -f $@; then exit 0; else break; fi; }; \
302 302
 	      exit 1;; \
303 303
 	  esac; \
304 304
 	done; \
... ...
@@ -479,8 +479,8 @@ install-man8: $(man8_MANS) $(man_MANS)
479 479
 	  esac; \
480 480
 	done; \
481 481
 	for i in $$list; do \
482
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
483
-	  else file=$$i; fi; \
482
+	  if test -f $$i; then file=$$i; \
483
+	  else file=$(srcdir)/$$i; fi; \
484 484
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
485 485
 	  case "$$ext" in \
486 486
 	    8*) ;; \
... ...
@@ -519,7 +519,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
519 519
 	unique=`for i in $$list; do \
520 520
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
521 521
 	  done | \
522
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
522
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
523 523
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
524 524
 	mkid -fID $$unique
525 525
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -267,8 +267,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
267 267
 	@for dep in $?; do \
268 268
 	  case '$(am__configure_deps)' in \
269 269
 	    *$$dep*) \
270
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
271
-		&& exit 0; \
270
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
271
+	        && { if test -f $@; then exit 0; else break; fi; }; \
272 272
 	      exit 1;; \
273 273
 	  esac; \
274 274
 	done; \
... ...
@@ -425,7 +425,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
425 425
 	unique=`for i in $$list; do \
426 426
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
427 427
 	  done | \
428
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
428
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
429 429
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
430 430
 	mkid -fID $$unique
431 431
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -317,8 +317,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
317 317
 	@for dep in $?; do \
318 318
 	  case '$(am__configure_deps)' in \
319 319
 	    *$$dep*) \
320
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
321
-		&& exit 0; \
320
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
321
+	        && { if test -f $@; then exit 0; else break; fi; }; \
322 322
 	      exit 1;; \
323 323
 	  esac; \
324 324
 	done; \
... ...
@@ -515,7 +515,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
515 515
 	unique=`for i in $$list; do \
516 516
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
517 517
 	  done | \
518
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
518
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
519 519
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
520 520
 	mkid -fID $$unique
521 521
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -288,8 +288,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
288 288
 	@for dep in $?; do \
289 289
 	  case '$(am__configure_deps)' in \
290 290
 	    *$$dep*) \
291
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
292
-		&& exit 0; \
291
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
292
+	        && { if test -f $@; then exit 0; else break; fi; }; \
293 293
 	      exit 1;; \
294 294
 	  esac; \
295 295
 	done; \
... ...
@@ -493,7 +493,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
493 493
 	unique=`for i in $$list; do \
494 494
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
495 495
 	  done | \
496
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
496
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
497 497
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
498 498
 	mkid -fID $$unique
499 499
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -259,8 +259,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
259 259
 	@for dep in $?; do \
260 260
 	  case '$(am__configure_deps)' in \
261 261
 	    *$$dep*) \
262
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
263
-		&& exit 0; \
262
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
263
+	        && { if test -f $@; then exit 0; else break; fi; }; \
264 264
 	      exit 1;; \
265 265
 	  esac; \
266 266
 	done; \
... ...
@@ -422,8 +422,8 @@ install-man1: $(man1_MANS) $(man_MANS)
422 422
 	  esac; \
423 423
 	done; \
424 424
 	for i in $$list; do \
425
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
426
-	  else file=$$i; fi; \
425
+	  if test -f $$i; then file=$$i; \
426
+	  else file=$(srcdir)/$$i; fi; \
427 427
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
428 428
 	  case "$$ext" in \
429 429
 	    1*) ;; \
... ...
@@ -462,7 +462,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
462 462
 	unique=`for i in $$list; do \
463 463
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
464 464
 	  done | \
465
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
465
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
466 466
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
467 467
 	mkid -fID $$unique
468 468
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -278,8 +278,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
278 278
 	@for dep in $?; do \
279 279
 	  case '$(am__configure_deps)' in \
280 280
 	    *$$dep*) \
281
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
282
-		&& exit 0; \
281
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
282
+	        && { if test -f $@; then exit 0; else break; fi; }; \
283 283
 	      exit 1;; \
284 284
 	  esac; \
285 285
 	done; \
... ...
@@ -468,7 +468,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
468 468
 	unique=`for i in $$list; do \
469 469
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
470 470
 	  done | \
471
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
471
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
472 472
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
473 473
 	mkid -fID $$unique
474 474
 tags: TAGS
... ...
@@ -4,7 +4,7 @@
4 4
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5 5
 #   Free Software Foundation, Inc.
6 6
 
7
-timestamp='2008-01-23'
7
+timestamp='2009-04-27'
8 8
 
9 9
 # This file is free software; you can redistribute it and/or modify it
10 10
 # under the terms of the GNU General Public License as published by
... ...
@@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
324 324
 	case `/usr/bin/uname -p` in
325 325
 	    sparc) echo sparc-icl-nx7; exit ;;
326 326
 	esac ;;
327
+    s390x:SunOS:*:*)
328
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
+	exit ;;
327 330
     sun4H:SunOS:5.*:*)
328 331
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329 332
 	exit ;;
... ...
@@ -331,7 +334,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
331 331
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332 332
 	exit ;;
333 333
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
334
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334
+	eval $set_cc_for_build
335
+	SUN_ARCH="i386"
336
+	# If there is a compiler, see if it is configured for 64-bit objects.
337
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
338
+	# This test works for both compilers.
339
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
340
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
341
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
342
+		grep IS_64BIT_ARCH >/dev/null
343
+	    then
344
+		SUN_ARCH="x86_64"
345
+	    fi
346
+	fi
347
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335 348
 	exit ;;
336 349
     sun4*:SunOS:6*:*)
337 350
 	# According to config.sub, this is the proper way to canonicalize
... ...
@@ -796,7 +812,7 @@ EOF
796 796
 	    x86)
797 797
 		echo i586-pc-interix${UNAME_RELEASE}
798 798
 		exit ;;
799
-	    EM64T | authenticamd)
799
+	    EM64T | authenticamd | genuineintel)
800 800
 		echo x86_64-unknown-interix${UNAME_RELEASE}
801 801
 		exit ;;
802 802
 	    IA64)
... ...
@@ -935,6 +951,9 @@ EOF
935 935
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
936 936
 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
937 937
 	exit ;;
938
+    padre:Linux:*:*)
939
+	echo sparc-unknown-linux-gnu
940
+	exit ;;
938 941
     parisc:Linux:*:* | hppa:Linux:*:*)
939 942
 	# Look for CPU level
940 943
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
... ...
@@ -985,9 +1004,6 @@ EOF
985 985
 	  a.out-i386-linux)
986 986
 		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
987 987
 		exit ;;
988
-	  coff-i386)
989
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
990
-		exit ;;
991 988
 	  "")
992 989
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
993 990
 		# one that does not give us useful --help.
... ...
@@ -1102,8 +1118,11 @@ EOF
1102 1102
     pc:*:*:*)
1103 1103
 	# Left here for compatibility:
1104 1104
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
1105
-        # the processor, so we play safe by assuming i386.
1106
-	echo i386-pc-msdosdjgpp
1105
+        # the processor, so we play safe by assuming i586.
1106
+	# Note: whatever this is, it MUST be the same as what config.sub
1107
+	# prints for the "djgpp" host, or else GDB configury will decide that
1108
+	# this is a cross-build.
1109
+	echo i586-pc-msdosdjgpp
1107 1110
         exit ;;
1108 1111
     Intel:Mach:3*:*)
1109 1112
 	echo i386-pc-mach3
... ...
@@ -1141,6 +1160,16 @@ EOF
1141 1141
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1142 1142
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1143 1143
           && { echo i486-ncr-sysv4; exit; } ;;
1144
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1145
+	OS_REL='.3'
1146
+	test -r /etc/.relid \
1147
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1148
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1149
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1150
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1151
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1152
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1153
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1144 1154
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1145 1155
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
1146 1156
 	exit ;;
... ...
@@ -1216,6 +1245,9 @@ EOF
1216 1216
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1217 1217
 	echo i586-pc-beos
1218 1218
 	exit ;;
1219
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1220
+	echo i586-pc-haiku
1221
+	exit ;;
1219 1222
     SX-4:SUPER-UX:*:*)
1220 1223
 	echo sx4-nec-superux${UNAME_RELEASE}
1221 1224
 	exit ;;
... ...
@@ -1324,6 +1356,9 @@ EOF
1324 1324
     i*86:rdos:*:*)
1325 1325
 	echo ${UNAME_MACHINE}-pc-rdos
1326 1326
 	exit ;;
1327
+    i*86:AROS:*:*)
1328
+	echo ${UNAME_MACHINE}-pc-aros
1329
+	exit ;;
1327 1330
 esac
1328 1331
 
1329 1332
 #echo '(No uname command or uname output not recognized.)' 1>&2
... ...
@@ -4,7 +4,7 @@
4 4
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5 5
 #   Free Software Foundation, Inc.
6 6
 
7
-timestamp='2008-01-16'
7
+timestamp='2009-04-17'
8 8
 
9 9
 # This file is (in principle) common to ALL GNU software.
10 10
 # The presence of a machine in this file suggests that SOME GNU software
... ...
@@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122 122
 case $maybe_os in
123 123
   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124 124
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125
+  kopensolaris*-gnu* | \
125 126
   storm-chaos* | os2-emx* | rtmk-nova*)
126 127
     os=-$maybe_os
127 128
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
... ...
@@ -249,13 +250,16 @@ case $basic_machine in
249 249
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
250 250
 	| i370 | i860 | i960 | ia64 \
251 251
 	| ip2k | iq2000 \
252
+	| lm32 \
252 253
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
253
-	| maxq | mb | microblaze | mcore | mep \
254
+	| maxq | mb | microblaze | mcore | mep | metag \
254 255
 	| mips | mipsbe | mipseb | mipsel | mipsle \
255 256
 	| mips16 \
256 257
 	| mips64 | mips64el \
257
-	| mips64vr | mips64vrel \
258
+	| mips64octeon | mips64octeonel \
258 259
 	| mips64orion | mips64orionel \
260
+	| mips64r5900 | mips64r5900el \
261
+	| mips64vr | mips64vrel \
259 262
 	| mips64vr4100 | mips64vr4100el \
260 263
 	| mips64vr4300 | mips64vr4300el \
261 264
 	| mips64vr5000 | mips64vr5000el \
... ...
@@ -268,6 +272,7 @@ case $basic_machine in
268 268
 	| mipsisa64sr71k | mipsisa64sr71kel \
269 269
 	| mipstx39 | mipstx39el \
270 270
 	| mn10200 | mn10300 \
271
+	| moxie \
271 272
 	| mt \
272 273
 	| msp430 \
273 274
 	| nios | nios2 \
... ...
@@ -277,7 +282,7 @@ case $basic_machine in
277 277
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
278 278
 	| pyramid \
279 279
 	| score \
280
-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
280
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
281 281
 	| sh64 | sh64le \
282 282
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
283 283
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
... ...
@@ -286,7 +291,7 @@ case $basic_machine in
286 286
 	| v850 | v850e \
287 287
 	| we32k \
288 288
 	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
289
-	| z8k)
289
+	| z8k | z80)
290 290
 		basic_machine=$basic_machine-unknown
291 291
 		;;
292 292
 	m6811 | m68hc11 | m6812 | m68hc12)
... ...
@@ -329,14 +334,17 @@ case $basic_machine in
329 329
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
330 330
 	| i*86-* | i860-* | i960-* | ia64-* \
331 331
 	| ip2k-* | iq2000-* \
332
+	| lm32-* \
332 333
 	| m32c-* | m32r-* | m32rle-* \
333 334
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
334
-	| m88110-* | m88k-* | maxq-* | mcore-* \
335
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
335 336
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
336 337
 	| mips16-* \
337 338
 	| mips64-* | mips64el-* \
338
-	| mips64vr-* | mips64vrel-* \
339
+	| mips64octeon-* | mips64octeonel-* \
339 340
 	| mips64orion-* | mips64orionel-* \
341
+	| mips64r5900-* | mips64r5900el-* \
342
+	| mips64vr-* | mips64vrel-* \
340 343
 	| mips64vr4100-* | mips64vr4100el-* \
341 344
 	| mips64vr4300-* | mips64vr4300el-* \
342 345
 	| mips64vr5000-* | mips64vr5000el-* \
... ...
@@ -358,20 +366,20 @@ case $basic_machine in
358 358
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
359 359
 	| pyramid-* \
360 360
 	| romp-* | rs6000-* \
361
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
361
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
362 362
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
363 363
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
364 364
 	| sparclite-* \
365 365
 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
366 366
 	| tahoe-* | thumb-* \
367
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
367
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
368 368
 	| tron-* \
369 369
 	| v850-* | v850e-* | vax-* \
370 370
 	| we32k-* \
371 371
 	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
372 372
 	| xstormy16-* | xtensa*-* \
373 373
 	| ymp-* \
374
-	| z8k-*)
374
+	| z8k-* | z80-*)
375 375
 		;;
376 376
 	# Recognize the basic CPU types without company name, with glob match.
377 377
 	xtensa*)
... ...
@@ -439,6 +447,10 @@ case $basic_machine in
439 439
 		basic_machine=m68k-apollo
440 440
 		os=-bsd
441 441
 		;;
442
+	aros)
443
+		basic_machine=i386-pc
444
+		os=-aros
445
+		;;
442 446
 	aux)
443 447
 		basic_machine=m68k-apple
444 448
 		os=-aux
... ...
@@ -459,6 +471,10 @@ case $basic_machine in
459 459
 		basic_machine=c90-cray
460 460
 		os=-unicos
461 461
 		;;
462
+        cegcc)
463
+		basic_machine=arm-unknown
464
+		os=-cegcc
465
+		;;
462 466
 	convex-c1)
463 467
 		basic_machine=c1-convex
464 468
 		os=-bsd
... ...
@@ -526,6 +542,10 @@ case $basic_machine in
526 526
 		basic_machine=m88k-motorola
527 527
 		os=-sysv3
528 528
 		;;
529
+	dicos)
530
+		basic_machine=i686-pc
531
+		os=-dicos
532
+		;;
529 533
 	djgpp)
530 534
 		basic_machine=i586-pc
531 535
 		os=-msdosdjgpp
... ...
@@ -1128,6 +1148,10 @@ case $basic_machine in
1128 1128
 		basic_machine=z8k-unknown
1129 1129
 		os=-sim
1130 1130
 		;;
1131
+	z80-*-coff)
1132
+		basic_machine=z80-unknown
1133
+		os=-sim
1134
+		;;
1131 1135
 	none)
1132 1136
 		basic_machine=none-none
1133 1137
 		os=-none
... ...
@@ -1166,7 +1190,7 @@ case $basic_machine in
1166 1166
 	we32k)
1167 1167
 		basic_machine=we32k-att
1168 1168
 		;;
1169
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1169
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1170 1170
 		basic_machine=sh-unknown
1171 1171
 		;;
1172 1172
 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
... ...
@@ -1238,8 +1262,9 @@ case $os in
1238 1238
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1239 1239
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1240 1240
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1241
+	      | -kopensolaris* \
1241 1242
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1242
-	      | -aos* \
1243
+	      | -aos* | -aros* \
1243 1244
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1244 1245
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1245 1246
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
... ...
@@ -1248,7 +1273,7 @@ case $os in
1248 1248
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1249 1249
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1250 1250
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1251
-	      | -chorusos* | -chorusrdb* \
1251
+	      | -chorusos* | -chorusrdb* | -cegcc* \
1252 1252
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1253 1253
 	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1254 1254
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
... ...
@@ -1388,6 +1413,9 @@ case $os in
1388 1388
 	-zvmoe)
1389 1389
 		os=-zvmoe
1390 1390
 		;;
1391
+	-dicos*)
1392
+		os=-dicos
1393
+		;;
1391 1394
 	-none)
1392 1395
 		;;
1393 1396
 	*)
... ...
@@ -65,7 +65,7 @@
65 65
 #       compiler:		$LTCC
66 66
 #       compiler flags:		$LTCFLAGS
67 67
 #       linker:		$LD (gnu? $with_gnu_ld)
68
-#       $progname:		(GNU libtool) 2.2.6 Debian-2.2.6a-1
68
+#       $progname:		(GNU libtool) 2.2.6 Debian-2.2.6a-4
69 69
 #       automake:		$automake_version
70 70
 #       autoconf:		$autoconf_version
71 71
 #
... ...
@@ -73,7 +73,7 @@
73 73
 
74 74
 PROGRAM=ltmain.sh
75 75
 PACKAGE=libtool
76
-VERSION="2.2.6 Debian-2.2.6a-1"
76
+VERSION="2.2.6 Debian-2.2.6a-4"
77 77
 TIMESTAMP=""
78 78
 package_revision=1.3012
79 79
 
... ...
@@ -5347,19 +5347,19 @@ func_mode_link ()
5347 5347
 	    # It is a libtool convenience library, so add in its objects.
5348 5348
 	    convenience="$convenience $ladir/$objdir/$old_library"
5349 5349
 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
5350
+	    tmp_libs=
5351
+	    for deplib in $dependency_libs; do
5352
+	      deplibs="$deplib $deplibs"
5353
+	      if $opt_duplicate_deps ; then
5354
+		case "$tmp_libs " in
5355
+		*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5356
+		esac
5357
+	      fi
5358
+	      tmp_libs="$tmp_libs $deplib"
5359
+	    done
5350 5360
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
5351 5361
 	    func_fatal_error "\`$lib' is not a convenience library"
5352 5362
 	  fi
5353
-	  tmp_libs=
5354
-	  for deplib in $dependency_libs; do
5355
-	    deplibs="$deplib $deplibs"
5356
-	    if $opt_duplicate_deps ; then
5357
-	      case "$tmp_libs " in
5358
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5359
-	      esac
5360
-	    fi
5361
-	    tmp_libs="$tmp_libs $deplib"
5362
-	  done
5363 5363
 	  continue
5364 5364
 	fi # $pass = conv
5365 5365
 
... ...
@@ -8585,6 +8585,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
8585 8585
   openbsd*)
8586 8586
     with_gnu_ld=no
8587 8587
     ;;
8588
+  linux* | k*bsd*-gnu)
8589
+    link_all_deplibs=no
8590
+    ;;
8588 8591
   esac
8589 8592
 
8590 8593
   ld_shlibs=yes
... ...
@@ -11279,7 +11282,7 @@ else
11279 11279
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11280 11280
   lt_status=$lt_dlunknown
11281 11281
   cat > conftest.$ac_ext <<_LT_EOF
11282
-#line 11282 "configure"
11282
+#line 11285 "configure"
11283 11283
 #include "confdefs.h"
11284 11284
 
11285 11285
 #if HAVE_DLFCN_H
... ...
@@ -11375,7 +11378,7 @@ else
11375 11375
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11376 11376
   lt_status=$lt_dlunknown
11377 11377
   cat > conftest.$ac_ext <<_LT_EOF
11378
-#line 11378 "configure"
11378
+#line 11381 "configure"
11379 11379
 #include "confdefs.h"
11380 11380
 
11381 11381
 #if HAVE_DLFCN_H
... ...
@@ -12526,7 +12529,7 @@ else
12526 12526
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
12527 12527
   lt_status=$lt_dlunknown
12528 12528
   cat > conftest.$ac_ext <<_LT_EOF
12529
-#line 12529 "configure"
12529
+#line 12532 "configure"
12530 12530
 #include "confdefs.h"
12531 12531
 
12532 12532
 #if HAVE_DLFCN_H
... ...
@@ -25391,7 +25394,7 @@ else
25391 25391
 fi
25392 25392
 
25393 25393
 
25394
-ac_config_files="$ac_config_files libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1"
25394
+ac_config_files="$ac_config_files libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile clambc/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1"
25395 25395
 
25396 25396
 cat >confcache <<\_ACEOF
25397 25397
 # This file is a shell script that caches the results of configure
... ...
@@ -26388,6 +26391,7 @@ do
26388 26388
     "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
26389 26389
     "unit_tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit_tests/Makefile" ;;
26390 26390
     "clamdtop/Makefile") CONFIG_FILES="$CONFIG_FILES clamdtop/Makefile" ;;
26391
+    "clambc/Makefile") CONFIG_FILES="$CONFIG_FILES clambc/Makefile" ;;
26391 26392
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
26392 26393
     "clamav-config") CONFIG_FILES="$CONFIG_FILES clamav-config" ;;
26393 26394
     "libclamav.pc") CONFIG_FILES="$CONFIG_FILES libclamav.pc" ;;
... ...
@@ -26454,7 +26458,7 @@ $debug ||
26454 26454
 if test -n "$CONFIG_FILES"; then
26455 26455
 
26456 26456
 
26457
-ac_cr=`echo X | tr X '\015'`
26457
+ac_cr='
'
26458 26458
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
26459 26459
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
26460 26460
   ac_cs_awk_cr='\\r'
... ...
@@ -27055,7 +27059,16 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
27055 27055
 
27056 27056
 
27057 27057
   case $ac_file$ac_mode in
27058
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
27058
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
27059
+# are listed without --file.  Let's play safe and only enable the eval
27060
+# if we detect the quoting.
27061
+case $CONFIG_FILES in
27062
+*\'*) eval set x "$CONFIG_FILES" ;;
27063
+*)   set x $CONFIG_FILES ;;
27064
+esac
27065
+shift
27066
+for mf
27067
+do
27059 27068
   # Strip MF so we end up with the name of the file.
27060 27069
   mf=`echo "$mf" | sed -e 's/:.*$//'`
27061 27070
   # Check whether this is an Automake generated Makefile or not.
... ...
@@ -1589,6 +1589,7 @@ etc/Makefile
1589 1589
 test/Makefile
1590 1590
 unit_tests/Makefile
1591 1591
 clamdtop/Makefile
1592
+clambc/Makefile
1592 1593
 Makefile
1593 1594
 clamav-config
1594 1595
 libclamav.pc
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -235,8 +235,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
235 235
 	@for dep in $?; do \
236 236
 	  case '$(am__configure_deps)' in \
237 237
 	    *$$dep*) \
238
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
239
-		&& exit 0; \
238
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
239
+	        && { if test -f $@; then exit 0; else break; fi; }; \
240 240
 	      exit 1;; \
241 241
 	  esac; \
242 242
 	done; \
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -241,8 +241,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
241 241
 	@for dep in $?; do \
242 242
 	  case '$(am__configure_deps)' in \
243 243
 	    *$$dep*) \
244
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
245
-		&& exit 0; \
244
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
245
+	        && { if test -f $@; then exit 0; else break; fi; }; \
246 246
 	      exit 1;; \
247 247
 	  esac; \
248 248
 	done; \
... ...
@@ -283,8 +283,8 @@ install-man1: $(man1_MANS) $(man_MANS)
283 283
 	  esac; \
284 284
 	done; \
285 285
 	for i in $$list; do \
286
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
287
-	  else file=$$i; fi; \
286
+	  if test -f $$i; then file=$$i; \
287
+	  else file=$(srcdir)/$$i; fi; \
288 288
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
289 289
 	  case "$$ext" in \
290 290
 	    1*) ;; \
... ...
@@ -328,8 +328,8 @@ install-man5: $(man5_MANS) $(man_MANS)
328 328
 	  esac; \
329 329
 	done; \
330 330
 	for i in $$list; do \
331
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
332
-	  else file=$$i; fi; \
331
+	  if test -f $$i; then file=$$i; \
332
+	  else file=$(srcdir)/$$i; fi; \
333 333
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
334 334
 	  case "$$ext" in \
335 335
 	    5*) ;; \
... ...
@@ -373,8 +373,8 @@ install-man8: $(man8_MANS) $(man_MANS)
373 373
 	  esac; \
374 374
 	done; \
375 375
 	for i in $$list; do \
376
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
377
-	  else file=$$i; fi; \
376
+	  if test -f $$i; then file=$$i; \
377
+	  else file=$(srcdir)/$$i; fi; \
378 378
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
379 379
 	  case "$$ext" in \
380 380
 	    8*) ;; \
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -234,8 +234,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
234 234
 	@for dep in $?; do \
235 235
 	  case '$(am__configure_deps)' in \
236 236
 	    *$$dep*) \
237
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
238
-		&& exit 0; \
237
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
238
+	        && { if test -f $@; then exit 0; else break; fi; }; \
239 239
 	      exit 1;; \
240 240
 	  esac; \
241 241
 	done; \
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -290,8 +290,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
290 290
 	@for dep in $?; do \
291 291
 	  case '$(am__configure_deps)' in \
292 292
 	    *$$dep*) \
293
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
294
-		&& exit 0; \
293
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
294
+	        && { if test -f $@; then exit 0; else break; fi; }; \
295 295
 	      exit 1;; \
296 296
 	  esac; \
297 297
 	done; \
... ...
@@ -499,7 +499,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
499 499
 	unique=`for i in $$list; do \
500 500
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
501 501
 	  done | \
502
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
502
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
503 503
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
504 504
 	mkid -fID $$unique
505 505
 tags: TAGS
... ...
@@ -285,7 +285,9 @@ libclamav_la_SOURCES = \
285 285
 	default.h\
286 286
 	sha256.c\
287 287
 	sha256.h\
288
-	bignum.h
288
+	bignum.h\
289
+	bytecode.c\
290
+	bytecode.h
289 291
 
290 292
 if !LINK_TOMMATH
291 293
 libclamav_la_SOURCES += bignum.c \
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -121,7 +121,7 @@ am__libclamav_la_SOURCES_DIST = clamav.h matcher-ac.c matcher-ac.h \
121 121
 	textnorm.h dlp.c dlp.h jsparse/js-norm.c jsparse/js-norm.h \
122 122
 	jsparse/lexglobal.h jsparse/textbuf.h uniq.c uniq.h version.c \
123 123
 	version.h mpool.c mpool.h default.h sha256.c sha256.h bignum.h \
124
-	bignum.c bignum_class.h
124
+	bytecode.c bytecode.h bignum.c bignum_class.h
125 125
 @LINK_TOMMATH_FALSE@am__objects_1 = libclamav_la-bignum.lo
126 126
 am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
127 127
 	libclamav_la-matcher-bm.lo libclamav_la-matcher.lo \
... ...
@@ -158,7 +158,8 @@ am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
158 158
 	libclamav_la-textnorm.lo libclamav_la-dlp.lo \
159 159
 	libclamav_la-js-norm.lo libclamav_la-uniq.lo \
160 160
 	libclamav_la-version.lo libclamav_la-mpool.lo \
161
-	libclamav_la-sha256.lo $(am__objects_1)
161
+	libclamav_la-sha256.lo libclamav_la-bytecode.lo \
162
+	$(am__objects_1)
162 163
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
163 164
 libclamav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
164 165
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libclamav_la_CFLAGS) \
... ...
@@ -528,7 +529,7 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \
528 528
 	explode.h textnorm.c textnorm.h dlp.c dlp.h jsparse/js-norm.c \
529 529
 	jsparse/js-norm.h jsparse/lexglobal.h jsparse/textbuf.h uniq.c \
530 530
 	uniq.h version.c version.h mpool.c mpool.h default.h sha256.c \
531
-	sha256.h bignum.h $(am__append_7)
531
+	sha256.h bignum.h bytecode.c bytecode.h $(am__append_7)
532 532
 noinst_LTLIBRARIES = libclamav_internal_utils.la libclamav_internal_utils_nothreads.la
533 533
 COMMON_CLEANFILES = version.h version.h.tmp *.gcda *.gcno lzma/*.gcda lzma/*.gcno
534 534
 @MAINTAINER_MODE_TRUE@BUILT_SOURCES = jsparse/generated/operators.h jsparse/generated/keywords.h jsparse-keywords.gperf
... ...
@@ -544,8 +545,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
544 544
 	@for dep in $?; do \
545 545
 	  case '$(am__configure_deps)' in \
546 546
 	    *$$dep*) \
547
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
548
-		&& exit 0; \
547
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
548
+	        && { if test -f $@; then exit 0; else break; fi; }; \
549 549
 	      exit 1;; \
550 550
 	  esac; \
551 551
 	done; \
... ...
@@ -643,6 +644,7 @@ distclean-compile:
643 643
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-bignum.Plo@am__quote@
644 644
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-binhex.Plo@am__quote@
645 645
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-blob.Plo@am__quote@
646
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-bytecode.Plo@am__quote@
646 647
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-bzlib.Plo@am__quote@
647 648
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-cab.Plo@am__quote@
648 649
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-chmunpack.Plo@am__quote@
... ...
@@ -1238,6 +1240,13 @@ libclamav_la-sha256.lo: sha256.c
1238 1238
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1239 1239
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-sha256.lo `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c
1240 1240
 
1241
+libclamav_la-bytecode.lo: bytecode.c
1242
+@am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-bytecode.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bytecode.Tpo -c -o libclamav_la-bytecode.lo `test -f 'bytecode.c' || echo '$(srcdir)/'`bytecode.c
1243
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libclamav_la-bytecode.Tpo $(DEPDIR)/libclamav_la-bytecode.Plo
1244
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='bytecode.c' object='libclamav_la-bytecode.lo' libtool=yes @AMDEPBACKSLASH@
1245
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1246
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-bytecode.lo `test -f 'bytecode.c' || echo '$(srcdir)/'`bytecode.c
1247
+
1241 1248
 libclamav_la-bignum.lo: bignum.c
1242 1249
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-bignum.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bignum.Tpo -c -o libclamav_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c
1243 1250
 @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libclamav_la-bignum.Tpo $(DEPDIR)/libclamav_la-bignum.Plo
... ...
@@ -1518,7 +1527,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
1518 1518
 	unique=`for i in $$list; do \
1519 1519
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
1520 1520
 	  done | \
1521
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
1521
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
1522 1522
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
1523 1523
 	mkid -fID $$unique
1524 1524
 tags: TAGS
1525 1525
new file mode 100644
... ...
@@ -0,0 +1,474 @@
0
+/*
1
+ *  Load, verify and execute ClamAV bytecode.
2
+ *
3
+ *  Copyright (C) 2009 Sourcefire, Inc.
4
+ *
5
+ *  Authors: Török Edvin
6
+ *
7
+ *  This program is free software; you can redistribute it and/or modify
8
+ *  it under the terms of the GNU General Public License version 2 as
9
+ *  published by the Free Software Foundation.
10
+ *
11
+ *  This program is distributed in the hope that it will be useful,
12
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ *  GNU General Public License for more details.
15
+ *
16
+ *  You should have received a copy of the GNU General Public License
17
+ *  along with this program; if not, write to the Free Software
18
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ *  MA 02110-1301, USA.
20
+ */
21
+
22
+#if HAVE_CONFIG_H
23
+#include "clamav-config.h"
24
+#endif
25
+
26
+#include "clamav.h"
27
+#include "others.h"
28
+#include "bytecode.h"
29
+#include "readdb.h"
30
+#include <string.h>
31
+
32
+struct cli_bc_varop {
33
+    uint8_t numOps;
34
+    uint16_t* ops;
35
+};
36
+
37
+struct cli_bc_inst {
38
+    enum bc_opcode opcode;
39
+    uint16_t type;
40
+    union {
41
+	uint16_t unaryop;
42
+	uint16_t binop[2];
43
+	struct cli_bc_varop ops;
44
+    } u;
45
+};
46
+
47
+struct cli_bc_bb {
48
+    unsigned numInsts;
49
+    struct cli_bc_inst *insts;
50
+};
51
+
52
+struct cli_bc_func {
53
+    uint8_t numArgs;
54
+    uint16_t numLocals;
55
+    uint16_t numBB;
56
+    uint16_t *types;
57
+    struct cli_bc_bb *BB;
58
+};
59
+
60
+struct cli_bc_ctx {
61
+    unsigned dummy;
62
+};
63
+
64
+struct cli_bc_ctx *cli_bytecode_alloc_context(void)
65
+{
66
+    struct cli_bc_ctx *ctx = cli_malloc(sizeof(*ctx));
67
+    return ctx;
68
+}
69
+
70
+void cli_bytecode_destroy_context(struct cli_bc_ctx *ctx)
71
+{
72
+   free(ctx);
73
+}
74
+
75
+
76
+static inline uint64_t readNumber(const unsigned char *p, unsigned *off, unsigned len, char *ok)
77
+{
78
+    uint64_t n=0;
79
+    unsigned i, newoff, lim, p0 = p[*off], shift=0;
80
+
81
+    lim = p0 - 0x60;
82
+    if (lim > 0x10) {
83
+	cli_errmsg("Invalid number type: %c\n", p0);
84
+	*ok = 0;
85
+	return 0;
86
+    }
87
+    newoff = *off +lim+1;
88
+    if (newoff > len) {
89
+	cli_errmsg("End of line encountered while reading number\n");
90
+	*ok = 0;
91
+	return 0;
92
+    }
93
+
94
+    if (p0 == 0x60) {
95
+	*off = newoff;
96
+	return 0;
97
+    }
98
+
99
+    for (i=*off+1;i < newoff; i++) {
100
+	uint64_t v = p[i];
101
+	if (UNLIKELY((v&0xf0) != 0x60)) {
102
+	    cli_errmsg("Invalid number part: %c\n", v);
103
+	    *ok = 0;
104
+	    return 0;
105
+	}
106
+	v &= 0xf;
107
+	v <<= shift;
108
+	n |= v;
109
+	shift += 4;
110
+    }
111
+    *off = newoff;
112
+    return n;
113
+}
114
+
115
+static inline uint64_t readOperand(unsigned char *p, unsigned *off, unsigned len, char *ok)
116
+{
117
+    if ((p[*off]&0xf0) == 0x40) {
118
+	p[*off] |= 0x20;
119
+	/* TODO: constant int operand needs to be added to constant table*/
120
+	return readNumber(p, off, len, ok);
121
+    }
122
+    return readNumber(p, off, len, ok);
123
+}
124
+static inline unsigned readFixedNumber(const unsigned char *p, unsigned *off,
125
+				       unsigned len, char *ok, unsigned width)
126
+{
127
+    unsigned i, n=0, shift=0;
128
+    unsigned newoff = *off + width;
129
+    if (newoff > len) {
130
+	cli_errmsg("Newline encountered while reading number\n");
131
+	*ok = 0;
132
+	return 0;
133
+    }
134
+    for (i=*off;i<newoff;i++) {
135
+	unsigned v = p[i];
136
+	if (UNLIKELY((v&0xf0) != 0x60)) {
137
+	    cli_errmsg("Invalid number part: %c\n", v);
138
+	    *ok = 0;
139
+	    return 0;
140
+	}
141
+	v &= 0xf;
142
+	v <<= shift;
143
+	n |= v;
144
+	shift += 4;
145
+    }
146
+    *off = newoff;
147
+    return n;
148
+}
149
+
150
+static inline char *readData(const unsigned char *p, unsigned *off, unsigned len, char *ok)
151
+{
152
+    unsigned char *dat, *q;
153
+    unsigned l, newoff, i;
154
+    if (p[*off] != '|') {
155
+	cli_errmsg("Data start marker missing: %c\n", p[*off]);
156
+	*ok = 0;
157
+	return NULL;
158
+    }
159
+    (*off)++;
160
+    l = readNumber(p, off, len, ok);
161
+    if (!l)
162
+	return NULL;
163
+    newoff = *off + l;
164
+    if (newoff > len) {
165
+	cli_errmsg("Line ended while reading data\n");
166
+	*ok = 0;
167
+	return 0;
168
+    }
169
+    dat = cli_malloc(l);
170
+    if (!dat) {
171
+	cli_errmsg("Cannot allocate memory for data\n");
172
+	*ok = 0;
173
+	return NULL;
174
+    }
175
+    q = dat;
176
+    for (i=*off;i<newoff;i++) {
177
+	const unsigned char v = p[i];
178
+	if (UNLIKELY((v&0xf0) != 0x60)) {
179
+	    cli_errmsg("Invalid data part: %c\n", v);
180
+	    *ok = 0;
181
+	    return 0;
182
+	}
183
+	*q++ = v;
184
+    }
185
+    *off = newoff;
186
+    return dat;
187
+}
188
+
189
+static int parseHeader(struct cli_bc *bc, char *buffer)
190
+{
191
+    uint64_t magic1;
192
+    unsigned magic2;
193
+    char ok = 1;
194
+    unsigned offset, len, flevel;
195
+    if (strncmp(buffer, BC_HEADER, sizeof(BC_HEADER)-1)) {
196
+	cli_errmsg("Missing file magic in bytecode");
197
+	return CL_EMALFDB;
198
+    }
199
+    offset = sizeof(BC_HEADER)-1;
200
+    len = strlen(buffer);
201
+    flevel = readNumber(buffer, &offset, len, &ok);
202
+    if (!ok) {
203
+	cli_errmsg("Unable to parse functionality level in bytecode header\n");
204
+	return CL_EMALFDB;
205
+    }
206
+    if (flevel > BC_FUNC_LEVEL) {
207
+	cli_dbgmsg("Skipping bytecode with functionality level: %u\n", flevel);
208
+	return CL_BREAK;
209
+    }
210
+    // Optimistic parsing, check for error only at the end.
211
+    bc->verifier = readNumber(buffer, &offset, len, &ok);
212
+    bc->sigmaker = readData(buffer, &offset, len, &ok);
213
+    bc->id = readNumber(buffer, &offset, len, &ok);
214
+    bc->metadata.maxStack = readNumber(buffer, &offset, len, &ok);
215
+    bc->metadata.maxMem = readNumber(buffer, &offset, len, &ok);
216
+    bc->metadata.maxTime = readNumber(buffer, &offset, len, &ok);
217
+    bc->metadata.targetExclude = readData(buffer, &offset, len, &ok);
218
+    bc->num_func = readNumber(buffer, &offset, len, &ok);
219
+    if (!ok) {
220
+	cli_errmsg("Invalid bytecode header\n", offset);
221
+	return CL_EMALFDB;
222
+    }
223
+    magic1 = readNumber(buffer, &offset, len, &ok);
224
+    magic2 = readFixedNumber(buffer, &offset, len, &ok, 2);
225
+    if (!ok || magic1 != 0x53e5493e9f3d1c30ull || magic2 != 42) {
226
+      unsigned m0 = magic1 >> 32;
227
+      unsigned m1 = magic1;
228
+      cli_errmsg("Magic numbers don't match: %lx%lx, %u\n", m0, m1, magic2);
229
+      return CL_EMALFDB;
230
+    }
231
+    if (offset != len) {
232
+	cli_errmsg("Trailing garbage in bytecode header: %d extra bytes\n",
233
+		   len-offset);
234
+	return CL_EMALFDB;
235
+    }
236
+
237
+    bc->funcs = cli_calloc(bc->num_func, sizeof(*bc->funcs));
238
+    if (!bc->funcs) {
239
+	cli_errmsg("Out of memory allocating %u functions\n", bc->num_func);
240
+	return CL_EMEM;
241
+    }
242
+    return CL_SUCCESS;
243
+}
244
+
245
+static int parseFunctionHeader(struct cli_bc *bc, unsigned fn, char *buffer)
246
+{
247
+    char ok=1;
248
+    unsigned offset, len, all_locals=0, i;
249
+    struct cli_bc_func *func;
250
+
251
+    if (fn >= bc->num_func) {
252
+	cli_errmsg("Found more functions than declared: %u >= %u\n", fn,
253
+		   bc->num_func);
254
+	return CL_EMALFDB;
255
+    }
256
+    func = &bc->funcs[fn];
257
+    len = strlen(buffer);
258
+
259
+    if (buffer[0] != 'A') {
260
+	cli_errmsg("Invalid function arguments header: %c\n", buffer[0]);
261
+	return CL_EMALFDB;
262
+    }
263
+    offset = 1;
264
+    func->numArgs = readFixedNumber(buffer, &offset, len, &ok, 1);
265
+    if (buffer[offset] != 'L') {
266
+	cli_errmsg("Invalid function locals header: %c\n", buffer[offset]);
267
+	return CL_EMALFDB;
268
+    }
269
+    offset++;
270
+    func->numLocals = readNumber(buffer, &offset, len, &ok);
271
+    if (!ok) {
272
+	cli_errmsg("Invalid number of arguments/locals\n");
273
+	return CL_EMALFDB;
274
+    }
275
+    all_locals = func->numArgs + func->numLocals;
276
+    func->types = cli_calloc(all_locals, sizeof(*func->types));
277
+    if (!func->types) {
278
+	cli_errmsg("Out of memory allocating function arguments\n");
279
+	return CL_EMEM;
280
+    }
281
+    for (i=0;i<all_locals;i++) {
282
+	func->types[i] = readNumber(buffer, &offset, len, &ok);
283
+    }
284
+    if (!ok) {
285
+	cli_errmsg("Invalid local types\n");
286
+	return CL_EMALFDB;
287
+    }
288
+    if (buffer[offset] != 'F') {
289
+	cli_errmsg("Invalid function body header: %c\n", buffer[offset]);
290
+	return CL_EMALFDB;
291
+    }
292
+    offset++;
293
+    func->numBB = readNumber(buffer, &offset, len, &ok);
294
+    if (!ok) {
295
+	cli_errmsg("Invalid basic block count\n");
296
+	return CL_EMALFDB;
297
+    }
298
+    func->BB = cli_calloc(func->numBB, sizeof(*func->BB));
299
+    if (!func->BB) {
300
+	cli_errmsg("Out of memory allocating basic blocks\n");
301
+	return CL_EMEM;
302
+    }
303
+    return CL_SUCCESS;
304
+}
305
+
306
+static int parseBB(struct cli_bc *bc, unsigned func, unsigned bb, char *buffer)
307
+{
308
+    char ok=1;
309
+    unsigned offset, len, last = 0;
310
+    struct cli_bc_bb *BB;
311
+    struct cli_bc_inst inst;
312
+
313
+    if (bb >= bc->funcs[func].numBB) {
314
+	cli_errmsg("Found too many basic blocks\n");
315
+	return CL_EMALFDB;
316
+    }
317
+
318
+    BB = &bc->funcs[func].BB[bb];
319
+    len = strlen(buffer);
320
+    if (buffer[0] != 'B') {
321
+	cli_errmsg("Invalid basic block header: %c\n", buffer[0]);
322
+	return CL_EMALFDB;
323
+    }
324
+    offset = 1;
325
+    BB->numInsts = 0;
326
+    BB->insts = NULL;
327
+    while (!last) {
328
+	unsigned numOp, i;
329
+	if (buffer[offset] == 'T') {
330
+	    last = 1;
331
+	    offset++;
332
+	    /* terminators are void */
333
+	    inst.type = 0;
334
+	} else {
335
+	    inst.type = readNumber(buffer, &offset, len, &ok);
336
+	}
337
+	inst.opcode = readFixedNumber(buffer, &offset, len, &ok, 2);
338
+	if (!ok) {
339
+	    cli_errmsg("Invalid type or operand\n");
340
+	    return CL_EMALFDB;
341
+	}
342
+	if (inst.opcode >= OP_INVALID) {
343
+	    cli_errmsg("Invalid opcode: %u\n", inst.opcode);
344
+	    return CL_EMALFDB;
345
+	}
346
+	numOp = operand_counts[inst.opcode];
347
+	switch (numOp) {
348
+	    case 1:
349
+		inst.u.unaryop = readOperand(buffer, &offset, len, &ok);
350
+		break;
351
+	    case 2:
352
+		inst.u.binop[0] = readOperand(buffer, &offset, len, &ok);
353
+		inst.u.binop[1] = readOperand(buffer, &offset, len, &ok);
354
+		break;
355
+	    default:
356
+		inst.u.ops.numOps = numOp;
357
+		inst.u.ops.ops = cli_calloc(numOp, sizeof(*inst.u.ops.ops));
358
+		if (!inst.u.ops.ops) {
359
+		    cli_errmsg("Out of memory allocating operands\n");
360
+		    return CL_EMALFDB;
361
+		}
362
+		for (i=0;i<numOp;i++) {
363
+		    inst.u.ops.ops[i] = readOperand(buffer, &offset, len, &ok);
364
+		}
365
+		break;
366
+	}
367
+	if (!ok) {
368
+	    cli_errmsg("Invalid instructions or operands\n");
369
+	    return CL_EMALFDB;
370
+	}
371
+	BB->insts = cli_realloc2(BB->insts, (++BB->numInsts)*sizeof(*BB->insts));
372
+	if (!BB->insts) {
373
+	    cli_errmsg("Unable to allocate memory for instruction %u\n", 
374
+		       BB->numInsts);
375
+	    return CL_EMEM;
376
+	}
377
+	BB->insts[BB->numInsts-1] = inst;
378
+    }
379
+    if (bb == bc->funcs[func].numBB-1) {
380
+	if (buffer[offset] != 'E') {
381
+	    cli_errmsg("Missing basicblock terminator, got: %c\n", buffer[offset]);
382
+	    return CL_EMALFDB;
383
+	}
384
+	offset++;
385
+    }
386
+    cli_dbgmsg("Parsed %d instructions\n", BB->numInsts);
387
+    if (offset != len) {
388
+	cli_errmsg("Trailing garbage in basicblock: %d extra bytes\n",
389
+		   len-offset);
390
+	return CL_EMALFDB;
391
+    }
392
+    return CL_SUCCESS;
393
+}
394
+
395
+enum parse_state {
396
+    PARSE_BC_HEADER=0,
397
+    PARSE_FUNC_HEADER,
398
+    PARSE_BB
399
+};
400
+
401
+int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio)
402
+{
403
+    unsigned row = 0, current_func = 0, bb=0;
404
+    char buffer[FILEBUFF];
405
+    enum parse_state state = PARSE_BC_HEADER;
406
+
407
+    if (!f && !dbio) {
408
+	cli_errmsg("Unable to load bytecode (null file)\n");
409
+	return CL_ENULLARG;
410
+    }
411
+
412
+    while (cli_dbgets(buffer, FILEBUFF, f, dbio)) {
413
+	int rc;
414
+	cli_chomp(buffer);
415
+	switch (state) {
416
+	    case PARSE_BC_HEADER:
417
+		rc = parseHeader(bc, buffer);
418
+		if (rc == CL_BREAK) /* skip */
419
+		    return CL_SUCCESS;
420
+		if (rc != CL_SUCCESS)
421
+		    return rc;
422
+		state = PARSE_FUNC_HEADER;
423
+		break;
424
+	    case PARSE_FUNC_HEADER:
425
+		rc = parseFunctionHeader(bc, current_func, buffer);
426
+		if (rc != CL_SUCCESS)
427
+		    return rc;
428
+		bb = 0;
429
+		state = PARSE_BB;
430
+		break;
431
+	    case PARSE_BB:
432
+		rc = parseBB(bc, current_func, bb++, buffer);
433
+		if (rc != CL_SUCCESS)
434
+		    return rc;
435
+		if (bb >= bc->funcs[current_func].numBB) {
436
+		    state = PARSE_FUNC_HEADER;
437
+		    current_func++;
438
+		}
439
+		break;
440
+	}
441
+    }
442
+    cli_dbgmsg("Parsed %d functions\n", current_func);
443
+    return CL_SUCCESS;
444
+}
445
+
446
+void cli_bytecode_run(struct cli_bc *bc, struct cli_bc_ctx *ctx)
447
+{
448
+}
449
+
450
+void cli_bytecode_destroy(struct cli_bc *bc)
451
+{
452
+    unsigned i, j, k;
453
+    free(bc->sigmaker);
454
+    free(bc->metadata.targetExclude);
455
+
456
+    for (i=0;i<bc->num_func;i++) {
457
+	struct cli_bc_func *f = &bc->funcs[i];
458
+	free(f->types);
459
+
460
+	for (j=0;j<f->numBB;j++) {
461
+	    struct cli_bc_bb *BB = &f->BB[j];
462
+	    for(k=0;k<BB->numInsts;k++) {
463
+		struct cli_bc_inst *i = &BB->insts[k];
464
+		if (operand_counts[i->opcode] > 2)
465
+		    free(i->u.ops.ops);
466
+	    }
467
+	    free(BB->insts);
468
+	}
469
+	free(f->BB);
470
+    }
471
+    free(bc->funcs);
472
+}
473
+
0 474
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+/*
1
+ *  Load, verify and execute ClamAV bytecode.
2
+ *
3
+ *  Copyright (C) 2009 Sourcefire, Inc.
4
+ *
5
+ *  Authors: Török Edvin
6
+ *
7
+ *  This program is free software; you can redistribute it and/or modify
8
+ *  it under the terms of the GNU General Public License version 2 as
9
+ *  published by the Free Software Foundation.
10
+ *
11
+ *  This program is distributed in the hope that it will be useful,
12
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ *  GNU General Public License for more details.
15
+ *
16
+ *  You should have received a copy of the GNU General Public License
17
+ *  along with this program; if not, write to the Free Software
18
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ *  MA 02110-1301, USA.
20
+ */
21
+#ifndef BYTECODE_H
22
+#define BYTECODE_H
23
+#include <stdio.h>
24
+#include "clambc.h"
25
+struct cli_dbio;
26
+struct cli_bc_ctx;
27
+struct cli_bc_func;
28
+
29
+struct cli_bc {
30
+  unsigned verifier;
31
+  char *sigmaker;
32
+  unsigned id;
33
+  struct bytecode_metadata metadata;
34
+  unsigned num_func;
35
+  struct cli_bc_func *funcs;
36
+};
37
+
38
+struct cli_bc_ctx *cli_bytecode_alloc_context(void);
39
+void cli_bytecode_destroy_context(struct cli_bc_ctx *ctx);
40
+
41
+int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio);
42
+void cli_bytecode_run(struct cli_bc *bc, struct cli_bc_ctx *ctx);
43
+void cli_bytecode_destroy(struct cli_bc *bc);
44
+
45
+#endif
0 46
new file mode 100644
... ...
@@ -0,0 +1,81 @@
0
+/*
1
+ *  ClamAV bytecode definitions.
2
+ *
3
+ *  Copyright (C) 2009 Sourcefire, Inc.
4
+ *
5
+ *  Authors: Török Edvin
6
+ *
7
+ *  This program is free software; you can redistribute it and/or modify
8
+ *  it under the terms of the GNU General Public License version 2 as
9
+ *  published by the Free Software Foundation.
10
+ *
11
+ *  This program is distributed in the hope that it will be useful,
12
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ *  GNU General Public License for more details.
15
+ *
16
+ *  You should have received a copy of the GNU General Public License
17
+ *  along with this program; if not, write to the Free Software
18
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ *  MA 02110-1301, USA.
20
+ */
21
+#ifndef CLAMBC_H
22
+#define CLAMBC_H
23
+
24
+struct bytecode_metadata {
25
+  unsigned long maxStack, maxMem;
26
+  unsigned long maxTime;
27
+  const char *targetExclude;
28
+};
29
+
30
+#define BC_FUNC_LEVEL 1
31
+#define BC_HEADER "ClamBC"
32
+
33
+enum bc_opcode {
34
+  OP_ADD=1,
35
+  OP_SUB,
36
+  OP_MUL,
37
+  OP_UDIV,
38
+  OP_SDIV,
39
+  OP_UREM,
40
+  OP_SREM,
41
+  OP_SHL,
42
+  OP_LSHR,
43
+  OP_ASHR,
44
+  OP_AND,
45
+  OP_OR,
46
+  OP_XOR,
47
+
48
+  OP_TRUNC,
49
+  OP_SEXT,
50
+  OP_ZEXT,
51
+  OP_RET,
52
+
53
+  OP_ICMP_EQ,
54
+  OP_ICMP_NE,
55
+  OP_ICMP_UGT,
56
+  OP_ICMP_UGE,
57
+  OP_ICMP_ULT,
58
+  OP_ICMP_ULE,
59
+  OP_ICMP_SGT,
60
+  OP_ICMP_SGE,
61
+  OP_ICMP_SLE,
62
+  OP_ICMP_SLT,
63
+  OP_SELECT,
64
+  OP_INVALID /* last */
65
+};
66
+
67
+static const unsigned char operand_counts[] = {
68
+  0,
69
+  /* ADD -> XOR */
70
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
71
+  /* TRUNC -> ZEXT */
72
+  2, 2, 2,
73
+  /* RET */
74
+  1,
75
+  /* ICMP */
76
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
77
+  /* SELECT */
78
+  3
79
+};
80
+#endif
... ...
@@ -144,6 +144,11 @@ CLAMAV_PRIVATE {
144 144
     messageDestroy;
145 145
     base64Flush;
146 146
     have_rar;
147
+    cli_bytecode_load;
148
+    cli_bytecode_run;
149
+    cli_bytecode_destroy;
150
+    cli_bytecode_alloc_context;
151
+    cli_bytecode_destroy_context;
147 152
   local:
148 153
     *;
149 154
 };
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -260,8 +260,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
260 260
 	@for dep in $?; do \
261 261
 	  case '$(am__configure_deps)' in \
262 262
 	    *$$dep*) \
263
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
264
-		&& exit 0; \
263
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
264
+	        && { if test -f $@; then exit 0; else break; fi; }; \
265 265
 	      exit 1;; \
266 266
 	  esac; \
267 267
 	done; \
... ...
@@ -337,7 +337,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
337 337
 	unique=`for i in $$list; do \
338 338
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
339 339
 	  done | \
340
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
340
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
341 341
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
342 342
 	mkid -fID $$unique
343 343
 tags: TAGS
... ...
@@ -28,9 +28,6 @@
28 28
 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 29
 #####
30 30
 
31
-# ClamAV: filter -Werror here
32
-CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Werror[^=-]//'`
33
-
34 31
 ACLOCAL_AMFLAGS = -I m4
35 32
 AUTOMAKE_OPTIONS = foreign
36 33
 AM_CPPFLAGS =
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -163,9 +163,7 @@ AWK = @AWK@
163 163
 CC = @CC@
164 164
 CCDEPMODE = @CCDEPMODE@
165 165
 CFGDIR = @CFGDIR@
166
-
167
-# ClamAV: filter -Werror here
168
-CFLAGS = `echo "@CFLAGS@" | sed -e 's/-Werror[^=-]//'`
166
+CFLAGS = @CFLAGS@
169 167
 CHECK_CPPFLAGS = @CHECK_CPPFLAGS@
170 168
 CHECK_LIBS = @CHECK_LIBS@
171 169
 CLAMAVGROUP = @CLAMAVGROUP@
... ...
@@ -383,8 +381,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
383 383
 	@for dep in $?; do \
384 384
 	  case '$(am__configure_deps)' in \
385 385
 	    *$$dep*) \
386
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
387
-		&& exit 0; \
386
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
387
+	        && { if test -f $@; then exit 0; else break; fi; }; \
388 388
 	      exit 1;; \
389 389
 	  esac; \
390 390
 	done; \
... ...
@@ -678,7 +676,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
678 678
 	unique=`for i in $$list; do \
679 679
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
680 680
 	  done | \
681
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
681
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
682 682
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
683 683
 	mkid -fID $$unique
684 684
 tags: TAGS
... ...
@@ -1614,6 +1614,9 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
1614 1614
 {
1615 1615
   lt_dlhandle	handle	= 0;
1616 1616
   int		errors	= 0;
1617
+  const char *	saved_error	= 0;
1618
+
1619
+  LT__GETERROR (saved_error);
1617 1620
 
1618 1621
   /* Can't have symbols hidden and visible at the same time!  */
1619 1622
   if (advise && advise->is_symlocal && advise->is_symglobal)
... ...
@@ -1650,6 +1653,7 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
1650 1650
 
1651 1651
 #if defined(LT_MODULE_EXT)
1652 1652
       /* Try appending SHLIB_EXT.   */
1653
+      LT__SETERRORSTR (saved_error);
1653 1654
       errors = try_dlopen (&handle, filename, shlib_ext, advise);
1654 1655
 
1655 1656
       /* As before, if the file was found but loading failed, return now
... ...
@@ -4261,6 +4261,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
4261 4261
   openbsd*)
4262 4262
     with_gnu_ld=no
4263 4263
     ;;
4264
+  linux* | k*bsd*-gnu)
4265
+    _LT_TAGVAR(link_all_deplibs, $1)=no
4266
+    ;;
4264 4267
   esac
4265 4268
 
4266 4269
   _LT_TAGVAR(ld_shlibs, $1)=yes
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -276,8 +276,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
276 276
 	@for dep in $?; do \
277 277
 	  case '$(am__configure_deps)' in \
278 278
 	    *$$dep*) \
279
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
280
-		&& exit 0; \
279
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
280
+	        && { if test -f $@; then exit 0; else break; fi; }; \
281 281
 	      exit 1;; \
282 282
 	  esac; \
283 283
 	done; \
... ...
@@ -480,7 +480,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
480 480
 	unique=`for i in $$list; do \
481 481
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
482 482
 	  done | \
483
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
483
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
484 484
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
485 485
 	mkid -fID $$unique
486 486
 tags: TAGS
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -224,8 +224,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
224 224
 	@for dep in $?; do \
225 225
 	  case '$(am__configure_deps)' in \
226 226
 	    *$$dep*) \
227
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
228
-		&& exit 0; \
227
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
228
+	        && { if test -f $@; then exit 0; else break; fi; }; \
229 229
 	      exit 1;; \
230 230
 	  esac; \
231 231
 	done; \
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -289,8 +289,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
289 289
 	@for dep in $?; do \
290 290
 	  case '$(am__configure_deps)' in \
291 291
 	    *$$dep*) \
292
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
293
-		&& exit 0; \
292
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
293
+	        && { if test -f $@; then exit 0; else break; fi; }; \
294 294
 	      exit 1;; \
295 295
 	  esac; \
296 296
 	done; \
... ...
@@ -532,7 +532,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
532 532
 	unique=`for i in $$list; do \
533 533
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
534 534
 	  done | \
535
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
535
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
536 536
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
537 537
 	mkid -fID $$unique
538 538
 tags: TAGS
... ...
@@ -575,7 +575,7 @@ distclean-tags:
575 575
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
576 576
 
577 577
 check-TESTS: $(TESTS)
578
-	@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[	 ]'; \
578
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
579 579
 	srcdir=$(srcdir); export srcdir; \
580 580
 	list=' $(TESTS) '; \
581 581
 	if test -n "$$list"; then \
... ...
@@ -586,7 +586,7 @@ check-TESTS: $(TESTS)
586 586
 	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
587 587
 	      all=`expr $$all + 1`; \
588 588
 	      case " $(XFAIL_TESTS) " in \
589
-	      *$$ws$$tst$$ws*) \
589
+	      *[\ \	]$$tst[\ \	]*) \
590 590
 		xpass=`expr $$xpass + 1`; \
591 591
 		failed=`expr $$failed + 1`; \
592 592
 		echo "XPASS: $$tst"; \
... ...
@@ -598,7 +598,7 @@ check-TESTS: $(TESTS)
598 598
 	    elif test $$? -ne 77; then \
599 599
 	      all=`expr $$all + 1`; \
600 600
 	      case " $(XFAIL_TESTS) " in \
601
-	      *$$ws$$tst$$ws*) \
601
+	      *[\ \	]$$tst[\ \	]*) \
602 602
 		xfail=`expr $$xfail + 1`; \
603 603
 		echo "XFAIL: $$tst"; \
604 604
 	      ;; \
... ...
@@ -612,23 +612,36 @@ check-TESTS: $(TESTS)
612 612
 	      echo "SKIP: $$tst"; \
613 613
 	    fi; \
614 614
 	  done; \
615
+	  if test "$$all" -eq 1; then \
616
+	    tests="test"; \
617
+	    All=""; \
618
+	  else \
619
+	    tests="tests"; \
620
+	    All="All "; \
621
+	  fi; \
615 622
 	  if test "$$failed" -eq 0; then \
616 623
 	    if test "$$xfail" -eq 0; then \
617
-	      banner="All $$all tests passed"; \
624
+	      banner="$$All$$all $$tests passed"; \
618 625
 	    else \
619
-	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
626
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
627
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
620 628
 	    fi; \
621 629
 	  else \
622 630
 	    if test "$$xpass" -eq 0; then \
623
-	      banner="$$failed of $$all tests failed"; \
631
+	      banner="$$failed of $$all $$tests failed"; \
624 632
 	    else \
625
-	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
633
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
634
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
626 635
 	    fi; \
627 636
 	  fi; \
628 637
 	  dashes="$$banner"; \
629 638
 	  skipped=""; \
630 639
 	  if test "$$skip" -ne 0; then \
631
-	    skipped="($$skip tests were not run)"; \
640
+	    if test "$$skip" -eq 1; then \
641
+	      skipped="($$skip test was not run)"; \
642
+	    else \
643
+	      skipped="($$skip tests were not run)"; \
644
+	    fi; \
632 645
 	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
633 646
 	      dashes="$$skipped"; \
634 647
 	  fi; \