Browse code

Merge remote-tracking branch 'origin/master' into swebb/clamyara

Conflicts:
libclamav/Makefile.am
libclamav/Makefile.in

Shawn Webb authored on 2014/11/11 01:34:54
Showing 141 changed files
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -35,6 +34,51 @@
35 35
 
36 36
 
37 37
 VPATH = @srcdir@
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
39
+am__make_running_with_option = \
40
+  case $${target_option-} in \
41
+      ?) ;; \
42
+      *) echo "am__make_running_with_option: internal error: invalid" \
43
+              "target option '$${target_option-}' specified" >&2; \
44
+         exit 1;; \
45
+  esac; \
46
+  has_opt=no; \
47
+  sane_makeflags=$$MAKEFLAGS; \
48
+  if $(am__is_gnu_make); then \
49
+    sane_makeflags=$$MFLAGS; \
50
+  else \
51
+    case $$MAKEFLAGS in \
52
+      *\\[\ \	]*) \
53
+        bs=\\; \
54
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
55
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
56
+    esac; \
57
+  fi; \
58
+  skip_next=no; \
59
+  strip_trailopt () \
60
+  { \
61
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
62
+  }; \
63
+  for flg in $$sane_makeflags; do \
64
+    test $$skip_next = yes && { skip_next=no; continue; }; \
65
+    case $$flg in \
66
+      *=*|--*) continue;; \
67
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
68
+      -*I?*) strip_trailopt 'I';; \
69
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
70
+      -*O?*) strip_trailopt 'O';; \
71
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
72
+      -*l?*) strip_trailopt 'l';; \
73
+      -[dEDm]) skip_next=yes;; \
74
+      -[JT]) skip_next=yes;; \
75
+    esac; \
76
+    case $$flg in \
77
+      *$$target_option*) has_opt=yes; break;; \
78
+    esac; \
79
+  done; \
80
+  test $$has_opt = yes
81
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
82
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
38 83
 pkgdatadir = $(datadir)/@PACKAGE@
39 84
 pkgincludedir = $(includedir)/@PACKAGE@
40 85
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -56,10 +100,10 @@ host_triplet = @host@
56 56
 target_triplet = @target@
57 57
 @ENABLE_CLAMSUBMIT_TRUE@am__append_1 = clamsubmit
58 58
 subdir = .
59
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
60
-	$(srcdir)/Makefile.in $(srcdir)/clamav-config.h.in \
61
-	$(srcdir)/clamav-config.in $(srcdir)/libclamav.pc.in \
62
-	$(srcdir)/platform.h.in $(top_srcdir)/configure \
59
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
60
+	$(top_srcdir)/configure $(am__configure_deps) \
61
+	$(srcdir)/clamav-config.h.in $(srcdir)/clamav-config.in \
62
+	$(srcdir)/libclamav.pc.in $(srcdir)/platform.h.in \
63 63
 	$(top_srcdir)/docs/man/clamav-milter.8.in \
64 64
 	$(top_srcdir)/docs/man/clamav-milter.conf.5.in \
65 65
 	$(top_srcdir)/docs/man/clambc.1.in \
... ...
@@ -67,16 +111,21 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
67 67
 	$(top_srcdir)/docs/man/clamd.8.in \
68 68
 	$(top_srcdir)/docs/man/clamd.conf.5.in \
69 69
 	$(top_srcdir)/docs/man/clamdscan.1.in \
70
-	$(top_srcdir)/docs/man/clamdtop.1.in \
71 70
 	$(top_srcdir)/docs/man/clamscan.1.in \
72
-	$(top_srcdir)/docs/man/clamsubmit.1.in \
73 71
 	$(top_srcdir)/docs/man/freshclam.1.in \
74 72
 	$(top_srcdir)/docs/man/freshclam.conf.5.in \
75
-	$(top_srcdir)/docs/man/sigtool.1.in AUTHORS COPYING ChangeLog \
76
-	INSTALL NEWS config/compile config/config.guess \
77
-	config/config.rpath config/config.sub config/depcomp \
78
-	config/install-sh config/ltmain.sh config/missing \
79
-	config/ylwrap
73
+	$(top_srcdir)/docs/man/sigtool.1.in \
74
+	$(top_srcdir)/docs/man/clamdtop.1.in \
75
+	$(top_srcdir)/docs/man/clamsubmit.1.in AUTHORS COPYING \
76
+	ChangeLog INSTALL NEWS README config/compile \
77
+	config/config.guess config/config.rpath config/config.sub \
78
+	config/depcomp config/install-sh config/missing config/ylwrap \
79
+	config/ltmain.sh $(top_srcdir)/config/compile \
80
+	$(top_srcdir)/config/config.guess \
81
+	$(top_srcdir)/config/config.rpath \
82
+	$(top_srcdir)/config/config.sub \
83
+	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
84
+	$(top_srcdir)/config/missing
80 85
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
81 86
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
82 87
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -187,29 +236,63 @@ am__uninstall_files_from_dir = { \
187 187
   }
188 188
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"
189 189
 SCRIPTS = $(bin_SCRIPTS)
190
+AM_V_P = $(am__v_P_@AM_V@)
191
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
192
+am__v_P_0 = false
193
+am__v_P_1 = :
190 194
 AM_V_GEN = $(am__v_GEN_@AM_V@)
191 195
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
192
-am__v_GEN_0 = @echo "  GEN   " $@;
196
+am__v_GEN_0 = @echo "  GEN     " $@;
197
+am__v_GEN_1 = 
193 198
 AM_V_at = $(am__v_at_@AM_V@)
194 199
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
195 200
 am__v_at_0 = @
201
+am__v_at_1 = 
196 202
 SOURCES =
197 203
 DIST_SOURCES =
198
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
199
-	html-recursive info-recursive install-data-recursive \
200
-	install-dvi-recursive install-exec-recursive \
201
-	install-html-recursive install-info-recursive \
202
-	install-pdf-recursive install-ps-recursive install-recursive \
203
-	installcheck-recursive installdirs-recursive pdf-recursive \
204
-	ps-recursive uninstall-recursive
204
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
205
+	ctags-recursive dvi-recursive html-recursive info-recursive \
206
+	install-data-recursive install-dvi-recursive \
207
+	install-exec-recursive install-html-recursive \
208
+	install-info-recursive install-pdf-recursive \
209
+	install-ps-recursive install-recursive installcheck-recursive \
210
+	installdirs-recursive pdf-recursive ps-recursive \
211
+	tags-recursive uninstall-recursive
212
+am__can_run_installinfo = \
213
+  case $$AM_UPDATE_INFO_DIR in \
214
+    n|no|NO) false;; \
215
+    *) (install-info --version) >/dev/null 2>&1;; \
216
+  esac
205 217
 DATA = $(pkgconfig_DATA)
206 218
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
207 219
   distclean-recursive maintainer-clean-recursive
208
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
209
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
210
-	distdir dist dist-all distcheck
220
+am__recursive_targets = \
221
+  $(RECURSIVE_TARGETS) \
222
+  $(RECURSIVE_CLEAN_TARGETS) \
223
+  $(am__extra_recursive_targets)
224
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
225
+	cscope distdir dist dist-all distcheck
226
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
227
+	$(LISP)clamav-config.h.in
228
+# Read a list of newline-separated strings from the standard input,
229
+# and print each of them once, without duplicates.  Input order is
230
+# *not* preserved.
231
+am__uniquify_input = $(AWK) '\
232
+  BEGIN { nonempty = 0; } \
233
+  { items[$$0] = 1; nonempty = 1; } \
234
+  END { if (nonempty) { for (i in items) print i; }; } \
235
+'
236
+# Make sure the list of sources is unique.  This is necessary because,
237
+# e.g., the same source file might be shared among _SOURCES variables
238
+# for different programs/libraries.
239
+am__define_uniq_tagged_files = \
240
+  list='$(am__tagged_files)'; \
241
+  unique=`for i in $$list; do \
242
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
243
+  done | $(am__uniquify_input)`
211 244
 ETAGS = etags
212 245
 CTAGS = ctags
246
+CSCOPE = cscope
213 247
 DIST_SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam \
214 248
 	sigtool clamconf database docs etc clamav-milter test clamdtop \
215 249
 	clambc unit_tests clamsubmit
... ...
@@ -222,6 +305,7 @@ am__remove_distdir = \
222 222
       && rm -rf "$(distdir)" \
223 223
       || { sleep 5 && rm -rf "$(distdir)"; }; \
224 224
   else :; fi
225
+am__post_remove_distdir = $(am__remove_distdir)
225 226
 am__relativize = \
226 227
   dir0=`pwd`; \
227 228
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
... ...
@@ -249,6 +333,7 @@ am__relativize = \
249 249
   reldir="$$dir2"
250 250
 DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
251 251
 GZIP_ENV = --best
252
+DIST_TARGETS = dist-bzip2 dist-gzip
252 253
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
253 254
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
254 255
 distcleancheck_listfiles = find . -type f -print
... ...
@@ -504,8 +589,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
504 504
 $(am__aclocal_m4_deps):
505 505
 
506 506
 clamav-config.h: stamp-h1
507
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
508
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
507
+	@test -f $@ || rm -f stamp-h1
508
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
509 509
 
510 510
 stamp-h1: $(srcdir)/clamav-config.h.in $(top_builddir)/config.status
511 511
 	@rm -f stamp-h1
... ...
@@ -551,8 +636,11 @@ docs/man/clamsubmit.1: $(top_builddir)/config.status $(top_srcdir)/docs/man/clam
551 551
 	cd $(top_builddir) && $(SHELL) ./config.status $@
552 552
 install-binSCRIPTS: $(bin_SCRIPTS)
553 553
 	@$(NORMAL_INSTALL)
554
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
555 554
 	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
555
+	if test -n "$$list"; then \
556
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
557
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
558
+	fi; \
556 559
 	for p in $$list; do \
557 560
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
558 561
 	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
... ...
@@ -607,8 +695,11 @@ distclean-libtool:
607 607
 	-rm -f libtool config.lt
608 608
 install-pkgconfigDATA: $(pkgconfig_DATA)
609 609
 	@$(NORMAL_INSTALL)
610
-	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
611 610
 	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
611
+	if test -n "$$list"; then \
612
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
613
+	  $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
614
+	fi; \
612 615
 	for p in $$list; do \
613 616
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
614 617
 	  echo "$$d$$p"; \
... ...
@@ -625,22 +716,25 @@ uninstall-pkgconfigDATA:
625 625
 	dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
626 626
 
627 627
 # This directory's subdirectories are mostly independent; you can cd
628
-# into them and run `make' without going through this Makefile.
629
-# To change the values of `make' variables: instead of editing Makefiles,
630
-# (1) if the variable is set in `config.status', edit `config.status'
631
-#     (which will cause the Makefiles to be regenerated when you run `make');
632
-# (2) otherwise, pass the desired values on the `make' command line.
633
-$(RECURSIVE_TARGETS):
634
-	@fail= failcom='exit 1'; \
635
-	for f in x $$MAKEFLAGS; do \
636
-	  case $$f in \
637
-	    *=* | --[!k]*);; \
638
-	    *k*) failcom='fail=yes';; \
639
-	  esac; \
640
-	done; \
628
+# into them and run 'make' without going through this Makefile.
629
+# To change the values of 'make' variables: instead of editing Makefiles,
630
+# (1) if the variable is set in 'config.status', edit 'config.status'
631
+#     (which will cause the Makefiles to be regenerated when you run 'make');
632
+# (2) otherwise, pass the desired values on the 'make' command line.
633
+$(am__recursive_targets):
634
+	@fail=; \
635
+	if $(am__make_keepgoing); then \
636
+	  failcom='fail=yes'; \
637
+	else \
638
+	  failcom='exit 1'; \
639
+	fi; \
641 640
 	dot_seen=no; \
642 641
 	target=`echo $@ | sed s/-recursive//`; \
643
-	list='$(SUBDIRS)'; for subdir in $$list; do \
642
+	case "$@" in \
643
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
644
+	  *) list='$(SUBDIRS)' ;; \
645
+	esac; \
646
+	for subdir in $$list; do \
644 647
 	  echo "Making $$target in $$subdir"; \
645 648
 	  if test "$$subdir" = "."; then \
646 649
 	    dot_seen=yes; \
... ...
@@ -655,57 +749,12 @@ $(RECURSIVE_TARGETS):
655 655
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
656 656
 	fi; test -z "$$fail"
657 657
 
658
-$(RECURSIVE_CLEAN_TARGETS):
659
-	@fail= failcom='exit 1'; \
660
-	for f in x $$MAKEFLAGS; do \
661
-	  case $$f in \
662
-	    *=* | --[!k]*);; \
663
-	    *k*) failcom='fail=yes';; \
664
-	  esac; \
665
-	done; \
666
-	dot_seen=no; \
667
-	case "$@" in \
668
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
669
-	  *) list='$(SUBDIRS)' ;; \
670
-	esac; \
671
-	rev=''; for subdir in $$list; do \
672
-	  if test "$$subdir" = "."; then :; else \
673
-	    rev="$$subdir $$rev"; \
674
-	  fi; \
675
-	done; \
676
-	rev="$$rev ."; \
677
-	target=`echo $@ | sed s/-recursive//`; \
678
-	for subdir in $$rev; do \
679
-	  echo "Making $$target in $$subdir"; \
680
-	  if test "$$subdir" = "."; then \
681
-	    local_target="$$target-am"; \
682
-	  else \
683
-	    local_target="$$target"; \
684
-	  fi; \
685
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
686
-	  || eval $$failcom; \
687
-	done && test -z "$$fail"
688
-tags-recursive:
689
-	list='$(SUBDIRS)'; for subdir in $$list; do \
690
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
691
-	done
692
-ctags-recursive:
693
-	list='$(SUBDIRS)'; for subdir in $$list; do \
694
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
695
-	done
658
+ID: $(am__tagged_files)
659
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
660
+tags: tags-recursive
661
+TAGS: tags
696 662
 
697
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
698
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
699
-	unique=`for i in $$list; do \
700
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
701
-	  done | \
702
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
703
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
704
-	mkid -fID $$unique
705
-tags: TAGS
706
-
707
-TAGS: tags-recursive $(HEADERS) $(SOURCES) clamav-config.h.in $(TAGS_DEPENDENCIES) \
708
-		$(TAGS_FILES) $(LISP)
663
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
709 664
 	set x; \
710 665
 	here=`pwd`; \
711 666
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
... ...
@@ -721,12 +770,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) clamav-config.h.in $(TAGS_DEPENDENCIE
721 721
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
722 722
 	  fi; \
723 723
 	done; \
724
-	list='$(SOURCES) $(HEADERS) clamav-config.h.in $(LISP) $(TAGS_FILES)'; \
725
-	unique=`for i in $$list; do \
726
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
727
-	  done | \
728
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
729
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
724
+	$(am__define_uniq_tagged_files); \
730 725
 	shift; \
731 726
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
732 727
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -738,15 +782,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) clamav-config.h.in $(TAGS_DEPENDENCIE
738 738
 	      $$unique; \
739 739
 	  fi; \
740 740
 	fi
741
-ctags: CTAGS
742
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) clamav-config.h.in $(TAGS_DEPENDENCIES) \
743
-		$(TAGS_FILES) $(LISP)
744
-	list='$(SOURCES) $(HEADERS) clamav-config.h.in $(LISP) $(TAGS_FILES)'; \
745
-	unique=`for i in $$list; do \
746
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
747
-	  done | \
748
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
749
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
741
+ctags: ctags-recursive
742
+
743
+CTAGS: ctags
744
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
745
+	$(am__define_uniq_tagged_files); \
750 746
 	test -z "$(CTAGS_ARGS)$$unique" \
751 747
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
752 748
 	     $$unique
... ...
@@ -755,9 +795,31 @@ GTAGS:
755 755
 	here=`$(am__cd) $(top_builddir) && pwd` \
756 756
 	  && $(am__cd) $(top_srcdir) \
757 757
 	  && gtags -i $(GTAGS_ARGS) "$$here"
758
+cscope: cscope.files
759
+	test ! -s cscope.files \
760
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
761
+clean-cscope:
762
+	-rm -f cscope.files
763
+cscope.files: clean-cscope cscopelist
764
+cscopelist: cscopelist-recursive
765
+
766
+cscopelist-am: $(am__tagged_files)
767
+	list='$(am__tagged_files)'; \
768
+	case "$(srcdir)" in \
769
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
770
+	  *) sdir=$(subdir)/$(srcdir) ;; \
771
+	esac; \
772
+	for i in $$list; do \
773
+	  if test -f "$$i"; then \
774
+	    echo "$(subdir)/$$i"; \
775
+	  else \
776
+	    echo "$$sdir/$$i"; \
777
+	  fi; \
778
+	done >> $(top_builddir)/cscope.files
758 779
 
759 780
 distclean-tags:
760 781
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
782
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
761 783
 
762 784
 distdir: $(DISTFILES)
763 785
 	$(am__remove_distdir)
... ...
@@ -793,13 +855,10 @@ distdir: $(DISTFILES)
793 793
 	done
794 794
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
795 795
 	  if test "$$subdir" = .; then :; else \
796
-	    test -d "$(distdir)/$$subdir" \
797
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
798
-	    || exit 1; \
799
-	  fi; \
800
-	done
801
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
802
-	  if test "$$subdir" = .; then :; else \
796
+	    $(am__make_dryrun) \
797
+	      || test -d "$(distdir)/$$subdir" \
798
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
799
+	      || exit 1; \
803 800
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
804 801
 	    $(am__relativize); \
805 802
 	    new_distdir=$$reldir; \
... ...
@@ -831,40 +890,41 @@ distdir: $(DISTFILES)
831 831
 	|| chmod -R a+r "$(distdir)"
832 832
 dist-gzip: distdir
833 833
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
834
-	$(am__remove_distdir)
834
+	$(am__post_remove_distdir)
835 835
 dist-bzip2: distdir
836 836
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
837
-	$(am__remove_distdir)
837
+	$(am__post_remove_distdir)
838 838
 
839 839
 dist-lzip: distdir
840 840
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
841
-	$(am__remove_distdir)
842
-
843
-dist-lzma: distdir
844
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
845
-	$(am__remove_distdir)
841
+	$(am__post_remove_distdir)
846 842
 
847 843
 dist-xz: distdir
848 844
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
849
-	$(am__remove_distdir)
845
+	$(am__post_remove_distdir)
850 846
 
851 847
 dist-tarZ: distdir
848
+	@echo WARNING: "Support for shar distribution archives is" \
849
+	               "deprecated." >&2
850
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
852 851
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
853
-	$(am__remove_distdir)
852
+	$(am__post_remove_distdir)
854 853
 
855 854
 dist-shar: distdir
855
+	@echo WARNING: "Support for distribution archives compressed with" \
856
+		       "legacy program 'compress' is deprecated." >&2
857
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
856 858
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
857
-	$(am__remove_distdir)
859
+	$(am__post_remove_distdir)
858 860
 
859 861
 dist-zip: distdir
860 862
 	-rm -f $(distdir).zip
861 863
 	zip -rq $(distdir).zip $(distdir)
862
-	$(am__remove_distdir)
864
+	$(am__post_remove_distdir)
863 865
 
864
-dist dist-all: distdir
865
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
866
-	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
867
-	$(am__remove_distdir)
866
+dist dist-all:
867
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
868
+	$(am__post_remove_distdir)
868 869
 
869 870
 # This target untars the dist file and tries a VPATH configuration.  Then
870 871
 # it guarantees that the distribution is self-contained by making another
... ...
@@ -875,8 +935,6 @@ distcheck: dist
875 875
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
876 876
 	*.tar.bz2*) \
877 877
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
878
-	*.tar.lzma*) \
879
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
880 878
 	*.tar.lz*) \
881 879
 	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
882 880
 	*.tar.xz*) \
... ...
@@ -888,9 +946,9 @@ distcheck: dist
888 888
 	*.zip*) \
889 889
 	  unzip $(distdir).zip ;;\
890 890
 	esac
891
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
892
-	mkdir $(distdir)/_build
893
-	mkdir $(distdir)/_inst
891
+	chmod -R a-w $(distdir)
892
+	chmod u+w $(distdir)
893
+	mkdir $(distdir)/_build $(distdir)/_inst
894 894
 	chmod a-w $(distdir)
895 895
 	test -d $(distdir)/_build || exit 0; \
896 896
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
... ...
@@ -922,7 +980,7 @@ distcheck: dist
922 922
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
923 923
 	  && cd "$$am__cwd" \
924 924
 	  || exit 1
925
-	$(am__remove_distdir)
925
+	$(am__post_remove_distdir)
926 926
 	@(echo "$(distdir) archives ready for distribution: "; \
927 927
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
928 928
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
... ...
@@ -1061,26 +1119,25 @@ ps-am:
1061 1061
 
1062 1062
 uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA
1063 1063
 
1064
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
1065
-	ctags-recursive install-am install-strip tags-recursive
1066
-
1067
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
1068
-	all all-am am--refresh check check-am clean clean-generic \
1069
-	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
1070
-	dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \
1071
-	dist-xz dist-zip distcheck distclean distclean-generic \
1072
-	distclean-hdr distclean-libtool distclean-tags distcleancheck \
1073
-	distdir distuninstallcheck dvi dvi-am html html-am info \
1074
-	info-am install install-am install-binSCRIPTS install-data \
1075
-	install-data-am install-dvi install-dvi-am install-exec \
1076
-	install-exec-am install-html install-html-am install-info \
1077
-	install-info-am install-man install-pdf install-pdf-am \
1078
-	install-pkgconfigDATA install-ps install-ps-am install-strip \
1079
-	installcheck installcheck-am installcheck-binSCRIPTS \
1080
-	installdirs installdirs-am maintainer-clean \
1081
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
1082
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
1083
-	uninstall uninstall-am uninstall-binSCRIPTS \
1064
+.MAKE: $(am__recursive_targets) all install-am install-strip
1065
+
1066
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
1067
+	am--refresh check check-am clean clean-cscope clean-generic \
1068
+	clean-libtool cscope cscopelist-am ctags ctags-am dist \
1069
+	dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
1070
+	dist-tarZ dist-xz dist-zip distcheck distclean \
1071
+	distclean-generic distclean-hdr distclean-libtool \
1072
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
1073
+	dvi-am html html-am info info-am install install-am \
1074
+	install-binSCRIPTS install-data install-data-am install-dvi \
1075
+	install-dvi-am install-exec install-exec-am install-html \
1076
+	install-html-am install-info install-info-am install-man \
1077
+	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
1078
+	install-ps-am install-strip installcheck installcheck-am \
1079
+	installcheck-binSCRIPTS installdirs installdirs-am \
1080
+	maintainer-clean maintainer-clean-generic mostlyclean \
1081
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1082
+	tags tags-am uninstall uninstall-am uninstall-binSCRIPTS \
1084 1083
 	uninstall-pkgconfigDATA
1085 1084
 
1086 1085
 lcov:
... ...
@@ -1,8 +1,7 @@
1
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
1
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
2
+
3
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
2 4
 
3
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5
-# Inc.
6 5
 # This file is free software; the Free Software Foundation
7 6
 # gives unlimited permission to copy and/or distribute it,
8 7
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -12,33 +11,31 @@
12 12
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 13
 # PARTICULAR PURPOSE.
14 14
 
15
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 16
 m4_ifndef([AC_AUTOCONF_VERSION],
16 17
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18
-[m4_warning([this file was generated for autoconf 2.68.
18
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
19
+[m4_warning([this file was generated for autoconf 2.69.
19 20
 You have another version of autoconf.  It may work, but is not guaranteed to.
20 21
 If you have problems, you may need to regenerate the build system entirely.
21
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22 23
 
23
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24
-# Foundation, Inc.
24
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
25 25
 #
26 26
 # This file is free software; the Free Software Foundation
27 27
 # gives unlimited permission to copy and/or distribute it,
28 28
 # with or without modifications, as long as this notice is preserved.
29 29
 
30
-# serial 1
31
-
32 30
 # AM_AUTOMAKE_VERSION(VERSION)
33 31
 # ----------------------------
34 32
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
35 33
 # generated from the m4 files accompanying Automake X.Y.
36 34
 # (This private macro should not be called outside this file.)
37 35
 AC_DEFUN([AM_AUTOMAKE_VERSION],
38
-[am__api_version='1.11'
36
+[am__api_version='1.14'
39 37
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40 38
 dnl require some minimum version.  Point them to the right macro.
41
-m4_if([$1], [1.11.3], [],
39
+m4_if([$1], [1.14], [],
42 40
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43 41
 ])
44 42
 
... ...
@@ -54,24 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
54 54
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55 55
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56 56
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
57
+[AM_AUTOMAKE_VERSION([1.14])dnl
58 58
 m4_ifndef([AC_AUTOCONF_VERSION],
59 59
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60 60
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
61 61
 
62 62
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
63 63
 
64
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
64
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
65 65
 #
66 66
 # This file is free software; the Free Software Foundation
67 67
 # gives unlimited permission to copy and/or distribute it,
68 68
 # with or without modifications, as long as this notice is preserved.
69 69
 
70
-# serial 1
71
-
72 70
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
74
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
71
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
72
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
75 73
 #
76 74
 # Of course, Automake must honor this variable whenever it calls a
77 75
 # tool from the auxiliary directory.  The problem is that $srcdir (and
... ...
@@ -90,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
90 90
 #
91 91
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92 92
 # are both prefixed by $srcdir.  In an in-source build this is usually
93
-# harmless because $srcdir is `.', but things will broke when you
93
+# harmless because $srcdir is '.', but things will broke when you
94 94
 # start a VPATH build or use an absolute $srcdir.
95 95
 #
96 96
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
... ...
@@ -116,22 +111,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
116 116
 
117 117
 # AM_CONDITIONAL                                            -*- Autoconf -*-
118 118
 
119
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120
-# Free Software Foundation, Inc.
119
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
121 120
 #
122 121
 # This file is free software; the Free Software Foundation
123 122
 # gives unlimited permission to copy and/or distribute it,
124 123
 # with or without modifications, as long as this notice is preserved.
125 124
 
126
-# serial 9
127
-
128 125
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
129 126
 # -------------------------------------
130 127
 # Define a conditional.
131 128
 AC_DEFUN([AM_CONDITIONAL],
132
-[AC_PREREQ(2.52)dnl
133
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
134
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129
+[AC_PREREQ([2.52])dnl
130
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
131
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135 132
 AC_SUBST([$1_TRUE])dnl
136 133
 AC_SUBST([$1_FALSE])dnl
137 134
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
... ...
@@ -150,16 +142,14 @@ AC_CONFIG_COMMANDS_PRE(
150 150
 Usually this means the macro was only invoked conditionally.]])
151 151
 fi])])
152 152
 
153
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
154
-# 2010, 2011 Free Software Foundation, Inc.
153
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
155 154
 #
156 155
 # This file is free software; the Free Software Foundation
157 156
 # gives unlimited permission to copy and/or distribute it,
158 157
 # with or without modifications, as long as this notice is preserved.
159 158
 
160
-# serial 12
161 159
 
162
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
160
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
163 161
 # written in clear, in which case automake, when reading aclocal.m4,
164 162
 # will think it sees a *use*, and therefore will trigger all it's
165 163
 # C support machinery.  Also note that it means that autoscan, seeing
... ...
@@ -169,7 +159,7 @@ fi])])
169 169
 # _AM_DEPENDENCIES(NAME)
170 170
 # ----------------------
171 171
 # See how the compiler implements dependency checking.
172
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
172
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
173 173
 # We try a few techniques and use that to set a single cache variable.
174 174
 #
175 175
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
... ...
@@ -182,12 +172,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
182 182
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
183 183
 AC_REQUIRE([AM_DEP_TRACK])dnl
184 184
 
185
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
186
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
187
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
189
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
190
-                   [depcc="$$1"   am_compiler_list=])
185
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
186
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
187
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
189
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
190
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
191
+                    [depcc="$$1"   am_compiler_list=])
191 192
 
192 193
 AC_CACHE_CHECK([dependency style of $depcc],
193 194
                [am_cv_$1_dependencies_compiler_type],
... ...
@@ -195,8 +186,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
195 195
   # We make a subdir and do the tests there.  Otherwise we can end up
196 196
   # making bogus files that we don't know about and never remove.  For
197 197
   # instance it was reported that on HP-UX the gcc test will end up
198
-  # making a dummy file named `D' -- because `-MD' means `put the output
199
-  # in D'.
198
+  # making a dummy file named 'D' -- because '-MD' means "put the output
199
+  # in D".
200 200
   rm -rf conftest.dir
201 201
   mkdir conftest.dir
202 202
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -236,16 +227,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
236 236
     : > sub/conftest.c
237 237
     for i in 1 2 3 4 5 6; do
238 238
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
239
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
240
-      # Solaris 8's {/usr,}/bin/sh.
241
-      touch sub/conftst$i.h
239
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
240
+      # Solaris 10 /bin/sh.
241
+      echo '/* dummy */' > sub/conftst$i.h
242 242
     done
243 243
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
244 244
 
245
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
245
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
246 246
     # mode.  It turns out that the SunPro C++ compiler does not properly
247
-    # handle `-M -o', and we need to detect this.  Also, some Intel
248
-    # versions had trouble with output in subdirs
247
+    # handle '-M -o', and we need to detect this.  Also, some Intel
248
+    # versions had trouble with output in subdirs.
249 249
     am__obj=sub/conftest.${OBJEXT-o}
250 250
     am__minus_obj="-o $am__obj"
251 251
     case $depmode in
... ...
@@ -254,8 +245,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
254 254
       test "$am__universal" = false || continue
255 255
       ;;
256 256
     nosideeffect)
257
-      # after this tag, mechanisms are not by side-effect, so they'll
258
-      # only be used when explicitly requested
257
+      # After this tag, mechanisms are not by side-effect, so they'll
258
+      # only be used when explicitly requested.
259 259
       if test "x$enable_dependency_tracking" = xyes; then
260 260
 	continue
261 261
       else
... ...
@@ -263,7 +254,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
263 263
       fi
264 264
       ;;
265 265
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
266
-      # This compiler won't grok `-c -o', but also, the minuso test has
266
+      # This compiler won't grok '-c -o', but also, the minuso test has
267 267
       # not run yet.  These depmodes are late enough in the game, and
268 268
       # so weak that their functioning should not be impacted.
269 269
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -311,7 +302,7 @@ AM_CONDITIONAL([am__fastdep$1], [
311 311
 # AM_SET_DEPDIR
312 312
 # -------------
313 313
 # Choose a directory name for dependency files.
314
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
314
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
315 315
 AC_DEFUN([AM_SET_DEPDIR],
316 316
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
317 317
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
... ...
@@ -321,9 +312,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
321 321
 # AM_DEP_TRACK
322 322
 # ------------
323 323
 AC_DEFUN([AM_DEP_TRACK],
324
-[AC_ARG_ENABLE(dependency-tracking,
325
-[  --disable-dependency-tracking  speeds up one-time build
326
-  --enable-dependency-tracking   do not reject slow dependency extractors])
324
+[AC_ARG_ENABLE([dependency-tracking], [dnl
325
+AS_HELP_STRING(
326
+  [--enable-dependency-tracking],
327
+  [do not reject slow dependency extractors])
328
+AS_HELP_STRING(
329
+  [--disable-dependency-tracking],
330
+  [speeds up one-time build])])
327 331
 if test "x$enable_dependency_tracking" != xno; then
328 332
   am_depcomp="$ac_aux_dir/depcomp"
329 333
   AMDEPBACKSLASH='\'
... ...
@@ -338,20 +333,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
338 338
 
339 339
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
340 340
 
341
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
342
-# Free Software Foundation, Inc.
341
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
343 342
 #
344 343
 # This file is free software; the Free Software Foundation
345 344
 # gives unlimited permission to copy and/or distribute it,
346 345
 # with or without modifications, as long as this notice is preserved.
347 346
 
348
-#serial 5
349 347
 
350 348
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
351 349
 # ------------------------------
352 350
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
353 351
 [{
354
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
352
+  # Older Autoconf quotes --file arguments for eval, but not when files
355 353
   # are listed without --file.  Let's play safe and only enable the eval
356 354
   # if we detect the quoting.
357 355
   case $CONFIG_FILES in
... ...
@@ -364,7 +357,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
364 364
     # Strip MF so we end up with the name of the file.
365 365
     mf=`echo "$mf" | sed -e 's/:.*$//'`
366 366
     # Check whether this is an Automake generated Makefile or not.
367
-    # We used to match only the files named `Makefile.in', but
367
+    # We used to match only the files named 'Makefile.in', but
368 368
     # some people rename them; so instead we look at the file content.
369 369
     # Grep'ing the first line is not enough: some people post-process
370 370
     # each Makefile.in and add a new line on top of each file to say so.
... ...
@@ -376,21 +369,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
376 376
       continue
377 377
     fi
378 378
     # Extract the definition of DEPDIR, am__include, and am__quote
379
-    # from the Makefile without running `make'.
379
+    # from the Makefile without running 'make'.
380 380
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381 381
     test -z "$DEPDIR" && continue
382 382
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
383
-    test -z "am__include" && continue
383
+    test -z "$am__include" && continue
384 384
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385
-    # When using ansi2knr, U may be empty or an underscore; expand it
386
-    U=`sed -n 's/^U = //p' < "$mf"`
387 385
     # Find all dependency output files, they are included files with
388 386
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
389 387
     # simplest approach to changing $(DEPDIR) to its actual value in the
390 388
     # expansion.
391 389
     for file in `sed -n "
392 390
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
393
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
391
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
394 392
       # Make sure the directory exists.
395 393
       test -f "$dirpart/$file" && continue
396 394
       fdir=`AS_DIRNAME(["$file"])`
... ...
@@ -408,7 +399,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
408 408
 # This macro should only be invoked once -- use via AC_REQUIRE.
409 409
 #
410 410
 # This code is only required when automatic dependency tracking
411
-# is enabled.  FIXME.  This creates each `.P' file that we will
411
+# is enabled.  FIXME.  This creates each '.P' file that we will
412 412
 # need in order to bootstrap the dependency handling code.
413 413
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
414 414
 [AC_CONFIG_COMMANDS([depfiles],
... ...
@@ -418,18 +409,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
418 418
 
419 419
 # Do all the work for Automake.                             -*- Autoconf -*-
420 420
 
421
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
422
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
421
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
423 422
 #
424 423
 # This file is free software; the Free Software Foundation
425 424
 # gives unlimited permission to copy and/or distribute it,
426 425
 # with or without modifications, as long as this notice is preserved.
427 426
 
428
-# serial 16
429
-
430 427
 # This macro actually does too much.  Some checks are only needed if
431 428
 # your package does certain things.  But this isn't really a big deal.
432 429
 
430
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
431
+m4_define([AC_PROG_CC],
432
+m4_defn([AC_PROG_CC])
433
+[_AM_PROG_CC_C_O
434
+])
435
+
433 436
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
434 437
 # AM_INIT_AUTOMAKE([OPTIONS])
435 438
 # -----------------------------------------------
... ...
@@ -442,7 +436,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
442 442
 # arguments mandatory, and then we can depend on a new Autoconf
443 443
 # release and drop the old call support.
444 444
 AC_DEFUN([AM_INIT_AUTOMAKE],
445
-[AC_PREREQ([2.62])dnl
445
+[AC_PREREQ([2.65])dnl
446 446
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
447 447
 dnl the ones we care about.
448 448
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
... ...
@@ -471,31 +465,40 @@ AC_SUBST([CYGPATH_W])
471 471
 # Define the identity of the package.
472 472
 dnl Distinguish between old-style and new-style calls.
473 473
 m4_ifval([$2],
474
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
474
+[AC_DIAGNOSE([obsolete],
475
+             [$0: two- and three-arguments forms are deprecated.])
476
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475 477
  AC_SUBST([PACKAGE], [$1])dnl
476 478
  AC_SUBST([VERSION], [$2])],
477 479
 [_AM_SET_OPTIONS([$1])dnl
478 480
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
481
+m4_if(
482
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
483
+  [ok:ok],,
480 484
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
481 485
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
482 486
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
483 487
 
484 488
 _AM_IF_OPTION([no-define],,
485
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
486
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
490
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
487 491
 
488 492
 # Some tools Automake needs.
489 493
 AC_REQUIRE([AM_SANITY_CHECK])dnl
490 494
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
491
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
492
-AM_MISSING_PROG(AUTOCONF, autoconf)
493
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
494
-AM_MISSING_PROG(AUTOHEADER, autoheader)
495
-AM_MISSING_PROG(MAKEINFO, makeinfo)
495
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
496
+AM_MISSING_PROG([AUTOCONF], [autoconf])
497
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
498
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
499
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
496 500
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
497 501
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
498
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
502
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
503
+# For better backward compatibility.  To be removed once Automake 1.9.x
504
+# dies out for good.  For more background, see:
505
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
506
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
507
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
499 508
 # We need awk for the "check" target.  The system "awk" is bad on
500 509
 # some platforms.
501 510
 AC_REQUIRE([AC_PROG_AWK])dnl
... ...
@@ -506,34 +509,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
506 506
 			     [_AM_PROG_TAR([v7])])])
507 507
 _AM_IF_OPTION([no-dependencies],,
508 508
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
509
-		  [_AM_DEPENDENCIES(CC)],
510
-		  [define([AC_PROG_CC],
511
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
509
+		  [_AM_DEPENDENCIES([CC])],
510
+		  [m4_define([AC_PROG_CC],
511
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
512 512
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
513
-		  [_AM_DEPENDENCIES(CXX)],
514
-		  [define([AC_PROG_CXX],
515
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
513
+		  [_AM_DEPENDENCIES([CXX])],
514
+		  [m4_define([AC_PROG_CXX],
515
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
516 516
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
517
-		  [_AM_DEPENDENCIES(OBJC)],
518
-		  [define([AC_PROG_OBJC],
519
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
517
+		  [_AM_DEPENDENCIES([OBJC])],
518
+		  [m4_define([AC_PROG_OBJC],
519
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
520
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
521
+		  [_AM_DEPENDENCIES([OBJCXX])],
522
+		  [m4_define([AC_PROG_OBJCXX],
523
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
520 524
 ])
521
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
522
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
523
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
524
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
525
+AC_REQUIRE([AM_SILENT_RULES])dnl
526
+dnl The testsuite driver may need to know about EXEEXT, so add the
527
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
528
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
525 529
 AC_CONFIG_COMMANDS_PRE(dnl
526 530
 [m4_provide_if([_AM_COMPILER_EXEEXT],
527 531
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
528
-])
529 532
 
530
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533
+# POSIX will say in a future version that running "rm -f" with no argument
534
+# is OK; and we want to be able to make that assumption in our Makefile
535
+# recipes.  So use an aggressive probe to check that the usage we want is
536
+# actually supported "in the wild" to an acceptable degree.
537
+# See automake bug#10828.
538
+# To make any issue more visible, cause the running configure to be aborted
539
+# by default if the 'rm' program in use doesn't match our expectations; the
540
+# user can still override this though.
541
+if rm -f && rm -fr && rm -rf; then : OK; else
542
+  cat >&2 <<'END'
543
+Oops!
544
+
545
+Your 'rm' program seems unable to run without file operands specified
546
+on the command line, even when the '-f' option is present.  This is contrary
547
+to the behaviour of most rm programs out there, and not conforming with
548
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
549
+
550
+Please tell bug-automake@gnu.org about your system, including the value
551
+of your $PATH and any error possibly output before this message.  This
552
+can help us improve future automake versions.
553
+
554
+END
555
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
556
+    echo 'Configuration will proceed anyway, since you have set the' >&2
557
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
558
+    echo >&2
559
+  else
560
+    cat >&2 <<'END'
561
+Aborting the configuration process, to ensure you take notice of the issue.
562
+
563
+You can download and install GNU coreutils to get an 'rm' implementation
564
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
565
+
566
+If you want to complete the configuration process using your problematic
567
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
568
+to "yes", and re-run configure.
569
+
570
+END
571
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
572
+  fi
573
+fi])
574
+
575
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
531 576
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
532 577
 dnl mangled by Autoconf and run in a shell conditional statement.
533 578
 m4_define([_AC_COMPILER_EXEEXT],
534 579
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
535 580
 
536
-
537 581
 # When config.status generates a header, we must update the stamp-h file.
538 582
 # This file resides in the same directory as the config header
539 583
 # that is generated.  The stamp files are numbered to have different names.
... ...
@@ -555,15 +602,12 @@ for _am_header in $config_headers :; do
555 555
 done
556 556
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
557 557
 
558
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
559
-# Inc.
558
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
560 559
 #
561 560
 # This file is free software; the Free Software Foundation
562 561
 # gives unlimited permission to copy and/or distribute it,
563 562
 # with or without modifications, as long as this notice is preserved.
564 563
 
565
-# serial 1
566
-
567 564
 # AM_PROG_INSTALL_SH
568 565
 # ------------------
569 566
 # Define $install_sh.
... ...
@@ -577,16 +621,14 @@ if test x"${install_sh}" != xset; then
577 577
     install_sh="\${SHELL} $am_aux_dir/install-sh"
578 578
   esac
579 579
 fi
580
-AC_SUBST(install_sh)])
580
+AC_SUBST([install_sh])])
581 581
 
582
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
583 583
 #
584 584
 # This file is free software; the Free Software Foundation
585 585
 # gives unlimited permission to copy and/or distribute it,
586 586
 # with or without modifications, as long as this notice is preserved.
587 587
 
588
-# serial 2
589
-
590 588
 # Check whether the underlying file-system supports filenames
591 589
 # with a leading dot.  For instance MS-DOS doesn't.
592 590
 AC_DEFUN([AM_SET_LEADING_DOT],
... ...
@@ -600,21 +642,18 @@ fi
600 600
 rmdir .tst 2>/dev/null
601 601
 AC_SUBST([am__leading_dot])])
602 602
 
603
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
604
-# Free Software Foundation, Inc.
603
+# Copyright (C) 1998-2013 Free Software Foundation, Inc.
605 604
 #
606 605
 # This file is free software; the Free Software Foundation
607 606
 # gives unlimited permission to copy and/or distribute it,
608 607
 # with or without modifications, as long as this notice is preserved.
609 608
 
610
-# serial 5
611
-
612 609
 # AM_PROG_LEX
613 610
 # -----------
614 611
 # Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
615 612
 # "missing" invocation, for better error output.
616 613
 AC_DEFUN([AM_PROG_LEX],
617
-[AC_PREREQ(2.50)dnl
614
+[AC_PREREQ([2.50])dnl
618 615
 AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
619 616
 AC_REQUIRE([AC_PROG_LEX])dnl
620 617
 if test "$LEX" = :; then
... ...
@@ -623,14 +662,12 @@ fi])
623 623
 
624 624
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
625 625
 
626
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
626
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
627 627
 #
628 628
 # This file is free software; the Free Software Foundation
629 629
 # gives unlimited permission to copy and/or distribute it,
630 630
 # with or without modifications, as long as this notice is preserved.
631 631
 
632
-# serial 4
633
-
634 632
 # AM_MAKE_INCLUDE()
635 633
 # -----------------
636 634
 # Check to see how make treats includes.
... ...
@@ -648,7 +685,7 @@ am__quote=
648 648
 _am_result=none
649 649
 # First try GNU make style include.
650 650
 echo "include confinc" > confmf
651
-# Ignore all kinds of additional output from `make'.
651
+# Ignore all kinds of additional output from 'make'.
652 652
 case `$am_make -s -f confmf 2> /dev/null` in #(
653 653
 *the\ am__doit\ target*)
654 654
   am__include=include
... ...
@@ -675,15 +712,12 @@ rm -f confinc confmf
675 675
 
676 676
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
677 677
 
678
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
679
-# Free Software Foundation, Inc.
678
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
680 679
 #
681 680
 # This file is free software; the Free Software Foundation
682 681
 # gives unlimited permission to copy and/or distribute it,
683 682
 # with or without modifications, as long as this notice is preserved.
684 683
 
685
-# serial 6
686
-
687 684
 # AM_MISSING_PROG(NAME, PROGRAM)
688 685
 # ------------------------------
689 686
 AC_DEFUN([AM_MISSING_PROG],
... ...
@@ -691,11 +725,10 @@ AC_DEFUN([AM_MISSING_PROG],
691 691
 $1=${$1-"${am_missing_run}$2"}
692 692
 AC_SUBST($1)])
693 693
 
694
-
695 694
 # AM_MISSING_HAS_RUN
696 695
 # ------------------
697
-# Define MISSING if not defined so far and test if it supports --run.
698
-# If it does, set am_missing_run to use it, otherwise, to nothing.
696
+# Define MISSING if not defined so far and test if it is modern enough.
697
+# If it is, set am_missing_run to use it, otherwise, to nothing.
699 698
 AC_DEFUN([AM_MISSING_HAS_RUN],
700 699
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
701 700
 AC_REQUIRE_AUX_FILE([missing])dnl
... ...
@@ -708,54 +741,22 @@ if test x"${MISSING+set}" != xset; then
708 708
   esac
709 709
 fi
710 710
 # Use eval to expand $SHELL
711
-if eval "$MISSING --run true"; then
712
-  am_missing_run="$MISSING --run "
711
+if eval "$MISSING --is-lightweight"; then
712
+  am_missing_run="$MISSING "
713 713
 else
714 714
   am_missing_run=
715
-  AC_MSG_WARN([`missing' script is too old or missing])
715
+  AC_MSG_WARN(['missing' script is too old or missing])
716 716
 fi
717 717
 ])
718 718
 
719
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
720
-# Inc.
721
-#
722
-# This file is free software; the Free Software Foundation
723
-# gives unlimited permission to copy and/or distribute it,
724
-# with or without modifications, as long as this notice is preserved.
725
-
726
-# serial 1
727
-
728
-# AM_PROG_MKDIR_P
729
-# ---------------
730
-# Check for `mkdir -p'.
731
-AC_DEFUN([AM_PROG_MKDIR_P],
732
-[AC_PREREQ([2.60])dnl
733
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
734
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
735
-dnl while keeping a definition of mkdir_p for backward compatibility.
736
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
737
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
738
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
739
-dnl adjustment using top_builddir (which is defined more often than
740
-dnl MKDIR_P).
741
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
742
-case $mkdir_p in
743
-  [[\\/$]]* | ?:[[\\/]]*) ;;
744
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
745
-esac
746
-])
747
-
748 719
 # Helper functions for option handling.                     -*- Autoconf -*-
749 720
 
750
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
751
-# Foundation, Inc.
721
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
752 722
 #
753 723
 # This file is free software; the Free Software Foundation
754 724
 # gives unlimited permission to copy and/or distribute it,
755 725
 # with or without modifications, as long as this notice is preserved.
756 726
 
757
-# serial 5
758
-
759 727
 # _AM_MANGLE_OPTION(NAME)
760 728
 # -----------------------
761 729
 AC_DEFUN([_AM_MANGLE_OPTION],
... ...
@@ -765,7 +766,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
765 765
 # --------------------
766 766
 # Set option NAME.  Presently that only means defining a flag for this option.
767 767
 AC_DEFUN([_AM_SET_OPTION],
768
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
768
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
769 769
 
770 770
 # _AM_SET_OPTIONS(OPTIONS)
771 771
 # ------------------------
... ...
@@ -779,13 +780,58 @@ AC_DEFUN([_AM_SET_OPTIONS],
779 779
 AC_DEFUN([_AM_IF_OPTION],
780 780
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
781 781
 
782
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
782
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
783 783
 #
784 784
 # This file is free software; the Free Software Foundation
785 785
 # gives unlimited permission to copy and/or distribute it,
786 786
 # with or without modifications, as long as this notice is preserved.
787 787
 
788
-# serial 1
788
+# _AM_PROG_CC_C_O
789
+# ---------------
790
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
791
+# to automatically call this.
792
+AC_DEFUN([_AM_PROG_CC_C_O],
793
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
794
+AC_REQUIRE_AUX_FILE([compile])dnl
795
+AC_LANG_PUSH([C])dnl
796
+AC_CACHE_CHECK(
797
+  [whether $CC understands -c and -o together],
798
+  [am_cv_prog_cc_c_o],
799
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
800
+  # Make sure it works both with $CC and with simple cc.
801
+  # Following AC_PROG_CC_C_O, we do the test twice because some
802
+  # compilers refuse to overwrite an existing .o file with -o,
803
+  # though they will create one.
804
+  am_cv_prog_cc_c_o=yes
805
+  for am_i in 1 2; do
806
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
807
+         && test -f conftest2.$ac_objext; then
808
+      : OK
809
+    else
810
+      am_cv_prog_cc_c_o=no
811
+      break
812
+    fi
813
+  done
814
+  rm -f core conftest*
815
+  unset am_i])
816
+if test "$am_cv_prog_cc_c_o" != yes; then
817
+   # Losing compiler, so override with the script.
818
+   # FIXME: It is wrong to rewrite CC.
819
+   # But if we don't then we get into trouble of one sort or another.
820
+   # A longer-term fix would be to have automake use am__CC in this case,
821
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
822
+   CC="$am_aux_dir/compile $CC"
823
+fi
824
+AC_LANG_POP([C])])
825
+
826
+# For backward compatibility.
827
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
828
+
829
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
830
+#
831
+# This file is free software; the Free Software Foundation
832
+# gives unlimited permission to copy and/or distribute it,
833
+# with or without modifications, as long as this notice is preserved.
789 834
 
790 835
 # AM_RUN_LOG(COMMAND)
791 836
 # -------------------
... ...
@@ -800,22 +846,16 @@ AC_DEFUN([AM_RUN_LOG],
800 800
 
801 801
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
802 802
 
803
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
804
-# Free Software Foundation, Inc.
803
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
805 804
 #
806 805
 # This file is free software; the Free Software Foundation
807 806
 # gives unlimited permission to copy and/or distribute it,
808 807
 # with or without modifications, as long as this notice is preserved.
809 808
 
810
-# serial 5
811
-
812 809
 # AM_SANITY_CHECK
813 810
 # ---------------
814 811
 AC_DEFUN([AM_SANITY_CHECK],
815 812
 [AC_MSG_CHECKING([whether build environment is sane])
816
-# Just in case
817
-sleep 1
818
-echo timestamp > conftest.file
819 813
 # Reject unsafe characters in $srcdir or the absolute working directory
820 814
 # name.  Accept space and tab only in the latter.
821 815
 am_lf='
... ...
@@ -826,32 +866,40 @@ case `pwd` in
826 826
 esac
827 827
 case $srcdir in
828 828
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
829
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
829
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
830 830
 esac
831 831
 
832
-# Do `set' in a subshell so we don't clobber the current shell's
832
+# Do 'set' in a subshell so we don't clobber the current shell's
833 833
 # arguments.  Must try -L first in case configure is actually a
834 834
 # symlink; some systems play weird games with the mod time of symlinks
835 835
 # (eg FreeBSD returns the mod time of the symlink's containing
836 836
 # directory).
837 837
 if (
838
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
839
-   if test "$[*]" = "X"; then
840
-      # -L didn't work.
841
-      set X `ls -t "$srcdir/configure" conftest.file`
842
-   fi
843
-   rm -f conftest.file
844
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
845
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
846
-
847
-      # If neither matched, then we have a broken ls.  This can happen
848
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
849
-      # broken ls alias from the environment.  This has actually
850
-      # happened.  Such a system could not be considered "sane".
851
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
852
-alias in your environment])
853
-   fi
854
-
838
+   am_has_slept=no
839
+   for am_try in 1 2; do
840
+     echo "timestamp, slept: $am_has_slept" > conftest.file
841
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
842
+     if test "$[*]" = "X"; then
843
+	# -L didn't work.
844
+	set X `ls -t "$srcdir/configure" conftest.file`
845
+     fi
846
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
847
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
848
+
849
+	# If neither matched, then we have a broken ls.  This can happen
850
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
851
+	# broken ls alias from the environment.  This has actually
852
+	# happened.  Such a system could not be considered "sane".
853
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
854
+  alias in your environment])
855
+     fi
856
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
857
+       break
858
+     fi
859
+     # Just in case.
860
+     sleep 1
861
+     am_has_slept=yes
862
+   done
855 863
    test "$[2]" = conftest.file
856 864
    )
857 865
 then
... ...
@@ -861,31 +909,50 @@ else
861 861
    AC_MSG_ERROR([newly created file is older than distributed files!
862 862
 Check your system clock])
863 863
 fi
864
-AC_MSG_RESULT(yes)])
864
+AC_MSG_RESULT([yes])
865
+# If we didn't sleep, we still need to ensure time stamps of config.status and
866
+# generated files are strictly newer.
867
+am_sleep_pid=
868
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
869
+  ( sleep 1 ) &
870
+  am_sleep_pid=$!
871
+fi
872
+AC_CONFIG_COMMANDS_PRE(
873
+  [AC_MSG_CHECKING([that generated files are newer than configure])
874
+   if test -n "$am_sleep_pid"; then
875
+     # Hide warnings about reused PIDs.
876
+     wait $am_sleep_pid 2>/dev/null
877
+   fi
878
+   AC_MSG_RESULT([done])])
879
+rm -f conftest.file
880
+])
865 881
 
866
-# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
882
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
867 883
 #
868 884
 # This file is free software; the Free Software Foundation
869 885
 # gives unlimited permission to copy and/or distribute it,
870 886
 # with or without modifications, as long as this notice is preserved.
871 887
 
872
-# serial 2
873
-
874 888
 # AM_SILENT_RULES([DEFAULT])
875 889
 # --------------------------
876 890
 # Enable less verbose build rules; with the default set to DEFAULT
877
-# (`yes' being less verbose, `no' or empty being verbose).
891
+# ("yes" being less verbose, "no" or empty being verbose).
878 892
 AC_DEFUN([AM_SILENT_RULES],
879
-[AC_ARG_ENABLE([silent-rules],
880
-[  --enable-silent-rules          less verbose build output (undo: `make V=1')
881
-  --disable-silent-rules         verbose build output (undo: `make V=0')])
882
-case $enable_silent_rules in
883
-yes) AM_DEFAULT_VERBOSITY=0;;
884
-no)  AM_DEFAULT_VERBOSITY=1;;
885
-*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
893
+[AC_ARG_ENABLE([silent-rules], [dnl
894
+AS_HELP_STRING(
895
+  [--enable-silent-rules],
896
+  [less verbose build output (undo: "make V=1")])
897
+AS_HELP_STRING(
898
+  [--disable-silent-rules],
899
+  [verbose build output (undo: "make V=0")])dnl
900
+])
901
+case $enable_silent_rules in @%:@ (((
902
+  yes) AM_DEFAULT_VERBOSITY=0;;
903
+   no) AM_DEFAULT_VERBOSITY=1;;
904
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
886 905
 esac
887 906
 dnl
888
-dnl A few `make' implementations (e.g., NonStop OS and NextStep)
907
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
889 908
 dnl do not support nested variable expansions.
890 909
 dnl See automake bug#9928 and bug#10237.
891 910
 am_make=${MAKE-make}
... ...
@@ -903,7 +970,7 @@ else
903 903
   am_cv_make_support_nested_variables=no
904 904
 fi])
905 905
 if test $am_cv_make_support_nested_variables = yes; then
906
-  dnl Using `$V' instead of `$(V)' breaks IRIX make.
906
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
907 907
   AM_V='$(V)'
908 908
   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
909 909
 else
... ...
@@ -920,44 +987,40 @@ AC_SUBST([AM_BACKSLASH])dnl
920 920
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
921 921
 ])
922 922
 
923
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
923
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
924 924
 #
925 925
 # This file is free software; the Free Software Foundation
926 926
 # gives unlimited permission to copy and/or distribute it,
927 927
 # with or without modifications, as long as this notice is preserved.
928 928
 
929
-# serial 1
930
-
931 929
 # AM_PROG_INSTALL_STRIP
932 930
 # ---------------------
933
-# One issue with vendor `install' (even GNU) is that you can't
931
+# One issue with vendor 'install' (even GNU) is that you can't
934 932
 # specify the program used to strip binaries.  This is especially
935 933
 # annoying in cross-compiling environments, where the build's strip
936 934
 # is unlikely to handle the host's binaries.
937 935
 # Fortunately install-sh will honor a STRIPPROG variable, so we
938
-# always use install-sh in `make install-strip', and initialize
936
+# always use install-sh in "make install-strip", and initialize
939 937
 # STRIPPROG with the value of the STRIP variable (set by the user).
940 938
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
941 939
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
942
-# Installed binaries are usually stripped using `strip' when the user
943
-# run `make install-strip'.  However `strip' might not be the right
940
+# Installed binaries are usually stripped using 'strip' when the user
941
+# run "make install-strip".  However 'strip' might not be the right
944 942
 # tool to use in cross-compilation environments, therefore Automake
945
-# will honor the `STRIP' environment variable to overrule this program.
946
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
943
+# will honor the 'STRIP' environment variable to overrule this program.
944
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
947 945
 if test "$cross_compiling" != no; then
948 946
   AC_CHECK_TOOL([STRIP], [strip], :)
949 947
 fi
950 948
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
951 949
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
952 950
 
953
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
951
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
954 952
 #
955 953
 # This file is free software; the Free Software Foundation
956 954
 # gives unlimited permission to copy and/or distribute it,
957 955
 # with or without modifications, as long as this notice is preserved.
958 956
 
959
-# serial 3
960
-
961 957
 # _AM_SUBST_NOTMAKE(VARIABLE)
962 958
 # ---------------------------
963 959
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
... ...
@@ -971,18 +1034,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
971 971
 
972 972
 # Check how to create a tarball.                            -*- Autoconf -*-
973 973
 
974
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
974
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
975 975
 #
976 976
 # This file is free software; the Free Software Foundation
977 977
 # gives unlimited permission to copy and/or distribute it,
978 978
 # with or without modifications, as long as this notice is preserved.
979 979
 
980
-# serial 2
981
-
982 980
 # _AM_PROG_TAR(FORMAT)
983 981
 # --------------------
984 982
 # Check how to create a tarball in format FORMAT.
985
-# FORMAT should be one of `v7', `ustar', or `pax'.
983
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
986 984
 #
987 985
 # Substitute a variable $(am__tar) that is a command
988 986
 # writing to stdout a FORMAT-tarball containing the directory
... ...
@@ -992,76 +1053,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
992 992
 # Substitute a variable $(am__untar) that extract such
993 993
 # a tarball read from stdin.
994 994
 #     $(am__untar) < result.tar
995
+#
995 996
 AC_DEFUN([_AM_PROG_TAR],
996 997
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
997 998
 # in the wild :-(  We should find a proper way to deprecate it ...
998 999
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
999
-m4_if([$1], [v7],
1000
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1001
-     [m4_case([$1], [ustar],, [pax],,
1002
-              [m4_fatal([Unknown tar format])])
1003
-AC_MSG_CHECKING([how to create a $1 tar archive])
1004
-# Loop over all known methods to create a tar archive until one works.
1000
+
1001
+# We'll loop over all known methods to create a tar archive until one works.
1005 1002
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1006
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1007
-# Do not fold the above two line into one, because Tru64 sh and
1008
-# Solaris sh will not grok spaces in the rhs of `-'.
1009
-for _am_tool in $_am_tools
1010
-do
1011
-  case $_am_tool in
1012
-  gnutar)
1013
-    for _am_tar in tar gnutar gtar;
1014
-    do
1015
-      AM_RUN_LOG([$_am_tar --version]) && break
1016
-    done
1017
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1018
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1019
-    am__untar="$_am_tar -xf -"
1020
-    ;;
1021
-  plaintar)
1022
-    # Must skip GNU tar: if it does not support --format= it doesn't create
1023
-    # ustar tarball either.
1024
-    (tar --version) >/dev/null 2>&1 && continue
1025
-    am__tar='tar chf - "$$tardir"'
1026
-    am__tar_='tar chf - "$tardir"'
1027
-    am__untar='tar xf -'
1028
-    ;;
1029
-  pax)
1030
-    am__tar='pax -L -x $1 -w "$$tardir"'
1031
-    am__tar_='pax -L -x $1 -w "$tardir"'
1032
-    am__untar='pax -r'
1033
-    ;;
1034
-  cpio)
1035
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1036
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1037
-    am__untar='cpio -i -H $1 -d'
1038
-    ;;
1039
-  none)
1040
-    am__tar=false
1041
-    am__tar_=false
1042
-    am__untar=false
1043
-    ;;
1044
-  esac
1045 1003
 
1046
-  # If the value was cached, stop now.  We just wanted to have am__tar
1047
-  # and am__untar set.
1048
-  test -n "${am_cv_prog_tar_$1}" && break
1004
+m4_if([$1], [v7],
1005
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1006
+
1007
+  [m4_case([$1],
1008
+    [ustar],
1009
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1010
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1011
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1012
+      # and bug#13588).
1013
+      am_max_uid=2097151 # 2^21 - 1
1014
+      am_max_gid=$am_max_uid
1015
+      # The $UID and $GID variables are not portable, so we need to resort
1016
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1017
+      # below are definitely unexpected, so allow the users to see them
1018
+      # (that is, avoid stderr redirection).
1019
+      am_uid=`id -u || echo unknown`
1020
+      am_gid=`id -g || echo unknown`
1021
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1022
+      if test $am_uid -le $am_max_uid; then
1023
+         AC_MSG_RESULT([yes])
1024
+      else
1025
+         AC_MSG_RESULT([no])
1026
+         _am_tools=none
1027
+      fi
1028
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1029
+      if test $am_gid -le $am_max_gid; then
1030
+         AC_MSG_RESULT([yes])
1031
+      else
1032
+        AC_MSG_RESULT([no])
1033
+        _am_tools=none
1034
+      fi],
1035
+
1036
+  [pax],
1037
+    [],
1038
+
1039
+  [m4_fatal([Unknown tar format])])
1040
+
1041
+  AC_MSG_CHECKING([how to create a $1 tar archive])
1042
+
1043
+  # Go ahead even if we have the value already cached.  We do so because we
1044
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
1045
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1046
+
1047
+  for _am_tool in $_am_tools; do
1048
+    case $_am_tool in
1049
+    gnutar)
1050
+      for _am_tar in tar gnutar gtar; do
1051
+        AM_RUN_LOG([$_am_tar --version]) && break
1052
+      done
1053
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1054
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1055
+      am__untar="$_am_tar -xf -"
1056
+      ;;
1057
+    plaintar)
1058
+      # Must skip GNU tar: if it does not support --format= it doesn't create
1059
+      # ustar tarball either.
1060
+      (tar --version) >/dev/null 2>&1 && continue
1061
+      am__tar='tar chf - "$$tardir"'
1062
+      am__tar_='tar chf - "$tardir"'
1063
+      am__untar='tar xf -'
1064
+      ;;
1065
+    pax)
1066
+      am__tar='pax -L -x $1 -w "$$tardir"'
1067
+      am__tar_='pax -L -x $1 -w "$tardir"'
1068
+      am__untar='pax -r'
1069
+      ;;
1070
+    cpio)
1071
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1072
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1073
+      am__untar='cpio -i -H $1 -d'
1074
+      ;;
1075
+    none)
1076
+      am__tar=false
1077
+      am__tar_=false
1078
+      am__untar=false
1079
+      ;;
1080
+    esac
1049 1081
 
1050
-  # tar/untar a dummy directory, and stop if the command works
1051
-  rm -rf conftest.dir
1052
-  mkdir conftest.dir
1053
-  echo GrepMe > conftest.dir/file
1054
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1082
+    # If the value was cached, stop now.  We just wanted to have am__tar
1083
+    # and am__untar set.
1084
+    test -n "${am_cv_prog_tar_$1}" && break
1085
+
1086
+    # tar/untar a dummy directory, and stop if the command works.
1087
+    rm -rf conftest.dir
1088
+    mkdir conftest.dir
1089
+    echo GrepMe > conftest.dir/file
1090
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1091
+    rm -rf conftest.dir
1092
+    if test -s conftest.tar; then
1093
+      AM_RUN_LOG([$am__untar <conftest.tar])
1094
+      AM_RUN_LOG([cat conftest.dir/file])
1095
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1096
+    fi
1097
+  done
1055 1098
   rm -rf conftest.dir
1056
-  if test -s conftest.tar; then
1057
-    AM_RUN_LOG([$am__untar <conftest.tar])
1058
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1059
-  fi
1060
-done
1061
-rm -rf conftest.dir
1062 1099
 
1063
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1064
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1100
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1101
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1102
+
1065 1103
 AC_SUBST([am__tar])
1066 1104
 AC_SUBST([am__untar])
1067 1105
 ]) # _AM_PROG_TAR
... ...
@@ -191,6 +191,9 @@
191 191
 /* have getaddrinfo() */
192 192
 #undef HAVE_GETADDRINFO
193 193
 
194
+/* Define to 1 if you have the `getnameinfo' function. */
195
+#undef HAVE_GETNAMEINFO
196
+
194 197
 /* Define to 1 if getpagesize() is available */
195 198
 #undef HAVE_GETPAGESIZE
196 199
 
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -56,7 +100,8 @@ target_triplet = @target@
56 56
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@sbin_PROGRAMS =  \
57 57
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	clamav-milter$(EXEEXT)
58 58
 subdir = clamav-milter
59
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
59
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
60
+	$(top_srcdir)/config/depcomp
60 61
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
61 62
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
62 63
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -155,6 +200,19 @@ clamav_milter_LDADD = $(LDADD)
155 155
 AM_V_lt = $(am__v_lt_@AM_V@)
156 156
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
157 157
 am__v_lt_0 = --silent
158
+am__v_lt_1 = 
159
+AM_V_P = $(am__v_P_@AM_V@)
160
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
161
+am__v_P_0 = false
162
+am__v_P_1 = :
163
+AM_V_GEN = $(am__v_GEN_@AM_V@)
164
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
165
+am__v_GEN_0 = @echo "  GEN     " $@;
166
+am__v_GEN_1 = 
167
+AM_V_at = $(am__v_at_@AM_V@)
168
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
169
+am__v_at_0 = @
170
+am__v_at_1 = 
158 171
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
159 172
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
160 173
 am__depfiles_maybe = depfiles
... ...
@@ -167,22 +225,23 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
167 167
 	$(AM_CFLAGS) $(CFLAGS)
168 168
 AM_V_CC = $(am__v_CC_@AM_V@)
169 169
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
170
-am__v_CC_0 = @echo "  CC    " $@;
171
-AM_V_at = $(am__v_at_@AM_V@)
172
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
173
-am__v_at_0 = @
170
+am__v_CC_0 = @echo "  CC      " $@;
171
+am__v_CC_1 = 
174 172
 CCLD = $(CC)
175 173
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
176 174
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
177 175
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
178 176
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
179 177
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
180
-am__v_CCLD_0 = @echo "  CCLD  " $@;
181
-AM_V_GEN = $(am__v_GEN_@AM_V@)
182
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
183
-am__v_GEN_0 = @echo "  GEN   " $@;
178
+am__v_CCLD_0 = @echo "  CCLD    " $@;
179
+am__v_CCLD_1 = 
184 180
 SOURCES = $(clamav_milter_SOURCES)
185 181
 DIST_SOURCES = $(am__clamav_milter_SOURCES_DIST)
182
+am__can_run_installinfo = \
183
+  case $$AM_UPDATE_INFO_DIR in \
184
+    n|no|NO) false;; \
185
+    *) (install-info --version) >/dev/null 2>&1;; \
186
+  esac
186 187
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
187 188
 am__vpath_adj = case $$p in \
188 189
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
... ...
@@ -213,6 +272,23 @@ am__uninstall_files_from_dir = { \
213 213
 man8dir = $(mandir)/man8
214 214
 NROFF = nroff
215 215
 MANS = $(man_MANS)
216
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
217
+# Read a list of newline-separated strings from the standard input,
218
+# and print each of them once, without duplicates.  Input order is
219
+# *not* preserved.
220
+am__uniquify_input = $(AWK) '\
221
+  BEGIN { nonempty = 0; } \
222
+  { items[$$0] = 1; nonempty = 1; } \
223
+  END { if (nonempty) { for (i in items) print i; }; } \
224
+'
225
+# Make sure the list of sources is unique.  This is necessary because,
226
+# e.g., the same source file might be shared among _SOURCES variables
227
+# for different programs/libraries.
228
+am__define_uniq_tagged_files = \
229
+  list='$(am__tagged_files)'; \
230
+  unique=`for i in $$list; do \
231
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
232
+  done | $(am__uniquify_input)`
216 233
 ETAGS = etags
217 234
 CTAGS = ctags
218 235
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -474,14 +550,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
474 474
 $(am__aclocal_m4_deps):
475 475
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
476 476
 	@$(NORMAL_INSTALL)
477
-	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
478 477
 	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
478
+	if test -n "$$list"; then \
479
+	  echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
480
+	  $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
481
+	fi; \
479 482
 	for p in $$list; do echo "$$p $$p"; done | \
480 483
 	sed 's/$(EXEEXT)$$//' | \
481
-	while read p p1; do if test -f $$p || test -f $$p1; \
482
-	  then echo "$$p"; echo "$$p"; else :; fi; \
484
+	while read p p1; do if test -f $$p \
485
+	 || test -f $$p1 \
486
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
483 487
 	done | \
484
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
488
+	sed -e 'p;s,.*/,,;n;h' \
489
+	    -e 's|.*|.|' \
485 490
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
486 491
 	sed 'N;N;N;s,\n, ,g' | \
487 492
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -502,7 +583,8 @@ uninstall-sbinPROGRAMS:
502 502
 	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
503 503
 	files=`for p in $$list; do echo "$$p"; done | \
504 504
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
505
-	      -e 's/$$/$(EXEEXT)/' `; \
505
+	      -e 's/$$/$(EXEEXT)/' \
506
+	`; \
506 507
 	test -n "$$list" || exit 0; \
507 508
 	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
508 509
 	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
... ...
@@ -531,6 +613,7 @@ installcheck-sbinPROGRAMS: $(sbin_PROGRAMS)
531 531
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
532 532
 	  done; \
533 533
 	done; rm -f c$${pid}_.???; exit $$bad
534
+
534 535
 clamav-milter$(EXEEXT): $(clamav_milter_OBJECTS) $(clamav_milter_DEPENDENCIES) $(EXTRA_clamav_milter_DEPENDENCIES) 
535 536
 	@rm -f clamav-milter$(EXEEXT)
536 537
 	$(AM_V_CCLD)$(LINK) $(clamav_milter_OBJECTS) $(clamav_milter_LDADD) $(LIBS)
... ...
@@ -556,14 +639,14 @@ distclean-compile:
556 556
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
557 557
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
558 558
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
559
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
559
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
560 560
 
561 561
 .c.obj:
562 562
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
563 563
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
564 564
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
565 565
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
566
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
566
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
567 567
 
568 568
 .c.lo:
569 569
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -635,11 +718,18 @@ clean-libtool:
635 635
 	-rm -rf .libs _libs
636 636
 install-man8: $(man_MANS)
637 637
 	@$(NORMAL_INSTALL)
638
-	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
639
-	@list=''; test -n "$(man8dir)" || exit 0; \
640
-	{ for i in $$list; do echo "$$i"; done; \
641
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
642
-	  sed -n '/\.8[a-z]*$$/p'; \
638
+	@list1=''; \
639
+	list2='$(man_MANS)'; \
640
+	test -n "$(man8dir)" \
641
+	  && test -n "`echo $$list1$$list2`" \
642
+	  || exit 0; \
643
+	echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
644
+	$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
645
+	{ for i in $$list1; do echo "$$i"; done;  \
646
+	if test -n "$$list2"; then \
647
+	  for i in $$list2; do echo "$$i"; done \
648
+	    | sed -n '/\.8[a-z]*$$/p'; \
649
+	fi; \
643 650
 	} | while read p; do \
644 651
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
645 652
 	  echo "$$d$$p"; echo "$$p"; \
... ...
@@ -670,26 +760,15 @@ uninstall-man8:
670 670
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
671 671
 	dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
672 672
 
673
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
674
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
675
-	unique=`for i in $$list; do \
676
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
677
-	  done | \
678
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
679
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
680
-	mkid -fID $$unique
681
-tags: TAGS
682
-
683
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
684
-		$(TAGS_FILES) $(LISP)
673
+ID: $(am__tagged_files)
674
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
675
+tags: tags-am
676
+TAGS: tags
677
+
678
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
685 679
 	set x; \
686 680
 	here=`pwd`; \
687
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
688
-	unique=`for i in $$list; do \
689
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
690
-	  done | \
691
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
692
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
681
+	$(am__define_uniq_tagged_files); \
693 682
 	shift; \
694 683
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
695 684
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -701,15 +780,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
701 701
 	      $$unique; \
702 702
 	  fi; \
703 703
 	fi
704
-ctags: CTAGS
705
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
706
-		$(TAGS_FILES) $(LISP)
707
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
708
-	unique=`for i in $$list; do \
709
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
710
-	  done | \
711
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
712
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
704
+ctags: ctags-am
705
+
706
+CTAGS: ctags
707
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
708
+	$(am__define_uniq_tagged_files); \
713 709
 	test -z "$(CTAGS_ARGS)$$unique" \
714 710
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
715 711
 	     $$unique
... ...
@@ -718,24 +793,26 @@ GTAGS:
718 718
 	here=`$(am__cd) $(top_builddir) && pwd` \
719 719
 	  && $(am__cd) $(top_srcdir) \
720 720
 	  && gtags -i $(GTAGS_ARGS) "$$here"
721
+cscopelist: cscopelist-am
722
+
723
+cscopelist-am: $(am__tagged_files)
724
+	list='$(am__tagged_files)'; \
725
+	case "$(srcdir)" in \
726
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
727
+	  *) sdir=$(subdir)/$(srcdir) ;; \
728
+	esac; \
729
+	for i in $$list; do \
730
+	  if test -f "$$i"; then \
731
+	    echo "$(subdir)/$$i"; \
732
+	  else \
733
+	    echo "$$sdir/$$i"; \
734
+	  fi; \
735
+	done >> $(top_builddir)/cscope.files
721 736
 
722 737
 distclean-tags:
723 738
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
724 739
 
725 740
 distdir: $(DISTFILES)
726
-	@list='$(MANS)'; if test -n "$$list"; then \
727
-	  list=`for p in $$list; do \
728
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
729
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
730
-	  if test -n "$$list" && \
731
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
732
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
733
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
734
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
735
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
736
-	    exit 1; \
737
-	  else :; fi; \
738
-	else :; fi
739 741
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
740 742
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
741 743
 	list='$(DISTFILES)'; \
... ...
@@ -878,19 +955,20 @@ uninstall-man: uninstall-man8
878 878
 
879 879
 .MAKE: install-am install-strip
880 880
 
881
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
882
-	clean-libtool clean-sbinPROGRAMS ctags distclean \
883
-	distclean-compile distclean-generic distclean-libtool \
884
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
885
-	install install-am install-data install-data-am install-dvi \
886
-	install-dvi-am install-exec install-exec-am install-html \
887
-	install-html-am install-info install-info-am install-man \
888
-	install-man8 install-pdf install-pdf-am install-ps \
889
-	install-ps-am install-sbinPROGRAMS install-strip installcheck \
890
-	installcheck-am installcheck-sbinPROGRAMS installdirs \
891
-	maintainer-clean maintainer-clean-generic mostlyclean \
892
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
893
-	pdf pdf-am ps ps-am tags uninstall uninstall-am uninstall-man \
881
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
882
+	clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
883
+	distclean distclean-compile distclean-generic \
884
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
885
+	html-am info info-am install install-am install-data \
886
+	install-data-am install-dvi install-dvi-am install-exec \
887
+	install-exec-am install-html install-html-am install-info \
888
+	install-info-am install-man install-man8 install-pdf \
889
+	install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
890
+	install-strip installcheck installcheck-am \
891
+	installcheck-sbinPROGRAMS installdirs maintainer-clean \
892
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
893
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
894
+	tags tags-am uninstall uninstall-am uninstall-man \
894 895
 	uninstall-man8 uninstall-sbinPROGRAMS
895 896
 
896 897
 
... ...
@@ -116,104 +116,6 @@ int main(int argc, char **argv) {
116 116
 	}
117 117
     }
118 118
 
119
-    if(!(my_socket = optget(opts, "MilterSocket")->strarg)) {
120
-	logg("!Please configure the MilterSocket directive\n");
121
-	logg_close();
122
-	optfree(opts);
123
-	return 1;
124
-    }
125
-
126
-    if(smfi_setconn(my_socket) == MI_FAILURE) {
127
-	logg("!smfi_setconn failed\n");
128
-	logg_close();
129
-	optfree(opts);
130
-	return 1;
131
-    }
132
-    if(smfi_register(descr) == MI_FAILURE) {
133
-	logg("!smfi_register failed\n");
134
-	logg_close();
135
-	optfree(opts);
136
-	return 1;
137
-    }
138
-    opt = optget(opts, "FixStaleSocket");
139
-    umsk = umask(0777); /* socket is created with 000 to avoid races */
140
-    if(smfi_opensocket(opt->enabled) == MI_FAILURE) {
141
-	logg("!Failed to create socket %s\n", my_socket);
142
-	logg_close();
143
-	optfree(opts);
144
-	return 1;
145
-    }
146
-    umask(umsk); /* restore umask */
147
-    if(strncmp(my_socket, "inet:", 5) && strncmp(my_socket, "inet6:", 6)) {
148
-	/* set group ownership and perms on the local socket */
149
-	char *sock_name = my_socket;
150
-	mode_t sock_mode;
151
-	if(!strncmp(my_socket, "unix:", 5))
152
-	    sock_name += 5;
153
-	if(!strncmp(my_socket, "local:", 6))
154
-	    sock_name += 6;
155
-	if(*my_socket == ':')
156
-	    sock_name ++;
157
-
158
-	if(optget(opts, "MilterSocketGroup")->enabled) {
159
-	    char *gname = optget(opts, "MilterSocketGroup")->strarg, *end;
160
-	    gid_t sock_gid = strtol(gname, &end, 10);
161
-	    if(*end) {
162
-		struct group *pgrp = getgrnam(gname);
163
-		if(!pgrp) {
164
-		    logg("!Unknown group %s\n", gname);
165
-		    logg_close();
166
-		    optfree(opts);
167
-		    return 1;
168
-		}
169
-		sock_gid = pgrp->gr_gid;
170
-	    }
171
-	    if(chown(sock_name, -1, sock_gid)) {
172
-		logg("!Failed to change socket ownership to group %s\n", gname);
173
-		logg_close();
174
-		optfree(opts);
175
-		return 1;
176
-	    }
177
-	}
178
-
179
-	if ((opt = optget(opts, "User"))->enabled) {
180
-	    struct passwd *user;
181
-	    if ((user = getpwnam(opt->strarg)) == NULL) {
182
-		logg("ERROR: Can't get information about user %s.\n",
183
-			opt->strarg);
184
-		logg_close();
185
-		optfree(opts);
186
-		return 1;
187
-	    }
188
-
189
-	    if(chown(sock_name, user->pw_uid, -1)) {
190
-		logg("!Failed to change socket ownership to user %s\n", user->pw_name);
191
-		optfree(opts);
192
-		logg_close();
193
-		return 1;
194
-	    }
195
-	}
196
-
197
-	if(optget(opts, "MilterSocketMode")->enabled) {
198
-	    char *end;
199
-	    sock_mode = strtol(optget(opts, "MilterSocketMode")->strarg, &end, 8);
200
-	    if(*end) {
201
-		logg("!Invalid MilterSocketMode %s\n", optget(opts, "MilterSocketMode")->strarg);
202
-		logg_close();
203
-		optfree(opts);
204
-		return 1;
205
-	    }
206
-	} else
207
-	    sock_mode = 0777 & ~umsk;
208
-
209
-	if(chmod(sock_name, sock_mode & 0666)) {
210
-	    logg("!Cannot set milter socket permission to %s\n", optget(opts, "MilterSocketMode")->strarg);
211
-	    logg_close();
212
-	    optfree(opts);
213
-	    return 1;
214
-	}
215
-    }
216
-
217 119
     if(geteuid() == 0 && (opt = optget(opts, "User"))->enabled) {
218 120
         struct passwd *user = NULL;
219 121
 	if((user = getpwnam(opt->strarg)) == NULL) {
... ...
@@ -346,6 +248,15 @@ int main(int argc, char **argv) {
346 346
 
347 347
     multircpt = optget(opts, "SupportMultipleRecipients")->enabled;
348 348
     
349
+    if(!(my_socket = optget(opts, "MilterSocket")->strarg)) {
350
+	logg("!Please configure the MilterSocket directive\n");
351
+	localnets_free();
352
+	whitelist_free();
353
+	logg_close();
354
+	optfree(opts);
355
+	return 1;
356
+    }
357
+
349 358
     if(!optget(opts, "Foreground")->enabled) {
350 359
 	if(daemonize() == -1) {
351 360
 	    logg("!daemonize() failed\n");
... ...
@@ -360,6 +271,92 @@ int main(int argc, char **argv) {
360 360
 	    logg("^Can't change current working directory to root\n");
361 361
     }
362 362
 
363
+    if(smfi_setconn(my_socket) == MI_FAILURE) {
364
+	logg("!smfi_setconn failed\n");
365
+	localnets_free();
366
+	whitelist_free();
367
+	logg_close();
368
+	optfree(opts);
369
+	return 1;
370
+    }
371
+    if(smfi_register(descr) == MI_FAILURE) {
372
+	logg("!smfi_register failed\n");
373
+	localnets_free();
374
+	whitelist_free();
375
+	logg_close();
376
+	optfree(opts);
377
+	return 1;
378
+    }
379
+    opt = optget(opts, "FixStaleSocket");
380
+    umsk = umask(0777); /* socket is created with 000 to avoid races */ 
381
+    if(smfi_opensocket(opt->enabled) == MI_FAILURE) {
382
+	logg("!Failed to create socket %s\n", my_socket);
383
+	localnets_free();
384
+	whitelist_free();
385
+	logg_close();
386
+	optfree(opts);
387
+	return 1;
388
+    }
389
+    umask(umsk); /* restore umask */
390
+    if(strncmp(my_socket, "inet:", 5) && strncmp(my_socket, "inet6:", 6)) {
391
+	/* set group ownership and perms on the local socket */
392
+	char *sock_name = my_socket;
393
+	mode_t sock_mode;
394
+	if(!strncmp(my_socket, "unix:", 5))
395
+	    sock_name += 5;
396
+	if(!strncmp(my_socket, "local:", 6))
397
+	    sock_name += 6;
398
+	if(*my_socket == ':')
399
+	    sock_name ++;
400
+
401
+	if(optget(opts, "MilterSocketGroup")->enabled) {
402
+	    char *gname = optget(opts, "MilterSocketGroup")->strarg, *end;
403
+	    gid_t sock_gid = strtol(gname, &end, 10);
404
+	    if(*end) {
405
+		struct group *pgrp = getgrnam(gname);
406
+		if(!pgrp) {
407
+		    logg("!Unknown group %s\n", gname);
408
+		    localnets_free();
409
+		    whitelist_free();
410
+		    logg_close();
411
+		    optfree(opts);
412
+		    return 1;
413
+		}
414
+		sock_gid = pgrp->gr_gid;
415
+	    }
416
+	    if(chown(sock_name, -1, sock_gid)) {
417
+		logg("!Failed to change socket ownership to group %s\n", gname);
418
+		localnets_free();
419
+		whitelist_free();
420
+		logg_close();
421
+		optfree(opts);
422
+		return 1;
423
+	    }
424
+	}
425
+	if(optget(opts, "MilterSocketMode")->enabled) {
426
+	    char *end;
427
+	    sock_mode = strtol(optget(opts, "MilterSocketMode")->strarg, &end, 8);
428
+	    if(*end) {
429
+		logg("!Invalid MilterSocketMode %s\n", optget(opts, "MilterSocketMode")->strarg);
430
+		localnets_free();
431
+		whitelist_free();
432
+		logg_close();
433
+		optfree(opts);
434
+		return 1;
435
+	    }
436
+	} else
437
+	    sock_mode = 0777 & ~umsk;
438
+
439
+	if(chmod(sock_name, sock_mode & 0666)) {
440
+	    logg("!Cannot set milter socket permission to %s\n", optget(opts, "MilterSocketMode")->strarg);
441
+	    localnets_free();
442
+	    whitelist_free();
443
+	    logg_close();
444
+	    optfree(opts);
445
+	    return 1;
446
+	}
447
+    }
448
+
363 449
     maxfilesize = optget(opts, "MaxFileSize")->numarg;
364 450
     if(!maxfilesize) {
365 451
 	logg("^Invalid MaxFileSize, using default (%d)\n", CLI_DEFAULT_MAXFILESIZE);
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -16,6 +15,51 @@
16 16
 @SET_MAKE@
17 17
 
18 18
 VPATH = @srcdir@
19
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
20
+am__make_running_with_option = \
21
+  case $${target_option-} in \
22
+      ?) ;; \
23
+      *) echo "am__make_running_with_option: internal error: invalid" \
24
+              "target option '$${target_option-}' specified" >&2; \
25
+         exit 1;; \
26
+  esac; \
27
+  has_opt=no; \
28
+  sane_makeflags=$$MAKEFLAGS; \
29
+  if $(am__is_gnu_make); then \
30
+    sane_makeflags=$$MFLAGS; \
31
+  else \
32
+    case $$MAKEFLAGS in \
33
+      *\\[\ \	]*) \
34
+        bs=\\; \
35
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
36
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
37
+    esac; \
38
+  fi; \
39
+  skip_next=no; \
40
+  strip_trailopt () \
41
+  { \
42
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
43
+  }; \
44
+  for flg in $$sane_makeflags; do \
45
+    test $$skip_next = yes && { skip_next=no; continue; }; \
46
+    case $$flg in \
47
+      *=*|--*) continue;; \
48
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
49
+      -*I?*) strip_trailopt 'I';; \
50
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
51
+      -*O?*) strip_trailopt 'O';; \
52
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
53
+      -*l?*) strip_trailopt 'l';; \
54
+      -[dEDm]) skip_next=yes;; \
55
+      -[JT]) skip_next=yes;; \
56
+    esac; \
57
+    case $$flg in \
58
+      *$$target_option*) has_opt=yes; break;; \
59
+    esac; \
60
+  done; \
61
+  test $$has_opt = yes
62
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
63
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
19 64
 pkgdatadir = $(datadir)/@PACKAGE@
20 65
 pkgincludedir = $(includedir)/@PACKAGE@
21 66
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -37,7 +81,8 @@ host_triplet = @host@
37 37
 target_triplet = @target@
38 38
 bin_PROGRAMS = clambc$(EXEEXT)
39 39
 subdir = clambc
40
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
41
+	$(top_srcdir)/config/depcomp
41 42
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42 43
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
43 44
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -121,6 +166,19 @@ clambc_LDADD = $(LDADD)
121 121
 AM_V_lt = $(am__v_lt_@AM_V@)
122 122
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
123 123
 am__v_lt_0 = --silent
124
+am__v_lt_1 = 
125
+AM_V_P = $(am__v_P_@AM_V@)
126
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
127
+am__v_P_0 = false
128
+am__v_P_1 = :
129
+AM_V_GEN = $(am__v_GEN_@AM_V@)
130
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
131
+am__v_GEN_0 = @echo "  GEN     " $@;
132
+am__v_GEN_1 = 
133
+AM_V_at = $(am__v_at_@AM_V@)
134
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
135
+am__v_at_0 = @
136
+am__v_at_1 = 
124 137
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
125 138
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
126 139
 am__depfiles_maybe = depfiles
... ...
@@ -133,22 +191,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
133 133
 	$(AM_CFLAGS) $(CFLAGS)
134 134
 AM_V_CC = $(am__v_CC_@AM_V@)
135 135
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
136
-am__v_CC_0 = @echo "  CC    " $@;
137
-AM_V_at = $(am__v_at_@AM_V@)
138
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
139
-am__v_at_0 = @
136
+am__v_CC_0 = @echo "  CC      " $@;
137
+am__v_CC_1 = 
140 138
 CCLD = $(CC)
141 139
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
142 140
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
143 141
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
144 142
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
145 143
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
146
-am__v_CCLD_0 = @echo "  CCLD  " $@;
147
-AM_V_GEN = $(am__v_GEN_@AM_V@)
148
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
149
-am__v_GEN_0 = @echo "  GEN   " $@;
144
+am__v_CCLD_0 = @echo "  CCLD    " $@;
145
+am__v_CCLD_1 = 
150 146
 SOURCES = $(clambc_SOURCES)
151 147
 DIST_SOURCES = $(clambc_SOURCES)
148
+am__can_run_installinfo = \
149
+  case $$AM_UPDATE_INFO_DIR in \
150
+    n|no|NO) false;; \
151
+    *) (install-info --version) >/dev/null 2>&1;; \
152
+  esac
153
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
154
+# Read a list of newline-separated strings from the standard input,
155
+# and print each of them once, without duplicates.  Input order is
156
+# *not* preserved.
157
+am__uniquify_input = $(AWK) '\
158
+  BEGIN { nonempty = 0; } \
159
+  { items[$$0] = 1; nonempty = 1; } \
160
+  END { if (nonempty) { for (i in items) print i; }; } \
161
+'
162
+# Make sure the list of sources is unique.  This is necessary because,
163
+# e.g., the same source file might be shared among _SOURCES variables
164
+# for different programs/libraries.
165
+am__define_uniq_tagged_files = \
166
+  list='$(am__tagged_files)'; \
167
+  unique=`for i in $$list; do \
168
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
169
+  done | $(am__uniquify_input)`
152 170
 ETAGS = etags
153 171
 CTAGS = ctags
154 172
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -399,14 +475,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
399 399
 $(am__aclocal_m4_deps):
400 400
 install-binPROGRAMS: $(bin_PROGRAMS)
401 401
 	@$(NORMAL_INSTALL)
402
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
403 402
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
403
+	if test -n "$$list"; then \
404
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
405
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
406
+	fi; \
404 407
 	for p in $$list; do echo "$$p $$p"; done | \
405 408
 	sed 's/$(EXEEXT)$$//' | \
406
-	while read p p1; do if test -f $$p || test -f $$p1; \
407
-	  then echo "$$p"; echo "$$p"; else :; fi; \
409
+	while read p p1; do if test -f $$p \
410
+	 || test -f $$p1 \
411
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
408 412
 	done | \
409
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
413
+	sed -e 'p;s,.*/,,;n;h' \
414
+	    -e 's|.*|.|' \
410 415
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
411 416
 	sed 'N;N;N;s,\n, ,g' | \
412 417
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -427,7 +508,8 @@ uninstall-binPROGRAMS:
427 427
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
428 428
 	files=`for p in $$list; do echo "$$p"; done | \
429 429
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
430
-	      -e 's/$$/$(EXEEXT)/' `; \
430
+	      -e 's/$$/$(EXEEXT)/' \
431
+	`; \
431 432
 	test -n "$$list" || exit 0; \
432 433
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
433 434
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -456,6 +538,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
456 456
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
457 457
 	  done; \
458 458
 	done; rm -f c$${pid}_.???; exit $$bad
459
+
459 460
 clambc$(EXEEXT): $(clambc_OBJECTS) $(clambc_DEPENDENCIES) $(EXTRA_clambc_DEPENDENCIES) 
460 461
 	@rm -f clambc$(EXEEXT)
461 462
 	$(AM_V_CCLD)$(LINK) $(clambc_OBJECTS) $(clambc_LDADD) $(LIBS)
... ...
@@ -476,14 +559,14 @@ distclean-compile:
476 476
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
477 477
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
478 478
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
479
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
480 480
 
481 481
 .c.obj:
482 482
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
483 483
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
484 484
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
485 485
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
486
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
486
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
487 487
 
488 488
 .c.lo:
489 489
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -540,26 +623,15 @@ mostlyclean-libtool:
540 540
 clean-libtool:
541 541
 	-rm -rf .libs _libs
542 542
 
543
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
544
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
545
-	unique=`for i in $$list; do \
546
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
547
-	  done | \
548
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
549
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
550
-	mkid -fID $$unique
551
-tags: TAGS
552
-
553
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
554
-		$(TAGS_FILES) $(LISP)
543
+ID: $(am__tagged_files)
544
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
545
+tags: tags-am
546
+TAGS: tags
547
+
548
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
555 549
 	set x; \
556 550
 	here=`pwd`; \
557
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
558
-	unique=`for i in $$list; do \
559
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
560
-	  done | \
561
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
562
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
551
+	$(am__define_uniq_tagged_files); \
563 552
 	shift; \
564 553
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
565 554
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -571,15 +643,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
571 571
 	      $$unique; \
572 572
 	  fi; \
573 573
 	fi
574
-ctags: CTAGS
575
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
576
-		$(TAGS_FILES) $(LISP)
577
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
578
-	unique=`for i in $$list; do \
579
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
580
-	  done | \
581
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
582
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
574
+ctags: ctags-am
575
+
576
+CTAGS: ctags
577
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
578
+	$(am__define_uniq_tagged_files); \
583 579
 	test -z "$(CTAGS_ARGS)$$unique" \
584 580
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
585 581
 	     $$unique
... ...
@@ -588,6 +656,21 @@ GTAGS:
588 588
 	here=`$(am__cd) $(top_builddir) && pwd` \
589 589
 	  && $(am__cd) $(top_srcdir) \
590 590
 	  && gtags -i $(GTAGS_ARGS) "$$here"
591
+cscopelist: cscopelist-am
592
+
593
+cscopelist-am: $(am__tagged_files)
594
+	list='$(am__tagged_files)'; \
595
+	case "$(srcdir)" in \
596
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
597
+	  *) sdir=$(subdir)/$(srcdir) ;; \
598
+	esac; \
599
+	for i in $$list; do \
600
+	  if test -f "$$i"; then \
601
+	    echo "$(subdir)/$$i"; \
602
+	  else \
603
+	    echo "$$sdir/$$i"; \
604
+	  fi; \
605
+	done >> $(top_builddir)/cscope.files
591 606
 
592 607
 distclean-tags:
593 608
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -732,19 +815,20 @@ uninstall-am: uninstall-binPROGRAMS
732 732
 
733 733
 .MAKE: install-am install-strip
734 734
 
735
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
736
-	clean-generic clean-libtool ctags distclean distclean-compile \
737
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
738
-	dvi-am html html-am info info-am install install-am \
739
-	install-binPROGRAMS install-data install-data-am install-dvi \
740
-	install-dvi-am install-exec install-exec-am install-html \
741
-	install-html-am install-info install-info-am install-man \
742
-	install-pdf install-pdf-am install-ps install-ps-am \
743
-	install-strip installcheck installcheck-am \
744
-	installcheck-binPROGRAMS installdirs maintainer-clean \
745
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
746
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
747
-	tags uninstall uninstall-am uninstall-binPROGRAMS
735
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
736
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
737
+	ctags ctags-am distclean distclean-compile distclean-generic \
738
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
739
+	html-am info info-am install install-am install-binPROGRAMS \
740
+	install-data install-data-am install-dvi install-dvi-am \
741
+	install-exec install-exec-am install-html install-html-am \
742
+	install-info install-info-am install-man install-pdf \
743
+	install-pdf-am install-ps install-ps-am install-strip \
744
+	installcheck installcheck-am installcheck-binPROGRAMS \
745
+	installdirs maintainer-clean maintainer-clean-generic \
746
+	mostlyclean mostlyclean-compile mostlyclean-generic \
747
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
748
+	uninstall-am uninstall-binPROGRAMS
748 749
 
749 750
 
750 751
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -60,7 +60,7 @@ static void help(void)
60 60
     printf("    --info                 -i         Print information about bytecode\n");
61 61
     printf("    --printsrc             -p         Print bytecode source\n");
62 62
     printf("    --printbcir            -c         Print IR of bytecode signature\n");
63
-    printf("    --trace <level>        -t         Set bytecode trace level 0..7 (default 7)\n");
63
+    printf("    --trace <level>        -T         Set bytecode trace level 0..7 (default 7)\n");
64 64
     printf("    --no-trace-showsource  -s         Don't show source line during tracing\n");
65 65
     printf("    --bytecode-statistics             Collect and print bytecode execution statistics\n");
66 66
     printf("    file                              file to test\n");
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,8 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 bin_PROGRAMS = clamconf$(EXEEXT)
57 57
 subdir = clamconf
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
59
+	$(top_srcdir)/config/depcomp
59 60
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 61
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 62
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -139,6 +184,19 @@ clamconf_LDADD = $(LDADD)
139 139
 AM_V_lt = $(am__v_lt_@AM_V@)
140 140
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
141 141
 am__v_lt_0 = --silent
142
+am__v_lt_1 = 
143
+AM_V_P = $(am__v_P_@AM_V@)
144
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
145
+am__v_P_0 = false
146
+am__v_P_1 = :
147
+AM_V_GEN = $(am__v_GEN_@AM_V@)
148
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
149
+am__v_GEN_0 = @echo "  GEN     " $@;
150
+am__v_GEN_1 = 
151
+AM_V_at = $(am__v_at_@AM_V@)
152
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
153
+am__v_at_0 = @
154
+am__v_at_1 = 
142 155
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
143 156
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
144 157
 am__depfiles_maybe = depfiles
... ...
@@ -151,22 +209,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
151 151
 	$(AM_CFLAGS) $(CFLAGS)
152 152
 AM_V_CC = $(am__v_CC_@AM_V@)
153 153
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
154
-am__v_CC_0 = @echo "  CC    " $@;
155
-AM_V_at = $(am__v_at_@AM_V@)
156
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
157
-am__v_at_0 = @
154
+am__v_CC_0 = @echo "  CC      " $@;
155
+am__v_CC_1 = 
158 156
 CCLD = $(CC)
159 157
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
160 158
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
161 159
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
162 160
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
163 161
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
164
-am__v_CCLD_0 = @echo "  CCLD  " $@;
165
-AM_V_GEN = $(am__v_GEN_@AM_V@)
166
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
167
-am__v_GEN_0 = @echo "  GEN   " $@;
162
+am__v_CCLD_0 = @echo "  CCLD    " $@;
163
+am__v_CCLD_1 = 
168 164
 SOURCES = $(clamconf_SOURCES)
169 165
 DIST_SOURCES = $(clamconf_SOURCES)
166
+am__can_run_installinfo = \
167
+  case $$AM_UPDATE_INFO_DIR in \
168
+    n|no|NO) false;; \
169
+    *) (install-info --version) >/dev/null 2>&1;; \
170
+  esac
171
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
172
+# Read a list of newline-separated strings from the standard input,
173
+# and print each of them once, without duplicates.  Input order is
174
+# *not* preserved.
175
+am__uniquify_input = $(AWK) '\
176
+  BEGIN { nonempty = 0; } \
177
+  { items[$$0] = 1; nonempty = 1; } \
178
+  END { if (nonempty) { for (i in items) print i; }; } \
179
+'
180
+# Make sure the list of sources is unique.  This is necessary because,
181
+# e.g., the same source file might be shared among _SOURCES variables
182
+# for different programs/libraries.
183
+am__define_uniq_tagged_files = \
184
+  list='$(am__tagged_files)'; \
185
+  unique=`for i in $$list; do \
186
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
187
+  done | $(am__uniquify_input)`
170 188
 ETAGS = etags
171 189
 CTAGS = ctags
172 190
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -422,14 +498,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
422 422
 $(am__aclocal_m4_deps):
423 423
 install-binPROGRAMS: $(bin_PROGRAMS)
424 424
 	@$(NORMAL_INSTALL)
425
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
426 425
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
426
+	if test -n "$$list"; then \
427
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
428
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
429
+	fi; \
427 430
 	for p in $$list; do echo "$$p $$p"; done | \
428 431
 	sed 's/$(EXEEXT)$$//' | \
429
-	while read p p1; do if test -f $$p || test -f $$p1; \
430
-	  then echo "$$p"; echo "$$p"; else :; fi; \
432
+	while read p p1; do if test -f $$p \
433
+	 || test -f $$p1 \
434
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
431 435
 	done | \
432
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
436
+	sed -e 'p;s,.*/,,;n;h' \
437
+	    -e 's|.*|.|' \
433 438
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
434 439
 	sed 'N;N;N;s,\n, ,g' | \
435 440
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -450,7 +531,8 @@ uninstall-binPROGRAMS:
450 450
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
451 451
 	files=`for p in $$list; do echo "$$p"; done | \
452 452
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
453
-	      -e 's/$$/$(EXEEXT)/' `; \
453
+	      -e 's/$$/$(EXEEXT)/' \
454
+	`; \
454 455
 	test -n "$$list" || exit 0; \
455 456
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
456 457
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -479,6 +561,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
479 479
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
480 480
 	  done; \
481 481
 	done; rm -f c$${pid}_.???; exit $$bad
482
+
482 483
 clamconf$(EXEEXT): $(clamconf_OBJECTS) $(clamconf_DEPENDENCIES) $(EXTRA_clamconf_DEPENDENCIES) 
483 484
 	@rm -f clamconf$(EXEEXT)
484 485
 	$(AM_V_CCLD)$(LINK) $(clamconf_OBJECTS) $(clamconf_LDADD) $(LIBS)
... ...
@@ -499,14 +582,14 @@ distclean-compile:
499 499
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
500 500
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
501 501
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
502
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
502
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
503 503
 
504 504
 .c.obj:
505 505
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
506 506
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
507 507
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
508 508
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
509
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
509
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
510 510
 
511 511
 .c.lo:
512 512
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -563,26 +646,15 @@ mostlyclean-libtool:
563 563
 clean-libtool:
564 564
 	-rm -rf .libs _libs
565 565
 
566
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
567
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
568
-	unique=`for i in $$list; do \
569
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
570
-	  done | \
571
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
572
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
573
-	mkid -fID $$unique
574
-tags: TAGS
575
-
576
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
577
-		$(TAGS_FILES) $(LISP)
566
+ID: $(am__tagged_files)
567
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
568
+tags: tags-am
569
+TAGS: tags
570
+
571
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
578 572
 	set x; \
579 573
 	here=`pwd`; \
580
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
581
-	unique=`for i in $$list; do \
582
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
583
-	  done | \
584
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
585
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
574
+	$(am__define_uniq_tagged_files); \
586 575
 	shift; \
587 576
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
588 577
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -594,15 +666,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
594 594
 	      $$unique; \
595 595
 	  fi; \
596 596
 	fi
597
-ctags: CTAGS
598
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
599
-		$(TAGS_FILES) $(LISP)
600
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
601
-	unique=`for i in $$list; do \
602
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
603
-	  done | \
604
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
605
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
597
+ctags: ctags-am
598
+
599
+CTAGS: ctags
600
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
601
+	$(am__define_uniq_tagged_files); \
606 602
 	test -z "$(CTAGS_ARGS)$$unique" \
607 603
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
608 604
 	     $$unique
... ...
@@ -611,6 +679,21 @@ GTAGS:
611 611
 	here=`$(am__cd) $(top_builddir) && pwd` \
612 612
 	  && $(am__cd) $(top_srcdir) \
613 613
 	  && gtags -i $(GTAGS_ARGS) "$$here"
614
+cscopelist: cscopelist-am
615
+
616
+cscopelist-am: $(am__tagged_files)
617
+	list='$(am__tagged_files)'; \
618
+	case "$(srcdir)" in \
619
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
620
+	  *) sdir=$(subdir)/$(srcdir) ;; \
621
+	esac; \
622
+	for i in $$list; do \
623
+	  if test -f "$$i"; then \
624
+	    echo "$(subdir)/$$i"; \
625
+	  else \
626
+	    echo "$$sdir/$$i"; \
627
+	  fi; \
628
+	done >> $(top_builddir)/cscope.files
614 629
 
615 630
 distclean-tags:
616 631
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -755,19 +838,20 @@ uninstall-am: uninstall-binPROGRAMS
755 755
 
756 756
 .MAKE: install-am install-strip
757 757
 
758
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
759
-	clean-generic clean-libtool ctags distclean distclean-compile \
760
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
761
-	dvi-am html html-am info info-am install install-am \
762
-	install-binPROGRAMS install-data install-data-am install-dvi \
763
-	install-dvi-am install-exec install-exec-am install-html \
764
-	install-html-am install-info install-info-am install-man \
765
-	install-pdf install-pdf-am install-ps install-ps-am \
766
-	install-strip installcheck installcheck-am \
767
-	installcheck-binPROGRAMS installdirs maintainer-clean \
768
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
769
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
770
-	tags uninstall uninstall-am uninstall-binPROGRAMS
758
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
759
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
760
+	ctags ctags-am distclean distclean-compile distclean-generic \
761
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
762
+	html-am info info-am install install-am install-binPROGRAMS \
763
+	install-data install-data-am install-dvi install-dvi-am \
764
+	install-exec install-exec-am install-html install-html-am \
765
+	install-info install-info-am install-man install-pdf \
766
+	install-pdf-am install-ps install-ps-am install-strip \
767
+	installcheck installcheck-am installcheck-binPROGRAMS \
768
+	installdirs maintainer-clean maintainer-clean-generic \
769
+	mostlyclean mostlyclean-compile mostlyclean-generic \
770
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
771
+	uninstall-am uninstall-binPROGRAMS
771 772
 
772 773
 
773 774
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -252,6 +252,7 @@ static void print_platform(struct cli_environment *env)
252 252
     printf("zlib version: %s (%s)\n",
253 253
 	   ZLIB_VERSION, zlibVersion());
254 254
 #endif
255
+
255 256
     if (env->triple[0])
256 257
     printf("Triple: %s\n", env->triple);
257 258
     if (env->cpu[0])
... ...
@@ -456,6 +457,12 @@ int main(int argc, char **argv)
456 456
 #ifdef HAVE_BZLIB_H
457 457
 	printf("BZIP2 ");
458 458
 #endif
459
+#ifdef HAVE_LIBXML2
460
+	printf("LIBXML2 ");
461
+#endif
462
+#ifdef HAVE_JSON
463
+	printf("JSON ");
464
+#endif
459 465
     if(have_rar)
460 466
 	printf("RAR ");
461 467
     if (have_clamjit)
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,8 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 @BUILD_CLAMD_TRUE@sbin_PROGRAMS = clamd$(EXEEXT)
57 57
 subdir = clamd
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
59
+	$(top_srcdir)/config/depcomp
59 60
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 61
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 62
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -152,6 +197,19 @@ clamd_LDADD = $(LDADD)
152 152
 AM_V_lt = $(am__v_lt_@AM_V@)
153 153
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
154 154
 am__v_lt_0 = --silent
155
+am__v_lt_1 = 
156
+AM_V_P = $(am__v_P_@AM_V@)
157
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
158
+am__v_P_0 = false
159
+am__v_P_1 = :
160
+AM_V_GEN = $(am__v_GEN_@AM_V@)
161
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
162
+am__v_GEN_0 = @echo "  GEN     " $@;
163
+am__v_GEN_1 = 
164
+AM_V_at = $(am__v_at_@AM_V@)
165
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
166
+am__v_at_0 = @
167
+am__v_at_1 = 
155 168
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
156 169
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
157 170
 am__depfiles_maybe = depfiles
... ...
@@ -164,22 +222,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
164 164
 	$(AM_CFLAGS) $(CFLAGS)
165 165
 AM_V_CC = $(am__v_CC_@AM_V@)
166 166
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
167
-am__v_CC_0 = @echo "  CC    " $@;
168
-AM_V_at = $(am__v_at_@AM_V@)
169
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
170
-am__v_at_0 = @
167
+am__v_CC_0 = @echo "  CC      " $@;
168
+am__v_CC_1 = 
171 169
 CCLD = $(CC)
172 170
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
173 171
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
174 172
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
175 173
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
176 174
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
177
-am__v_CCLD_0 = @echo "  CCLD  " $@;
178
-AM_V_GEN = $(am__v_GEN_@AM_V@)
179
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
180
-am__v_GEN_0 = @echo "  GEN   " $@;
175
+am__v_CCLD_0 = @echo "  CCLD    " $@;
176
+am__v_CCLD_1 = 
181 177
 SOURCES = $(clamd_SOURCES)
182 178
 DIST_SOURCES = $(am__clamd_SOURCES_DIST)
179
+am__can_run_installinfo = \
180
+  case $$AM_UPDATE_INFO_DIR in \
181
+    n|no|NO) false;; \
182
+    *) (install-info --version) >/dev/null 2>&1;; \
183
+  esac
184
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
185
+# Read a list of newline-separated strings from the standard input,
186
+# and print each of them once, without duplicates.  Input order is
187
+# *not* preserved.
188
+am__uniquify_input = $(AWK) '\
189
+  BEGIN { nonempty = 0; } \
190
+  { items[$$0] = 1; nonempty = 1; } \
191
+  END { if (nonempty) { for (i in items) print i; }; } \
192
+'
193
+# Make sure the list of sources is unique.  This is necessary because,
194
+# e.g., the same source file might be shared among _SOURCES variables
195
+# for different programs/libraries.
196
+am__define_uniq_tagged_files = \
197
+  list='$(am__tagged_files)'; \
198
+  unique=`for i in $$list; do \
199
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
200
+  done | $(am__uniquify_input)`
183 201
 ETAGS = etags
184 202
 CTAGS = ctags
185 203
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -453,14 +529,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
453 453
 $(am__aclocal_m4_deps):
454 454
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
455 455
 	@$(NORMAL_INSTALL)
456
-	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
457 456
 	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
457
+	if test -n "$$list"; then \
458
+	  echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
459
+	  $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
460
+	fi; \
458 461
 	for p in $$list; do echo "$$p $$p"; done | \
459 462
 	sed 's/$(EXEEXT)$$//' | \
460
-	while read p p1; do if test -f $$p || test -f $$p1; \
461
-	  then echo "$$p"; echo "$$p"; else :; fi; \
463
+	while read p p1; do if test -f $$p \
464
+	 || test -f $$p1 \
465
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
462 466
 	done | \
463
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
467
+	sed -e 'p;s,.*/,,;n;h' \
468
+	    -e 's|.*|.|' \
464 469
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
465 470
 	sed 'N;N;N;s,\n, ,g' | \
466 471
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -481,7 +562,8 @@ uninstall-sbinPROGRAMS:
481 481
 	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
482 482
 	files=`for p in $$list; do echo "$$p"; done | \
483 483
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
484
-	      -e 's/$$/$(EXEEXT)/' `; \
484
+	      -e 's/$$/$(EXEEXT)/' \
485
+	`; \
485 486
 	test -n "$$list" || exit 0; \
486 487
 	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
487 488
 	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
... ...
@@ -510,6 +592,7 @@ installcheck-sbinPROGRAMS: $(sbin_PROGRAMS)
510 510
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
511 511
 	  done; \
512 512
 	done; rm -f c$${pid}_.???; exit $$bad
513
+
513 514
 clamd$(EXEEXT): $(clamd_OBJECTS) $(clamd_DEPENDENCIES) $(EXTRA_clamd_DEPENDENCIES) 
514 515
 	@rm -f clamd$(EXEEXT)
515 516
 	$(AM_V_CCLD)$(LINK) $(clamd_OBJECTS) $(clamd_LDADD) $(LIBS)
... ...
@@ -539,14 +622,14 @@ distclean-compile:
539 539
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
540 540
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
541 541
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
542
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
542
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
543 543
 
544 544
 .c.obj:
545 545
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
546 546
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
547 547
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
548 548
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
549
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
549
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
550 550
 
551 551
 .c.lo:
552 552
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -617,26 +700,15 @@ mostlyclean-libtool:
617 617
 clean-libtool:
618 618
 	-rm -rf .libs _libs
619 619
 
620
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
621
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
622
-	unique=`for i in $$list; do \
623
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
624
-	  done | \
625
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
626
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
627
-	mkid -fID $$unique
628
-tags: TAGS
629
-
630
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
631
-		$(TAGS_FILES) $(LISP)
620
+ID: $(am__tagged_files)
621
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
622
+tags: tags-am
623
+TAGS: tags
624
+
625
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
632 626
 	set x; \
633 627
 	here=`pwd`; \
634
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
635
-	unique=`for i in $$list; do \
636
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
637
-	  done | \
638
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
639
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
628
+	$(am__define_uniq_tagged_files); \
640 629
 	shift; \
641 630
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
642 631
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -648,15 +720,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
648 648
 	      $$unique; \
649 649
 	  fi; \
650 650
 	fi
651
-ctags: CTAGS
652
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
653
-		$(TAGS_FILES) $(LISP)
654
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
655
-	unique=`for i in $$list; do \
656
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
657
-	  done | \
658
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
659
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
651
+ctags: ctags-am
652
+
653
+CTAGS: ctags
654
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
655
+	$(am__define_uniq_tagged_files); \
660 656
 	test -z "$(CTAGS_ARGS)$$unique" \
661 657
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
662 658
 	     $$unique
... ...
@@ -665,6 +733,21 @@ GTAGS:
665 665
 	here=`$(am__cd) $(top_builddir) && pwd` \
666 666
 	  && $(am__cd) $(top_srcdir) \
667 667
 	  && gtags -i $(GTAGS_ARGS) "$$here"
668
+cscopelist: cscopelist-am
669
+
670
+cscopelist-am: $(am__tagged_files)
671
+	list='$(am__tagged_files)'; \
672
+	case "$(srcdir)" in \
673
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
674
+	  *) sdir=$(subdir)/$(srcdir) ;; \
675
+	esac; \
676
+	for i in $$list; do \
677
+	  if test -f "$$i"; then \
678
+	    echo "$(subdir)/$$i"; \
679
+	  else \
680
+	    echo "$$sdir/$$i"; \
681
+	  fi; \
682
+	done >> $(top_builddir)/cscope.files
668 683
 
669 684
 distclean-tags:
670 685
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -810,20 +893,20 @@ uninstall-am: uninstall-sbinPROGRAMS
810 810
 
811 811
 .MAKE: install-am install-strip
812 812
 
813
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
814
-	clean-libtool clean-sbinPROGRAMS ctags distclean \
815
-	distclean-compile distclean-generic distclean-libtool \
816
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
817
-	install install-am install-data install-data-am install-dvi \
818
-	install-dvi-am install-exec install-exec-am install-html \
819
-	install-html-am install-info install-info-am install-man \
820
-	install-pdf install-pdf-am install-ps install-ps-am \
821
-	install-sbinPROGRAMS install-strip installcheck \
822
-	installcheck-am installcheck-sbinPROGRAMS installdirs \
823
-	maintainer-clean maintainer-clean-generic mostlyclean \
824
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
825
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
826
-	uninstall-sbinPROGRAMS
813
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
814
+	clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
815
+	distclean distclean-compile distclean-generic \
816
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
817
+	html-am info info-am install install-am install-data \
818
+	install-data-am install-dvi install-dvi-am install-exec \
819
+	install-exec-am install-html install-html-am install-info \
820
+	install-info-am install-man install-pdf install-pdf-am \
821
+	install-ps install-ps-am install-sbinPROGRAMS install-strip \
822
+	installcheck installcheck-am installcheck-sbinPROGRAMS \
823
+	installdirs maintainer-clean maintainer-clean-generic \
824
+	mostlyclean mostlyclean-compile mostlyclean-generic \
825
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
826
+	uninstall-am uninstall-sbinPROGRAMS
827 827
 
828 828
 
829 829
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1441,6 +1441,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
1441 1441
 	pthread_kill(fan_pid, SIGUSR1);
1442 1442
 	pthread_mutex_unlock(&logg_mutex);
1443 1443
 	pthread_join(fan_pid, NULL);
1444
+    free(tharg);
1444 1445
     }
1445 1446
 #endif
1446 1447
     if(engine) {
... ...
@@ -49,6 +49,7 @@
49 49
 int tcpserver(int **lsockets, unsigned int *nlsockets, char *ipaddr, const struct optstruct *opts)
50 50
 {
51 51
     struct addrinfo hints, *info, *p;
52
+    char host[NI_MAXHOST], serv[NI_MAXSERV];
52 53
     int *sockets;
53 54
     int sockfd, backlog;
54 55
     int *t;
... ...
@@ -66,19 +67,12 @@ int tcpserver(int **lsockets, unsigned int *nlsockets, char *ipaddr, const struc
66 66
     hints.ai_socktype = SOCK_STREAM;
67 67
     hints.ai_flags = AI_PASSIVE;
68 68
 
69
-#if C_LINUX
70
-    if (!(ipaddr)) {
71
-        /*
72
-         * By default, getaddrinfo() will return 0.0.0.0 if NULL is passed in as the first parameter.
73
-         * Binding to 0.0.0.0 will prevent us from also binding IPv6 ::0 (errno = EADDRINUSE). However,
74
-         * if we bind to ::0 (or shorthand, ::), then Linux will bind to both IPv4 and IPv6.
75
-         */
76
-        ipaddr = "::";
77
-    }
69
+#ifdef AI_ADDRCONFIG
70
+    hints.ai_flags |= AI_ADDRCONFIG;
78 71
 #endif
79 72
 
80 73
     if ((res = getaddrinfo(ipaddr, port, &hints, &info))) {
81
-        logg("!TCP: getaddrinfo: %s\n", gai_strerror(res));
74
+        logg("!TCP: getaddrinfo failed: %s\n", gai_strerror(res));
82 75
         return -1;
83 76
     }
84 77
 
... ...
@@ -102,26 +96,41 @@ int tcpserver(int **lsockets, unsigned int *nlsockets, char *ipaddr, const struc
102 102
             logg("!TCP: setsocktopt(SO_REUSEADDR) error: %s\n", strerror(errno));
103 103
         }
104 104
 
105
+#ifdef IPV6_V6ONLY
106
+        if (p->ai_family == AF_INET6 &&
107
+            setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) == -1) {
108
+            estr = strerror(errno);
109
+            logg("!TCP: setsocktopt(IPV6_V6ONLY) error: %s\n", estr);
110
+        }
111
+#endif /* IPV6_V6ONLY */
112
+
113
+#ifdef HAVE_GETNAMEINFO
114
+        if ((res = getnameinfo(p->ai_addr, p->ai_addrlen, host, sizeof(host),
115
+                               serv, sizeof(serv), NI_NUMERICHOST|NI_NUMERICSERV))) {
116
+            logg("!TCP: getnameinfo failed: %s\n", gai_strerror(res));
117
+            host[0] = '\0';
118
+            serv[0] = '\0';
119
+        }
120
+#else
121
+        strncpy(host, ipaddr, sizeof(host));
122
+        host[sizeof(host)-1] = '\0';
123
+        snprintf(serv, sizeof(serv), "%u", (unsigned int)(optget(opts, "TCPSocket")->numarg));
124
+#endif
105 125
         if(bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
106 126
             estr = strerror(errno);
107
-            if (ipaddr || i == 0)
108
-                logg("!TCP: bind() error when trying to listen on [%s]:%s: %s\n", ipaddr, port, estr);
127
+            logg("!TCP: Cannot bind to [%s]:%s: %s\n", host, serv, estr);
109 128
             closesocket(sockfd);
110 129
 
111 130
             continue;
112
-        } else {
113
-            if((ipaddr))
114
-                logg("#TCP: Bound to address %s on port %u\n", ipaddr, (unsigned int) optget(opts, "TCPSocket")->numarg);
115
-            else
116
-                logg("#TCP: Bound to port %u\n", (unsigned int) optget(opts, "TCPSocket")->numarg);
117 131
         }
132
+        logg("#TCP: Bound to [%s]:%s\n", host, serv);
118 133
 
119 134
         backlog = optget(opts, "MaxConnectionQueueLength")->numarg;
120 135
         logg("#TCP: Setting connection queue length to %d\n", backlog);
121 136
 
122 137
         if(listen(sockfd, backlog) == -1) {
123 138
             estr = strerror(errno);
124
-            logg("!TCP: listen() error: %s\n", estr);
139
+            logg("!TCP: Cannot listen on [%s]:%s: %s\n", host, serv, estr);
125 140
             closesocket(sockfd);
126 141
 
127 142
             continue;
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,8 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 @BUILD_CLAMD_TRUE@bin_PROGRAMS = clamdscan$(EXEEXT)
57 57
 subdir = clamdscan
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
59
+	$(top_srcdir)/config/depcomp
59 60
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 61
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 62
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -150,6 +195,19 @@ clamdscan_LDADD = $(LDADD)
150 150
 AM_V_lt = $(am__v_lt_@AM_V@)
151 151
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
152 152
 am__v_lt_0 = --silent
153
+am__v_lt_1 = 
154
+AM_V_P = $(am__v_P_@AM_V@)
155
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
156
+am__v_P_0 = false
157
+am__v_P_1 = :
158
+AM_V_GEN = $(am__v_GEN_@AM_V@)
159
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
160
+am__v_GEN_0 = @echo "  GEN     " $@;
161
+am__v_GEN_1 = 
162
+AM_V_at = $(am__v_at_@AM_V@)
163
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
164
+am__v_at_0 = @
165
+am__v_at_1 = 
153 166
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
154 167
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
155 168
 am__depfiles_maybe = depfiles
... ...
@@ -162,22 +220,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
162 162
 	$(AM_CFLAGS) $(CFLAGS)
163 163
 AM_V_CC = $(am__v_CC_@AM_V@)
164 164
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
165
-am__v_CC_0 = @echo "  CC    " $@;
166
-AM_V_at = $(am__v_at_@AM_V@)
167
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
168
-am__v_at_0 = @
165
+am__v_CC_0 = @echo "  CC      " $@;
166
+am__v_CC_1 = 
169 167
 CCLD = $(CC)
170 168
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
171 169
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
172 170
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
173 171
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
174 172
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
175
-am__v_CCLD_0 = @echo "  CCLD  " $@;
176
-AM_V_GEN = $(am__v_GEN_@AM_V@)
177
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
178
-am__v_GEN_0 = @echo "  GEN   " $@;
173
+am__v_CCLD_0 = @echo "  CCLD    " $@;
174
+am__v_CCLD_1 = 
179 175
 SOURCES = $(clamdscan_SOURCES)
180 176
 DIST_SOURCES = $(am__clamdscan_SOURCES_DIST)
177
+am__can_run_installinfo = \
178
+  case $$AM_UPDATE_INFO_DIR in \
179
+    n|no|NO) false;; \
180
+    *) (install-info --version) >/dev/null 2>&1;; \
181
+  esac
182
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
183
+# Read a list of newline-separated strings from the standard input,
184
+# and print each of them once, without duplicates.  Input order is
185
+# *not* preserved.
186
+am__uniquify_input = $(AWK) '\
187
+  BEGIN { nonempty = 0; } \
188
+  { items[$$0] = 1; nonempty = 1; } \
189
+  END { if (nonempty) { for (i in items) print i; }; } \
190
+'
191
+# Make sure the list of sources is unique.  This is necessary because,
192
+# e.g., the same source file might be shared among _SOURCES variables
193
+# for different programs/libraries.
194
+am__define_uniq_tagged_files = \
195
+  list='$(am__tagged_files)'; \
196
+  unique=`for i in $$list; do \
197
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
198
+  done | $(am__uniquify_input)`
181 199
 ETAGS = etags
182 200
 CTAGS = ctags
183 201
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -439,14 +515,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
439 439
 $(am__aclocal_m4_deps):
440 440
 install-binPROGRAMS: $(bin_PROGRAMS)
441 441
 	@$(NORMAL_INSTALL)
442
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
443 442
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
443
+	if test -n "$$list"; then \
444
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
445
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
446
+	fi; \
444 447
 	for p in $$list; do echo "$$p $$p"; done | \
445 448
 	sed 's/$(EXEEXT)$$//' | \
446
-	while read p p1; do if test -f $$p || test -f $$p1; \
447
-	  then echo "$$p"; echo "$$p"; else :; fi; \
449
+	while read p p1; do if test -f $$p \
450
+	 || test -f $$p1 \
451
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
448 452
 	done | \
449
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
453
+	sed -e 'p;s,.*/,,;n;h' \
454
+	    -e 's|.*|.|' \
450 455
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
451 456
 	sed 'N;N;N;s,\n, ,g' | \
452 457
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -467,7 +548,8 @@ uninstall-binPROGRAMS:
467 467
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
468 468
 	files=`for p in $$list; do echo "$$p"; done | \
469 469
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
470
-	      -e 's/$$/$(EXEEXT)/' `; \
470
+	      -e 's/$$/$(EXEEXT)/' \
471
+	`; \
471 472
 	test -n "$$list" || exit 0; \
472 473
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
473 474
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -496,6 +578,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
496 496
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
497 497
 	  done; \
498 498
 	done; rm -f c$${pid}_.???; exit $$bad
499
+
499 500
 clamdscan$(EXEEXT): $(clamdscan_OBJECTS) $(clamdscan_DEPENDENCIES) $(EXTRA_clamdscan_DEPENDENCIES) 
500 501
 	@rm -f clamdscan$(EXEEXT)
501 502
 	$(AM_V_CCLD)$(LINK) $(clamdscan_OBJECTS) $(clamdscan_LDADD) $(LIBS)
... ...
@@ -521,14 +604,14 @@ distclean-compile:
521 521
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
522 522
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
523 523
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
524
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
524
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
525 525
 
526 526
 .c.obj:
527 527
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
528 528
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
529 529
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
530 530
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
531
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
531
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
532 532
 
533 533
 .c.lo:
534 534
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -627,26 +710,15 @@ mostlyclean-libtool:
627 627
 clean-libtool:
628 628
 	-rm -rf .libs _libs
629 629
 
630
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
631
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
632
-	unique=`for i in $$list; do \
633
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
634
-	  done | \
635
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
636
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
637
-	mkid -fID $$unique
638
-tags: TAGS
639
-
640
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
641
-		$(TAGS_FILES) $(LISP)
630
+ID: $(am__tagged_files)
631
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
632
+tags: tags-am
633
+TAGS: tags
634
+
635
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
642 636
 	set x; \
643 637
 	here=`pwd`; \
644
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
645
-	unique=`for i in $$list; do \
646
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
647
-	  done | \
648
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
649
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
638
+	$(am__define_uniq_tagged_files); \
650 639
 	shift; \
651 640
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
652 641
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -658,15 +730,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
658 658
 	      $$unique; \
659 659
 	  fi; \
660 660
 	fi
661
-ctags: CTAGS
662
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
663
-		$(TAGS_FILES) $(LISP)
664
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
665
-	unique=`for i in $$list; do \
666
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
667
-	  done | \
668
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
669
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
661
+ctags: ctags-am
662
+
663
+CTAGS: ctags
664
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
665
+	$(am__define_uniq_tagged_files); \
670 666
 	test -z "$(CTAGS_ARGS)$$unique" \
671 667
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
672 668
 	     $$unique
... ...
@@ -675,6 +743,21 @@ GTAGS:
675 675
 	here=`$(am__cd) $(top_builddir) && pwd` \
676 676
 	  && $(am__cd) $(top_srcdir) \
677 677
 	  && gtags -i $(GTAGS_ARGS) "$$here"
678
+cscopelist: cscopelist-am
679
+
680
+cscopelist-am: $(am__tagged_files)
681
+	list='$(am__tagged_files)'; \
682
+	case "$(srcdir)" in \
683
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
684
+	  *) sdir=$(subdir)/$(srcdir) ;; \
685
+	esac; \
686
+	for i in $$list; do \
687
+	  if test -f "$$i"; then \
688
+	    echo "$(subdir)/$$i"; \
689
+	  else \
690
+	    echo "$$sdir/$$i"; \
691
+	  fi; \
692
+	done >> $(top_builddir)/cscope.files
678 693
 
679 694
 distclean-tags:
680 695
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -819,19 +902,20 @@ uninstall-am: uninstall-binPROGRAMS
819 819
 
820 820
 .MAKE: install-am install-strip
821 821
 
822
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
823
-	clean-generic clean-libtool ctags distclean distclean-compile \
824
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
825
-	dvi-am html html-am info info-am install install-am \
826
-	install-binPROGRAMS install-data install-data-am install-dvi \
827
-	install-dvi-am install-exec install-exec-am install-html \
828
-	install-html-am install-info install-info-am install-man \
829
-	install-pdf install-pdf-am install-ps install-ps-am \
830
-	install-strip installcheck installcheck-am \
831
-	installcheck-binPROGRAMS installdirs maintainer-clean \
832
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
833
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
834
-	tags uninstall uninstall-am uninstall-binPROGRAMS
822
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
823
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
824
+	ctags ctags-am distclean distclean-compile distclean-generic \
825
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
826
+	html-am info info-am install install-am install-binPROGRAMS \
827
+	install-data install-data-am install-dvi install-dvi-am \
828
+	install-exec install-exec-am install-html install-html-am \
829
+	install-info install-info-am install-man install-pdf \
830
+	install-pdf-am install-ps install-ps-am install-strip \
831
+	installcheck installcheck-am installcheck-binPROGRAMS \
832
+	installdirs maintainer-clean maintainer-clean-generic \
833
+	mostlyclean mostlyclean-compile mostlyclean-generic \
834
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
835
+	uninstall-am uninstall-binPROGRAMS
835 836
 
836 837
 
837 838
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -16,6 +15,51 @@
16 16
 @SET_MAKE@
17 17
 
18 18
 VPATH = @srcdir@
19
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
20
+am__make_running_with_option = \
21
+  case $${target_option-} in \
22
+      ?) ;; \
23
+      *) echo "am__make_running_with_option: internal error: invalid" \
24
+              "target option '$${target_option-}' specified" >&2; \
25
+         exit 1;; \
26
+  esac; \
27
+  has_opt=no; \
28
+  sane_makeflags=$$MAKEFLAGS; \
29
+  if $(am__is_gnu_make); then \
30
+    sane_makeflags=$$MFLAGS; \
31
+  else \
32
+    case $$MAKEFLAGS in \
33
+      *\\[\ \	]*) \
34
+        bs=\\; \
35
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
36
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
37
+    esac; \
38
+  fi; \
39
+  skip_next=no; \
40
+  strip_trailopt () \
41
+  { \
42
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
43
+  }; \
44
+  for flg in $$sane_makeflags; do \
45
+    test $$skip_next = yes && { skip_next=no; continue; }; \
46
+    case $$flg in \
47
+      *=*|--*) continue;; \
48
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
49
+      -*I?*) strip_trailopt 'I';; \
50
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
51
+      -*O?*) strip_trailopt 'O';; \
52
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
53
+      -*l?*) strip_trailopt 'l';; \
54
+      -[dEDm]) skip_next=yes;; \
55
+      -[JT]) skip_next=yes;; \
56
+    esac; \
57
+    case $$flg in \
58
+      *$$target_option*) has_opt=yes; break;; \
59
+    esac; \
60
+  done; \
61
+  test $$has_opt = yes
62
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
63
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
19 64
 pkgdatadir = $(datadir)/@PACKAGE@
20 65
 pkgincludedir = $(includedir)/@PACKAGE@
21 66
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -37,7 +81,8 @@ host_triplet = @host@
37 37
 target_triplet = @target@
38 38
 @HAVE_CURSES_TRUE@bin_PROGRAMS = clamdtop$(EXEEXT)
39 39
 subdir = clamdtop
40
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
41
+	$(top_srcdir)/config/depcomp
41 42
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42 43
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
43 44
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -126,6 +171,19 @@ clamdtop_OBJECTS = $(am_clamdtop_OBJECTS)
126 126
 AM_V_lt = $(am__v_lt_@AM_V@)
127 127
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
128 128
 am__v_lt_0 = --silent
129
+am__v_lt_1 = 
130
+AM_V_P = $(am__v_P_@AM_V@)
131
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
132
+am__v_P_0 = false
133
+am__v_P_1 = :
134
+AM_V_GEN = $(am__v_GEN_@AM_V@)
135
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
136
+am__v_GEN_0 = @echo "  GEN     " $@;
137
+am__v_GEN_1 = 
138
+AM_V_at = $(am__v_at_@AM_V@)
139
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
140
+am__v_at_0 = @
141
+am__v_at_1 = 
129 142
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
130 143
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
131 144
 am__depfiles_maybe = depfiles
... ...
@@ -138,22 +196,23 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
138 138
 	$(AM_CFLAGS) $(CFLAGS)
139 139
 AM_V_CC = $(am__v_CC_@AM_V@)
140 140
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
141
-am__v_CC_0 = @echo "  CC    " $@;
142
-AM_V_at = $(am__v_at_@AM_V@)
143
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
144
-am__v_at_0 = @
141
+am__v_CC_0 = @echo "  CC      " $@;
142
+am__v_CC_1 = 
145 143
 CCLD = $(CC)
146 144
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
147 145
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
148 146
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
149 147
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
150 148
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
151
-am__v_CCLD_0 = @echo "  CCLD  " $@;
152
-AM_V_GEN = $(am__v_GEN_@AM_V@)
153
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
154
-am__v_GEN_0 = @echo "  GEN   " $@;
149
+am__v_CCLD_0 = @echo "  CCLD    " $@;
150
+am__v_CCLD_1 = 
155 151
 SOURCES = $(clamdtop_SOURCES)
156 152
 DIST_SOURCES = $(am__clamdtop_SOURCES_DIST)
153
+am__can_run_installinfo = \
154
+  case $$AM_UPDATE_INFO_DIR in \
155
+    n|no|NO) false;; \
156
+    *) (install-info --version) >/dev/null 2>&1;; \
157
+  esac
157 158
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
158 159
 am__vpath_adj = case $$p in \
159 160
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
... ...
@@ -184,6 +243,23 @@ am__uninstall_files_from_dir = { \
184 184
 man1dir = $(mandir)/man1
185 185
 NROFF = nroff
186 186
 MANS = $(man_MANS)
187
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
188
+# Read a list of newline-separated strings from the standard input,
189
+# and print each of them once, without duplicates.  Input order is
190
+# *not* preserved.
191
+am__uniquify_input = $(AWK) '\
192
+  BEGIN { nonempty = 0; } \
193
+  { items[$$0] = 1; nonempty = 1; } \
194
+  END { if (nonempty) { for (i in items) print i; }; } \
195
+'
196
+# Make sure the list of sources is unique.  This is necessary because,
197
+# e.g., the same source file might be shared among _SOURCES variables
198
+# for different programs/libraries.
199
+am__define_uniq_tagged_files = \
200
+  list='$(am__tagged_files)'; \
201
+  unique=`for i in $$list; do \
202
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
203
+  done | $(am__uniquify_input)`
187 204
 ETAGS = etags
188 205
 CTAGS = ctags
189 206
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -436,14 +512,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
436 436
 $(am__aclocal_m4_deps):
437 437
 install-binPROGRAMS: $(bin_PROGRAMS)
438 438
 	@$(NORMAL_INSTALL)
439
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
440 439
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
440
+	if test -n "$$list"; then \
441
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
442
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
443
+	fi; \
441 444
 	for p in $$list; do echo "$$p $$p"; done | \
442 445
 	sed 's/$(EXEEXT)$$//' | \
443
-	while read p p1; do if test -f $$p || test -f $$p1; \
444
-	  then echo "$$p"; echo "$$p"; else :; fi; \
446
+	while read p p1; do if test -f $$p \
447
+	 || test -f $$p1 \
448
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
445 449
 	done | \
446
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
450
+	sed -e 'p;s,.*/,,;n;h' \
451
+	    -e 's|.*|.|' \
447 452
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
448 453
 	sed 'N;N;N;s,\n, ,g' | \
449 454
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -464,7 +545,8 @@ uninstall-binPROGRAMS:
464 464
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
465 465
 	files=`for p in $$list; do echo "$$p"; done | \
466 466
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
467
-	      -e 's/$$/$(EXEEXT)/' `; \
467
+	      -e 's/$$/$(EXEEXT)/' \
468
+	`; \
468 469
 	test -n "$$list" || exit 0; \
469 470
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
470 471
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -493,6 +575,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
493 493
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
494 494
 	  done; \
495 495
 	done; rm -f c$${pid}_.???; exit $$bad
496
+
496 497
 clamdtop$(EXEEXT): $(clamdtop_OBJECTS) $(clamdtop_DEPENDENCIES) $(EXTRA_clamdtop_DEPENDENCIES) 
497 498
 	@rm -f clamdtop$(EXEEXT)
498 499
 	$(AM_V_CCLD)$(LINK) $(clamdtop_OBJECTS) $(clamdtop_LDADD) $(LIBS)
... ...
@@ -513,14 +596,14 @@ distclean-compile:
513 513
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
514 514
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
515 515
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
516
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
516
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
517 517
 
518 518
 .c.obj:
519 519
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
520 520
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
521 521
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
522 522
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
523
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
523
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
524 524
 
525 525
 .c.lo:
526 526
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -578,11 +661,18 @@ clean-libtool:
578 578
 	-rm -rf .libs _libs
579 579
 install-man1: $(man_MANS)
580 580
 	@$(NORMAL_INSTALL)
581
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
582
-	@list=''; test -n "$(man1dir)" || exit 0; \
583
-	{ for i in $$list; do echo "$$i"; done; \
584
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
585
-	  sed -n '/\.1[a-z]*$$/p'; \
581
+	@list1=''; \
582
+	list2='$(man_MANS)'; \
583
+	test -n "$(man1dir)" \
584
+	  && test -n "`echo $$list1$$list2`" \
585
+	  || exit 0; \
586
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
587
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
588
+	{ for i in $$list1; do echo "$$i"; done;  \
589
+	if test -n "$$list2"; then \
590
+	  for i in $$list2; do echo "$$i"; done \
591
+	    | sed -n '/\.1[a-z]*$$/p'; \
592
+	fi; \
586 593
 	} | while read p; do \
587 594
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
588 595
 	  echo "$$d$$p"; echo "$$p"; \
... ...
@@ -613,26 +703,15 @@ uninstall-man1:
613 613
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
614 614
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
615 615
 
616
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
617
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
618
-	unique=`for i in $$list; do \
619
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
620
-	  done | \
621
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
622
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
623
-	mkid -fID $$unique
624
-tags: TAGS
625
-
626
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
627
-		$(TAGS_FILES) $(LISP)
616
+ID: $(am__tagged_files)
617
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
618
+tags: tags-am
619
+TAGS: tags
620
+
621
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
628 622
 	set x; \
629 623
 	here=`pwd`; \
630
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
631
-	unique=`for i in $$list; do \
632
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
633
-	  done | \
634
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
635
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
624
+	$(am__define_uniq_tagged_files); \
636 625
 	shift; \
637 626
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
638 627
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -644,15 +723,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
644 644
 	      $$unique; \
645 645
 	  fi; \
646 646
 	fi
647
-ctags: CTAGS
648
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
649
-		$(TAGS_FILES) $(LISP)
650
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
651
-	unique=`for i in $$list; do \
652
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
653
-	  done | \
654
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
655
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
647
+ctags: ctags-am
648
+
649
+CTAGS: ctags
650
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
651
+	$(am__define_uniq_tagged_files); \
656 652
 	test -z "$(CTAGS_ARGS)$$unique" \
657 653
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
658 654
 	     $$unique
... ...
@@ -661,24 +736,26 @@ GTAGS:
661 661
 	here=`$(am__cd) $(top_builddir) && pwd` \
662 662
 	  && $(am__cd) $(top_srcdir) \
663 663
 	  && gtags -i $(GTAGS_ARGS) "$$here"
664
+cscopelist: cscopelist-am
665
+
666
+cscopelist-am: $(am__tagged_files)
667
+	list='$(am__tagged_files)'; \
668
+	case "$(srcdir)" in \
669
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
670
+	  *) sdir=$(subdir)/$(srcdir) ;; \
671
+	esac; \
672
+	for i in $$list; do \
673
+	  if test -f "$$i"; then \
674
+	    echo "$(subdir)/$$i"; \
675
+	  else \
676
+	    echo "$$sdir/$$i"; \
677
+	  fi; \
678
+	done >> $(top_builddir)/cscope.files
664 679
 
665 680
 distclean-tags:
666 681
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
667 682
 
668 683
 distdir: $(DISTFILES)
669
-	@list='$(MANS)'; if test -n "$$list"; then \
670
-	  list=`for p in $$list; do \
671
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
672
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
673
-	  if test -n "$$list" && \
674
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
675
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
676
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
677
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
678
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
679
-	    exit 1; \
680
-	  else :; fi; \
681
-	else :; fi
682 684
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
683 685
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
684 686
 	list='$(DISTFILES)'; \
... ...
@@ -819,19 +896,20 @@ uninstall-man: uninstall-man1
819 819
 
820 820
 .MAKE: install-am install-strip
821 821
 
822
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
823
-	clean-generic clean-libtool ctags distclean distclean-compile \
824
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
825
-	dvi-am html html-am info info-am install install-am \
826
-	install-binPROGRAMS install-data install-data-am install-dvi \
827
-	install-dvi-am install-exec install-exec-am install-html \
828
-	install-html-am install-info install-info-am install-man \
829
-	install-man1 install-pdf install-pdf-am install-ps \
830
-	install-ps-am install-strip installcheck installcheck-am \
822
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
823
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
824
+	ctags ctags-am distclean distclean-compile distclean-generic \
825
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
826
+	html-am info info-am install install-am install-binPROGRAMS \
827
+	install-data install-data-am install-dvi install-dvi-am \
828
+	install-exec install-exec-am install-html install-html-am \
829
+	install-info install-info-am install-man install-man1 \
830
+	install-pdf install-pdf-am install-ps install-ps-am \
831
+	install-strip installcheck installcheck-am \
831 832
 	installcheck-binPROGRAMS installdirs maintainer-clean \
832 833
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
833 834
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
834
-	tags uninstall uninstall-am uninstall-binPROGRAMS \
835
+	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
835 836
 	uninstall-man uninstall-man1
836 837
 
837 838
 
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -35,6 +34,51 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
39
+am__make_running_with_option = \
40
+  case $${target_option-} in \
41
+      ?) ;; \
42
+      *) echo "am__make_running_with_option: internal error: invalid" \
43
+              "target option '$${target_option-}' specified" >&2; \
44
+         exit 1;; \
45
+  esac; \
46
+  has_opt=no; \
47
+  sane_makeflags=$$MAKEFLAGS; \
48
+  if $(am__is_gnu_make); then \
49
+    sane_makeflags=$$MFLAGS; \
50
+  else \
51
+    case $$MAKEFLAGS in \
52
+      *\\[\ \	]*) \
53
+        bs=\\; \
54
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
55
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
56
+    esac; \
57
+  fi; \
58
+  skip_next=no; \
59
+  strip_trailopt () \
60
+  { \
61
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
62
+  }; \
63
+  for flg in $$sane_makeflags; do \
64
+    test $$skip_next = yes && { skip_next=no; continue; }; \
65
+    case $$flg in \
66
+      *=*|--*) continue;; \
67
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
68
+      -*I?*) strip_trailopt 'I';; \
69
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
70
+      -*O?*) strip_trailopt 'O';; \
71
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
72
+      -*l?*) strip_trailopt 'l';; \
73
+      -[dEDm]) skip_next=yes;; \
74
+      -[JT]) skip_next=yes;; \
75
+    esac; \
76
+    case $$flg in \
77
+      *$$target_option*) has_opt=yes; break;; \
78
+    esac; \
79
+  done; \
80
+  test $$has_opt = yes
81
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
82
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
38 83
 pkgdatadir = $(datadir)/@PACKAGE@
39 84
 pkgincludedir = $(includedir)/@PACKAGE@
40 85
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -56,7 +100,8 @@ host_triplet = @host@
56 56
 target_triplet = @target@
57 57
 bin_PROGRAMS = clamscan$(EXEEXT)
58 58
 subdir = clamscan
59
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
59
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
60
+	$(top_srcdir)/config/depcomp
60 61
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
61 62
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
62 63
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -141,6 +186,19 @@ clamscan_LDADD = $(LDADD)
141 141
 AM_V_lt = $(am__v_lt_@AM_V@)
142 142
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
143 143
 am__v_lt_0 = --silent
144
+am__v_lt_1 = 
145
+AM_V_P = $(am__v_P_@AM_V@)
146
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
147
+am__v_P_0 = false
148
+am__v_P_1 = :
149
+AM_V_GEN = $(am__v_GEN_@AM_V@)
150
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
151
+am__v_GEN_0 = @echo "  GEN     " $@;
152
+am__v_GEN_1 = 
153
+AM_V_at = $(am__v_at_@AM_V@)
154
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
155
+am__v_at_0 = @
156
+am__v_at_1 = 
144 157
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
145 158
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
146 159
 am__depfiles_maybe = depfiles
... ...
@@ -153,22 +211,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
153 153
 	$(AM_CFLAGS) $(CFLAGS)
154 154
 AM_V_CC = $(am__v_CC_@AM_V@)
155 155
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
156
-am__v_CC_0 = @echo "  CC    " $@;
157
-AM_V_at = $(am__v_at_@AM_V@)
158
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
159
-am__v_at_0 = @
156
+am__v_CC_0 = @echo "  CC      " $@;
157
+am__v_CC_1 = 
160 158
 CCLD = $(CC)
161 159
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
162 160
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
163 161
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
164 162
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
165 163
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
166
-am__v_CCLD_0 = @echo "  CCLD  " $@;
167
-AM_V_GEN = $(am__v_GEN_@AM_V@)
168
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
169
-am__v_GEN_0 = @echo "  GEN   " $@;
164
+am__v_CCLD_0 = @echo "  CCLD    " $@;
165
+am__v_CCLD_1 = 
170 166
 SOURCES = $(clamscan_SOURCES)
171 167
 DIST_SOURCES = $(clamscan_SOURCES)
168
+am__can_run_installinfo = \
169
+  case $$AM_UPDATE_INFO_DIR in \
170
+    n|no|NO) false;; \
171
+    *) (install-info --version) >/dev/null 2>&1;; \
172
+  esac
173
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
174
+# Read a list of newline-separated strings from the standard input,
175
+# and print each of them once, without duplicates.  Input order is
176
+# *not* preserved.
177
+am__uniquify_input = $(AWK) '\
178
+  BEGIN { nonempty = 0; } \
179
+  { items[$$0] = 1; nonempty = 1; } \
180
+  END { if (nonempty) { for (i in items) print i; }; } \
181
+'
182
+# Make sure the list of sources is unique.  This is necessary because,
183
+# e.g., the same source file might be shared among _SOURCES variables
184
+# for different programs/libraries.
185
+am__define_uniq_tagged_files = \
186
+  list='$(am__tagged_files)'; \
187
+  unique=`for i in $$list; do \
188
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
189
+  done | $(am__uniquify_input)`
172 190
 ETAGS = etags
173 191
 CTAGS = ctags
174 192
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -426,14 +502,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
426 426
 $(am__aclocal_m4_deps):
427 427
 install-binPROGRAMS: $(bin_PROGRAMS)
428 428
 	@$(NORMAL_INSTALL)
429
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
430 429
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
430
+	if test -n "$$list"; then \
431
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
432
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
433
+	fi; \
431 434
 	for p in $$list; do echo "$$p $$p"; done | \
432 435
 	sed 's/$(EXEEXT)$$//' | \
433
-	while read p p1; do if test -f $$p || test -f $$p1; \
434
-	  then echo "$$p"; echo "$$p"; else :; fi; \
436
+	while read p p1; do if test -f $$p \
437
+	 || test -f $$p1 \
438
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
435 439
 	done | \
436
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
440
+	sed -e 'p;s,.*/,,;n;h' \
441
+	    -e 's|.*|.|' \
437 442
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
438 443
 	sed 'N;N;N;s,\n, ,g' | \
439 444
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -454,7 +535,8 @@ uninstall-binPROGRAMS:
454 454
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
455 455
 	files=`for p in $$list; do echo "$$p"; done | \
456 456
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
457
-	      -e 's/$$/$(EXEEXT)/' `; \
457
+	      -e 's/$$/$(EXEEXT)/' \
458
+	`; \
458 459
 	test -n "$$list" || exit 0; \
459 460
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
460 461
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -483,6 +565,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
483 483
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
484 484
 	  done; \
485 485
 	done; rm -f c$${pid}_.???; exit $$bad
486
+
486 487
 clamscan$(EXEEXT): $(clamscan_OBJECTS) $(clamscan_DEPENDENCIES) $(EXTRA_clamscan_DEPENDENCIES) 
487 488
 	@rm -f clamscan$(EXEEXT)
488 489
 	$(AM_V_CCLD)$(LINK) $(clamscan_OBJECTS) $(clamscan_LDADD) $(LIBS)
... ...
@@ -506,14 +589,14 @@ distclean-compile:
506 506
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
507 507
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
508 508
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
509
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
509
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
510 510
 
511 511
 .c.obj:
512 512
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
513 513
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
514 514
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
515 515
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
516
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
516
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
517 517
 
518 518
 .c.lo:
519 519
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -598,26 +681,15 @@ mostlyclean-libtool:
598 598
 clean-libtool:
599 599
 	-rm -rf .libs _libs
600 600
 
601
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
602
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
603
-	unique=`for i in $$list; do \
604
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
605
-	  done | \
606
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
607
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
608
-	mkid -fID $$unique
609
-tags: TAGS
610
-
611
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
612
-		$(TAGS_FILES) $(LISP)
601
+ID: $(am__tagged_files)
602
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
603
+tags: tags-am
604
+TAGS: tags
605
+
606
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
613 607
 	set x; \
614 608
 	here=`pwd`; \
615
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
616
-	unique=`for i in $$list; do \
617
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
618
-	  done | \
619
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
620
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
609
+	$(am__define_uniq_tagged_files); \
621 610
 	shift; \
622 611
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
623 612
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -629,15 +701,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
629 629
 	      $$unique; \
630 630
 	  fi; \
631 631
 	fi
632
-ctags: CTAGS
633
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
634
-		$(TAGS_FILES) $(LISP)
635
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
636
-	unique=`for i in $$list; do \
637
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
638
-	  done | \
639
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
640
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
632
+ctags: ctags-am
633
+
634
+CTAGS: ctags
635
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
636
+	$(am__define_uniq_tagged_files); \
641 637
 	test -z "$(CTAGS_ARGS)$$unique" \
642 638
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
643 639
 	     $$unique
... ...
@@ -646,6 +714,21 @@ GTAGS:
646 646
 	here=`$(am__cd) $(top_builddir) && pwd` \
647 647
 	  && $(am__cd) $(top_srcdir) \
648 648
 	  && gtags -i $(GTAGS_ARGS) "$$here"
649
+cscopelist: cscopelist-am
650
+
651
+cscopelist-am: $(am__tagged_files)
652
+	list='$(am__tagged_files)'; \
653
+	case "$(srcdir)" in \
654
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
655
+	  *) sdir=$(subdir)/$(srcdir) ;; \
656
+	esac; \
657
+	for i in $$list; do \
658
+	  if test -f "$$i"; then \
659
+	    echo "$(subdir)/$$i"; \
660
+	  else \
661
+	    echo "$$sdir/$$i"; \
662
+	  fi; \
663
+	done >> $(top_builddir)/cscope.files
649 664
 
650 665
 distclean-tags:
651 666
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -790,19 +873,20 @@ uninstall-am: uninstall-binPROGRAMS
790 790
 
791 791
 .MAKE: install-am install-strip
792 792
 
793
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
794
-	clean-generic clean-libtool ctags distclean distclean-compile \
795
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
796
-	dvi-am html html-am info info-am install install-am \
797
-	install-binPROGRAMS install-data install-data-am install-dvi \
798
-	install-dvi-am install-exec install-exec-am install-html \
799
-	install-html-am install-info install-info-am install-man \
800
-	install-pdf install-pdf-am install-ps install-ps-am \
801
-	install-strip installcheck installcheck-am \
802
-	installcheck-binPROGRAMS installdirs maintainer-clean \
803
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
804
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
805
-	tags uninstall uninstall-am uninstall-binPROGRAMS
793
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
794
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
795
+	ctags ctags-am distclean distclean-compile distclean-generic \
796
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
797
+	html-am info info-am install install-am install-binPROGRAMS \
798
+	install-data install-data-am install-dvi install-dvi-am \
799
+	install-exec install-exec-am install-html install-html-am \
800
+	install-info install-info-am install-man install-pdf \
801
+	install-pdf-am install-ps install-ps-am install-strip \
802
+	installcheck installcheck-am installcheck-binPROGRAMS \
803
+	installdirs maintainer-clean maintainer-clean-generic \
804
+	mostlyclean mostlyclean-compile mostlyclean-generic \
805
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
806
+	uninstall-am uninstall-binPROGRAMS
806 807
 
807 808
 
808 809
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -123,30 +123,36 @@ static int checkaccess(const char *path, const char *username, int mode)
123 123
 
124 124
 struct metachain {
125 125
     char **chains;
126
-    unsigned lastadd;
127
-    unsigned lastvir;
128
-    unsigned level;
129
-    unsigned n;
126
+    size_t lastadd;
127
+    size_t lastvir;
128
+    size_t level;
129
+    size_t nchains;
130 130
 };
131 131
 
132 132
 static cl_error_t pre(int fd, const char *type, void *context)
133 133
 {
134
-    struct metachain *c = context;
134
+    struct metachain *c;
135
+
135 136
     UNUSEDPARAM(fd);
136 137
     UNUSEDPARAM(type);
137 138
 
138
-    if (c) {
139
-        c->level++;
140
-    }
139
+    if (!(context))
140
+        return CL_CLEAN;
141
+
142
+    c = (struct metachain *)context;
143
+
144
+    c->level++;
145
+
141 146
     return CL_CLEAN;
142 147
 }
143 148
 
144
-static int print_chain(struct metachain *c, char *str, unsigned len)
149
+static int print_chain(struct metachain *c, char *str, size_t len)
145 150
 {
146
-    unsigned i;
147
-    unsigned na = 0;
148
-    for (i=0;i<c->n-1;i++) {
149
-        unsigned int n = strlen(c->chains[i]);
151
+    size_t i;
152
+    size_t na = 0;
153
+
154
+    for (i=0;i<c->nchains-1;i++) {
155
+        size_t n = strlen(c->chains[i]);
150 156
 
151 157
         if (na)
152 158
             str[na++] = '!';
... ...
@@ -161,21 +167,23 @@ static int print_chain(struct metachain *c, char *str, unsigned len)
161 161
     str[na] = '\0';
162 162
     str[len-1] = '\0';
163 163
 
164
-    return i == c->n-1 ? 0 : 1;
164
+    return i == c->nchains-1 ? 0 : 1;
165 165
 }
166 166
 
167 167
 static cl_error_t post(int fd, int result, const char *virname, void *context)
168 168
 {
169 169
     struct metachain *c = context;
170
+    char str[128];
170 171
 
171 172
     UNUSEDPARAM(fd);
172 173
     UNUSEDPARAM(result);
173 174
 
174
-    if (c && c->n) {
175
-        char str[128];
175
+    if (c && c->nchains) {
176 176
         print_chain(c, str, sizeof(str));
177
+
177 178
         if (c->level == c->lastadd && !virname)
178
-            free(c->chains[--c->n]);
179
+            free(c->chains[--c->nchains]);
180
+
179 181
         if (virname && !c->lastvir)
180 182
             c->lastvir = c->level;
181 183
     }
... ...
@@ -187,12 +195,12 @@ static cl_error_t post(int fd, int result, const char *virname, void *context)
187 187
 }
188 188
 
189 189
 static cl_error_t meta(const char* container_type, unsigned long fsize_container, const char *filename,
190
-		       unsigned long fsize_real,  int is_encrypted, unsigned int filepos_container, void *context)
190
+    unsigned long fsize_real,  int is_encrypted, unsigned int filepos_container, void *context)
191 191
 {
192 192
     char prev[128];
193
-    struct metachain *c = context;
194
-    const char *type = !strncmp(container_type,"CL_TYPE_",8) ? container_type + 8 : container_type;
195
-    unsigned n = strlen(type) + 1 + strlen(filename) + 1;
193
+    struct metachain *c;
194
+    const char *type;
195
+    size_t n;
196 196
     char *chain;
197 197
     char **chains;
198 198
     int toolong;
... ...
@@ -202,6 +210,10 @@ static cl_error_t meta(const char* container_type, unsigned long fsize_container
202 202
     UNUSEDPARAM(is_encrypted);
203 203
     UNUSEDPARAM(filepos_container);
204 204
 
205
+    c = (struct metachain *)context;
206
+    type = (strncmp(container_type, "CL_TYPE_", 8) == 0 ? container_type + 8 : container_type);
207
+    n = strlen(type) + strlen(filename) + 2;
208
+
205 209
     if (!c)
206 210
         return CL_CLEAN;
207 211
 
... ...
@@ -209,13 +221,14 @@ static cl_error_t meta(const char* container_type, unsigned long fsize_container
209 209
 
210 210
     if (!chain)
211 211
         return CL_CLEAN;
212
+
212 213
     if (!strcmp(type, "ANY"))
213 214
         snprintf(chain, n,"%s", filename);
214 215
     else
215 216
         snprintf(chain, n,"%s:%s", type, filename);
216 217
 
217 218
     if (c->lastadd != c->level) {
218
-        n = c->n + 1;
219
+        n = c->nchains + 1;
219 220
 
220 221
         chains = realloc(c->chains, n * sizeof(*chains));
221 222
         if (!chains) {
... ...
@@ -224,15 +237,20 @@ static cl_error_t meta(const char* container_type, unsigned long fsize_container
224 224
         }
225 225
 
226 226
         c->chains = chains;
227
-        c->n = n;
227
+        c->nchains = n;
228 228
         c->lastadd = c->level;
229 229
     } else {
230
-        free(c->chains[c->n-1]);
230
+        if (c->nchains > 0)
231
+            free(c->chains[c->nchains-1]);
231 232
     }
232 233
 
233
-    c->chains[c->n-1] = chain;
234
-    toolong = print_chain(c, prev, sizeof(prev));
235
-    logg("*Scanning %s%s!%s\n", prev,toolong ? "..." : "", chain);
234
+    if (c->nchains > 0) {
235
+        c->chains[c->nchains-1] = chain;
236
+        toolong = print_chain(c, prev, sizeof(prev));
237
+        logg("*Scanning %s%s!%s\n", prev,toolong ? "..." : "", chain);
238
+    } else {
239
+        free(chain);
240
+    }
236 241
 
237 242
     return CL_CLEAN;
238 243
 }
... ...
@@ -314,10 +332,10 @@ static void scanfile(const char *filename, struct cl_engine *engine, const struc
314 314
 
315 315
     memset(&chain, 0, sizeof(chain));
316 316
     if(optget(opts, "archive-verbose")->enabled) {
317
-        chain.chains = malloc(sizeof(*chain.chains));
317
+        chain.chains = malloc(sizeof(char **));
318 318
         if (chain.chains) {
319 319
             chain.chains[0] = strdup(filename);
320
-            chain.n = 1;
320
+            chain.nchains = 1;
321 321
         }
322 322
     }
323 323
 
... ...
@@ -331,22 +349,23 @@ static void scanfile(const char *filename, struct cl_engine *engine, const struc
331 331
 
332 332
 
333 333
     if((ret = cl_scandesc_callback(fd, virpp, &info.blocks, engine, options, &chain)) == CL_VIRUS) {
334
+        if (options & CL_SCAN_ALLMATCHES) {
335
+            virpp = (const char **)*virpp; /* allmatch needs an extra dereference */
336
+            virname = virpp[0]; /* this is the first virus */
337
+        }
334 338
         if(optget(opts, "archive-verbose")->enabled) {
335
-            if (chain.n > 1) {
339
+            if (chain.nchains > 1) {
336 340
                 char str[128];
337 341
                 int toolong = print_chain(&chain, str, sizeof(str));
338 342
 
339
-                logg("~%s%s!(%d)%s: %s FOUND\n", str, toolong ? "..." : "", chain.lastvir-1, chain.chains[chain.n-1], virname);
343
+                logg("~%s%s!(%u)%s: %s FOUND\n", str, toolong ? "..." : "", chain.lastvir-1, chain.chains[chain.nchains-1], virname);
340 344
             } else if (chain.lastvir) {
341
-                logg("~%s!(%d): %s FOUND\n", filename, chain.lastvir-1, virname);
345
+                logg("~%s!(%u): %s FOUND\n", filename, chain.lastvir-1, virname);
342 346
             }
343 347
         }
344 348
 
345 349
         if (options & CL_SCAN_ALLMATCHES) {
346 350
             int i = 0;
347
-
348
-            virpp = (const char **)*virpp; /* horrible */
349
-            virname = virpp[0];
350 351
             while (virpp[i])
351 352
                 logg("~%s: %s FOUND\n", filename, virpp[i++]);
352 353
 
... ...
@@ -372,7 +391,7 @@ static void scanfile(const char *filename, struct cl_engine *engine, const struc
372 372
         info.errors++;
373 373
     }
374 374
 
375
-    for (i=0;i<chain.n;i++)
375
+    for (i=0;i<chain.nchains;i++)
376 376
         free(chain.chains[i]);
377 377
 
378 378
     free(chain.chains);
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,8 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 bin_PROGRAMS = clamsubmit$(EXEEXT)
57 57
 subdir = clamsubmit
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
59
+	$(top_srcdir)/config/depcomp
59 60
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 61
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 62
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -139,6 +184,19 @@ clamsubmit_LDADD = $(LDADD)
139 139
 AM_V_lt = $(am__v_lt_@AM_V@)
140 140
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
141 141
 am__v_lt_0 = --silent
142
+am__v_lt_1 = 
143
+AM_V_P = $(am__v_P_@AM_V@)
144
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
145
+am__v_P_0 = false
146
+am__v_P_1 = :
147
+AM_V_GEN = $(am__v_GEN_@AM_V@)
148
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
149
+am__v_GEN_0 = @echo "  GEN     " $@;
150
+am__v_GEN_1 = 
151
+AM_V_at = $(am__v_at_@AM_V@)
152
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
153
+am__v_at_0 = @
154
+am__v_at_1 = 
142 155
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
143 156
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
144 157
 am__depfiles_maybe = depfiles
... ...
@@ -151,22 +209,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
151 151
 	$(AM_CFLAGS) $(CFLAGS)
152 152
 AM_V_CC = $(am__v_CC_@AM_V@)
153 153
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
154
-am__v_CC_0 = @echo "  CC    " $@;
155
-AM_V_at = $(am__v_at_@AM_V@)
156
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
157
-am__v_at_0 = @
154
+am__v_CC_0 = @echo "  CC      " $@;
155
+am__v_CC_1 = 
158 156
 CCLD = $(CC)
159 157
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
160 158
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
161 159
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
162 160
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
163 161
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
164
-am__v_CCLD_0 = @echo "  CCLD  " $@;
165
-AM_V_GEN = $(am__v_GEN_@AM_V@)
166
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
167
-am__v_GEN_0 = @echo "  GEN   " $@;
162
+am__v_CCLD_0 = @echo "  CCLD    " $@;
163
+am__v_CCLD_1 = 
168 164
 SOURCES = $(clamsubmit_SOURCES)
169 165
 DIST_SOURCES = $(clamsubmit_SOURCES)
166
+am__can_run_installinfo = \
167
+  case $$AM_UPDATE_INFO_DIR in \
168
+    n|no|NO) false;; \
169
+    *) (install-info --version) >/dev/null 2>&1;; \
170
+  esac
171
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
172
+# Read a list of newline-separated strings from the standard input,
173
+# and print each of them once, without duplicates.  Input order is
174
+# *not* preserved.
175
+am__uniquify_input = $(AWK) '\
176
+  BEGIN { nonempty = 0; } \
177
+  { items[$$0] = 1; nonempty = 1; } \
178
+  END { if (nonempty) { for (i in items) print i; }; } \
179
+'
180
+# Make sure the list of sources is unique.  This is necessary because,
181
+# e.g., the same source file might be shared among _SOURCES variables
182
+# for different programs/libraries.
183
+am__define_uniq_tagged_files = \
184
+  list='$(am__tagged_files)'; \
185
+  unique=`for i in $$list; do \
186
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
187
+  done | $(am__uniquify_input)`
170 188
 ETAGS = etags
171 189
 CTAGS = ctags
172 190
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -420,14 +496,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
420 420
 $(am__aclocal_m4_deps):
421 421
 install-binPROGRAMS: $(bin_PROGRAMS)
422 422
 	@$(NORMAL_INSTALL)
423
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
424 423
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
424
+	if test -n "$$list"; then \
425
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
426
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
427
+	fi; \
425 428
 	for p in $$list; do echo "$$p $$p"; done | \
426 429
 	sed 's/$(EXEEXT)$$//' | \
427
-	while read p p1; do if test -f $$p || test -f $$p1; \
428
-	  then echo "$$p"; echo "$$p"; else :; fi; \
430
+	while read p p1; do if test -f $$p \
431
+	 || test -f $$p1 \
432
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
429 433
 	done | \
430
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
434
+	sed -e 'p;s,.*/,,;n;h' \
435
+	    -e 's|.*|.|' \
431 436
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
432 437
 	sed 'N;N;N;s,\n, ,g' | \
433 438
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -448,7 +529,8 @@ uninstall-binPROGRAMS:
448 448
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
449 449
 	files=`for p in $$list; do echo "$$p"; done | \
450 450
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
451
-	      -e 's/$$/$(EXEEXT)/' `; \
451
+	      -e 's/$$/$(EXEEXT)/' \
452
+	`; \
452 453
 	test -n "$$list" || exit 0; \
453 454
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
454 455
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -477,6 +559,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
477 477
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
478 478
 	  done; \
479 479
 	done; rm -f c$${pid}_.???; exit $$bad
480
+
480 481
 clamsubmit$(EXEEXT): $(clamsubmit_OBJECTS) $(clamsubmit_DEPENDENCIES) $(EXTRA_clamsubmit_DEPENDENCIES) 
481 482
 	@rm -f clamsubmit$(EXEEXT)
482 483
 	$(AM_V_CCLD)$(LINK) $(clamsubmit_OBJECTS) $(clamsubmit_LDADD) $(LIBS)
... ...
@@ -498,14 +581,14 @@ distclean-compile:
498 498
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
499 499
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
500 500
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
501
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
501
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
502 502
 
503 503
 .c.obj:
504 504
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
505 505
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
506 506
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
507 507
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
508
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
508
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
509 509
 
510 510
 .c.lo:
511 511
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -576,26 +659,15 @@ mostlyclean-libtool:
576 576
 clean-libtool:
577 577
 	-rm -rf .libs _libs
578 578
 
579
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
580
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
581
-	unique=`for i in $$list; do \
582
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
583
-	  done | \
584
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
585
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
586
-	mkid -fID $$unique
587
-tags: TAGS
588
-
589
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
590
-		$(TAGS_FILES) $(LISP)
579
+ID: $(am__tagged_files)
580
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
581
+tags: tags-am
582
+TAGS: tags
583
+
584
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
591 585
 	set x; \
592 586
 	here=`pwd`; \
593
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
594
-	unique=`for i in $$list; do \
595
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
596
-	  done | \
597
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
598
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
587
+	$(am__define_uniq_tagged_files); \
599 588
 	shift; \
600 589
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
601 590
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -607,15 +679,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
607 607
 	      $$unique; \
608 608
 	  fi; \
609 609
 	fi
610
-ctags: CTAGS
611
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
612
-		$(TAGS_FILES) $(LISP)
613
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
614
-	unique=`for i in $$list; do \
615
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
616
-	  done | \
617
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
618
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
610
+ctags: ctags-am
611
+
612
+CTAGS: ctags
613
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
614
+	$(am__define_uniq_tagged_files); \
619 615
 	test -z "$(CTAGS_ARGS)$$unique" \
620 616
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
621 617
 	     $$unique
... ...
@@ -624,6 +692,21 @@ GTAGS:
624 624
 	here=`$(am__cd) $(top_builddir) && pwd` \
625 625
 	  && $(am__cd) $(top_srcdir) \
626 626
 	  && gtags -i $(GTAGS_ARGS) "$$here"
627
+cscopelist: cscopelist-am
628
+
629
+cscopelist-am: $(am__tagged_files)
630
+	list='$(am__tagged_files)'; \
631
+	case "$(srcdir)" in \
632
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
633
+	  *) sdir=$(subdir)/$(srcdir) ;; \
634
+	esac; \
635
+	for i in $$list; do \
636
+	  if test -f "$$i"; then \
637
+	    echo "$(subdir)/$$i"; \
638
+	  else \
639
+	    echo "$$sdir/$$i"; \
640
+	  fi; \
641
+	done >> $(top_builddir)/cscope.files
627 642
 
628 643
 distclean-tags:
629 644
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -768,19 +851,20 @@ uninstall-am: uninstall-binPROGRAMS
768 768
 
769 769
 .MAKE: install-am install-strip
770 770
 
771
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
772
-	clean-generic clean-libtool ctags distclean distclean-compile \
773
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
774
-	dvi-am html html-am info info-am install install-am \
775
-	install-binPROGRAMS install-data install-data-am install-dvi \
776
-	install-dvi-am install-exec install-exec-am install-html \
777
-	install-html-am install-info install-info-am install-man \
778
-	install-pdf install-pdf-am install-ps install-ps-am \
779
-	install-strip installcheck installcheck-am \
780
-	installcheck-binPROGRAMS installdirs maintainer-clean \
781
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
782
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
783
-	tags uninstall uninstall-am uninstall-binPROGRAMS
771
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
772
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
773
+	ctags ctags-am distclean distclean-compile distclean-generic \
774
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
775
+	html-am info info-am install install-am install-binPROGRAMS \
776
+	install-data install-data-am install-dvi install-dvi-am \
777
+	install-exec install-exec-am install-html install-html-am \
778
+	install-info install-info-am install-man install-pdf \
779
+	install-pdf-am install-ps install-ps-am install-strip \
780
+	installcheck installcheck-am installcheck-binPROGRAMS \
781
+	installdirs maintainer-clean maintainer-clean-generic \
782
+	mostlyclean mostlyclean-compile mostlyclean-generic \
783
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
784
+	uninstall-am uninstall-binPROGRAMS
784 785
 
785 786
 
786 787
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1,13 +1,11 @@
1 1
 #! /bin/sh
2 2
 # Guess values for system-dependent variables and create Makefiles.
3
-# Generated by GNU Autoconf 2.68 for ClamAV devel.
3
+# Generated by GNU Autoconf 2.69 for ClamAV devel.
4 4
 #
5 5
 # Report bugs to <http://bugs.clamav.net/>.
6 6
 #
7 7
 #
8
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
9
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
10
-# Foundation, Inc.
8
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
11 9
 #
12 10
 #
13 11
 # This configure script is free software; the Free Software Foundation
... ...
@@ -136,6 +134,31 @@ export LANGUAGE
136 136
 # CDPATH.
137 137
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138 138
 
139
+# Use a proper internal environment variable to ensure we don't fall
140
+  # into an infinite loop, continuously re-executing ourselves.
141
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
142
+    _as_can_reexec=no; export _as_can_reexec;
143
+    # We cannot yet assume a decent shell, so we have to provide a
144
+# neutralization value for shells without unset; and this also
145
+# works around shells that cannot unset nonexistent variables.
146
+# Preserve -v and -x to the replacement shell.
147
+BASH_ENV=/dev/null
148
+ENV=/dev/null
149
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
150
+case $- in # ((((
151
+  *v*x* | *x*v* ) as_opts=-vx ;;
152
+  *v* ) as_opts=-v ;;
153
+  *x* ) as_opts=-x ;;
154
+  * ) as_opts= ;;
155
+esac
156
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
157
+# Admittedly, this is quite paranoid, since all the known shells bail
158
+# out after a failed `exec'.
159
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
160
+as_fn_exit 255
161
+  fi
162
+  # We don't want this to propagate to other subprocesses.
163
+          { _as_can_reexec=; unset _as_can_reexec;}
139 164
 if test "x$CONFIG_SHELL" = x; then
140 165
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
141 166
   emulate sh
... ...
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
169 169
 else
170 170
   exitcode=1; echo positional parameters were not saved.
171 171
 fi
172
-test x\$exitcode = x0 || exit 1"
172
+test x\$exitcode = x0 || exit 1
173
+test -x / || exit 1"
173 174
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
174 175
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
175 176
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
... ...
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
222 222
 
223 223
 
224 224
       if test "x$CONFIG_SHELL" != x; then :
225
-  # We cannot yet assume a decent shell, so we have to provide a
226
-	# neutralization value for shells without unset; and this also
227
-	# works around shells that cannot unset nonexistent variables.
228
-	# Preserve -v and -x to the replacement shell.
229
-	BASH_ENV=/dev/null
230
-	ENV=/dev/null
231
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
232
-	export CONFIG_SHELL
233
-	case $- in # ((((
234
-	  *v*x* | *x*v* ) as_opts=-vx ;;
235
-	  *v* ) as_opts=-v ;;
236
-	  *x* ) as_opts=-x ;;
237
-	  * ) as_opts= ;;
238
-	esac
239
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
225
+  export CONFIG_SHELL
226
+             # We cannot yet assume a decent shell, so we have to provide a
227
+# neutralization value for shells without unset; and this also
228
+# works around shells that cannot unset nonexistent variables.
229
+# Preserve -v and -x to the replacement shell.
230
+BASH_ENV=/dev/null
231
+ENV=/dev/null
232
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
233
+case $- in # ((((
234
+  *v*x* | *x*v* ) as_opts=-vx ;;
235
+  *v* ) as_opts=-v ;;
236
+  *x* ) as_opts=-x ;;
237
+  * ) as_opts= ;;
238
+esac
239
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
240
+# Admittedly, this is quite paranoid, since all the known shells bail
241
+# out after a failed `exec'.
242
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
243
+exit 255
240 244
 fi
241 245
 
242 246
     if test x$as_have_required = xno; then :
... ...
@@ -339,6 +367,14 @@ $as_echo X"$as_dir" |
339 339
 
340 340
 
341 341
 } # as_fn_mkdir_p
342
+
343
+# as_fn_executable_p FILE
344
+# -----------------------
345
+# Test if FILE is an executable regular file.
346
+as_fn_executable_p ()
347
+{
348
+  test -f "$1" && test -x "$1"
349
+} # as_fn_executable_p
342 350
 # as_fn_append VAR VALUE
343 351
 # ----------------------
344 352
 # Append the text in VALUE to the end of the definition contained in VAR. Take
... ...
@@ -460,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
460 460
   chmod +x "$as_me.lineno" ||
461 461
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
462 462
 
463
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
464
+  # already done that, so ensure we don't try to do so again and fall
465
+  # in an infinite loop.  This has already happened in practice.
466
+  _as_can_reexec=no; export _as_can_reexec
463 467
   # Don't try to exec as it changes $[0], causing all sort of problems
464 468
   # (the dirname of $[0] is not the place where we might find the
465 469
   # original and so on.  Autoconf is especially sensitive to this).
... ...
@@ -494,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
494 494
     # ... but there are two gotchas:
495 495
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
496 496
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
497
-    # In both cases, we have to default to `cp -p'.
497
+    # In both cases, we have to default to `cp -pR'.
498 498
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
499
-      as_ln_s='cp -p'
499
+      as_ln_s='cp -pR'
500 500
   elif ln conf$$.file conf$$ 2>/dev/null; then
501 501
     as_ln_s=ln
502 502
   else
503
-    as_ln_s='cp -p'
503
+    as_ln_s='cp -pR'
504 504
   fi
505 505
 else
506
-  as_ln_s='cp -p'
506
+  as_ln_s='cp -pR'
507 507
 fi
508 508
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
509 509
 rmdir conf$$.dir 2>/dev/null
... ...
@@ -515,28 +555,8 @@ else
515 515
   as_mkdir_p=false
516 516
 fi
517 517
 
518
-if test -x / >/dev/null 2>&1; then
519
-  as_test_x='test -x'
520
-else
521
-  if ls -dL / >/dev/null 2>&1; then
522
-    as_ls_L_option=L
523
-  else
524
-    as_ls_L_option=
525
-  fi
526
-  as_test_x='
527
-    eval sh -c '\''
528
-      if test -d "$1"; then
529
-	test -d "$1/.";
530
-      else
531
-	case $1 in #(
532
-	-*)set "./$1";;
533
-	esac;
534
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
535
-	???[sx]*):;;*)false;;esac;fi
536
-    '\'' sh
537
-  '
538
-fi
539
-as_executable_p=$as_test_x
518
+as_test_x='test -x'
519
+as_executable_p=as_fn_executable_p
540 520
 
541 521
 # Sed expression to map a string onto a valid CPP name.
542 522
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
... ...
@@ -1373,8 +1393,6 @@ target=$target_alias
1373 1373
 if test "x$host_alias" != x; then
1374 1374
   if test "x$build_alias" = x; then
1375 1375
     cross_compiling=maybe
1376
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1377
-    If a cross compiler is detected then cross compile mode will be used" >&2
1378 1376
   elif test "x$build_alias" != "x$host_alias"; then
1379 1377
     cross_compiling=yes
1380 1378
   fi
... ...
@@ -1539,10 +1557,12 @@ Optional Features:
1539 1539
   --disable-option-checking  ignore unrecognized --enable/--with options
1540 1540
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1541 1541
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1542
-  --enable-silent-rules          less verbose build output (undo: `make V=1')
1543
-  --disable-silent-rules         verbose build output (undo: `make V=0')
1544
-  --disable-dependency-tracking  speeds up one-time build
1545
-  --enable-dependency-tracking   do not reject slow dependency extractors
1542
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
1543
+  --disable-silent-rules  verbose build output (undo: "make V=0")
1544
+  --enable-dependency-tracking
1545
+                          do not reject slow dependency extractors
1546
+  --disable-dependency-tracking
1547
+                          speeds up one-time build
1546 1548
   --enable-static[=PKGS]  build static libraries [default=no]
1547 1549
   --enable-shared[=PKGS]  build shared libraries [default=yes]
1548 1550
   --enable-fast-install[=PKGS]
... ...
@@ -1707,9 +1727,9 @@ test -n "$ac_init_help" && exit $ac_status
1707 1707
 if $ac_init_version; then
1708 1708
   cat <<\_ACEOF
1709 1709
 ClamAV configure devel
1710
-generated by GNU Autoconf 2.68
1710
+generated by GNU Autoconf 2.69
1711 1711
 
1712
-Copyright (C) 2010 Free Software Foundation, Inc.
1712
+Copyright (C) 2012 Free Software Foundation, Inc.
1713 1713
 This configure script is free software; the Free Software Foundation
1714 1714
 gives unlimited permission to copy, distribute and modify it.
1715 1715
 _ACEOF
... ...
@@ -1986,7 +2006,7 @@ $as_echo "$ac_try_echo"; } >&5
1986 1986
 	 test ! -s conftest.err
1987 1987
        } && test -s conftest$ac_exeext && {
1988 1988
 	 test "$cross_compiling" = yes ||
1989
-	 $as_test_x conftest$ac_exeext
1989
+	 test -x conftest$ac_exeext
1990 1990
        }; then :
1991 1991
   ac_retval=0
1992 1992
 else
... ...
@@ -2176,7 +2196,7 @@ This file contains any messages produced by compilers while
2176 2176
 running configure, to aid debugging if configure makes a mistake.
2177 2177
 
2178 2178
 It was created by ClamAV $as_me devel, which was
2179
-generated by GNU Autoconf 2.68.  Invocation command line was
2179
+generated by GNU Autoconf 2.69.  Invocation command line was
2180 2180
 
2181 2181
   $ $0 $@
2182 2182
 
... ...
@@ -2858,7 +2878,7 @@ done
2858 2858
 
2859 2859
 
2860 2860
 
2861
-am__api_version='1.11'
2861
+am__api_version='1.14'
2862 2862
 
2863 2863
 # Find a good install program.  We prefer a C program (faster),
2864 2864
 # so one script is as good as another.  But avoid the broken or
... ...
@@ -2897,7 +2917,7 @@ case $as_dir/ in #((
2897 2897
     # by default.
2898 2898
     for ac_prog in ginstall scoinst install; do
2899 2899
       for ac_exec_ext in '' $ac_executable_extensions; do
2900
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2900
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
2901 2901
 	  if test $ac_prog = install &&
2902 2902
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2903 2903
 	    # AIX install.  It has an incompatible calling convention.
... ...
@@ -2955,9 +2975,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2955 2955
 
2956 2956
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2957 2957
 $as_echo_n "checking whether build environment is sane... " >&6; }
2958
-# Just in case
2959
-sleep 1
2960
-echo timestamp > conftest.file
2961 2958
 # Reject unsafe characters in $srcdir or the absolute working directory
2962 2959
 # name.  Accept space and tab only in the latter.
2963 2960
 am_lf='
... ...
@@ -2968,32 +2985,40 @@ case `pwd` in
2968 2968
 esac
2969 2969
 case $srcdir in
2970 2970
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
2971
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
2971
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
2972 2972
 esac
2973 2973
 
2974
-# Do `set' in a subshell so we don't clobber the current shell's
2974
+# Do 'set' in a subshell so we don't clobber the current shell's
2975 2975
 # arguments.  Must try -L first in case configure is actually a
2976 2976
 # symlink; some systems play weird games with the mod time of symlinks
2977 2977
 # (eg FreeBSD returns the mod time of the symlink's containing
2978 2978
 # directory).
2979 2979
 if (
2980
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2981
-   if test "$*" = "X"; then
2982
-      # -L didn't work.
2983
-      set X `ls -t "$srcdir/configure" conftest.file`
2984
-   fi
2985
-   rm -f conftest.file
2986
-   if test "$*" != "X $srcdir/configure conftest.file" \
2987
-      && test "$*" != "X conftest.file $srcdir/configure"; then
2988
-
2989
-      # If neither matched, then we have a broken ls.  This can happen
2990
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
2991
-      # broken ls alias from the environment.  This has actually
2992
-      # happened.  Such a system could not be considered "sane".
2993
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
2994
-alias in your environment" "$LINENO" 5
2995
-   fi
2996
-
2980
+   am_has_slept=no
2981
+   for am_try in 1 2; do
2982
+     echo "timestamp, slept: $am_has_slept" > conftest.file
2983
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2984
+     if test "$*" = "X"; then
2985
+	# -L didn't work.
2986
+	set X `ls -t "$srcdir/configure" conftest.file`
2987
+     fi
2988
+     if test "$*" != "X $srcdir/configure conftest.file" \
2989
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
2990
+
2991
+	# If neither matched, then we have a broken ls.  This can happen
2992
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
2993
+	# broken ls alias from the environment.  This has actually
2994
+	# happened.  Such a system could not be considered "sane".
2995
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
2996
+  alias in your environment" "$LINENO" 5
2997
+     fi
2998
+     if test "$2" = conftest.file || test $am_try -eq 2; then
2999
+       break
3000
+     fi
3001
+     # Just in case.
3002
+     sleep 1
3003
+     am_has_slept=yes
3004
+   done
2997 3005
    test "$2" = conftest.file
2998 3006
    )
2999 3007
 then
... ...
@@ -3005,6 +3030,16 @@ Check your system clock" "$LINENO" 5
3005 3005
 fi
3006 3006
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3007 3007
 $as_echo "yes" >&6; }
3008
+# If we didn't sleep, we still need to ensure time stamps of config.status and
3009
+# generated files are strictly newer.
3010
+am_sleep_pid=
3011
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
3012
+  ( sleep 1 ) &
3013
+  am_sleep_pid=$!
3014
+fi
3015
+
3016
+rm -f conftest.file
3017
+
3008 3018
 test "$program_prefix" != NONE &&
3009 3019
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
3010 3020
 # Use a double $ so make ignores it.
... ...
@@ -3027,12 +3062,12 @@ if test x"${MISSING+set}" != xset; then
3027 3027
   esac
3028 3028
 fi
3029 3029
 # Use eval to expand $SHELL
3030
-if eval "$MISSING --run true"; then
3031
-  am_missing_run="$MISSING --run "
3030
+if eval "$MISSING --is-lightweight"; then
3031
+  am_missing_run="$MISSING "
3032 3032
 else
3033 3033
   am_missing_run=
3034
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
3035
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
3034
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
3035
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
3036 3036
 fi
3037 3037
 
3038 3038
 if test x"${install_sh}" != xset; then
... ...
@@ -3044,10 +3079,10 @@ if test x"${install_sh}" != xset; then
3044 3044
   esac
3045 3045
 fi
3046 3046
 
3047
-# Installed binaries are usually stripped using `strip' when the user
3048
-# run `make install-strip'.  However `strip' might not be the right
3047
+# Installed binaries are usually stripped using 'strip' when the user
3048
+# run "make install-strip".  However 'strip' might not be the right
3049 3049
 # tool to use in cross-compilation environments, therefore Automake
3050
-# will honor the `STRIP' environment variable to overrule this program.
3050
+# will honor the 'STRIP' environment variable to overrule this program.
3051 3051
 if test "$cross_compiling" != no; then
3052 3052
   if test -n "$ac_tool_prefix"; then
3053 3053
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
... ...
@@ -3066,7 +3101,7 @@ do
3066 3066
   IFS=$as_save_IFS
3067 3067
   test -z "$as_dir" && as_dir=.
3068 3068
     for ac_exec_ext in '' $ac_executable_extensions; do
3069
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3069
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3070 3070
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
3071 3071
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3072 3072
     break 2
... ...
@@ -3106,7 +3141,7 @@ do
3106 3106
   IFS=$as_save_IFS
3107 3107
   test -z "$as_dir" && as_dir=.
3108 3108
     for ac_exec_ext in '' $ac_executable_extensions; do
3109
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3109
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3110 3110
     ac_cv_prog_ac_ct_STRIP="strip"
3111 3111
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3112 3112
     break 2
... ...
@@ -3157,7 +3192,7 @@ do
3157 3157
   test -z "$as_dir" && as_dir=.
3158 3158
     for ac_prog in mkdir gmkdir; do
3159 3159
 	 for ac_exec_ext in '' $ac_executable_extensions; do
3160
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
3160
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
3161 3161
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
3162 3162
 	     'mkdir (GNU coreutils) '* | \
3163 3163
 	     'mkdir (coreutils) '* | \
... ...
@@ -3186,12 +3221,6 @@ fi
3186 3186
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
3187 3187
 $as_echo "$MKDIR_P" >&6; }
3188 3188
 
3189
-mkdir_p="$MKDIR_P"
3190
-case $mkdir_p in
3191
-  [\\/$]* | ?:[\\/]*) ;;
3192
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
3193
-esac
3194
-
3195 3189
 for ac_prog in gawk mawk nawk awk
3196 3190
 do
3197 3191
   # Extract the first word of "$ac_prog", so it can be a program name with args.
... ...
@@ -3210,7 +3239,7 @@ do
3210 3210
   IFS=$as_save_IFS
3211 3211
   test -z "$as_dir" && as_dir=.
3212 3212
     for ac_exec_ext in '' $ac_executable_extensions; do
3213
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3213
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3214 3214
     ac_cv_prog_AWK="$ac_prog"
3215 3215
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3216 3216
     break 2
... ...
@@ -3274,6 +3303,45 @@ else
3274 3274
 fi
3275 3275
 rmdir .tst 2>/dev/null
3276 3276
 
3277
+# Check whether --enable-silent-rules was given.
3278
+if test "${enable_silent_rules+set}" = set; then :
3279
+  enableval=$enable_silent_rules;
3280
+fi
3281
+
3282
+case $enable_silent_rules in # (((
3283
+  yes) AM_DEFAULT_VERBOSITY=0;;
3284
+   no) AM_DEFAULT_VERBOSITY=1;;
3285
+    *) AM_DEFAULT_VERBOSITY=1;;
3286
+esac
3287
+am_make=${MAKE-make}
3288
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
3289
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
3290
+if ${am_cv_make_support_nested_variables+:} false; then :
3291
+  $as_echo_n "(cached) " >&6
3292
+else
3293
+  if $as_echo 'TRUE=$(BAR$(V))
3294
+BAR0=false
3295
+BAR1=true
3296
+V=1
3297
+am__doit:
3298
+	@$(TRUE)
3299
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
3300
+  am_cv_make_support_nested_variables=yes
3301
+else
3302
+  am_cv_make_support_nested_variables=no
3303
+fi
3304
+fi
3305
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
3306
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
3307
+if test $am_cv_make_support_nested_variables = yes; then
3308
+    AM_V='$(V)'
3309
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
3310
+else
3311
+  AM_V=$AM_DEFAULT_VERBOSITY
3312
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3313
+fi
3314
+AM_BACKSLASH='\'
3315
+
3277 3316
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
3278 3317
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3279 3318
   # is not polluted with repeated "-I."
... ...
@@ -3315,6 +3383,12 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
3315 3315
 
3316 3316
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
3317 3317
 
3318
+# For better backward compatibility.  To be removed once Automake 1.9.x
3319
+# dies out for good.  For more background, see:
3320
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
3321
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
3322
+mkdir_p='$(MKDIR_P)'
3323
+
3318 3324
 # We need awk for the "check" target.  The system "awk" is bad on
3319 3325
 # some platforms.
3320 3326
 # Always define AMTAR for backward compatibility.  Yes, it's still used
... ...
@@ -3322,101 +3396,182 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
3322 3322
 AMTAR='$${TAR-tar}'
3323 3323
 
3324 3324
 
3325
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
3326
-$as_echo_n "checking how to create a ustar tar archive... " >&6; }
3327
-# Loop over all known methods to create a tar archive until one works.
3325
+# We'll loop over all known methods to create a tar archive until one works.
3328 3326
 _am_tools='gnutar plaintar pax cpio none'
3329
-_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
3330
-# Do not fold the above two line into one, because Tru64 sh and
3331
-# Solaris sh will not grok spaces in the rhs of `-'.
3332
-for _am_tool in $_am_tools
3333
-do
3334
-  case $_am_tool in
3335
-  gnutar)
3336
-    for _am_tar in tar gnutar gtar;
3337
-    do
3338
-      { echo "$as_me:$LINENO: $_am_tar --version" >&5
3327
+
3328
+# The POSIX 1988 'ustar' format is defined with fixed-size fields.
3329
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
3330
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
3331
+      # and bug#13588).
3332
+      am_max_uid=2097151 # 2^21 - 1
3333
+      am_max_gid=$am_max_uid
3334
+      # The $UID and $GID variables are not portable, so we need to resort
3335
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
3336
+      # below are definitely unexpected, so allow the users to see them
3337
+      # (that is, avoid stderr redirection).
3338
+      am_uid=`id -u || echo unknown`
3339
+      am_gid=`id -g || echo unknown`
3340
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
3341
+$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
3342
+      if test $am_uid -le $am_max_uid; then
3343
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3344
+$as_echo "yes" >&6; }
3345
+      else
3346
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3347
+$as_echo "no" >&6; }
3348
+         _am_tools=none
3349
+      fi
3350
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
3351
+$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
3352
+      if test $am_gid -le $am_max_gid; then
3353
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3354
+$as_echo "yes" >&6; }
3355
+      else
3356
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3357
+$as_echo "no" >&6; }
3358
+        _am_tools=none
3359
+      fi
3360
+
3361
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
3362
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
3363
+
3364
+  # Go ahead even if we have the value already cached.  We do so because we
3365
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
3366
+  _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
3367
+
3368
+  for _am_tool in $_am_tools; do
3369
+    case $_am_tool in
3370
+    gnutar)
3371
+      for _am_tar in tar gnutar gtar; do
3372
+        { echo "$as_me:$LINENO: $_am_tar --version" >&5
3339 3373
    ($_am_tar --version) >&5 2>&5
3340 3374
    ac_status=$?
3341 3375
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
3342 3376
    (exit $ac_status); } && break
3343
-    done
3344
-    am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
3345
-    am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
3346
-    am__untar="$_am_tar -xf -"
3347
-    ;;
3348
-  plaintar)
3349
-    # Must skip GNU tar: if it does not support --format= it doesn't create
3350
-    # ustar tarball either.
3351
-    (tar --version) >/dev/null 2>&1 && continue
3352
-    am__tar='tar chf - "$$tardir"'
3353
-    am__tar_='tar chf - "$tardir"'
3354
-    am__untar='tar xf -'
3355
-    ;;
3356
-  pax)
3357
-    am__tar='pax -L -x ustar -w "$$tardir"'
3358
-    am__tar_='pax -L -x ustar -w "$tardir"'
3359
-    am__untar='pax -r'
3360
-    ;;
3361
-  cpio)
3362
-    am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
3363
-    am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
3364
-    am__untar='cpio -i -H ustar -d'
3365
-    ;;
3366
-  none)
3367
-    am__tar=false
3368
-    am__tar_=false
3369
-    am__untar=false
3370
-    ;;
3371
-  esac
3377
+      done
3378
+      am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
3379
+      am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
3380
+      am__untar="$_am_tar -xf -"
3381
+      ;;
3382
+    plaintar)
3383
+      # Must skip GNU tar: if it does not support --format= it doesn't create
3384
+      # ustar tarball either.
3385
+      (tar --version) >/dev/null 2>&1 && continue
3386
+      am__tar='tar chf - "$$tardir"'
3387
+      am__tar_='tar chf - "$tardir"'
3388
+      am__untar='tar xf -'
3389
+      ;;
3390
+    pax)
3391
+      am__tar='pax -L -x ustar -w "$$tardir"'
3392
+      am__tar_='pax -L -x ustar -w "$tardir"'
3393
+      am__untar='pax -r'
3394
+      ;;
3395
+    cpio)
3396
+      am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
3397
+      am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
3398
+      am__untar='cpio -i -H ustar -d'
3399
+      ;;
3400
+    none)
3401
+      am__tar=false
3402
+      am__tar_=false
3403
+      am__untar=false
3404
+      ;;
3405
+    esac
3372 3406
 
3373
-  # If the value was cached, stop now.  We just wanted to have am__tar
3374
-  # and am__untar set.
3375
-  test -n "${am_cv_prog_tar_ustar}" && break
3407
+    # If the value was cached, stop now.  We just wanted to have am__tar
3408
+    # and am__untar set.
3409
+    test -n "${am_cv_prog_tar_ustar}" && break
3376 3410
 
3377
-  # tar/untar a dummy directory, and stop if the command works
3378
-  rm -rf conftest.dir
3379
-  mkdir conftest.dir
3380
-  echo GrepMe > conftest.dir/file
3381
-  { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
3411
+    # tar/untar a dummy directory, and stop if the command works.
3412
+    rm -rf conftest.dir
3413
+    mkdir conftest.dir
3414
+    echo GrepMe > conftest.dir/file
3415
+    { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
3382 3416
    (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
3383 3417
    ac_status=$?
3384 3418
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
3385 3419
    (exit $ac_status); }
3386
-  rm -rf conftest.dir
3387
-  if test -s conftest.tar; then
3388
-    { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
3420
+    rm -rf conftest.dir
3421
+    if test -s conftest.tar; then
3422
+      { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
3389 3423
    ($am__untar <conftest.tar) >&5 2>&5
3390 3424
    ac_status=$?
3391 3425
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
3392 3426
    (exit $ac_status); }
3393
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3394
-  fi
3395
-done
3396
-rm -rf conftest.dir
3427
+      { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
3428
+   (cat conftest.dir/file) >&5 2>&5
3429
+   ac_status=$?
3430
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
3431
+   (exit $ac_status); }
3432
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3433
+    fi
3434
+  done
3435
+  rm -rf conftest.dir
3397 3436
 
3398
-if ${am_cv_prog_tar_ustar+:} false; then :
3437
+  if ${am_cv_prog_tar_ustar+:} false; then :
3399 3438
   $as_echo_n "(cached) " >&6
3400 3439
 else
3401 3440
   am_cv_prog_tar_ustar=$_am_tool
3402 3441
 fi
3403 3442
 
3404
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
3443
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
3405 3444
 $as_echo "$am_cv_prog_tar_ustar" >&6; }
3406 3445
 
3407 3446
 
3408 3447
 
3409 3448
 
3410 3449
 
3450
+
3451
+# POSIX will say in a future version that running "rm -f" with no argument
3452
+# is OK; and we want to be able to make that assumption in our Makefile
3453
+# recipes.  So use an aggressive probe to check that the usage we want is
3454
+# actually supported "in the wild" to an acceptable degree.
3455
+# See automake bug#10828.
3456
+# To make any issue more visible, cause the running configure to be aborted
3457
+# by default if the 'rm' program in use doesn't match our expectations; the
3458
+# user can still override this though.
3459
+if rm -f && rm -fr && rm -rf; then : OK; else
3460
+  cat >&2 <<'END'
3461
+Oops!
3462
+
3463
+Your 'rm' program seems unable to run without file operands specified
3464
+on the command line, even when the '-f' option is present.  This is contrary
3465
+to the behaviour of most rm programs out there, and not conforming with
3466
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
3467
+
3468
+Please tell bug-automake@gnu.org about your system, including the value
3469
+of your $PATH and any error possibly output before this message.  This
3470
+can help us improve future automake versions.
3471
+
3472
+END
3473
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
3474
+    echo 'Configuration will proceed anyway, since you have set the' >&2
3475
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
3476
+    echo >&2
3477
+  else
3478
+    cat >&2 <<'END'
3479
+Aborting the configuration process, to ensure you take notice of the issue.
3480
+
3481
+You can download and install GNU coreutils to get an 'rm' implementation
3482
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
3483
+
3484
+If you want to complete the configuration process using your problematic
3485
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
3486
+to "yes", and re-run configure.
3487
+
3488
+END
3489
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
3490
+  fi
3491
+fi
3411 3492
 # Check whether --enable-silent-rules was given.
3412 3493
 if test "${enable_silent_rules+set}" = set; then :
3413 3494
   enableval=$enable_silent_rules;
3414 3495
 fi
3415 3496
 
3416
-case $enable_silent_rules in
3417
-yes) AM_DEFAULT_VERBOSITY=0;;
3418
-no)  AM_DEFAULT_VERBOSITY=1;;
3419
-*)   AM_DEFAULT_VERBOSITY=0;;
3497
+case $enable_silent_rules in # (((
3498
+  yes) AM_DEFAULT_VERBOSITY=0;;
3499
+   no) AM_DEFAULT_VERBOSITY=1;;
3500
+    *) AM_DEFAULT_VERBOSITY=0;;
3420 3501
 esac
3421 3502
 am_make=${MAKE-make}
3422 3503
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
... ...
@@ -3470,7 +3625,7 @@ am__quote=
3470 3470
 _am_result=none
3471 3471
 # First try GNU make style include.
3472 3472
 echo "include confinc" > confmf
3473
-# Ignore all kinds of additional output from `make'.
3473
+# Ignore all kinds of additional output from 'make'.
3474 3474
 case `$am_make -s -f confmf 2> /dev/null` in #(
3475 3475
 *the\ am__doit\ target*)
3476 3476
   am__include=include
... ...
@@ -3536,7 +3691,7 @@ do
3536 3536
   IFS=$as_save_IFS
3537 3537
   test -z "$as_dir" && as_dir=.
3538 3538
     for ac_exec_ext in '' $ac_executable_extensions; do
3539
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3539
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3540 3540
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
3541 3541
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3542 3542
     break 2
... ...
@@ -3576,7 +3731,7 @@ do
3576 3576
   IFS=$as_save_IFS
3577 3577
   test -z "$as_dir" && as_dir=.
3578 3578
     for ac_exec_ext in '' $ac_executable_extensions; do
3579
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3579
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3580 3580
     ac_cv_prog_ac_ct_CC="gcc"
3581 3581
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3582 3582
     break 2
... ...
@@ -3629,7 +3784,7 @@ do
3629 3629
   IFS=$as_save_IFS
3630 3630
   test -z "$as_dir" && as_dir=.
3631 3631
     for ac_exec_ext in '' $ac_executable_extensions; do
3632
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3632
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3633 3633
     ac_cv_prog_CC="${ac_tool_prefix}cc"
3634 3634
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3635 3635
     break 2
... ...
@@ -3670,7 +3825,7 @@ do
3670 3670
   IFS=$as_save_IFS
3671 3671
   test -z "$as_dir" && as_dir=.
3672 3672
     for ac_exec_ext in '' $ac_executable_extensions; do
3673
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3673
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3674 3674
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3675 3675
        ac_prog_rejected=yes
3676 3676
        continue
... ...
@@ -3728,7 +3883,7 @@ do
3728 3728
   IFS=$as_save_IFS
3729 3729
   test -z "$as_dir" && as_dir=.
3730 3730
     for ac_exec_ext in '' $ac_executable_extensions; do
3731
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3731
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3732 3732
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3733 3733
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3734 3734
     break 2
... ...
@@ -3772,7 +3927,7 @@ do
3772 3772
   IFS=$as_save_IFS
3773 3773
   test -z "$as_dir" && as_dir=.
3774 3774
     for ac_exec_ext in '' $ac_executable_extensions; do
3775
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3775
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3776 3776
     ac_cv_prog_ac_ct_CC="$ac_prog"
3777 3777
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3778 3778
     break 2
... ...
@@ -4218,8 +4373,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4218 4218
 /* end confdefs.h.  */
4219 4219
 #include <stdarg.h>
4220 4220
 #include <stdio.h>
4221
-#include <sys/types.h>
4222
-#include <sys/stat.h>
4221
+struct stat;
4223 4222
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4224 4223
 struct buf { int x; };
4225 4224
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
... ...
@@ -4304,6 +4458,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4304 4304
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4305 4305
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4306 4306
 
4307
+ac_ext=c
4308
+ac_cpp='$CPP $CPPFLAGS'
4309
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4310
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4311
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4312
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
4313
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
4314
+if ${am_cv_prog_cc_c_o+:} false; then :
4315
+  $as_echo_n "(cached) " >&6
4316
+else
4317
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4318
+/* end confdefs.h.  */
4319
+
4320
+int
4321
+main ()
4322
+{
4323
+
4324
+  ;
4325
+  return 0;
4326
+}
4327
+_ACEOF
4328
+  # Make sure it works both with $CC and with simple cc.
4329
+  # Following AC_PROG_CC_C_O, we do the test twice because some
4330
+  # compilers refuse to overwrite an existing .o file with -o,
4331
+  # though they will create one.
4332
+  am_cv_prog_cc_c_o=yes
4333
+  for am_i in 1 2; do
4334
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
4335
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
4336
+   ac_status=$?
4337
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
4338
+   (exit $ac_status); } \
4339
+         && test -f conftest2.$ac_objext; then
4340
+      : OK
4341
+    else
4342
+      am_cv_prog_cc_c_o=no
4343
+      break
4344
+    fi
4345
+  done
4346
+  rm -f core conftest*
4347
+  unset am_i
4348
+fi
4349
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
4350
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
4351
+if test "$am_cv_prog_cc_c_o" != yes; then
4352
+   # Losing compiler, so override with the script.
4353
+   # FIXME: It is wrong to rewrite CC.
4354
+   # But if we don't then we get into trouble of one sort or another.
4355
+   # A longer-term fix would be to have automake use am__CC in this case,
4356
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
4357
+   CC="$am_aux_dir/compile $CC"
4358
+fi
4359
+ac_ext=c
4360
+ac_cpp='$CPP $CPPFLAGS'
4361
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4362
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4363
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4364
+
4365
+
4307 4366
 depcc="$CC"   am_compiler_list=
4308 4367
 
4309 4368
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
... ...
@@ -4315,8 +4528,8 @@ else
4315 4315
   # We make a subdir and do the tests there.  Otherwise we can end up
4316 4316
   # making bogus files that we don't know about and never remove.  For
4317 4317
   # instance it was reported that on HP-UX the gcc test will end up
4318
-  # making a dummy file named `D' -- because `-MD' means `put the output
4319
-  # in D'.
4318
+  # making a dummy file named 'D' -- because '-MD' means "put the output
4319
+  # in D".
4320 4320
   rm -rf conftest.dir
4321 4321
   mkdir conftest.dir
4322 4322
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -4351,16 +4564,16 @@ else
4351 4351
     : > sub/conftest.c
4352 4352
     for i in 1 2 3 4 5 6; do
4353 4353
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
4354
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
4355
-      # Solaris 8's {/usr,}/bin/sh.
4356
-      touch sub/conftst$i.h
4354
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
4355
+      # Solaris 10 /bin/sh.
4356
+      echo '/* dummy */' > sub/conftst$i.h
4357 4357
     done
4358 4358
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4359 4359
 
4360
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
4360
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
4361 4361
     # mode.  It turns out that the SunPro C++ compiler does not properly
4362
-    # handle `-M -o', and we need to detect this.  Also, some Intel
4363
-    # versions had trouble with output in subdirs
4362
+    # handle '-M -o', and we need to detect this.  Also, some Intel
4363
+    # versions had trouble with output in subdirs.
4364 4364
     am__obj=sub/conftest.${OBJEXT-o}
4365 4365
     am__minus_obj="-o $am__obj"
4366 4366
     case $depmode in
... ...
@@ -4369,8 +4582,8 @@ else
4369 4369
       test "$am__universal" = false || continue
4370 4370
       ;;
4371 4371
     nosideeffect)
4372
-      # after this tag, mechanisms are not by side-effect, so they'll
4373
-      # only be used when explicitly requested
4372
+      # After this tag, mechanisms are not by side-effect, so they'll
4373
+      # only be used when explicitly requested.
4374 4374
       if test "x$enable_dependency_tracking" = xyes; then
4375 4375
 	continue
4376 4376
       else
... ...
@@ -4378,7 +4591,7 @@ else
4378 4378
       fi
4379 4379
       ;;
4380 4380
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
4381
-      # This compiler won't grok `-c -o', but also, the minuso test has
4381
+      # This compiler won't grok '-c -o', but also, the minuso test has
4382 4382
       # not run yet.  These depmodes are late enough in the game, and
4383 4383
       # so weak that their functioning should not be impacted.
4384 4384
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -4587,7 +4800,7 @@ do
4587 4587
     for ac_prog in grep ggrep; do
4588 4588
     for ac_exec_ext in '' $ac_executable_extensions; do
4589 4589
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4590
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4590
+      as_fn_executable_p "$ac_path_GREP" || continue
4591 4591
 # Check for GNU ac_path_GREP and select it if it is found.
4592 4592
   # Check for GNU $ac_path_GREP
4593 4593
 case `"$ac_path_GREP" --version 2>&1` in
... ...
@@ -4653,7 +4866,7 @@ do
4653 4653
     for ac_prog in egrep; do
4654 4654
     for ac_exec_ext in '' $ac_executable_extensions; do
4655 4655
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4656
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4656
+      as_fn_executable_p "$ac_path_EGREP" || continue
4657 4657
 # Check for GNU ac_path_EGREP and select it if it is found.
4658 4658
   # Check for GNU $ac_path_EGREP
4659 4659
 case `"$ac_path_EGREP" --version 2>&1` in
... ...
@@ -4860,8 +5073,8 @@ else
4860 4860
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4861 4861
 /* end confdefs.h.  */
4862 4862
 
4863
-#	  define __EXTENSIONS__ 1
4864
-	  $ac_includes_default
4863
+#         define __EXTENSIONS__ 1
4864
+          $ac_includes_default
4865 4865
 int
4866 4866
 main ()
4867 4867
 {
... ...
@@ -5049,7 +5262,7 @@ do
5049 5049
     for ac_prog in sed gsed; do
5050 5050
     for ac_exec_ext in '' $ac_executable_extensions; do
5051 5051
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
5052
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
5052
+      as_fn_executable_p "$ac_path_SED" || continue
5053 5053
 # Check for GNU ac_path_SED and select it if it is found.
5054 5054
   # Check for GNU $ac_path_SED
5055 5055
 case `"$ac_path_SED" --version 2>&1` in
... ...
@@ -5128,7 +5341,7 @@ do
5128 5128
     for ac_prog in fgrep; do
5129 5129
     for ac_exec_ext in '' $ac_executable_extensions; do
5130 5130
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
5131
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
5131
+      as_fn_executable_p "$ac_path_FGREP" || continue
5132 5132
 # Check for GNU ac_path_FGREP and select it if it is found.
5133 5133
   # Check for GNU $ac_path_FGREP
5134 5134
 case `"$ac_path_FGREP" --version 2>&1` in
... ...
@@ -5384,7 +5597,7 @@ do
5384 5384
   IFS=$as_save_IFS
5385 5385
   test -z "$as_dir" && as_dir=.
5386 5386
     for ac_exec_ext in '' $ac_executable_extensions; do
5387
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5387
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5388 5388
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
5389 5389
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5390 5390
     break 2
... ...
@@ -5428,7 +5641,7 @@ do
5428 5428
   IFS=$as_save_IFS
5429 5429
   test -z "$as_dir" && as_dir=.
5430 5430
     for ac_exec_ext in '' $ac_executable_extensions; do
5431
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5431
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5432 5432
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
5433 5433
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5434 5434
     break 2
... ...
@@ -5852,7 +6065,7 @@ do
5852 5852
   IFS=$as_save_IFS
5853 5853
   test -z "$as_dir" && as_dir=.
5854 5854
     for ac_exec_ext in '' $ac_executable_extensions; do
5855
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5855
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5856 5856
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5857 5857
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5858 5858
     break 2
... ...
@@ -5892,7 +6105,7 @@ do
5892 5892
   IFS=$as_save_IFS
5893 5893
   test -z "$as_dir" && as_dir=.
5894 5894
     for ac_exec_ext in '' $ac_executable_extensions; do
5895
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5895
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5896 5896
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
5897 5897
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5898 5898
     break 2
... ...
@@ -6198,7 +6411,7 @@ do
6198 6198
   IFS=$as_save_IFS
6199 6199
   test -z "$as_dir" && as_dir=.
6200 6200
     for ac_exec_ext in '' $ac_executable_extensions; do
6201
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6201
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6202 6202
     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6203 6203
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6204 6204
     break 2
... ...
@@ -6238,7 +6451,7 @@ do
6238 6238
   IFS=$as_save_IFS
6239 6239
   test -z "$as_dir" && as_dir=.
6240 6240
     for ac_exec_ext in '' $ac_executable_extensions; do
6241
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6241
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6242 6242
     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6243 6243
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6244 6244
     break 2
... ...
@@ -6341,7 +6554,7 @@ do
6341 6341
   IFS=$as_save_IFS
6342 6342
   test -z "$as_dir" && as_dir=.
6343 6343
     for ac_exec_ext in '' $ac_executable_extensions; do
6344
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6344
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6345 6345
     ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
6346 6346
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6347 6347
     break 2
... ...
@@ -6385,7 +6598,7 @@ do
6385 6385
   IFS=$as_save_IFS
6386 6386
   test -z "$as_dir" && as_dir=.
6387 6387
     for ac_exec_ext in '' $ac_executable_extensions; do
6388
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6388
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6389 6389
     ac_cv_prog_ac_ct_AR="$ac_prog"
6390 6390
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6391 6391
     break 2
... ...
@@ -6510,7 +6723,7 @@ do
6510 6510
   IFS=$as_save_IFS
6511 6511
   test -z "$as_dir" && as_dir=.
6512 6512
     for ac_exec_ext in '' $ac_executable_extensions; do
6513
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6513
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6514 6514
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6515 6515
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6516 6516
     break 2
... ...
@@ -6550,7 +6763,7 @@ do
6550 6550
   IFS=$as_save_IFS
6551 6551
   test -z "$as_dir" && as_dir=.
6552 6552
     for ac_exec_ext in '' $ac_executable_extensions; do
6553
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6553
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6554 6554
     ac_cv_prog_ac_ct_STRIP="strip"
6555 6555
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6556 6556
     break 2
... ...
@@ -6609,7 +6822,7 @@ do
6609 6609
   IFS=$as_save_IFS
6610 6610
   test -z "$as_dir" && as_dir=.
6611 6611
     for ac_exec_ext in '' $ac_executable_extensions; do
6612
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6612
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6613 6613
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6614 6614
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6615 6615
     break 2
... ...
@@ -6649,7 +6862,7 @@ do
6649 6649
   IFS=$as_save_IFS
6650 6650
   test -z "$as_dir" && as_dir=.
6651 6651
     for ac_exec_ext in '' $ac_executable_extensions; do
6652
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6652
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6653 6653
     ac_cv_prog_ac_ct_RANLIB="ranlib"
6654 6654
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6655 6655
     break 2
... ...
@@ -7298,7 +7511,7 @@ do
7298 7298
   IFS=$as_save_IFS
7299 7299
   test -z "$as_dir" && as_dir=.
7300 7300
     for ac_exec_ext in '' $ac_executable_extensions; do
7301
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7301
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7302 7302
     ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
7303 7303
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7304 7304
     break 2
... ...
@@ -7338,7 +7551,7 @@ do
7338 7338
   IFS=$as_save_IFS
7339 7339
   test -z "$as_dir" && as_dir=.
7340 7340
     for ac_exec_ext in '' $ac_executable_extensions; do
7341
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7341
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7342 7342
     ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
7343 7343
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7344 7344
     break 2
... ...
@@ -7418,7 +7631,7 @@ do
7418 7418
   IFS=$as_save_IFS
7419 7419
   test -z "$as_dir" && as_dir=.
7420 7420
     for ac_exec_ext in '' $ac_executable_extensions; do
7421
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7421
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7422 7422
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
7423 7423
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7424 7424
     break 2
... ...
@@ -7458,7 +7671,7 @@ do
7458 7458
   IFS=$as_save_IFS
7459 7459
   test -z "$as_dir" && as_dir=.
7460 7460
     for ac_exec_ext in '' $ac_executable_extensions; do
7461
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7461
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7462 7462
     ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
7463 7463
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7464 7464
     break 2
... ...
@@ -7510,7 +7723,7 @@ do
7510 7510
   IFS=$as_save_IFS
7511 7511
   test -z "$as_dir" && as_dir=.
7512 7512
     for ac_exec_ext in '' $ac_executable_extensions; do
7513
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7513
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7514 7514
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
7515 7515
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7516 7516
     break 2
... ...
@@ -7550,7 +7763,7 @@ do
7550 7550
   IFS=$as_save_IFS
7551 7551
   test -z "$as_dir" && as_dir=.
7552 7552
     for ac_exec_ext in '' $ac_executable_extensions; do
7553
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7553
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7554 7554
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
7555 7555
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7556 7556
     break 2
... ...
@@ -7602,7 +7815,7 @@ do
7602 7602
   IFS=$as_save_IFS
7603 7603
   test -z "$as_dir" && as_dir=.
7604 7604
     for ac_exec_ext in '' $ac_executable_extensions; do
7605
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7605
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7606 7606
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7607 7607
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7608 7608
     break 2
... ...
@@ -7642,7 +7855,7 @@ do
7642 7642
   IFS=$as_save_IFS
7643 7643
   test -z "$as_dir" && as_dir=.
7644 7644
     for ac_exec_ext in '' $ac_executable_extensions; do
7645
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7645
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7646 7646
     ac_cv_prog_ac_ct_LIPO="lipo"
7647 7647
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7648 7648
     break 2
... ...
@@ -7694,7 +7907,7 @@ do
7694 7694
   IFS=$as_save_IFS
7695 7695
   test -z "$as_dir" && as_dir=.
7696 7696
     for ac_exec_ext in '' $ac_executable_extensions; do
7697
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7697
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7698 7698
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7699 7699
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7700 7700
     break 2
... ...
@@ -7734,7 +7947,7 @@ do
7734 7734
   IFS=$as_save_IFS
7735 7735
   test -z "$as_dir" && as_dir=.
7736 7736
     for ac_exec_ext in '' $ac_executable_extensions; do
7737
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7737
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7738 7738
     ac_cv_prog_ac_ct_OTOOL="otool"
7739 7739
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7740 7740
     break 2
... ...
@@ -7786,7 +7999,7 @@ do
7786 7786
   IFS=$as_save_IFS
7787 7787
   test -z "$as_dir" && as_dir=.
7788 7788
     for ac_exec_ext in '' $ac_executable_extensions; do
7789
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7789
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7790 7790
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7791 7791
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7792 7792
     break 2
... ...
@@ -7826,7 +8039,7 @@ do
7826 7826
   IFS=$as_save_IFS
7827 7827
   test -z "$as_dir" && as_dir=.
7828 7828
     for ac_exec_ext in '' $ac_executable_extensions; do
7829
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7829
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7830 7830
     ac_cv_prog_ac_ct_OTOOL64="otool64"
7831 7831
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7832 7832
     break 2
... ...
@@ -13137,7 +13350,7 @@ do
13137 13137
   IFS=$as_save_IFS
13138 13138
   test -z "$as_dir" && as_dir=.
13139 13139
     for ac_exec_ext in '' $ac_executable_extensions; do
13140
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13140
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13141 13141
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
13142 13142
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13143 13143
     break 2
... ...
@@ -13177,7 +13390,7 @@ do
13177 13177
   IFS=$as_save_IFS
13178 13178
   test -z "$as_dir" && as_dir=.
13179 13179
     for ac_exec_ext in '' $ac_executable_extensions; do
13180
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13180
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13181 13181
     ac_cv_prog_ac_ct_CC="gcc"
13182 13182
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13183 13183
     break 2
... ...
@@ -13230,7 +13443,7 @@ do
13230 13230
   IFS=$as_save_IFS
13231 13231
   test -z "$as_dir" && as_dir=.
13232 13232
     for ac_exec_ext in '' $ac_executable_extensions; do
13233
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13233
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13234 13234
     ac_cv_prog_CC="${ac_tool_prefix}cc"
13235 13235
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13236 13236
     break 2
... ...
@@ -13271,7 +13484,7 @@ do
13271 13271
   IFS=$as_save_IFS
13272 13272
   test -z "$as_dir" && as_dir=.
13273 13273
     for ac_exec_ext in '' $ac_executable_extensions; do
13274
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13274
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13275 13275
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
13276 13276
        ac_prog_rejected=yes
13277 13277
        continue
... ...
@@ -13329,7 +13542,7 @@ do
13329 13329
   IFS=$as_save_IFS
13330 13330
   test -z "$as_dir" && as_dir=.
13331 13331
     for ac_exec_ext in '' $ac_executable_extensions; do
13332
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13332
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13333 13333
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
13334 13334
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13335 13335
     break 2
... ...
@@ -13373,7 +13586,7 @@ do
13373 13373
   IFS=$as_save_IFS
13374 13374
   test -z "$as_dir" && as_dir=.
13375 13375
     for ac_exec_ext in '' $ac_executable_extensions; do
13376
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13376
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13377 13377
     ac_cv_prog_ac_ct_CC="$ac_prog"
13378 13378
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13379 13379
     break 2
... ...
@@ -13569,8 +13782,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13569 13569
 /* end confdefs.h.  */
13570 13570
 #include <stdarg.h>
13571 13571
 #include <stdio.h>
13572
-#include <sys/types.h>
13573
-#include <sys/stat.h>
13572
+struct stat;
13574 13573
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
13575 13574
 struct buf { int x; };
13576 13575
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
... ...
@@ -13655,6 +13867,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13655 13655
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13656 13656
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13657 13657
 
13658
+ac_ext=c
13659
+ac_cpp='$CPP $CPPFLAGS'
13660
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13661
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13662
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
13663
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
13664
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
13665
+if ${am_cv_prog_cc_c_o+:} false; then :
13666
+  $as_echo_n "(cached) " >&6
13667
+else
13668
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13669
+/* end confdefs.h.  */
13670
+
13671
+int
13672
+main ()
13673
+{
13674
+
13675
+  ;
13676
+  return 0;
13677
+}
13678
+_ACEOF
13679
+  # Make sure it works both with $CC and with simple cc.
13680
+  # Following AC_PROG_CC_C_O, we do the test twice because some
13681
+  # compilers refuse to overwrite an existing .o file with -o,
13682
+  # though they will create one.
13683
+  am_cv_prog_cc_c_o=yes
13684
+  for am_i in 1 2; do
13685
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
13686
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
13687
+   ac_status=$?
13688
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
13689
+   (exit $ac_status); } \
13690
+         && test -f conftest2.$ac_objext; then
13691
+      : OK
13692
+    else
13693
+      am_cv_prog_cc_c_o=no
13694
+      break
13695
+    fi
13696
+  done
13697
+  rm -f core conftest*
13698
+  unset am_i
13699
+fi
13700
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
13701
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
13702
+if test "$am_cv_prog_cc_c_o" != yes; then
13703
+   # Losing compiler, so override with the script.
13704
+   # FIXME: It is wrong to rewrite CC.
13705
+   # But if we don't then we get into trouble of one sort or another.
13706
+   # A longer-term fix would be to have automake use am__CC in this case,
13707
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
13708
+   CC="$am_aux_dir/compile $CC"
13709
+fi
13710
+ac_ext=c
13711
+ac_cpp='$CPP $CPPFLAGS'
13712
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13713
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13714
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
13715
+
13716
+
13658 13717
 depcc="$CC"   am_compiler_list=
13659 13718
 
13660 13719
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
... ...
@@ -13666,8 +13937,8 @@ else
13666 13666
   # We make a subdir and do the tests there.  Otherwise we can end up
13667 13667
   # making bogus files that we don't know about and never remove.  For
13668 13668
   # instance it was reported that on HP-UX the gcc test will end up
13669
-  # making a dummy file named `D' -- because `-MD' means `put the output
13670
-  # in D'.
13669
+  # making a dummy file named 'D' -- because '-MD' means "put the output
13670
+  # in D".
13671 13671
   rm -rf conftest.dir
13672 13672
   mkdir conftest.dir
13673 13673
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -13702,16 +13973,16 @@ else
13702 13702
     : > sub/conftest.c
13703 13703
     for i in 1 2 3 4 5 6; do
13704 13704
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
13705
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
13706
-      # Solaris 8's {/usr,}/bin/sh.
13707
-      touch sub/conftst$i.h
13705
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
13706
+      # Solaris 10 /bin/sh.
13707
+      echo '/* dummy */' > sub/conftst$i.h
13708 13708
     done
13709 13709
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
13710 13710
 
13711
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
13711
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
13712 13712
     # mode.  It turns out that the SunPro C++ compiler does not properly
13713
-    # handle `-M -o', and we need to detect this.  Also, some Intel
13714
-    # versions had trouble with output in subdirs
13713
+    # handle '-M -o', and we need to detect this.  Also, some Intel
13714
+    # versions had trouble with output in subdirs.
13715 13715
     am__obj=sub/conftest.${OBJEXT-o}
13716 13716
     am__minus_obj="-o $am__obj"
13717 13717
     case $depmode in
... ...
@@ -13720,8 +13991,8 @@ else
13720 13720
       test "$am__universal" = false || continue
13721 13721
       ;;
13722 13722
     nosideeffect)
13723
-      # after this tag, mechanisms are not by side-effect, so they'll
13724
-      # only be used when explicitly requested
13723
+      # After this tag, mechanisms are not by side-effect, so they'll
13724
+      # only be used when explicitly requested.
13725 13725
       if test "x$enable_dependency_tracking" = xyes; then
13726 13726
 	continue
13727 13727
       else
... ...
@@ -13729,7 +14000,7 @@ else
13729 13729
       fi
13730 13730
       ;;
13731 13731
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
13732
-      # This compiler won't grok `-c -o', but also, the minuso test has
13732
+      # This compiler won't grok '-c -o', but also, the minuso test has
13733 13733
       # not run yet.  These depmodes are late enough in the game, and
13734 13734
       # so weak that their functioning should not be impacted.
13735 13735
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -13801,7 +14072,7 @@ do
13801 13801
   IFS=$as_save_IFS
13802 13802
   test -z "$as_dir" && as_dir=.
13803 13803
     for ac_exec_ext in '' $ac_executable_extensions; do
13804
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13804
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13805 13805
     ac_cv_prog_LEX="$ac_prog"
13806 13806
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13807 13807
     break 2
... ...
@@ -13833,7 +14104,8 @@ a { ECHO; }
13833 13833
 b { REJECT; }
13834 13834
 c { yymore (); }
13835 13835
 d { yyless (1); }
13836
-e { yyless (input () != 0); }
13836
+e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument.  */
13837
+    yyless ((input () != 0)); }
13837 13838
 f { unput (yytext[0]); }
13838 13839
 . { BEGIN INITIAL; }
13839 13840
 %%
... ...
@@ -13962,7 +14234,7 @@ do
13962 13962
   IFS=$as_save_IFS
13963 13963
   test -z "$as_dir" && as_dir=.
13964 13964
     for ac_exec_ext in '' $ac_executable_extensions; do
13965
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13965
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13966 13966
     ac_cv_prog_YACC="$ac_prog"
13967 13967
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13968 13968
     break 2
... ...
@@ -14304,11 +14576,11 @@ else
14304 14304
 int
14305 14305
 main ()
14306 14306
 {
14307
-/* FIXME: Include the comments suggested by Paul. */
14307
+
14308 14308
 #ifndef __cplusplus
14309
-  /* Ultrix mips cc rejects this.  */
14309
+  /* Ultrix mips cc rejects this sort of thing.  */
14310 14310
   typedef int charset[2];
14311
-  const charset cs;
14311
+  const charset cs = { 0, 0 };
14312 14312
   /* SunOS 4.1.1 cc rejects this.  */
14313 14313
   char const *const *pcpcc;
14314 14314
   char **ppc;
... ...
@@ -14325,8 +14597,9 @@ main ()
14325 14325
   ++pcpcc;
14326 14326
   ppc = (char**) pcpcc;
14327 14327
   pcpcc = (char const *const *) ppc;
14328
-  { /* SCO 3.2v4 cc rejects this.  */
14329
-    char *t;
14328
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
14329
+    char tx;
14330
+    char *t = &tx;
14330 14331
     char const *s = 0 ? (char *) 0 : (char const *) 0;
14331 14332
 
14332 14333
     *t++ = 0;
... ...
@@ -14342,10 +14615,10 @@ main ()
14342 14342
     iptr p = 0;
14343 14343
     ++p;
14344 14344
   }
14345
-  { /* AIX XL C 1.02.0.0 rejects this saying
14345
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
14346 14346
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14347
-    struct s { int j; const int *ap[3]; };
14348
-    struct s *b; b->j = 5;
14347
+    struct s { int j; const int *ap[3]; } bx;
14348
+    struct s *b = &bx; b->j = 5;
14349 14349
   }
14350 14350
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14351 14351
     const int foo = 10;
... ...
@@ -15429,7 +15702,7 @@ if test "$ac_res" != no; then :
15429 15429
 fi
15430 15430
 
15431 15431
 
15432
-for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise
15432
+for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise getnameinfo
15433 15433
 do :
15434 15434
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15435 15435
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
... ...
@@ -16574,7 +16847,7 @@ do
16574 16574
   IFS=$as_save_IFS
16575 16575
   test -z "$as_dir" && as_dir=.
16576 16576
     for ac_exec_ext in '' $ac_executable_extensions; do
16577
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
16577
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
16578 16578
     ac_cv_prog_GCOV="$ac_prog"
16579 16579
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
16580 16580
     break 2
... ...
@@ -16617,7 +16890,7 @@ do
16617 16617
   IFS=$as_save_IFS
16618 16618
   test -z "$as_dir" && as_dir=.
16619 16619
     for ac_exec_ext in '' $ac_executable_extensions; do
16620
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
16620
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
16621 16621
     ac_cv_prog_LCOV="$ac_prog"
16622 16622
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
16623 16623
     break 2
... ...
@@ -16660,7 +16933,7 @@ do
16660 16660
   IFS=$as_save_IFS
16661 16661
   test -z "$as_dir" && as_dir=.
16662 16662
     for ac_exec_ext in '' $ac_executable_extensions; do
16663
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
16663
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
16664 16664
     ac_cv_prog_GENHTML="$ac_prog"
16665 16665
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
16666 16666
     break 2
... ...
@@ -19875,7 +20148,7 @@ do
19875 19875
   IFS=$as_save_IFS
19876 19876
   test -z "$as_dir" && as_dir=.
19877 19877
     for ac_exec_ext in '' $ac_executable_extensions; do
19878
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
19878
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19879 19879
     ac_cv_path_GETENT="$as_dir/$ac_word$ac_exec_ext"
19880 19880
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19881 19881
     break 2
... ...
@@ -22785,6 +23058,14 @@ LIBOBJS=$ac_libobjs
22785 22785
 LTLIBOBJS=$ac_ltlibobjs
22786 22786
 
22787 22787
 
22788
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
22789
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
22790
+   if test -n "$am_sleep_pid"; then
22791
+     # Hide warnings about reused PIDs.
22792
+     wait $am_sleep_pid 2>/dev/null
22793
+   fi
22794
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
22795
+$as_echo "done" >&6; }
22788 22796
  if test -n "$EXEEXT"; then
22789 22797
   am__EXEEXT_TRUE=
22790 22798
   am__EXEEXT_FALSE='#'
... ...
@@ -23173,16 +23454,16 @@ if (echo >conf$$.file) 2>/dev/null; then
23173 23173
     # ... but there are two gotchas:
23174 23174
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
23175 23175
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
23176
-    # In both cases, we have to default to `cp -p'.
23176
+    # In both cases, we have to default to `cp -pR'.
23177 23177
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
23178
-      as_ln_s='cp -p'
23178
+      as_ln_s='cp -pR'
23179 23179
   elif ln conf$$.file conf$$ 2>/dev/null; then
23180 23180
     as_ln_s=ln
23181 23181
   else
23182
-    as_ln_s='cp -p'
23182
+    as_ln_s='cp -pR'
23183 23183
   fi
23184 23184
 else
23185
-  as_ln_s='cp -p'
23185
+  as_ln_s='cp -pR'
23186 23186
 fi
23187 23187
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
23188 23188
 rmdir conf$$.dir 2>/dev/null
... ...
@@ -23242,28 +23523,16 @@ else
23242 23242
   as_mkdir_p=false
23243 23243
 fi
23244 23244
 
23245
-if test -x / >/dev/null 2>&1; then
23246
-  as_test_x='test -x'
23247
-else
23248
-  if ls -dL / >/dev/null 2>&1; then
23249
-    as_ls_L_option=L
23250
-  else
23251
-    as_ls_L_option=
23252
-  fi
23253
-  as_test_x='
23254
-    eval sh -c '\''
23255
-      if test -d "$1"; then
23256
-	test -d "$1/.";
23257
-      else
23258
-	case $1 in #(
23259
-	-*)set "./$1";;
23260
-	esac;
23261
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
23262
-	???[sx]*):;;*)false;;esac;fi
23263
-    '\'' sh
23264
-  '
23265
-fi
23266
-as_executable_p=$as_test_x
23245
+
23246
+# as_fn_executable_p FILE
23247
+# -----------------------
23248
+# Test if FILE is an executable regular file.
23249
+as_fn_executable_p ()
23250
+{
23251
+  test -f "$1" && test -x "$1"
23252
+} # as_fn_executable_p
23253
+as_test_x='test -x'
23254
+as_executable_p=as_fn_executable_p
23267 23255
 
23268 23256
 # Sed expression to map a string onto a valid CPP name.
23269 23257
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
... ...
@@ -23285,7 +23554,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
23285 23285
 # values after options handling.
23286 23286
 ac_log="
23287 23287
 This file was extended by ClamAV $as_me devel, which was
23288
-generated by GNU Autoconf 2.68.  Invocation command line was
23288
+generated by GNU Autoconf 2.69.  Invocation command line was
23289 23289
 
23290 23290
   CONFIG_FILES    = $CONFIG_FILES
23291 23291
   CONFIG_HEADERS  = $CONFIG_HEADERS
... ...
@@ -23352,10 +23621,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
23352 23352
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
23353 23353
 ac_cs_version="\\
23354 23354
 ClamAV config.status devel
23355
-configured by $0, generated by GNU Autoconf 2.68,
23355
+configured by $0, generated by GNU Autoconf 2.69,
23356 23356
   with options \\"\$ac_cs_config\\"
23357 23357
 
23358
-Copyright (C) 2010 Free Software Foundation, Inc.
23358
+Copyright (C) 2012 Free Software Foundation, Inc.
23359 23359
 This config.status script is free software; the Free Software Foundation
23360 23360
 gives unlimited permission to copy, distribute and modify it."
23361 23361
 
... ...
@@ -23446,7 +23715,7 @@ fi
23446 23446
 _ACEOF
23447 23447
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
23448 23448
 if \$ac_cs_recheck; then
23449
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
23449
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
23450 23450
   shift
23451 23451
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
23452 23452
   CONFIG_SHELL='$SHELL'
... ...
@@ -24389,7 +24658,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
24389 24389
 
24390 24390
   case $ac_file$ac_mode in
24391 24391
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
24392
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
24392
+  # Older Autoconf quotes --file arguments for eval, but not when files
24393 24393
   # are listed without --file.  Let's play safe and only enable the eval
24394 24394
   # if we detect the quoting.
24395 24395
   case $CONFIG_FILES in
... ...
@@ -24402,7 +24671,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
24402 24402
     # Strip MF so we end up with the name of the file.
24403 24403
     mf=`echo "$mf" | sed -e 's/:.*$//'`
24404 24404
     # Check whether this is an Automake generated Makefile or not.
24405
-    # We used to match only the files named `Makefile.in', but
24405
+    # We used to match only the files named 'Makefile.in', but
24406 24406
     # some people rename them; so instead we look at the file content.
24407 24407
     # Grep'ing the first line is not enough: some people post-process
24408 24408
     # each Makefile.in and add a new line on top of each file to say so.
... ...
@@ -24436,21 +24705,19 @@ $as_echo X"$mf" |
24436 24436
       continue
24437 24437
     fi
24438 24438
     # Extract the definition of DEPDIR, am__include, and am__quote
24439
-    # from the Makefile without running `make'.
24439
+    # from the Makefile without running 'make'.
24440 24440
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
24441 24441
     test -z "$DEPDIR" && continue
24442 24442
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
24443
-    test -z "am__include" && continue
24443
+    test -z "$am__include" && continue
24444 24444
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
24445
-    # When using ansi2knr, U may be empty or an underscore; expand it
24446
-    U=`sed -n 's/^U = //p' < "$mf"`
24447 24445
     # Find all dependency output files, they are included files with
24448 24446
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
24449 24447
     # simplest approach to changing $(DEPDIR) to its actual value in the
24450 24448
     # expansion.
24451 24449
     for file in `sed -n "
24452 24450
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
24453
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
24451
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
24454 24452
       # Make sure the directory exists.
24455 24453
       test -f "$dirpart/$file" && continue
24456 24454
       fdir=`$as_dirname -- "$file" ||
... ...
@@ -25423,6 +25690,14 @@ LIBOBJS=$ac_libobjs
25423 25423
 LTLIBOBJS=$ac_ltlibobjs
25424 25424
 
25425 25425
 
25426
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
25427
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
25428
+   if test -n "$am_sleep_pid"; then
25429
+     # Hide warnings about reused PIDs.
25430
+     wait $am_sleep_pid 2>/dev/null
25431
+   fi
25432
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
25433
+$as_echo "done" >&6; }
25426 25434
  if test -n "$EXEEXT"; then
25427 25435
   am__EXEEXT_TRUE=
25428 25436
   am__EXEEXT_FALSE='#'
... ...
@@ -25819,16 +26094,16 @@ if (echo >conf$$.file) 2>/dev/null; then
25819 25819
     # ... but there are two gotchas:
25820 25820
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
25821 25821
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
25822
-    # In both cases, we have to default to `cp -p'.
25822
+    # In both cases, we have to default to `cp -pR'.
25823 25823
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
25824
-      as_ln_s='cp -p'
25824
+      as_ln_s='cp -pR'
25825 25825
   elif ln conf$$.file conf$$ 2>/dev/null; then
25826 25826
     as_ln_s=ln
25827 25827
   else
25828
-    as_ln_s='cp -p'
25828
+    as_ln_s='cp -pR'
25829 25829
   fi
25830 25830
 else
25831
-  as_ln_s='cp -p'
25831
+  as_ln_s='cp -pR'
25832 25832
 fi
25833 25833
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
25834 25834
 rmdir conf$$.dir 2>/dev/null
... ...
@@ -25888,28 +26163,16 @@ else
25888 25888
   as_mkdir_p=false
25889 25889
 fi
25890 25890
 
25891
-if test -x / >/dev/null 2>&1; then
25892
-  as_test_x='test -x'
25893
-else
25894
-  if ls -dL / >/dev/null 2>&1; then
25895
-    as_ls_L_option=L
25896
-  else
25897
-    as_ls_L_option=
25898
-  fi
25899
-  as_test_x='
25900
-    eval sh -c '\''
25901
-      if test -d "$1"; then
25902
-	test -d "$1/.";
25903
-      else
25904
-	case $1 in #(
25905
-	-*)set "./$1";;
25906
-	esac;
25907
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
25908
-	???[sx]*):;;*)false;;esac;fi
25909
-    '\'' sh
25910
-  '
25911
-fi
25912
-as_executable_p=$as_test_x
25891
+
25892
+# as_fn_executable_p FILE
25893
+# -----------------------
25894
+# Test if FILE is an executable regular file.
25895
+as_fn_executable_p ()
25896
+{
25897
+  test -f "$1" && test -x "$1"
25898
+} # as_fn_executable_p
25899
+as_test_x='test -x'
25900
+as_executable_p=as_fn_executable_p
25913 25901
 
25914 25902
 # Sed expression to map a string onto a valid CPP name.
25915 25903
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
... ...
@@ -25931,7 +26194,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
25931 25931
 # values after options handling.
25932 25932
 ac_log="
25933 25933
 This file was extended by ClamAV $as_me devel, which was
25934
-generated by GNU Autoconf 2.68.  Invocation command line was
25934
+generated by GNU Autoconf 2.69.  Invocation command line was
25935 25935
 
25936 25936
   CONFIG_FILES    = $CONFIG_FILES
25937 25937
   CONFIG_HEADERS  = $CONFIG_HEADERS
... ...
@@ -25998,10 +26261,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
25998 25998
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
25999 25999
 ac_cs_version="\\
26000 26000
 ClamAV config.status devel
26001
-configured by $0, generated by GNU Autoconf 2.68,
26001
+configured by $0, generated by GNU Autoconf 2.69,
26002 26002
   with options \\"\$ac_cs_config\\"
26003 26003
 
26004
-Copyright (C) 2010 Free Software Foundation, Inc.
26004
+Copyright (C) 2012 Free Software Foundation, Inc.
26005 26005
 This config.status script is free software; the Free Software Foundation
26006 26006
 gives unlimited permission to copy, distribute and modify it."
26007 26007
 
... ...
@@ -26092,7 +26355,7 @@ fi
26092 26092
 _ACEOF
26093 26093
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
26094 26094
 if \$ac_cs_recheck; then
26095
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
26095
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
26096 26096
   shift
26097 26097
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
26098 26098
   CONFIG_SHELL='$SHELL'
... ...
@@ -27037,7 +27300,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
27037 27037
 
27038 27038
   case $ac_file$ac_mode in
27039 27039
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
27040
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
27040
+  # Older Autoconf quotes --file arguments for eval, but not when files
27041 27041
   # are listed without --file.  Let's play safe and only enable the eval
27042 27042
   # if we detect the quoting.
27043 27043
   case $CONFIG_FILES in
... ...
@@ -27050,7 +27313,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
27050 27050
     # Strip MF so we end up with the name of the file.
27051 27051
     mf=`echo "$mf" | sed -e 's/:.*$//'`
27052 27052
     # Check whether this is an Automake generated Makefile or not.
27053
-    # We used to match only the files named `Makefile.in', but
27053
+    # We used to match only the files named 'Makefile.in', but
27054 27054
     # some people rename them; so instead we look at the file content.
27055 27055
     # Grep'ing the first line is not enough: some people post-process
27056 27056
     # each Makefile.in and add a new line on top of each file to say so.
... ...
@@ -27084,21 +27347,19 @@ $as_echo X"$mf" |
27084 27084
       continue
27085 27085
     fi
27086 27086
     # Extract the definition of DEPDIR, am__include, and am__quote
27087
-    # from the Makefile without running `make'.
27087
+    # from the Makefile without running 'make'.
27088 27088
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
27089 27089
     test -z "$DEPDIR" && continue
27090 27090
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
27091
-    test -z "am__include" && continue
27091
+    test -z "$am__include" && continue
27092 27092
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
27093
-    # When using ansi2knr, U may be empty or an underscore; expand it
27094
-    U=`sed -n 's/^U = //p' < "$mf"`
27095 27093
     # Find all dependency output files, they are included files with
27096 27094
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
27097 27095
     # simplest approach to changing $(DEPDIR) to its actual value in the
27098 27096
     # expansion.
27099 27097
     for file in `sed -n "
27100 27098
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
27101
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
27099
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
27102 27100
       # Make sure the directory exists.
27103 27101
       test -f "$dirpart/$file" && continue
27104 27102
       fdir=`$as_dirname -- "$file" ||
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  along with this program; if not, write to the Free Software
35 35
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -54,7 +98,7 @@ build_triplet = @build@
54 54
 host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 subdir = database
57
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
57
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
58 58
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
59 59
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
60 60
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -129,14 +173,26 @@ mkinstalldirs = $(install_sh) -d
129 129
 CONFIG_HEADER = $(top_builddir)/clamav-config.h
130 130
 CONFIG_CLEAN_FILES =
131 131
 CONFIG_CLEAN_VPATH_FILES =
132
+AM_V_P = $(am__v_P_@AM_V@)
133
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
134
+am__v_P_0 = false
135
+am__v_P_1 = :
132 136
 AM_V_GEN = $(am__v_GEN_@AM_V@)
133 137
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
134
-am__v_GEN_0 = @echo "  GEN   " $@;
138
+am__v_GEN_0 = @echo "  GEN     " $@;
139
+am__v_GEN_1 = 
135 140
 AM_V_at = $(am__v_at_@AM_V@)
136 141
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
137 142
 am__v_at_0 = @
143
+am__v_at_1 = 
138 144
 SOURCES =
139 145
 DIST_SOURCES =
146
+am__can_run_installinfo = \
147
+  case $$AM_UPDATE_INFO_DIR in \
148
+    n|no|NO) false;; \
149
+    *) (install-info --version) >/dev/null 2>&1;; \
150
+  esac
151
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
140 152
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
141 153
 ACLOCAL = @ACLOCAL@
142 154
 AMTAR = @AMTAR@
... ...
@@ -378,11 +434,11 @@ mostlyclean-libtool:
378 378
 
379 379
 clean-libtool:
380 380
 	-rm -rf .libs _libs
381
-tags: TAGS
382
-TAGS:
381
+tags TAGS:
382
+
383
+ctags CTAGS:
383 384
 
384
-ctags: CTAGS
385
-CTAGS:
385
+cscope cscopelist:
386 386
 
387 387
 
388 388
 distdir: $(DISTFILES)
... ...
@@ -518,16 +574,17 @@ uninstall-am:
518 518
 .MAKE: install-am install-strip
519 519
 
520 520
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
521
-	distclean distclean-generic distclean-libtool distdir dvi \
522
-	dvi-am html html-am info info-am install install-am \
523
-	install-data install-data-am install-data-local install-dvi \
524
-	install-dvi-am install-exec install-exec-am install-html \
525
-	install-html-am install-info install-info-am install-man \
526
-	install-pdf install-pdf-am install-ps install-ps-am \
527
-	install-strip installcheck installcheck-am installdirs \
528
-	maintainer-clean maintainer-clean-generic mostlyclean \
529
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
530
-	uninstall uninstall-am
521
+	cscopelist-am ctags-am distclean distclean-generic \
522
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
523
+	install install-am install-data install-data-am \
524
+	install-data-local install-dvi install-dvi-am install-exec \
525
+	install-exec-am install-html install-html-am install-info \
526
+	install-info-am install-man install-pdf install-pdf-am \
527
+	install-ps install-ps-am install-strip installcheck \
528
+	installcheck-am installdirs maintainer-clean \
529
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
530
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
531
+	uninstall-am
531 532
 
532 533
 
533 534
 install-data-local:
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -33,6 +32,51 @@
33 33
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
34 34
 #  MA 02110-1301, USA.
35 35
 VPATH = @srcdir@
36
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
37
+am__make_running_with_option = \
38
+  case $${target_option-} in \
39
+      ?) ;; \
40
+      *) echo "am__make_running_with_option: internal error: invalid" \
41
+              "target option '$${target_option-}' specified" >&2; \
42
+         exit 1;; \
43
+  esac; \
44
+  has_opt=no; \
45
+  sane_makeflags=$$MAKEFLAGS; \
46
+  if $(am__is_gnu_make); then \
47
+    sane_makeflags=$$MFLAGS; \
48
+  else \
49
+    case $$MAKEFLAGS in \
50
+      *\\[\ \	]*) \
51
+        bs=\\; \
52
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
53
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
54
+    esac; \
55
+  fi; \
56
+  skip_next=no; \
57
+  strip_trailopt () \
58
+  { \
59
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
60
+  }; \
61
+  for flg in $$sane_makeflags; do \
62
+    test $$skip_next = yes && { skip_next=no; continue; }; \
63
+    case $$flg in \
64
+      *=*|--*) continue;; \
65
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
66
+      -*I?*) strip_trailopt 'I';; \
67
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
68
+      -*O?*) strip_trailopt 'O';; \
69
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
70
+      -*l?*) strip_trailopt 'l';; \
71
+      -[dEDm]) skip_next=yes;; \
72
+      -[JT]) skip_next=yes;; \
73
+    esac; \
74
+    case $$flg in \
75
+      *$$target_option*) has_opt=yes; break;; \
76
+    esac; \
77
+  done; \
78
+  test $$has_opt = yes
79
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
80
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
36 81
 pkgdatadir = $(datadir)/@PACKAGE@
37 82
 pkgincludedir = $(includedir)/@PACKAGE@
38 83
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -54,7 +98,7 @@ host_triplet = @host@
54 54
 target_triplet = @target@
55 55
 @ENABLE_CLAMSUBMIT_TRUE@am__append_1 = man/clamsubmit.1
56 56
 subdir = docs
57
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
57
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
58 58
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
59 59
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
60 60
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -129,14 +173,25 @@ mkinstalldirs = $(install_sh) -d
129 129
 CONFIG_HEADER = $(top_builddir)/clamav-config.h
130 130
 CONFIG_CLEAN_FILES =
131 131
 CONFIG_CLEAN_VPATH_FILES =
132
+AM_V_P = $(am__v_P_@AM_V@)
133
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
134
+am__v_P_0 = false
135
+am__v_P_1 = :
132 136
 AM_V_GEN = $(am__v_GEN_@AM_V@)
133 137
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
134
-am__v_GEN_0 = @echo "  GEN   " $@;
138
+am__v_GEN_0 = @echo "  GEN     " $@;
139
+am__v_GEN_1 = 
135 140
 AM_V_at = $(am__v_at_@AM_V@)
136 141
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
137 142
 am__v_at_0 = @
143
+am__v_at_1 = 
138 144
 SOURCES =
139 145
 DIST_SOURCES =
146
+am__can_run_installinfo = \
147
+  case $$AM_UPDATE_INFO_DIR in \
148
+    n|no|NO) false;; \
149
+    *) (install-info --version) >/dev/null 2>&1;; \
150
+  esac
140 151
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
141 152
 am__vpath_adj = case $$p in \
142 153
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
... ...
@@ -171,6 +226,7 @@ man5dir = $(mandir)/man5
171 171
 man8dir = $(mandir)/man8
172 172
 NROFF = nroff
173 173
 MANS = $(man_MANS)
174
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
174 175
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
175 176
 ACLOCAL = @ACLOCAL@
176 177
 AMTAR = @AMTAR@
... ...
@@ -417,11 +473,18 @@ clean-libtool:
417 417
 	-rm -rf .libs _libs
418 418
 install-man1: $(man_MANS)
419 419
 	@$(NORMAL_INSTALL)
420
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
421
-	@list=''; test -n "$(man1dir)" || exit 0; \
422
-	{ for i in $$list; do echo "$$i"; done; \
423
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
424
-	  sed -n '/\.1[a-z]*$$/p'; \
420
+	@list1=''; \
421
+	list2='$(man_MANS)'; \
422
+	test -n "$(man1dir)" \
423
+	  && test -n "`echo $$list1$$list2`" \
424
+	  || exit 0; \
425
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
426
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
427
+	{ for i in $$list1; do echo "$$i"; done;  \
428
+	if test -n "$$list2"; then \
429
+	  for i in $$list2; do echo "$$i"; done \
430
+	    | sed -n '/\.1[a-z]*$$/p'; \
431
+	fi; \
425 432
 	} | while read p; do \
426 433
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
427 434
 	  echo "$$d$$p"; echo "$$p"; \
... ...
@@ -453,11 +516,18 @@ uninstall-man1:
453 453
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
454 454
 install-man5: $(man_MANS)
455 455
 	@$(NORMAL_INSTALL)
456
-	test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
457
-	@list=''; test -n "$(man5dir)" || exit 0; \
458
-	{ for i in $$list; do echo "$$i"; done; \
459
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
460
-	  sed -n '/\.5[a-z]*$$/p'; \
456
+	@list1=''; \
457
+	list2='$(man_MANS)'; \
458
+	test -n "$(man5dir)" \
459
+	  && test -n "`echo $$list1$$list2`" \
460
+	  || exit 0; \
461
+	echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
462
+	$(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
463
+	{ for i in $$list1; do echo "$$i"; done;  \
464
+	if test -n "$$list2"; then \
465
+	  for i in $$list2; do echo "$$i"; done \
466
+	    | sed -n '/\.5[a-z]*$$/p'; \
467
+	fi; \
461 468
 	} | while read p; do \
462 469
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
463 470
 	  echo "$$d$$p"; echo "$$p"; \
... ...
@@ -489,11 +559,18 @@ uninstall-man5:
489 489
 	dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
490 490
 install-man8: $(man_MANS)
491 491
 	@$(NORMAL_INSTALL)
492
-	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
493
-	@list=''; test -n "$(man8dir)" || exit 0; \
494
-	{ for i in $$list; do echo "$$i"; done; \
495
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
496
-	  sed -n '/\.8[a-z]*$$/p'; \
492
+	@list1=''; \
493
+	list2='$(man_MANS)'; \
494
+	test -n "$(man8dir)" \
495
+	  && test -n "`echo $$list1$$list2`" \
496
+	  || exit 0; \
497
+	echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
498
+	$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
499
+	{ for i in $$list1; do echo "$$i"; done;  \
500
+	if test -n "$$list2"; then \
501
+	  for i in $$list2; do echo "$$i"; done \
502
+	    | sed -n '/\.8[a-z]*$$/p'; \
503
+	fi; \
497 504
 	} | while read p; do \
498 505
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
499 506
 	  echo "$$d$$p"; echo "$$p"; \
... ...
@@ -523,27 +600,14 @@ uninstall-man8:
523 523
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
524 524
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
525 525
 	dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
526
-tags: TAGS
527
-TAGS:
526
+tags TAGS:
527
+
528
+ctags CTAGS:
528 529
 
529
-ctags: CTAGS
530
-CTAGS:
530
+cscope cscopelist:
531 531
 
532 532
 
533 533
 distdir: $(DISTFILES)
534
-	@list='$(MANS)'; if test -n "$$list"; then \
535
-	  list=`for p in $$list; do \
536
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
537
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
538
-	  if test -n "$$list" && \
539
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
540
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
541
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
542
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
543
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
544
-	    exit 1; \
545
-	  else :; fi; \
546
-	else :; fi
547 534
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
548 535
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
549 536
 	list='$(DISTFILES)'; \
... ...
@@ -681,17 +745,18 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
681 681
 .MAKE: install-am install-strip
682 682
 
683 683
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
684
-	distclean distclean-generic distclean-libtool distdir dvi \
685
-	dvi-am html html-am info info-am install install-am \
686
-	install-data install-data-am install-dvi install-dvi-am \
687
-	install-exec install-exec-am install-html install-html-am \
688
-	install-info install-info-am install-man install-man1 \
689
-	install-man5 install-man8 install-pdf install-pdf-am \
690
-	install-ps install-ps-am install-strip installcheck \
691
-	installcheck-am installdirs maintainer-clean \
684
+	cscopelist-am ctags-am distclean distclean-generic \
685
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
686
+	install install-am install-data install-data-am install-dvi \
687
+	install-dvi-am install-exec install-exec-am install-html \
688
+	install-html-am install-info install-info-am install-man \
689
+	install-man1 install-man5 install-man8 install-pdf \
690
+	install-pdf-am install-ps install-ps-am install-strip \
691
+	installcheck installcheck-am installdirs maintainer-clean \
692 692
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
693
-	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
694
-	uninstall-man uninstall-man1 uninstall-man5 uninstall-man8
693
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
694
+	uninstall-am uninstall-man uninstall-man1 uninstall-man5 \
695
+	uninstall-man8
695 696
 
696 697
 
697 698
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
698 699
Binary files a/docs/clamdoc.pdf and b/docs/clamdoc.pdf differ
... ...
@@ -272,6 +272,9 @@
272 272
 	    \footnote{Note that several versions of GCC have bugs when compiling LLVM, see
273 273
 		\url{http://llvm.org/docs/GettingStarted.html#brokengcc} for a
274 274
 		    full list.}
275
+	\item OSX Xcode versions prior to 5.0 use a g++ compiler frontend (llvm-gcc) that is not 
276
+	    compatible with ClamAV JIT. It is recommended to either compile ClamAV JIT with 
277
+	    clang++ or to compile ClamAV without JIT.
275 278
 	\item A supported CPU for the JIT, either of: X86, X86-64, PowerPC, PowerPC64
276 279
     \end{itemize}
277 280
     The following packages are optional, but needed for the JIT unit tests:
... ...
@@ -238,7 +238,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
238 238
 <!--End of Table of Child-Links-->
239 239
 <BR><HR>
240 240
 <ADDRESS>
241
-Cisco 2014-05-21
241
+Sourcefire 2013-04-16
242 242
 </ADDRESS>
243 243
 </BODY>
244 244
 </HTML>
245 245
new file mode 100644
246 246
Binary files /dev/null and b/docs/html/crossref.png differ
247 247
Binary files a/docs/html/img2.png and b/docs/html/img2.png differ
248 248
Binary files a/docs/html/img3.png and b/docs/html/img3.png differ
249 249
Binary files a/docs/html/img4.png and b/docs/html/img4.png differ
250 250
new file mode 100644
251 251
Binary files /dev/null and b/docs/html/img5.png differ
252 252
new file mode 100644
253 253
Binary files /dev/null and b/docs/html/img6.png differ
... ...
@@ -238,7 +238,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
238 238
 <!--End of Table of Child-Links-->
239 239
 <BR><HR>
240 240
 <ADDRESS>
241
-Cisco 2014-05-21
241
+Sourcefire 2013-04-16
242 242
 </ADDRESS>
243 243
 </BODY>
244 244
 </HTML>
... ...
@@ -171,7 +171,7 @@ Contents</A>
171 171
  SRC="img3.png"
172 172
  ALT="\begin{boxedminipage}[b]{\textwidth}
173 173
 ClamAV User Manual,
174
-\copyright \ 2014 Cis...
174
+\copyright  2014 Cis...
175 175
 ... Franklin Street, Fifth Floor, Boston,
176 176
 MA 02110-1301, USA.
177 177
 \end{boxedminipage}">
... ...
@@ -195,7 +195,7 @@ ClamAV and Clam AntiVirus are trademarks of Cisco Systems, Inc.
195 195
 <P>
196 196
 <BR><HR>
197 197
 <ADDRESS>
198
-Cisco 2014-05-21
198
+Sourcefire 2013-04-16
199 199
 </ADDRESS>
200 200
 </BODY>
201 201
 </HTML>
... ...
@@ -56,11 +56,11 @@ Binary packages</A>
56 56
 </H2>
57 57
     You can find the up-to-date list of binary packages at our website:
58 58
     <TT><A NAME="tex2html5"
59
-  HREF="http://www.clamav.net/download/packages/">http://www.clamav.net/download/packages/</A></TT>
59
+  HREF="http://www.clamav.net/download.html#otherversions">http://www.clamav.net/download.html#otherversions</A></TT>
60 60
 <P>
61 61
 <BR><HR>
62 62
 <ADDRESS>
63
-Cisco 2014-05-21
63
+Sourcefire 2013-04-16
64 64
 </ADDRESS>
65 65
 </BODY>
66 66
 </HTML>
... ...
@@ -82,7 +82,7 @@ Installation</A>
82 82
 <!--End of Table of Child-Links-->
83 83
 <BR><HR>
84 84
 <ADDRESS>
85
-Cisco 2014-05-21
85
+Sourcefire 2013-04-16
86 86
 </ADDRESS>
87 87
 </BODY>
88 88
 </HTML>
... ...
@@ -98,6 +98,10 @@ the package for these compilers are usually called: gcc, g++, or gcc-c++.
98 98
 	    <A NAME="tex2html9"
99 99
   HREF="footnode.html#foot821"><SUP><SPAN CLASS="arabic">6</SPAN></SUP></A>
100 100
 </LI>
101
+<LI>OSX Xcode versions prior to 5.0 use a g++ compiler frontend (llvm-gcc) that is not 
102
+	    compatible with ClamAV JIT. It is recommended to either compile ClamAV JIT with 
103
+	    clang++ or to compile ClamAV without JIT.
104
+</LI>
101 105
 <LI>A supported CPU for the JIT, either of: X86, X86-64, PowerPC, PowerPC64
102 106
     
103 107
 </LI>
... ...
@@ -139,7 +143,7 @@ the package for these compilers are usually called: gcc, g++, or gcc-c++.
139 139
   HREF="node1.html">Contents</A></B> </DIV>
140 140
 <!--End of Navigation Panel-->
141 141
 <ADDRESS>
142
-Cisco 2014-05-21
142
+Sourcefire 2013-04-16
143 143
 </ADDRESS>
144 144
 </BODY>
145 145
 </HTML>
... ...
@@ -74,7 +74,7 @@ Installing on shell account</A>
74 74
 <P>
75 75
 <BR><HR>
76 76
 <ADDRESS>
77
-Cisco 2014-05-21
77
+Sourcefire 2013-04-16
78 78
 </ADDRESS>
79 79
 </BODY>
80 80
 </HTML>
... ...
@@ -68,7 +68,7 @@ Adding new system user and group</A>
68 68
 <P>
69 69
 <BR><HR>
70 70
 <ADDRESS>
71
-Cisco 2014-05-21
71
+Sourcefire 2013-04-16
72 72
 </ADDRESS>
73 73
 </BODY>
74 74
 </HTML>
... ...
@@ -74,7 +74,7 @@ Compilation of base package</A>
74 74
 <P>
75 75
 <BR><HR>
76 76
 <ADDRESS>
77
-Cisco 2014-05-21
77
+Sourcefire 2013-04-16
78 78
 </ADDRESS>
79 79
 </BODY>
80 80
 </HTML>
... ...
@@ -65,7 +65,7 @@ Compilation with clamav-milter enabled</A>
65 65
 <P>
66 66
 <BR><HR>
67 67
 <ADDRESS>
68
-Cisco 2014-05-21
68
+Sourcefire 2013-04-16
69 69
 </ADDRESS>
70 70
 </BODY>
71 71
 </HTML>
... ...
@@ -141,7 +141,7 @@ All 4 tests passed
141 141
   HREF="node1.html">Contents</A></B> </DIV>
142 142
 <!--End of Navigation Panel-->
143 143
 <ADDRESS>
144
-Cisco 2014-05-21
144
+Sourcefire 2013-04-16
145 145
 </ADDRESS>
146 146
 </BODY>
147 147
 </HTML>
... ...
@@ -58,7 +58,7 @@ Reporting a unit test failure bug</A>
58 58
 	If <code>make check</code> says that some tests failed we encourage you to report a bug on our bugzilla: <TT><A NAME="tex2html14"
59 59
   HREF="http://bugs.clamav.net">http://bugs.clamav.net</A></TT>.
60 60
 	The information we need is (see also <TT><A NAME="tex2html15"
61
-  HREF="http://clamav.net/bugs">http://clamav.net/bugs</A></TT>):
61
+  HREF="http://www.clamav.net/documentation.html#ins-bugs">http://www.clamav.net/documentation.html#ins-bugs</A></TT>):
62 62
 	
63 63
 <UL>
64 64
 <LI>The exact output from <code>make check</code>	 
... ...
@@ -96,7 +96,7 @@ $ CK_FORK=no ./libtool --mode=execute valgrind unit_tests/check-clamav
96 96
 <P>
97 97
 <BR><HR>
98 98
 <ADDRESS>
99
-Cisco 2014-05-21
99
+Sourcefire 2013-04-16
100 100
 </ADDRESS>
101 101
 </BODY>
102 102
 </HTML>
... ...
@@ -86,7 +86,7 @@ Here is a listing of currently available ClamAV Virus Database Files:
86 86
 <P>
87 87
 <BR><HR>
88 88
 <ADDRESS>
89
-Cisco 2014-05-21
89
+Sourcefire 2013-04-16
90 90
 </ADDRESS>
91 91
 </BODY>
92 92
 </HTML>
... ...
@@ -78,7 +78,7 @@ Introduction</A>
78 78
 <!--End of Table of Child-Links-->
79 79
 <BR><HR>
80 80
 <ADDRESS>
81
-Cisco 2014-05-21
81
+Sourcefire 2013-04-16
82 82
 </ADDRESS>
83 83
 </BODY>
84 84
 </HTML>
... ...
@@ -90,7 +90,7 @@ Configuration</A>
90 90
 <!--End of Table of Child-Links-->
91 91
 <BR><HR>
92 92
 <ADDRESS>
93
-Cisco 2014-05-21
93
+Sourcefire 2013-04-16
94 94
 </ADDRESS>
95 95
 </BODY>
96 96
 </HTML>
... ...
@@ -78,7 +78,7 @@ clamd</A>
78 78
 <!--End of Table of Child-Links-->
79 79
 <BR><HR>
80 80
 <ADDRESS>
81
-Cisco 2014-05-21
81
+Sourcefire 2013-04-16
82 82
 </ADDRESS>
83 83
 </BODY>
84 84
 </HTML>
... ...
@@ -67,7 +67,7 @@ Configure on-access scanning in <code>clamd.conf</code> and read the
67 67
 <P>
68 68
 <BR><HR>
69 69
 <ADDRESS>
70
-Cisco 2014-05-21
70
+Sourcefire 2013-04-16
71 71
 </ADDRESS>
72 72
 </BODY>
73 73
 </HTML>
... ...
@@ -91,7 +91,7 @@ Please consult your MTA's manual on how to connect ClamAV with the milter.
91 91
 <P>
92 92
 <BR><HR>
93 93
 <ADDRESS>
94
-Cisco 2014-05-21
94
+Sourcefire 2013-04-16
95 95
 </ADDRESS>
96 96
 </BODY>
97 97
 </HTML>
... ...
@@ -74,7 +74,7 @@ Testing</A>
74 74
 <P>
75 75
 <BR><HR>
76 76
 <ADDRESS>
77
-Cisco 2014-05-21
77
+Sourcefire 2013-04-16
78 78
 </ADDRESS>
79 79
 </BODY>
80 80
 </HTML>
... ...
@@ -140,7 +140,7 @@ N * * * *	/usr/local/bin/freshclam --quiet
140 140
   HREF="node1.html">Contents</A></B> </DIV>
141 141
 <!--End of Navigation Panel-->
142 142
 <ADDRESS>
143
-Cisco 2014-05-21
143
+Sourcefire 2013-04-16
144 144
 </ADDRESS>
145 145
 </BODY>
146 146
 </HTML>
... ...
@@ -76,7 +76,7 @@ Closest mirrors</A>
76 76
 <P>
77 77
 <BR><HR>
78 78
 <ADDRESS>
79
-Cisco 2014-05-21
79
+Sourcefire 2013-04-16
80 80
 </ADDRESS>
81 81
 </BODY>
82 82
 </HTML>
... ...
@@ -109,7 +109,7 @@ The only private data that is transferred is an IP address, which is used
109 109
   HREF="node1.html">Contents</A></B> </DIV>
110 110
 <!--End of Navigation Panel-->
111 111
 <ADDRESS>
112
-Cisco 2014-05-21
112
+Sourcefire 2013-04-16
113 113
 </ADDRESS>
114 114
 </BODY>
115 115
 </HTML>
... ...
@@ -89,7 +89,7 @@ Usage</A>
89 89
 <!--End of Table of Child-Links-->
90 90
 <BR><HR>
91 91
 <ADDRESS>
92
-Cisco 2014-05-21
92
+Sourcefire 2013-04-16
93 93
 </ADDRESS>
94 94
 </BODY>
95 95
 </HTML>
... ...
@@ -235,7 +235,7 @@ Scan stream: clamd will return a new port number you should
235 235
   HREF="node1.html">Contents</A></B> </DIV>
236 236
 <!--End of Navigation Panel-->
237 237
 <ADDRESS>
238
-Cisco 2014-05-21
238
+Sourcefire 2013-04-16
239 239
 </ADDRESS>
240 240
 </BODY>
241 241
 </HTML>
... ...
@@ -216,7 +216,7 @@ Features</A>
216 216
   HREF="node1.html">Contents</A></B> </DIV>
217 217
 <!--End of Navigation Panel-->
218 218
 <ADDRESS>
219
-Cisco 2014-05-21
219
+Sourcefire 2013-04-16
220 220
 </ADDRESS>
221 221
 </BODY>
222 222
 </HTML>
... ...
@@ -75,7 +75,7 @@ Clam<SPAN  CLASS="textbf">d</SPAN>scan</A>
75 75
 <P>
76 76
 <BR><HR>
77 77
 <ADDRESS>
78
-Cisco 2014-05-21
78
+Sourcefire 2013-04-16
79 79
 </ADDRESS>
80 80
 </BODY>
81 81
 </HTML>
... ...
@@ -90,7 +90,7 @@ SIGTERM signal. In other case you can lose access
90 90
 <P>
91 91
 <BR><HR>
92 92
 <ADDRESS>
93
-Cisco 2014-05-21
93
+Sourcefire 2013-04-16
94 94
 </ADDRESS>
95 95
 </BODY>
96 96
 </HTML>
... ...
@@ -69,7 +69,7 @@ For more detailed help, type 'man clamdtop' or 'clamdtop -help'.
69 69
 <P>
70 70
 <BR><HR>
71 71
 <ADDRESS>
72
-Cisco 2014-05-21
72
+Sourcefire 2013-04-16
73 73
 </ADDRESS>
74 74
 </BODY>
75 75
 </HTML>
... ...
@@ -71,7 +71,7 @@ For more detailed help, type 'man clamscan' or 'clamscan -help'.
71 71
 <P>
72 72
 <BR><HR>
73 73
 <ADDRESS>
74
-Cisco 2014-05-21
74
+Sourcefire 2013-04-16
75 75
 </ADDRESS>
76 76
 </BODY>
77 77
 </HTML>
... ...
@@ -62,7 +62,7 @@ ClamBC</A>
62 62
 <P>
63 63
 <BR><HR>
64 64
 <ADDRESS>
65
-Cisco 2014-05-21
65
+Sourcefire 2013-04-16
66 66
 </ADDRESS>
67 67
 </BODY>
68 68
 </HTML>
... ...
@@ -85,7 +85,7 @@ Database updated (2831219 signatures) from database.clamav.net (IP: 64.6.100.177
85 85
 <P>
86 86
 <BR><HR>
87 87
 <ADDRESS>
88
-Cisco 2014-05-21
88
+Sourcefire 2013-04-16
89 89
 </ADDRESS>
90 90
 </BODY>
91 91
 </HTML>
... ...
@@ -115,7 +115,7 @@ Engine flevel: 77, dconf: 77
115 115
 <P>
116 116
 <BR><HR>
117 117
 <ADDRESS>
118
-Cisco 2014-05-21
118
+Sourcefire 2013-04-16
119 119
 </ADDRESS>
120 120
 </BODY>
121 121
 </HTML>
... ...
@@ -69,7 +69,7 @@ Output format</A>
69 69
 <!--End of Table of Child-Links-->
70 70
 <BR><HR>
71 71
 <ADDRESS>
72
-Cisco 2014-05-21
72
+Sourcefire 2013-04-16
73 73
 </ADDRESS>
74 74
 </BODY>
75 75
 </HTML>
... ...
@@ -80,7 +80,7 @@ clamscan</A>
80 80
 <P>
81 81
 <BR><HR>
82 82
 <ADDRESS>
83
-Cisco 2014-05-21
83
+Sourcefire 2013-04-16
84 84
 </ADDRESS>
85 85
 </BODY>
86 86
 </HTML>
... ...
@@ -82,7 +82,7 @@ Error messages are printed in the following format:
82 82
 <P>
83 83
 <BR><HR>
84 84
 <ADDRESS>
85
-Cisco 2014-05-21
85
+Sourcefire 2013-04-16
86 86
 </ADDRESS>
87 87
 </BODY>
88 88
 </HTML>
... ...
@@ -73,7 +73,7 @@ Mailing lists and IRC channel</A>
73 73
 </UL>
74 74
     You can subscribe and search the mailing list archives at: 
75 75
     <TT><A NAME="tex2html2"
76
-  HREF="http://www.clamav.net/support/ml/">http://www.clamav.net/support/ml/</A></TT>
76
+  HREF="http://www.clamav.net/contact.html#ml">http://www.clamav.net/contact.html#ml</A></TT>
77 77
 <BR>
78 78
 Alternatively you can try asking on the <code>#clamav</code> IRC channel - launch
79 79
     your favourite irc client and type:
... ...
@@ -85,7 +85,7 @@ Alternatively you can try asking on the <code>#clamav</code> IRC channel - launc
85 85
 <P>
86 86
 <BR><HR>
87 87
 <ADDRESS>
88
-Cisco 2014-05-21
88
+Sourcefire 2013-04-16
89 89
 </ADDRESS>
90 90
 </BODY>
91 91
 </HTML>
... ...
@@ -128,7 +128,7 @@ LibClamAV</A>
128 128
 <!--End of Table of Child-Links-->
129 129
 <BR><HR>
130 130
 <ADDRESS>
131
-Cisco 2014-05-21
131
+Sourcefire 2013-04-16
132 132
 </ADDRESS>
133 133
 </BODY>
134 134
 </HTML>
... ...
@@ -62,7 +62,7 @@ Licence</A>
62 62
 <P>
63 63
 <BR><HR>
64 64
 <ADDRESS>
65
-Cisco 2014-05-21
65
+Sourcefire 2013-04-16
66 66
 </ADDRESS>
67 67
 </BODY>
68 68
 </HTML>
... ...
@@ -78,7 +78,7 @@ Supported formats and features</A>
78 78
 <!--End of Table of Child-Links-->
79 79
 <BR><HR>
80 80
 <ADDRESS>
81
-Cisco 2014-05-21
81
+Sourcefire 2013-04-16
82 82
 </ADDRESS>
83 83
 </BODY>
84 84
 </HTML>
... ...
@@ -86,7 +86,7 @@ Executables</A>
86 86
 <P>
87 87
 <BR><HR>
88 88
 <ADDRESS>
89
-Cisco 2014-05-21
89
+Sourcefire 2013-04-16
90 90
 </ADDRESS>
91 91
 </BODY>
92 92
 </HTML>
... ...
@@ -61,7 +61,7 @@ Mail files</A>
61 61
 <P>
62 62
 <BR><HR>
63 63
 <ADDRESS>
64
-Cisco 2014-05-21
64
+Sourcefire 2013-04-16
65 65
 </ADDRESS>
66 66
 </BODY>
67 67
 </HTML>
... ...
@@ -119,7 +119,7 @@ Archives and compressed files</A>
119 119
 <P>
120 120
 <BR><HR>
121 121
 <ADDRESS>
122
-Cisco 2014-05-21
122
+Sourcefire 2013-04-16
123 123
 </ADDRESS>
124 124
 </BODY>
125 125
 </HTML>
... ...
@@ -75,7 +75,7 @@ Documents</A>
75 75
 <P>
76 76
 <BR><HR>
77 77
 <ADDRESS>
78
-Cisco 2014-05-21
78
+Sourcefire 2013-04-16
79 79
 </ADDRESS>
80 80
 </BODY>
81 81
 </HTML>
... ...
@@ -69,7 +69,7 @@ Future versions of Libclamav may include additional features to
69 69
 <P>
70 70
 <BR><HR>
71 71
 <ADDRESS>
72
-Cisco 2014-05-21
72
+Sourcefire 2013-04-16
73 73
 </ADDRESS>
74 74
 </BODY>
75 75
 </HTML>
... ...
@@ -74,7 +74,7 @@ Others</A>
74 74
 <P>
75 75
 <BR><HR>
76 76
 <ADDRESS>
77
-Cisco 2014-05-21
77
+Sourcefire 2013-04-16
78 78
 </ADDRESS>
79 79
 </BODY>
80 80
 </HTML>
... ...
@@ -90,7 +90,7 @@ API</A>
90 90
 <!--End of Table of Child-Links-->
91 91
 <BR><HR>
92 92
 <ADDRESS>
93
-Cisco 2014-05-21
93
+Sourcefire 2013-04-16
94 94
 </ADDRESS>
95 95
 </BODY>
96 96
 </HTML>
... ...
@@ -58,13 +58,13 @@ Virus submitting</A>
58 58
     databases, please submit the sample at our website:
59 59
     <DIV ALIGN="CENTER">
60 60
 <TT><A NAME="tex2html3"
61
-  HREF="http://www.clamav.net/sendvirus">http://www.clamav.net/sendvirus</A></TT>
61
+  HREF="http://www.clamav.net/malware-sample">http://www.clamav.net/malware-sample</A></TT>
62 62
 </DIV>
63 63
 
64 64
 <P>
65 65
 <BR><HR>
66 66
 <ADDRESS>
67
-Cisco 2014-05-21
67
+Sourcefire 2013-04-16
68 68
 </ADDRESS>
69 69
 </BODY>
70 70
 </HTML>
... ...
@@ -63,7 +63,7 @@ Header file</A>
63 63
 <P>
64 64
 <BR><HR>
65 65
 <ADDRESS>
66
-Cisco 2014-05-21
66
+Sourcefire 2013-04-16
67 67
 </ADDRESS>
68 68
 </BODY>
69 69
 </HTML>
... ...
@@ -72,7 +72,7 @@ Initialization</A>
72 72
 <P>
73 73
 <BR><HR>
74 74
 <ADDRESS>
75
-Cisco 2014-05-21
75
+Sourcefire 2013-04-16
76 76
 </ADDRESS>
77 77
 </BODY>
78 78
 </HTML>
... ...
@@ -124,7 +124,7 @@ Load bytecode.
124 124
 <P>
125 125
 <BR><HR>
126 126
 <ADDRESS>
127
-Cisco 2014-05-21
127
+Sourcefire 2013-04-16
128 128
 </ADDRESS>
129 129
 </BODY>
130 130
 </HTML>
... ...
@@ -68,7 +68,7 @@ Error handling</A>
68 68
 <P>
69 69
 <BR><HR>
70 70
 <ADDRESS>
71
-Cisco 2014-05-21
71
+Sourcefire 2013-04-16
72 72
 </ADDRESS>
73 73
 </BODY>
74 74
 </HTML>
... ...
@@ -74,7 +74,7 @@ Engine structure</A>
74 74
 <P>
75 75
 <BR><HR>
76 76
 <ADDRESS>
77
-Cisco 2014-05-21
77
+Sourcefire 2013-04-16
78 78
 </ADDRESS>
79 79
 </BODY>
80 80
 </HTML>
... ...
@@ -78,7 +78,7 @@ const char *cl_engine_get_str(const struct cl_engine *engine,
78 78
 <P>
79 79
 <BR><HR>
80 80
 <ADDRESS>
81
-Cisco 2014-05-21
81
+Sourcefire 2013-04-16
82 82
 </ADDRESS>
83 83
 </BODY>
84 84
 </HTML>
... ...
@@ -102,7 +102,7 @@ Database checks</A>
102 102
 <P>
103 103
 <BR><HR>
104 104
 <ADDRESS>
105
-Cisco 2014-05-21
105
+Sourcefire 2013-04-16
106 106
 </ADDRESS>
107 107
 </BODY>
108 108
 </HTML>
... ...
@@ -221,7 +221,7 @@ OLE2 containers, which contain VBA macros will be marked infected
221 221
   HREF="node1.html">Contents</A></B> </DIV>
222 222
 <!--End of Navigation Panel-->
223 223
 <ADDRESS>
224
-Cisco 2014-05-21
224
+Sourcefire 2013-04-16
225 225
 </ADDRESS>
226 226
 </BODY>
227 227
 </HTML>
... ...
@@ -62,7 +62,7 @@ Memory</A>
62 62
 <P>
63 63
 <BR><HR>
64 64
 <ADDRESS>
65
-Cisco 2014-05-21
65
+Sourcefire 2013-04-16
66 66
 </ADDRESS>
67 67
 </BODY>
68 68
 </HTML>
... ...
@@ -64,7 +64,7 @@ Forking daemons</A>
64 64
 <P>
65 65
 <BR><HR>
66 66
 <ADDRESS>
67
-Cisco 2014-05-21
67
+Sourcefire 2013-04-16
68 68
 </ADDRESS>
69 69
 </BODY>
70 70
 </HTML>
... ...
@@ -77,7 +77,7 @@ Base package</A>
77 77
 <!--End of Table of Child-Links-->
78 78
 <BR><HR>
79 79
 <ADDRESS>
80
-Cisco 2014-05-21
80
+Sourcefire 2013-04-16
81 81
 </ADDRESS>
82 82
 </BODY>
83 83
 </HTML>
... ...
@@ -66,7 +66,7 @@ clamav-config</A>
66 66
 <P>
67 67
 <BR><HR>
68 68
 <ADDRESS>
69
-Cisco 2014-05-21
69
+Sourcefire 2013-04-16
70 70
 </ADDRESS>
71 71
 </BODY>
72 72
 </HTML>
... ...
@@ -64,7 +64,7 @@ Example</A>
64 64
 <P>
65 65
 <BR><HR>
66 66
 <ADDRESS>
67
-Cisco 2014-05-21
67
+Sourcefire 2013-04-16
68 68
 </ADDRESS>
69 69
 </BODY>
70 70
 </HTML>
... ...
@@ -81,7 +81,7 @@ Verification OK.
81 81
 <P>
82 82
 <BR><HR>
83 83
 <ADDRESS>
84
-Cisco 2014-05-21
84
+Sourcefire 2013-04-16
85 85
 </ADDRESS>
86 86
 </BODY>
87 87
 </HTML>
... ...
@@ -612,7 +612,7 @@ Contributors</A>
612 612
   HREF="node1.html">Contents</A></B> </DIV>
613 613
 <!--End of Navigation Panel-->
614 614
 <ADDRESS>
615
-Cisco 2014-05-21
615
+Sourcefire 2013-04-16
616 616
 </ADDRESS>
617 617
 </BODY>
618 618
 </HTML>
... ...
@@ -458,7 +458,7 @@ Donors</A>
458 458
   HREF="node1.html">Contents</A></B> </DIV>
459 459
 <!--End of Navigation Panel-->
460 460
 <ADDRESS>
461
-Cisco 2014-05-21
461
+Sourcefire 2013-04-16
462 462
 </ADDRESS>
463 463
 </BODY>
464 464
 </HTML>
... ...
@@ -62,7 +62,7 @@ Graphics</A>
62 62
 <P>
63 63
 <BR><HR>
64 64
 <ADDRESS>
65
-Cisco 2014-05-21
65
+Sourcefire 2013-04-16
66 66
 </ADDRESS>
67 67
 </BODY>
68 68
 </HTML>
... ...
@@ -61,7 +61,7 @@ OpenAntiVirus</A>
61 61
 <P>
62 62
 <BR><HR>
63 63
 <ADDRESS>
64
-Cisco 2014-05-21
64
+Sourcefire 2013-04-16
65 65
 </ADDRESS>
66 66
 </BODY>
67 67
 </HTML>
... ...
@@ -136,7 +136,7 @@ Role: manager, virus databases
136 136
 <P>
137 137
 <BR><HR>
138 138
 <ADDRESS>
139
-Cisco 2014-05-21
139
+Sourcefire 2013-04-16
140 140
 </ADDRESS>
141 141
 </BODY>
142 142
 </HTML>
... ...
@@ -127,7 +127,7 @@ Role: coder
127 127
 </UL>
128 128
 <BR><HR>
129 129
 <ADDRESS>
130
-Cisco 2014-05-21
130
+Sourcefire 2013-04-16
131 131
 </ADDRESS>
132 132
 </BODY>
133 133
 </HTML>
... ...
@@ -68,7 +68,7 @@ Supported platforms</A>
68 68
 <!--End of Table of Child-Links-->
69 69
 <BR><HR>
70 70
 <ADDRESS>
71
-Cisco 2014-05-21
71
+Sourcefire 2013-04-16
72 72
 </ADDRESS>
73 73
 </BODY>
74 74
 </HTML>
... ...
@@ -76,7 +76,7 @@ UNIX</A>
76 76
 <P>
77 77
 <BR><HR>
78 78
 <ADDRESS>
79
-Cisco 2014-05-21
79
+Sourcefire 2013-04-16
80 80
 </ADDRESS>
81 81
 </BODY>
82 82
 </HTML>
... ...
@@ -59,7 +59,7 @@ Windows</A>
59 59
 <P>
60 60
 <BR><HR>
61 61
 <ADDRESS>
62
-Cisco 2014-05-21
62
+Sourcefire 2013-04-16
63 63
 </ADDRESS>
64 64
 </BODY>
65 65
 </HTML>
... ...
@@ -33,7 +33,7 @@ Print IR of bytecode signature
33 33
 \fB\-\-input\fR                \fB\-r\fR
34 34
 Input file to run the bytecode on
35 35
 .TP
36
-\fB\-\-trace\fR <level>        \fB\-l\fR
36
+\fB\-\-trace\fR <level>        \fB\-T\fR
37 37
 Set bytecode trace level 0..7 (default 7)
38 38
 .TP
39 39
 \fB\-\-no\-trace\-showsource\fR
... ...
@@ -54,7 +54,7 @@ Scan a file descriptor. After issuing a FILDES command a subsequent rfc2292/bsd4
54 54
 Alternatively the file descriptor may be sent in the same packet, including the extra character.
55 55
 .TP
56 56
 \fBSTATS\fR
57
-IIt is mandatory to newline terminate this command, or prefix with \fBn\fR or \fBz\fR, it is recommended to only use the \fBz\fR prefix.
57
+It is mandatory to newline terminate this command, or prefix with \fBn\fR or \fBz\fR, it is recommended to only use the \fBz\fR prefix.
58 58
 
59 59
 Replies with statistics about the scan queue, contents of scan queue, and memory
60 60
 usage. The exact reply format is subject to change in future releases.
... ...
@@ -21,6 +21,7 @@ Display help information and exit.
21 21
 .TP 
22 22
 \fB\-V, \-\-version\fR
23 23
 Print version number and exit.
24
+.TP
24 25
 \fB\-\-config\-file=FILE\fR
25 26
 Read clamd settings from FILE, to determine how to connect to it.
26 27
 .TP 
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,7 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am__append_1 = clamav-milter.conf.sample
57 57
 subdir = etc
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
59 59
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 60
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 61
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -130,14 +174,25 @@ mkinstalldirs = $(install_sh) -d
130 130
 CONFIG_HEADER = $(top_builddir)/clamav-config.h
131 131
 CONFIG_CLEAN_FILES =
132 132
 CONFIG_CLEAN_VPATH_FILES =
133
+AM_V_P = $(am__v_P_@AM_V@)
134
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
135
+am__v_P_0 = false
136
+am__v_P_1 = :
133 137
 AM_V_GEN = $(am__v_GEN_@AM_V@)
134 138
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
135
-am__v_GEN_0 = @echo "  GEN   " $@;
139
+am__v_GEN_0 = @echo "  GEN     " $@;
140
+am__v_GEN_1 = 
136 141
 AM_V_at = $(am__v_at_@AM_V@)
137 142
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
138 143
 am__v_at_0 = @
144
+am__v_at_1 = 
139 145
 SOURCES =
140 146
 DIST_SOURCES =
147
+am__can_run_installinfo = \
148
+  case $$AM_UPDATE_INFO_DIR in \
149
+    n|no|NO) false;; \
150
+    *) (install-info --version) >/dev/null 2>&1;; \
151
+  esac
141 152
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
142 153
 am__vpath_adj = case $$p in \
143 154
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
... ...
@@ -167,6 +222,7 @@ am__uninstall_files_from_dir = { \
167 167
   }
168 168
 am__installdirs = "$(DESTDIR)$(sysconfdir)"
169 169
 DATA = $(sysconf_DATA)
170
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
170 171
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
171 172
 ACLOCAL = @ACLOCAL@
172 173
 AMTAR = @AMTAR@
... ...
@@ -411,8 +467,11 @@ clean-libtool:
411 411
 	-rm -rf .libs _libs
412 412
 install-sysconfDATA: $(sysconf_DATA)
413 413
 	@$(NORMAL_INSTALL)
414
-	test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
415 414
 	@list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
415
+	if test -n "$$list"; then \
416
+	  echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \
417
+	  $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \
418
+	fi; \
416 419
 	for p in $$list; do \
417 420
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
418 421
 	  echo "$$d$$p"; \
... ...
@@ -427,11 +486,11 @@ uninstall-sysconfDATA:
427 427
 	@list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
428 428
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
429 429
 	dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
430
-tags: TAGS
431
-TAGS:
430
+tags TAGS:
431
+
432
+ctags CTAGS:
432 433
 
433
-ctags: CTAGS
434
-CTAGS:
434
+cscope cscopelist:
435 435
 
436 436
 
437 437
 distdir: $(DISTFILES)
... ...
@@ -570,16 +629,16 @@ uninstall-am: uninstall-sysconfDATA
570 570
 .MAKE: install-am install-strip
571 571
 
572 572
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
573
-	distclean distclean-generic distclean-libtool distdir dvi \
574
-	dvi-am html html-am info info-am install install-am \
575
-	install-data install-data-am install-dvi install-dvi-am \
576
-	install-exec install-exec-am install-html install-html-am \
577
-	install-info install-info-am install-man install-pdf \
578
-	install-pdf-am install-ps install-ps-am install-strip \
579
-	install-sysconfDATA installcheck installcheck-am installdirs \
580
-	maintainer-clean maintainer-clean-generic mostlyclean \
581
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
582
-	uninstall uninstall-am uninstall-sysconfDATA
573
+	cscopelist-am ctags-am distclean distclean-generic \
574
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
575
+	install install-am install-data install-data-am install-dvi \
576
+	install-dvi-am install-exec install-exec-am install-html \
577
+	install-html-am install-info install-info-am install-man \
578
+	install-pdf install-pdf-am install-ps install-ps-am \
579
+	install-strip install-sysconfDATA installcheck installcheck-am \
580
+	installdirs maintainer-clean maintainer-clean-generic \
581
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
582
+	ps ps-am tags-am uninstall uninstall-am uninstall-sysconfDATA
583 583
 
584 584
 
585 585
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -35,6 +34,51 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
39
+am__make_running_with_option = \
40
+  case $${target_option-} in \
41
+      ?) ;; \
42
+      *) echo "am__make_running_with_option: internal error: invalid" \
43
+              "target option '$${target_option-}' specified" >&2; \
44
+         exit 1;; \
45
+  esac; \
46
+  has_opt=no; \
47
+  sane_makeflags=$$MAKEFLAGS; \
48
+  if $(am__is_gnu_make); then \
49
+    sane_makeflags=$$MFLAGS; \
50
+  else \
51
+    case $$MAKEFLAGS in \
52
+      *\\[\ \	]*) \
53
+        bs=\\; \
54
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
55
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
56
+    esac; \
57
+  fi; \
58
+  skip_next=no; \
59
+  strip_trailopt () \
60
+  { \
61
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
62
+  }; \
63
+  for flg in $$sane_makeflags; do \
64
+    test $$skip_next = yes && { skip_next=no; continue; }; \
65
+    case $$flg in \
66
+      *=*|--*) continue;; \
67
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
68
+      -*I?*) strip_trailopt 'I';; \
69
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
70
+      -*O?*) strip_trailopt 'O';; \
71
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
72
+      -*l?*) strip_trailopt 'l';; \
73
+      -[dEDm]) skip_next=yes;; \
74
+      -[JT]) skip_next=yes;; \
75
+    esac; \
76
+    case $$flg in \
77
+      *$$target_option*) has_opt=yes; break;; \
78
+    esac; \
79
+  done; \
80
+  test $$has_opt = yes
81
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
82
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
38 83
 pkgdatadir = $(datadir)/@PACKAGE@
39 84
 pkgincludedir = $(includedir)/@PACKAGE@
40 85
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -56,7 +100,8 @@ host_triplet = @host@
56 56
 target_triplet = @target@
57 57
 bin_PROGRAMS = freshclam$(EXEEXT)
58 58
 subdir = freshclam
59
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
59
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
60
+	$(top_srcdir)/config/depcomp
60 61
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
61 62
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
62 63
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -143,6 +188,19 @@ freshclam_LDADD = $(LDADD)
143 143
 AM_V_lt = $(am__v_lt_@AM_V@)
144 144
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
145 145
 am__v_lt_0 = --silent
146
+am__v_lt_1 = 
147
+AM_V_P = $(am__v_P_@AM_V@)
148
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
149
+am__v_P_0 = false
150
+am__v_P_1 = :
151
+AM_V_GEN = $(am__v_GEN_@AM_V@)
152
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
153
+am__v_GEN_0 = @echo "  GEN     " $@;
154
+am__v_GEN_1 = 
155
+AM_V_at = $(am__v_at_@AM_V@)
156
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
157
+am__v_at_0 = @
158
+am__v_at_1 = 
146 159
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
147 160
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
148 161
 am__depfiles_maybe = depfiles
... ...
@@ -155,22 +213,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
155 155
 	$(AM_CFLAGS) $(CFLAGS)
156 156
 AM_V_CC = $(am__v_CC_@AM_V@)
157 157
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
158
-am__v_CC_0 = @echo "  CC    " $@;
159
-AM_V_at = $(am__v_at_@AM_V@)
160
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
161
-am__v_at_0 = @
158
+am__v_CC_0 = @echo "  CC      " $@;
159
+am__v_CC_1 = 
162 160
 CCLD = $(CC)
163 161
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
164 162
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
165 163
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
166 164
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
167 165
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
168
-am__v_CCLD_0 = @echo "  CCLD  " $@;
169
-AM_V_GEN = $(am__v_GEN_@AM_V@)
170
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
171
-am__v_GEN_0 = @echo "  GEN   " $@;
166
+am__v_CCLD_0 = @echo "  CCLD    " $@;
167
+am__v_CCLD_1 = 
172 168
 SOURCES = $(freshclam_SOURCES)
173 169
 DIST_SOURCES = $(freshclam_SOURCES)
170
+am__can_run_installinfo = \
171
+  case $$AM_UPDATE_INFO_DIR in \
172
+    n|no|NO) false;; \
173
+    *) (install-info --version) >/dev/null 2>&1;; \
174
+  esac
175
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
176
+# Read a list of newline-separated strings from the standard input,
177
+# and print each of them once, without duplicates.  Input order is
178
+# *not* preserved.
179
+am__uniquify_input = $(AWK) '\
180
+  BEGIN { nonempty = 0; } \
181
+  { items[$$0] = 1; nonempty = 1; } \
182
+  END { if (nonempty) { for (i in items) print i; }; } \
183
+'
184
+# Make sure the list of sources is unique.  This is necessary because,
185
+# e.g., the same source file might be shared among _SOURCES variables
186
+# for different programs/libraries.
187
+am__define_uniq_tagged_files = \
188
+  list='$(am__tagged_files)'; \
189
+  unique=`for i in $$list; do \
190
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
191
+  done | $(am__uniquify_input)`
174 192
 ETAGS = etags
175 193
 CTAGS = ctags
176 194
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -443,14 +519,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
443 443
 $(am__aclocal_m4_deps):
444 444
 install-binPROGRAMS: $(bin_PROGRAMS)
445 445
 	@$(NORMAL_INSTALL)
446
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
447 446
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
447
+	if test -n "$$list"; then \
448
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
449
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
450
+	fi; \
448 451
 	for p in $$list; do echo "$$p $$p"; done | \
449 452
 	sed 's/$(EXEEXT)$$//' | \
450
-	while read p p1; do if test -f $$p || test -f $$p1; \
451
-	  then echo "$$p"; echo "$$p"; else :; fi; \
453
+	while read p p1; do if test -f $$p \
454
+	 || test -f $$p1 \
455
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
452 456
 	done | \
453
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
457
+	sed -e 'p;s,.*/,,;n;h' \
458
+	    -e 's|.*|.|' \
454 459
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
455 460
 	sed 'N;N;N;s,\n, ,g' | \
456 461
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -471,7 +552,8 @@ uninstall-binPROGRAMS:
471 471
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
472 472
 	files=`for p in $$list; do echo "$$p"; done | \
473 473
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
474
-	      -e 's/$$/$(EXEEXT)/' `; \
474
+	      -e 's/$$/$(EXEEXT)/' \
475
+	`; \
475 476
 	test -n "$$list" || exit 0; \
476 477
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
477 478
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -500,6 +582,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
500 500
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
501 501
 	  done; \
502 502
 	done; rm -f c$${pid}_.???; exit $$bad
503
+
503 504
 freshclam$(EXEEXT): $(freshclam_OBJECTS) $(freshclam_DEPENDENCIES) $(EXTRA_freshclam_DEPENDENCIES) 
504 505
 	@rm -f freshclam$(EXEEXT)
505 506
 	$(AM_V_CCLD)$(LINK) $(freshclam_OBJECTS) $(freshclam_LDADD) $(LIBS)
... ...
@@ -530,14 +613,14 @@ distclean-compile:
530 530
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
531 531
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
532 532
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
533
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
533
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
534 534
 
535 535
 .c.obj:
536 536
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
537 537
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
538 538
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
539 539
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
540
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
540
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
541 541
 
542 542
 .c.lo:
543 543
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -650,26 +733,15 @@ mostlyclean-libtool:
650 650
 clean-libtool:
651 651
 	-rm -rf .libs _libs
652 652
 
653
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
654
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
655
-	unique=`for i in $$list; do \
656
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
657
-	  done | \
658
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
659
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
660
-	mkid -fID $$unique
661
-tags: TAGS
662
-
663
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
664
-		$(TAGS_FILES) $(LISP)
653
+ID: $(am__tagged_files)
654
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
655
+tags: tags-am
656
+TAGS: tags
657
+
658
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
665 659
 	set x; \
666 660
 	here=`pwd`; \
667
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
668
-	unique=`for i in $$list; do \
669
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
670
-	  done | \
671
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
672
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
661
+	$(am__define_uniq_tagged_files); \
673 662
 	shift; \
674 663
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
675 664
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -681,15 +753,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
681 681
 	      $$unique; \
682 682
 	  fi; \
683 683
 	fi
684
-ctags: CTAGS
685
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
686
-		$(TAGS_FILES) $(LISP)
687
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
688
-	unique=`for i in $$list; do \
689
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
690
-	  done | \
691
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
692
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
684
+ctags: ctags-am
685
+
686
+CTAGS: ctags
687
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
688
+	$(am__define_uniq_tagged_files); \
693 689
 	test -z "$(CTAGS_ARGS)$$unique" \
694 690
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
695 691
 	     $$unique
... ...
@@ -698,6 +766,21 @@ GTAGS:
698 698
 	here=`$(am__cd) $(top_builddir) && pwd` \
699 699
 	  && $(am__cd) $(top_srcdir) \
700 700
 	  && gtags -i $(GTAGS_ARGS) "$$here"
701
+cscopelist: cscopelist-am
702
+
703
+cscopelist-am: $(am__tagged_files)
704
+	list='$(am__tagged_files)'; \
705
+	case "$(srcdir)" in \
706
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
707
+	  *) sdir=$(subdir)/$(srcdir) ;; \
708
+	esac; \
709
+	for i in $$list; do \
710
+	  if test -f "$$i"; then \
711
+	    echo "$(subdir)/$$i"; \
712
+	  else \
713
+	    echo "$$sdir/$$i"; \
714
+	  fi; \
715
+	done >> $(top_builddir)/cscope.files
701 716
 
702 717
 distclean-tags:
703 718
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -842,19 +925,20 @@ uninstall-am: uninstall-binPROGRAMS
842 842
 
843 843
 .MAKE: install-am install-strip
844 844
 
845
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
846
-	clean-generic clean-libtool ctags distclean distclean-compile \
847
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
848
-	dvi-am html html-am info info-am install install-am \
849
-	install-binPROGRAMS install-data install-data-am install-dvi \
850
-	install-dvi-am install-exec install-exec-am install-html \
851
-	install-html-am install-info install-info-am install-man \
852
-	install-pdf install-pdf-am install-ps install-ps-am \
853
-	install-strip installcheck installcheck-am \
854
-	installcheck-binPROGRAMS installdirs maintainer-clean \
855
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
856
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
857
-	tags uninstall uninstall-am uninstall-binPROGRAMS
845
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
846
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
847
+	ctags ctags-am distclean distclean-compile distclean-generic \
848
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
849
+	html-am info info-am install install-am install-binPROGRAMS \
850
+	install-data install-data-am install-dvi install-dvi-am \
851
+	install-exec install-exec-am install-html install-html-am \
852
+	install-info install-info-am install-man install-pdf \
853
+	install-pdf-am install-ps install-ps-am install-strip \
854
+	installcheck installcheck-am installcheck-binPROGRAMS \
855
+	installdirs maintainer-clean maintainer-clean-generic \
856
+	mostlyclean mostlyclean-compile mostlyclean-generic \
857
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
858
+	uninstall-am uninstall-binPROGRAMS
858 859
 
859 860
 
860 861
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1209,13 +1209,21 @@ chdir_tmp (const char *dbname, const char *tmpdir)
1209 1209
 {
1210 1210
     char cvdfile[32];
1211 1211
 
1212
-
1213 1212
     if (access (tmpdir, R_OK | W_OK) == -1)
1214 1213
     {
1215
-        sprintf (cvdfile, "%s.cvd", dbname);
1214
+        int ret;
1215
+        ret = snprintf (cvdfile, sizeof(cvdfile), "%s.cvd", dbname);
1216
+        if (ret >= sizeof(cvdfile) || ret == -1) {
1217
+            logg ("!chdir_tmp: dbname parameter value too long to create cvd file name: %s\n", dbname);
1218
+            return -1;
1219
+        }
1216 1220
         if (access (cvdfile, R_OK) == -1)
1217 1221
         {
1218
-            sprintf (cvdfile, "%s.cld", dbname);
1222
+            ret = snprintf (cvdfile, sizeof(cvdfile), "%s.cld", dbname);
1223
+            if (ret >= sizeof(cvdfile) || ret == -1) {
1224
+                logg ("!chdir_tmp: dbname parameter value too long to create cld file name: %s\n", dbname);
1225
+                return -1;
1226
+            }
1219 1227
             if (access (cvdfile, R_OK) == -1)
1220 1228
             {
1221 1229
                 logg ("!chdir_tmp: Can't access local %s database\n", dbname);
... ...
@@ -448,7 +448,9 @@ libclamav_la_SOURCES = \
448 448
 	yara_lexer.h \
449 449
 	yara_parser.c \
450 450
 	yara_parser.h \
451
-	yara_clam.h
451
+	yara_clam.h \
452
+	msdoc.c \
453
+	msdoc.h
452 454
 
453 455
 libclamav_la_SOURCES += bignum.h\
454 456
 	bignum_fast.h\
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -36,6 +35,51 @@
36 36
 
37 37
 
38 38
 VPATH = @srcdir@
39
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
40
+am__make_running_with_option = \
41
+  case $${target_option-} in \
42
+      ?) ;; \
43
+      *) echo "am__make_running_with_option: internal error: invalid" \
44
+              "target option '$${target_option-}' specified" >&2; \
45
+         exit 1;; \
46
+  esac; \
47
+  has_opt=no; \
48
+  sane_makeflags=$$MAKEFLAGS; \
49
+  if $(am__is_gnu_make); then \
50
+    sane_makeflags=$$MFLAGS; \
51
+  else \
52
+    case $$MAKEFLAGS in \
53
+      *\\[\ \	]*) \
54
+        bs=\\; \
55
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
56
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
57
+    esac; \
58
+  fi; \
59
+  skip_next=no; \
60
+  strip_trailopt () \
61
+  { \
62
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
63
+  }; \
64
+  for flg in $$sane_makeflags; do \
65
+    test $$skip_next = yes && { skip_next=no; continue; }; \
66
+    case $$flg in \
67
+      *=*|--*) continue;; \
68
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
69
+      -*I?*) strip_trailopt 'I';; \
70
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
71
+      -*O?*) strip_trailopt 'O';; \
72
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
73
+      -*l?*) strip_trailopt 'l';; \
74
+      -[dEDm]) skip_next=yes;; \
75
+      -[JT]) skip_next=yes;; \
76
+    esac; \
77
+    case $$flg in \
78
+      *$$target_option*) has_opt=yes; break;; \
79
+    esac; \
80
+  done; \
81
+  test $$has_opt = yes
82
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
83
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
39 84
 pkgdatadir = $(datadir)/@PACKAGE@
40 85
 pkgincludedir = $(includedir)/@PACKAGE@
41 86
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -65,9 +109,10 @@ target_triplet = @target@
65 65
 @ENABLE_UNRAR_TRUE@@VERSIONSCRIPT_TRUE@am__append_5 = -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamunrar_iface/libclamunrar_iface.map
66 66
 @VERSIONSCRIPT_TRUE@am__append_6 = -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamav/libclamav.map
67 67
 subdir = libclamav
68
-DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
69
-	$(srcdir)/Makefile.in yara_grammar.c yara_grammar.h \
70
-	yara_lexer.c
68
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
69
+	yara_grammar.h yara_grammar.c yara_lexer.c \
70
+	$(top_srcdir)/config/depcomp $(top_srcdir)/config/ylwrap \
71
+	$(include_HEADERS)
71 72
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
72 73
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
73 74
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -240,13 +285,14 @@ am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
240 240
 	libclamav_la-www.lo libclamav_la-stats_json.lo \
241 241
 	libclamav_la-hostid.lo libclamav_la-openioc.lo \
242 242
 	libclamav_la-yara_grammar.lo libclamav_la-yara_lexer.lo \
243
-	libclamav_la-yara_parser.lo libclamav_la-fp_add.lo \
244
-	libclamav_la-fp_add_d.lo libclamav_la-fp_addmod.lo \
245
-	libclamav_la-fp_cmp.lo libclamav_la-fp_cmp_d.lo \
246
-	libclamav_la-fp_cmp_mag.lo libclamav_la-fp_sub.lo \
247
-	libclamav_la-fp_sub_d.lo libclamav_la-fp_submod.lo \
248
-	libclamav_la-s_fp_add.lo libclamav_la-s_fp_sub.lo \
249
-	libclamav_la-fp_radix_size.lo libclamav_la-fp_read_radix.lo \
243
+	libclamav_la-yara_parser.lo libclamav_la-msdoc.lo \
244
+	libclamav_la-fp_add.lo libclamav_la-fp_add_d.lo \
245
+	libclamav_la-fp_addmod.lo libclamav_la-fp_cmp.lo \
246
+	libclamav_la-fp_cmp_d.lo libclamav_la-fp_cmp_mag.lo \
247
+	libclamav_la-fp_sub.lo libclamav_la-fp_sub_d.lo \
248
+	libclamav_la-fp_submod.lo libclamav_la-s_fp_add.lo \
249
+	libclamav_la-s_fp_sub.lo libclamav_la-fp_radix_size.lo \
250
+	libclamav_la-fp_read_radix.lo \
250 251
 	libclamav_la-fp_read_signed_bin.lo \
251 252
 	libclamav_la-fp_read_unsigned_bin.lo \
252 253
 	libclamav_la-fp_reverse.lo libclamav_la-fp_s_rmap.lo \
... ...
@@ -295,6 +341,7 @@ libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
295 295
 AM_V_lt = $(am__v_lt_@AM_V@)
296 296
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
297 297
 am__v_lt_0 = --silent
298
+am__v_lt_1 = 
298 299
 libclamav_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
299 300
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libclamav_la_CFLAGS) \
300 301
 	$(CFLAGS) $(libclamav_la_LDFLAGS) $(LDFLAGS) -o $@
... ...
@@ -375,6 +422,18 @@ libclamunrar_iface_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
375 375
 	$(AM_CFLAGS) $(CFLAGS) $(libclamunrar_iface_la_LDFLAGS) \
376 376
 	$(LDFLAGS) -o $@
377 377
 @ENABLE_UNRAR_TRUE@am_libclamunrar_iface_la_rpath = -rpath $(libdir)
378
+AM_V_P = $(am__v_P_@AM_V@)
379
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
380
+am__v_P_0 = false
381
+am__v_P_1 = :
382
+AM_V_GEN = $(am__v_GEN_@AM_V@)
383
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
384
+am__v_GEN_0 = @echo "  GEN     " $@;
385
+am__v_GEN_1 = 
386
+AM_V_at = $(am__v_at_@AM_V@)
387
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
388
+am__v_at_0 = @
389
+am__v_at_1 = 
378 390
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
379 391
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
380 392
 am__depfiles_maybe = depfiles
... ...
@@ -387,35 +446,35 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
387 387
 	$(AM_CFLAGS) $(CFLAGS)
388 388
 AM_V_CC = $(am__v_CC_@AM_V@)
389 389
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
390
-am__v_CC_0 = @echo "  CC    " $@;
391
-AM_V_at = $(am__v_at_@AM_V@)
392
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
393
-am__v_at_0 = @
390
+am__v_CC_0 = @echo "  CC      " $@;
391
+am__v_CC_1 = 
394 392
 CCLD = $(CC)
395 393
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
396 394
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
397 395
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
398 396
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
399 397
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
400
-am__v_CCLD_0 = @echo "  CCLD  " $@;
398
+am__v_CCLD_0 = @echo "  CCLD    " $@;
399
+am__v_CCLD_1 = 
401 400
 @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||
402 401
 LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
403 402
 LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
404 403
 	$(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS)
405 404
 AM_V_LEX = $(am__v_LEX_@AM_V@)
406 405
 am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
407
-am__v_LEX_0 = @echo "  LEX   " $@;
406
+am__v_LEX_0 = @echo "  LEX     " $@;
407
+am__v_LEX_1 = 
408 408
 YLWRAP = $(top_srcdir)/config/ylwrap
409 409
 @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
410
+am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
411
+		   -e s/c++$$/h++/ -e s/c$$/h/
410 412
 YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
411 413
 LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
412 414
 	$(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS)
413 415
 AM_V_YACC = $(am__v_YACC_@AM_V@)
414 416
 am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
415
-am__v_YACC_0 = @echo "  YACC  " $@;
416
-AM_V_GEN = $(am__v_GEN_@AM_V@)
417
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
418
-am__v_GEN_0 = @echo "  GEN   " $@;
417
+am__v_YACC_0 = @echo "  YACC    " $@;
418
+am__v_YACC_1 = 
419 419
 SOURCES = $(libclamav_la_SOURCES) \
420 420
 	$(libclamav_internal_utils_la_SOURCES) \
421 421
 	$(libclamav_internal_utils_nothreads_la_SOURCES) \
... ...
@@ -427,19 +486,45 @@ DIST_SOURCES = $(libclamav_la_SOURCES) \
427 427
 	$(libclamav_nocxx_la_SOURCES) \
428 428
 	$(am__libclamunrar_la_SOURCES_DIST) \
429 429
 	$(am__libclamunrar_iface_la_SOURCES_DIST)
430
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
431
-	html-recursive info-recursive install-data-recursive \
432
-	install-dvi-recursive install-exec-recursive \
433
-	install-html-recursive install-info-recursive \
434
-	install-pdf-recursive install-ps-recursive install-recursive \
435
-	installcheck-recursive installdirs-recursive pdf-recursive \
436
-	ps-recursive uninstall-recursive
430
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
431
+	ctags-recursive dvi-recursive html-recursive info-recursive \
432
+	install-data-recursive install-dvi-recursive \
433
+	install-exec-recursive install-html-recursive \
434
+	install-info-recursive install-pdf-recursive \
435
+	install-ps-recursive install-recursive installcheck-recursive \
436
+	installdirs-recursive pdf-recursive ps-recursive \
437
+	tags-recursive uninstall-recursive
438
+am__can_run_installinfo = \
439
+  case $$AM_UPDATE_INFO_DIR in \
440
+    n|no|NO) false;; \
441
+    *) (install-info --version) >/dev/null 2>&1;; \
442
+  esac
437 443
 HEADERS = $(include_HEADERS)
438 444
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
439 445
   distclean-recursive maintainer-clean-recursive
440
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
441
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
446
+am__recursive_targets = \
447
+  $(RECURSIVE_TARGETS) \
448
+  $(RECURSIVE_CLEAN_TARGETS) \
449
+  $(am__extra_recursive_targets)
450
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
442 451
 	distdir
452
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
453
+# Read a list of newline-separated strings from the standard input,
454
+# and print each of them once, without duplicates.  Input order is
455
+# *not* preserved.
456
+am__uniquify_input = $(AWK) '\
457
+  BEGIN { nonempty = 0; } \
458
+  { items[$$0] = 1; nonempty = 1; } \
459
+  END { if (nonempty) { for (i in items) print i; }; } \
460
+'
461
+# Make sure the list of sources is unique.  This is necessary because,
462
+# e.g., the same source file might be shared among _SOURCES variables
463
+# for different programs/libraries.
464
+am__define_uniq_tagged_files = \
465
+  list='$(am__tagged_files)'; \
466
+  unique=`for i in $$list; do \
467
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
468
+  done | $(am__uniquify_input)`
443 469
 ETAGS = etags
444 470
 CTAGS = ctags
445 471
 DIST_SUBDIRS = c++
... ...
@@ -829,10 +914,10 @@ libclamav_la_SOURCES = matcher-ac.c matcher-ac.h matcher-bm.c \
829 829
 	crtmgr.h asn1.c asn1.h fpu.c fpu.h stats.c stats.h www.c www.h \
830 830
 	stats_json.c stats_json.h hostid.c hostid.h openioc.c \
831 831
 	openioc.h yara_grammar.y yara_lexer.l yara_lexer.h \
832
-	yara_parser.c yara_parser.h yara_clam.h bignum.h bignum_fast.h \
833
-	tomsfastmath/addsub/fp_add.c tomsfastmath/addsub/fp_add_d.c \
834
-	tomsfastmath/addsub/fp_addmod.c tomsfastmath/addsub/fp_cmp.c \
835
-	tomsfastmath/addsub/fp_cmp_d.c \
832
+	yara_parser.c yara_parser.h yara_clam.h msdoc.c msdoc.h \
833
+	bignum.h bignum_fast.h tomsfastmath/addsub/fp_add.c \
834
+	tomsfastmath/addsub/fp_add_d.c tomsfastmath/addsub/fp_addmod.c \
835
+	tomsfastmath/addsub/fp_cmp.c tomsfastmath/addsub/fp_cmp_d.c \
836 836
 	tomsfastmath/addsub/fp_cmp_mag.c tomsfastmath/addsub/fp_sub.c \
837 837
 	tomsfastmath/addsub/fp_sub_d.c tomsfastmath/addsub/fp_submod.c \
838 838
 	tomsfastmath/addsub/s_fp_add.c tomsfastmath/addsub/s_fp_sub.c \
... ...
@@ -934,9 +1019,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
934 934
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
935 935
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
936 936
 $(am__aclocal_m4_deps):
937
+
937 938
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
938 939
 	@$(NORMAL_INSTALL)
939
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
940 940
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
941 941
 	list2=; for p in $$list; do \
942 942
 	  if test -f $$p; then \
... ...
@@ -944,6 +1029,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
944 944
 	  else :; fi; \
945 945
 	done; \
946 946
 	test -z "$$list2" || { \
947
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
948
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
947 949
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
948 950
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
949 951
 	}
... ...
@@ -959,34 +1046,44 @@ uninstall-libLTLIBRARIES:
959 959
 
960 960
 clean-libLTLIBRARIES:
961 961
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
962
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
963
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
964
-	  test "$$dir" != "$$p" || dir=.; \
965
-	  echo "rm -f \"$${dir}/so_locations\""; \
966
-	  rm -f "$${dir}/so_locations"; \
967
-	done
962
+	@list='$(lib_LTLIBRARIES)'; \
963
+	locs=`for p in $$list; do echo $$p; done | \
964
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
965
+	      sort -u`; \
966
+	test -z "$$locs" || { \
967
+	  echo rm -f $${locs}; \
968
+	  rm -f $${locs}; \
969
+	}
968 970
 
969 971
 clean-noinstLTLIBRARIES:
970 972
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
971
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
972
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
973
-	  test "$$dir" != "$$p" || dir=.; \
974
-	  echo "rm -f \"$${dir}/so_locations\""; \
975
-	  rm -f "$${dir}/so_locations"; \
976
-	done
973
+	@list='$(noinst_LTLIBRARIES)'; \
974
+	locs=`for p in $$list; do echo $$p; done | \
975
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
976
+	      sort -u`; \
977
+	test -z "$$locs" || { \
978
+	  echo rm -f $${locs}; \
979
+	  rm -f $${locs}; \
980
+	}
977 981
 yara_grammar.h: yara_grammar.c
978 982
 	@if test ! -f $@; then rm -f yara_grammar.c; else :; fi
979 983
 	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) yara_grammar.c; else :; fi
984
+
980 985
 libclamav.la: $(libclamav_la_OBJECTS) $(libclamav_la_DEPENDENCIES) $(EXTRA_libclamav_la_DEPENDENCIES) 
981 986
 	$(AM_V_CCLD)$(libclamav_la_LINK) -rpath $(libdir) $(libclamav_la_OBJECTS) $(libclamav_la_LIBADD) $(LIBS)
987
+
982 988
 libclamav_internal_utils.la: $(libclamav_internal_utils_la_OBJECTS) $(libclamav_internal_utils_la_DEPENDENCIES) $(EXTRA_libclamav_internal_utils_la_DEPENDENCIES) 
983 989
 	$(AM_V_CCLD)$(libclamav_internal_utils_la_LINK)  $(libclamav_internal_utils_la_OBJECTS) $(libclamav_internal_utils_la_LIBADD) $(LIBS)
990
+
984 991
 libclamav_internal_utils_nothreads.la: $(libclamav_internal_utils_nothreads_la_OBJECTS) $(libclamav_internal_utils_nothreads_la_DEPENDENCIES) $(EXTRA_libclamav_internal_utils_nothreads_la_DEPENDENCIES) 
985 992
 	$(AM_V_CCLD)$(libclamav_internal_utils_nothreads_la_LINK)  $(libclamav_internal_utils_nothreads_la_OBJECTS) $(libclamav_internal_utils_nothreads_la_LIBADD) $(LIBS)
993
+
986 994
 libclamav_nocxx.la: $(libclamav_nocxx_la_OBJECTS) $(libclamav_nocxx_la_DEPENDENCIES) $(EXTRA_libclamav_nocxx_la_DEPENDENCIES) 
987 995
 	$(AM_V_CCLD)$(libclamav_nocxx_la_LINK)  $(libclamav_nocxx_la_OBJECTS) $(libclamav_nocxx_la_LIBADD) $(LIBS)
996
+
988 997
 libclamunrar.la: $(libclamunrar_la_OBJECTS) $(libclamunrar_la_DEPENDENCIES) $(EXTRA_libclamunrar_la_DEPENDENCIES) 
989 998
 	$(AM_V_CCLD)$(libclamunrar_la_LINK) $(am_libclamunrar_la_rpath) $(libclamunrar_la_OBJECTS) $(libclamunrar_la_LIBADD) $(LIBS)
999
+
990 1000
 libclamunrar_iface.la: $(libclamunrar_iface_la_OBJECTS) $(libclamunrar_iface_la_DEPENDENCIES) $(EXTRA_libclamunrar_iface_la_DEPENDENCIES) 
991 1001
 	$(AM_V_CCLD)$(libclamunrar_iface_la_LINK) $(am_libclamunrar_iface_la_rpath) $(libclamunrar_iface_la_OBJECTS) $(libclamunrar_iface_la_LIBADD) $(LIBS)
992 1002
 
... ...
@@ -1180,6 +1277,7 @@ distclean-compile:
1180 1180
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-message.Plo@am__quote@
1181 1181
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-mew.Plo@am__quote@
1182 1182
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-mpool.Plo@am__quote@
1183
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-msdoc.Plo@am__quote@
1183 1184
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-msexpand.Plo@am__quote@
1184 1185
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-mspack.Plo@am__quote@
1185 1186
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-nulsft.Plo@am__quote@
... ...
@@ -1255,14 +1353,14 @@ distclean-compile:
1255 1255
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
1256 1256
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
1257 1257
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1258
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
1258
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
1259 1259
 
1260 1260
 .c.obj:
1261 1261
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
1262 1262
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
1263 1263
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
1264 1264
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1265
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
1265
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
1266 1266
 
1267 1267
 .c.lo:
1268 1268
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -2251,6 +2349,13 @@ libclamav_la-yara_parser.lo: yara_parser.c
2251 2251
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2252 2252
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-yara_parser.lo `test -f 'yara_parser.c' || echo '$(srcdir)/'`yara_parser.c
2253 2253
 
2254
+libclamav_la-msdoc.lo: msdoc.c
2255
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-msdoc.lo -MD -MP -MF $(DEPDIR)/libclamav_la-msdoc.Tpo -c -o libclamav_la-msdoc.lo `test -f 'msdoc.c' || echo '$(srcdir)/'`msdoc.c
2256
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-msdoc.Tpo $(DEPDIR)/libclamav_la-msdoc.Plo
2257
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='msdoc.c' object='libclamav_la-msdoc.lo' libtool=yes @AMDEPBACKSLASH@
2258
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2259
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-msdoc.lo `test -f 'msdoc.c' || echo '$(srcdir)/'`msdoc.c
2260
+
2254 2261
 libclamav_la-fp_add.lo: tomsfastmath/addsub/fp_add.c
2255 2262
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-fp_add.lo -MD -MP -MF $(DEPDIR)/libclamav_la-fp_add.Tpo -c -o libclamav_la-fp_add.lo `test -f 'tomsfastmath/addsub/fp_add.c' || echo '$(srcdir)/'`tomsfastmath/addsub/fp_add.c
2256 2263
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-fp_add.Tpo $(DEPDIR)/libclamav_la-fp_add.Plo
... ...
@@ -3046,7 +3151,7 @@ unrar_iface.lo: ../libclamunrar_iface/unrar_iface.c
3046 3046
 	$(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
3047 3047
 
3048 3048
 .y.c:
3049
-	$(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
3049
+	$(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE)
3050 3050
 
3051 3051
 mostlyclean-libtool:
3052 3052
 	-rm -f *.lo
... ...
@@ -3055,8 +3160,11 @@ clean-libtool:
3055 3055
 	-rm -rf .libs _libs
3056 3056
 install-includeHEADERS: $(include_HEADERS)
3057 3057
 	@$(NORMAL_INSTALL)
3058
-	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
3059 3058
 	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
3059
+	if test -n "$$list"; then \
3060
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
3061
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
3062
+	fi; \
3060 3063
 	for p in $$list; do \
3061 3064
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
3062 3065
 	  echo "$$d$$p"; \
... ...
@@ -3073,22 +3181,25 @@ uninstall-includeHEADERS:
3073 3073
 	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
3074 3074
 
3075 3075
 # This directory's subdirectories are mostly independent; you can cd
3076
-# into them and run `make' without going through this Makefile.
3077
-# To change the values of `make' variables: instead of editing Makefiles,
3078
-# (1) if the variable is set in `config.status', edit `config.status'
3079
-#     (which will cause the Makefiles to be regenerated when you run `make');
3080
-# (2) otherwise, pass the desired values on the `make' command line.
3081
-$(RECURSIVE_TARGETS):
3082
-	@fail= failcom='exit 1'; \
3083
-	for f in x $$MAKEFLAGS; do \
3084
-	  case $$f in \
3085
-	    *=* | --[!k]*);; \
3086
-	    *k*) failcom='fail=yes';; \
3087
-	  esac; \
3088
-	done; \
3076
+# into them and run 'make' without going through this Makefile.
3077
+# To change the values of 'make' variables: instead of editing Makefiles,
3078
+# (1) if the variable is set in 'config.status', edit 'config.status'
3079
+#     (which will cause the Makefiles to be regenerated when you run 'make');
3080
+# (2) otherwise, pass the desired values on the 'make' command line.
3081
+$(am__recursive_targets):
3082
+	@fail=; \
3083
+	if $(am__make_keepgoing); then \
3084
+	  failcom='fail=yes'; \
3085
+	else \
3086
+	  failcom='exit 1'; \
3087
+	fi; \
3089 3088
 	dot_seen=no; \
3090 3089
 	target=`echo $@ | sed s/-recursive//`; \
3091
-	list='$(SUBDIRS)'; for subdir in $$list; do \
3090
+	case "$@" in \
3091
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
3092
+	  *) list='$(SUBDIRS)' ;; \
3093
+	esac; \
3094
+	for subdir in $$list; do \
3092 3095
 	  echo "Making $$target in $$subdir"; \
3093 3096
 	  if test "$$subdir" = "."; then \
3094 3097
 	    dot_seen=yes; \
... ...
@@ -3103,57 +3214,12 @@ $(RECURSIVE_TARGETS):
3103 3103
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
3104 3104
 	fi; test -z "$$fail"
3105 3105
 
3106
-$(RECURSIVE_CLEAN_TARGETS):
3107
-	@fail= failcom='exit 1'; \
3108
-	for f in x $$MAKEFLAGS; do \
3109
-	  case $$f in \
3110
-	    *=* | --[!k]*);; \
3111
-	    *k*) failcom='fail=yes';; \
3112
-	  esac; \
3113
-	done; \
3114
-	dot_seen=no; \
3115
-	case "$@" in \
3116
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
3117
-	  *) list='$(SUBDIRS)' ;; \
3118
-	esac; \
3119
-	rev=''; for subdir in $$list; do \
3120
-	  if test "$$subdir" = "."; then :; else \
3121
-	    rev="$$subdir $$rev"; \
3122
-	  fi; \
3123
-	done; \
3124
-	rev="$$rev ."; \
3125
-	target=`echo $@ | sed s/-recursive//`; \
3126
-	for subdir in $$rev; do \
3127
-	  echo "Making $$target in $$subdir"; \
3128
-	  if test "$$subdir" = "."; then \
3129
-	    local_target="$$target-am"; \
3130
-	  else \
3131
-	    local_target="$$target"; \
3132
-	  fi; \
3133
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
3134
-	  || eval $$failcom; \
3135
-	done && test -z "$$fail"
3136
-tags-recursive:
3137
-	list='$(SUBDIRS)'; for subdir in $$list; do \
3138
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
3139
-	done
3140
-ctags-recursive:
3141
-	list='$(SUBDIRS)'; for subdir in $$list; do \
3142
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
3143
-	done
3106
+ID: $(am__tagged_files)
3107
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
3108
+tags: tags-recursive
3109
+TAGS: tags
3144 3110
 
3145
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
3146
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
3147
-	unique=`for i in $$list; do \
3148
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
3149
-	  done | \
3150
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
3151
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
3152
-	mkid -fID $$unique
3153
-tags: TAGS
3154
-
3155
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
3156
-		$(TAGS_FILES) $(LISP)
3111
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
3157 3112
 	set x; \
3158 3113
 	here=`pwd`; \
3159 3114
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
... ...
@@ -3169,12 +3235,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
3169 3169
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
3170 3170
 	  fi; \
3171 3171
 	done; \
3172
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
3173
-	unique=`for i in $$list; do \
3174
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
3175
-	  done | \
3176
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
3177
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
3172
+	$(am__define_uniq_tagged_files); \
3178 3173
 	shift; \
3179 3174
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
3180 3175
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -3186,15 +3247,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
3186 3186
 	      $$unique; \
3187 3187
 	  fi; \
3188 3188
 	fi
3189
-ctags: CTAGS
3190
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
3191
-		$(TAGS_FILES) $(LISP)
3192
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
3193
-	unique=`for i in $$list; do \
3194
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
3195
-	  done | \
3196
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
3197
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
3189
+ctags: ctags-recursive
3190
+
3191
+CTAGS: ctags
3192
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
3193
+	$(am__define_uniq_tagged_files); \
3198 3194
 	test -z "$(CTAGS_ARGS)$$unique" \
3199 3195
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
3200 3196
 	     $$unique
... ...
@@ -3203,6 +3260,21 @@ GTAGS:
3203 3203
 	here=`$(am__cd) $(top_builddir) && pwd` \
3204 3204
 	  && $(am__cd) $(top_srcdir) \
3205 3205
 	  && gtags -i $(GTAGS_ARGS) "$$here"
3206
+cscopelist: cscopelist-recursive
3207
+
3208
+cscopelist-am: $(am__tagged_files)
3209
+	list='$(am__tagged_files)'; \
3210
+	case "$(srcdir)" in \
3211
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
3212
+	  *) sdir=$(subdir)/$(srcdir) ;; \
3213
+	esac; \
3214
+	for i in $$list; do \
3215
+	  if test -f "$$i"; then \
3216
+	    echo "$(subdir)/$$i"; \
3217
+	  else \
3218
+	    echo "$$sdir/$$i"; \
3219
+	  fi; \
3220
+	done >> $(top_builddir)/cscope.files
3206 3221
 
3207 3222
 distclean-tags:
3208 3223
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -3239,13 +3311,10 @@ distdir: $(DISTFILES)
3239 3239
 	done
3240 3240
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
3241 3241
 	  if test "$$subdir" = .; then :; else \
3242
-	    test -d "$(distdir)/$$subdir" \
3243
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
3244
-	    || exit 1; \
3245
-	  fi; \
3246
-	done
3247
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
3248
-	  if test "$$subdir" = .; then :; else \
3242
+	    $(am__make_dryrun) \
3243
+	      || test -d "$(distdir)/$$subdir" \
3244
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
3245
+	      || exit 1; \
3249 3246
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
3250 3247
 	    $(am__relativize); \
3251 3248
 	    new_distdir=$$reldir; \
... ...
@@ -3381,26 +3450,25 @@ ps-am:
3381 3381
 
3382 3382
 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
3383 3383
 
3384
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
3385
-	ctags-recursive install install-am install-strip \
3386
-	tags-recursive
3387
-
3388
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
3389
-	all all-am check check-am clean clean-generic \
3390
-	clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
3391
-	ctags ctags-recursive distclean distclean-compile \
3392
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
3393
-	dvi-am html html-am info info-am install install-am \
3394
-	install-data install-data-am install-dvi install-dvi-am \
3395
-	install-exec install-exec-am install-html install-html-am \
3384
+.MAKE: $(am__recursive_targets) all check install install-am \
3385
+	install-strip
3386
+
3387
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
3388
+	check-am clean clean-generic clean-libLTLIBRARIES \
3389
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
3390
+	ctags-am distclean distclean-compile distclean-generic \
3391
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
3392
+	html-am info info-am install install-am install-data \
3393
+	install-data-am install-dvi install-dvi-am install-exec \
3394
+	install-exec-am install-html install-html-am \
3396 3395
 	install-includeHEADERS install-info install-info-am \
3397 3396
 	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
3398 3397
 	install-ps install-ps-am install-strip installcheck \
3399 3398
 	installcheck-am installdirs installdirs-am maintainer-clean \
3400 3399
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
3401 3400
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
3402
-	tags tags-recursive uninstall uninstall-am \
3403
-	uninstall-includeHEADERS uninstall-libLTLIBRARIES
3401
+	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
3402
+	uninstall-libLTLIBRARIES
3404 3403
 
3405 3404
 @ENABLE_LLVM_FALSE@c++/Makefile: c++/Makefile.nollvm.in
3406 3405
 @ENABLE_LLVM_FALSE@	$(AM_V_at) cp $< $@
... ...
@@ -836,8 +836,10 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg
836 836
 		    break;
837 837
 		}
838 838
 	    }
839
-	    if(dsize)
840
-		break;
839
+	    if(dsize) {
840
+            crtmgr_free(&newcerts);
841
+            break;
842
+        }
841 843
 	    if(newcerts.crts) {
842 844
 		x509 = newcerts.crts;
843 845
 		cli_dbgmsg("asn1_parse_mscat: %u new certificates collected\n", newcerts.items);
... ...
@@ -877,8 +879,10 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg
877 877
 		    }
878 878
 		    x509 = x509->next;
879 879
 		}
880
-		if(x509)
880
+		if(x509) {
881
+            crtmgr_free(&newcerts);
881 882
 		    break;
883
+        }
882 884
 		if(newcerts.items)
883 885
 		    cli_dbgmsg("asn1_parse_mscat: %u certificates did not verify\n", newcerts.items);
884 886
 		crtmgr_free(&newcerts);
... ...
@@ -29,13 +29,20 @@
29 29
 #include "llvm/ADT/PostOrderIterator.h"
30 30
 #include "llvm/ADT/SCCIterator.h"
31 31
 #include "llvm/Analysis/CallGraph.h"
32
-#include "llvm/Analysis/Verifier.h"
33 32
 #if LLVM_VERSION < 32
34 33
 #include "llvm/Analysis/DebugInfo.h"
35
-#else
34
+#elif LLVM_VERSION < 35
36 35
 #include "llvm/DebugInfo.h"
36
+#else
37
+#include "llvm/IR/DebugInfo.h"
37 38
 #endif
39
+#if LLVM_VERSION < 35
38 40
 #include "llvm/Analysis/Dominators.h"
41
+#include "llvm/Analysis/Verifier.h"
42
+#else
43
+#include "llvm/IR/Dominators.h"
44
+#include "llvm/IR/Verifier.h"
45
+#endif
39 46
 #include "llvm/Analysis/ConstantFolding.h"
40 47
 #if LLVM_VERSION < 29
41 48
 //#include "llvm/Analysis/LiveValues.h" (unused)
... ...
@@ -50,9 +57,14 @@
50 50
 #include "llvm/Config/config.h"
51 51
 #include "llvm/Pass.h"
52 52
 #include "llvm/Support/CommandLine.h"
53
+#if LLVM_VERSION < 35
53 54
 #include "llvm/Support/DataFlow.h"
54 55
 #include "llvm/Support/InstIterator.h"
55 56
 #include "llvm/Support/GetElementPtrTypeIterator.h"
57
+#else
58
+#include "llvm/IR/InstIterator.h"
59
+#include "llvm/IR/GetElementPtrTypeIterator.h"
60
+#endif
56 61
 #include "llvm/ADT/DepthFirstIterator.h"
57 62
 #include "llvm/Transforms/Scalar.h"
58 63
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
... ...
@@ -71,7 +83,6 @@
71 71
 #include "llvm/Intrinsics.h"
72 72
 #include "llvm/LLVMContext.h"
73 73
 #include "llvm/Module.h"
74
-#include "llvm/Support/InstVisitor.h"
75 74
 #else
76 75
 #include "llvm/IR/DerivedTypes.h"
77 76
 #include "llvm/IR/Instructions.h"
... ...
@@ -79,7 +90,14 @@
79 79
 #include "llvm/IR/Intrinsics.h"
80 80
 #include "llvm/IR/LLVMContext.h"
81 81
 #include "llvm/IR/Module.h"
82
+#endif
83
+
84
+#if LLVM_VERSION < 33
85
+#include "llvm/Support/InstVisitor.h"
86
+#elif LLVM_VERSION < 35
82 87
 #include "llvm/InstVisitor.h"
88
+#else
89
+#include "llvm/IR/InstVisitor.h"
83 90
 #endif
84 91
 
85 92
 #define DEFINEPASS(passname) passname() : FunctionPass(ID)
... ...
@@ -95,7 +113,7 @@ static Value *GetUnderlyingObject(Value *P, TargetData *TD)
95 95
 
96 96
 namespace llvm {
97 97
   class PtrVerifier;
98
-#if LLVM_VERSION >= 30
98
+#if LLVM_VERSION >= 29
99 99
   void initializePtrVerifierPass(PassRegistry&);
100 100
 #endif
101 101
 
... ...
@@ -103,12 +121,20 @@ namespace llvm {
103 103
   private:
104 104
       DenseSet<Function*> badFunctions;
105 105
       std::vector<Instruction*> delInst;
106
+#if LLVM_VERSION < 35
106 107
       CallGraphNode *rootNode;
108
+#else
109
+      CallGraph *CG;
110
+#endif
107 111
   public:
108 112
       static char ID;
113
+#if LLVM_VERSION < 35
109 114
       DEFINEPASS(PtrVerifier), rootNode(0), PT(), TD(), SE(), expander(),
115
+#else
116
+      DEFINEPASS(PtrVerifier), CG(0), PT(), TD(), SE(), expander(),
117
+#endif
110 118
           DT(), AbrtBB(), Changed(false), valid(false), EP() {
111
-#if LLVM_VERSION >= 30
119
+#if LLVM_VERSION >= 29
112 120
           initializePtrVerifierPass(*PassRegistry::getPassRegistry());
113 121
 #endif
114 122
       }
... ...
@@ -133,12 +159,21 @@ namespace llvm {
133 133
           AbrtBB = 0;
134 134
           valid = true;
135 135
 
136
+#if LLVM_VERSION < 35
136 137
           if (!rootNode) {
137 138
               rootNode = getAnalysis<CallGraph>().getRoot();
139
+#else
140
+          if (!CG) {
141
+              CG = &getAnalysis<CallGraphWrapperPass>().getCallGraph();
142
+#endif
138 143
               // No recursive functions for now.
139 144
               // In the future we may insert runtime checks for stack depth.
145
+#if LLVM_VERSION < 35
140 146
               for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode),
141 147
                        E = scc_end(rootNode); SCCI != E; ++SCCI) {
148
+#else
149
+              for (scc_iterator<CallGraph*> SCCI = scc_begin(CG); !SCCI.isAtEnd(); ++SCCI) {
150
+#endif
142 151
                   const std::vector<CallGraphNode*> &nextSCC = *SCCI;
143 152
                   if (nextSCC.size() > 1 || SCCI.hasLoop()) {
144 153
                       errs() << "INVALID: Recursion detected, callgraph SCC components: ";
... ...
@@ -164,12 +199,19 @@ namespace llvm {
164 164
           EP = &*It;
165 165
 #if LLVM_VERSION < 32
166 166
           TD = &getAnalysis<TargetData>();
167
-#else
167
+#elif LLVM_VERSION < 35
168 168
           TD = &getAnalysis<DataLayout>();
169
+#else
170
+          DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
171
+          TD = DLP ? &DLP->getDataLayout() : 0;
169 172
 #endif
170 173
           SE = &getAnalysis<ScalarEvolution>();
171 174
           PT = &getAnalysis<PointerTracking>();
175
+#if LLVM_VERSION < 35
172 176
           DT = &getAnalysis<DominatorTree>();
177
+#else
178
+          DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
179
+#endif
173 180
           expander = new SCEVExpander(*SE OPT("SCEVexpander"));
174 181
 
175 182
           std::vector<Instruction*> insns;
... ...
@@ -307,13 +349,23 @@ namespace llvm {
307 307
       virtual void getAnalysisUsage(AnalysisUsage &AU) const {
308 308
 #if LLVM_VERSION < 32
309 309
           AU.addRequired<TargetData>();
310
-#else
310
+#elif LLVM_VERSION < 35
311 311
           AU.addRequired<DataLayout>();
312
+#else
313
+          AU.addRequired<DataLayoutPass>();
312 314
 #endif
315
+#if LLVM_VERSION < 35
313 316
           AU.addRequired<DominatorTree>();
317
+#else
318
+          AU.addRequired<DominatorTreeWrapperPass>();
319
+#endif
314 320
           AU.addRequired<ScalarEvolution>();
315 321
           AU.addRequired<PointerTracking>();
322
+#if LLVM_VERSION < 35
316 323
           AU.addRequired<CallGraph>();
324
+#else
325
+          AU.addRequired<CallGraphWrapperPass>();
326
+#endif
317 327
       }
318 328
 
319 329
       bool isValid() const { return valid; }
... ...
@@ -321,8 +373,10 @@ namespace llvm {
321 321
       PointerTracking *PT;
322 322
 #if LLVM_VERSION < 32
323 323
       TargetData *TD;
324
-#else
324
+#elif LLVM_VERSION < 35
325 325
       DataLayout *TD;
326
+#else
327
+      const DataLayout *TD;
326 328
 #endif
327 329
       ScalarEvolution *SE;
328 330
       SCEVExpander *expander;
... ...
@@ -851,19 +905,27 @@ namespace llvm {
851 851
     char PtrVerifier::ID;
852 852
 
853 853
 } /* end namespace llvm */
854
-#if LLVM_VERSION >= 30
854
+#if LLVM_VERSION >= 29
855 855
 INITIALIZE_PASS_BEGIN(PtrVerifier, "", "", false, false)
856 856
 #if LLVM_VERSION < 32
857 857
 INITIALIZE_PASS_DEPENDENCY(TargetData)
858
-#else
858
+#elif LLVM_VERSION < 35
859 859
 INITIALIZE_PASS_DEPENDENCY(DataLayout)
860
+#else
861
+INITIALIZE_PASS_DEPENDENCY(DataLayoutPass)
860 862
 #endif
863
+#if LLVM_VERSION < 35
861 864
 INITIALIZE_PASS_DEPENDENCY(DominatorTree)
865
+#else
866
+INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
867
+#endif
862 868
 INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
863 869
 #if LLVM_VERSION < 34
864 870
 INITIALIZE_AG_DEPENDENCY(CallGraph)
865
-#else
871
+#elif LLVM_VERSION < 35
866 872
 INITIALIZE_PASS_DEPENDENCY(CallGraph)
873
+#else
874
+INITIALIZE_PASS_DEPENDENCY(CallGraphWrapperPass)
867 875
 #endif
868 876
 INITIALIZE_PASS_DEPENDENCY(PointerTracking)
869 877
 INITIALIZE_PASS_END(PtrVerifier, "clambc-rtchecks", "ClamBC RTchecks", false, false)
... ...
@@ -34,9 +34,9 @@ if BUILD_EXTERNAL_LLVM
34 34
 # we know this will be built with GNU make, so its safe to use GNU make specific
35 35
 # $(shell ...)
36 36
 #LLVM_DEPS=$(shell $(LLVM_CONFIG) --libfiles jit nativecodegen)
37
-libclamavcxx_la_CXXFLAGS = $(AM_CPPFLAGS) @LLVMCONFIG_CXXFLAGS@ -fexceptions -DLLVM_VERSION=${LLVM_VERSION} @JSON_CPPFLAGS@
38
-libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LIBS@ @LLVMCONFIG_LDFLAGS@ @JSON_LDFLAGS@
39
-libclamavcxx_la_DEPENDENCIES = @LLVMCONFIG_LIBFILES@ @JSON_LIBS@
37
+libclamavcxx_la_CXXFLAGS = $(AM_CPPFLAGS) @LLVMCONFIG_CXXFLAGS@ -fexceptions -DLLVM_VERSION=${LLVM_VERSION}
38
+libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LIBS@ @LLVMCONFIG_LDFLAGS@
39
+libclamavcxx_la_DEPENDENCIES = @LLVMCONFIG_LIBFILES@
40 40
 noinst_LTLIBRARIES = libclamavcxx.la
41 41
 libclamavcxx_la_SOURCES += PointerTracking.cpp
42 42
 libclamavcxx_la_SOURCES += PointerTracking.h
... ...
@@ -48,7 +48,7 @@ noinst_LTLIBRARIES = libclamavcxx.la libllvmsystem.la\
48 48
 libclamavcxx_la_LIBADD=libllvmjit.la
49 49
 libclamavcxx_la_DEPENDENCIES=libllvmjit.la libllvmcodegen.la libllvmsystem.la
50 50
 libclamavcxx_la_LDFLAGS=-no-undefined
51
-libclamavcxx_la_CXXFLAGS = $(LLVM_CXXFLAGS) -DLLVM_VERSION=${LLVM_VERSION} @JSON_CPPFLAGS@
51
+libclamavcxx_la_CXXFLAGS = $(LLVM_CXXFLAGS) -DLLVM_VERSION=${LLVM_VERSION}
52 52
 
53 53
 
54 54
 if BUILD_X86
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -32,6 +31,51 @@
32 32
 
33 33
 
34 34
 VPATH = @srcdir@
35
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
36
+am__make_running_with_option = \
37
+  case $${target_option-} in \
38
+      ?) ;; \
39
+      *) echo "am__make_running_with_option: internal error: invalid" \
40
+              "target option '$${target_option-}' specified" >&2; \
41
+         exit 1;; \
42
+  esac; \
43
+  has_opt=no; \
44
+  sane_makeflags=$$MAKEFLAGS; \
45
+  if $(am__is_gnu_make); then \
46
+    sane_makeflags=$$MFLAGS; \
47
+  else \
48
+    case $$MAKEFLAGS in \
49
+      *\\[\ \	]*) \
50
+        bs=\\; \
51
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
52
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
53
+    esac; \
54
+  fi; \
55
+  skip_next=no; \
56
+  strip_trailopt () \
57
+  { \
58
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
59
+  }; \
60
+  for flg in $$sane_makeflags; do \
61
+    test $$skip_next = yes && { skip_next=no; continue; }; \
62
+    case $$flg in \
63
+      *=*|--*) continue;; \
64
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
65
+      -*I?*) strip_trailopt 'I';; \
66
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
67
+      -*O?*) strip_trailopt 'O';; \
68
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
69
+      -*l?*) strip_trailopt 'l';; \
70
+      -[dEDm]) skip_next=yes;; \
71
+      -[JT]) skip_next=yes;; \
72
+    esac; \
73
+    case $$flg in \
74
+      *$$target_option*) has_opt=yes; break;; \
75
+    esac; \
76
+  done; \
77
+  test $$has_opt = yes
78
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
79
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
35 80
 pkgdatadir = $(datadir)/@PACKAGE@
36 81
 pkgincludedir = $(includedir)/@PACKAGE@
37 82
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -63,17 +107,21 @@ target_triplet = @target@
63 63
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@am__append_9 = $(TBLGENFILES)
64 64
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = tblgen$(EXEEXT)
65 65
 subdir = .
66
-DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
67
-	$(srcdir)/Makefile.in $(srcdir)/clamavcxx-config.h.in \
68
-	$(top_srcdir)/configure config/compile config/config.guess \
69
-	config/config.sub config/depcomp config/install-sh \
70
-	config/ltmain.sh config/missing
66
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
67
+	$(top_srcdir)/configure $(am__configure_deps) \
68
+	$(srcdir)/clamavcxx-config.h.in $(top_srcdir)/config/depcomp \
69
+	config/compile config/config.guess config/config.sub \
70
+	config/depcomp config/install-sh config/missing \
71
+	config/ltmain.sh $(top_srcdir)/config/compile \
72
+	$(top_srcdir)/config/config.guess \
73
+	$(top_srcdir)/config/config.sub \
74
+	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
75
+	$(top_srcdir)/config/missing
71 76
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
72 77
 am__aclocal_m4_deps = $(top_srcdir)/m4/check_gnu_make.m4 \
73 78
 	$(top_srcdir)/m4/cxx_flag_check.m4 $(top_srcdir)/m4/libtool.m4 \
74 79
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
75 80
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
76
-	$(top_srcdir)/../../m4/reorganization/libs/json.m4 \
77 81
 	$(top_srcdir)/configure.ac
78 82
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
79 83
 	$(ACLOCAL_M4)
... ...
@@ -97,6 +145,7 @@ libclamavcxx_la_OBJECTS = $(am_libclamavcxx_la_OBJECTS)
97 97
 AM_V_lt = $(am__v_lt_@AM_V@)
98 98
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
99 99
 am__v_lt_0 = --silent
100
+am__v_lt_1 = 
100 101
 libclamavcxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
101 102
 	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
102 103
 	$(libclamavcxx_la_CXXFLAGS) $(CXXFLAGS) \
... ...
@@ -762,6 +811,18 @@ tblgen_LDADD = $(LDADD)
762 762
 tblgen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
763 763
 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(tblgen_CXXFLAGS) \
764 764
 	$(CXXFLAGS) $(tblgen_LDFLAGS) $(LDFLAGS) -o $@
765
+AM_V_P = $(am__v_P_@AM_V@)
766
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
767
+am__v_P_0 = false
768
+am__v_P_1 = :
769
+AM_V_GEN = $(am__v_GEN_@AM_V@)
770
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
771
+am__v_GEN_0 = @echo "  GEN     " $@;
772
+am__v_GEN_1 = 
773
+AM_V_at = $(am__v_at_@AM_V@)
774
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
775
+am__v_at_0 = @
776
+am__v_at_1 = 
765 777
 DEFAULT_INCLUDES = -I.@am__isrc@
766 778
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
767 779
 am__depfiles_maybe = depfiles
... ...
@@ -774,17 +835,16 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
774 774
 	$(AM_CFLAGS) $(CFLAGS)
775 775
 AM_V_CC = $(am__v_CC_@AM_V@)
776 776
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
777
-am__v_CC_0 = @echo "  CC    " $@;
778
-AM_V_at = $(am__v_at_@AM_V@)
779
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
780
-am__v_at_0 = @
777
+am__v_CC_0 = @echo "  CC      " $@;
778
+am__v_CC_1 = 
781 779
 CCLD = $(CC)
782 780
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
783 781
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
784 782
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
785 783
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
786 784
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
787
-am__v_CCLD_0 = @echo "  CCLD  " $@;
785
+am__v_CCLD_0 = @echo "  CCLD    " $@;
786
+am__v_CCLD_1 = 
788 787
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
789 788
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
790 789
 LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
... ...
@@ -793,17 +853,16 @@ LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
793 793
 	$(AM_CXXFLAGS) $(CXXFLAGS)
794 794
 AM_V_CXX = $(am__v_CXX_@AM_V@)
795 795
 am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
796
-am__v_CXX_0 = @echo "  CXX   " $@;
796
+am__v_CXX_0 = @echo "  CXX     " $@;
797
+am__v_CXX_1 = 
797 798
 CXXLD = $(CXX)
798 799
 CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
799 800
 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
800 801
 	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
801 802
 AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
802 803
 am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
803
-am__v_CXXLD_0 = @echo "  CXXLD " $@;
804
-AM_V_GEN = $(am__v_GEN_@AM_V@)
805
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
806
-am__v_GEN_0 = @echo "  GEN   " $@;
804
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
805
+am__v_CXXLD_1 = 
807 806
 SOURCES = $(libclamavcxx_la_SOURCES) $(libllvmcodegen_la_SOURCES) \
808 807
 	$(libllvmjit_la_SOURCES) $(libllvmpowerpccodegen_la_SOURCES) \
809 808
 	$(libllvmsystem_la_SOURCES) $(libllvmx86codegen_la_SOURCES) \
... ...
@@ -815,8 +874,33 @@ DIST_SOURCES = $(am__libclamavcxx_la_SOURCES_DIST) \
815 815
 	$(am__libllvmsystem_la_SOURCES_DIST) \
816 816
 	$(am__libllvmx86codegen_la_SOURCES_DIST) \
817 817
 	$(am__tblgen_SOURCES_DIST)
818
+am__can_run_installinfo = \
819
+  case $$AM_UPDATE_INFO_DIR in \
820
+    n|no|NO) false;; \
821
+    *) (install-info --version) >/dev/null 2>&1;; \
822
+  esac
823
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
824
+	$(LISP)clamavcxx-config.h.in
825
+# Read a list of newline-separated strings from the standard input,
826
+# and print each of them once, without duplicates.  Input order is
827
+# *not* preserved.
828
+am__uniquify_input = $(AWK) '\
829
+  BEGIN { nonempty = 0; } \
830
+  { items[$$0] = 1; nonempty = 1; } \
831
+  END { if (nonempty) { for (i in items) print i; }; } \
832
+'
833
+# Make sure the list of sources is unique.  This is necessary because,
834
+# e.g., the same source file might be shared among _SOURCES variables
835
+# for different programs/libraries.
836
+am__define_uniq_tagged_files = \
837
+  list='$(am__tagged_files)'; \
838
+  unique=`for i in $$list; do \
839
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
840
+  done | $(am__uniquify_input)`
818 841
 ETAGS = etags
819 842
 CTAGS = ctags
843
+CSCOPE = cscope
844
+AM_RECURSIVE_TARGETS = cscope
820 845
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
821 846
 distdir = $(PACKAGE)-$(VERSION)
822 847
 top_distdir = $(distdir)
... ...
@@ -826,8 +910,10 @@ am__remove_distdir = \
826 826
       && rm -rf "$(distdir)" \
827 827
       || { sleep 5 && rm -rf "$(distdir)"; }; \
828 828
   else :; fi
829
+am__post_remove_distdir = $(am__remove_distdir)
829 830
 DIST_ARCHIVES = $(distdir).tar.gz
830 831
 GZIP_ENV = --best
832
+DIST_TARGETS = dist-gzip
831 833
 distuninstallcheck_listfiles = find . -type f -print
832 834
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
833 835
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
... ...
@@ -868,9 +954,6 @@ INSTALL_DATA = @INSTALL_DATA@
868 868
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
869 869
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
870 870
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
871
-JSON_CPPFLAGS = @JSON_CPPFLAGS@
872
-JSON_LDFLAGS = @JSON_LDFLAGS@
873
-JSON_LIBS = @JSON_LIBS@
874 871
 LD = @LD@
875 872
 LDFLAGS = @LDFLAGS@
876 873
 LIBOBJS = @LIBOBJS@
... ...
@@ -982,20 +1065,20 @@ ACLOCAL_AMFLAGS = -I m4
982 982
 libclamavcxx_la_SOURCES = bytecode2llvm.cpp ClamBCRTChecks.cpp \
983 983
 	ClamBCModule.h ClamBCDiagnostics.h detect.cpp llvm30_compat.h \
984 984
 	$(am__append_1)
985
-@BUILD_EXTERNAL_LLVM_FALSE@libclamavcxx_la_CXXFLAGS = $(LLVM_CXXFLAGS) -DLLVM_VERSION=${LLVM_VERSION} @JSON_CPPFLAGS@
985
+@BUILD_EXTERNAL_LLVM_FALSE@libclamavcxx_la_CXXFLAGS = $(LLVM_CXXFLAGS) -DLLVM_VERSION=${LLVM_VERSION}
986 986
 #$(LLVM_CONFIG): build-llvm
987 987
 # we know this will be built with GNU make, so its safe to use GNU make specific
988 988
 # $(shell ...)
989 989
 #LLVM_DEPS=$(shell $(LLVM_CONFIG) --libfiles jit nativecodegen)
990
-@BUILD_EXTERNAL_LLVM_TRUE@libclamavcxx_la_CXXFLAGS = $(AM_CPPFLAGS) @LLVMCONFIG_CXXFLAGS@ -fexceptions -DLLVM_VERSION=${LLVM_VERSION} @JSON_CPPFLAGS@
990
+@BUILD_EXTERNAL_LLVM_TRUE@libclamavcxx_la_CXXFLAGS = $(AM_CPPFLAGS) @LLVMCONFIG_CXXFLAGS@ -fexceptions -DLLVM_VERSION=${LLVM_VERSION}
991 991
 @BUILD_EXTERNAL_LLVM_FALSE@libclamavcxx_la_LDFLAGS = -no-undefined
992
-@BUILD_EXTERNAL_LLVM_TRUE@libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LIBS@ @LLVMCONFIG_LDFLAGS@ @JSON_LDFLAGS@
992
+@BUILD_EXTERNAL_LLVM_TRUE@libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LIBS@ @LLVMCONFIG_LDFLAGS@
993 993
 @BUILD_EXTERNAL_LLVM_FALSE@libclamavcxx_la_DEPENDENCIES =  \
994 994
 @BUILD_EXTERNAL_LLVM_FALSE@	libllvmjit.la libllvmcodegen.la \
995 995
 @BUILD_EXTERNAL_LLVM_FALSE@	libllvmsystem.la $(am__append_4) \
996 996
 @BUILD_EXTERNAL_LLVM_FALSE@	$(am__append_7)
997 997
 @BUILD_EXTERNAL_LLVM_TRUE@libclamavcxx_la_DEPENDENCIES =  \
998
-@BUILD_EXTERNAL_LLVM_TRUE@	@LLVMCONFIG_LIBFILES@ @JSON_LIBS@ \
998
+@BUILD_EXTERNAL_LLVM_TRUE@	@LLVMCONFIG_LIBFILES@ \
999 999
 @BUILD_EXTERNAL_LLVM_TRUE@	$(am__append_4) $(am__append_7)
1000 1000
 @BUILD_EXTERNAL_LLVM_FALSE@noinst_LTLIBRARIES = libclamavcxx.la \
1001 1001
 @BUILD_EXTERNAL_LLVM_FALSE@	libllvmsystem.la libllvmcodegen.la \
... ...
@@ -1484,8 +1567,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
1484 1484
 $(am__aclocal_m4_deps):
1485 1485
 
1486 1486
 clamavcxx-config.h: stamp-h1
1487
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
1488
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
1487
+	@test -f $@ || rm -f stamp-h1
1488
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
1489 1489
 
1490 1490
 stamp-h1: $(srcdir)/clamavcxx-config.h.in $(top_builddir)/config.status
1491 1491
 	@rm -f stamp-h1
... ...
@@ -1500,22 +1583,30 @@ distclean-hdr:
1500 1500
 
1501 1501
 clean-noinstLTLIBRARIES:
1502 1502
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
1503
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
1504
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
1505
-	  test "$$dir" != "$$p" || dir=.; \
1506
-	  echo "rm -f \"$${dir}/so_locations\""; \
1507
-	  rm -f "$${dir}/so_locations"; \
1508
-	done
1503
+	@list='$(noinst_LTLIBRARIES)'; \
1504
+	locs=`for p in $$list; do echo $$p; done | \
1505
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
1506
+	      sort -u`; \
1507
+	test -z "$$locs" || { \
1508
+	  echo rm -f $${locs}; \
1509
+	  rm -f $${locs}; \
1510
+	}
1511
+
1509 1512
 libclamavcxx.la: $(libclamavcxx_la_OBJECTS) $(libclamavcxx_la_DEPENDENCIES) $(EXTRA_libclamavcxx_la_DEPENDENCIES) 
1510 1513
 	$(AM_V_CXXLD)$(libclamavcxx_la_LINK) $(am_libclamavcxx_la_rpath) $(libclamavcxx_la_OBJECTS) $(libclamavcxx_la_LIBADD) $(LIBS)
1514
+
1511 1515
 libllvmcodegen.la: $(libllvmcodegen_la_OBJECTS) $(libllvmcodegen_la_DEPENDENCIES) $(EXTRA_libllvmcodegen_la_DEPENDENCIES) 
1512 1516
 	$(AM_V_CXXLD)$(CXXLINK) $(am_libllvmcodegen_la_rpath) $(libllvmcodegen_la_OBJECTS) $(libllvmcodegen_la_LIBADD) $(LIBS)
1517
+
1513 1518
 libllvmjit.la: $(libllvmjit_la_OBJECTS) $(libllvmjit_la_DEPENDENCIES) $(EXTRA_libllvmjit_la_DEPENDENCIES) 
1514 1519
 	$(AM_V_CXXLD)$(CXXLINK) $(am_libllvmjit_la_rpath) $(libllvmjit_la_OBJECTS) $(libllvmjit_la_LIBADD) $(LIBS)
1520
+
1515 1521
 libllvmpowerpccodegen.la: $(libllvmpowerpccodegen_la_OBJECTS) $(libllvmpowerpccodegen_la_DEPENDENCIES) $(EXTRA_libllvmpowerpccodegen_la_DEPENDENCIES) 
1516 1522
 	$(AM_V_CXXLD)$(CXXLINK) $(am_libllvmpowerpccodegen_la_rpath) $(libllvmpowerpccodegen_la_OBJECTS) $(libllvmpowerpccodegen_la_LIBADD) $(LIBS)
1523
+
1517 1524
 libllvmsystem.la: $(libllvmsystem_la_OBJECTS) $(libllvmsystem_la_DEPENDENCIES) $(EXTRA_libllvmsystem_la_DEPENDENCIES) 
1518 1525
 	$(AM_V_CXXLD)$(libllvmsystem_la_LINK) $(am_libllvmsystem_la_rpath) $(libllvmsystem_la_OBJECTS) $(libllvmsystem_la_LIBADD) $(LIBS)
1526
+
1519 1527
 libllvmx86codegen.la: $(libllvmx86codegen_la_OBJECTS) $(libllvmx86codegen_la_DEPENDENCIES) $(EXTRA_libllvmx86codegen_la_DEPENDENCIES) 
1520 1528
 	$(AM_V_CXXLD)$(CXXLINK) $(am_libllvmx86codegen_la_rpath) $(libllvmx86codegen_la_OBJECTS) $(libllvmx86codegen_la_LIBADD) $(LIBS)
1521 1529
 
... ...
@@ -1527,6 +1618,7 @@ clean-noinstPROGRAMS:
1527 1527
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
1528 1528
 	echo " rm -f" $$list; \
1529 1529
 	rm -f $$list
1530
+
1530 1531
 tblgen$(EXEEXT): $(tblgen_OBJECTS) $(tblgen_DEPENDENCIES) $(EXTRA_tblgen_DEPENDENCIES) 
1531 1532
 	@rm -f tblgen$(EXEEXT)
1532 1533
 	$(AM_V_CXXLD)$(tblgen_LINK) $(tblgen_OBJECTS) $(tblgen_LDADD) $(LIBS)
... ...
@@ -1937,14 +2029,14 @@ distclean-compile:
1937 1937
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
1938 1938
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
1939 1939
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1940
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
1940
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
1941 1941
 
1942 1942
 .c.obj:
1943 1943
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
1944 1944
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
1945 1945
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
1946 1946
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1947
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
1947
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
1948 1948
 
1949 1949
 .c.lo:
1950 1950
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -5392,26 +5484,15 @@ clean-libtool:
5392 5392
 distclean-libtool:
5393 5393
 	-rm -f libtool config.lt
5394 5394
 
5395
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
5396
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
5397
-	unique=`for i in $$list; do \
5398
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
5399
-	  done | \
5400
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
5401
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
5402
-	mkid -fID $$unique
5403
-tags: TAGS
5404
-
5405
-TAGS:  $(HEADERS) $(SOURCES) clamavcxx-config.h.in $(TAGS_DEPENDENCIES) \
5406
-		$(TAGS_FILES) $(LISP)
5395
+ID: $(am__tagged_files)
5396
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
5397
+tags: tags-am
5398
+TAGS: tags
5399
+
5400
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
5407 5401
 	set x; \
5408 5402
 	here=`pwd`; \
5409
-	list='$(SOURCES) $(HEADERS) clamavcxx-config.h.in $(LISP) $(TAGS_FILES)'; \
5410
-	unique=`for i in $$list; do \
5411
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
5412
-	  done | \
5413
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
5414
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
5403
+	$(am__define_uniq_tagged_files); \
5415 5404
 	shift; \
5416 5405
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
5417 5406
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -5423,15 +5504,11 @@ TAGS:  $(HEADERS) $(SOURCES) clamavcxx-config.h.in $(TAGS_DEPENDENCIES) \
5423 5423
 	      $$unique; \
5424 5424
 	  fi; \
5425 5425
 	fi
5426
-ctags: CTAGS
5427
-CTAGS:  $(HEADERS) $(SOURCES) clamavcxx-config.h.in $(TAGS_DEPENDENCIES) \
5428
-		$(TAGS_FILES) $(LISP)
5429
-	list='$(SOURCES) $(HEADERS) clamavcxx-config.h.in $(LISP) $(TAGS_FILES)'; \
5430
-	unique=`for i in $$list; do \
5431
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
5432
-	  done | \
5433
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
5434
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
5426
+ctags: ctags-am
5427
+
5428
+CTAGS: ctags
5429
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
5430
+	$(am__define_uniq_tagged_files); \
5435 5431
 	test -z "$(CTAGS_ARGS)$$unique" \
5436 5432
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
5437 5433
 	     $$unique
... ...
@@ -5440,9 +5517,31 @@ GTAGS:
5440 5440
 	here=`$(am__cd) $(top_builddir) && pwd` \
5441 5441
 	  && $(am__cd) $(top_srcdir) \
5442 5442
 	  && gtags -i $(GTAGS_ARGS) "$$here"
5443
+cscope: cscope.files
5444
+	test ! -s cscope.files \
5445
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
5446
+clean-cscope:
5447
+	-rm -f cscope.files
5448
+cscope.files: clean-cscope cscopelist
5449
+cscopelist: cscopelist-am
5450
+
5451
+cscopelist-am: $(am__tagged_files)
5452
+	list='$(am__tagged_files)'; \
5453
+	case "$(srcdir)" in \
5454
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
5455
+	  *) sdir=$(subdir)/$(srcdir) ;; \
5456
+	esac; \
5457
+	for i in $$list; do \
5458
+	  if test -f "$$i"; then \
5459
+	    echo "$(subdir)/$$i"; \
5460
+	  else \
5461
+	    echo "$$sdir/$$i"; \
5462
+	  fi; \
5463
+	done >> $(top_builddir)/cscope.files
5443 5464
 
5444 5465
 distclean-tags:
5445 5466
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
5467
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
5446 5468
 
5447 5469
 distdir: $(DISTFILES)
5448 5470
 	$(am__remove_distdir)
... ...
@@ -5488,40 +5587,42 @@ distdir: $(DISTFILES)
5488 5488
 	|| chmod -R a+r "$(distdir)"
5489 5489
 dist-gzip: distdir
5490 5490
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
5491
-	$(am__remove_distdir)
5491
+	$(am__post_remove_distdir)
5492 5492
 
5493 5493
 dist-bzip2: distdir
5494 5494
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
5495
-	$(am__remove_distdir)
5495
+	$(am__post_remove_distdir)
5496 5496
 
5497 5497
 dist-lzip: distdir
5498 5498
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
5499
-	$(am__remove_distdir)
5500
-
5501
-dist-lzma: distdir
5502
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
5503
-	$(am__remove_distdir)
5499
+	$(am__post_remove_distdir)
5504 5500
 
5505 5501
 dist-xz: distdir
5506 5502
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
5507
-	$(am__remove_distdir)
5503
+	$(am__post_remove_distdir)
5508 5504
 
5509 5505
 dist-tarZ: distdir
5506
+	@echo WARNING: "Support for shar distribution archives is" \
5507
+	               "deprecated." >&2
5508
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
5510 5509
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
5511
-	$(am__remove_distdir)
5510
+	$(am__post_remove_distdir)
5512 5511
 
5513 5512
 dist-shar: distdir
5513
+	@echo WARNING: "Support for distribution archives compressed with" \
5514
+		       "legacy program 'compress' is deprecated." >&2
5515
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
5514 5516
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
5515
-	$(am__remove_distdir)
5517
+	$(am__post_remove_distdir)
5516 5518
 
5517 5519
 dist-zip: distdir
5518 5520
 	-rm -f $(distdir).zip
5519 5521
 	zip -rq $(distdir).zip $(distdir)
5520
-	$(am__remove_distdir)
5522
+	$(am__post_remove_distdir)
5521 5523
 
5522
-dist dist-all: distdir
5523
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
5524
-	$(am__remove_distdir)
5524
+dist dist-all:
5525
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
5526
+	$(am__post_remove_distdir)
5525 5527
 
5526 5528
 # This target untars the dist file and tries a VPATH configuration.  Then
5527 5529
 # it guarantees that the distribution is self-contained by making another
... ...
@@ -5532,8 +5633,6 @@ distcheck: dist
5532 5532
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
5533 5533
 	*.tar.bz2*) \
5534 5534
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
5535
-	*.tar.lzma*) \
5536
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
5537 5535
 	*.tar.lz*) \
5538 5536
 	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
5539 5537
 	*.tar.xz*) \
... ...
@@ -5545,9 +5644,9 @@ distcheck: dist
5545 5545
 	*.zip*) \
5546 5546
 	  unzip $(distdir).zip ;;\
5547 5547
 	esac
5548
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
5549
-	mkdir $(distdir)/_build
5550
-	mkdir $(distdir)/_inst
5548
+	chmod -R a-w $(distdir)
5549
+	chmod u+w $(distdir)
5550
+	mkdir $(distdir)/_build $(distdir)/_inst
5551 5551
 	chmod a-w $(distdir)
5552 5552
 	test -d $(distdir)/_build || exit 0; \
5553 5553
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
... ...
@@ -5579,7 +5678,7 @@ distcheck: dist
5579 5579
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
5580 5580
 	  && cd "$$am__cwd" \
5581 5581
 	  || exit 1
5582
-	$(am__remove_distdir)
5582
+	$(am__post_remove_distdir)
5583 5583
 	@(echo "$(distdir) archives ready for distribution: "; \
5584 5584
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
5585 5585
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
... ...
@@ -5724,23 +5823,23 @@ uninstall-am:
5724 5724
 
5725 5725
 .MAKE: all check install install-am install-strip
5726 5726
 
5727
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
5728
-	clean-generic clean-libtool clean-local \
5729
-	clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags dist \
5730
-	dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma \
5731
-	dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
5732
-	distclean-compile distclean-generic distclean-hdr \
5733
-	distclean-libtool distclean-local distclean-tags \
5734
-	distcleancheck distdir distuninstallcheck dvi dvi-am html \
5735
-	html-am info info-am install install-am install-data \
5736
-	install-data-am install-dvi install-dvi-am install-exec \
5737
-	install-exec-am install-html install-html-am install-info \
5738
-	install-info-am install-man install-pdf install-pdf-am \
5739
-	install-ps install-ps-am install-strip installcheck \
5740
-	installcheck-am installdirs maintainer-clean \
5741
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
5742
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
5743
-	tags uninstall uninstall-am
5727
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
5728
+	clean-cscope clean-generic clean-libtool clean-local \
5729
+	clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscope \
5730
+	cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
5731
+	dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
5732
+	dist-zip distcheck distclean distclean-compile \
5733
+	distclean-generic distclean-hdr distclean-libtool \
5734
+	distclean-local distclean-tags distcleancheck distdir \
5735
+	distuninstallcheck dvi dvi-am html html-am info info-am \
5736
+	install install-am install-data install-data-am install-dvi \
5737
+	install-dvi-am install-exec install-exec-am install-html \
5738
+	install-html-am install-info install-info-am install-man \
5739
+	install-pdf install-pdf-am install-ps install-ps-am \
5740
+	install-strip installcheck installcheck-am installdirs \
5741
+	maintainer-clean maintainer-clean-generic mostlyclean \
5742
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
5743
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am
5744 5744
 
5745 5745
 
5746 5746
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@llvm/include/llvm/Intrinsics.gen: llvm/include/llvm/Intrinsics.td $(TBLGEN)
... ...
@@ -16,15 +16,19 @@
16 16
 #ifndef _WIN32
17 17
 
18 18
 #include "llvm/Analysis/ConstantFolding.h"
19
-#include "llvm/Analysis/Dominators.h"
20 19
 #include "llvm/Analysis/LoopInfo.h"
21 20
 #include "llvm/Analysis/MemoryBuiltins.h"
22 21
 #include "llvm/Analysis/ValueTracking.h"
23 22
 #include "PointerTracking.h"
24 23
 #include "llvm/Analysis/ScalarEvolution.h"
25 24
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
25
+#if LLVM_VERSION < 35
26 26
 #include "llvm/Support/CallSite.h"
27 27
 #include "llvm/Support/InstIterator.h"
28
+#else
29
+#include "llvm/IR/CallSite.h"
30
+#include "llvm/IR/InstIterator.h"
31
+#endif
28 32
 #include "llvm/Support/raw_ostream.h"
29 33
 #include "llvm/Target/TargetLibraryInfo.h"
30 34
 
... ...
@@ -55,23 +59,31 @@ static Value *GetUnderlyingObject(Value *P, TargetData *TD)
55 55
 }
56 56
 #endif
57 57
 
58
-#if LLVM_VERSION >= 30
58
+#if LLVM_VERSION >= 29
59 59
 namespace llvm {
60 60
     void initializePointerTrackingPass(llvm::PassRegistry&);
61 61
 };
62 62
 INITIALIZE_PASS_BEGIN(PointerTracking, "pointertracking",
63 63
                 "Track pointer bounds", false, true)
64
+#if LLVM_VERSION < 35
64 65
 INITIALIZE_PASS_DEPENDENCY(DominatorTree)
66
+#else
67
+INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
68
+#endif
65 69
 INITIALIZE_PASS_DEPENDENCY(LoopInfo)
66 70
 INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
71
+#if LLVM_VERSION < 35
67 72
 INITIALIZE_PASS_DEPENDENCY(DominatorTree)
73
+#else
74
+INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
75
+#endif
68 76
 INITIALIZE_PASS_END(PointerTracking, "pointertracking",
69 77
                 "Track pointer bounds", false, true)
70 78
 #endif
71 79
 
72 80
 char PointerTracking::ID = 0;
73 81
 PointerTracking::PointerTracking() : FunctionPass(ID) {
74
-#if LLVM_VERSION >= 30
82
+#if LLVM_VERSION >= 29
75 83
     initializePointerTrackingPass(*PassRegistry::getPassRegistry());
76 84
 #endif
77 85
 }
... ...
@@ -82,17 +94,28 @@ bool PointerTracking::runOnFunction(Function &F) {
82 82
   FF = &F;
83 83
 #if LLVM_VERSION < 32
84 84
   TD = getAnalysisIfAvailable<TargetData>();
85
-#else
85
+#elif LLVM_VERSION < 35
86 86
   TD = getAnalysisIfAvailable<DataLayout>();
87
+#else
88
+  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
89
+  TD = DLP ? &DLP->getDataLayout() : 0;
87 90
 #endif
88 91
   SE = &getAnalysis<ScalarEvolution>();
89 92
   LI = &getAnalysis<LoopInfo>();
93
+#if LLVM_VERSION < 35
90 94
   DT = &getAnalysis<DominatorTree>();
95
+#else
96
+  DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
97
+#endif
91 98
   return false;
92 99
 }
93 100
 
94 101
 void PointerTracking::getAnalysisUsage(AnalysisUsage &AU) const {
102
+#if LLVM_VERSION < 35
95 103
   AU.addRequiredTransitive<DominatorTree>();
104
+#else
105
+  AU.addRequiredTransitive<DominatorTreeWrapperPass>();
106
+#endif
96 107
   AU.addRequiredTransitive<LoopInfo>();
97 108
   AU.addRequiredTransitive<ScalarEvolution>();
98 109
   AU.setPreservesAll();
... ...
@@ -28,9 +28,15 @@
28 28
 #define LLVM_ANALYSIS_POINTERTRACKING_H
29 29
 
30 30
 #include "llvm/ADT/SmallPtrSet.h"
31
+#if LLVM_VERSION < 35
31 32
 #include "llvm/Analysis/Dominators.h"
32
-#include "llvm/Pass.h"
33 33
 #include "llvm/Support/PredIteratorCache.h"
34
+#else
35
+#include "llvm/IR/Dominators.h"
36
+#include "llvm/IR/PredIteratorCache.h"
37
+#include "llvm/IR/DataLayout.h"
38
+#endif
39
+#include "llvm/Pass.h"
34 40
 #include "llvm30_compat.h"
35 41
 
36 42
 #if LLVM_VERSION < 33
... ...
@@ -59,7 +65,7 @@ namespace llvm {
59 59
     Unknown // it can sometimes be true, sometimes false, or it is undecided
60 60
   };
61 61
 
62
-#if LLVM_VERSION >= 30
62
+#if LLVM_VERSION >= 29
63 63
   void initializePointerTrackingPass(PassRegistry&);
64 64
 #endif
65 65
 
... ...
@@ -117,8 +123,10 @@ namespace llvm {
117 117
     Function *FF;
118 118
 #if LLVM_VERSION < 32
119 119
     TargetData *TD;
120
-#else
120
+#elif LLVM_VERSION < 35
121 121
     DataLayout *TD;
122
+#else
123
+    const DataLayout *TD;
122 124
 #endif
123 125
     ScalarEvolution *SE;
124 126
     LoopInfo *LI;
... ...
@@ -1,8 +1,7 @@
1
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
1
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
2
+
3
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
2 4
 
3
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5
-# Inc.
6 5
 # This file is free software; the Free Software Foundation
7 6
 # gives unlimited permission to copy and/or distribute it,
8 7
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -12,33 +11,31 @@
12 12
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 13
 # PARTICULAR PURPOSE.
14 14
 
15
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 16
 m4_ifndef([AC_AUTOCONF_VERSION],
16 17
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18
-[m4_warning([this file was generated for autoconf 2.68.
18
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
19
+[m4_warning([this file was generated for autoconf 2.69.
19 20
 You have another version of autoconf.  It may work, but is not guaranteed to.
20 21
 If you have problems, you may need to regenerate the build system entirely.
21
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22 23
 
23
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24
-# Foundation, Inc.
24
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
25 25
 #
26 26
 # This file is free software; the Free Software Foundation
27 27
 # gives unlimited permission to copy and/or distribute it,
28 28
 # with or without modifications, as long as this notice is preserved.
29 29
 
30
-# serial 1
31
-
32 30
 # AM_AUTOMAKE_VERSION(VERSION)
33 31
 # ----------------------------
34 32
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
35 33
 # generated from the m4 files accompanying Automake X.Y.
36 34
 # (This private macro should not be called outside this file.)
37 35
 AC_DEFUN([AM_AUTOMAKE_VERSION],
38
-[am__api_version='1.11'
36
+[am__api_version='1.14'
39 37
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40 38
 dnl require some minimum version.  Point them to the right macro.
41
-m4_if([$1], [1.11.3], [],
39
+m4_if([$1], [1.14], [],
42 40
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43 41
 ])
44 42
 
... ...
@@ -54,24 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
54 54
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55 55
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56 56
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
57
+[AM_AUTOMAKE_VERSION([1.14])dnl
58 58
 m4_ifndef([AC_AUTOCONF_VERSION],
59 59
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60 60
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
61 61
 
62 62
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
63 63
 
64
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
64
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
65 65
 #
66 66
 # This file is free software; the Free Software Foundation
67 67
 # gives unlimited permission to copy and/or distribute it,
68 68
 # with or without modifications, as long as this notice is preserved.
69 69
 
70
-# serial 1
71
-
72 70
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
74
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
71
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
72
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
75 73
 #
76 74
 # Of course, Automake must honor this variable whenever it calls a
77 75
 # tool from the auxiliary directory.  The problem is that $srcdir (and
... ...
@@ -90,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
90 90
 #
91 91
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92 92
 # are both prefixed by $srcdir.  In an in-source build this is usually
93
-# harmless because $srcdir is `.', but things will broke when you
93
+# harmless because $srcdir is '.', but things will broke when you
94 94
 # start a VPATH build or use an absolute $srcdir.
95 95
 #
96 96
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
... ...
@@ -116,22 +111,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
116 116
 
117 117
 # AM_CONDITIONAL                                            -*- Autoconf -*-
118 118
 
119
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120
-# Free Software Foundation, Inc.
119
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
121 120
 #
122 121
 # This file is free software; the Free Software Foundation
123 122
 # gives unlimited permission to copy and/or distribute it,
124 123
 # with or without modifications, as long as this notice is preserved.
125 124
 
126
-# serial 9
127
-
128 125
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
129 126
 # -------------------------------------
130 127
 # Define a conditional.
131 128
 AC_DEFUN([AM_CONDITIONAL],
132
-[AC_PREREQ(2.52)dnl
133
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
134
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129
+[AC_PREREQ([2.52])dnl
130
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
131
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135 132
 AC_SUBST([$1_TRUE])dnl
136 133
 AC_SUBST([$1_FALSE])dnl
137 134
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
... ...
@@ -150,16 +142,14 @@ AC_CONFIG_COMMANDS_PRE(
150 150
 Usually this means the macro was only invoked conditionally.]])
151 151
 fi])])
152 152
 
153
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
154
-# 2010, 2011 Free Software Foundation, Inc.
153
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
155 154
 #
156 155
 # This file is free software; the Free Software Foundation
157 156
 # gives unlimited permission to copy and/or distribute it,
158 157
 # with or without modifications, as long as this notice is preserved.
159 158
 
160
-# serial 12
161 159
 
162
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
160
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
163 161
 # written in clear, in which case automake, when reading aclocal.m4,
164 162
 # will think it sees a *use*, and therefore will trigger all it's
165 163
 # C support machinery.  Also note that it means that autoscan, seeing
... ...
@@ -169,7 +159,7 @@ fi])])
169 169
 # _AM_DEPENDENCIES(NAME)
170 170
 # ----------------------
171 171
 # See how the compiler implements dependency checking.
172
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
172
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
173 173
 # We try a few techniques and use that to set a single cache variable.
174 174
 #
175 175
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
... ...
@@ -182,12 +172,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
182 182
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
183 183
 AC_REQUIRE([AM_DEP_TRACK])dnl
184 184
 
185
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
186
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
187
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
189
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
190
-                   [depcc="$$1"   am_compiler_list=])
185
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
186
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
187
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
189
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
190
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
191
+                    [depcc="$$1"   am_compiler_list=])
191 192
 
192 193
 AC_CACHE_CHECK([dependency style of $depcc],
193 194
                [am_cv_$1_dependencies_compiler_type],
... ...
@@ -195,8 +186,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
195 195
   # We make a subdir and do the tests there.  Otherwise we can end up
196 196
   # making bogus files that we don't know about and never remove.  For
197 197
   # instance it was reported that on HP-UX the gcc test will end up
198
-  # making a dummy file named `D' -- because `-MD' means `put the output
199
-  # in D'.
198
+  # making a dummy file named 'D' -- because '-MD' means "put the output
199
+  # in D".
200 200
   rm -rf conftest.dir
201 201
   mkdir conftest.dir
202 202
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -236,16 +227,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
236 236
     : > sub/conftest.c
237 237
     for i in 1 2 3 4 5 6; do
238 238
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
239
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
240
-      # Solaris 8's {/usr,}/bin/sh.
241
-      touch sub/conftst$i.h
239
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
240
+      # Solaris 10 /bin/sh.
241
+      echo '/* dummy */' > sub/conftst$i.h
242 242
     done
243 243
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
244 244
 
245
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
245
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
246 246
     # mode.  It turns out that the SunPro C++ compiler does not properly
247
-    # handle `-M -o', and we need to detect this.  Also, some Intel
248
-    # versions had trouble with output in subdirs
247
+    # handle '-M -o', and we need to detect this.  Also, some Intel
248
+    # versions had trouble with output in subdirs.
249 249
     am__obj=sub/conftest.${OBJEXT-o}
250 250
     am__minus_obj="-o $am__obj"
251 251
     case $depmode in
... ...
@@ -254,8 +245,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
254 254
       test "$am__universal" = false || continue
255 255
       ;;
256 256
     nosideeffect)
257
-      # after this tag, mechanisms are not by side-effect, so they'll
258
-      # only be used when explicitly requested
257
+      # After this tag, mechanisms are not by side-effect, so they'll
258
+      # only be used when explicitly requested.
259 259
       if test "x$enable_dependency_tracking" = xyes; then
260 260
 	continue
261 261
       else
... ...
@@ -263,7 +254,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
263 263
       fi
264 264
       ;;
265 265
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
266
-      # This compiler won't grok `-c -o', but also, the minuso test has
266
+      # This compiler won't grok '-c -o', but also, the minuso test has
267 267
       # not run yet.  These depmodes are late enough in the game, and
268 268
       # so weak that their functioning should not be impacted.
269 269
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -311,7 +302,7 @@ AM_CONDITIONAL([am__fastdep$1], [
311 311
 # AM_SET_DEPDIR
312 312
 # -------------
313 313
 # Choose a directory name for dependency files.
314
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
314
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
315 315
 AC_DEFUN([AM_SET_DEPDIR],
316 316
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
317 317
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
... ...
@@ -321,9 +312,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
321 321
 # AM_DEP_TRACK
322 322
 # ------------
323 323
 AC_DEFUN([AM_DEP_TRACK],
324
-[AC_ARG_ENABLE(dependency-tracking,
325
-[  --disable-dependency-tracking  speeds up one-time build
326
-  --enable-dependency-tracking   do not reject slow dependency extractors])
324
+[AC_ARG_ENABLE([dependency-tracking], [dnl
325
+AS_HELP_STRING(
326
+  [--enable-dependency-tracking],
327
+  [do not reject slow dependency extractors])
328
+AS_HELP_STRING(
329
+  [--disable-dependency-tracking],
330
+  [speeds up one-time build])])
327 331
 if test "x$enable_dependency_tracking" != xno; then
328 332
   am_depcomp="$ac_aux_dir/depcomp"
329 333
   AMDEPBACKSLASH='\'
... ...
@@ -338,20 +333,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
338 338
 
339 339
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
340 340
 
341
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
342
-# Free Software Foundation, Inc.
341
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
343 342
 #
344 343
 # This file is free software; the Free Software Foundation
345 344
 # gives unlimited permission to copy and/or distribute it,
346 345
 # with or without modifications, as long as this notice is preserved.
347 346
 
348
-#serial 5
349 347
 
350 348
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
351 349
 # ------------------------------
352 350
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
353 351
 [{
354
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
352
+  # Older Autoconf quotes --file arguments for eval, but not when files
355 353
   # are listed without --file.  Let's play safe and only enable the eval
356 354
   # if we detect the quoting.
357 355
   case $CONFIG_FILES in
... ...
@@ -364,7 +357,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
364 364
     # Strip MF so we end up with the name of the file.
365 365
     mf=`echo "$mf" | sed -e 's/:.*$//'`
366 366
     # Check whether this is an Automake generated Makefile or not.
367
-    # We used to match only the files named `Makefile.in', but
367
+    # We used to match only the files named 'Makefile.in', but
368 368
     # some people rename them; so instead we look at the file content.
369 369
     # Grep'ing the first line is not enough: some people post-process
370 370
     # each Makefile.in and add a new line on top of each file to say so.
... ...
@@ -376,21 +369,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
376 376
       continue
377 377
     fi
378 378
     # Extract the definition of DEPDIR, am__include, and am__quote
379
-    # from the Makefile without running `make'.
379
+    # from the Makefile without running 'make'.
380 380
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381 381
     test -z "$DEPDIR" && continue
382 382
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
383
-    test -z "am__include" && continue
383
+    test -z "$am__include" && continue
384 384
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385
-    # When using ansi2knr, U may be empty or an underscore; expand it
386
-    U=`sed -n 's/^U = //p' < "$mf"`
387 385
     # Find all dependency output files, they are included files with
388 386
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
389 387
     # simplest approach to changing $(DEPDIR) to its actual value in the
390 388
     # expansion.
391 389
     for file in `sed -n "
392 390
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
393
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
391
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
394 392
       # Make sure the directory exists.
395 393
       test -f "$dirpart/$file" && continue
396 394
       fdir=`AS_DIRNAME(["$file"])`
... ...
@@ -408,7 +399,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
408 408
 # This macro should only be invoked once -- use via AC_REQUIRE.
409 409
 #
410 410
 # This code is only required when automatic dependency tracking
411
-# is enabled.  FIXME.  This creates each `.P' file that we will
411
+# is enabled.  FIXME.  This creates each '.P' file that we will
412 412
 # need in order to bootstrap the dependency handling code.
413 413
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
414 414
 [AC_CONFIG_COMMANDS([depfiles],
... ...
@@ -418,18 +409,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
418 418
 
419 419
 # Do all the work for Automake.                             -*- Autoconf -*-
420 420
 
421
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
422
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
421
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
423 422
 #
424 423
 # This file is free software; the Free Software Foundation
425 424
 # gives unlimited permission to copy and/or distribute it,
426 425
 # with or without modifications, as long as this notice is preserved.
427 426
 
428
-# serial 16
429
-
430 427
 # This macro actually does too much.  Some checks are only needed if
431 428
 # your package does certain things.  But this isn't really a big deal.
432 429
 
430
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
431
+m4_define([AC_PROG_CC],
432
+m4_defn([AC_PROG_CC])
433
+[_AM_PROG_CC_C_O
434
+])
435
+
433 436
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
434 437
 # AM_INIT_AUTOMAKE([OPTIONS])
435 438
 # -----------------------------------------------
... ...
@@ -442,7 +436,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
442 442
 # arguments mandatory, and then we can depend on a new Autoconf
443 443
 # release and drop the old call support.
444 444
 AC_DEFUN([AM_INIT_AUTOMAKE],
445
-[AC_PREREQ([2.62])dnl
445
+[AC_PREREQ([2.65])dnl
446 446
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
447 447
 dnl the ones we care about.
448 448
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
... ...
@@ -471,31 +465,40 @@ AC_SUBST([CYGPATH_W])
471 471
 # Define the identity of the package.
472 472
 dnl Distinguish between old-style and new-style calls.
473 473
 m4_ifval([$2],
474
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
474
+[AC_DIAGNOSE([obsolete],
475
+             [$0: two- and three-arguments forms are deprecated.])
476
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475 477
  AC_SUBST([PACKAGE], [$1])dnl
476 478
  AC_SUBST([VERSION], [$2])],
477 479
 [_AM_SET_OPTIONS([$1])dnl
478 480
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
481
+m4_if(
482
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
483
+  [ok:ok],,
480 484
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
481 485
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
482 486
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
483 487
 
484 488
 _AM_IF_OPTION([no-define],,
485
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
486
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
490
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
487 491
 
488 492
 # Some tools Automake needs.
489 493
 AC_REQUIRE([AM_SANITY_CHECK])dnl
490 494
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
491
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
492
-AM_MISSING_PROG(AUTOCONF, autoconf)
493
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
494
-AM_MISSING_PROG(AUTOHEADER, autoheader)
495
-AM_MISSING_PROG(MAKEINFO, makeinfo)
495
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
496
+AM_MISSING_PROG([AUTOCONF], [autoconf])
497
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
498
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
499
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
496 500
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
497 501
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
498
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
502
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
503
+# For better backward compatibility.  To be removed once Automake 1.9.x
504
+# dies out for good.  For more background, see:
505
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
506
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
507
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
499 508
 # We need awk for the "check" target.  The system "awk" is bad on
500 509
 # some platforms.
501 510
 AC_REQUIRE([AC_PROG_AWK])dnl
... ...
@@ -506,34 +509,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
506 506
 			     [_AM_PROG_TAR([v7])])])
507 507
 _AM_IF_OPTION([no-dependencies],,
508 508
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
509
-		  [_AM_DEPENDENCIES(CC)],
510
-		  [define([AC_PROG_CC],
511
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
509
+		  [_AM_DEPENDENCIES([CC])],
510
+		  [m4_define([AC_PROG_CC],
511
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
512 512
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
513
-		  [_AM_DEPENDENCIES(CXX)],
514
-		  [define([AC_PROG_CXX],
515
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
513
+		  [_AM_DEPENDENCIES([CXX])],
514
+		  [m4_define([AC_PROG_CXX],
515
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
516 516
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
517
-		  [_AM_DEPENDENCIES(OBJC)],
518
-		  [define([AC_PROG_OBJC],
519
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
517
+		  [_AM_DEPENDENCIES([OBJC])],
518
+		  [m4_define([AC_PROG_OBJC],
519
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
520
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
521
+		  [_AM_DEPENDENCIES([OBJCXX])],
522
+		  [m4_define([AC_PROG_OBJCXX],
523
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
520 524
 ])
521
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
522
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
523
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
524
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
525
+AC_REQUIRE([AM_SILENT_RULES])dnl
526
+dnl The testsuite driver may need to know about EXEEXT, so add the
527
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
528
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
525 529
 AC_CONFIG_COMMANDS_PRE(dnl
526 530
 [m4_provide_if([_AM_COMPILER_EXEEXT],
527 531
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
528
-])
529 532
 
530
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533
+# POSIX will say in a future version that running "rm -f" with no argument
534
+# is OK; and we want to be able to make that assumption in our Makefile
535
+# recipes.  So use an aggressive probe to check that the usage we want is
536
+# actually supported "in the wild" to an acceptable degree.
537
+# See automake bug#10828.
538
+# To make any issue more visible, cause the running configure to be aborted
539
+# by default if the 'rm' program in use doesn't match our expectations; the
540
+# user can still override this though.
541
+if rm -f && rm -fr && rm -rf; then : OK; else
542
+  cat >&2 <<'END'
543
+Oops!
544
+
545
+Your 'rm' program seems unable to run without file operands specified
546
+on the command line, even when the '-f' option is present.  This is contrary
547
+to the behaviour of most rm programs out there, and not conforming with
548
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
549
+
550
+Please tell bug-automake@gnu.org about your system, including the value
551
+of your $PATH and any error possibly output before this message.  This
552
+can help us improve future automake versions.
553
+
554
+END
555
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
556
+    echo 'Configuration will proceed anyway, since you have set the' >&2
557
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
558
+    echo >&2
559
+  else
560
+    cat >&2 <<'END'
561
+Aborting the configuration process, to ensure you take notice of the issue.
562
+
563
+You can download and install GNU coreutils to get an 'rm' implementation
564
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
565
+
566
+If you want to complete the configuration process using your problematic
567
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
568
+to "yes", and re-run configure.
569
+
570
+END
571
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
572
+  fi
573
+fi])
574
+
575
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
531 576
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
532 577
 dnl mangled by Autoconf and run in a shell conditional statement.
533 578
 m4_define([_AC_COMPILER_EXEEXT],
534 579
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
535 580
 
536
-
537 581
 # When config.status generates a header, we must update the stamp-h file.
538 582
 # This file resides in the same directory as the config header
539 583
 # that is generated.  The stamp files are numbered to have different names.
... ...
@@ -555,15 +602,12 @@ for _am_header in $config_headers :; do
555 555
 done
556 556
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
557 557
 
558
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
559
-# Inc.
558
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
560 559
 #
561 560
 # This file is free software; the Free Software Foundation
562 561
 # gives unlimited permission to copy and/or distribute it,
563 562
 # with or without modifications, as long as this notice is preserved.
564 563
 
565
-# serial 1
566
-
567 564
 # AM_PROG_INSTALL_SH
568 565
 # ------------------
569 566
 # Define $install_sh.
... ...
@@ -577,16 +621,14 @@ if test x"${install_sh}" != xset; then
577 577
     install_sh="\${SHELL} $am_aux_dir/install-sh"
578 578
   esac
579 579
 fi
580
-AC_SUBST(install_sh)])
580
+AC_SUBST([install_sh])])
581 581
 
582
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
583 583
 #
584 584
 # This file is free software; the Free Software Foundation
585 585
 # gives unlimited permission to copy and/or distribute it,
586 586
 # with or without modifications, as long as this notice is preserved.
587 587
 
588
-# serial 2
589
-
590 588
 # Check whether the underlying file-system supports filenames
591 589
 # with a leading dot.  For instance MS-DOS doesn't.
592 590
 AC_DEFUN([AM_SET_LEADING_DOT],
... ...
@@ -603,20 +645,17 @@ AC_SUBST([am__leading_dot])])
603 603
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
604 604
 # From Jim Meyering
605 605
 
606
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
607
-# 2011 Free Software Foundation, Inc.
606
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
608 607
 #
609 608
 # This file is free software; the Free Software Foundation
610 609
 # gives unlimited permission to copy and/or distribute it,
611 610
 # with or without modifications, as long as this notice is preserved.
612 611
 
613
-# serial 5
614
-
615 612
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
616 613
 # ----------------------------------
617 614
 # Control maintainer-specific portions of Makefiles.
618
-# Default is to disable them, unless `enable' is passed literally.
619
-# For symmetry, `disable' may be passed as well.  Anyway, the user
615
+# Default is to disable them, unless 'enable' is passed literally.
616
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
620 617
 # can override the default with the --enable/--disable switch.
621 618
 AC_DEFUN([AM_MAINTAINER_MODE],
622 619
 [m4_case(m4_default([$1], [disable]),
... ...
@@ -627,10 +666,11 @@ AC_DEFUN([AM_MAINTAINER_MODE],
627 627
 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
628 628
   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
629 629
   AC_ARG_ENABLE([maintainer-mode],
630
-[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
631
-			  (and sometimes confusing) to the casual installer],
632
-      [USE_MAINTAINER_MODE=$enableval],
633
-      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
630
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
631
+      am_maintainer_other[ make rules and dependencies not useful
632
+      (and sometimes confusing) to the casual installer])],
633
+    [USE_MAINTAINER_MODE=$enableval],
634
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
634 635
   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
635 636
   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
636 637
   MAINT=$MAINTAINER_MODE_TRUE
... ...
@@ -638,18 +678,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
638 638
 ]
639 639
 )
640 640
 
641
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
642
-
643 641
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
644 642
 
645
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
643
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
646 644
 #
647 645
 # This file is free software; the Free Software Foundation
648 646
 # gives unlimited permission to copy and/or distribute it,
649 647
 # with or without modifications, as long as this notice is preserved.
650 648
 
651
-# serial 4
652
-
653 649
 # AM_MAKE_INCLUDE()
654 650
 # -----------------
655 651
 # Check to see how make treats includes.
... ...
@@ -667,7 +703,7 @@ am__quote=
667 667
 _am_result=none
668 668
 # First try GNU make style include.
669 669
 echo "include confinc" > confmf
670
-# Ignore all kinds of additional output from `make'.
670
+# Ignore all kinds of additional output from 'make'.
671 671
 case `$am_make -s -f confmf 2> /dev/null` in #(
672 672
 *the\ am__doit\ target*)
673 673
   am__include=include
... ...
@@ -694,15 +730,12 @@ rm -f confinc confmf
694 694
 
695 695
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
696 696
 
697
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
698
-# Free Software Foundation, Inc.
697
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
699 698
 #
700 699
 # This file is free software; the Free Software Foundation
701 700
 # gives unlimited permission to copy and/or distribute it,
702 701
 # with or without modifications, as long as this notice is preserved.
703 702
 
704
-# serial 6
705
-
706 703
 # AM_MISSING_PROG(NAME, PROGRAM)
707 704
 # ------------------------------
708 705
 AC_DEFUN([AM_MISSING_PROG],
... ...
@@ -710,11 +743,10 @@ AC_DEFUN([AM_MISSING_PROG],
710 710
 $1=${$1-"${am_missing_run}$2"}
711 711
 AC_SUBST($1)])
712 712
 
713
-
714 713
 # AM_MISSING_HAS_RUN
715 714
 # ------------------
716
-# Define MISSING if not defined so far and test if it supports --run.
717
-# If it does, set am_missing_run to use it, otherwise, to nothing.
715
+# Define MISSING if not defined so far and test if it is modern enough.
716
+# If it is, set am_missing_run to use it, otherwise, to nothing.
718 717
 AC_DEFUN([AM_MISSING_HAS_RUN],
719 718
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
720 719
 AC_REQUIRE_AUX_FILE([missing])dnl
... ...
@@ -727,54 +759,22 @@ if test x"${MISSING+set}" != xset; then
727 727
   esac
728 728
 fi
729 729
 # Use eval to expand $SHELL
730
-if eval "$MISSING --run true"; then
731
-  am_missing_run="$MISSING --run "
730
+if eval "$MISSING --is-lightweight"; then
731
+  am_missing_run="$MISSING "
732 732
 else
733 733
   am_missing_run=
734
-  AC_MSG_WARN([`missing' script is too old or missing])
734
+  AC_MSG_WARN(['missing' script is too old or missing])
735 735
 fi
736 736
 ])
737 737
 
738
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
739
-# Inc.
740
-#
741
-# This file is free software; the Free Software Foundation
742
-# gives unlimited permission to copy and/or distribute it,
743
-# with or without modifications, as long as this notice is preserved.
744
-
745
-# serial 1
746
-
747
-# AM_PROG_MKDIR_P
748
-# ---------------
749
-# Check for `mkdir -p'.
750
-AC_DEFUN([AM_PROG_MKDIR_P],
751
-[AC_PREREQ([2.60])dnl
752
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
753
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
754
-dnl while keeping a definition of mkdir_p for backward compatibility.
755
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
756
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
757
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
758
-dnl adjustment using top_builddir (which is defined more often than
759
-dnl MKDIR_P).
760
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
761
-case $mkdir_p in
762
-  [[\\/$]]* | ?:[[\\/]]*) ;;
763
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
764
-esac
765
-])
766
-
767 738
 # Helper functions for option handling.                     -*- Autoconf -*-
768 739
 
769
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
770
-# Foundation, Inc.
740
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
771 741
 #
772 742
 # This file is free software; the Free Software Foundation
773 743
 # gives unlimited permission to copy and/or distribute it,
774 744
 # with or without modifications, as long as this notice is preserved.
775 745
 
776
-# serial 5
777
-
778 746
 # _AM_MANGLE_OPTION(NAME)
779 747
 # -----------------------
780 748
 AC_DEFUN([_AM_MANGLE_OPTION],
... ...
@@ -784,7 +784,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
784 784
 # --------------------
785 785
 # Set option NAME.  Presently that only means defining a flag for this option.
786 786
 AC_DEFUN([_AM_SET_OPTION],
787
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
787
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
788 788
 
789 789
 # _AM_SET_OPTIONS(OPTIONS)
790 790
 # ------------------------
... ...
@@ -798,13 +798,58 @@ AC_DEFUN([_AM_SET_OPTIONS],
798 798
 AC_DEFUN([_AM_IF_OPTION],
799 799
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
800 800
 
801
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
801
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
802 802
 #
803 803
 # This file is free software; the Free Software Foundation
804 804
 # gives unlimited permission to copy and/or distribute it,
805 805
 # with or without modifications, as long as this notice is preserved.
806 806
 
807
-# serial 1
807
+# _AM_PROG_CC_C_O
808
+# ---------------
809
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
810
+# to automatically call this.
811
+AC_DEFUN([_AM_PROG_CC_C_O],
812
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
813
+AC_REQUIRE_AUX_FILE([compile])dnl
814
+AC_LANG_PUSH([C])dnl
815
+AC_CACHE_CHECK(
816
+  [whether $CC understands -c and -o together],
817
+  [am_cv_prog_cc_c_o],
818
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
819
+  # Make sure it works both with $CC and with simple cc.
820
+  # Following AC_PROG_CC_C_O, we do the test twice because some
821
+  # compilers refuse to overwrite an existing .o file with -o,
822
+  # though they will create one.
823
+  am_cv_prog_cc_c_o=yes
824
+  for am_i in 1 2; do
825
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
826
+         && test -f conftest2.$ac_objext; then
827
+      : OK
828
+    else
829
+      am_cv_prog_cc_c_o=no
830
+      break
831
+    fi
832
+  done
833
+  rm -f core conftest*
834
+  unset am_i])
835
+if test "$am_cv_prog_cc_c_o" != yes; then
836
+   # Losing compiler, so override with the script.
837
+   # FIXME: It is wrong to rewrite CC.
838
+   # But if we don't then we get into trouble of one sort or another.
839
+   # A longer-term fix would be to have automake use am__CC in this case,
840
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
841
+   CC="$am_aux_dir/compile $CC"
842
+fi
843
+AC_LANG_POP([C])])
844
+
845
+# For backward compatibility.
846
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
847
+
848
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
849
+#
850
+# This file is free software; the Free Software Foundation
851
+# gives unlimited permission to copy and/or distribute it,
852
+# with or without modifications, as long as this notice is preserved.
808 853
 
809 854
 # AM_RUN_LOG(COMMAND)
810 855
 # -------------------
... ...
@@ -819,22 +864,16 @@ AC_DEFUN([AM_RUN_LOG],
819 819
 
820 820
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
821 821
 
822
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
823
-# Free Software Foundation, Inc.
822
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
824 823
 #
825 824
 # This file is free software; the Free Software Foundation
826 825
 # gives unlimited permission to copy and/or distribute it,
827 826
 # with or without modifications, as long as this notice is preserved.
828 827
 
829
-# serial 5
830
-
831 828
 # AM_SANITY_CHECK
832 829
 # ---------------
833 830
 AC_DEFUN([AM_SANITY_CHECK],
834 831
 [AC_MSG_CHECKING([whether build environment is sane])
835
-# Just in case
836
-sleep 1
837
-echo timestamp > conftest.file
838 832
 # Reject unsafe characters in $srcdir or the absolute working directory
839 833
 # name.  Accept space and tab only in the latter.
840 834
 am_lf='
... ...
@@ -845,32 +884,40 @@ case `pwd` in
845 845
 esac
846 846
 case $srcdir in
847 847
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
848
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
848
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
849 849
 esac
850 850
 
851
-# Do `set' in a subshell so we don't clobber the current shell's
851
+# Do 'set' in a subshell so we don't clobber the current shell's
852 852
 # arguments.  Must try -L first in case configure is actually a
853 853
 # symlink; some systems play weird games with the mod time of symlinks
854 854
 # (eg FreeBSD returns the mod time of the symlink's containing
855 855
 # directory).
856 856
 if (
857
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
858
-   if test "$[*]" = "X"; then
859
-      # -L didn't work.
860
-      set X `ls -t "$srcdir/configure" conftest.file`
861
-   fi
862
-   rm -f conftest.file
863
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
864
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
865
-
866
-      # If neither matched, then we have a broken ls.  This can happen
867
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
868
-      # broken ls alias from the environment.  This has actually
869
-      # happened.  Such a system could not be considered "sane".
870
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
871
-alias in your environment])
872
-   fi
873
-
857
+   am_has_slept=no
858
+   for am_try in 1 2; do
859
+     echo "timestamp, slept: $am_has_slept" > conftest.file
860
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
861
+     if test "$[*]" = "X"; then
862
+	# -L didn't work.
863
+	set X `ls -t "$srcdir/configure" conftest.file`
864
+     fi
865
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
866
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
867
+
868
+	# If neither matched, then we have a broken ls.  This can happen
869
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
870
+	# broken ls alias from the environment.  This has actually
871
+	# happened.  Such a system could not be considered "sane".
872
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
873
+  alias in your environment])
874
+     fi
875
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
876
+       break
877
+     fi
878
+     # Just in case.
879
+     sleep 1
880
+     am_has_slept=yes
881
+   done
874 882
    test "$[2]" = conftest.file
875 883
    )
876 884
 then
... ...
@@ -880,31 +927,50 @@ else
880 880
    AC_MSG_ERROR([newly created file is older than distributed files!
881 881
 Check your system clock])
882 882
 fi
883
-AC_MSG_RESULT(yes)])
883
+AC_MSG_RESULT([yes])
884
+# If we didn't sleep, we still need to ensure time stamps of config.status and
885
+# generated files are strictly newer.
886
+am_sleep_pid=
887
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
888
+  ( sleep 1 ) &
889
+  am_sleep_pid=$!
890
+fi
891
+AC_CONFIG_COMMANDS_PRE(
892
+  [AC_MSG_CHECKING([that generated files are newer than configure])
893
+   if test -n "$am_sleep_pid"; then
894
+     # Hide warnings about reused PIDs.
895
+     wait $am_sleep_pid 2>/dev/null
896
+   fi
897
+   AC_MSG_RESULT([done])])
898
+rm -f conftest.file
899
+])
884 900
 
885
-# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
901
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
886 902
 #
887 903
 # This file is free software; the Free Software Foundation
888 904
 # gives unlimited permission to copy and/or distribute it,
889 905
 # with or without modifications, as long as this notice is preserved.
890 906
 
891
-# serial 2
892
-
893 907
 # AM_SILENT_RULES([DEFAULT])
894 908
 # --------------------------
895 909
 # Enable less verbose build rules; with the default set to DEFAULT
896
-# (`yes' being less verbose, `no' or empty being verbose).
910
+# ("yes" being less verbose, "no" or empty being verbose).
897 911
 AC_DEFUN([AM_SILENT_RULES],
898
-[AC_ARG_ENABLE([silent-rules],
899
-[  --enable-silent-rules          less verbose build output (undo: `make V=1')
900
-  --disable-silent-rules         verbose build output (undo: `make V=0')])
901
-case $enable_silent_rules in
902
-yes) AM_DEFAULT_VERBOSITY=0;;
903
-no)  AM_DEFAULT_VERBOSITY=1;;
904
-*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
912
+[AC_ARG_ENABLE([silent-rules], [dnl
913
+AS_HELP_STRING(
914
+  [--enable-silent-rules],
915
+  [less verbose build output (undo: "make V=1")])
916
+AS_HELP_STRING(
917
+  [--disable-silent-rules],
918
+  [verbose build output (undo: "make V=0")])dnl
919
+])
920
+case $enable_silent_rules in @%:@ (((
921
+  yes) AM_DEFAULT_VERBOSITY=0;;
922
+   no) AM_DEFAULT_VERBOSITY=1;;
923
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
905 924
 esac
906 925
 dnl
907
-dnl A few `make' implementations (e.g., NonStop OS and NextStep)
926
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
908 927
 dnl do not support nested variable expansions.
909 928
 dnl See automake bug#9928 and bug#10237.
910 929
 am_make=${MAKE-make}
... ...
@@ -922,7 +988,7 @@ else
922 922
   am_cv_make_support_nested_variables=no
923 923
 fi])
924 924
 if test $am_cv_make_support_nested_variables = yes; then
925
-  dnl Using `$V' instead of `$(V)' breaks IRIX make.
925
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
926 926
   AM_V='$(V)'
927 927
   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
928 928
 else
... ...
@@ -939,44 +1005,40 @@ AC_SUBST([AM_BACKSLASH])dnl
939 939
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
940 940
 ])
941 941
 
942
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
942
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
943 943
 #
944 944
 # This file is free software; the Free Software Foundation
945 945
 # gives unlimited permission to copy and/or distribute it,
946 946
 # with or without modifications, as long as this notice is preserved.
947 947
 
948
-# serial 1
949
-
950 948
 # AM_PROG_INSTALL_STRIP
951 949
 # ---------------------
952
-# One issue with vendor `install' (even GNU) is that you can't
950
+# One issue with vendor 'install' (even GNU) is that you can't
953 951
 # specify the program used to strip binaries.  This is especially
954 952
 # annoying in cross-compiling environments, where the build's strip
955 953
 # is unlikely to handle the host's binaries.
956 954
 # Fortunately install-sh will honor a STRIPPROG variable, so we
957
-# always use install-sh in `make install-strip', and initialize
955
+# always use install-sh in "make install-strip", and initialize
958 956
 # STRIPPROG with the value of the STRIP variable (set by the user).
959 957
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
960 958
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
961
-# Installed binaries are usually stripped using `strip' when the user
962
-# run `make install-strip'.  However `strip' might not be the right
959
+# Installed binaries are usually stripped using 'strip' when the user
960
+# run "make install-strip".  However 'strip' might not be the right
963 961
 # tool to use in cross-compilation environments, therefore Automake
964
-# will honor the `STRIP' environment variable to overrule this program.
965
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
962
+# will honor the 'STRIP' environment variable to overrule this program.
963
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
966 964
 if test "$cross_compiling" != no; then
967 965
   AC_CHECK_TOOL([STRIP], [strip], :)
968 966
 fi
969 967
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
970 968
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
971 969
 
972
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
970
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
973 971
 #
974 972
 # This file is free software; the Free Software Foundation
975 973
 # gives unlimited permission to copy and/or distribute it,
976 974
 # with or without modifications, as long as this notice is preserved.
977 975
 
978
-# serial 3
979
-
980 976
 # _AM_SUBST_NOTMAKE(VARIABLE)
981 977
 # ---------------------------
982 978
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
... ...
@@ -990,18 +1052,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
990 990
 
991 991
 # Check how to create a tarball.                            -*- Autoconf -*-
992 992
 
993
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
993
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
994 994
 #
995 995
 # This file is free software; the Free Software Foundation
996 996
 # gives unlimited permission to copy and/or distribute it,
997 997
 # with or without modifications, as long as this notice is preserved.
998 998
 
999
-# serial 2
1000
-
1001 999
 # _AM_PROG_TAR(FORMAT)
1002 1000
 # --------------------
1003 1001
 # Check how to create a tarball in format FORMAT.
1004
-# FORMAT should be one of `v7', `ustar', or `pax'.
1002
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1005 1003
 #
1006 1004
 # Substitute a variable $(am__tar) that is a command
1007 1005
 # writing to stdout a FORMAT-tarball containing the directory
... ...
@@ -1011,76 +1071,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1011 1011
 # Substitute a variable $(am__untar) that extract such
1012 1012
 # a tarball read from stdin.
1013 1013
 #     $(am__untar) < result.tar
1014
+#
1014 1015
 AC_DEFUN([_AM_PROG_TAR],
1015 1016
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
1016 1017
 # in the wild :-(  We should find a proper way to deprecate it ...
1017 1018
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1018
-m4_if([$1], [v7],
1019
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1020
-     [m4_case([$1], [ustar],, [pax],,
1021
-              [m4_fatal([Unknown tar format])])
1022
-AC_MSG_CHECKING([how to create a $1 tar archive])
1023
-# Loop over all known methods to create a tar archive until one works.
1019
+
1020
+# We'll loop over all known methods to create a tar archive until one works.
1024 1021
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1025
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1026
-# Do not fold the above two line into one, because Tru64 sh and
1027
-# Solaris sh will not grok spaces in the rhs of `-'.
1028
-for _am_tool in $_am_tools
1029
-do
1030
-  case $_am_tool in
1031
-  gnutar)
1032
-    for _am_tar in tar gnutar gtar;
1033
-    do
1034
-      AM_RUN_LOG([$_am_tar --version]) && break
1035
-    done
1036
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1037
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1038
-    am__untar="$_am_tar -xf -"
1039
-    ;;
1040
-  plaintar)
1041
-    # Must skip GNU tar: if it does not support --format= it doesn't create
1042
-    # ustar tarball either.
1043
-    (tar --version) >/dev/null 2>&1 && continue
1044
-    am__tar='tar chf - "$$tardir"'
1045
-    am__tar_='tar chf - "$tardir"'
1046
-    am__untar='tar xf -'
1047
-    ;;
1048
-  pax)
1049
-    am__tar='pax -L -x $1 -w "$$tardir"'
1050
-    am__tar_='pax -L -x $1 -w "$tardir"'
1051
-    am__untar='pax -r'
1052
-    ;;
1053
-  cpio)
1054
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1055
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1056
-    am__untar='cpio -i -H $1 -d'
1057
-    ;;
1058
-  none)
1059
-    am__tar=false
1060
-    am__tar_=false
1061
-    am__untar=false
1062
-    ;;
1063
-  esac
1064 1022
 
1065
-  # If the value was cached, stop now.  We just wanted to have am__tar
1066
-  # and am__untar set.
1067
-  test -n "${am_cv_prog_tar_$1}" && break
1023
+m4_if([$1], [v7],
1024
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1025
+
1026
+  [m4_case([$1],
1027
+    [ustar],
1028
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1029
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1030
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1031
+      # and bug#13588).
1032
+      am_max_uid=2097151 # 2^21 - 1
1033
+      am_max_gid=$am_max_uid
1034
+      # The $UID and $GID variables are not portable, so we need to resort
1035
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1036
+      # below are definitely unexpected, so allow the users to see them
1037
+      # (that is, avoid stderr redirection).
1038
+      am_uid=`id -u || echo unknown`
1039
+      am_gid=`id -g || echo unknown`
1040
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1041
+      if test $am_uid -le $am_max_uid; then
1042
+         AC_MSG_RESULT([yes])
1043
+      else
1044
+         AC_MSG_RESULT([no])
1045
+         _am_tools=none
1046
+      fi
1047
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1048
+      if test $am_gid -le $am_max_gid; then
1049
+         AC_MSG_RESULT([yes])
1050
+      else
1051
+        AC_MSG_RESULT([no])
1052
+        _am_tools=none
1053
+      fi],
1054
+
1055
+  [pax],
1056
+    [],
1057
+
1058
+  [m4_fatal([Unknown tar format])])
1059
+
1060
+  AC_MSG_CHECKING([how to create a $1 tar archive])
1061
+
1062
+  # Go ahead even if we have the value already cached.  We do so because we
1063
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
1064
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1065
+
1066
+  for _am_tool in $_am_tools; do
1067
+    case $_am_tool in
1068
+    gnutar)
1069
+      for _am_tar in tar gnutar gtar; do
1070
+        AM_RUN_LOG([$_am_tar --version]) && break
1071
+      done
1072
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1073
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1074
+      am__untar="$_am_tar -xf -"
1075
+      ;;
1076
+    plaintar)
1077
+      # Must skip GNU tar: if it does not support --format= it doesn't create
1078
+      # ustar tarball either.
1079
+      (tar --version) >/dev/null 2>&1 && continue
1080
+      am__tar='tar chf - "$$tardir"'
1081
+      am__tar_='tar chf - "$tardir"'
1082
+      am__untar='tar xf -'
1083
+      ;;
1084
+    pax)
1085
+      am__tar='pax -L -x $1 -w "$$tardir"'
1086
+      am__tar_='pax -L -x $1 -w "$tardir"'
1087
+      am__untar='pax -r'
1088
+      ;;
1089
+    cpio)
1090
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1091
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1092
+      am__untar='cpio -i -H $1 -d'
1093
+      ;;
1094
+    none)
1095
+      am__tar=false
1096
+      am__tar_=false
1097
+      am__untar=false
1098
+      ;;
1099
+    esac
1068 1100
 
1069
-  # tar/untar a dummy directory, and stop if the command works
1070
-  rm -rf conftest.dir
1071
-  mkdir conftest.dir
1072
-  echo GrepMe > conftest.dir/file
1073
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1101
+    # If the value was cached, stop now.  We just wanted to have am__tar
1102
+    # and am__untar set.
1103
+    test -n "${am_cv_prog_tar_$1}" && break
1104
+
1105
+    # tar/untar a dummy directory, and stop if the command works.
1106
+    rm -rf conftest.dir
1107
+    mkdir conftest.dir
1108
+    echo GrepMe > conftest.dir/file
1109
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1110
+    rm -rf conftest.dir
1111
+    if test -s conftest.tar; then
1112
+      AM_RUN_LOG([$am__untar <conftest.tar])
1113
+      AM_RUN_LOG([cat conftest.dir/file])
1114
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1115
+    fi
1116
+  done
1074 1117
   rm -rf conftest.dir
1075
-  if test -s conftest.tar; then
1076
-    AM_RUN_LOG([$am__untar <conftest.tar])
1077
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1078
-  fi
1079
-done
1080
-rm -rf conftest.dir
1081 1118
 
1082
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1083
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1119
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1120
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1121
+
1084 1122
 AC_SUBST([am__tar])
1085 1123
 AC_SUBST([am__untar])
1086 1124
 ]) # _AM_PROG_TAR
... ...
@@ -44,8 +44,15 @@
44 44
 #include "llvm/ADT/SmallVector.h"
45 45
 #include "llvm/Analysis/LoopInfo.h"
46 46
 #include "llvm/Analysis/ScalarEvolution.h"
47
+#if LLVM_VERSION < 35
47 48
 #include "llvm/Analysis/Verifier.h"
48 49
 #include "llvm/AutoUpgrade.h"
50
+#include "llvm/Support/TargetFolder.h"
51
+#else
52
+#include "llvm/IR/Verifier.h"
53
+#include "llvm/IR/AutoUpgrade.h"
54
+#include "llvm/Analysis/TargetFolder.h"
55
+#endif
49 56
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
50 57
 #include "llvm/ExecutionEngine/JIT.h"
51 58
 #include "llvm/ExecutionEngine/JITEventListener.h"
... ...
@@ -100,15 +107,16 @@ void LLVMInitializePowerPCAsmPrinter();
100 100
 #endif
101 101
 
102 102
 #include "llvm/Target/TargetOptions.h"
103
-#include "llvm/Support/TargetFolder.h"
104 103
 #include "llvm/Transforms/Scalar.h"
105 104
 #include "llvm/Transforms/IPO.h"
106 105
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
107 106
 
108 107
 #if LLVM_VERSION < 32
109 108
 #include "llvm/Analysis/DebugInfo.h"
110
-#else
109
+#elif LLVM_VERSION < 35
111 110
 #include "llvm/DebugInfo.h"
111
+#else
112
+#include "llvm/IR/DebugInfo.h"
112 113
 #endif
113 114
 
114 115
 #if LLVM_VERSION < 32
... ...
@@ -144,6 +152,10 @@ void LLVMInitializePowerPCAsmPrinter();
144 144
 #include "llvm/Analysis/CFG.h"
145 145
 #endif
146 146
 
147
+#if LLVM_VERSION >= 35
148
+#include "llvm/IR/Dominators.h"
149
+#endif
150
+
147 151
 //#define TIMING
148 152
 #undef TIMING
149 153
 
... ...
@@ -657,7 +669,11 @@ public:
657 657
 	}
658 658
 	BBSetTy  needsTimeoutCheck;
659 659
 	BBMapTy BBMap;
660
+#if LLVM_VERSION < 35
660 661
 	DominatorTree &DT = getAnalysis<DominatorTree>();
662
+#else
663
+	DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
664
+#endif
661 665
 	for (Function::iterator I=F.begin(),E=F.end(); I != E; ++I) {
662 666
 	    BasicBlock *BB = &*I;
663 667
 	    unsigned apicalls = 0;
... ...
@@ -784,7 +800,11 @@ public:
784 784
       AU.setPreservesAll();
785 785
       AU.addRequired<LoopInfo>();
786 786
       AU.addRequired<ScalarEvolution>();
787
+#if LLVM_VERSION < 35
787 788
       AU.addRequired<DominatorTree>();
789
+#else
790
+      AU.addRequired<DominatorTreeWrapperPass>();
791
+#endif
788 792
     }
789 793
 };
790 794
 char RuntimeLimits::ID;
... ...
@@ -1701,9 +1721,8 @@ public:
1701 1701
 			    Value *Dst = convertOperand(func, inst, inst->u.three[0]);
1702 1702
 			    Dst = Builder.CreatePointerCast(Dst, PointerType::getUnqual(Type::getInt8Ty(Context)));
1703 1703
 			    Value *Val = convertOperand(func, Type::getInt8Ty(Context), inst->u.three[1]);
1704
-			    //Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1705
-                            Value *Len = convertOperand(func, Type::getInt64Ty(Context), inst->u.three[2]);
1706
-#if LLVM_VERSION < 30
1704
+			    Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1705
+#if LLVM_VERSION < 29
1707 1706
 			    CallInst *c = Builder.CreateCall4(CF->FMemset, Dst, Val, Len,
1708 1707
 								ConstantInt::get(Type::getInt32Ty(Context), 1));
1709 1708
 #else
... ...
@@ -1723,9 +1742,8 @@ public:
1723 1723
 			    Dst = Builder.CreatePointerCast(Dst, PointerType::getUnqual(Type::getInt8Ty(Context)));
1724 1724
 			    Value *Src = convertOperand(func, inst, inst->u.three[1]);
1725 1725
 			    Src = Builder.CreatePointerCast(Src, PointerType::getUnqual(Type::getInt8Ty(Context)));
1726
-			    //Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1727
-                            Value *Len = convertOperand(func, Type::getInt64Ty(Context), inst->u.three[2]);
1728
-#if LLVM_VERSION < 30
1726
+			    Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1727
+#if LLVM_VERSION < 29
1729 1728
 			    CallInst *c = Builder.CreateCall4(CF->FMemcpy, Dst, Src, Len,
1730 1729
 								ConstantInt::get(Type::getInt32Ty(Context), 1));
1731 1730
 #else
... ...
@@ -1745,9 +1763,8 @@ public:
1745 1745
 			    Dst = Builder.CreatePointerCast(Dst, PointerType::getUnqual(Type::getInt8Ty(Context)));
1746 1746
 			    Value *Src = convertOperand(func, inst, inst->u.three[1]);
1747 1747
 			    Src = Builder.CreatePointerCast(Src, PointerType::getUnqual(Type::getInt8Ty(Context)));
1748
-                            //Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1749
-                            Value *Len = convertOperand(func, Type::getInt64Ty(Context), inst->u.three[2]);
1750
-#if LLVM_VERSION < 30
1748
+			    Value *Len = convertOperand(func, Type::getInt32Ty(Context), inst->u.three[2]);
1749
+#if LLVM_VERSION < 29
1751 1750
 			    CallInst *c = Builder.CreateCall4(CF->FMemmove, Dst, Src, Len,
1752 1751
 								ConstantInt::get(Type::getInt32Ty(Context), 1));
1753 1752
 #else
... ...
@@ -1856,7 +1873,11 @@ public:
1856 1856
 
1857 1857
 	    // If successful so far, run verifyFunction
1858 1858
 	    if (!broken) {
1859
+#if LLVM_VERSION < 35
1859 1860
 		if (verifyFunction(*F, PrintMessageAction)) {
1861
+#else
1862
+		if (verifyFunction(*F, &errs())) {
1863
+#endif
1860 1864
 		    // verification failed
1861 1865
 		    broken = true;
1862 1866
 		    cli_warnmsg("[Bytecode JIT]: Verification failed\n");
... ...
@@ -1945,7 +1966,11 @@ public:
1945 1945
 	ReturnInst::Create(Context, CI, BB);
1946 1946
 
1947 1947
 	delete [] Functions;
1948
+#if LLVM_VERSION < 35
1948 1949
 	if (verifyFunction(*F, PrintMessageAction))
1950
+#else
1951
+	if (verifyFunction(*F, &errs()))
1952
+#endif
1949 1953
 	    return 0;
1950 1954
 
1951 1955
 /*			DEBUG(errs() << "Generating code\n");
... ...
@@ -2003,21 +2028,18 @@ static void addFunctionProtos(struct CommonFunctions *CF, ExecutionEngine *EE, M
2003 2003
     std::vector<constType*> args;
2004 2004
     args.push_back(PointerType::getUnqual(Type::getInt8Ty(Context)));
2005 2005
     args.push_back(Type::getInt8Ty(Context));
2006
-    //args.push_back(Type::getInt32Ty(Context));
2007
-    args.push_back(Type::getInt64Ty(Context));
2008 2006
     args.push_back(Type::getInt32Ty(Context));
2009
-#if LLVM_VERSION >= 30
2007
+    args.push_back(Type::getInt32Ty(Context));
2008
+#if LLVM_VERSION >= 29
2010 2009
     args.push_back(Type::getInt1Ty(Context));
2011 2010
 #endif
2012 2011
     FunctionType* FuncTy_3 = FunctionType::get(Type::getVoidTy(Context),
2013 2012
 					       args, false);
2014 2013
     CF->FMemset = Function::Create(FuncTy_3, GlobalValue::ExternalLinkage,
2015
-#if LLVM_VERSION < 30
2016
-                                   //"llvm.memset.i32",
2017
-                                   "llvm.memset.i64",
2014
+#if LLVM_VERSION < 29
2015
+                                   "llvm.memset.i32",
2018 2016
 #else
2019
-                                   //"llvm.memset.p0i8.i32",
2020
-                                   "llvm.memset.p0i8.i64",
2017
+                                   "llvm.memset.p0i8.i32",
2021 2018
 #endif
2022 2019
                                    M);
2023 2020
     CF->FMemset->setDoesNotThrow();
... ...
@@ -2030,21 +2052,18 @@ static void addFunctionProtos(struct CommonFunctions *CF, ExecutionEngine *EE, M
2030 2030
     args.clear();
2031 2031
     args.push_back(PointerType::getUnqual(Type::getInt8Ty(Context)));
2032 2032
     args.push_back(PointerType::getUnqual(Type::getInt8Ty(Context)));
2033
-    //args.push_back(Type::getInt32Ty(Context));
2034
-    args.push_back(Type::getInt64Ty(Context));
2035 2033
     args.push_back(Type::getInt32Ty(Context));
2036
-#if LLVM_VERSION >= 30
2034
+    args.push_back(Type::getInt32Ty(Context));
2035
+#if LLVM_VERSION >= 29
2037 2036
     args.push_back(Type::getInt1Ty(Context));
2038 2037
 #endif
2039 2038
     FunctionType* FuncTy_4 = FunctionType::get(Type::getVoidTy(Context),
2040 2039
 					       args, false);
2041 2040
     CF->FMemmove = Function::Create(FuncTy_4, GlobalValue::ExternalLinkage,
2042
-#if LLVM_VERSION < 30
2043
-                                    //"llvm.memmove.i32",
2044
-                                    "llvm.memcpy.i64",
2041
+#if LLVM_VERSION < 29
2042
+                                    "llvm.memmove.i32",
2045 2043
 #else
2046
-                                    //"llvm.memmove.p0i8.i32",
2047
-                                    "llvm.memmove.p0i8.i64",
2044
+                                    "llvm.memmove.p0i8.i32",
2048 2045
 #endif
2049 2046
                                     M);
2050 2047
     CF->FMemmove->setDoesNotThrow();
... ...
@@ -2055,12 +2074,10 @@ static void addFunctionProtos(struct CommonFunctions *CF, ExecutionEngine *EE, M
2055 2055
 #endif
2056 2056
 
2057 2057
     CF->FMemcpy = Function::Create(FuncTy_4, GlobalValue::ExternalLinkage,
2058
-#if LLVM_VERSION < 30
2059
-                                   //"llvm.memcpy.i32",
2060
-                                   "llvm.memcpy.i64",
2058
+#if LLVM_VERSION < 29
2059
+                                   "llvm.memcpy.i32",
2061 2060
 #else
2062
-                                   //"llvm.memcpy.p0i8.p0i8.i32",
2063
-                                   "llvm.memcpy.p0i8.p0i8.i64",
2061
+                                   "llvm.memcpy.p0i8.p0i8.i32",
2064 2062
 #endif
2065 2063
                                    M);
2066 2064
     CF->FMemcpy->setDoesNotThrow();
... ...
@@ -2125,7 +2142,11 @@ static void addFunctionProtos(struct CommonFunctions *CF, ExecutionEngine *EE, M
2125 2125
 INITIALIZE_PASS_BEGIN(RuntimeLimits, "rl", "Runtime Limits", false, false)
2126 2126
 INITIALIZE_PASS_DEPENDENCY(LoopInfo)
2127 2127
 INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
2128
+#if LLVM_VERSION < 35
2128 2129
 INITIALIZE_PASS_DEPENDENCY(DominatorTree)
2130
+#else
2131
+INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
2132
+#endif
2129 2133
 INITIALIZE_PASS_END(RuntimeLimits, "rl" ,"Runtime Limits", false, false)
2130 2134
 #endif
2131 2135
 
... ...
@@ -2341,16 +2362,20 @@ static void setGuard(unsigned char* guardbuf)
2341 2341
 }
2342 2342
 #if LLVM_VERSION < 32
2343 2343
 static void addFPasses(FunctionPassManager &FPM, bool trusted, const TargetData *TD)
2344
-#else
2344
+#elif LLVM_VERSION < 35
2345 2345
 static void addFPasses(FunctionPassManager &FPM, bool trusted, const DataLayout *TD)
2346
+#else
2347
+static void addFPasses(FunctionPassManager &FPM, bool trusted, const Module *M)
2346 2348
 #endif
2347 2349
 {
2348 2350
     // Set up the optimizer pipeline.  Start with registering info about how
2349 2351
     // the target lays out data structures.
2350 2352
 #if LLVM_VERSION < 32
2351 2353
     FPM.add(new TargetData(*TD));
2352
-#else
2354
+#elif LLVM_VERSION < 35
2353 2355
     FPM.add(new DataLayout(*TD));
2356
+#else
2357
+    FPM.add(new DataLayoutPass(M));
2354 2358
 #endif
2355 2359
     // Promote allocas to registers.
2356 2360
     FPM.add(createPromoteMemoryToRegisterPass());
... ...
@@ -2428,9 +2453,12 @@ int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
2428 2428
 #if LLVM_VERSION < 32
2429 2429
 	addFPasses(OurFPM, true, EE->getTargetData());
2430 2430
 	addFPasses(OurFPMUnsigned, false, EE->getTargetData());
2431
-#else
2431
+#elif LLVM_VERSION < 35
2432 2432
 	addFPasses(OurFPM, true, EE->getDataLayout());
2433 2433
 	addFPasses(OurFPMUnsigned, false, EE->getDataLayout());
2434
+#else
2435
+	addFPasses(OurFPM, true, M);
2436
+	addFPasses(OurFPMUnsigned, false, M);
2434 2437
 #endif
2435 2438
 
2436 2439
 
... ...
@@ -2541,8 +2569,10 @@ int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
2541 2541
 	PassManager PM;
2542 2542
 #if LLVM_VERSION < 32
2543 2543
 	PM.add(new TargetData(*EE->getTargetData()));
2544
-#else
2544
+#elif LLVM_VERSION < 35
2545 2545
 	PM.add(new DataLayout(*EE->getDataLayout()));
2546
+#else
2547
+	PM.add(new DataLayoutPass(M));
2546 2548
 #endif
2547 2549
 	// TODO: only run this on the untrusted bytecodes, not all of them...
2548 2550
 	if (has_untrusted)
... ...
@@ -2601,10 +2631,17 @@ int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
2601 2601
 int bytecode_init(void)
2602 2602
 {
2603 2603
     // If already initialized return
2604
+#if LLVM_VERSION < 35
2604 2605
     if (llvm_is_multithreaded()) {
2605 2606
 	cli_warnmsg("bytecode_init: already initialized\n");
2606 2607
 	return CL_EARG;
2607 2608
     }
2609
+#else
2610
+    if (!LLVMIsMultithreaded()) {
2611
+        cli_warnmsg("bytecode_init: LLVM is compiled without multithreading support\n");
2612
+    }
2613
+#endif
2614
+
2608 2615
     llvm_install_error_handler(llvm_error_handler);
2609 2616
 #ifdef CL_DEBUG
2610 2617
     sys::PrintStackTraceOnErrorSignal();
... ...
@@ -2628,7 +2665,11 @@ int bytecode_init(void)
2628 2628
 #endif
2629 2629
     llvm::DwarfExceptionHandling = false;
2630 2630
 #endif
2631
+#if LLVM_VERSION < 33
2631 2632
     llvm_start_multithreaded();
2633
+#else
2634
+    // This is now deprecated/useless: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THREADS in LLVM.
2635
+#endif
2632 2636
 
2633 2637
     // If we have a native target, initialize it to ensure it is linked in and
2634 2638
     // usable by the JIT.
... ...
@@ -2638,7 +2679,11 @@ int bytecode_init(void)
2638 2638
     InitializeAllTargets();
2639 2639
 #endif
2640 2640
 
2641
+#if LLVM_VERSION < 35
2641 2642
     if (!llvm_is_multithreaded()) {
2643
+#else
2644
+    if (!LLVMIsMultithreaded()) {
2645
+#endif
2642 2646
 	//TODO:cli_dbgmsg
2643 2647
 	DEBUG(errs() << "WARNING: ClamAV JIT built w/o atomic builtins\n"
2644 2648
 	      << "On x86 for best performance ClamAV should be built for i686, not i386!\n");
... ...
@@ -2710,7 +2755,7 @@ void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx)
2710 2710
 	std::string ErrorMessage;
2711 2711
 #if LLVM_VERSION < 29
2712 2712
 	lines->buffer = MemoryBuffer::getFile(path, &ErrorMessage);
2713
-#else
2713
+#elif LLVM_VERSION < 35
2714 2714
 	OwningPtr<MemoryBuffer> File;
2715 2715
 	error_code ec = MemoryBuffer::getFile(path, File);
2716 2716
 	if (ec) {
... ...
@@ -2718,6 +2763,15 @@ void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx)
2718 2718
 	    lines->buffer = 0;
2719 2719
 	} else
2720 2720
 	    lines->buffer = File.take();
2721
+#else
2722
+	ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr = MemoryBuffer::getFile(path);
2723
+	if (!FileOrErr) {
2724
+		// TODO: How to handle ErrorMessage?
2725
+		lines->buffer = 0;
2726
+	}
2727
+	else {
2728
+		lines->buffer = FileOrErr.get().release();
2729
+	}
2721 2730
 #endif
2722 2731
 	if (!lines->buffer) {
2723 2732
 	    errs() << "Unable to open file '" << path << "'\n";
... ...
@@ -2863,7 +2917,10 @@ static bool getLocationInfo(const Value *V, std::string &DisplayName,
2863 2863
   StringRef G;
2864 2864
   StringRef H;
2865 2865
 #endif
2866
+#if LLVM_VERSION < 35
2866 2867
   DIType TypeD;
2868
+#endif
2869
+  StringRef T;
2867 2870
 
2868 2871
   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(const_cast<Value*>(V))) {
2869 2872
     Value *DIGV = findDbgGlobalDeclare(GV);
... ...
@@ -2880,7 +2937,11 @@ static bool getLocationInfo(const Value *V, std::string &DisplayName,
2880 2880
     G = Var.getFilename();
2881 2881
     H = Var.getDirectory();
2882 2882
 #endif
2883
+#if LLVM_VERSION < 35
2883 2884
     TypeD = Var.getType();
2885
+#else
2886
+    T = Var.getType().getName();
2887
+#endif
2884 2888
   } else if (Function *F = dyn_cast<Function>(const_cast<Value*>(V))){
2885 2889
     Value *DIF = findDbgSubprogramDeclare(F);
2886 2890
     if (!DIF) return false;
... ...
@@ -2896,7 +2957,11 @@ static bool getLocationInfo(const Value *V, std::string &DisplayName,
2896 2896
     G = Var.getFilename();
2897 2897
     H = Var.getDirectory();
2898 2898
 #endif
2899
+#if LLVM_VERSION < 35
2899 2900
     TypeD = Var.getType();
2901
+#else
2902
+    T = Var.getType().getName();
2903
+#endif
2900 2904
   } else {
2901 2905
     const DbgDeclareInst *DDI = findDbgDeclare(V);
2902 2906
     if (!DDI) return false;
... ...
@@ -2913,10 +2978,16 @@ static bool getLocationInfo(const Value *V, std::string &DisplayName,
2913 2913
     G = StringRef();
2914 2914
     H = StringRef();
2915 2915
 #endif
2916
+#if LLVM_VERSION < 35
2916 2917
     TypeD = Var.getType();
2918
+#else
2919
+    T = Var.getType().getName();
2920
+#endif
2917 2921
   }
2918 2922
 
2919
-  StringRef T = TypeD.getName();
2923
+#if LLVM_VERSION < 35
2924
+  T = TypeD.getName();
2925
+#endif
2920 2926
   if (!T.empty())
2921 2927
     Type = T;
2922 2928
 #if LLVM_VERSION < 33
... ...
@@ -3,19 +3,12 @@
3 3
 /* Define if building universal (internal helper macro) */
4 4
 #undef AC_APPLE_UNIVERSAL_BUILD
5 5
 
6
-/* Define to 1 if you have a deprecated version of the 'libjson' library
7
-   (-ljson). */
8
-#undef HAVE_DEPRECATED_JSON
9
-
10 6
 /* Define to 1 if you have the <dlfcn.h> header file. */
11 7
 #undef HAVE_DLFCN_H
12 8
 
13 9
 /* Define to 1 if you have the <inttypes.h> header file. */
14 10
 #undef HAVE_INTTYPES_H
15 11
 
16
-/* Define to 1 if you have the 'libjson' library (-ljson). */
17
-#undef HAVE_JSON
18
-
19 12
 /* Define to 1 if you have the <memory.h> header file. */
20 13
 #undef HAVE_MEMORY_H
21 14
 
... ...
@@ -1,13 +1,11 @@
1 1
 #! /bin/sh
2 2
 # Guess values for system-dependent variables and create Makefiles.
3
-# Generated by GNU Autoconf 2.68 for libclamavc++ devel.
3
+# Generated by GNU Autoconf 2.69 for libclamavc++ devel.
4 4
 #
5 5
 # Report bugs to <http://bugs.clamav.net>.
6 6
 #
7 7
 #
8
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
9
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
10
-# Foundation, Inc.
8
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
11 9
 #
12 10
 #
13 11
 # This configure script is free software; the Free Software Foundation
... ...
@@ -136,6 +134,31 @@ export LANGUAGE
136 136
 # CDPATH.
137 137
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138 138
 
139
+# Use a proper internal environment variable to ensure we don't fall
140
+  # into an infinite loop, continuously re-executing ourselves.
141
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
142
+    _as_can_reexec=no; export _as_can_reexec;
143
+    # We cannot yet assume a decent shell, so we have to provide a
144
+# neutralization value for shells without unset; and this also
145
+# works around shells that cannot unset nonexistent variables.
146
+# Preserve -v and -x to the replacement shell.
147
+BASH_ENV=/dev/null
148
+ENV=/dev/null
149
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
150
+case $- in # ((((
151
+  *v*x* | *x*v* ) as_opts=-vx ;;
152
+  *v* ) as_opts=-v ;;
153
+  *x* ) as_opts=-x ;;
154
+  * ) as_opts= ;;
155
+esac
156
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
157
+# Admittedly, this is quite paranoid, since all the known shells bail
158
+# out after a failed `exec'.
159
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
160
+as_fn_exit 255
161
+  fi
162
+  # We don't want this to propagate to other subprocesses.
163
+          { _as_can_reexec=; unset _as_can_reexec;}
139 164
 if test "x$CONFIG_SHELL" = x; then
140 165
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
141 166
   emulate sh
... ...
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
169 169
 else
170 170
   exitcode=1; echo positional parameters were not saved.
171 171
 fi
172
-test x\$exitcode = x0 || exit 1"
172
+test x\$exitcode = x0 || exit 1
173
+test -x / || exit 1"
173 174
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
174 175
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
175 176
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
... ...
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
222 222
 
223 223
 
224 224
       if test "x$CONFIG_SHELL" != x; then :
225
-  # We cannot yet assume a decent shell, so we have to provide a
226
-	# neutralization value for shells without unset; and this also
227
-	# works around shells that cannot unset nonexistent variables.
228
-	# Preserve -v and -x to the replacement shell.
229
-	BASH_ENV=/dev/null
230
-	ENV=/dev/null
231
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
232
-	export CONFIG_SHELL
233
-	case $- in # ((((
234
-	  *v*x* | *x*v* ) as_opts=-vx ;;
235
-	  *v* ) as_opts=-v ;;
236
-	  *x* ) as_opts=-x ;;
237
-	  * ) as_opts= ;;
238
-	esac
239
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
225
+  export CONFIG_SHELL
226
+             # We cannot yet assume a decent shell, so we have to provide a
227
+# neutralization value for shells without unset; and this also
228
+# works around shells that cannot unset nonexistent variables.
229
+# Preserve -v and -x to the replacement shell.
230
+BASH_ENV=/dev/null
231
+ENV=/dev/null
232
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
233
+case $- in # ((((
234
+  *v*x* | *x*v* ) as_opts=-vx ;;
235
+  *v* ) as_opts=-v ;;
236
+  *x* ) as_opts=-x ;;
237
+  * ) as_opts= ;;
238
+esac
239
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
240
+# Admittedly, this is quite paranoid, since all the known shells bail
241
+# out after a failed `exec'.
242
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
243
+exit 255
240 244
 fi
241 245
 
242 246
     if test x$as_have_required = xno; then :
... ...
@@ -339,6 +367,14 @@ $as_echo X"$as_dir" |
339 339
 
340 340
 
341 341
 } # as_fn_mkdir_p
342
+
343
+# as_fn_executable_p FILE
344
+# -----------------------
345
+# Test if FILE is an executable regular file.
346
+as_fn_executable_p ()
347
+{
348
+  test -f "$1" && test -x "$1"
349
+} # as_fn_executable_p
342 350
 # as_fn_append VAR VALUE
343 351
 # ----------------------
344 352
 # Append the text in VALUE to the end of the definition contained in VAR. Take
... ...
@@ -460,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
460 460
   chmod +x "$as_me.lineno" ||
461 461
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
462 462
 
463
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
464
+  # already done that, so ensure we don't try to do so again and fall
465
+  # in an infinite loop.  This has already happened in practice.
466
+  _as_can_reexec=no; export _as_can_reexec
463 467
   # Don't try to exec as it changes $[0], causing all sort of problems
464 468
   # (the dirname of $[0] is not the place where we might find the
465 469
   # original and so on.  Autoconf is especially sensitive to this).
... ...
@@ -494,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
494 494
     # ... but there are two gotchas:
495 495
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
496 496
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
497
-    # In both cases, we have to default to `cp -p'.
497
+    # In both cases, we have to default to `cp -pR'.
498 498
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
499
-      as_ln_s='cp -p'
499
+      as_ln_s='cp -pR'
500 500
   elif ln conf$$.file conf$$ 2>/dev/null; then
501 501
     as_ln_s=ln
502 502
   else
503
-    as_ln_s='cp -p'
503
+    as_ln_s='cp -pR'
504 504
   fi
505 505
 else
506
-  as_ln_s='cp -p'
506
+  as_ln_s='cp -pR'
507 507
 fi
508 508
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
509 509
 rmdir conf$$.dir 2>/dev/null
... ...
@@ -515,28 +555,8 @@ else
515 515
   as_mkdir_p=false
516 516
 fi
517 517
 
518
-if test -x / >/dev/null 2>&1; then
519
-  as_test_x='test -x'
520
-else
521
-  if ls -dL / >/dev/null 2>&1; then
522
-    as_ls_L_option=L
523
-  else
524
-    as_ls_L_option=
525
-  fi
526
-  as_test_x='
527
-    eval sh -c '\''
528
-      if test -d "$1"; then
529
-	test -d "$1/.";
530
-      else
531
-	case $1 in #(
532
-	-*)set "./$1";;
533
-	esac;
534
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
535
-	???[sx]*):;;*)false;;esac;fi
536
-    '\'' sh
537
-  '
538
-fi
539
-as_executable_p=$as_test_x
518
+as_test_x='test -x'
519
+as_executable_p=as_fn_executable_p
540 520
 
541 521
 # Sed expression to map a string onto a valid CPP name.
542 522
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
... ...
@@ -617,9 +637,6 @@ ac_subst_vars='am__EXEEXT_FALSE
617 617
 am__EXEEXT_TRUE
618 618
 LTLIBOBJS
619 619
 LIBOBJS
620
-JSON_CPPFLAGS
621
-JSON_LDFLAGS
622
-JSON_LIBS
623 620
 BUILD_EXTERNAL_LLVM_FALSE
624 621
 BUILD_EXTERNAL_LLVM_TRUE
625 622
 NO_MISSING_FIELD_INITIALIZERS
... ...
@@ -632,11 +649,11 @@ THREAD_LIBS
632 632
 DEBUG_BUILD_FALSE
633 633
 DEBUG_BUILD_TRUE
634 634
 LLVM_VERSION
635
-subdirs
636 635
 LLVMCONFIG_LIBFILES
637 636
 LLVMCONFIG_LIBS
638 637
 LLVMCONFIG_LDFLAGS
639 638
 LLVMCONFIG_CXXFLAGS
639
+subdirs
640 640
 GMAKE
641 641
 ifGNUmake
642 642
 CXXCPP
... ...
@@ -782,7 +799,6 @@ with_system_llvm
782 782
 enable_llvm
783 783
 enable_optimized
784 784
 enable_all_jit_targets
785
-with_libjson
786 785
 '
787 786
       ac_precious_vars='build_alias
788 787
 host_alias
... ...
@@ -1252,8 +1268,6 @@ target=$target_alias
1252 1252
 if test "x$host_alias" != x; then
1253 1253
   if test "x$build_alias" = x; then
1254 1254
     cross_compiling=maybe
1255
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1256
-    If a cross compiler is detected then cross compile mode will be used" >&2
1257 1255
   elif test "x$build_alias" != "x$host_alias"; then
1258 1256
     cross_compiling=yes
1259 1257
   fi
... ...
@@ -1418,12 +1432,15 @@ Optional Features:
1418 1418
   --disable-option-checking  ignore unrecognized --enable/--with options
1419 1419
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1420 1420
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1421
-  --enable-silent-rules          less verbose build output (undo: `make V=1')
1422
-  --disable-silent-rules         verbose build output (undo: `make V=0')
1423
-  --disable-dependency-tracking  speeds up one-time build
1424
-  --enable-dependency-tracking   do not reject slow dependency extractors
1425
-  --enable-maintainer-mode  enable make rules and dependencies not useful
1426
-			  (and sometimes confusing) to the casual installer
1421
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
1422
+  --disable-silent-rules  verbose build output (undo: "make V=0")
1423
+  --enable-dependency-tracking
1424
+                          do not reject slow dependency extractors
1425
+  --disable-dependency-tracking
1426
+                          speeds up one-time build
1427
+  --enable-maintainer-mode
1428
+                          enable make rules and dependencies not useful (and
1429
+                          sometimes confusing) to the casual installer
1427 1430
   --enable-static[=PKGS]  build static libraries [default=no]
1428 1431
   --enable-shared[=PKGS]  build shared libraries [default=yes]
1429 1432
   --enable-fast-install[=PKGS]
... ...
@@ -1445,8 +1462,6 @@ Optional Packages:
1445 1445
   --with-system-llvm      Use system llvm instead of built-in, uses full path
1446 1446
                           to llvm-config (default= search /usr/local or /usr
1447 1447
                           if not found in /usr/local)
1448
-  --with-libjson=DIR   path to directory containing libjson (default=
1449
-    /usr/local or /usr if not found in /usr/local)
1450 1448
 
1451 1449
 Some influential environment variables:
1452 1450
   CXX         C++ compiler command
... ...
@@ -1528,9 +1543,9 @@ test -n "$ac_init_help" && exit $ac_status
1528 1528
 if $ac_init_version; then
1529 1529
   cat <<\_ACEOF
1530 1530
 libclamavc++ configure devel
1531
-generated by GNU Autoconf 2.68
1531
+generated by GNU Autoconf 2.69
1532 1532
 
1533
-Copyright (C) 2010 Free Software Foundation, Inc.
1533
+Copyright (C) 2012 Free Software Foundation, Inc.
1534 1534
 This configure script is free software; the Free Software Foundation
1535 1535
 gives unlimited permission to copy, distribute and modify it.
1536 1536
 _ACEOF
... ...
@@ -1754,7 +1769,7 @@ $as_echo "$ac_try_echo"; } >&5
1754 1754
 	 test ! -s conftest.err
1755 1755
        } && test -s conftest$ac_exeext && {
1756 1756
 	 test "$cross_compiling" = yes ||
1757
-	 $as_test_x conftest$ac_exeext
1757
+	 test -x conftest$ac_exeext
1758 1758
        }; then :
1759 1759
   ac_retval=0
1760 1760
 else
... ...
@@ -1904,7 +1919,7 @@ $as_echo "$ac_try_echo"; } >&5
1904 1904
 	 test ! -s conftest.err
1905 1905
        } && test -s conftest$ac_exeext && {
1906 1906
 	 test "$cross_compiling" = yes ||
1907
-	 $as_test_x conftest$ac_exeext
1907
+	 test -x conftest$ac_exeext
1908 1908
        }; then :
1909 1909
   ac_retval=0
1910 1910
 else
... ...
@@ -1969,7 +1984,7 @@ This file contains any messages produced by compilers while
1969 1969
 running configure, to aid debugging if configure makes a mistake.
1970 1970
 
1971 1971
 It was created by libclamavc++ $as_me devel, which was
1972
-generated by GNU Autoconf 2.68.  Invocation command line was
1972
+generated by GNU Autoconf 2.69.  Invocation command line was
1973 1973
 
1974 1974
   $ $0 $@
1975 1975
 
... ...
@@ -2459,7 +2474,7 @@ test -n "$target_alias" &&
2459 2459
   test "$program_prefix$program_suffix$program_transform_name" = \
2460 2460
     NONENONEs,x,x, &&
2461 2461
   program_prefix=${target_alias}-
2462
-am__api_version='1.11'
2462
+am__api_version='1.14'
2463 2463
 
2464 2464
 # Find a good install program.  We prefer a C program (faster),
2465 2465
 # so one script is as good as another.  But avoid the broken or
... ...
@@ -2498,7 +2513,7 @@ case $as_dir/ in #((
2498 2498
     # by default.
2499 2499
     for ac_prog in ginstall scoinst install; do
2500 2500
       for ac_exec_ext in '' $ac_executable_extensions; do
2501
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2501
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
2502 2502
 	  if test $ac_prog = install &&
2503 2503
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2504 2504
 	    # AIX install.  It has an incompatible calling convention.
... ...
@@ -2556,9 +2571,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2556 2556
 
2557 2557
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2558 2558
 $as_echo_n "checking whether build environment is sane... " >&6; }
2559
-# Just in case
2560
-sleep 1
2561
-echo timestamp > conftest.file
2562 2559
 # Reject unsafe characters in $srcdir or the absolute working directory
2563 2560
 # name.  Accept space and tab only in the latter.
2564 2561
 am_lf='
... ...
@@ -2569,32 +2581,40 @@ case `pwd` in
2569 2569
 esac
2570 2570
 case $srcdir in
2571 2571
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
2572
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
2572
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
2573 2573
 esac
2574 2574
 
2575
-# Do `set' in a subshell so we don't clobber the current shell's
2575
+# Do 'set' in a subshell so we don't clobber the current shell's
2576 2576
 # arguments.  Must try -L first in case configure is actually a
2577 2577
 # symlink; some systems play weird games with the mod time of symlinks
2578 2578
 # (eg FreeBSD returns the mod time of the symlink's containing
2579 2579
 # directory).
2580 2580
 if (
2581
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2582
-   if test "$*" = "X"; then
2583
-      # -L didn't work.
2584
-      set X `ls -t "$srcdir/configure" conftest.file`
2585
-   fi
2586
-   rm -f conftest.file
2587
-   if test "$*" != "X $srcdir/configure conftest.file" \
2588
-      && test "$*" != "X conftest.file $srcdir/configure"; then
2589
-
2590
-      # If neither matched, then we have a broken ls.  This can happen
2591
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
2592
-      # broken ls alias from the environment.  This has actually
2593
-      # happened.  Such a system could not be considered "sane".
2594
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
2595
-alias in your environment" "$LINENO" 5
2596
-   fi
2597
-
2581
+   am_has_slept=no
2582
+   for am_try in 1 2; do
2583
+     echo "timestamp, slept: $am_has_slept" > conftest.file
2584
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2585
+     if test "$*" = "X"; then
2586
+	# -L didn't work.
2587
+	set X `ls -t "$srcdir/configure" conftest.file`
2588
+     fi
2589
+     if test "$*" != "X $srcdir/configure conftest.file" \
2590
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
2591
+
2592
+	# If neither matched, then we have a broken ls.  This can happen
2593
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
2594
+	# broken ls alias from the environment.  This has actually
2595
+	# happened.  Such a system could not be considered "sane".
2596
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
2597
+  alias in your environment" "$LINENO" 5
2598
+     fi
2599
+     if test "$2" = conftest.file || test $am_try -eq 2; then
2600
+       break
2601
+     fi
2602
+     # Just in case.
2603
+     sleep 1
2604
+     am_has_slept=yes
2605
+   done
2598 2606
    test "$2" = conftest.file
2599 2607
    )
2600 2608
 then
... ...
@@ -2606,6 +2626,16 @@ Check your system clock" "$LINENO" 5
2606 2606
 fi
2607 2607
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2608 2608
 $as_echo "yes" >&6; }
2609
+# If we didn't sleep, we still need to ensure time stamps of config.status and
2610
+# generated files are strictly newer.
2611
+am_sleep_pid=
2612
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2613
+  ( sleep 1 ) &
2614
+  am_sleep_pid=$!
2615
+fi
2616
+
2617
+rm -f conftest.file
2618
+
2609 2619
 test "$program_prefix" != NONE &&
2610 2620
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
2611 2621
 # Use a double $ so make ignores it.
... ...
@@ -2628,12 +2658,12 @@ if test x"${MISSING+set}" != xset; then
2628 2628
   esac
2629 2629
 fi
2630 2630
 # Use eval to expand $SHELL
2631
-if eval "$MISSING --run true"; then
2632
-  am_missing_run="$MISSING --run "
2631
+if eval "$MISSING --is-lightweight"; then
2632
+  am_missing_run="$MISSING "
2633 2633
 else
2634 2634
   am_missing_run=
2635
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
2636
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
2635
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
2636
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
2637 2637
 fi
2638 2638
 
2639 2639
 if test x"${install_sh}" != xset; then
... ...
@@ -2645,10 +2675,10 @@ if test x"${install_sh}" != xset; then
2645 2645
   esac
2646 2646
 fi
2647 2647
 
2648
-# Installed binaries are usually stripped using `strip' when the user
2649
-# run `make install-strip'.  However `strip' might not be the right
2648
+# Installed binaries are usually stripped using 'strip' when the user
2649
+# run "make install-strip".  However 'strip' might not be the right
2650 2650
 # tool to use in cross-compilation environments, therefore Automake
2651
-# will honor the `STRIP' environment variable to overrule this program.
2651
+# will honor the 'STRIP' environment variable to overrule this program.
2652 2652
 if test "$cross_compiling" != no; then
2653 2653
   if test -n "$ac_tool_prefix"; then
2654 2654
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
... ...
@@ -2667,7 +2697,7 @@ do
2667 2667
   IFS=$as_save_IFS
2668 2668
   test -z "$as_dir" && as_dir=.
2669 2669
     for ac_exec_ext in '' $ac_executable_extensions; do
2670
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2670
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2671 2671
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2672 2672
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2673 2673
     break 2
... ...
@@ -2707,7 +2737,7 @@ do
2707 2707
   IFS=$as_save_IFS
2708 2708
   test -z "$as_dir" && as_dir=.
2709 2709
     for ac_exec_ext in '' $ac_executable_extensions; do
2710
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2710
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2711 2711
     ac_cv_prog_ac_ct_STRIP="strip"
2712 2712
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2713 2713
     break 2
... ...
@@ -2758,7 +2788,7 @@ do
2758 2758
   test -z "$as_dir" && as_dir=.
2759 2759
     for ac_prog in mkdir gmkdir; do
2760 2760
 	 for ac_exec_ext in '' $ac_executable_extensions; do
2761
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
2761
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
2762 2762
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2763 2763
 	     'mkdir (GNU coreutils) '* | \
2764 2764
 	     'mkdir (coreutils) '* | \
... ...
@@ -2787,12 +2817,6 @@ fi
2787 2787
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
2788 2788
 $as_echo "$MKDIR_P" >&6; }
2789 2789
 
2790
-mkdir_p="$MKDIR_P"
2791
-case $mkdir_p in
2792
-  [\\/$]* | ?:[\\/]*) ;;
2793
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2794
-esac
2795
-
2796 2790
 for ac_prog in gawk mawk nawk awk
2797 2791
 do
2798 2792
   # Extract the first word of "$ac_prog", so it can be a program name with args.
... ...
@@ -2811,7 +2835,7 @@ do
2811 2811
   IFS=$as_save_IFS
2812 2812
   test -z "$as_dir" && as_dir=.
2813 2813
     for ac_exec_ext in '' $ac_executable_extensions; do
2814
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2814
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2815 2815
     ac_cv_prog_AWK="$ac_prog"
2816 2816
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2817 2817
     break 2
... ...
@@ -2875,6 +2899,45 @@ else
2875 2875
 fi
2876 2876
 rmdir .tst 2>/dev/null
2877 2877
 
2878
+# Check whether --enable-silent-rules was given.
2879
+if test "${enable_silent_rules+set}" = set; then :
2880
+  enableval=$enable_silent_rules;
2881
+fi
2882
+
2883
+case $enable_silent_rules in # (((
2884
+  yes) AM_DEFAULT_VERBOSITY=0;;
2885
+   no) AM_DEFAULT_VERBOSITY=1;;
2886
+    *) AM_DEFAULT_VERBOSITY=1;;
2887
+esac
2888
+am_make=${MAKE-make}
2889
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
2890
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
2891
+if ${am_cv_make_support_nested_variables+:} false; then :
2892
+  $as_echo_n "(cached) " >&6
2893
+else
2894
+  if $as_echo 'TRUE=$(BAR$(V))
2895
+BAR0=false
2896
+BAR1=true
2897
+V=1
2898
+am__doit:
2899
+	@$(TRUE)
2900
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
2901
+  am_cv_make_support_nested_variables=yes
2902
+else
2903
+  am_cv_make_support_nested_variables=no
2904
+fi
2905
+fi
2906
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
2907
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
2908
+if test $am_cv_make_support_nested_variables = yes; then
2909
+    AM_V='$(V)'
2910
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2911
+else
2912
+  AM_V=$AM_DEFAULT_VERBOSITY
2913
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2914
+fi
2915
+AM_BACKSLASH='\'
2916
+
2878 2917
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2879 2918
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2880 2919
   # is not polluted with repeated "-I."
... ...
@@ -2916,6 +2979,12 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2916 2916
 
2917 2917
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2918 2918
 
2919
+# For better backward compatibility.  To be removed once Automake 1.9.x
2920
+# dies out for good.  For more background, see:
2921
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2922
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2923
+mkdir_p='$(MKDIR_P)'
2924
+
2919 2925
 # We need awk for the "check" target.  The system "awk" is bad on
2920 2926
 # some platforms.
2921 2927
 # Always define AMTAR for backward compatibility.  Yes, it's still used
... ...
@@ -2923,101 +2992,151 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2923 2923
 AMTAR='$${TAR-tar}'
2924 2924
 
2925 2925
 
2926
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
2927
-$as_echo_n "checking how to create a pax tar archive... " >&6; }
2928
-# Loop over all known methods to create a tar archive until one works.
2926
+# We'll loop over all known methods to create a tar archive until one works.
2929 2927
 _am_tools='gnutar  pax cpio none'
2930
-_am_tools=${am_cv_prog_tar_pax-$_am_tools}
2931
-# Do not fold the above two line into one, because Tru64 sh and
2932
-# Solaris sh will not grok spaces in the rhs of `-'.
2933
-for _am_tool in $_am_tools
2934
-do
2935
-  case $_am_tool in
2936
-  gnutar)
2937
-    for _am_tar in tar gnutar gtar;
2938
-    do
2939
-      { echo "$as_me:$LINENO: $_am_tar --version" >&5
2928
+
2929
+
2930
+
2931
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
2932
+$as_echo_n "checking how to create a pax tar archive... " >&6; }
2933
+
2934
+  # Go ahead even if we have the value already cached.  We do so because we
2935
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
2936
+  _am_tools=${am_cv_prog_tar_pax-$_am_tools}
2937
+
2938
+  for _am_tool in $_am_tools; do
2939
+    case $_am_tool in
2940
+    gnutar)
2941
+      for _am_tar in tar gnutar gtar; do
2942
+        { echo "$as_me:$LINENO: $_am_tar --version" >&5
2940 2943
    ($_am_tar --version) >&5 2>&5
2941 2944
    ac_status=$?
2942 2945
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
2943 2946
    (exit $ac_status); } && break
2944
-    done
2945
-    am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
2946
-    am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
2947
-    am__untar="$_am_tar -xf -"
2948
-    ;;
2949
-  plaintar)
2950
-    # Must skip GNU tar: if it does not support --format= it doesn't create
2951
-    # ustar tarball either.
2952
-    (tar --version) >/dev/null 2>&1 && continue
2953
-    am__tar='tar chf - "$$tardir"'
2954
-    am__tar_='tar chf - "$tardir"'
2955
-    am__untar='tar xf -'
2956
-    ;;
2957
-  pax)
2958
-    am__tar='pax -L -x pax -w "$$tardir"'
2959
-    am__tar_='pax -L -x pax -w "$tardir"'
2960
-    am__untar='pax -r'
2961
-    ;;
2962
-  cpio)
2963
-    am__tar='find "$$tardir" -print | cpio -o -H pax -L'
2964
-    am__tar_='find "$tardir" -print | cpio -o -H pax -L'
2965
-    am__untar='cpio -i -H pax -d'
2966
-    ;;
2967
-  none)
2968
-    am__tar=false
2969
-    am__tar_=false
2970
-    am__untar=false
2971
-    ;;
2972
-  esac
2947
+      done
2948
+      am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
2949
+      am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
2950
+      am__untar="$_am_tar -xf -"
2951
+      ;;
2952
+    plaintar)
2953
+      # Must skip GNU tar: if it does not support --format= it doesn't create
2954
+      # ustar tarball either.
2955
+      (tar --version) >/dev/null 2>&1 && continue
2956
+      am__tar='tar chf - "$$tardir"'
2957
+      am__tar_='tar chf - "$tardir"'
2958
+      am__untar='tar xf -'
2959
+      ;;
2960
+    pax)
2961
+      am__tar='pax -L -x pax -w "$$tardir"'
2962
+      am__tar_='pax -L -x pax -w "$tardir"'
2963
+      am__untar='pax -r'
2964
+      ;;
2965
+    cpio)
2966
+      am__tar='find "$$tardir" -print | cpio -o -H pax -L'
2967
+      am__tar_='find "$tardir" -print | cpio -o -H pax -L'
2968
+      am__untar='cpio -i -H pax -d'
2969
+      ;;
2970
+    none)
2971
+      am__tar=false
2972
+      am__tar_=false
2973
+      am__untar=false
2974
+      ;;
2975
+    esac
2973 2976
 
2974
-  # If the value was cached, stop now.  We just wanted to have am__tar
2975
-  # and am__untar set.
2976
-  test -n "${am_cv_prog_tar_pax}" && break
2977
+    # If the value was cached, stop now.  We just wanted to have am__tar
2978
+    # and am__untar set.
2979
+    test -n "${am_cv_prog_tar_pax}" && break
2977 2980
 
2978
-  # tar/untar a dummy directory, and stop if the command works
2979
-  rm -rf conftest.dir
2980
-  mkdir conftest.dir
2981
-  echo GrepMe > conftest.dir/file
2982
-  { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
2981
+    # tar/untar a dummy directory, and stop if the command works.
2982
+    rm -rf conftest.dir
2983
+    mkdir conftest.dir
2984
+    echo GrepMe > conftest.dir/file
2985
+    { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
2983 2986
    (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
2984 2987
    ac_status=$?
2985 2988
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
2986 2989
    (exit $ac_status); }
2987
-  rm -rf conftest.dir
2988
-  if test -s conftest.tar; then
2989
-    { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
2990
+    rm -rf conftest.dir
2991
+    if test -s conftest.tar; then
2992
+      { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
2990 2993
    ($am__untar <conftest.tar) >&5 2>&5
2991 2994
    ac_status=$?
2992 2995
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
2993 2996
    (exit $ac_status); }
2994
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2995
-  fi
2996
-done
2997
-rm -rf conftest.dir
2997
+      { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
2998
+   (cat conftest.dir/file) >&5 2>&5
2999
+   ac_status=$?
3000
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
3001
+   (exit $ac_status); }
3002
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3003
+    fi
3004
+  done
3005
+  rm -rf conftest.dir
2998 3006
 
2999
-if ${am_cv_prog_tar_pax+:} false; then :
3007
+  if ${am_cv_prog_tar_pax+:} false; then :
3000 3008
   $as_echo_n "(cached) " >&6
3001 3009
 else
3002 3010
   am_cv_prog_tar_pax=$_am_tool
3003 3011
 fi
3004 3012
 
3005
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
3013
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
3006 3014
 $as_echo "$am_cv_prog_tar_pax" >&6; }
3007 3015
 
3008 3016
 
3009 3017
 
3010 3018
 
3011 3019
 
3020
+
3021
+# POSIX will say in a future version that running "rm -f" with no argument
3022
+# is OK; and we want to be able to make that assumption in our Makefile
3023
+# recipes.  So use an aggressive probe to check that the usage we want is
3024
+# actually supported "in the wild" to an acceptable degree.
3025
+# See automake bug#10828.
3026
+# To make any issue more visible, cause the running configure to be aborted
3027
+# by default if the 'rm' program in use doesn't match our expectations; the
3028
+# user can still override this though.
3029
+if rm -f && rm -fr && rm -rf; then : OK; else
3030
+  cat >&2 <<'END'
3031
+Oops!
3032
+
3033
+Your 'rm' program seems unable to run without file operands specified
3034
+on the command line, even when the '-f' option is present.  This is contrary
3035
+to the behaviour of most rm programs out there, and not conforming with
3036
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
3037
+
3038
+Please tell bug-automake@gnu.org about your system, including the value
3039
+of your $PATH and any error possibly output before this message.  This
3040
+can help us improve future automake versions.
3041
+
3042
+END
3043
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
3044
+    echo 'Configuration will proceed anyway, since you have set the' >&2
3045
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
3046
+    echo >&2
3047
+  else
3048
+    cat >&2 <<'END'
3049
+Aborting the configuration process, to ensure you take notice of the issue.
3050
+
3051
+You can download and install GNU coreutils to get an 'rm' implementation
3052
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
3053
+
3054
+If you want to complete the configuration process using your problematic
3055
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
3056
+to "yes", and re-run configure.
3057
+
3058
+END
3059
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
3060
+  fi
3061
+fi
3012 3062
 # Check whether --enable-silent-rules was given.
3013 3063
 if test "${enable_silent_rules+set}" = set; then :
3014 3064
   enableval=$enable_silent_rules;
3015 3065
 fi
3016 3066
 
3017
-case $enable_silent_rules in
3018
-yes) AM_DEFAULT_VERBOSITY=0;;
3019
-no)  AM_DEFAULT_VERBOSITY=1;;
3020
-*)   AM_DEFAULT_VERBOSITY=0;;
3067
+case $enable_silent_rules in # (((
3068
+  yes) AM_DEFAULT_VERBOSITY=0;;
3069
+   no) AM_DEFAULT_VERBOSITY=1;;
3070
+    *) AM_DEFAULT_VERBOSITY=0;;
3021 3071
 esac
3022 3072
 am_make=${MAKE-make}
3023 3073
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
... ...
@@ -3078,7 +3197,7 @@ do
3078 3078
   IFS=$as_save_IFS
3079 3079
   test -z "$as_dir" && as_dir=.
3080 3080
     for ac_exec_ext in '' $ac_executable_extensions; do
3081
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3081
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3082 3082
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
3083 3083
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3084 3084
     break 2
... ...
@@ -3122,7 +3241,7 @@ do
3122 3122
   IFS=$as_save_IFS
3123 3123
   test -z "$as_dir" && as_dir=.
3124 3124
     for ac_exec_ext in '' $ac_executable_extensions; do
3125
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3125
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3126 3126
     ac_cv_prog_ac_ct_CXX="$ac_prog"
3127 3127
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3128 3128
     break 2
... ...
@@ -3575,7 +3694,7 @@ am__quote=
3575 3575
 _am_result=none
3576 3576
 # First try GNU make style include.
3577 3577
 echo "include confinc" > confmf
3578
-# Ignore all kinds of additional output from `make'.
3578
+# Ignore all kinds of additional output from 'make'.
3579 3579
 case `$am_make -s -f confmf 2> /dev/null` in #(
3580 3580
 *the\ am__doit\ target*)
3581 3581
   am__include=include
... ...
@@ -3631,8 +3750,8 @@ else
3631 3631
   # We make a subdir and do the tests there.  Otherwise we can end up
3632 3632
   # making bogus files that we don't know about and never remove.  For
3633 3633
   # instance it was reported that on HP-UX the gcc test will end up
3634
-  # making a dummy file named `D' -- because `-MD' means `put the output
3635
-  # in D'.
3634
+  # making a dummy file named 'D' -- because '-MD' means "put the output
3635
+  # in D".
3636 3636
   rm -rf conftest.dir
3637 3637
   mkdir conftest.dir
3638 3638
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -3667,16 +3786,16 @@ else
3667 3667
     : > sub/conftest.c
3668 3668
     for i in 1 2 3 4 5 6; do
3669 3669
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
3670
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3671
-      # Solaris 8's {/usr,}/bin/sh.
3672
-      touch sub/conftst$i.h
3670
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
3671
+      # Solaris 10 /bin/sh.
3672
+      echo '/* dummy */' > sub/conftst$i.h
3673 3673
     done
3674 3674
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3675 3675
 
3676
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
3676
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
3677 3677
     # mode.  It turns out that the SunPro C++ compiler does not properly
3678
-    # handle `-M -o', and we need to detect this.  Also, some Intel
3679
-    # versions had trouble with output in subdirs
3678
+    # handle '-M -o', and we need to detect this.  Also, some Intel
3679
+    # versions had trouble with output in subdirs.
3680 3680
     am__obj=sub/conftest.${OBJEXT-o}
3681 3681
     am__minus_obj="-o $am__obj"
3682 3682
     case $depmode in
... ...
@@ -3685,8 +3804,8 @@ else
3685 3685
       test "$am__universal" = false || continue
3686 3686
       ;;
3687 3687
     nosideeffect)
3688
-      # after this tag, mechanisms are not by side-effect, so they'll
3689
-      # only be used when explicitly requested
3688
+      # After this tag, mechanisms are not by side-effect, so they'll
3689
+      # only be used when explicitly requested.
3690 3690
       if test "x$enable_dependency_tracking" = xyes; then
3691 3691
 	continue
3692 3692
       else
... ...
@@ -3694,7 +3813,7 @@ else
3694 3694
       fi
3695 3695
       ;;
3696 3696
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3697
-      # This compiler won't grok `-c -o', but also, the minuso test has
3697
+      # This compiler won't grok '-c -o', but also, the minuso test has
3698 3698
       # not run yet.  These depmodes are late enough in the game, and
3699 3699
       # so weak that their functioning should not be impacted.
3700 3700
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -3770,7 +3889,7 @@ do
3770 3770
   IFS=$as_save_IFS
3771 3771
   test -z "$as_dir" && as_dir=.
3772 3772
     for ac_exec_ext in '' $ac_executable_extensions; do
3773
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3773
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3774 3774
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
3775 3775
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3776 3776
     break 2
... ...
@@ -3810,7 +3929,7 @@ do
3810 3810
   IFS=$as_save_IFS
3811 3811
   test -z "$as_dir" && as_dir=.
3812 3812
     for ac_exec_ext in '' $ac_executable_extensions; do
3813
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3813
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3814 3814
     ac_cv_prog_ac_ct_CC="gcc"
3815 3815
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3816 3816
     break 2
... ...
@@ -3863,7 +3982,7 @@ do
3863 3863
   IFS=$as_save_IFS
3864 3864
   test -z "$as_dir" && as_dir=.
3865 3865
     for ac_exec_ext in '' $ac_executable_extensions; do
3866
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3866
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3867 3867
     ac_cv_prog_CC="${ac_tool_prefix}cc"
3868 3868
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3869 3869
     break 2
... ...
@@ -3904,7 +4023,7 @@ do
3904 3904
   IFS=$as_save_IFS
3905 3905
   test -z "$as_dir" && as_dir=.
3906 3906
     for ac_exec_ext in '' $ac_executable_extensions; do
3907
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3907
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3908 3908
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3909 3909
        ac_prog_rejected=yes
3910 3910
        continue
... ...
@@ -3962,7 +4081,7 @@ do
3962 3962
   IFS=$as_save_IFS
3963 3963
   test -z "$as_dir" && as_dir=.
3964 3964
     for ac_exec_ext in '' $ac_executable_extensions; do
3965
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3965
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3966 3966
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3967 3967
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3968 3968
     break 2
... ...
@@ -4006,7 +4125,7 @@ do
4006 4006
   IFS=$as_save_IFS
4007 4007
   test -z "$as_dir" && as_dir=.
4008 4008
     for ac_exec_ext in '' $ac_executable_extensions; do
4009
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4009
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4010 4010
     ac_cv_prog_ac_ct_CC="$ac_prog"
4011 4011
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4012 4012
     break 2
... ...
@@ -4202,8 +4321,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4202 4202
 /* end confdefs.h.  */
4203 4203
 #include <stdarg.h>
4204 4204
 #include <stdio.h>
4205
-#include <sys/types.h>
4206
-#include <sys/stat.h>
4205
+struct stat;
4207 4206
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4208 4207
 struct buf { int x; };
4209 4208
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
... ...
@@ -4288,6 +4406,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4288 4288
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4289 4289
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4290 4290
 
4291
+ac_ext=c
4292
+ac_cpp='$CPP $CPPFLAGS'
4293
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4294
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4295
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4296
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
4297
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
4298
+if ${am_cv_prog_cc_c_o+:} false; then :
4299
+  $as_echo_n "(cached) " >&6
4300
+else
4301
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4302
+/* end confdefs.h.  */
4303
+
4304
+int
4305
+main ()
4306
+{
4307
+
4308
+  ;
4309
+  return 0;
4310
+}
4311
+_ACEOF
4312
+  # Make sure it works both with $CC and with simple cc.
4313
+  # Following AC_PROG_CC_C_O, we do the test twice because some
4314
+  # compilers refuse to overwrite an existing .o file with -o,
4315
+  # though they will create one.
4316
+  am_cv_prog_cc_c_o=yes
4317
+  for am_i in 1 2; do
4318
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
4319
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
4320
+   ac_status=$?
4321
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
4322
+   (exit $ac_status); } \
4323
+         && test -f conftest2.$ac_objext; then
4324
+      : OK
4325
+    else
4326
+      am_cv_prog_cc_c_o=no
4327
+      break
4328
+    fi
4329
+  done
4330
+  rm -f core conftest*
4331
+  unset am_i
4332
+fi
4333
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
4334
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
4335
+if test "$am_cv_prog_cc_c_o" != yes; then
4336
+   # Losing compiler, so override with the script.
4337
+   # FIXME: It is wrong to rewrite CC.
4338
+   # But if we don't then we get into trouble of one sort or another.
4339
+   # A longer-term fix would be to have automake use am__CC in this case,
4340
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
4341
+   CC="$am_aux_dir/compile $CC"
4342
+fi
4343
+ac_ext=c
4344
+ac_cpp='$CPP $CPPFLAGS'
4345
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4346
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4347
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4348
+
4349
+
4291 4350
 depcc="$CC"   am_compiler_list=
4292 4351
 
4293 4352
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
... ...
@@ -4299,8 +4476,8 @@ else
4299 4299
   # We make a subdir and do the tests there.  Otherwise we can end up
4300 4300
   # making bogus files that we don't know about and never remove.  For
4301 4301
   # instance it was reported that on HP-UX the gcc test will end up
4302
-  # making a dummy file named `D' -- because `-MD' means `put the output
4303
-  # in D'.
4302
+  # making a dummy file named 'D' -- because '-MD' means "put the output
4303
+  # in D".
4304 4304
   rm -rf conftest.dir
4305 4305
   mkdir conftest.dir
4306 4306
   # Copy depcomp to subdir because otherwise we won't find it if we're
... ...
@@ -4335,16 +4512,16 @@ else
4335 4335
     : > sub/conftest.c
4336 4336
     for i in 1 2 3 4 5 6; do
4337 4337
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
4338
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
4339
-      # Solaris 8's {/usr,}/bin/sh.
4340
-      touch sub/conftst$i.h
4338
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
4339
+      # Solaris 10 /bin/sh.
4340
+      echo '/* dummy */' > sub/conftst$i.h
4341 4341
     done
4342 4342
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4343 4343
 
4344
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
4344
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
4345 4345
     # mode.  It turns out that the SunPro C++ compiler does not properly
4346
-    # handle `-M -o', and we need to detect this.  Also, some Intel
4347
-    # versions had trouble with output in subdirs
4346
+    # handle '-M -o', and we need to detect this.  Also, some Intel
4347
+    # versions had trouble with output in subdirs.
4348 4348
     am__obj=sub/conftest.${OBJEXT-o}
4349 4349
     am__minus_obj="-o $am__obj"
4350 4350
     case $depmode in
... ...
@@ -4353,8 +4530,8 @@ else
4353 4353
       test "$am__universal" = false || continue
4354 4354
       ;;
4355 4355
     nosideeffect)
4356
-      # after this tag, mechanisms are not by side-effect, so they'll
4357
-      # only be used when explicitly requested
4356
+      # After this tag, mechanisms are not by side-effect, so they'll
4357
+      # only be used when explicitly requested.
4358 4358
       if test "x$enable_dependency_tracking" = xyes; then
4359 4359
 	continue
4360 4360
       else
... ...
@@ -4362,7 +4539,7 @@ else
4362 4362
       fi
4363 4363
       ;;
4364 4364
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
4365
-      # This compiler won't grok `-c -o', but also, the minuso test has
4365
+      # This compiler won't grok '-c -o', but also, the minuso test has
4366 4366
       # not run yet.  These depmodes are late enough in the game, and
4367 4367
       # so weak that their functioning should not be impacted.
4368 4368
       am__obj=conftest.${OBJEXT-o}
... ...
@@ -4571,7 +4748,7 @@ do
4571 4571
     for ac_prog in grep ggrep; do
4572 4572
     for ac_exec_ext in '' $ac_executable_extensions; do
4573 4573
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4574
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4574
+      as_fn_executable_p "$ac_path_GREP" || continue
4575 4575
 # Check for GNU ac_path_GREP and select it if it is found.
4576 4576
   # Check for GNU $ac_path_GREP
4577 4577
 case `"$ac_path_GREP" --version 2>&1` in
... ...
@@ -4637,7 +4814,7 @@ do
4637 4637
     for ac_prog in egrep; do
4638 4638
     for ac_exec_ext in '' $ac_executable_extensions; do
4639 4639
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4640
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4640
+      as_fn_executable_p "$ac_path_EGREP" || continue
4641 4641
 # Check for GNU ac_path_EGREP and select it if it is found.
4642 4642
   # Check for GNU $ac_path_EGREP
4643 4643
 case `"$ac_path_EGREP" --version 2>&1` in
... ...
@@ -5190,7 +5367,7 @@ do
5190 5190
     for ac_prog in sed gsed; do
5191 5191
     for ac_exec_ext in '' $ac_executable_extensions; do
5192 5192
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
5193
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
5193
+      as_fn_executable_p "$ac_path_SED" || continue
5194 5194
 # Check for GNU ac_path_SED and select it if it is found.
5195 5195
   # Check for GNU $ac_path_SED
5196 5196
 case `"$ac_path_SED" --version 2>&1` in
... ...
@@ -5269,7 +5446,7 @@ do
5269 5269
     for ac_prog in fgrep; do
5270 5270
     for ac_exec_ext in '' $ac_executable_extensions; do
5271 5271
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
5272
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
5272
+      as_fn_executable_p "$ac_path_FGREP" || continue
5273 5273
 # Check for GNU ac_path_FGREP and select it if it is found.
5274 5274
   # Check for GNU $ac_path_FGREP
5275 5275
 case `"$ac_path_FGREP" --version 2>&1` in
... ...
@@ -5525,7 +5702,7 @@ do
5525 5525
   IFS=$as_save_IFS
5526 5526
   test -z "$as_dir" && as_dir=.
5527 5527
     for ac_exec_ext in '' $ac_executable_extensions; do
5528
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5528
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5529 5529
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
5530 5530
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5531 5531
     break 2
... ...
@@ -5569,7 +5746,7 @@ do
5569 5569
   IFS=$as_save_IFS
5570 5570
   test -z "$as_dir" && as_dir=.
5571 5571
     for ac_exec_ext in '' $ac_executable_extensions; do
5572
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5572
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5573 5573
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
5574 5574
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5575 5575
     break 2
... ...
@@ -5993,7 +6170,7 @@ do
5993 5993
   IFS=$as_save_IFS
5994 5994
   test -z "$as_dir" && as_dir=.
5995 5995
     for ac_exec_ext in '' $ac_executable_extensions; do
5996
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5996
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5997 5997
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5998 5998
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5999 5999
     break 2
... ...
@@ -6033,7 +6210,7 @@ do
6033 6033
   IFS=$as_save_IFS
6034 6034
   test -z "$as_dir" && as_dir=.
6035 6035
     for ac_exec_ext in '' $ac_executable_extensions; do
6036
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6036
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6037 6037
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
6038 6038
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6039 6039
     break 2
... ...
@@ -6339,7 +6516,7 @@ do
6339 6339
   IFS=$as_save_IFS
6340 6340
   test -z "$as_dir" && as_dir=.
6341 6341
     for ac_exec_ext in '' $ac_executable_extensions; do
6342
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6342
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6343 6343
     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6344 6344
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6345 6345
     break 2
... ...
@@ -6379,7 +6556,7 @@ do
6379 6379
   IFS=$as_save_IFS
6380 6380
   test -z "$as_dir" && as_dir=.
6381 6381
     for ac_exec_ext in '' $ac_executable_extensions; do
6382
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6382
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6383 6383
     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6384 6384
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6385 6385
     break 2
... ...
@@ -6482,7 +6659,7 @@ do
6482 6482
   IFS=$as_save_IFS
6483 6483
   test -z "$as_dir" && as_dir=.
6484 6484
     for ac_exec_ext in '' $ac_executable_extensions; do
6485
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6485
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6486 6486
     ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
6487 6487
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6488 6488
     break 2
... ...
@@ -6526,7 +6703,7 @@ do
6526 6526
   IFS=$as_save_IFS
6527 6527
   test -z "$as_dir" && as_dir=.
6528 6528
     for ac_exec_ext in '' $ac_executable_extensions; do
6529
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6529
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6530 6530
     ac_cv_prog_ac_ct_AR="$ac_prog"
6531 6531
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6532 6532
     break 2
... ...
@@ -6651,7 +6828,7 @@ do
6651 6651
   IFS=$as_save_IFS
6652 6652
   test -z "$as_dir" && as_dir=.
6653 6653
     for ac_exec_ext in '' $ac_executable_extensions; do
6654
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6654
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6655 6655
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6656 6656
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6657 6657
     break 2
... ...
@@ -6691,7 +6868,7 @@ do
6691 6691
   IFS=$as_save_IFS
6692 6692
   test -z "$as_dir" && as_dir=.
6693 6693
     for ac_exec_ext in '' $ac_executable_extensions; do
6694
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6694
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6695 6695
     ac_cv_prog_ac_ct_STRIP="strip"
6696 6696
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6697 6697
     break 2
... ...
@@ -6750,7 +6927,7 @@ do
6750 6750
   IFS=$as_save_IFS
6751 6751
   test -z "$as_dir" && as_dir=.
6752 6752
     for ac_exec_ext in '' $ac_executable_extensions; do
6753
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6753
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6754 6754
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6755 6755
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6756 6756
     break 2
... ...
@@ -6790,7 +6967,7 @@ do
6790 6790
   IFS=$as_save_IFS
6791 6791
   test -z "$as_dir" && as_dir=.
6792 6792
     for ac_exec_ext in '' $ac_executable_extensions; do
6793
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6793
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6794 6794
     ac_cv_prog_ac_ct_RANLIB="ranlib"
6795 6795
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6796 6796
     break 2
... ...
@@ -7439,7 +7616,7 @@ do
7439 7439
   IFS=$as_save_IFS
7440 7440
   test -z "$as_dir" && as_dir=.
7441 7441
     for ac_exec_ext in '' $ac_executable_extensions; do
7442
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7442
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7443 7443
     ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
7444 7444
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7445 7445
     break 2
... ...
@@ -7479,7 +7656,7 @@ do
7479 7479
   IFS=$as_save_IFS
7480 7480
   test -z "$as_dir" && as_dir=.
7481 7481
     for ac_exec_ext in '' $ac_executable_extensions; do
7482
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7482
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7483 7483
     ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
7484 7484
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7485 7485
     break 2
... ...
@@ -7559,7 +7736,7 @@ do
7559 7559
   IFS=$as_save_IFS
7560 7560
   test -z "$as_dir" && as_dir=.
7561 7561
     for ac_exec_ext in '' $ac_executable_extensions; do
7562
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7562
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7563 7563
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
7564 7564
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7565 7565
     break 2
... ...
@@ -7599,7 +7776,7 @@ do
7599 7599
   IFS=$as_save_IFS
7600 7600
   test -z "$as_dir" && as_dir=.
7601 7601
     for ac_exec_ext in '' $ac_executable_extensions; do
7602
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7602
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7603 7603
     ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
7604 7604
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7605 7605
     break 2
... ...
@@ -7651,7 +7828,7 @@ do
7651 7651
   IFS=$as_save_IFS
7652 7652
   test -z "$as_dir" && as_dir=.
7653 7653
     for ac_exec_ext in '' $ac_executable_extensions; do
7654
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7654
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7655 7655
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
7656 7656
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7657 7657
     break 2
... ...
@@ -7691,7 +7868,7 @@ do
7691 7691
   IFS=$as_save_IFS
7692 7692
   test -z "$as_dir" && as_dir=.
7693 7693
     for ac_exec_ext in '' $ac_executable_extensions; do
7694
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7694
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7695 7695
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
7696 7696
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7697 7697
     break 2
... ...
@@ -7743,7 +7920,7 @@ do
7743 7743
   IFS=$as_save_IFS
7744 7744
   test -z "$as_dir" && as_dir=.
7745 7745
     for ac_exec_ext in '' $ac_executable_extensions; do
7746
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7746
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7747 7747
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7748 7748
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7749 7749
     break 2
... ...
@@ -7783,7 +7960,7 @@ do
7783 7783
   IFS=$as_save_IFS
7784 7784
   test -z "$as_dir" && as_dir=.
7785 7785
     for ac_exec_ext in '' $ac_executable_extensions; do
7786
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7786
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7787 7787
     ac_cv_prog_ac_ct_LIPO="lipo"
7788 7788
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7789 7789
     break 2
... ...
@@ -7835,7 +8012,7 @@ do
7835 7835
   IFS=$as_save_IFS
7836 7836
   test -z "$as_dir" && as_dir=.
7837 7837
     for ac_exec_ext in '' $ac_executable_extensions; do
7838
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7838
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7839 7839
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7840 7840
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7841 7841
     break 2
... ...
@@ -7875,7 +8052,7 @@ do
7875 7875
   IFS=$as_save_IFS
7876 7876
   test -z "$as_dir" && as_dir=.
7877 7877
     for ac_exec_ext in '' $ac_executable_extensions; do
7878
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7878
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7879 7879
     ac_cv_prog_ac_ct_OTOOL="otool"
7880 7880
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7881 7881
     break 2
... ...
@@ -7927,7 +8104,7 @@ do
7927 7927
   IFS=$as_save_IFS
7928 7928
   test -z "$as_dir" && as_dir=.
7929 7929
     for ac_exec_ext in '' $ac_executable_extensions; do
7930
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7930
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7931 7931
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7932 7932
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7933 7933
     break 2
... ...
@@ -7967,7 +8144,7 @@ do
7967 7967
   IFS=$as_save_IFS
7968 7968
   test -z "$as_dir" && as_dir=.
7969 7969
     for ac_exec_ext in '' $ac_executable_extensions; do
7970
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7970
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7971 7971
     ac_cv_prog_ac_ct_OTOOL64="otool64"
7972 7972
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7973 7973
     break 2
... ...
@@ -15444,22 +15621,8 @@ if test "${with_system_llvm+set}" = set; then :
15444 15444
  if test "x$llvmconfig" != "x"; then
15445 15445
      llvmver=`$llvmconfig --version`
15446 15446
 
15447
-     LLVMCONFIG_CXXFLAGS=`$llvmconfig --cxxflags`
15448
-
15449
-     LLVMCONFIG_LDFLAGS=`$llvmconfig --ldflags`
15450
-
15451
-     LLVMCONFIG_LIBS=`$llvmconfig --libs jit nativecodegen scalaropts ipo`
15452
-
15453
-     LLVMCONFIG_LIBFILES=`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`
15454
-
15455 15447
      { $as_echo "$as_me:${as_lineno-$LINENO}: Using external LLVM" >&5
15456 15448
 $as_echo "$as_me: Using external LLVM" >&6;}
15457
-     { $as_echo "$as_me:${as_lineno-$LINENO}: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&5
15458
-$as_echo "$as_me: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&6;}
15459
-     { $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&5
15460
-$as_echo "$as_me: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&6;}
15461
-     { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&5
15462
-$as_echo "$as_me: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&6;}
15463 15449
  fi
15464 15450
 
15465 15451
 fi
... ...
@@ -15493,15 +15656,38 @@ elif test $llvmver_test -lt 290; then
15493 15493
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($llvmver)" >&5
15494 15494
 $as_echo "no ($llvmver)" >&6; }
15495 15495
     as_fn_error $? "LLVM >= 2.9 required, but \"$llvmver\"($llvmver_test) found" "$LINENO" 5
15496
-elif test $llvmver_test -gt 342; then
15496
+elif test $llvmver_test -ge 360; then
15497 15497
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($llvmver)" >&5
15498 15498
 $as_echo "no ($llvmver)" >&6; }
15499
-    as_fn_error $? "LLVM <= 3.4.2 required, but \"$llvmver\"($llvmver_test) found" "$LINENO" 5
15499
+    as_fn_error $? "LLVM < 3.6 required, but \"$llvmver\"($llvmver_test) found" "$LINENO" 5
15500 15500
 else
15501 15501
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($llvmver)" >&5
15502 15502
 $as_echo "ok ($llvmver)" >&6; }
15503 15503
 fi
15504 15504
 
15505
+if test "x$llvmconfig" != "x"; then
15506
+    LLVMCONFIG_CXXFLAGS=`$llvmconfig --cxxflags`
15507
+
15508
+    if test $llvmver_test -ge 350; then
15509
+                ldflags=`$llvmconfig --ldflags`
15510
+        syslibs=`$llvmconfig --system-libs`
15511
+        LLVMCONFIG_LDFLAGS="$ldflags $syslibs"
15512
+
15513
+    else
15514
+        LLVMCONFIG_LDFLAGS=`$llvmconfig --ldflags`
15515
+
15516
+    fi
15517
+    LLVMCONFIG_LIBS=`$llvmconfig --libs jit nativecodegen scalaropts ipo`
15518
+
15519
+    LLVMCONFIG_LIBFILES=`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`
15520
+
15521
+    { $as_echo "$as_me:${as_lineno-$LINENO}: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&5
15522
+$as_echo "$as_me: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&6;}
15523
+    { $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&5
15524
+$as_echo "$as_me: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&6;}
15525
+    { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&5
15526
+$as_echo "$as_me: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&6;}
15527
+fi
15505 15528
 llvmver_int=${llvmver_major}${llvmver_minor}
15506 15529
 
15507 15530
 LLVM_VERSION=$llvmver_int
... ...
@@ -15735,220 +15921,6 @@ else
15735 15735
 fi
15736 15736
 
15737 15737
 
15738
-
15739
-
15740
-# Check whether --with-libjson was given.
15741
-if test "${with_libjson+set}" = set; then :
15742
-  withval=$with_libjson;
15743
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjson installation" >&5
15744
-$as_echo_n "checking for libjson installation... " >&6; }
15745
-if test "X$withval" != "Xyes"
15746
-then
15747
-  LIBJSON_HOME="$withval"
15748
-  if test -f "$LIBJSON_HOME/include/json/json.h" -o -f "$LIBJSON_HOME/include/json-c/json.h"
15749
-  then
15750
-    have_json_header="yes"
15751
-  fi
15752
-else
15753
-  LIBJSON_HOME=/usr/local
15754
-  if test -f "$LIBJSON_HOME/include/json/json.h" -o -f "$LIBJSON_HOME/include/json-c/json.h"
15755
-  then
15756
-    have_json_header="yes"
15757
-  else
15758
-    LIBJSON_HOME=/usr
15759
-    if test -f "$LIBJSON_HOME/include/json/json.h" -o -f "$LIBJSON_HOME/include/json-c/json.h"
15760
-    then
15761
-      have_json_header="yes"
15762
-    else
15763
-      have_json_header="no"
15764
-      LIBJSON_HOME=""
15765
-    fi
15766
-  fi
15767
-fi
15768
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBJSON_HOME" >&5
15769
-$as_echo "$LIBJSON_HOME" >&6; }
15770
-
15771
-else
15772
-
15773
-have_json_header="no"
15774
-
15775
-fi
15776
-
15777
-
15778
-if test "X$have_json_header" = "Xyes"
15779
-then
15780
-  if test -f "$LIBJSON_HOME/include/json/json.h"
15781
-  then
15782
-    JSON_INCLUDE="include/json"
15783
-  fi
15784
-  if test -f "$LIBJSON_HOME/include/json-c/json.h"
15785
-  then
15786
-    JSON_INCLUDE="include/json-c"
15787
-  fi
15788
-  if test -z $JSON_INCLUDE
15789
-  then
15790
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: json header lost." >&5
15791
-$as_echo "$as_me: WARNING: json header lost." >&2;}
15792
-  fi
15793
-
15794
-  JSON_CPPFLAGS="-I$LIBJSON_HOME/$JSON_INCLUDE"
15795
-  save_LDFLAGS="$LDFLAGS"
15796
-  save_CFLAGS="$CFLAGS"
15797
-  save_LIBS="$LIBS"
15798
-  LIBS=""
15799
-  JSON_LIBS=""
15800
-  if test "$LIBJSON_HOME" != "/usr"
15801
-  then
15802
-    JSON_LDFLAGS="-L$LIBJSON_HOME/lib"
15803
-    LDFLAGS="$LDFLAGS $JSON_LDFLAGS"
15804
-    CFLAGS="$CFLAGS $JSON_CPPFLAGS"
15805
-  fi
15806
-
15807
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing json_object_object_get_ex" >&5
15808
-$as_echo_n "checking for library containing json_object_object_get_ex... " >&6; }
15809
-if ${ac_cv_search_json_object_object_get_ex+:} false; then :
15810
-  $as_echo_n "(cached) " >&6
15811
-else
15812
-  ac_func_search_save_LIBS=$LIBS
15813
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15814
-/* end confdefs.h.  */
15815
-
15816
-/* Override any GCC internal prototype to avoid an error.
15817
-   Use char because int might match the return type of a GCC
15818
-   builtin and then its argument prototype would still apply.  */
15819
-#ifdef __cplusplus
15820
-extern "C"
15821
-#endif
15822
-char json_object_object_get_ex ();
15823
-int
15824
-main ()
15825
-{
15826
-return json_object_object_get_ex ();
15827
-  ;
15828
-  return 0;
15829
-}
15830
-_ACEOF
15831
-for ac_lib in '' json-c json; do
15832
-  if test -z "$ac_lib"; then
15833
-    ac_res="none required"
15834
-  else
15835
-    ac_res=-l$ac_lib
15836
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15837
-  fi
15838
-  if ac_fn_c_try_link "$LINENO"; then :
15839
-  ac_cv_search_json_object_object_get_ex=$ac_res
15840
-fi
15841
-rm -f core conftest.err conftest.$ac_objext \
15842
-    conftest$ac_exeext
15843
-  if ${ac_cv_search_json_object_object_get_ex+:} false; then :
15844
-  break
15845
-fi
15846
-done
15847
-if ${ac_cv_search_json_object_object_get_ex+:} false; then :
15848
-
15849
-else
15850
-  ac_cv_search_json_object_object_get_ex=no
15851
-fi
15852
-rm conftest.$ac_ext
15853
-LIBS=$ac_func_search_save_LIBS
15854
-fi
15855
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_json_object_object_get_ex" >&5
15856
-$as_echo "$ac_cv_search_json_object_object_get_ex" >&6; }
15857
-ac_res=$ac_cv_search_json_object_object_get_ex
15858
-if test "$ac_res" != no; then :
15859
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15860
-
15861
-have_json="yes"
15862
-have_deprecated_json="no"
15863
-else
15864
-
15865
-have_json="no"
15866
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing json_object_object_get" >&5
15867
-$as_echo_n "checking for library containing json_object_object_get... " >&6; }
15868
-if ${ac_cv_search_json_object_object_get+:} false; then :
15869
-  $as_echo_n "(cached) " >&6
15870
-else
15871
-  ac_func_search_save_LIBS=$LIBS
15872
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15873
-/* end confdefs.h.  */
15874
-
15875
-/* Override any GCC internal prototype to avoid an error.
15876
-   Use char because int might match the return type of a GCC
15877
-   builtin and then its argument prototype would still apply.  */
15878
-#ifdef __cplusplus
15879
-extern "C"
15880
-#endif
15881
-char json_object_object_get ();
15882
-int
15883
-main ()
15884
-{
15885
-return json_object_object_get ();
15886
-  ;
15887
-  return 0;
15888
-}
15889
-_ACEOF
15890
-for ac_lib in '' json-c json; do
15891
-  if test -z "$ac_lib"; then
15892
-    ac_res="none required"
15893
-  else
15894
-    ac_res=-l$ac_lib
15895
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15896
-  fi
15897
-  if ac_fn_c_try_link "$LINENO"; then :
15898
-  ac_cv_search_json_object_object_get=$ac_res
15899
-fi
15900
-rm -f core conftest.err conftest.$ac_objext \
15901
-    conftest$ac_exeext
15902
-  if ${ac_cv_search_json_object_object_get+:} false; then :
15903
-  break
15904
-fi
15905
-done
15906
-if ${ac_cv_search_json_object_object_get+:} false; then :
15907
-
15908
-else
15909
-  ac_cv_search_json_object_object_get=no
15910
-fi
15911
-rm conftest.$ac_ext
15912
-LIBS=$ac_func_search_save_LIBS
15913
-fi
15914
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_json_object_object_get" >&5
15915
-$as_echo "$ac_cv_search_json_object_object_get" >&6; }
15916
-ac_res=$ac_cv_search_json_object_object_get
15917
-if test "$ac_res" != no; then :
15918
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15919
-
15920
-have_json="yes"
15921
-have_deprecated_json="yes"
15922
-
15923
-fi
15924
-
15925
-
15926
-fi
15927
-
15928
-
15929
-  CFLAGS="$save_CFLAGS"
15930
-  LDFLAGS="$save_LDFLAGS"
15931
-fi
15932
-
15933
-if test "X$have_json" = "Xyes"; then
15934
-
15935
-$as_echo "#define HAVE_JSON 1" >>confdefs.h
15936
-
15937
-  if test "X$have_deprecated_json" = "Xyes"; then
15938
-
15939
-$as_echo "#define HAVE_DEPRECATED_JSON 1" >>confdefs.h
15940
-
15941
-  fi
15942
-  JSON_LIBS="$LIBS"
15943
-fi
15944
-
15945
-LIBS="$save_LIBS"
15946
-
15947
-
15948
-
15949
-
15950
-
15951
-
15952 15738
 ac_config_files="$ac_config_files Makefile"
15953 15739
 
15954 15740
 cat >confcache <<\_ACEOF
... ...
@@ -16060,6 +16032,14 @@ LIBOBJS=$ac_libobjs
16060 16060
 LTLIBOBJS=$ac_ltlibobjs
16061 16061
 
16062 16062
 
16063
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
16064
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
16065
+   if test -n "$am_sleep_pid"; then
16066
+     # Hide warnings about reused PIDs.
16067
+     wait $am_sleep_pid 2>/dev/null
16068
+   fi
16069
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
16070
+$as_echo "done" >&6; }
16063 16071
  if test -n "$EXEEXT"; then
16064 16072
   am__EXEEXT_TRUE=
16065 16073
   am__EXEEXT_FALSE='#'
... ...
@@ -16399,16 +16379,16 @@ if (echo >conf$$.file) 2>/dev/null; then
16399 16399
     # ... but there are two gotchas:
16400 16400
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
16401 16401
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
16402
-    # In both cases, we have to default to `cp -p'.
16402
+    # In both cases, we have to default to `cp -pR'.
16403 16403
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
16404
-      as_ln_s='cp -p'
16404
+      as_ln_s='cp -pR'
16405 16405
   elif ln conf$$.file conf$$ 2>/dev/null; then
16406 16406
     as_ln_s=ln
16407 16407
   else
16408
-    as_ln_s='cp -p'
16408
+    as_ln_s='cp -pR'
16409 16409
   fi
16410 16410
 else
16411
-  as_ln_s='cp -p'
16411
+  as_ln_s='cp -pR'
16412 16412
 fi
16413 16413
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
16414 16414
 rmdir conf$$.dir 2>/dev/null
... ...
@@ -16468,28 +16448,16 @@ else
16468 16468
   as_mkdir_p=false
16469 16469
 fi
16470 16470
 
16471
-if test -x / >/dev/null 2>&1; then
16472
-  as_test_x='test -x'
16473
-else
16474
-  if ls -dL / >/dev/null 2>&1; then
16475
-    as_ls_L_option=L
16476
-  else
16477
-    as_ls_L_option=
16478
-  fi
16479
-  as_test_x='
16480
-    eval sh -c '\''
16481
-      if test -d "$1"; then
16482
-	test -d "$1/.";
16483
-      else
16484
-	case $1 in #(
16485
-	-*)set "./$1";;
16486
-	esac;
16487
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
16488
-	???[sx]*):;;*)false;;esac;fi
16489
-    '\'' sh
16490
-  '
16491
-fi
16492
-as_executable_p=$as_test_x
16471
+
16472
+# as_fn_executable_p FILE
16473
+# -----------------------
16474
+# Test if FILE is an executable regular file.
16475
+as_fn_executable_p ()
16476
+{
16477
+  test -f "$1" && test -x "$1"
16478
+} # as_fn_executable_p
16479
+as_test_x='test -x'
16480
+as_executable_p=as_fn_executable_p
16493 16481
 
16494 16482
 # Sed expression to map a string onto a valid CPP name.
16495 16483
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
... ...
@@ -16511,7 +16479,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16511 16511
 # values after options handling.
16512 16512
 ac_log="
16513 16513
 This file was extended by libclamavc++ $as_me devel, which was
16514
-generated by GNU Autoconf 2.68.  Invocation command line was
16514
+generated by GNU Autoconf 2.69.  Invocation command line was
16515 16515
 
16516 16516
   CONFIG_FILES    = $CONFIG_FILES
16517 16517
   CONFIG_HEADERS  = $CONFIG_HEADERS
... ...
@@ -16577,10 +16545,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16577 16577
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
16578 16578
 ac_cs_version="\\
16579 16579
 libclamavc++ config.status devel
16580
-configured by $0, generated by GNU Autoconf 2.68,
16580
+configured by $0, generated by GNU Autoconf 2.69,
16581 16581
   with options \\"\$ac_cs_config\\"
16582 16582
 
16583
-Copyright (C) 2010 Free Software Foundation, Inc.
16583
+Copyright (C) 2012 Free Software Foundation, Inc.
16584 16584
 This config.status script is free software; the Free Software Foundation
16585 16585
 gives unlimited permission to copy, distribute and modify it."
16586 16586
 
... ...
@@ -16671,7 +16639,7 @@ fi
16671 16671
 _ACEOF
16672 16672
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16673 16673
 if \$ac_cs_recheck; then
16674
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16674
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16675 16675
   shift
16676 16676
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
16677 16677
   CONFIG_SHELL='$SHELL'
... ...
@@ -17680,7 +17648,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
17680 17680
 
17681 17681
   case $ac_file$ac_mode in
17682 17682
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
17683
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
17683
+  # Older Autoconf quotes --file arguments for eval, but not when files
17684 17684
   # are listed without --file.  Let's play safe and only enable the eval
17685 17685
   # if we detect the quoting.
17686 17686
   case $CONFIG_FILES in
... ...
@@ -17693,7 +17661,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
17693 17693
     # Strip MF so we end up with the name of the file.
17694 17694
     mf=`echo "$mf" | sed -e 's/:.*$//'`
17695 17695
     # Check whether this is an Automake generated Makefile or not.
17696
-    # We used to match only the files named `Makefile.in', but
17696
+    # We used to match only the files named 'Makefile.in', but
17697 17697
     # some people rename them; so instead we look at the file content.
17698 17698
     # Grep'ing the first line is not enough: some people post-process
17699 17699
     # each Makefile.in and add a new line on top of each file to say so.
... ...
@@ -17727,21 +17695,19 @@ $as_echo X"$mf" |
17727 17727
       continue
17728 17728
     fi
17729 17729
     # Extract the definition of DEPDIR, am__include, and am__quote
17730
-    # from the Makefile without running `make'.
17730
+    # from the Makefile without running 'make'.
17731 17731
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
17732 17732
     test -z "$DEPDIR" && continue
17733 17733
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
17734
-    test -z "am__include" && continue
17734
+    test -z "$am__include" && continue
17735 17735
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
17736
-    # When using ansi2knr, U may be empty or an underscore; expand it
17737
-    U=`sed -n 's/^U = //p' < "$mf"`
17738 17736
     # Find all dependency output files, they are included files with
17739 17737
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
17740 17738
     # simplest approach to changing $(DEPDIR) to its actual value in the
17741 17739
     # expansion.
17742 17740
     for file in `sed -n "
17743 17741
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
17744
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
17742
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
17745 17743
       # Make sure the directory exists.
17746 17744
       test -f "$dirpart/$file" && continue
17747 17745
       fdir=`$as_dirname -- "$file" ||
... ...
@@ -74,14 +74,7 @@ AC_ARG_WITH([system-llvm], AC_HELP_STRING([--with-system-llvm],
74 74
  if test "x$llvmconfig" != "x"; then
75 75
      llvmver=`$llvmconfig --version`
76 76
 
77
-     AC_SUBST(LLVMCONFIG_CXXFLAGS, [`$llvmconfig --cxxflags`])
78
-     AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
79
-     AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs jit nativecodegen scalaropts ipo`])
80
-     AC_SUBST(LLVMCONFIG_LIBFILES, [`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`])
81 77
      AC_MSG_NOTICE([Using external LLVM])
82
-     AC_MSG_NOTICE([CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS])
83
-     AC_MSG_NOTICE([LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS])
84
-     AC_MSG_NOTICE([LIBS from llvm-config: $LLVMCONFIG_LIBS])
85 78
  fi
86 79
 ])
87 80
 
... ...
@@ -110,13 +103,30 @@ if test "x$packaged_llvm" = "xyes"; then
110 110
 elif test $llvmver_test -lt 290; then
111 111
     AC_MSG_RESULT([no ($llvmver)])
112 112
     AC_MSG_ERROR([LLVM >= 2.9 required, but "$llvmver"($llvmver_test) found])
113
-elif test $llvmver_test -gt 342; then
113
+elif test $llvmver_test -ge 360; then
114 114
     AC_MSG_RESULT([no ($llvmver)])
115
-    AC_MSG_ERROR([LLVM <= 3.4.2 required, but "$llvmver"($llvmver_test) found])
115
+    AC_MSG_ERROR([LLVM < 3.6 required, but "$llvmver"($llvmver_test) found])
116 116
 else
117 117
     AC_MSG_RESULT([ok ($llvmver)])
118 118
 fi
119 119
 
120
+dnl aquire the required flags to properly link in external LLVM
121
+if test "x$llvmconfig" != "x"; then
122
+    AC_SUBST(LLVMCONFIG_CXXFLAGS, [`$llvmconfig --cxxflags`])
123
+    if test $llvmver_test -ge 350; then
124
+        dnl LLVM 3.5.0 and after splits linker flags into two sets
125
+        ldflags=`$llvmconfig --ldflags`
126
+        syslibs=`$llvmconfig --system-libs`
127
+        AC_SUBST(LLVMCONFIG_LDFLAGS, ["$ldflags $syslibs"])
128
+    else
129
+        AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
130
+    fi
131
+    AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs jit nativecodegen scalaropts ipo`])
132
+    AC_SUBST(LLVMCONFIG_LIBFILES, [`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`])
133
+    AC_MSG_NOTICE([CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS])
134
+    AC_MSG_NOTICE([LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS])
135
+    AC_MSG_NOTICE([LIBS from llvm-config: $LLVMCONFIG_LIBS])
136
+fi
120 137
 dnl patch does not affect clamav source (yet)
121 138
 llvmver_int=${llvmver_major}${llvmver_minor}
122 139
 
... ...
@@ -267,11 +277,6 @@ AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
267 267
 
268 268
 AM_CONDITIONAL(BUILD_EXTERNAL_LLVM, [test -n "$llvmconfig"])
269 269
 
270
-m4_include([../../m4/reorganization/libs/json.m4])
271
-AC_SUBST([JSON_LIBS])
272
-AC_SUBST([JSON_LDFLAGS])
273
-AC_SUBST([JSON_CPPFLAGS])
274
-
275 270
 AC_OUTPUT([
276 271
     Makefile
277 272
 ])
... ...
@@ -267,7 +267,8 @@ cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine, cli_file_t
267 267
             const unsigned char * znamep = buff;
268 268
             int32_t zlen = bread;
269 269
             int lhc = 0;
270
-            int zi;
270
+            int zi, likely_ooxml = 0;
271
+            cli_file_t ret2;
271 272
             
272 273
             for (zi=0; zi<32; zi++) {
273 274
                 znamep = (const unsigned char *)cli_memstr((const char *)znamep, zlen, lhdr_magic, 4);
... ...
@@ -284,9 +285,34 @@ cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine, cli_file_t
284 284
                         } else if (0 == memcmp(znamep, "word/", 5)) {
285 285
                             cli_dbgmsg("Recognized OOXML Word file\n");
286 286
                             return CL_TYPE_OOXML_WORD;
287
+                        } else if (0 == memcmp(znamep, "docProps/", 5)) {
288
+                            likely_ooxml = 1;
289
+                        }
290
+
291
+                        if (++lhc > 2) {
292
+                            /* only check first three zip headers unless likely ooxml */
293
+                            if (likely_ooxml) {
294
+                                cli_dbgmsg("Likely OOXML, checking additional zip headers\n");
295
+                                if ((ret2 = cli_ooxml_filetype(NULL, map)) != CL_SUCCESS) {
296
+                                    /* either an error or retyping has occurred, return error or just CL_TYPE_ZIP? */
297
+                                    switch (ret2) {
298
+                                    case CL_TYPE_OOXML_XL:
299
+                                        cli_dbgmsg("Recognized OOXML XL file\n");
300
+                                        break;
301
+                                    case CL_TYPE_OOXML_PPT:
302
+                                        cli_dbgmsg("Recognized OOXML PPT file\n");
303
+                                        break;
304
+                                    case CL_TYPE_OOXML_WORD:
305
+                                        cli_dbgmsg("Recognized OOXML WORD file\n");
306
+                                        break;
307
+                                    default:
308
+                                        cli_dbgmsg("unexpected ooxml_filetype return: %i\n", ret2);
309
+                                    }
310
+                                    return ret2;
311
+                                }
312
+                            }
313
+                            break;
287 314
                         }
288
-                        if (++lhc > 2)
289
-                            break; /* only check first three zip headers */
290 315
                     }
291 316
                     else {
292 317
                         znamep = NULL; /* force to map more */
... ...
@@ -776,7 +776,7 @@ static int cli_hashset_grow(struct cli_hashset *hs)
776 776
 		rc = cli_hashset_init_pool(&new_hs, hs->capacity << 1, hs->limit*100/hs->capacity, hs->mempool);
777 777
 	else
778 778
 		rc = cli_hashset_init(&new_hs, hs->capacity << 1, hs->limit*100/hs->capacity);
779
-	if(rc < 0)
779
+	if(rc != 0)
780 780
 		return rc;
781 781
 	/* and copy keys */
782 782
 	for(i=0;i < hs->capacity;i++) {
783 783
new file mode 100644
... ...
@@ -0,0 +1,954 @@
0
+/*
1
+ * Extract component parts of OLE2 files (e.g. MS Office Documents)
2
+ * 
3
+ * Copyright (C) 2007-2013 Sourcefire, Inc.
4
+ * 
5
+ * Authors: Trog
6
+ * 
7
+ * This program is free software; you can redistribute it and/or modify it under
8
+ * the terms of the GNU General Public License version 2 as published by the
9
+ * Free Software Foundation.
10
+ * 
11
+ * This program is distributed in the hope that it will be useful, but WITHOUT
12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14
+ * more details.
15
+ * 
16
+ * You should have received a copy of the GNU General Public License along with
17
+ * this program; if not, write to the Free Software Foundation, Inc., 51
18
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ */
20
+
21
+#if HAVE_CONFIG_H
22
+#include "clamav-config.h"
23
+#endif
24
+
25
+#include <sys/types.h>
26
+#include <sys/stat.h>
27
+#include <fcntl.h>
28
+#include <stdio.h>
29
+#include <string.h>
30
+#include <ctype.h>
31
+#include <stdlib.h>
32
+#include <errno.h>
33
+#include <conv.h>
34
+#ifdef	HAVE_UNISTD_H
35
+#include <unistd.h>
36
+#endif
37
+
38
+#if HAVE_ICONV
39
+#include <iconv.h>
40
+#endif
41
+
42
+#include "clamav.h"
43
+#include "cltypes.h"
44
+#include "others.h"
45
+#include "msdoc.h"
46
+#include "scanners.h"
47
+#include "fmap.h"
48
+#include "json_api.h"
49
+
50
+#if HAVE_JSON
51
+static char *
52
+ole2_convert_utf(summary_ctx_t *sctx, char *begin, size_t sz, const char *encoding)
53
+{
54
+    char *outbuf=NULL;
55
+#if HAVE_ICONV
56
+    char *buf, *p1, *p2;
57
+    off_t offset;
58
+    size_t inlen, outlen, nonrev, sz2;
59
+    int i, try;
60
+    iconv_t cd;
61
+#endif
62
+    /* applies in the both case */
63
+    if (sctx->codepage == 20127 || sctx->codepage == 65001) {
64
+        outbuf = cli_strdup(begin);
65
+        return outbuf;
66
+    }
67
+
68
+#if HAVE_ICONV
69
+    p1 = buf = cli_calloc(1, sz);
70
+    if (!(buf))
71
+        return NULL;
72
+
73
+    memcpy(buf, begin, sz);
74
+    inlen = sz;
75
+
76
+    /* encoding lookup if not specified */
77
+    if (!encoding) {
78
+        for (i = 0; i < NUMCODEPAGES; ++i) {
79
+            if (sctx->codepage == codepage_entries[i].codepage)
80
+                encoding = codepage_entries[i].encoding;
81
+            else if (sctx->codepage < codepage_entries[i].codepage) {
82
+                /* assuming sorted array */
83
+                break;
84
+            }
85
+        }
86
+
87
+        if (!encoding) {
88
+            cli_warnmsg("ole2_convert_utf: could not locate codepage encoding for %d\n", sctx->codepage);
89
+            sctx->flags |= OLE2_CODEPAGE_ERROR_NOTFOUND;
90
+            free(buf);
91
+            return NULL;
92
+        }
93
+    }
94
+
95
+    cd = iconv_open("UTF-8", encoding);
96
+    if (cd == (iconv_t)(-1)) {
97
+        cli_errmsg("ole2_convert_utf: could not initialize iconv\n");
98
+        sctx->flags |= OLE2_CODEPAGE_ERROR_UNINITED;
99
+    }
100
+    else {
101
+        offset = 0;
102
+        for (try = 1; try <= 3; ++try) {
103
+            /* charset to UTF-8 should never exceed sz*6 */
104
+            sz2 = (try*2) * sz;
105
+            /* use cli_realloc, reuse the buffer that has already been translated */
106
+            outbuf = (char *)cli_realloc(outbuf, sz2+1);
107
+            if (!outbuf) {
108
+                free(buf);
109
+                return NULL;
110
+            }
111
+
112
+            outlen = sz2 - offset;
113
+            p2 = outbuf + offset;
114
+
115
+            /* conversion */
116
+            nonrev = iconv(cd, &p1, &inlen, &p2, &outlen);
117
+
118
+            if (errno == EILSEQ) {
119
+                cli_dbgmsg("ole2_convert_utf: input buffer contains invalid character for its encoding\n");
120
+                sctx->flags |= OLE2_CODEPAGE_ERROR_INVALID;
121
+                break;
122
+            }
123
+            else if (errno == EINVAL && nonrev == (size_t)-1) {
124
+                cli_dbgmsg("ole2_convert_utf: input buffer contains incomplete multibyte character\n");
125
+                sctx->flags |= OLE2_CODEPAGE_ERROR_INCOMPLETE;
126
+                break;
127
+            }
128
+            else if (inlen == 0) {
129
+                //cli_dbgmsg("ole2_convert_utf: input buffer is successfully translated\n");
130
+                break;
131
+            }
132
+
133
+            //outbuf[sz2 - outlen] = '\0';
134
+            //cli_dbgmsg("%u %s\n", inlen, outbuf);
135
+
136
+            offset = sz2 - outlen;
137
+            if (try < 3)
138
+                cli_dbgmsg("ole2_convert_utf: outbuf is too small, resizing %llu -> %llu\n",
139
+                           (long long unsigned)((try*2) * sz), (long long unsigned)(((try+1)*2) * sz));
140
+        }
141
+
142
+        if (errno == E2BIG && nonrev == (size_t)-1) {
143
+            cli_dbgmsg("ole2_convert_utf: buffer could not be fully translated\n");
144
+            sctx->flags |= OLE2_CODEPAGE_ERROR_OUTBUFTOOSMALL;
145
+        }
146
+
147
+        outbuf[sz2 - outlen] = '\0';
148
+    }
149
+
150
+    iconv_close(cd);
151
+    free(buf);
152
+#endif
153
+    /* this should force base64 encoding if NULL */
154
+    return outbuf;
155
+}
156
+
157
+static int
158
+ole2_process_property(summary_ctx_t *sctx, unsigned char *databuf, uint32_t offset)
159
+{
160
+    uint16_t proptype, padding;
161
+    int ret = CL_SUCCESS;
162
+
163
+    if (cli_json_timeout_cycle_check(sctx->ctx, &(sctx->toval)) != CL_SUCCESS) {
164
+        sctx->flags |= OLE2_SUMMARY_FLAG_TIMEOUT;
165
+        return CL_ETIMEOUT;
166
+    }
167
+
168
+    if (offset+sizeof(proptype)+sizeof(padding) > sctx->pssize) {
169
+        sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
170
+        return CL_EFORMAT;
171
+    }
172
+
173
+    memcpy(&proptype, databuf+offset, sizeof(proptype));
174
+    offset+=sizeof(proptype);
175
+    memcpy(&padding, databuf+offset, sizeof(padding));
176
+    offset+=sizeof(padding);
177
+    /* endian conversion */
178
+    proptype = sum16_endian_convert(proptype);
179
+
180
+    //cli_dbgmsg("proptype: 0x%04x\n", proptype);
181
+    if (padding != 0) {
182
+        cli_dbgmsg("ole2_process_property: invalid padding value, non-zero\n");
183
+        sctx->flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
184
+        return CL_EFORMAT;
185
+    }
186
+
187
+    switch (proptype) {
188
+    case PT_EMPTY:
189
+    case PT_NULL:
190
+        ret = cli_jsonnull(sctx->summary, sctx->propname);
191
+        break;
192
+    case PT_INT16:
193
+	{
194
+            int16_t dout;
195
+            if (offset+sizeof(dout) > sctx->pssize) {
196
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
197
+                return CL_EFORMAT;
198
+            }
199
+            memcpy(&dout, databuf+offset, sizeof(dout));
200
+            offset+=sizeof(dout);
201
+            /* endian conversion */
202
+            dout = sum16_endian_convert(dout);
203
+
204
+            if (sctx->writecp) {
205
+                sctx->codepage = (uint16_t)dout;
206
+                ret = cli_jsonint(sctx->summary, sctx->propname, sctx->codepage);
207
+            }
208
+            else
209
+                ret = cli_jsonint(sctx->summary, sctx->propname, dout);
210
+            break;
211
+	}
212
+    case PT_INT32:
213
+    case PT_INT32v1:
214
+	{
215
+            int32_t dout;
216
+            if (offset+sizeof(dout) > sctx->pssize) {
217
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
218
+                return CL_EFORMAT;
219
+            }
220
+            memcpy(&dout, databuf+offset, sizeof(dout));
221
+            offset+=sizeof(dout);
222
+            /* endian conversion */
223
+            dout = sum32_endian_convert(dout);
224
+
225
+            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
226
+            break;
227
+	}
228
+    case PT_FLOAT32: /* review this please */
229
+	{
230
+            float dout;
231
+            if (offset+sizeof(dout) > sctx->pssize) {
232
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
233
+                return CL_EFORMAT;
234
+            }
235
+            memcpy(&dout, databuf+offset, sizeof(dout));
236
+            offset+=sizeof(dout);
237
+            /* endian conversion */
238
+            dout = sum32_endian_convert(dout);
239
+
240
+            ret = cli_jsondouble(sctx->summary, sctx->propname, dout);
241
+            break;
242
+	}
243
+    case PT_DATE:
244
+    case PT_DOUBLE64: /* review this please */
245
+	{
246
+            double dout;
247
+            if (offset+sizeof(dout) > sctx->pssize) {
248
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
249
+                return CL_EFORMAT;
250
+            }
251
+            memcpy(&dout, databuf+offset, sizeof(dout));
252
+            offset+=sizeof(dout);
253
+            /* endian conversion */
254
+            dout = sum64_endian_convert(dout);
255
+
256
+            ret = cli_jsondouble(sctx->summary, sctx->propname, dout);
257
+            break;
258
+	}
259
+    case PT_BOOL:
260
+	{
261
+            uint16_t dout;
262
+            if (offset+sizeof(dout) > sctx->pssize) {
263
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
264
+                return CL_EFORMAT;
265
+            }
266
+            memcpy(&dout, databuf+offset, sizeof(dout));
267
+            offset+=sizeof(dout);
268
+            /* no need for endian conversion */
269
+
270
+            ret = cli_jsonbool(sctx->summary, sctx->propname, dout);
271
+            break;
272
+	}
273
+    case PT_INT8v1:
274
+	{
275
+            int8_t dout;
276
+            if (offset+sizeof(dout) > sctx->pssize) {
277
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
278
+                return CL_EFORMAT;
279
+            }
280
+            memcpy(&dout, databuf+offset, sizeof(dout));
281
+            offset+=sizeof(dout);
282
+            /* no need for endian conversion */
283
+
284
+            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
285
+            break;
286
+	}
287
+    case PT_UINT8:
288
+	{
289
+            uint8_t dout;
290
+            if (offset+sizeof(dout) > sctx->pssize) {
291
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
292
+                return CL_EFORMAT;
293
+            }
294
+            memcpy(&dout, databuf+offset, sizeof(dout));
295
+            offset+=sizeof(dout);
296
+            /* no need for endian conversion */
297
+
298
+            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
299
+            break;
300
+	}
301
+    case PT_UINT16:
302
+	{
303
+            uint16_t dout;
304
+            if (offset+sizeof(dout) > sctx->pssize) {
305
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
306
+                return CL_EFORMAT;
307
+            }
308
+            memcpy(&dout, databuf+offset, sizeof(dout));
309
+            offset+=sizeof(dout);
310
+            /* endian conversion */
311
+            dout = sum16_endian_convert(dout);
312
+
313
+            if (sctx->writecp)
314
+                sctx->codepage = dout;
315
+
316
+            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
317
+            break;
318
+	}
319
+    case PT_UINT32:
320
+    case PT_UINT32v1:
321
+	{
322
+            uint32_t dout;
323
+            if (offset+sizeof(dout) > sctx->pssize) {
324
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
325
+                return CL_EFORMAT;
326
+            }
327
+            memcpy(&dout, databuf+offset, sizeof(dout));
328
+            offset+=sizeof(dout);
329
+            /* endian conversion */
330
+            dout = sum32_endian_convert(dout);
331
+
332
+            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
333
+            break;
334
+	}
335
+    case PT_INT64:
336
+	{
337
+            int64_t dout;
338
+            if (offset+sizeof(dout) > sctx->pssize) {
339
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
340
+                return CL_EFORMAT;
341
+            }
342
+            memcpy(&dout, databuf+offset, sizeof(dout));
343
+            offset+=sizeof(dout);
344
+            /* endian conversion */
345
+            dout = sum64_endian_convert(dout);
346
+
347
+            ret = cli_jsonint64(sctx->summary, sctx->propname, dout);
348
+            break;
349
+	}
350
+    case PT_UINT64:
351
+	{
352
+            uint64_t dout;
353
+            if (offset+sizeof(dout) > sctx->pssize) {
354
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
355
+                return CL_EFORMAT;
356
+            }
357
+            memcpy(&dout, databuf+offset, sizeof(dout));
358
+            offset+=sizeof(dout);
359
+            /* endian conversion */
360
+            dout = sum64_endian_convert(dout);
361
+
362
+            ret = cli_jsonint64(sctx->summary, sctx->propname, dout);
363
+            break;
364
+	}
365
+    case PT_BSTR:
366
+    case PT_LPSTR:
367
+        if (sctx->codepage == 0) {
368
+            cli_dbgmsg("ole2_propset_json: current codepage is unknown, cannot parse char stream\n");
369
+            sctx->flags |= OLE2_SUMMARY_FLAG_CODEPAGE;
370
+        }
371
+        else {
372
+            uint32_t strsize;
373
+            char *outstr, *outstr2;
374
+
375
+            if (offset+sizeof(strsize) > sctx->pssize) {
376
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
377
+                return CL_EFORMAT;
378
+            }
379
+
380
+            memcpy(&strsize, databuf+offset, sizeof(strsize));
381
+            offset+=sizeof(strsize);
382
+            /* endian conversion? */
383
+            strsize = sum32_endian_convert(strsize);
384
+
385
+            if (offset+strsize > sctx->pssize) {
386
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
387
+                return CL_EFORMAT;
388
+            }
389
+
390
+            /* limitation on string length */
391
+            if (strsize > PROPSTRLIMIT) {
392
+                cli_dbgmsg("ole2_process_property: property string sized %lu truncated to size %lu\n",
393
+                           (unsigned long)strsize, (unsigned long)PROPSTRLIMIT);
394
+                sctx->flags |= OLE2_SUMMARY_FLAG_TRUNC_STR;
395
+                strsize = PROPSTRLIMIT;
396
+            }
397
+
398
+            outstr = cli_calloc(strsize+1, 1); /* last char must be NULL */
399
+            if (!outstr) {
400
+                return CL_EMEM;
401
+            }
402
+            strncpy(outstr, (const char *)(databuf+offset), strsize);
403
+
404
+            /* conversion of various encodings to UTF-8 */
405
+            outstr2 = ole2_convert_utf(sctx, outstr, strsize, NULL);
406
+            if (!outstr2) {
407
+                /* use base64 encoding when all else fails! */
408
+                char b64jstr[PROPSTRLIMIT];
409
+
410
+                /* outstr2 should be 4/3 times the original (rounded up) */
411
+                outstr2 = cl_base64_encode(outstr, strsize);
412
+                if (!outstr2) {
413
+                    cli_dbgmsg("ole2_process_property: failed to convert to base64 string\n");
414
+                    return CL_EMEM;
415
+                }
416
+
417
+                snprintf(b64jstr, PROPSTRLIMIT, "%s_base64", sctx->propname);
418
+                ret = cli_jsonbool(sctx->summary, b64jstr, 1);
419
+                if (ret != CL_SUCCESS)
420
+                    return ret;
421
+            }
422
+
423
+            ret = cli_jsonstr(sctx->summary, sctx->propname, outstr2);
424
+            free(outstr);
425
+            free(outstr2);
426
+        }
427
+        break;
428
+    case PT_LPWSTR:
429
+	{
430
+            uint32_t strsize;
431
+            char *outstr, *outstr2;
432
+
433
+            if (offset+sizeof(strsize) > sctx->pssize) {
434
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
435
+                return CL_EFORMAT;
436
+            }
437
+            memcpy(&strsize, databuf+offset, sizeof(strsize));
438
+            offset+=sizeof(strsize);
439
+            /* endian conversion; wide strings are by length, not size (x2) */
440
+            strsize = sum32_endian_convert(strsize)*2;
441
+
442
+            /* limitation on string length */
443
+            if (strsize > (2*PROPSTRLIMIT)) {
444
+                cli_dbgmsg("ole2_process_property: property string sized %lu truncated to size %lu\n",
445
+                           (unsigned long)strsize, (unsigned long)(2*PROPSTRLIMIT));
446
+                sctx->flags |= OLE2_SUMMARY_FLAG_TRUNC_STR;
447
+                strsize = (2*PROPSTRLIMIT);
448
+            }
449
+
450
+            if (offset+strsize > sctx->pssize) {
451
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
452
+                return CL_EFORMAT;
453
+            }
454
+            outstr = cli_calloc(strsize+2, 1); /* last two chars must be NULL */
455
+            if (!outstr) {
456
+                return CL_EMEM;
457
+            }
458
+            memcpy(outstr, (const char *)(databuf+offset), strsize);
459
+            /* conversion of 16-width char strings (UTF-16 or UTF-16LE??) to UTF-8 */
460
+            outstr2 = ole2_convert_utf(sctx, outstr, strsize, UTF16_MS);
461
+            if (!outstr2) {
462
+                /* use base64 encoding when all else fails! */
463
+                char b64jstr[PROPSTRLIMIT];
464
+
465
+                outstr2 = cl_base64_encode(outstr, strsize);
466
+                if (!outstr2) {
467
+                    free(outstr);
468
+                    return CL_EMEM;
469
+                }
470
+
471
+                snprintf(b64jstr, PROPSTRLIMIT, "%s_base64", sctx->propname);
472
+                ret = cli_jsonbool(sctx->summary, b64jstr, 1);
473
+                if (ret != CL_SUCCESS)
474
+                    return ret;
475
+            }
476
+
477
+            ret = cli_jsonstr(sctx->summary, sctx->propname, outstr2);
478
+            free(outstr);
479
+            free(outstr2);
480
+            break;
481
+	}
482
+    case PT_FILETIME:
483
+	{
484
+            uint32_t ltime, htime;
485
+            uint64_t wtime = 0, utime =0;
486
+
487
+            if (offset+sizeof(ltime)+sizeof(htime) > sctx->pssize) {
488
+                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
489
+                return CL_EFORMAT;
490
+            }
491
+            memcpy(&ltime, databuf+offset, sizeof(ltime));
492
+            offset+=sizeof(ltime);
493
+            memcpy(&htime, databuf+offset, sizeof(htime));
494
+            offset+=sizeof(ltime);
495
+            ltime = sum32_endian_convert(ltime);
496
+            htime = sum32_endian_convert(htime);
497
+
498
+            /* UNIX timestamp formatting */
499
+            wtime = htime;
500
+            wtime <<= 32;
501
+            wtime |= ltime;
502
+
503
+            utime = wtime / 10000000;
504
+            utime -= 11644473600LL;
505
+
506
+            if ((uint32_t)((utime & 0xFFFFFFFF00000000) >> 32)) {
507
+                cli_dbgmsg("ole2_process_property: UNIX timestamp is larger than 32-bit number\n");
508
+            }
509
+            else {
510
+                ret = cli_jsonint(sctx->summary, sctx->propname, (uint32_t)(utime & 0xFFFFFFFF));
511
+            }
512
+            break;
513
+	}
514
+    default:
515
+        cli_dbgmsg("ole2_process_property: unhandled property type 0x%04x for %s property\n", 
516
+                   proptype, sctx->propname);
517
+        sctx->flags |= OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE;
518
+    }
519
+
520
+    return ret;
521
+}
522
+
523
+static void ole2_translate_docsummary_propid(summary_ctx_t *sctx, uint32_t propid)
524
+{
525
+    switch(propid) {
526
+    case DSPID_CODEPAGE:
527
+        sctx->writecp = 1; /* must be set ONLY for codepage */
528
+        sctx->propname = "CodePage";
529
+        break;
530
+    case DSPID_CATEGORY:
531
+        sctx->propname = "Category";
532
+        break;
533
+    case DSPID_PRESFORMAT:
534
+        sctx->propname = "PresentationTarget";
535
+        break;
536
+    case DSPID_BYTECOUNT:
537
+        sctx->propname = "Bytes";
538
+        break;
539
+    case DSPID_LINECOUNT:
540
+        sctx->propname = "Lines";
541
+        break;
542
+    case DSPID_PARCOUNT:
543
+        sctx->propname = "Paragraphs";
544
+        break;
545
+    case DSPID_SLIDECOUNT:
546
+        sctx->propname = "Slides";
547
+        break;
548
+    case DSPID_NOTECOUNT:
549
+        sctx->propname = "Notes";
550
+        break;
551
+    case DSPID_HIDDENCOUNT:
552
+        sctx->propname = "HiddenSlides";
553
+        break;
554
+    case DSPID_MMCLIPCOUNT:
555
+        sctx->propname = "MMClips";
556
+        break;
557
+    case DSPID_SCALE:
558
+        sctx->propname = "Scale";
559
+        break;
560
+    case DSPID_HEADINGPAIR: /* VT_VARIANT | VT_VECTOR */
561
+        sctx->propname = "HeadingPairs";
562
+        break;
563
+    case DSPID_DOCPARTS:    /* VT_VECTOR | VT_LPSTR */
564
+        sctx->propname = "DocPartTitles";
565
+        break;
566
+    case DSPID_MANAGER:
567
+        sctx->propname = "Manager";
568
+        break;
569
+    case DSPID_COMPANY:
570
+        sctx->propname = "Company";
571
+        break;
572
+    case DSPID_LINKSDIRTY:
573
+        sctx->propname = "LinksDirty";
574
+        break;
575
+    case DSPID_CCHWITHSPACES:
576
+        sctx->propname = "Char&WSCount";
577
+        break;
578
+    case DSPID_SHAREDDOC:   /* SHOULD BE FALSE! */
579
+        sctx->propname = "SharedDoc";
580
+        break;
581
+    case DSPID_LINKBASE:    /* moved to user-defined */
582
+        sctx->propname = "LinkBase";
583
+        break;
584
+    case DSPID_HLINKS:      /* moved to user-defined */
585
+        sctx->propname = "HyperLinks";
586
+        break;
587
+    case DSPID_HYPERLINKSCHANGED:
588
+        sctx->propname = "HyperLinksChanged";
589
+        break;
590
+    case DSPID_VERSION:
591
+        sctx->propname = "Version";
592
+        break;
593
+    case DSPID_DIGSIG:
594
+        sctx->propname = "DigitalSig";
595
+        break;
596
+    case DSPID_CONTENTTYPE:
597
+        sctx->propname = "ContentType";
598
+        break;
599
+    case DSPID_CONTENTSTATUS:
600
+        sctx->propname = "ContentStatus";
601
+        break;
602
+    case DSPID_LANGUAGE:
603
+        sctx->propname = "Language";
604
+        break;
605
+    case DSPID_DOCVERSION:
606
+        sctx->propname = "DocVersion";
607
+        break;
608
+    default:
609
+        cli_dbgmsg("ole2_docsum_propset_json: unrecognized propid!\n");
610
+        sctx->flags |= OLE2_SUMMARY_FLAG_UNKNOWN_PROPID;
611
+    }
612
+}
613
+
614
+static void ole2_translate_summary_propid(summary_ctx_t *sctx, uint32_t propid)
615
+{
616
+    switch(propid) {
617
+    case SPID_CODEPAGE:
618
+        sctx->writecp = 1; /* must be set ONLY for codepage */
619
+        sctx->propname = "CodePage";
620
+        break;
621
+    case SPID_TITLE:
622
+        sctx->propname = "Title";
623
+        break;
624
+    case SPID_SUBJECT:
625
+        sctx->propname = "Subject";
626
+        break;
627
+    case SPID_AUTHOR:
628
+        sctx->propname = "Author";
629
+        break;
630
+    case SPID_KEYWORDS:
631
+        sctx->propname = "Keywords";
632
+        break;
633
+    case SPID_COMMENTS:
634
+        sctx->propname = "Comments";
635
+        break;
636
+    case SPID_TEMPLATE:
637
+        sctx->propname = "Template";
638
+        break;
639
+    case SPID_LASTAUTHOR:
640
+        sctx->propname = "LastAuthor";
641
+        break;
642
+    case SPID_REVNUMBER:
643
+        sctx->propname = "RevNumber";
644
+        break;
645
+    case SPID_EDITTIME:
646
+        sctx->propname = "EditTime";
647
+        break;
648
+    case SPID_LASTPRINTED:
649
+        sctx->propname = "LastPrinted";
650
+        break;
651
+    case SPID_CREATEDTIME:
652
+        sctx->propname = "CreatedTime";
653
+        break;
654
+    case SPID_MODIFIEDTIME:
655
+        sctx->propname = "ModifiedTime";
656
+        break;
657
+    case SPID_PAGECOUNT:
658
+        sctx->propname = "PageCount";
659
+        break;
660
+    case SPID_WORDCOUNT:
661
+        sctx->propname = "WordCount";
662
+        break;
663
+    case SPID_CHARCOUNT:
664
+        sctx->propname = "CharCount";
665
+        break;
666
+    case SPID_THUMBNAIL:
667
+        sctx->propname = "Thumbnail";
668
+        break;
669
+    case SPID_APPNAME:
670
+        sctx->propname = "AppName";
671
+        break;
672
+    case SPID_SECURITY:
673
+        sctx->propname = "Security";
674
+        break;
675
+    default:
676
+        cli_dbgmsg("ole2_translate_summary_propid: unrecognized propid!\n");
677
+        sctx->flags |= OLE2_SUMMARY_FLAG_UNKNOWN_PROPID;
678
+    }
679
+}
680
+
681
+static int ole2_summary_propset_json(summary_ctx_t *sctx, off_t offset)
682
+{
683
+    unsigned char *hdr, *ps;
684
+    uint32_t numprops, limitprops;
685
+    off_t foff = offset, psoff = 0;
686
+    uint32_t poffset;
687
+    int ret;
688
+    unsigned int i;
689
+
690
+    cli_dbgmsg("in ole2_summary_propset_json\n");
691
+
692
+    /* summary ctx propset-specific setup*/
693
+    sctx->codepage = 0;
694
+    sctx->writecp = 0;
695
+    sctx->propname = NULL;
696
+
697
+    /* examine property set metadata */
698
+    if ((foff+(2*sizeof(uint32_t))) > sctx->maplen) {
699
+        sctx->flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
700
+        return CL_EFORMAT;
701
+    }
702
+    hdr = (unsigned char*)fmap_need_off_once(sctx->sfmap, foff, (2*sizeof(uint32_t)));
703
+    if (!hdr) {
704
+        sctx->flags |= OLE2_SUMMARY_ERROR_DATABUF;
705
+        return CL_EREAD;
706
+    }
707
+    //foff+=(2*sizeof(uint32_t)); // keep foff pointing to start of propset segment
708
+    psoff+=(2*sizeof(uint32_t));
709
+    memcpy(&(sctx->pssize), hdr, sizeof(sctx->pssize));
710
+    memcpy(&numprops, hdr+sizeof(sctx->pssize), sizeof(numprops));
711
+    /* endian conversion */
712
+    sctx->pssize = sum32_endian_convert(sctx->pssize);
713
+    numprops = sum32_endian_convert(numprops);
714
+    cli_dbgmsg("ole2_summary_propset_json: pssize: %u, numprops: %u\n", sctx->pssize, numprops);
715
+    if (numprops > PROPCNTLIMIT) {
716
+        sctx->flags |= OLE2_SUMMARY_LIMIT_PROPS;
717
+        limitprops = PROPCNTLIMIT;
718
+    }
719
+    else {
720
+        limitprops = numprops;
721
+    }
722
+    cli_dbgmsg("ole2_summary_propset_json: processing %u of %u (%u max) propeties\n",
723
+               limitprops, numprops, PROPCNTLIMIT);
724
+
725
+    /* extract remaining fragment of propset */
726
+    if ((size_t)(foff+(sctx->pssize)) > (size_t)(sctx->maplen)) {
727
+        sctx->flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
728
+        return CL_EFORMAT;
729
+    }
730
+    ps = (unsigned char*)fmap_need_off_once(sctx->sfmap, foff, sctx->pssize);
731
+    if (!ps) {
732
+        sctx->flags |= OLE2_SUMMARY_ERROR_DATABUF;
733
+        return CL_EREAD;
734
+    }
735
+
736
+    /* iterate over the properties */
737
+    for (i = 0; i < limitprops; ++i) {
738
+        uint32_t propid, propoff;
739
+
740
+        if (psoff+sizeof(propid)+sizeof(poffset) > sctx->pssize) {
741
+            sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
742
+            return CL_EFORMAT;
743
+        }
744
+        memcpy(&propid, ps+psoff, sizeof(propid));
745
+        psoff+=sizeof(propid);
746
+        memcpy(&propoff, ps+psoff, sizeof(propoff));
747
+        psoff+=sizeof(propoff);
748
+        /* endian conversion */
749
+        propid = sum32_endian_convert(propid);
750
+        propoff = sum32_endian_convert(propoff);
751
+        cli_dbgmsg("ole2_summary_propset_json: propid: 0x%08x, propoff: %u\n", propid, propoff);
752
+
753
+        sctx->propname = NULL; sctx->writecp = 0;
754
+        if (!sctx->mode)
755
+            ole2_translate_summary_propid(sctx, propid);
756
+        else
757
+            ole2_translate_docsummary_propid(sctx, propid);
758
+
759
+        if (sctx->propname != NULL) {
760
+            ret = ole2_process_property(sctx, ps, propoff);
761
+            if (ret != CL_SUCCESS)
762
+                return ret;
763
+        }
764
+        else {
765
+            /* add unknown propid flag */
766
+        }
767
+    }
768
+
769
+    return CL_SUCCESS;
770
+}
771
+
772
+static int cli_ole2_summary_json_cleanup(summary_ctx_t *sctx, int retcode)
773
+{
774
+    json_object *jarr;
775
+
776
+    cli_dbgmsg("in cli_ole2_summary_json_cleanup: %d[%x]\n", retcode, sctx->flags);
777
+
778
+    if (sctx->sfmap) {
779
+        funmap(sctx->sfmap);
780
+    }
781
+
782
+    if (sctx->flags) {
783
+        jarr = cli_jsonarray(sctx->summary, "ParseErrors");
784
+
785
+        /* summary errors */
786
+        if (sctx->flags & OLE2_SUMMARY_ERROR_TOOSMALL) {
787
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_TOOSMALL");
788
+        }
789
+        if (sctx->flags & OLE2_SUMMARY_ERROR_OOB) {
790
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_OOB");
791
+        }
792
+        if (sctx->flags & OLE2_SUMMARY_ERROR_DATABUF) {
793
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_DATABUF");
794
+        }
795
+        if (sctx->flags & OLE2_SUMMARY_ERROR_INVALID_ENTRY) {
796
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_INVALID_ENTRY");
797
+        }
798
+        if (sctx->flags & OLE2_SUMMARY_LIMIT_PROPS) {
799
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_LIMIT_PROPS");
800
+        }
801
+        if (sctx->flags & OLE2_SUMMARY_FLAG_TIMEOUT) {
802
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_TIMEOUT");
803
+        }
804
+        if (sctx->flags & OLE2_SUMMARY_FLAG_CODEPAGE) {
805
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_CODEPAGE");
806
+        }
807
+        if (sctx->flags & OLE2_SUMMARY_FLAG_UNKNOWN_PROPID) {
808
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_UNKNOWN_PROPID");
809
+        }
810
+        if (sctx->flags & OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE) {
811
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE");
812
+        }
813
+        if (sctx->flags & OLE2_SUMMARY_FLAG_TRUNC_STR) {
814
+            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_TRUNC_STR");
815
+        }
816
+
817
+        /* codepage translation errors */
818
+        if (sctx->flags & OLE2_CODEPAGE_ERROR_NOTFOUND) {
819
+            cli_jsonstr(jarr, NULL, "OLE2_CODEPAGE_ERROR_NOTFOUND");
820
+        }
821
+        if (sctx->flags & OLE2_CODEPAGE_ERROR_UNINITED) {
822
+            cli_jsonstr(jarr, NULL, "OLE2_CODEPAGE_ERROR_UNINITED");
823
+        }
824
+        if (sctx->flags & OLE2_CODEPAGE_ERROR_INVALID) {
825
+            cli_jsonstr(jarr, NULL, "OLE2_CODEPAGE_ERROR_INVALID");
826
+        }
827
+        if (sctx->flags & OLE2_CODEPAGE_ERROR_INCOMPLETE) {
828
+            cli_jsonstr(jarr, NULL, "OLE2_CODEPAGE_ERROR_INCOMPLETE");
829
+        }
830
+        if (sctx->flags & OLE2_CODEPAGE_ERROR_OUTBUFTOOSMALL) {
831
+            cli_jsonstr(jarr, NULL, "OLE2_CODEPAGE_ERROR_OUTBUFTOOSMALL");
832
+        }
833
+    }
834
+
835
+    return retcode;
836
+}
837
+
838
+int cli_ole2_summary_json(cli_ctx *ctx, int fd, int mode)
839
+{
840
+    summary_ctx_t sctx;
841
+    STATBUF statbuf;
842
+    off_t foff = 0;
843
+    unsigned char *databuf;
844
+    summary_stub_t sumstub;
845
+    propset_entry_t pentry;
846
+    int ret = CL_SUCCESS;
847
+
848
+    cli_dbgmsg("in cli_ole2_summary_json\n");
849
+
850
+    /* preliminary sanity checks */
851
+    if (ctx == NULL) {
852
+        return CL_ENULLARG;
853
+    }
854
+
855
+    if (fd < 0) {
856
+        cli_dbgmsg("ole2_summary_json: invalid file descriptor\n");
857
+        return CL_ENULLARG; /* placeholder */
858
+    }
859
+
860
+    if (mode != 0 && mode != 1) {
861
+        cli_dbgmsg("ole2_summary_json: invalid mode specified\n");
862
+        return CL_ENULLARG; /* placeholder */
863
+    }
864
+
865
+    /* summary ctx setup */
866
+    memset(&sctx, 0, sizeof(sctx));
867
+    sctx.ctx = ctx;
868
+    sctx.mode = mode;
869
+
870
+    if (FSTAT(fd, &statbuf) == -1) {
871
+        cli_dbgmsg("ole2_summary_json: cannot stat file descriptor\n");
872
+        return CL_ESTAT;
873
+    }
874
+
875
+    sctx.sfmap = fmap(fd, 0, statbuf.st_size);
876
+    if (!sctx.sfmap) {
877
+        cli_dbgmsg("ole2_summary_json: failed to get fmap\n");
878
+        return CL_EMAP;
879
+    }
880
+    sctx.maplen = sctx.sfmap->len;
881
+    cli_dbgmsg("ole2_summary_json: streamsize: %u\n", sctx.maplen);
882
+
883
+    if (!mode)
884
+        sctx.summary = cli_jsonobj(ctx->wrkproperty, "SummaryInfo");
885
+    else
886
+        sctx.summary = cli_jsonobj(ctx->wrkproperty, "DocSummaryInfo");
887
+    if (!sctx.summary) {
888
+        cli_errmsg("ole2_summary_json: no memory for json object.\n");
889
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EMEM);
890
+    }
891
+
892
+    sctx.codepage = 0;
893
+    sctx.writecp = 0;
894
+
895
+    /* acquire property stream metadata */
896
+    if (sctx.maplen < sizeof(summary_stub_t)) {
897
+        sctx.flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
898
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
899
+    }
900
+    databuf = (unsigned char*)fmap_need_off_once(sctx.sfmap, foff, sizeof(summary_stub_t));
901
+    if (!databuf) {
902
+        sctx.flags |= OLE2_SUMMARY_ERROR_DATABUF;
903
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EREAD);
904
+    }
905
+    foff += sizeof(summary_stub_t);
906
+    memcpy(&sumstub, databuf, sizeof(summary_stub_t));
907
+
908
+    /* endian conversion and checks */
909
+    sumstub.byte_order = le16_to_host(sumstub.byte_order);
910
+    if (sumstub.byte_order != 0xfffe) {
911
+        cli_dbgmsg("ole2_summary_json: byteorder 0x%x is invalid\n", sumstub.byte_order);
912
+        sctx.flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
913
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);;
914
+    }
915
+    sumstub.version = sum16_endian_convert(sumstub.version); /*unused*/
916
+    sumstub.system = sum32_endian_convert(sumstub.system); /*unused*/
917
+    sumstub.num_propsets = sum32_endian_convert(sumstub.num_propsets);
918
+    if (sumstub.num_propsets != 1 && sumstub.num_propsets != 2) {
919
+        cli_dbgmsg("ole2_summary_json: invalid number of property sets\n");
920
+        sctx.flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
921
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
922
+    }
923
+
924
+    cli_dbgmsg("ole2_summary_json: byteorder 0x%x\n", sumstub.byte_order);
925
+    cli_dbgmsg("ole2_summary_json: %u property set(s) detected\n", sumstub.num_propsets);
926
+
927
+    /* first property set (index=0) is always SummaryInfo or DocSummaryInfo */
928
+    if ((sctx.maplen-foff) < sizeof(propset_entry_t)) {
929
+        sctx.flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
930
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
931
+    }
932
+    databuf = (unsigned char*)fmap_need_off_once(sctx.sfmap, foff, sizeof(propset_entry_t));
933
+    if (!databuf) {
934
+        sctx.flags |= OLE2_SUMMARY_ERROR_DATABUF;
935
+        return cli_ole2_summary_json_cleanup(&sctx, CL_EREAD);
936
+    }
937
+    foff += sizeof(propset_entry_t);
938
+    memcpy(&pentry, databuf, sizeof(propset_entry_t));
939
+    /* endian conversion */
940
+    pentry.offset = sum32_endian_convert(pentry.offset);
941
+
942
+    if ((ret = ole2_summary_propset_json(&sctx, pentry.offset)) != CL_SUCCESS) {
943
+        return cli_ole2_summary_json_cleanup(&sctx, ret);
944
+    }
945
+
946
+    /* second property set (index=1) is always a custom property set (if present) */
947
+    if (sumstub.num_propsets == 2) {
948
+        cli_jsonbool(ctx->wrkproperty, "HasUserDefinedProperties", 1);
949
+    }
950
+
951
+    return cli_ole2_summary_json_cleanup(&sctx, CL_SUCCESS);
952
+}
953
+#endif /* HAVE_JSON */
0 954
new file mode 100644
... ...
@@ -0,0 +1,336 @@
0
+/*
1
+ *  Extract component parts of OLE2 files (e.g. MS Office Documents)
2
+ *
3
+ *  Copyright (C) 2007-2008 Sourcefire, Inc.
4
+ *
5
+ *  Authors: Trog
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
+#ifndef __MSDOC_H
23
+#define __MSDOC_H
24
+
25
+#include "others.h"
26
+#include "uniq.h"
27
+
28
+/* Summary and Document Information Parsing to JSON */
29
+#if HAVE_JSON
30
+
31
+#define PROPCNTLIMIT 25
32
+#define PROPSTRLIMIT 256 /* affects property strs, NOT sanitized strs (may result in a buffer allocating PROPSTRLIMIT*6) */
33
+#define UTF16_MS "UTF-16LE"
34
+
35
+#define sum16_endian_convert(v) le16_to_host((uint16_t)(v))
36
+#define sum32_endian_convert(v) le32_to_host((uint32_t)(v))
37
+#define sum64_endian_convert(v) le64_to_host((uint64_t)(v))
38
+
39
+enum summary_pidsi {
40
+    SPID_CODEPAGE   = 0x00000001,
41
+    SPID_TITLE      = 0x00000002,
42
+    SPID_SUBJECT    = 0x00000003,
43
+    SPID_AUTHOR     = 0x00000004,
44
+    SPID_KEYWORDS   = 0x00000005,
45
+    SPID_COMMENTS   = 0x00000006,
46
+    SPID_TEMPLATE   = 0x00000007,
47
+    SPID_LASTAUTHOR = 0x00000008,
48
+    SPID_REVNUMBER  = 0x00000009,
49
+    SPID_EDITTIME   = 0x0000000A,
50
+    SPID_LASTPRINTED  = 0x0000000B,
51
+    SPID_CREATEDTIME  = 0x0000000C,
52
+    SPID_MODIFIEDTIME = 0x0000000D,
53
+    SPID_PAGECOUNT = 0x0000000E,
54
+    SPID_WORDCOUNT = 0x0000000F,
55
+    SPID_CHARCOUNT = 0x00000010,
56
+    SPID_THUMBNAIL = 0x00000011,
57
+    SPID_APPNAME   = 0x00000012,
58
+    SPID_SECURITY  = 0x00000013
59
+};
60
+
61
+enum docsum_pidsi {
62
+    DSPID_CODEPAGE    = 0x00000001,
63
+    DSPID_CATEGORY    = 0x00000002,
64
+    DSPID_PRESFORMAT  = 0x00000003,
65
+    DSPID_BYTECOUNT   = 0x00000004,
66
+    DSPID_LINECOUNT   = 0x00000005,
67
+    DSPID_PARCOUNT    = 0x00000006,
68
+    DSPID_SLIDECOUNT  = 0x00000007,
69
+    DSPID_NOTECOUNT   = 0x00000008,
70
+    DSPID_HIDDENCOUNT = 0x00000009,
71
+    DSPID_MMCLIPCOUNT = 0x0000000A,
72
+    DSPID_SCALE       = 0x0000000B,
73
+    DSPID_HEADINGPAIR = 0x0000000C, /* VT_VARIANT | VT_VECTOR */
74
+    DSPID_DOCPARTS    = 0x0000000D, /* VT_VECTOR | VT_LPSTR */
75
+    DSPID_MANAGER     = 0x0000000E,
76
+    DSPID_COMPANY     = 0x0000000F,
77
+    DSPID_LINKSDIRTY  = 0x00000010,
78
+    DSPID_CCHWITHSPACES = 0x00000011,
79
+    DSPID_SHAREDDOC   = 0x00000013, /* must be false */
80
+    DSPID_LINKBASE    = 0x00000014, /* moved to user-defined */
81
+    DSPID_HLINKS      = 0x00000015, /* moved to user-defined */
82
+    DSPID_HYPERLINKSCHANGED = 0x00000016,
83
+    DSPID_VERSION     = 0x00000017,
84
+    DSPID_DIGSIG      = 0x00000018,
85
+    DSPID_CONTENTTYPE   = 0x0000001A,
86
+    DSPID_CONTENTSTATUS = 0x0000001B,
87
+    DSPID_LANGUAGE      = 0x0000001C,
88
+    DSPID_DOCVERSION    = 0x0000001D
89
+};
90
+
91
+enum property_type {
92
+    PT_EMPTY    = 0x0000,
93
+    PT_NULL     = 0x0001,
94
+    PT_INT16    = 0x0002,
95
+    PT_INT32    = 0x0003,
96
+    PT_FLOAT32  = 0x0004,
97
+    PT_DOUBLE64 = 0x0005,
98
+    PT_DATE     = 0x0007,
99
+    PT_BSTR     = 0x0008,
100
+    PT_BOOL    = 0x000B,
101
+    PT_INT8v1  = 0x0010,
102
+    PT_UINT8   = 0x0011,
103
+    PT_UINT16  = 0x0012,
104
+    PT_UINT32  = 0x0013,
105
+    PT_INT64   = 0x0014,
106
+    PT_UINT64  = 0x0015,
107
+    PT_INT32v1  = 0x0016,
108
+    PT_UINT32v1 = 0x0017,
109
+    PT_LPSTR  = 0x001E,
110
+    PT_LPWSTR = 0x001F,
111
+    PT_FILETIME = 0x0040,
112
+	
113
+    /* More Types not currently handled */
114
+};
115
+
116
+typedef struct summary_stub {
117
+    uint16_t byte_order;
118
+    uint16_t version;
119
+    uint32_t system; /* implementation-specific */
120
+    uint8_t CLSID[16];
121
+
122
+    uint32_t num_propsets; /* 1 or 2 */
123
+} summary_stub_t;
124
+
125
+typedef struct propset_summary_entry {
126
+    uint8_t FMTID[16];
127
+    uint32_t offset;
128
+} propset_entry_t;
129
+
130
+/* error codes */
131
+#define OLE2_SUMMARY_ERROR_TOOSMALL      0x00000001
132
+#define OLE2_SUMMARY_ERROR_OOB           0x00000002
133
+#define OLE2_SUMMARY_ERROR_DATABUF       0x00000004
134
+#define OLE2_SUMMARY_ERROR_INVALID_ENTRY 0x00000008
135
+#define OLE2_SUMMARY_LIMIT_PROPS         0x00000010
136
+#define OLE2_SUMMARY_FLAG_TIMEOUT        0x00000020
137
+#define OLE2_SUMMARY_FLAG_CODEPAGE       0x00000040
138
+#define OLE2_SUMMARY_FLAG_UNKNOWN_PROPID 0x00000080
139
+#define OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE 0x00000100
140
+#define OLE2_SUMMARY_FLAG_TRUNC_STR      0x00000200
141
+
142
+#define OLE2_CODEPAGE_ERROR_NOTFOUND     0x00000400
143
+#define OLE2_CODEPAGE_ERROR_UNINITED     0x00000800
144
+#define OLE2_CODEPAGE_ERROR_INVALID      0x00001000
145
+#define OLE2_CODEPAGE_ERROR_INCOMPLETE   0x00002000
146
+#define OLE2_CODEPAGE_ERROR_OUTBUFTOOSMALL 0x00002000
147
+
148
+/* metadata structures */
149
+typedef struct summary_ctx {
150
+    cli_ctx *ctx;
151
+    int mode;
152
+    fmap_t *sfmap;
153
+    json_object *summary;
154
+    size_t maplen;
155
+    uint32_t flags;
156
+
157
+    /* propset metadata */
158
+    uint32_t pssize; /* track from propset start, not tail start */
159
+    uint16_t codepage;
160
+    int writecp;
161
+
162
+    /* property metadata */
163
+    const char *propname;
164
+
165
+    /* timeout meta */
166
+    int toval;
167
+} summary_ctx_t;
168
+
169
+/* string conversion */
170
+struct codepage_entry {
171
+    int16_t codepage;
172
+    const char *encoding;
173
+};
174
+
175
+#define NUMCODEPAGES sizeof(codepage_entries)/sizeof(struct codepage_entry)
176
+/* MAINTAIN - the array in codepage value sorted order */
177
+static const struct codepage_entry codepage_entries[] = {
178
+    { 37,    "IBM037" },      /* IBM EBCDIC US-Canada */
179
+    { 437,   "IBM437" },      /* OEM United States */
180
+    { 500,   "IBM500" },      /* IBM EBCDIC International */
181
+    { 708,   "ASMO-708" },    /* Arabic (ASMO 708) */
182
+    { 709,   NULL },          /* Arabic (ASMO-449+, BCON V4) */
183
+    { 710,   NULL },          /* Arabic - Transparent Arabic */
184
+    { 720,   NULL },          /* Arabic (Transparent ASMO); Arabic (DOS) */
185
+    { 737,   NULL },          /* OEM Greek (formerly 437G); Greek (DOS) */
186
+    { 775,   "IBM775" },      /* OEM Baltic; Baltic (DOS) */
187
+    { 850,   "IBM850" },      /* OEM Multilingual Latin 1; Western European (DOS) */
188
+    { 852,   "IBM852" },      /* OEM Latin 2; Central European (DOS) */
189
+    { 855,   "IBM855" },      /* OEM Cyrillic (primarily Russian) */
190
+    { 857,   "IBM857" },      /* OEM Turkish; Turkish (DOS) */
191
+    { 858,   NULL },          /* OEM Multilingual Latin 1 + Euro symbol */
192
+    { 860,   "IBM860" },      /* OEM Portuguese; Portuguese (DOS) */
193
+    { 861,   "IBM861" },      /* OEM Icelandic; Icelandic (DOS) */
194
+    { 862,   NULL },          /* OEM Hebrew; Hebrew (DOS) */
195
+    { 863,   "IBM863" },      /* OEM French Canadian; French Canadian (DOS) */
196
+    { 864,   "IBM864" },      /* OEM Arabic; Arabic (864) */
197
+    { 865,   "IBM865" },      /* OEM Nordic; Nordic (DOS) */
198
+    { 866,   "CP866" },       /* OEM Russian; Cyrillic (DOS) */
199
+    { 869,   "IBM869" },      /* OEM Modern Greek; Greek, Modern (DOS) */
200
+    { 870,   "IBM870" },      /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */
201
+    { 874,   "WINDOWS-874" }, /* ANSI/OEM Thai (ISO 8859-11); Thai (Windows) */
202
+    { 875,   "CP875" },       /* IBM EBCDIC Greek Modern */
203
+    { 932,   "SHIFT_JIS" },   /* ANSI/OEM Japanese; Japanese (Shift-JIS) */
204
+    { 936,   "GB2312" },      /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */
205
+    { 949,   NULL },          /* ANSI/OEM Korean (Unified Hangul Code) */
206
+    { 950,   "BIG5" },        /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */
207
+    { 1026,  "IBM1026" },     /* IBM EBCDIC Turkish (Latin 5) */
208
+    { 1047,  NULL },          /* IBM EBCDIC Latin 1/Open System */
209
+    { 1140,  NULL },          /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */
210
+    { 1141,  NULL },          /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */
211
+    { 1142,  NULL },          /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */
212
+    { 1143,  NULL },          /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */
213
+    { 1144,  NULL },          /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */
214
+    { 1145,  NULL },          /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */
215
+    { 1146,  NULL },          /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */
216
+    { 1147,  NULL },          /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */
217
+    { 1148,  NULL },          /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */
218
+    { 1149,  NULL },          /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */
219
+    { 1200,  "UTF-16LE" },    /* Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications */
220
+    { 1201,  "UTF-16BE" },    /* Unicode UTF-16, big endian byte order; available only to managed applications */
221
+    { 1250,  "WINDOWS-1250" }, /* ANSI Central European; Central European (Windows) */
222
+    { 1251,  "WINDOWS-1251" }, /* ANSI Cyrillic; Cyrillic (Windows) */
223
+    { 1252,  "WINDOWS-1252" }, /* ANSI Latin 1; Western European (Windows) */
224
+    { 1253,  "WINDOWS-1253" }, /* ANSI Greek; Greek (Windows) */
225
+    { 1254,  "WINDOWS-1254" }, /* ANSI Turkish; Turkish (Windows) */
226
+    { 1255,  "WINDOWS-1255" }, /* ANSI Hebrew; Hebrew (Windows) */
227
+    { 1256,  "WINDOWS-1256" }, /* ANSI Arabic; Arabic (Windows) */
228
+    { 1257,  "WINDOWS-1257" }, /* ANSI Baltic; Baltic (Windows) */
229
+    { 1258,  "WINDOWS-1258" }, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */
230
+    { 1361,  "JOHAB" },       /* Korean (Johab) */
231
+    { 10000, "MACINTOSH" },   /* MAC Roman; Western European (Mac) */
232
+    { 10001, NULL },          /* Japanese (Mac) */
233
+    { 10002, NULL },          /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */
234
+    { 10003, NULL },          /* Korean (Mac) */
235
+    { 10004, NULL },          /* Arabic (Mac) */
236
+    { 10005, NULL },          /* Hebrew (Mac) */
237
+    { 10006, NULL },          /* Greek (Mac) */
238
+    { 10007, NULL },          /* Cyrillic (Mac) */
239
+    { 10008, NULL },          /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */
240
+    { 10010, NULL },          /* Romanian (Mac) */
241
+    { 10017, NULL },          /* Ukrainian (Mac) */
242
+    { 10021, NULL },          /* Thai (Mac) */
243
+    { 10029, NULL },          /* MAC Latin 2; Central European (Mac) */
244
+    { 10079, NULL },          /* Icelandic (Mac) */
245
+    { 10081, NULL },          /* Turkish (Mac) */
246
+    { 10082, NULL },          /* Croatian (Mac) */
247
+    { 12000, "UTF-32LE" },    /* Unicode UTF-32, little endian byte order; available only to managed applications */
248
+    { 12001, "UTF-32BE" },    /* Unicode UTF-32, big endian byte order; available only to managed applications */
249
+    { 20000, NULL },          /* CNS Taiwan; Chinese Traditional (CNS) */
250
+    { 20001, NULL },          /* TCA Taiwan */
251
+    { 20002, NULL },          /* Eten Taiwan; Chinese Traditional (Eten) */
252
+    { 20003, NULL },          /* IBM5550 Taiwan */
253
+    { 20004, NULL },          /* TeleText Taiwan */
254
+    { 20005, NULL },          /* Wang Taiwan */
255
+    { 20105, NULL },          /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */
256
+    { 20106, NULL },          /* IA5 German (7-bit) */
257
+    { 20107, NULL },          /* IA5 Swedish (7-bit) */
258
+    { 20108, NULL },          /* IA5 Norwegian (7-bit) */
259
+    { 20127, "US-ASCII" },    /* US-ASCII (7-bit) */
260
+    { 20261, NULL },          /* T.61 */
261
+    { 20269, NULL },          /* ISO 6937 Non-Spacing Accent */
262
+    { 20273, "IBM273" },      /* IBM EBCDIC Germany */
263
+    { 20277, "IBM277" },      /* IBM EBCDIC Denmark-Norway */
264
+    { 20278, "IBM278" },      /* IBM EBCDIC Finland-Sweden */
265
+    { 20280, "IBM280" },      /* IBM EBCDIC Italy */
266
+    { 20284, "IBM284" },      /* IBM EBCDIC Latin America-Spain */
267
+    { 20285, "IBM285" },      /* IBM EBCDIC United Kingdom */
268
+    { 20290, "IBM290" },      /* IBM EBCDIC Japanese Katakana Extended */
269
+    { 20297, "IBM297" },      /* IBM EBCDIC France */
270
+    { 20420, "IBM420" },      /* IBM EBCDIC Arabic */
271
+    { 20423, "IBM423" },      /* IBM EBCDIC Greek */
272
+    { 20424, "IBM424" },      /* IBM EBCDIC Hebrew */
273
+    { 20833, NULL },          /* IBM EBCDIC Korean Extended */
274
+    { 20838, NULL },          /* IBM EBCDIC Thai */
275
+    { 20866, "KOI8-R" },      /* Russian (KOI8-R); Cyrillic (KOI8-R) */
276
+    { 20871, "IBM871" },      /* IBM EBCDIC Icelandic */
277
+    { 20880, "IBM880" },      /* IBM EBCDIC Cyrillic Russian */
278
+    { 20905, "IBM905" },      /* IBM EBCDIC Turkish */
279
+    { 20924, NULL },          /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */
280
+    { 20932, "EUC-JP" },      /* Japanese (JIS 0208-1990 and 0212-1990) */
281
+    { 20936, NULL },          /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */
282
+    { 20949, NULL },          /* Korean Wansung */
283
+    { 21025, "CP1025" },      /* IBM EBCDIC Cyrillic Serbian-Bulgarian */
284
+    { 21027, NULL },          /* (deprecated) */
285
+    { 21866, "KOI8-U" },      /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */
286
+    { 28591, "ISO-8859-1" },  /* ISO 8859-1 Latin 1; Western European (ISO) */
287
+    { 28592, "ISO-8859-2" },  /* ISO 8859-2 Central European; Central European (ISO) */
288
+    { 28593, "ISO-8859-3" },  /* ISO 8859-3 Latin 3 */
289
+    { 28594, "ISO-8859-4" },  /* ISO 8859-4 Baltic */
290
+    { 28595, "ISO-8859-5" },  /* ISO 8859-5 Cyrillic */
291
+    { 28596, "ISO-8859-6" },  /* ISO 8859-6 Arabic */
292
+    { 28597, "ISO-8859-7" },  /* ISO 8859-7 Greek */
293
+    { 28598, "ISO-8859-8" },  /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */
294
+    { 28599, "ISO-8859-9" },  /* ISO 8859-9 Turkish */
295
+    { 28603, "ISO-8859-13" }, /* ISO 8859-13 Estonian */
296
+    { 28605, "ISO-8859-15" }, /* ISO 8859-15 Latin 9 */
297
+    { 29001, NULL },          /* Europa 3 */
298
+    { 38598, NULL },          /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */
299
+    { 50220, "ISO-2022-JP" },   /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) (guess) */
300
+    { 50221, "ISO-2022-JP-2" }, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) (guess) */
301
+    { 50222, "ISO-2022-JP-3" }, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) (guess) */
302
+    { 50225, "ISO-2022-KR" }, /* ISO 2022 Korean */
303
+    { 50227, NULL },          /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */
304
+    { 50229, NULL },          /* ISO 2022 Traditional Chinese */
305
+    { 50930, NULL },          /* EBCDIC Japanese (Katakana) Extended */
306
+    { 50931, NULL },          /* EBCDIC US-Canada and Japanese */
307
+    { 50933, NULL },          /* EBCDIC Korean Extended and Korean */
308
+    { 50935, NULL },          /* EBCDIC Simplified Chinese Extended and Simplified Chinese */
309
+    { 50936, NULL },          /* EBCDIC Simplified Chinese */
310
+    { 50937, NULL },          /* EBCDIC US-Canada and Traditional Chinese */
311
+    { 50939, NULL },          /* EBCDIC Japanese (Latin) Extended and Japanese */
312
+    { 51932, "EUC-JP" },      /* EUC Japanese */
313
+    { 51936, "EUC-CN" },      /* EUC Simplified Chinese; Chinese Simplified (EUC) */
314
+    { 51949, "EUC-KR" },      /* EUC Korean */
315
+    { 51950, NULL },          /* EUC Traditional Chinese */
316
+    { 52936, NULL },          /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */
317
+    { 54936, "GB18030" },     /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */
318
+    { 57002, NULL },          /* ISCII Devanagari */
319
+    { 57003, NULL },          /* ISCII Bengali */
320
+    { 57004, NULL },          /* ISCII Tamil */
321
+    { 57005, NULL },          /* ISCII Telugu */
322
+    { 57006, NULL },          /* ISCII Assamese */
323
+    { 57007, NULL },          /* ISCII Oriya */
324
+    { 57008, NULL },          /* ISCII Kannada */
325
+    { 57009, NULL },          /* ISCII Malayalam */
326
+    { 57010, NULL },          /* ISCII Gujarati */
327
+    { 57011, NULL },          /* ISCII Punjabi */
328
+    { 65000, "UTF-7" },       /* Unicode (UTF-7) */
329
+    { 65001, "UTF-8" }        /* Unicode (UTF-8) */
330
+};
331
+
332
+int cli_ole2_summary_json(cli_ctx *ctx, int fd, int mode);
333
+#endif /* HAVE_JSON */
334
+
335
+#endif /* __MSDOC_H_ */
... ...
@@ -28,12 +28,13 @@
28 28
 #include <fcntl.h>
29 29
 #include <stdio.h>
30 30
 #include <string.h>
31
+#include <ctype.h>
32
+#include <stdlib.h>
33
+#include <errno.h>
34
+#include <conv.h>
31 35
 #ifdef	HAVE_UNISTD_H
32 36
 #include <unistd.h>
33 37
 #endif
34
-#include <ctype.h>
35
-#include <stdlib.h>
36
-#include "clamav.h"
37 38
 
38 39
 #include "clamav.h"
39 40
 #include "cltypes.h"
... ...
@@ -42,6 +43,9 @@
42 42
 #include "scanners.h"
43 43
 #include "fmap.h"
44 44
 #include "json_api.h"
45
+#if HAVE_JSON
46
+#include "msdoc.h"
47
+#endif
45 48
 
46 49
 #ifdef DEBUG_OLE2_LIST
47 50
 #define ole2_listmsg(...) cli_dbgmsg( __VA_ARGS__)
... ...
@@ -1312,897 +1316,3 @@ abort:
1312 1312
 
1313 1313
     return ret == CL_BREAK ? CL_CLEAN : ret;
1314 1314
 }
1315
-
1316
-/* Summary and Document Information Parsing to JSON */
1317
-#if HAVE_JSON
1318
-
1319
-#define WINUNICODE 0x04B0
1320
-#define PROPCNTLIMIT 25
1321
-#define PROPSTRLIMIT 62
1322
-
1323
-#define sum16_endian_convert(v) le16_to_host((uint16_t)(v))
1324
-#define sum32_endian_convert(v) le32_to_host((uint32_t)(v))
1325
-#define sum64_endian_convert(v) le64_to_host((uint64_t)(v))
1326
-
1327
-enum summary_pidsi {
1328
-    SPID_CODEPAGE   = 0x00000001,
1329
-    SPID_TITLE      = 0x00000002,
1330
-    SPID_SUBJECT    = 0x00000003,
1331
-    SPID_AUTHOR     = 0x00000004,
1332
-    SPID_KEYWORDS   = 0x00000005,
1333
-    SPID_COMMENTS   = 0x00000006,
1334
-    SPID_TEMPLATE   = 0x00000007,
1335
-    SPID_LASTAUTHOR = 0x00000008,
1336
-    SPID_REVNUMBER  = 0x00000009,
1337
-    SPID_EDITTIME   = 0x0000000A,
1338
-    SPID_LASTPRINTED  = 0x0000000B,
1339
-    SPID_CREATEDTIME  = 0x0000000C,
1340
-    SPID_MODIFIEDTIME = 0x0000000D,
1341
-    SPID_PAGECOUNT = 0x0000000E,
1342
-    SPID_WORDCOUNT = 0x0000000F,
1343
-    SPID_CHARCOUNT = 0x00000010,
1344
-    SPID_THUMBNAIL = 0x00000011,
1345
-    SPID_APPNAME   = 0x00000012,
1346
-    SPID_SECURITY  = 0x00000013
1347
-};
1348
-
1349
-enum docsum_pidsi {
1350
-    DSPID_CODEPAGE    = 0x00000001,
1351
-    DSPID_CATEGORY    = 0x00000002,
1352
-    DSPID_PRESFORMAT  = 0x00000003,
1353
-    DSPID_BYTECOUNT   = 0x00000004,
1354
-    DSPID_LINECOUNT   = 0x00000005,
1355
-    DSPID_PARCOUNT    = 0x00000006,
1356
-    DSPID_SLIDECOUNT  = 0x00000007,
1357
-    DSPID_NOTECOUNT   = 0x00000008,
1358
-    DSPID_HIDDENCOUNT = 0x00000009,
1359
-    DSPID_MMCLIPCOUNT = 0x0000000A,
1360
-    DSPID_SCALE       = 0x0000000B,
1361
-    DSPID_HEADINGPAIR = 0x0000000C, /* VT_VARIANT | VT_VECTOR */
1362
-    DSPID_DOCPARTS    = 0x0000000D, /* VT_VECTOR | VT_LPSTR */
1363
-    DSPID_MANAGER     = 0x0000000E,
1364
-    DSPID_COMPANY     = 0x0000000F,
1365
-    DSPID_LINKSDIRTY  = 0x00000010,
1366
-    DSPID_CCHWITHSPACES = 0x00000011,
1367
-    DSPID_SHAREDDOC   = 0x00000013, /* must be false */
1368
-    DSPID_LINKBASE    = 0x00000014, /* moved to user-defined */
1369
-    DSPID_HLINKS      = 0x00000015, /* moved to user-defined */
1370
-    DSPID_HYPERLINKSCHANGED = 0x00000016,
1371
-    DSPID_VERSION     = 0x00000017,
1372
-    DSPID_DIGSIG      = 0x00000018,
1373
-    DSPID_CONTENTTYPE   = 0x0000001A,
1374
-    DSPID_CONTENTSTATUS = 0x0000001B,
1375
-    DSPID_LANGUAGE      = 0x0000001C,
1376
-    DSPID_DOCVERSION    = 0x0000001D
1377
-};
1378
-
1379
-enum property_type {
1380
-    PT_EMPTY    = 0x0000,
1381
-    PT_NULL     = 0x0001,
1382
-    PT_INT16    = 0x0002,
1383
-    PT_INT32    = 0x0003,
1384
-    PT_FLOAT32  = 0x0004,
1385
-    PT_DOUBLE64 = 0x0005,
1386
-    PT_DATE     = 0x0007,
1387
-    PT_BSTR     = 0x0008,
1388
-    PT_BOOL    = 0x000B,
1389
-    PT_INT8v1  = 0x0010,
1390
-    PT_UINT8   = 0x0011,
1391
-    PT_UINT16  = 0x0012,
1392
-    PT_UINT32  = 0x0013,
1393
-    PT_INT64   = 0x0014,
1394
-    PT_UINT64  = 0x0015,
1395
-    PT_INT32v1  = 0x0016,
1396
-    PT_UINT32v1 = 0x0017,
1397
-    PT_LPSTR  = 0x001E,
1398
-    PT_LPWSTR = 0x001F,
1399
-    PT_FILETIME = 0x0040,
1400
-	
1401
-    /* More Types not currently handled */
1402
-};
1403
-
1404
-typedef struct summary_stub {
1405
-    uint16_t byte_order;
1406
-    uint16_t version;
1407
-    uint32_t system; /* implementation-specific */
1408
-    uint8_t CLSID[16];
1409
-
1410
-    uint32_t num_propsets; /* 1 or 2 */
1411
-} summary_stub_t;
1412
-
1413
-typedef struct propset_summary_entry {
1414
-    uint8_t FMTID[16];
1415
-    uint32_t offset;
1416
-} propset_entry_t;
1417
-
1418
-/* metadata structures */
1419
-#define OLE2_SUMMARY_ERROR_TOOSMALL      0x00000001
1420
-#define OLE2_SUMMARY_ERROR_OOB           0x00000002
1421
-#define OLE2_SUMMARY_ERROR_DATABUF       0x00000004
1422
-#define OLE2_SUMMARY_ERROR_INVALID_ENTRY 0x00000008
1423
-#define OLE2_SUMMARY_LIMIT_PROPS         0x00000010
1424
-#define OLE2_SUMMARY_FLAG_TIMEOUT        0x00000020
1425
-#define OLE2_SUMMARY_FLAG_CODEPAGE       0x00000040
1426
-#define OLE2_SUMMARY_FLAG_UNKNOWN_PROPID 0x00000080
1427
-#define OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE 0x00000100
1428
-#define OLE2_SUMMARY_FLAG_TRUNC_STR      0x00000200
1429
-
1430
-typedef struct summary_ctx {
1431
-    cli_ctx *ctx;
1432
-    int mode;
1433
-    fmap_t *sfmap;
1434
-    json_object *summary;
1435
-    size_t maplen;
1436
-    uint32_t flags;
1437
-
1438
-    /* propset metadata */
1439
-    uint32_t pssize; /* track from propset start, not tail start */
1440
-    int16_t codepage;
1441
-    int writecp;
1442
-
1443
-    /* property metadata */
1444
-    const char *propname;
1445
-
1446
-    /* timeout meta */
1447
-    int toval;
1448
-} summary_ctx_t;
1449
-
1450
-static int
1451
-ole2_process_property(summary_ctx_t *sctx, unsigned char *databuf, uint32_t offset)
1452
-{
1453
-    uint16_t proptype, padding;
1454
-    int ret = CL_SUCCESS;
1455
-
1456
-    if (cli_json_timeout_cycle_check(sctx->ctx, &(sctx->toval)) != CL_SUCCESS) {
1457
-        sctx->flags |= OLE2_SUMMARY_FLAG_TIMEOUT;
1458
-        return CL_ETIMEOUT;
1459
-    }
1460
-
1461
-    if (offset+sizeof(proptype)+sizeof(padding) > sctx->pssize) {
1462
-        sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1463
-        return CL_EFORMAT;
1464
-    }
1465
-
1466
-    memcpy(&proptype, databuf+offset, sizeof(proptype));
1467
-    offset+=sizeof(proptype);
1468
-    memcpy(&padding, databuf+offset, sizeof(padding));
1469
-    offset+=sizeof(padding);
1470
-    /* endian conversion */
1471
-    proptype = sum16_endian_convert(proptype);
1472
-
1473
-    //cli_dbgmsg("proptype: 0x%04x\n", proptype);
1474
-    if (padding != 0) {
1475
-        cli_dbgmsg("ole2_process_property: invalid padding value, non-zero\n");
1476
-        sctx->flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
1477
-        return CL_EFORMAT;
1478
-    }
1479
-
1480
-    switch (proptype) {
1481
-    case PT_EMPTY:
1482
-    case PT_NULL:
1483
-        ret = cli_jsonnull(sctx->summary, sctx->propname);
1484
-        break;
1485
-    case PT_INT16:
1486
-	{
1487
-            int16_t dout;
1488
-            if (offset+sizeof(dout) > sctx->pssize) {
1489
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1490
-                return CL_EFORMAT;
1491
-            }
1492
-            memcpy(&dout, databuf+offset, sizeof(dout));
1493
-            offset+=sizeof(dout);
1494
-            /* endian conversion */
1495
-            dout = sum16_endian_convert(dout);
1496
-
1497
-            if (sctx->writecp)
1498
-                sctx->codepage = dout;
1499
-
1500
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1501
-            break;
1502
-	}
1503
-    case PT_INT32:
1504
-    case PT_INT32v1:
1505
-	{
1506
-            int32_t dout;
1507
-            if (offset+sizeof(dout) > sctx->pssize) {
1508
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1509
-                return CL_EFORMAT;
1510
-            }
1511
-            memcpy(&dout, databuf+offset, sizeof(dout));
1512
-            offset+=sizeof(dout);
1513
-            /* endian conversion */
1514
-            dout = sum32_endian_convert(dout);
1515
-
1516
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1517
-            break;
1518
-	}
1519
-    case PT_FLOAT32: /* review this please */
1520
-	{
1521
-            float dout;
1522
-            if (offset+sizeof(dout) > sctx->pssize) {
1523
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1524
-                return CL_EFORMAT;
1525
-            }
1526
-            memcpy(&dout, databuf+offset, sizeof(dout));
1527
-            offset+=sizeof(dout);
1528
-            /* endian conversion */
1529
-            dout = sum32_endian_convert(dout);
1530
-
1531
-            ret = cli_jsondouble(sctx->summary, sctx->propname, dout);
1532
-            break;
1533
-	}
1534
-    case PT_DATE:
1535
-    case PT_DOUBLE64: /* review this please */
1536
-	{
1537
-            double dout;
1538
-            if (offset+sizeof(dout) > sctx->pssize) {
1539
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1540
-                return CL_EFORMAT;
1541
-            }
1542
-            memcpy(&dout, databuf+offset, sizeof(dout));
1543
-            offset+=sizeof(dout);
1544
-            /* endian conversion */
1545
-            dout = sum64_endian_convert(dout);
1546
-
1547
-            ret = cli_jsondouble(sctx->summary, sctx->propname, dout);
1548
-            break;
1549
-	}
1550
-    case PT_BOOL:
1551
-	{
1552
-            uint16_t dout;
1553
-            if (offset+sizeof(dout) > sctx->pssize) {
1554
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1555
-                return CL_EFORMAT;
1556
-            }
1557
-            memcpy(&dout, databuf+offset, sizeof(dout));
1558
-            offset+=sizeof(dout);
1559
-            /* no need for endian conversion */
1560
-
1561
-            ret = cli_jsonbool(sctx->summary, sctx->propname, dout);
1562
-            break;
1563
-	}
1564
-    case PT_INT8v1:
1565
-	{
1566
-            int8_t dout;
1567
-            if (offset+sizeof(dout) > sctx->pssize) {
1568
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1569
-                return CL_EFORMAT;
1570
-            }
1571
-            memcpy(&dout, databuf+offset, sizeof(dout));
1572
-            offset+=sizeof(dout);
1573
-            /* no need for endian conversion */
1574
-
1575
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1576
-            break;
1577
-	}
1578
-    case PT_UINT8:
1579
-	{
1580
-            uint8_t dout;
1581
-            if (offset+sizeof(dout) > sctx->pssize) {
1582
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1583
-                return CL_EFORMAT;
1584
-            }
1585
-            memcpy(&dout, databuf+offset, sizeof(dout));
1586
-            offset+=sizeof(dout);
1587
-            /* no need for endian conversion */
1588
-
1589
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1590
-            break;
1591
-	}
1592
-    case PT_UINT16:
1593
-	{
1594
-            uint16_t dout;
1595
-            if (offset+sizeof(dout) > sctx->pssize) {
1596
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1597
-                return CL_EFORMAT;
1598
-            }
1599
-            memcpy(&dout, databuf+offset, sizeof(dout));
1600
-            offset+=sizeof(dout);
1601
-            /* endian conversion */
1602
-            dout = sum16_endian_convert(dout);
1603
-
1604
-            if (sctx->writecp)
1605
-                sctx->codepage = dout;
1606
-
1607
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1608
-            break;
1609
-	}
1610
-    case PT_UINT32:
1611
-    case PT_UINT32v1:
1612
-	{
1613
-            uint32_t dout;
1614
-            if (offset+sizeof(dout) > sctx->pssize) {
1615
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1616
-                return CL_EFORMAT;
1617
-            }
1618
-            memcpy(&dout, databuf+offset, sizeof(dout));
1619
-            offset+=sizeof(dout);
1620
-            /* endian conversion */
1621
-            dout = sum32_endian_convert(dout);
1622
-
1623
-            ret = cli_jsonint(sctx->summary, sctx->propname, dout);
1624
-            break;
1625
-	}
1626
-    case PT_INT64:
1627
-	{
1628
-            int64_t dout;
1629
-            if (offset+sizeof(dout) > sctx->pssize) {
1630
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1631
-                return CL_EFORMAT;
1632
-            }
1633
-            memcpy(&dout, databuf+offset, sizeof(dout));
1634
-            offset+=sizeof(dout);
1635
-            /* endian conversion */
1636
-            dout = sum64_endian_convert(dout);
1637
-
1638
-            ret = cli_jsonint64(sctx->summary, sctx->propname, dout);
1639
-            break;
1640
-	}
1641
-    case PT_UINT64:
1642
-	{
1643
-            uint64_t dout;
1644
-            if (offset+sizeof(dout) > sctx->pssize) {
1645
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1646
-                return CL_EFORMAT;
1647
-            }
1648
-            memcpy(&dout, databuf+offset, sizeof(dout));
1649
-            offset+=sizeof(dout);
1650
-            /* endian conversion */
1651
-            dout = sum64_endian_convert(dout);
1652
-
1653
-            ret = cli_jsonint64(sctx->summary, sctx->propname, dout);
1654
-            break;
1655
-	}
1656
-    case PT_BSTR:
1657
-    case PT_LPSTR:
1658
-        if (sctx->codepage == 0) {
1659
-            cli_dbgmsg("ole2_propset_json: current codepage is unknown, cannot parse char stream\n");
1660
-            sctx->flags |= OLE2_SUMMARY_FLAG_CODEPAGE;
1661
-            break;
1662
-        }
1663
-        else if (sctx->codepage != WINUNICODE) {
1664
-            uint32_t strsize;
1665
-            char *outstr;
1666
-
1667
-            if (offset+sizeof(strsize) > sctx->pssize) {
1668
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1669
-                return CL_EFORMAT;
1670
-            }
1671
-
1672
-            memcpy(&strsize, databuf+offset, sizeof(strsize));
1673
-            offset+=sizeof(strsize);
1674
-            /* endian conversion */
1675
-            strsize = sum32_endian_convert(strsize);
1676
-
1677
-            if (offset+strsize > sctx->pssize) {
1678
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1679
-                return CL_EFORMAT;
1680
-            }
1681
-
1682
-            /* limitation on string length */
1683
-            if (strsize > PROPSTRLIMIT) {
1684
-                cli_dbgmsg("ole2_process_property: property string sized %lu truncated to size %lu\n",
1685
-                           (unsigned long)strsize, (unsigned long)PROPSTRLIMIT);
1686
-                sctx->flags |= OLE2_SUMMARY_FLAG_TRUNC_STR;
1687
-                strsize = PROPSTRLIMIT;
1688
-            }
1689
-
1690
-            outstr = cli_calloc(strsize+1, 1); /* last char must be NULL */
1691
-            if (!outstr) {
1692
-                return CL_EMEM;
1693
-            }
1694
-            strncpy(outstr, (const char *)(databuf+offset), strsize);
1695
-            ret = cli_jsonstr(sctx->summary, sctx->propname, outstr);
1696
-            free(outstr);
1697
-            break;
1698
-        }
1699
-        /* fall-through for unicode strings */
1700
-    case PT_LPWSTR:
1701
-	{
1702
-            uint32_t strsize;
1703
-            char *outstr, *outstr2;
1704
-
1705
-            if (offset+sizeof(strsize) > sctx->pssize) {
1706
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1707
-                return CL_EFORMAT;
1708
-            }
1709
-            memcpy(&strsize, databuf+offset, sizeof(strsize));
1710
-            offset+=sizeof(strsize);
1711
-            /* endian conversion */
1712
-            strsize = sum32_endian_convert(strsize);
1713
-            
1714
-            if (proptype == PT_LPSTR) { /* fall-through specifics */
1715
-                if (strsize % 2) {
1716
-                    cli_dbgmsg("ole2_process_property: LPSTR using wchar not sized a multiple of 2\n");
1717
-                    sctx->flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
1718
-                    return CL_EFORMAT;
1719
-                }
1720
-            }
1721
-            else {
1722
-                strsize*=2; /* Unicode strings are by length, not size */
1723
-            }
1724
-
1725
-            /* limitation on string length */
1726
-            if (strsize > (2*PROPSTRLIMIT)) {
1727
-                cli_dbgmsg("ole2_process_property: property string sized %lu truncated to size %lu\n",
1728
-                           (unsigned long)strsize, (unsigned long)(2*PROPSTRLIMIT));
1729
-                sctx->flags |= OLE2_SUMMARY_FLAG_TRUNC_STR;
1730
-                strsize = (2*PROPSTRLIMIT);
1731
-            }
1732
-
1733
-            if (offset+strsize > sctx->pssize) {
1734
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1735
-                return CL_EFORMAT;
1736
-            }
1737
-            outstr = cli_calloc(strsize+2, 1); /* last two chars must be NULL */
1738
-            if (!outstr) {
1739
-                return CL_EMEM;
1740
-            }
1741
-            strncpy(outstr, (const char *)(databuf+offset), strsize);
1742
-            outstr2 = (char*)get_property_name2(outstr, strsize);
1743
-            if (outstr2) {
1744
-                ret = cli_jsonstr(sctx->summary, sctx->propname, outstr2);
1745
-                free(outstr2);
1746
-            }
1747
-            free(outstr);
1748
-            break;
1749
-	}
1750
-    case PT_FILETIME:
1751
-	{
1752
-            uint32_t ltime, htime;
1753
-            uint64_t wtime = 0, utime =0;
1754
-
1755
-            if (offset+sizeof(ltime)+sizeof(htime) > sctx->pssize) {
1756
-                sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
1757
-                return CL_EFORMAT;
1758
-            }
1759
-            memcpy(&ltime, databuf+offset, sizeof(ltime));
1760
-            offset+=sizeof(ltime);
1761
-            memcpy(&htime, databuf+offset, sizeof(htime));
1762
-            offset+=sizeof(ltime);
1763
-            ltime = sum32_endian_convert(ltime);
1764
-            htime = sum32_endian_convert(htime);
1765
-
1766
-            /* UNIX timestamp formatting */
1767
-            wtime = htime;
1768
-            wtime <<= 32;
1769
-            wtime |= ltime;
1770
-
1771
-            utime = wtime / 10000000;
1772
-            utime -= 11644473600LL;
1773
-
1774
-            if ((uint32_t)((utime & 0xFFFFFFFF00000000) >> 32)) {
1775
-                cli_dbgmsg("ole2_process_property: UNIX timestamp is larger than 32-bit number\n");
1776
-            }
1777
-            else {
1778
-                ret = cli_jsonint(sctx->summary, sctx->propname, (uint32_t)(utime & 0xFFFFFFFF));
1779
-            }
1780
-            break;
1781
-	}
1782
-    default:
1783
-        cli_dbgmsg("ole2_process_property: unhandled property type 0x%04x for %s property\n", 
1784
-                   proptype, sctx->propname);
1785
-        sctx->flags |= OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE;
1786
-    }
1787
-
1788
-    return ret;
1789
-}
1790
-
1791
-static void ole2_translate_docsummary_propid(summary_ctx_t *sctx, uint32_t propid)
1792
-{
1793
-    switch(propid) {
1794
-    case DSPID_CODEPAGE:
1795
-        sctx->writecp = 1; /* must be set ONLY for codepage */
1796
-        sctx->propname = "CodePage";
1797
-        break;
1798
-    case DSPID_CATEGORY:
1799
-        sctx->propname = "Category";
1800
-        break;
1801
-    case DSPID_PRESFORMAT:
1802
-        sctx->propname = "PresentationTarget";
1803
-        break;
1804
-    case DSPID_BYTECOUNT:
1805
-        sctx->propname = "Bytes";
1806
-        break;
1807
-    case DSPID_LINECOUNT:
1808
-        sctx->propname = "Lines";
1809
-        break;
1810
-    case DSPID_PARCOUNT:
1811
-        sctx->propname = "Paragraphs";
1812
-        break;
1813
-    case DSPID_SLIDECOUNT:
1814
-        sctx->propname = "Slides";
1815
-        break;
1816
-    case DSPID_NOTECOUNT:
1817
-        sctx->propname = "Notes";
1818
-        break;
1819
-    case DSPID_HIDDENCOUNT:
1820
-        sctx->propname = "HiddenSlides";
1821
-        break;
1822
-    case DSPID_MMCLIPCOUNT:
1823
-        sctx->propname = "MMClips";
1824
-        break;
1825
-    case DSPID_SCALE:
1826
-        sctx->propname = "Scale";
1827
-        break;
1828
-    case DSPID_HEADINGPAIR: /* VT_VARIANT | VT_VECTOR */
1829
-        sctx->propname = "HeadingPairs";
1830
-        break;
1831
-    case DSPID_DOCPARTS:    /* VT_VECTOR | VT_LPSTR */
1832
-        sctx->propname = "DocPartTitles";
1833
-        break;
1834
-    case DSPID_MANAGER:
1835
-        sctx->propname = "Manager";
1836
-        break;
1837
-    case DSPID_COMPANY:
1838
-        sctx->propname = "Company";
1839
-        break;
1840
-    case DSPID_LINKSDIRTY:
1841
-        sctx->propname = "LinksDirty";
1842
-        break;
1843
-    case DSPID_CCHWITHSPACES:
1844
-        sctx->propname = "Char&WSCount";
1845
-        break;
1846
-    case DSPID_SHAREDDOC:   /* SHOULD BE FALSE! */
1847
-        sctx->propname = "SharedDoc";
1848
-        break;
1849
-    case DSPID_LINKBASE:    /* moved to user-defined */
1850
-        sctx->propname = "LinkBase";
1851
-        break;
1852
-    case DSPID_HLINKS:      /* moved to user-defined */
1853
-        sctx->propname = "HyperLinks";
1854
-        break;
1855
-    case DSPID_HYPERLINKSCHANGED:
1856
-        sctx->propname = "HyperLinksChanged";
1857
-        break;
1858
-    case DSPID_VERSION:
1859
-        sctx->propname = "Version";
1860
-        break;
1861
-    case DSPID_DIGSIG:
1862
-        sctx->propname = "DigitalSig";
1863
-        break;
1864
-    case DSPID_CONTENTTYPE:
1865
-        sctx->propname = "ContentType";
1866
-        break;
1867
-    case DSPID_CONTENTSTATUS:
1868
-        sctx->propname = "ContentStatus";
1869
-        break;
1870
-    case DSPID_LANGUAGE:
1871
-        sctx->propname = "Language";
1872
-        break;
1873
-    case DSPID_DOCVERSION:
1874
-        sctx->propname = "DocVersion";
1875
-        break;
1876
-    default:
1877
-        cli_dbgmsg("ole2_docsum_propset_json: unrecognized propid!\n");
1878
-        sctx->flags |= OLE2_SUMMARY_FLAG_UNKNOWN_PROPID;
1879
-    }
1880
-}
1881
-
1882
-static void ole2_translate_summary_propid(summary_ctx_t *sctx, uint32_t propid)
1883
-{
1884
-    switch(propid) {
1885
-    case SPID_CODEPAGE:
1886
-        sctx->writecp = 1; /* must be set ONLY for codepage */
1887
-        sctx->propname = "CodePage";
1888
-        break;
1889
-    case SPID_TITLE:
1890
-        sctx->propname = "Title";
1891
-        break;
1892
-    case SPID_SUBJECT:
1893
-        sctx->propname = "Subject";
1894
-        break;
1895
-    case SPID_AUTHOR:
1896
-        sctx->propname = "Author";
1897
-        break;
1898
-    case SPID_KEYWORDS:
1899
-        sctx->propname = "Keywords";
1900
-        break;
1901
-    case SPID_COMMENTS:
1902
-        sctx->propname = "Comments";
1903
-        break;
1904
-    case SPID_TEMPLATE:
1905
-        sctx->propname = "Template";
1906
-        break;
1907
-    case SPID_LASTAUTHOR:
1908
-        sctx->propname = "LastAuthor";
1909
-        break;
1910
-    case SPID_REVNUMBER:
1911
-        sctx->propname = "RevNumber";
1912
-        break;
1913
-    case SPID_EDITTIME:
1914
-        sctx->propname = "EditTime";
1915
-        break;
1916
-    case SPID_LASTPRINTED:
1917
-        sctx->propname = "LastPrinted";
1918
-        break;
1919
-    case SPID_CREATEDTIME:
1920
-        sctx->propname = "CreatedTime";
1921
-        break;
1922
-    case SPID_MODIFIEDTIME:
1923
-        sctx->propname = "ModifiedTime";
1924
-        break;
1925
-    case SPID_PAGECOUNT:
1926
-        sctx->propname = "PageCount";
1927
-        break;
1928
-    case SPID_WORDCOUNT:
1929
-        sctx->propname = "WordCount";
1930
-        break;
1931
-    case SPID_CHARCOUNT:
1932
-        sctx->propname = "CharCount";
1933
-        break;
1934
-    case SPID_THUMBNAIL:
1935
-        sctx->propname = "Thumbnail";
1936
-        break;
1937
-    case SPID_APPNAME:
1938
-        sctx->propname = "AppName";
1939
-        break;
1940
-    case SPID_SECURITY:
1941
-        sctx->propname = "Security";
1942
-        break;
1943
-    default:
1944
-        cli_dbgmsg("ole2_translate_summary_propid: unrecognized propid!\n");
1945
-        sctx->flags |= OLE2_SUMMARY_FLAG_UNKNOWN_PROPID;
1946
-    }
1947
-}
1948
-
1949
-static int ole2_summary_propset_json(summary_ctx_t *sctx, off_t offset)
1950
-{
1951
-    unsigned char *hdr, *ps;
1952
-    uint32_t numprops, limitprops;
1953
-    off_t foff = offset, psoff = 0;
1954
-    uint32_t poffset;
1955
-    int ret;
1956
-    unsigned int i;
1957
-
1958
-    cli_dbgmsg("in ole2_summary_propset_json\n");
1959
-
1960
-    /* summary ctx propset-specific setup*/
1961
-    sctx->codepage = 0;
1962
-    sctx->writecp = 0;
1963
-    sctx->propname = NULL;
1964
-
1965
-    /* examine property set metadata */
1966
-    if ((foff+(2*sizeof(uint32_t))) > sctx->maplen) {
1967
-        sctx->flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
1968
-        return CL_EFORMAT;
1969
-    }
1970
-    hdr = (unsigned char*)fmap_need_off_once(sctx->sfmap, foff, (2*sizeof(uint32_t)));
1971
-    if (!hdr) {
1972
-        sctx->flags |= OLE2_SUMMARY_ERROR_DATABUF;
1973
-        return CL_EREAD;
1974
-    }
1975
-    //foff+=(2*sizeof(uint32_t)); // keep foff pointing to start of propset segment
1976
-    psoff+=(2*sizeof(uint32_t));
1977
-    memcpy(&(sctx->pssize), hdr, sizeof(sctx->pssize));
1978
-    memcpy(&numprops, hdr+sizeof(sctx->pssize), sizeof(numprops));
1979
-    /* endian conversion */
1980
-    sctx->pssize = sum32_endian_convert(sctx->pssize);
1981
-    numprops = sum32_endian_convert(numprops);
1982
-    cli_dbgmsg("ole2_summary_propset_json: pssize: %u, numprops: %u\n", sctx->pssize, numprops);
1983
-    if (numprops > PROPCNTLIMIT) {
1984
-        sctx->flags |= OLE2_SUMMARY_LIMIT_PROPS;
1985
-        limitprops = PROPCNTLIMIT;
1986
-    }
1987
-    else {
1988
-        limitprops = numprops;
1989
-    }
1990
-    cli_dbgmsg("ole2_summary_propset_json: processing %u of %u (%u max) propeties\n",
1991
-               limitprops, numprops, PROPCNTLIMIT);
1992
-
1993
-    /* extract remaining fragment of propset */
1994
-    if ((size_t)(foff+(sctx->pssize)) > (size_t)(sctx->maplen)) {
1995
-        sctx->flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
1996
-        return CL_EFORMAT;
1997
-    }
1998
-    ps = (unsigned char*)fmap_need_off_once(sctx->sfmap, foff, sctx->pssize);
1999
-    if (!ps) {
2000
-        sctx->flags |= OLE2_SUMMARY_ERROR_DATABUF;
2001
-        return CL_EREAD;
2002
-    }
2003
-
2004
-    /* iterate over the properties */
2005
-    for (i = 0; i < limitprops; ++i) {
2006
-        uint32_t propid, propoff;
2007
-
2008
-        if (psoff+sizeof(propid)+sizeof(poffset) > sctx->pssize) {
2009
-            sctx->flags |= OLE2_SUMMARY_ERROR_OOB;
2010
-            return CL_EFORMAT;
2011
-        }
2012
-        memcpy(&propid, ps+psoff, sizeof(propid));
2013
-        psoff+=sizeof(propid);
2014
-        memcpy(&propoff, ps+psoff, sizeof(propoff));
2015
-        psoff+=sizeof(propoff);
2016
-        /* endian conversion */
2017
-        propid = sum32_endian_convert(propid);
2018
-        propoff = sum32_endian_convert(propoff);
2019
-        cli_dbgmsg("ole2_summary_propset_json: propid: 0x%08x, propoff: %u\n", propid, propoff);
2020
-
2021
-        sctx->propname = NULL; sctx->writecp = 0;
2022
-        if (!sctx->mode)
2023
-            ole2_translate_summary_propid(sctx, propid);
2024
-        else
2025
-            ole2_translate_docsummary_propid(sctx, propid);
2026
-
2027
-        if (sctx->propname != NULL) {
2028
-            ret = ole2_process_property(sctx, ps, propoff);
2029
-            if (ret != CL_SUCCESS)
2030
-                return ret;
2031
-        }
2032
-        else {
2033
-            /* add unknown propid flag */
2034
-        }
2035
-    }
2036
-
2037
-    return CL_SUCCESS;
2038
-}
2039
-
2040
-static int cli_ole2_summary_json_cleanup(summary_ctx_t *sctx, int retcode)
2041
-{
2042
-    json_object *jarr;
2043
-
2044
-    cli_dbgmsg("in cli_ole2_summary_json_cleanup: %d[%x]\n", retcode, sctx->flags);
2045
-
2046
-    if (sctx->sfmap) {
2047
-        funmap(sctx->sfmap);
2048
-    }
2049
-
2050
-    if (sctx->flags) {
2051
-        jarr = cli_jsonarray(sctx->summary, "ParseErrors");
2052
-
2053
-        /* check errors */
2054
-        if (sctx->flags & OLE2_SUMMARY_ERROR_TOOSMALL) {
2055
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_TOOSMALL");
2056
-        }
2057
-        if (sctx->flags & OLE2_SUMMARY_ERROR_OOB) {
2058
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_OOB");
2059
-        }
2060
-        if (sctx->flags & OLE2_SUMMARY_ERROR_DATABUF) {
2061
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_DATABUF");
2062
-        }
2063
-        if (sctx->flags & OLE2_SUMMARY_ERROR_INVALID_ENTRY) {
2064
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_ERROR_INVALID_ENTRY");
2065
-        }
2066
-        if (sctx->flags & OLE2_SUMMARY_LIMIT_PROPS) {
2067
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_LIMIT_PROPS");
2068
-        }
2069
-        if (sctx->flags & OLE2_SUMMARY_FLAG_TIMEOUT) {
2070
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_TIMEOUT");
2071
-        }
2072
-        if (sctx->flags & OLE2_SUMMARY_FLAG_CODEPAGE) {
2073
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_CODEPAGE");
2074
-        }
2075
-        if (sctx->flags & OLE2_SUMMARY_FLAG_UNKNOWN_PROPID) {
2076
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_UNKNOWN_PROPID");
2077
-        }
2078
-        if (sctx->flags & OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE) {
2079
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_UNHANDLED_PROPTYPE");
2080
-        }
2081
-        if (sctx->flags & OLE2_SUMMARY_FLAG_TRUNC_STR) {
2082
-            cli_jsonstr(jarr, NULL, "OLE2_SUMMARY_FLAG_TRUNC_STR");
2083
-        }
2084
-    }
2085
-
2086
-    return retcode;
2087
-}
2088
-
2089
-
2090
-#endif /* HAVE_JSON */
2091
-
2092
-#if HAVE_JSON
2093
-int cli_ole2_summary_json(cli_ctx *ctx, int fd, int mode)
2094
-{
2095
-    summary_ctx_t sctx;
2096
-    STATBUF statbuf;
2097
-    off_t foff = 0;
2098
-    unsigned char *databuf;
2099
-    summary_stub_t sumstub;
2100
-    propset_entry_t pentry;
2101
-    int ret = CL_SUCCESS;
2102
-
2103
-    cli_dbgmsg("in cli_ole2_summary_json\n");
2104
-
2105
-    /* preliminary sanity checks */
2106
-    if (ctx == NULL) {
2107
-        return CL_ENULLARG;
2108
-    }
2109
-
2110
-    if (fd < 0) {
2111
-        cli_dbgmsg("ole2_summary_json: invalid file descriptor\n");
2112
-        return CL_ENULLARG; /* placeholder */
2113
-    }
2114
-
2115
-    if (mode != 0 && mode != 1) {
2116
-        cli_dbgmsg("ole2_summary_json: invalid mode specified\n");
2117
-        return CL_ENULLARG; /* placeholder */
2118
-    }
2119
-
2120
-    /* summary ctx setup */
2121
-    memset(&sctx, 0, sizeof(sctx));
2122
-    sctx.ctx = ctx;
2123
-    sctx.mode = mode;
2124
-
2125
-    if (FSTAT(fd, &statbuf) == -1) {
2126
-        cli_dbgmsg("ole2_summary_json: cannot stat file descriptor\n");
2127
-        return CL_ESTAT;
2128
-    }
2129
-
2130
-    sctx.sfmap = fmap(fd, 0, statbuf.st_size);
2131
-    if (!sctx.sfmap) {
2132
-        cli_dbgmsg("ole2_summary_json: failed to get fmap\n");
2133
-        return CL_EMAP;
2134
-    }
2135
-    sctx.maplen = sctx.sfmap->len;
2136
-    cli_dbgmsg("ole2_summary_json: streamsize: %u\n", sctx.maplen);
2137
-
2138
-    if (!mode)
2139
-        sctx.summary = cli_jsonobj(ctx->wrkproperty, "SummaryInfo");
2140
-    else
2141
-        sctx.summary = cli_jsonobj(ctx->wrkproperty, "DocSummaryInfo");
2142
-    if (!sctx.summary) {
2143
-        cli_errmsg("ole2_summary_json: no memory for json object.\n");
2144
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EMEM);
2145
-    }
2146
-
2147
-    sctx.codepage = 0;
2148
-    sctx.writecp = 0;
2149
-
2150
-    /* acquire property stream metadata */
2151
-    if (sctx.maplen < sizeof(summary_stub_t)) {
2152
-        sctx.flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
2153
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
2154
-    }
2155
-    databuf = (unsigned char*)fmap_need_off_once(sctx.sfmap, foff, sizeof(summary_stub_t));
2156
-    if (!databuf) {
2157
-        sctx.flags |= OLE2_SUMMARY_ERROR_DATABUF;
2158
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EREAD);
2159
-    }
2160
-    foff += sizeof(summary_stub_t);
2161
-    memcpy(&sumstub, databuf, sizeof(summary_stub_t));
2162
-
2163
-    /* endian conversion and checks */
2164
-    sumstub.byte_order = le16_to_host(sumstub.byte_order);
2165
-    if (sumstub.byte_order != 0xfffe) {
2166
-        cli_dbgmsg("ole2_summary_json: byteorder 0x%x is invalid\n", sumstub.byte_order);
2167
-        sctx.flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
2168
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);;
2169
-    }
2170
-    sumstub.version = sum16_endian_convert(sumstub.version); /*unused*/
2171
-    sumstub.system = sum32_endian_convert(sumstub.system); /*unused*/
2172
-    sumstub.num_propsets = sum32_endian_convert(sumstub.num_propsets);
2173
-    if (sumstub.num_propsets != 1 && sumstub.num_propsets != 2) {
2174
-        cli_dbgmsg("ole2_summary_json: invalid number of property sets\n");
2175
-        sctx.flags |= OLE2_SUMMARY_ERROR_INVALID_ENTRY;
2176
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
2177
-    }
2178
-
2179
-    cli_dbgmsg("ole2_summary_json: byteorder 0x%x\n", sumstub.byte_order);
2180
-    cli_dbgmsg("ole2_summary_json: %u property set(s) detected\n", sumstub.num_propsets);
2181
-
2182
-    /* first property set (index=0) is always SummaryInfo or DocSummaryInfo */
2183
-    if ((sctx.maplen-foff) < sizeof(propset_entry_t)) {
2184
-        sctx.flags |= OLE2_SUMMARY_ERROR_TOOSMALL;
2185
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EFORMAT);
2186
-    }
2187
-    databuf = (unsigned char*)fmap_need_off_once(sctx.sfmap, foff, sizeof(propset_entry_t));
2188
-    if (!databuf) {
2189
-        sctx.flags |= OLE2_SUMMARY_ERROR_DATABUF;
2190
-        return cli_ole2_summary_json_cleanup(&sctx, CL_EREAD);
2191
-    }
2192
-    foff += sizeof(propset_entry_t);
2193
-    memcpy(&pentry, databuf, sizeof(propset_entry_t));
2194
-    /* endian conversion */
2195
-    pentry.offset = sum32_endian_convert(pentry.offset);
2196
-
2197
-    if ((ret = ole2_summary_propset_json(&sctx, pentry.offset)) != CL_SUCCESS) {
2198
-        return cli_ole2_summary_json_cleanup(&sctx, ret);
2199
-    }
2200
-
2201
-    /* second property set (index=1) is always a custom property set (if present) */
2202
-    if (sumstub.num_propsets == 2) {
2203
-        cli_jsonbool(ctx->wrkproperty, "HasUserDefinedProperties", 1);
2204
-    }
2205
-
2206
-    return cli_ole2_summary_json_cleanup(&sctx, CL_SUCCESS);
2207
-}
2208
-#endif /* HAVE_JSON */
... ...
@@ -482,7 +482,7 @@ static int ooxml_content_cb(int fd, cli_ctx *ctx)
482 482
         if (!xmlStrcmp(CT, (const xmlChar *)"application/vnd.openxmlformats-package.core-properties+xml")) {
483 483
             if (!core) {
484 484
                 /* default: /docProps/core.xml*/
485
-                tmp = unzip_search(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
485
+                tmp = unzip_search_single(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
486 486
                 if (tmp == CL_ETIMEOUT) {
487 487
                     ret = tmp;
488 488
                 }
... ...
@@ -500,7 +500,7 @@ static int ooxml_content_cb(int fd, cli_ctx *ctx)
500 500
         else if (!xmlStrcmp(CT, (const xmlChar *)"application/vnd.openxmlformats-officedocument.extended-properties+xml")) {
501 501
             if (!extn) {
502 502
                 /* default: /docProps/app.xml */
503
-                tmp = unzip_search(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
503
+                tmp = unzip_search_single(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
504 504
                 if (tmp == CL_ETIMEOUT) {
505 505
                     ret = tmp;
506 506
                 }
... ...
@@ -518,7 +518,7 @@ static int ooxml_content_cb(int fd, cli_ctx *ctx)
518 518
         else if (!xmlStrcmp(CT, (const xmlChar *)"application/vnd.openxmlformats-officedocument.custom-properties+xml")) {
519 519
             if (!cust) {
520 520
                 /* default: /docProps/custom.xml */
521
-                tmp = unzip_search(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
521
+                tmp = unzip_search_single(ctx, (const char *)(PN+1), xmlStrlen(PN)-1, &loff);
522 522
                 if (tmp == CL_ETIMEOUT) {
523 523
                     ret = tmp;
524 524
                 }
... ...
@@ -537,10 +537,11 @@ static int ooxml_content_cb(int fd, cli_ctx *ctx)
537 537
             dsig++;
538 538
         }
539 539
 
540
-        if (ret != CL_SUCCESS)
540
+        if (ret != CL_BREAK && ret != CL_SUCCESS)
541 541
             goto ooxml_content_exit;
542 542
     }
543 543
 
544
+ ooxml_content_exit:
544 545
     if (core)
545 546
         cli_jsonint(ctx->wrkproperty, "CorePropertiesFileCount", core);
546 547
     else if (!mcore)
... ...
@@ -566,13 +567,45 @@ static int ooxml_content_cb(int fd, cli_ctx *ctx)
566 566
         cli_jsonint(ctx->wrkproperty, "DigitalSignaturesCount", dsig);
567 567
     }
568 568
 
569
- ooxml_content_exit:
570 569
     xmlTextReaderClose(reader);
571 570
     xmlFreeTextReader(reader);
572 571
     return ret;
573 572
 }
574 573
 #endif /* HAVE_LIBXML2 && HAVE_JSON */
575 574
 
575
+int cli_ooxml_filetype(cli_ctx *ctx, fmap_t *map)
576
+{
577
+    struct zip_requests requests;
578
+    int ret;
579
+
580
+    memset(&requests, 0, sizeof(struct zip_requests));
581
+
582
+    if ((ret = unzip_search_add(&requests, "xl/", 3)) != CL_SUCCESS) {
583
+        return CL_SUCCESS;
584
+    }
585
+    if ((ret = unzip_search_add(&requests, "ppt/", 4)) != CL_SUCCESS) {
586
+        return CL_SUCCESS;
587
+    }
588
+    if ((ret = unzip_search_add(&requests, "word/", 5)) != CL_SUCCESS) {
589
+        return CL_SUCCESS;
590
+    }
591
+
592
+    if ((ret = unzip_search(ctx, map, &requests)) == CL_VIRUS) {
593
+        switch (requests.found) {
594
+        case 0:
595
+            return CL_TYPE_OOXML_XL;
596
+        case 1:
597
+            return CL_TYPE_OOXML_PPT;
598
+        case 2:
599
+            return CL_TYPE_OOXML_WORD;
600
+        default:
601
+            return CL_SUCCESS;
602
+        }
603
+    }
604
+
605
+    return CL_SUCCESS;
606
+}
607
+
576 608
 int cli_process_ooxml(cli_ctx *ctx)
577 609
 {
578 610
 #if HAVE_LIBXML2 && HAVE_JSON
... ...
@@ -585,7 +618,7 @@ int cli_process_ooxml(cli_ctx *ctx)
585 585
     }
586 586
 
587 587
     /* find "[Content Types].xml" */
588
-    tmp = unzip_search(ctx, "[Content_Types].xml", 18, &loff);
588
+    tmp = unzip_search_single(ctx, "[Content_Types].xml", 18, &loff);
589 589
     if (tmp == CL_ETIMEOUT) {
590 590
         return CL_ETIMEOUT;
591 591
     }
... ...
@@ -26,6 +26,7 @@
26 26
 #endif
27 27
 
28 28
 #include "others.h"
29
+int cli_ooxml_filetype(cli_ctx *, fmap_t *);
29 30
 int cli_process_ooxml(cli_ctx *);
30 31
 
31 32
 #endif
... ...
@@ -127,7 +127,7 @@ char *pdf_convert_utf(char *begin, size_t sz)
127 127
 
128 128
     return res;
129 129
 #else
130
-    res = cli_calloc(begin, sz+1);
130
+    res = cli_calloc(sz+1, 1);
131 131
     if ((res)) {
132 132
         memcpy(res, begin, sz);
133 133
         res[sz] = '\0';
... ...
@@ -111,8 +111,8 @@ if((ndesc = open(tempfile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) { \
111 111
 
112 112
 #define CLI_TMPUNLK() if(!ctx->engine->keeptmp) { \
113 113
     if (cli_unlink(tempfile)) { \
114
-	free(tempfile); \
115
-	return CL_EUNLINK; \
114
+        free(tempfile); \
115
+        return CL_EUNLINK; \
116 116
     } \
117 117
 }
118 118
 
... ...
@@ -126,70 +126,70 @@ if((ndesc = open(tempfile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) { \
126 126
 
127 127
 #define FSGCASE(NAME,FREESEC) \
128 128
     case 0: /* Unpacked and NOT rebuilt */ \
129
-	cli_dbgmsg(NAME": Successfully decompressed\n"); \
130
-	close(ndesc); \
131
-	if (cli_unlink(tempfile)) { \
132
-	    free(exe_sections); \
133
-	    free(tempfile); \
134
-	    FREESEC; \
135
-	    return CL_EUNLINK; \
136
-	} \
137
-	free(tempfile); \
138
-	FREESEC; \
139
-	found = 0; \
140
-	upx_success = 1; \
141
-	break; /* FSG ONLY! - scan raw data after upx block */
129
+    cli_dbgmsg(NAME": Successfully decompressed\n"); \
130
+    close(ndesc); \
131
+    if (cli_unlink(tempfile)) { \
132
+        free(exe_sections); \
133
+        free(tempfile); \
134
+        FREESEC; \
135
+        return CL_EUNLINK; \
136
+    } \
137
+    free(tempfile); \
138
+    FREESEC; \
139
+    found = 0; \
140
+    upx_success = 1; \
141
+    break; /* FSG ONLY! - scan raw data after upx block */
142 142
 
143 143
 #define SPINCASE() \
144 144
     case 2: \
145
-	free(spinned); \
146
-	close(ndesc); \
147
-	if (cli_unlink(tempfile)) { \
148
-	    free(exe_sections); \
149
-	    free(tempfile); \
150
-	    return CL_EUNLINK; \
151
-	} \
152
-	cli_dbgmsg("PESpin: Size exceeded\n"); \
153
-	free(tempfile); \
154
-	break; \
145
+    free(spinned); \
146
+    close(ndesc); \
147
+    if (cli_unlink(tempfile)) { \
148
+        free(exe_sections); \
149
+        free(tempfile); \
150
+        return CL_EUNLINK; \
151
+    } \
152
+    cli_dbgmsg("PESpin: Size exceeded\n"); \
153
+    free(tempfile); \
154
+    break; \
155 155
 
156 156
 #define CLI_UNPRESULTS_(NAME,FSGSTUFF,EXPR,GOOD,FREEME) \
157 157
     switch(EXPR) { \
158 158
     case GOOD: /* Unpacked and rebuilt */ \
159
-	if(ctx->engine->keeptmp) \
160
-	    cli_dbgmsg(NAME": Unpacked and rebuilt executable saved in %s\n", tempfile); \
161
-	else \
162
-	    cli_dbgmsg(NAME": Unpacked and rebuilt executable\n"); \
163
-	cli_multifree FREEME; \
159
+        if(ctx->engine->keeptmp) \
160
+            cli_dbgmsg(NAME": Unpacked and rebuilt executable saved in %s\n", tempfile); \
161
+        else \
162
+            cli_dbgmsg(NAME": Unpacked and rebuilt executable\n"); \
163
+        cli_multifree FREEME; \
164 164
         free(exe_sections); \
165
-	lseek(ndesc, 0, SEEK_SET); \
166
-	cli_dbgmsg("***** Scanning rebuilt PE file *****\n"); \
167
-	SHA_OFF; \
168
-	if(cli_magic_scandesc(ndesc, ctx) == CL_VIRUS) { \
169
-	    close(ndesc); \
170
-	    CLI_TMPUNLK(); \
171
-	    free(tempfile); \
172
-	    SHA_RESET; \
173
-	    return CL_VIRUS; \
174
-	} \
175
-	SHA_RESET; \
176
-	close(ndesc); \
177
-	CLI_TMPUNLK(); \
178
-	free(tempfile); \
179
-	return CL_CLEAN; \
165
+        lseek(ndesc, 0, SEEK_SET); \
166
+        cli_dbgmsg("***** Scanning rebuilt PE file *****\n"); \
167
+        SHA_OFF; \
168
+        if(cli_magic_scandesc(ndesc, ctx) == CL_VIRUS) { \
169
+            close(ndesc); \
170
+            CLI_TMPUNLK(); \
171
+            free(tempfile); \
172
+            SHA_RESET; \
173
+            return CL_VIRUS; \
174
+        } \
175
+        SHA_RESET; \
176
+        close(ndesc); \
177
+        CLI_TMPUNLK(); \
178
+        free(tempfile); \
179
+        return CL_CLEAN; \
180 180
 \
181 181
 FSGSTUFF; \
182 182
 \
183 183
     default: \
184
-	cli_dbgmsg(NAME": Unpacking failed\n"); \
185
-	close(ndesc); \
186
-	if (cli_unlink(tempfile)) { \
187
-	    free(exe_sections); \
188
-	    free(tempfile); \
189
-	    cli_multifree FREEME; \
190
-	    return CL_EUNLINK; \
191
-	} \
192
-	cli_multifree FREEME; \
184
+        cli_dbgmsg(NAME": Unpacking failed\n"); \
185
+        close(ndesc); \
186
+        if (cli_unlink(tempfile)) { \
187
+            free(exe_sections); \
188
+            free(tempfile); \
189
+            cli_multifree FREEME; \
190
+            return CL_EUNLINK; \
191
+        } \
192
+        cli_multifree FREEME; \
193 193
         free(tempfile); \
194 194
     }
195 195
 
... ...
@@ -227,7 +227,7 @@ static int versioninfo_cb(void *opaque, uint32_t type, uint32_t name, uint32_t l
227 227
     cli_dbgmsg("versioninfo_cb: type: %x, name: %x, lang: %x, rva: %x\n", type, name, lang, rva);
228 228
     vlist->rvas[vlist->count] = rva;
229 229
     if(++vlist->count == sizeof(vlist->rvas) / sizeof(vlist->rvas[0]))
230
-	return 1;
230
+        return 1;
231 231
     return 0;
232 232
 }
233 233
 
... ...
@@ -238,24 +238,25 @@ uint32_t cli_rawaddr(uint32_t rva, const struct cli_exe_section *shp, uint16_t n
238 238
     uint32_t ret;
239 239
 
240 240
     if (rva<hdr_size) { /* Out of section EP - mapped to imagebase+rva */
241
-	if (rva >= fsize) {
242
-	    *err=1;
243
-	    return 0;
244
-	}
241
+        if (rva >= fsize) {
242
+            *err=1;
243
+            return 0;
244
+        }
245
+
245 246
         *err=0;
246
-	return rva;
247
+        return rva;
247 248
     }
248 249
 
249 250
     for(i = nos-1; i >= 0; i--) {
250 251
         if(shp[i].rsz && shp[i].rva <= rva && shp[i].rsz > rva - shp[i].rva) {
251
-	    found = 1;
252
-	    break;
253
-	}
252
+            found = 1;
253
+            break;
254
+        }
254 255
     }
255 256
 
256 257
     if(!found) {
257
-	*err = 1;
258
-	return 0;
258
+        *err = 1;
259
+        return 0;
259 260
     }
260 261
 
261 262
     ret = rva - shp[i].rva + shp[i].raw;
... ...
@@ -263,61 +264,6 @@ uint32_t cli_rawaddr(uint32_t rva, const struct cli_exe_section *shp, uint16_t n
263 263
     return ret;
264 264
 }
265 265
 
266
-
267
-/*
268
-static int cli_ddump(int desc, int offset, int size, const char *file) {
269
-	int pos, ndesc, bread, sum = 0;
270
-	char buff[FILEBUFF];
271
-
272
-
273
-    cli_dbgmsg("in ddump()\n");
274
-
275
-    if((pos = lseek(desc, 0, SEEK_CUR)) == -1) {
276
-	cli_dbgmsg("Invalid descriptor\n");
277
-	return -1;
278
-    }
279
-
280
-    if(lseek(desc, offset, SEEK_SET) == -1) {
281
-	cli_dbgmsg("lseek() failed\n");
282
-	lseek(desc, pos, SEEK_SET);
283
-	return -1;
284
-    }
285
-
286
-    if((ndesc = open(file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) {
287
-	cli_dbgmsg("Can't create file %s\n", file);
288
-	lseek(desc, pos, SEEK_SET);
289
-	return -1;
290
-    }
291
-
292
-    while((bread = cli_readn(desc, buff, FILEBUFF)) > 0) {
293
-	if(sum + bread >= size) {
294
-	    if(write(ndesc, buff, size - sum) == -1) {
295
-		cli_dbgmsg("Can't write to file\n");
296
-		lseek(desc, pos, SEEK_SET);
297
-		close(ndesc);
298
-		cli_unlink(file);
299
-		return -1;
300
-	    }
301
-	    break;
302
-	} else {
303
-	    if(write(ndesc, buff, bread) == -1) {
304
-		cli_dbgmsg("Can't write to file\n");
305
-		lseek(desc, pos, SEEK_SET);
306
-		close(ndesc);
307
-		cli_unlink(file);
308
-		return -1;
309
-	    }
310
-	}
311
-	sum += bread;
312
-    }
313
-
314
-    close(ndesc);
315
-    lseek(desc, pos, SEEK_SET);
316
-    return 0;
317
-}
318
-*/
319
-
320
-
321 266
 /* 
322 267
    void findres(uint32_t by_type, uint32_t by_name, uint32_t res_rva, cli_ctx *ctx, struct cli_exe_section *exe_sections, uint16_t nsections, uint32_t hdr_size, int (*cb)(void *, uint32_t, uint32_t, uint32_t, uint32_t), void *opaque)
323 268
    callback based res lookup
... ...
@@ -722,49 +668,49 @@ static void add_section_info(cli_ctx *ctx, struct cli_exe_section *s)
722 722
 
723 723
 int cli_scanpe(cli_ctx *ctx)
724 724
 {
725
-	uint16_t e_magic; /* DOS signature ("MZ") */
726
-	uint16_t nsections;
727
-	uint32_t e_lfanew; /* address of new exe header */
728
-	uint32_t ep, vep; /* entry point (raw, virtual) */
729
-	uint8_t polipos = 0;
730
-	time_t timestamp;
731
-	struct pe_image_file_hdr file_hdr;
732
-	union {
733
-	    struct pe_image_optional_hdr64 opt64;
734
-	    struct pe_image_optional_hdr32 opt32;
735
-	} pe_opt;
736
-	struct pe_image_section_hdr *section_hdr;
737
-	char sname[9], epbuff[4096], *tempfile;
738
-	uint32_t epsize;
739
-	ssize_t bytes, at;
740
-	unsigned int i, found, upx_success = 0, min = 0, max = 0, err, overlays = 0;
741
-	unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0, corrupted_cur;
742
-	int (*upxfn)(const char *, uint32_t, char *, uint32_t *, uint32_t, uint32_t, uint32_t) = NULL;
743
-	const char *src = NULL;
744
-	char *dest = NULL;
745
-	int ndesc, ret = CL_CLEAN, upack = 0, native=0;
746
-	size_t fsize;
747
-	uint32_t valign, falign, hdr_size, j;
748
-	struct cli_exe_section *exe_sections;
749
-	char timestr[32];
750
-	struct pe_image_data_dir *dirs;
751
-	struct cli_bc_ctx *bc_ctx;
752
-	fmap_t *map;
753
-	struct cli_pe_hook_data pedata;
725
+    uint16_t e_magic; /* DOS signature ("MZ") */
726
+    uint16_t nsections;
727
+    uint32_t e_lfanew; /* address of new exe header */
728
+    uint32_t ep, vep; /* entry point (raw, virtual) */
729
+    uint8_t polipos = 0;
730
+    time_t timestamp;
731
+    struct pe_image_file_hdr file_hdr;
732
+    union {
733
+        struct pe_image_optional_hdr64 opt64;
734
+        struct pe_image_optional_hdr32 opt32;
735
+    } pe_opt;
736
+    struct pe_image_section_hdr *section_hdr;
737
+    char sname[9], epbuff[4096], *tempfile;
738
+    uint32_t epsize;
739
+    ssize_t bytes, at;
740
+    unsigned int i, j, found, upx_success = 0, min = 0, max = 0, err, overlays = 0, rescan = 1;
741
+    unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0, corrupted_cur;
742
+    int (*upxfn)(const char *, uint32_t, char *, uint32_t *, uint32_t, uint32_t, uint32_t) = NULL;
743
+    const char *src = NULL;
744
+    char *dest = NULL;
745
+    int ndesc, ret = CL_CLEAN, upack = 0, native=0;
746
+    size_t fsize;
747
+    uint32_t valign, falign, hdr_size;
748
+    struct cli_exe_section *exe_sections;
749
+    char timestr[32];
750
+    struct pe_image_data_dir *dirs;
751
+    struct cli_bc_ctx *bc_ctx;
752
+    fmap_t *map;
753
+    struct cli_pe_hook_data pedata;
754 754
 #ifdef HAVE__INTERNAL__SHA_COLLECT
755
-	int sha_collect = ctx->sha_collect;
755
+    int sha_collect = ctx->sha_collect;
756 756
 #endif
757 757
     const char *archtype=NULL, *subsystem=NULL;
758
-	uint32_t viruses_found = 0;
758
+    uint32_t viruses_found = 0;
759 759
 #if HAVE_JSON
760
-        int toval = 0;
761
-        struct json_object *pe_json=NULL;
762
-        char jsonbuf[128];
760
+    int toval = 0;
761
+    struct json_object *pe_json=NULL;
762
+    char jsonbuf[128];
763 763
 #endif
764 764
 
765 765
     if(!ctx) {
766
-	cli_errmsg("cli_scanpe: ctx == NULL\n");
767
-	return CL_ENULLARG;
766
+        cli_errmsg("cli_scanpe: ctx == NULL\n");
767
+        return CL_ENULLARG;
768 768
     }
769 769
 
770 770
 #if HAVE_JSON
... ...
@@ -778,41 +724,42 @@ int cli_scanpe(cli_ctx *ctx)
778 778
 #endif
779 779
     map = *ctx->fmap;
780 780
     if(fmap_readn(map, &e_magic, 0, sizeof(e_magic)) != sizeof(e_magic)) {
781
-	cli_dbgmsg("Can't read DOS signature\n");
782
-	return CL_CLEAN;
781
+        cli_dbgmsg("Can't read DOS signature\n");
782
+        return CL_CLEAN;
783 783
     }
784 784
 
785 785
     if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) {
786
-	cli_dbgmsg("Invalid DOS signature\n");
787
-	return CL_CLEAN;
786
+        cli_dbgmsg("Invalid DOS signature\n");
787
+        return CL_CLEAN;
788 788
     }
789 789
 
790 790
     if(fmap_readn(map, &e_lfanew, 58 + sizeof(e_magic), sizeof(e_lfanew)) != sizeof(e_lfanew)) {
791
-	cli_dbgmsg("Can't read new header address\n");
792
-	/* truncated header? */
793
-	if(DETECT_BROKEN_PE) {
794
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
795
-	    return CL_VIRUS;
796
-	}
797
-	return CL_CLEAN;
791
+        cli_dbgmsg("Can't read new header address\n");
792
+        /* truncated header? */
793
+        if(DETECT_BROKEN_PE) {
794
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
795
+            return CL_VIRUS;
796
+        }
797
+
798
+        return CL_CLEAN;
798 799
     }
799 800
 
800 801
     e_lfanew = EC32(e_lfanew);
801 802
     cli_dbgmsg("e_lfanew == %d\n", e_lfanew);
802 803
     if(!e_lfanew) {
803
-	cli_dbgmsg("Not a PE file\n");
804
-	return CL_CLEAN;
804
+        cli_dbgmsg("Not a PE file\n");
805
+        return CL_CLEAN;
805 806
     }
806 807
 
807 808
     if(fmap_readn(map, &file_hdr, e_lfanew, sizeof(struct pe_image_file_hdr)) != sizeof(struct pe_image_file_hdr)) {
808
-	/* bad information in e_lfanew - probably not a PE file */
809
-	cli_dbgmsg("Can't read file header\n");
810
-	return CL_CLEAN;
809
+        /* bad information in e_lfanew - probably not a PE file */
810
+        cli_dbgmsg("Can't read file header\n");
811
+        return CL_CLEAN;
811 812
     }
812 813
 
813 814
     if(EC32(file_hdr.Magic) != PE_IMAGE_NT_SIGNATURE) {
814
-	cli_dbgmsg("Invalid PE signature (probably NE file)\n");
815
-	return CL_CLEAN;
815
+        cli_dbgmsg("Invalid PE signature (probably NE file)\n");
816
+        return CL_CLEAN;
816 817
     }
817 818
 
818 819
     if(EC16(file_hdr.Characteristics) & 0x2000) {
... ...
@@ -820,108 +767,108 @@ int cli_scanpe(cli_ctx *ctx)
820 820
         if ((pe_json))
821 821
             cli_jsonstr(pe_json, "Type", "DLL");
822 822
 #endif
823
-	cli_dbgmsg("File type: DLL\n");
824
-	dll = 1;
823
+        cli_dbgmsg("File type: DLL\n");
824
+        dll = 1;
825 825
     } else if(EC16(file_hdr.Characteristics) & 0x01) {
826 826
 #if HAVE_JSON
827 827
         if ((pe_json))
828 828
             cli_jsonstr(pe_json, "Type", "EXE");
829 829
 #endif
830
-	cli_dbgmsg("File type: Executable\n");
830
+        cli_dbgmsg("File type: Executable\n");
831 831
     }
832 832
 
833 833
     switch(EC16(file_hdr.Machine)) {
834
-	case 0x0:
834
+    case 0x0:
835 835
         archtype = "Unknown";
836
-	    break;
837
-	case 0x14c:
836
+        break;
837
+    case 0x14c:
838 838
         archtype = "80386";
839
-	    break;
840
-	case 0x14d:
839
+        break;
840
+    case 0x14d:
841 841
         archtype = "80486";
842
-	    break;
843
-	case 0x14e:
842
+        break;
843
+    case 0x14e:
844 844
         archtype = "80586";
845
-	    break;
846
-	case 0x160:
845
+        break;
846
+    case 0x160:
847 847
         archtype = "R30000 (big-endian)";
848
-	    break;
849
-	case 0x162:
848
+        break;
849
+    case 0x162:
850 850
         archtype = "R3000";
851
-	    break;
852
-	case 0x166:
851
+        break;
852
+    case 0x166:
853 853
         archtype = "R4000";
854
-	    break;
855
-	case 0x168:
854
+        break;
855
+    case 0x168:
856 856
         archtype = "R10000";
857
-	    break;
858
-	case 0x184:
857
+        break;
858
+    case 0x184:
859 859
         archtype = "DEC Alpha AXP";
860
-	    break;
861
-	case 0x284:
860
+        break;
861
+    case 0x284:
862 862
         archtype = "DEC Alpha AXP 64bit";
863
-	    break;
864
-	case 0x1f0:
863
+        break;
864
+    case 0x1f0:
865 865
         archtype = "PowerPC";
866
-	    break;
867
-	case 0x200:
866
+        break;
867
+    case 0x200:
868 868
         archtype = "IA64";
869
-	    break;
870
-	case 0x268:
869
+        break;
870
+    case 0x268:
871 871
         archtype = "M68k";
872
-	    break;
873
-	case 0x266:
872
+        break;
873
+    case 0x266:
874 874
         archtype = "MIPS16";
875
-	    break;
876
-	case 0x366:
875
+        break;
876
+    case 0x366:
877 877
         archtype = "MIPS+FPU";
878
-	    break;
879
-	case 0x466:
878
+        break;
879
+    case 0x466:
880 880
         archtype = "MIPS16+FPU";
881
-	    break;
882
-	case 0x1a2:
881
+        break;
882
+    case 0x1a2:
883 883
         archtype = "Hitachi SH3";
884
-	    break;
885
-	case 0x1a3:
884
+        break;
885
+    case 0x1a3:
886 886
         archtype = "Hitachi SH3-DSP";
887
-	    break;
888
-	case 0x1a4:
887
+        break;
888
+    case 0x1a4:
889 889
         archtype = "Hitachi SH3-E";
890
-	    break;
891
-	case 0x1a6:
890
+        break;
891
+    case 0x1a6:
892 892
         archtype = "Hitachi SH4";
893
-	    break;
894
-	case 0x1a8:
893
+        break;
894
+    case 0x1a8:
895 895
         archtype = "Hitachi SH5";
896
-	    break;
897
-	case 0x1c0:
896
+        break;
897
+    case 0x1c0:
898 898
         archtype = "ARM";
899
-	    break;
900
-	case 0x1c2:
899
+        break;
900
+    case 0x1c2:
901 901
         archtype = "THUMB";
902
-	    break;
903
-	case 0x1d3:
902
+        break;
903
+    case 0x1d3:
904 904
         archtype = "AM33";
905
-	    break;
906
-	case 0x520:
905
+        break;
906
+    case 0x520:
907 907
         archtype = "Infineon TriCore";
908
-	    break;
909
-	case 0xcef:
908
+        break;
909
+    case 0xcef:
910 910
         archtype = "CEF";
911
-	    break;
912
-	case 0xebc:
911
+        break;
912
+    case 0xebc:
913 913
         archtype = "EFI Byte Code";
914
-	    break;
915
-	case 0x9041:
914
+        break;
915
+    case 0x9041:
916 916
         archtype = "M32R";
917
-	    break;
918
-	case 0xc0ee:
917
+        break;
918
+    case 0xc0ee:
919 919
         archtype = "CEEE";
920
-	    break;
921
-	case 0x8664:
920
+        break;
921
+    case 0x8664:
922 922
         archtype = "AMD64";
923
-	    break;
924
-	default:
923
+        break;
924
+    default:
925 925
         archtype = "Unknown";
926 926
     }
927 927
 
... ...
@@ -937,18 +884,21 @@ int cli_scanpe(cli_ctx *ctx)
937 937
 #if HAVE_JSON
938 938
         pe_add_heuristic_property(ctx, "BadNumberOfSections");
939 939
 #endif
940
-	if(DETECT_BROKEN_PE) {
941
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
942
-	    return CL_VIRUS;
943
-	}
944
-	if(!ctx->corrupted_input) {
945
-	    if(nsections)
946
-		cli_warnmsg("PE file contains %d sections\n", nsections);
947
-	    else
948
-		cli_warnmsg("PE file contains no sections\n");
949
-	}
950
-	return CL_CLEAN;
940
+        if(DETECT_BROKEN_PE) {
941
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
942
+            return CL_VIRUS;
943
+        }
944
+
945
+        if(!ctx->corrupted_input) {
946
+            if(nsections)
947
+            cli_warnmsg("PE file contains %d sections\n", nsections);
948
+            else
949
+            cli_warnmsg("PE file contains no sections\n");
950
+        }
951
+
952
+        return CL_CLEAN;
951 953
     }
954
+
952 955
     cli_dbgmsg("NumberOfSections: %d\n", nsections);
953 956
 
954 957
     timestamp = (time_t) EC32(file_hdr.TimeDateStamp);
... ...
@@ -969,21 +919,23 @@ int cli_scanpe(cli_ctx *ctx)
969 969
         pe_add_heuristic_property(ctx, "BadOptionalHeaderSize");
970 970
 #endif
971 971
         cli_dbgmsg("SizeOfOptionalHeader too small\n");
972
-	if(DETECT_BROKEN_PE) {
973
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
974
-	    return CL_VIRUS;
975
-	}
976
-	return CL_CLEAN;
972
+        if(DETECT_BROKEN_PE) {
973
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
974
+            return CL_VIRUS;
975
+        }
976
+
977
+        return CL_CLEAN;
977 978
     }
978 979
 
979 980
     at = e_lfanew + sizeof(struct pe_image_file_hdr);
980 981
     if(fmap_readn(map, &optional_hdr32, at, sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr32)) {
981 982
         cli_dbgmsg("Can't read optional file header\n");
982
-	if(DETECT_BROKEN_PE) {
983
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
984
-	    return CL_VIRUS;
985
-	}
986
-	return CL_CLEAN;
983
+        if(DETECT_BROKEN_PE) {
984
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
985
+            return CL_VIRUS;
986
+        }
987
+
988
+        return CL_CLEAN;
987 989
     }
988 990
     at += sizeof(struct pe_image_optional_hdr32);
989 991
 
... ...
@@ -993,125 +945,129 @@ int cli_scanpe(cli_ctx *ctx)
993 993
         pe_add_heuristic_property(ctx, "BadOptionalHeaderSizePE32Plus");
994 994
 #endif
995 995
         if(EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr64)) {
996
-	    /* FIXME: need to play around a bit more with xp64 */
997
-	    cli_dbgmsg("Incorrect SizeOfOptionalHeader for PE32+\n");
998
-	    if(DETECT_BROKEN_PE) {
999
-		cli_append_virus(ctx,"Heuristics.Broken.Executable");
1000
-		return CL_VIRUS;
1001
-	    }
1002
-	    return CL_CLEAN;
1003
-	}
1004
-	pe_plus = 1;
996
+            /* FIXME: need to play around a bit more with xp64 */
997
+            cli_dbgmsg("Incorrect SizeOfOptionalHeader for PE32+\n");
998
+
999
+            if(DETECT_BROKEN_PE) {
1000
+                cli_append_virus(ctx,"Heuristics.Broken.Executable");
1001
+                return CL_VIRUS;
1002
+            }
1003
+
1004
+            return CL_CLEAN;
1005
+        }
1006
+        pe_plus = 1;
1005 1007
     }
1006 1008
 
1007 1009
     if(!pe_plus) { /* PE */
1008
-	if (EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr32)) {
1009
-	    /* Seek to the end of the long header */
1010
-	    at += EC16(file_hdr.SizeOfOptionalHeader)-sizeof(struct pe_image_optional_hdr32);
1011
-	}
1010
+        if (EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr32)) {
1011
+            /* Seek to the end of the long header */
1012
+            at += EC16(file_hdr.SizeOfOptionalHeader)-sizeof(struct pe_image_optional_hdr32);
1013
+        }
1012 1014
 
1013
-	if(DCONF & PE_CONF_UPACK)
1014
-	    upack = (EC16(file_hdr.SizeOfOptionalHeader)==0x148);
1015
-
1016
-	vep = EC32(optional_hdr32.AddressOfEntryPoint);
1017
-	hdr_size = EC32(optional_hdr32.SizeOfHeaders);
1018
-	cli_dbgmsg("File format: PE\n");
1019
-
1020
-	cli_dbgmsg("MajorLinkerVersion: %d\n", optional_hdr32.MajorLinkerVersion);
1021
-	cli_dbgmsg("MinorLinkerVersion: %d\n", optional_hdr32.MinorLinkerVersion);
1022
-	cli_dbgmsg("SizeOfCode: 0x%x\n", EC32(optional_hdr32.SizeOfCode));
1023
-	cli_dbgmsg("SizeOfInitializedData: 0x%x\n", EC32(optional_hdr32.SizeOfInitializedData));
1024
-	cli_dbgmsg("SizeOfUninitializedData: 0x%x\n", EC32(optional_hdr32.SizeOfUninitializedData));
1025
-	cli_dbgmsg("AddressOfEntryPoint: 0x%x\n", vep);
1026
-	cli_dbgmsg("BaseOfCode: 0x%x\n", EC32(optional_hdr32.BaseOfCode));
1027
-	cli_dbgmsg("SectionAlignment: 0x%x\n", EC32(optional_hdr32.SectionAlignment));
1028
-	cli_dbgmsg("FileAlignment: 0x%x\n", EC32(optional_hdr32.FileAlignment));
1029
-	cli_dbgmsg("MajorSubsystemVersion: %d\n", EC16(optional_hdr32.MajorSubsystemVersion));
1030
-	cli_dbgmsg("MinorSubsystemVersion: %d\n", EC16(optional_hdr32.MinorSubsystemVersion));
1031
-	cli_dbgmsg("SizeOfImage: 0x%x\n", EC32(optional_hdr32.SizeOfImage));
1032
-	cli_dbgmsg("SizeOfHeaders: 0x%x\n", hdr_size);
1033
-	cli_dbgmsg("NumberOfRvaAndSizes: %d\n", EC32(optional_hdr32.NumberOfRvaAndSizes));
1034
-	dirs = optional_hdr32.DataDirectory;
1015
+        if(DCONF & PE_CONF_UPACK)
1016
+            upack = (EC16(file_hdr.SizeOfOptionalHeader)==0x148);
1017
+
1018
+        vep = EC32(optional_hdr32.AddressOfEntryPoint);
1019
+        hdr_size = EC32(optional_hdr32.SizeOfHeaders);
1020
+        cli_dbgmsg("File format: PE\n");
1021
+
1022
+        cli_dbgmsg("MajorLinkerVersion: %d\n", optional_hdr32.MajorLinkerVersion);
1023
+        cli_dbgmsg("MinorLinkerVersion: %d\n", optional_hdr32.MinorLinkerVersion);
1024
+        cli_dbgmsg("SizeOfCode: 0x%x\n", EC32(optional_hdr32.SizeOfCode));
1025
+        cli_dbgmsg("SizeOfInitializedData: 0x%x\n", EC32(optional_hdr32.SizeOfInitializedData));
1026
+        cli_dbgmsg("SizeOfUninitializedData: 0x%x\n", EC32(optional_hdr32.SizeOfUninitializedData));
1027
+        cli_dbgmsg("AddressOfEntryPoint: 0x%x\n", vep);
1028
+        cli_dbgmsg("BaseOfCode: 0x%x\n", EC32(optional_hdr32.BaseOfCode));
1029
+        cli_dbgmsg("SectionAlignment: 0x%x\n", EC32(optional_hdr32.SectionAlignment));
1030
+        cli_dbgmsg("FileAlignment: 0x%x\n", EC32(optional_hdr32.FileAlignment));
1031
+        cli_dbgmsg("MajorSubsystemVersion: %d\n", EC16(optional_hdr32.MajorSubsystemVersion));
1032
+        cli_dbgmsg("MinorSubsystemVersion: %d\n", EC16(optional_hdr32.MinorSubsystemVersion));
1033
+        cli_dbgmsg("SizeOfImage: 0x%x\n", EC32(optional_hdr32.SizeOfImage));
1034
+        cli_dbgmsg("SizeOfHeaders: 0x%x\n", hdr_size);
1035
+        cli_dbgmsg("NumberOfRvaAndSizes: %d\n", EC32(optional_hdr32.NumberOfRvaAndSizes));
1036
+        dirs = optional_hdr32.DataDirectory;
1035 1037
 #if HAVE_JSON
1036
-    cli_jsonint(pe_json, "MajorLinkerVersion", optional_hdr32.MajorLinkerVersion);
1037
-    cli_jsonint(pe_json, "MinorLinkerVersion", optional_hdr32.MinorLinkerVersion);
1038
-    cli_jsonint(pe_json, "SizeOfCode", EC32(optional_hdr32.SizeOfCode));
1039
-    cli_jsonint(pe_json, "SizeOfInitializedData", EC32(optional_hdr32.SizeOfInitializedData));
1040
-    cli_jsonint(pe_json, "SizeOfUninitializedData", EC32(optional_hdr32.SizeOfUninitializedData));
1041
-    cli_jsonint(pe_json, "NumberOfRvaAndSizes", EC32(optional_hdr32.NumberOfRvaAndSizes));
1042
-    cli_jsonint(pe_json, "MajorSubsystemVersion", EC16(optional_hdr32.MajorSubsystemVersion));
1043
-    cli_jsonint(pe_json, "MinorSubsystemVersion", EC16(optional_hdr32.MinorSubsystemVersion));
1038
+        cli_jsonint(pe_json, "MajorLinkerVersion", optional_hdr32.MajorLinkerVersion);
1039
+        cli_jsonint(pe_json, "MinorLinkerVersion", optional_hdr32.MinorLinkerVersion);
1040
+        cli_jsonint(pe_json, "SizeOfCode", EC32(optional_hdr32.SizeOfCode));
1041
+        cli_jsonint(pe_json, "SizeOfInitializedData", EC32(optional_hdr32.SizeOfInitializedData));
1042
+        cli_jsonint(pe_json, "SizeOfUninitializedData", EC32(optional_hdr32.SizeOfUninitializedData));
1043
+        cli_jsonint(pe_json, "NumberOfRvaAndSizes", EC32(optional_hdr32.NumberOfRvaAndSizes));
1044
+        cli_jsonint(pe_json, "MajorSubsystemVersion", EC16(optional_hdr32.MajorSubsystemVersion));
1045
+        cli_jsonint(pe_json, "MinorSubsystemVersion", EC16(optional_hdr32.MinorSubsystemVersion));
1044 1046
 
1045
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.BaseOfCode));
1046
-    cli_jsonstr(pe_json, "BaseOfCode", jsonbuf);
1047
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.BaseOfCode));
1048
+        cli_jsonstr(pe_json, "BaseOfCode", jsonbuf);
1047 1049
 
1048
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.SectionAlignment));
1049
-    cli_jsonstr(pe_json, "SectionAlignment", jsonbuf);
1050
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.SectionAlignment));
1051
+        cli_jsonstr(pe_json, "SectionAlignment", jsonbuf);
1050 1052
 
1051
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.FileAlignment));
1052
-    cli_jsonstr(pe_json, "FileAlignment", jsonbuf);
1053
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.FileAlignment));
1054
+        cli_jsonstr(pe_json, "FileAlignment", jsonbuf);
1053 1055
 
1054
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.SizeOfImage));
1055
-    cli_jsonstr(pe_json, "SizeOfImage", jsonbuf);
1056
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr32.SizeOfImage));
1057
+        cli_jsonstr(pe_json, "SizeOfImage", jsonbuf);
1056 1058
 
1057
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", hdr_size);
1058
-    cli_jsonstr(pe_json, "SizeOfHeaders", jsonbuf);
1059
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", hdr_size);
1060
+        cli_jsonstr(pe_json, "SizeOfHeaders", jsonbuf);
1059 1061
 #endif
1060 1062
 
1061 1063
     } else { /* PE+ */
1062
-        /* read the remaining part of the header */
1063
-        if(fmap_readn(map, &optional_hdr32 + 1, at, sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) {
1064
-	    cli_dbgmsg("Can't read optional file header\n");
1065
-	    if(DETECT_BROKEN_PE) {
1066
-		cli_append_virus(ctx,"Heuristics.Broken.Executable");
1067
-		return CL_VIRUS;
1068
-	    }
1069
-	    return CL_CLEAN;
1070
-	}
1071
-	at += sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32);
1072
-	vep = EC32(optional_hdr64.AddressOfEntryPoint);
1073
-	hdr_size = EC32(optional_hdr64.SizeOfHeaders);
1074
-	cli_dbgmsg("File format: PE32+\n");
1075
-
1076
-	cli_dbgmsg("MajorLinkerVersion: %d\n", optional_hdr64.MajorLinkerVersion);
1077
-	cli_dbgmsg("MinorLinkerVersion: %d\n", optional_hdr64.MinorLinkerVersion);
1078
-	cli_dbgmsg("SizeOfCode: 0x%x\n", EC32(optional_hdr64.SizeOfCode));
1079
-	cli_dbgmsg("SizeOfInitializedData: 0x%x\n", EC32(optional_hdr64.SizeOfInitializedData));
1080
-	cli_dbgmsg("SizeOfUninitializedData: 0x%x\n", EC32(optional_hdr64.SizeOfUninitializedData));
1081
-	cli_dbgmsg("AddressOfEntryPoint: 0x%x\n", vep);
1082
-	cli_dbgmsg("BaseOfCode: 0x%x\n", EC32(optional_hdr64.BaseOfCode));
1083
-	cli_dbgmsg("SectionAlignment: 0x%x\n", EC32(optional_hdr64.SectionAlignment));
1084
-	cli_dbgmsg("FileAlignment: 0x%x\n", EC32(optional_hdr64.FileAlignment));
1085
-	cli_dbgmsg("MajorSubsystemVersion: %d\n", EC16(optional_hdr64.MajorSubsystemVersion));
1086
-	cli_dbgmsg("MinorSubsystemVersion: %d\n", EC16(optional_hdr64.MinorSubsystemVersion));
1087
-	cli_dbgmsg("SizeOfImage: 0x%x\n", EC32(optional_hdr64.SizeOfImage));
1088
-	cli_dbgmsg("SizeOfHeaders: 0x%x\n", hdr_size);
1089
-	cli_dbgmsg("NumberOfRvaAndSizes: %d\n", EC32(optional_hdr64.NumberOfRvaAndSizes));
1090
-	dirs = optional_hdr64.DataDirectory;
1064
+            /* read the remaining part of the header */
1065
+            if(fmap_readn(map, &optional_hdr32 + 1, at, sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) {
1066
+            cli_dbgmsg("Can't read optional file header\n");
1067
+            if(DETECT_BROKEN_PE) {
1068
+                cli_append_virus(ctx,"Heuristics.Broken.Executable");
1069
+                return CL_VIRUS;
1070
+            }
1071
+
1072
+            return CL_CLEAN;
1073
+        }
1074
+
1075
+        at += sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32);
1076
+        vep = EC32(optional_hdr64.AddressOfEntryPoint);
1077
+        hdr_size = EC32(optional_hdr64.SizeOfHeaders);
1078
+        cli_dbgmsg("File format: PE32+\n");
1079
+
1080
+        cli_dbgmsg("MajorLinkerVersion: %d\n", optional_hdr64.MajorLinkerVersion);
1081
+        cli_dbgmsg("MinorLinkerVersion: %d\n", optional_hdr64.MinorLinkerVersion);
1082
+        cli_dbgmsg("SizeOfCode: 0x%x\n", EC32(optional_hdr64.SizeOfCode));
1083
+        cli_dbgmsg("SizeOfInitializedData: 0x%x\n", EC32(optional_hdr64.SizeOfInitializedData));
1084
+        cli_dbgmsg("SizeOfUninitializedData: 0x%x\n", EC32(optional_hdr64.SizeOfUninitializedData));
1085
+        cli_dbgmsg("AddressOfEntryPoint: 0x%x\n", vep);
1086
+        cli_dbgmsg("BaseOfCode: 0x%x\n", EC32(optional_hdr64.BaseOfCode));
1087
+        cli_dbgmsg("SectionAlignment: 0x%x\n", EC32(optional_hdr64.SectionAlignment));
1088
+        cli_dbgmsg("FileAlignment: 0x%x\n", EC32(optional_hdr64.FileAlignment));
1089
+        cli_dbgmsg("MajorSubsystemVersion: %d\n", EC16(optional_hdr64.MajorSubsystemVersion));
1090
+        cli_dbgmsg("MinorSubsystemVersion: %d\n", EC16(optional_hdr64.MinorSubsystemVersion));
1091
+        cli_dbgmsg("SizeOfImage: 0x%x\n", EC32(optional_hdr64.SizeOfImage));
1092
+        cli_dbgmsg("SizeOfHeaders: 0x%x\n", hdr_size);
1093
+        cli_dbgmsg("NumberOfRvaAndSizes: %d\n", EC32(optional_hdr64.NumberOfRvaAndSizes));
1094
+        dirs = optional_hdr64.DataDirectory;
1091 1095
 #if HAVE_JSON
1092
-    cli_jsonint(pe_json, "MajorLinkerVersion", optional_hdr64.MajorLinkerVersion);
1093
-    cli_jsonint(pe_json, "MinorLinkerVersion", optional_hdr64.MinorLinkerVersion);
1094
-    cli_jsonint(pe_json, "SizeOfCode", EC32(optional_hdr64.SizeOfCode));
1095
-    cli_jsonint(pe_json, "SizeOfInitializedData", EC32(optional_hdr64.SizeOfInitializedData));
1096
-    cli_jsonint(pe_json, "SizeOfUninitializedData", EC32(optional_hdr64.SizeOfUninitializedData));
1097
-    cli_jsonint(pe_json, "NumberOfRvaAndSizes", EC32(optional_hdr64.NumberOfRvaAndSizes));
1098
-    cli_jsonint(pe_json, "MajorSubsystemVersion", EC16(optional_hdr64.MajorSubsystemVersion));
1099
-    cli_jsonint(pe_json, "MinorSubsystemVersion", EC16(optional_hdr64.MinorSubsystemVersion));
1096
+        cli_jsonint(pe_json, "MajorLinkerVersion", optional_hdr64.MajorLinkerVersion);
1097
+        cli_jsonint(pe_json, "MinorLinkerVersion", optional_hdr64.MinorLinkerVersion);
1098
+        cli_jsonint(pe_json, "SizeOfCode", EC32(optional_hdr64.SizeOfCode));
1099
+        cli_jsonint(pe_json, "SizeOfInitializedData", EC32(optional_hdr64.SizeOfInitializedData));
1100
+        cli_jsonint(pe_json, "SizeOfUninitializedData", EC32(optional_hdr64.SizeOfUninitializedData));
1101
+        cli_jsonint(pe_json, "NumberOfRvaAndSizes", EC32(optional_hdr64.NumberOfRvaAndSizes));
1102
+        cli_jsonint(pe_json, "MajorSubsystemVersion", EC16(optional_hdr64.MajorSubsystemVersion));
1103
+        cli_jsonint(pe_json, "MinorSubsystemVersion", EC16(optional_hdr64.MinorSubsystemVersion));
1100 1104
 
1101
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.BaseOfCode));
1102
-    cli_jsonstr(pe_json, "BaseOfCode", jsonbuf);
1105
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.BaseOfCode));
1106
+        cli_jsonstr(pe_json, "BaseOfCode", jsonbuf);
1103 1107
 
1104
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.SectionAlignment));
1105
-    cli_jsonstr(pe_json, "SectionAlignment", jsonbuf);
1108
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.SectionAlignment));
1109
+        cli_jsonstr(pe_json, "SectionAlignment", jsonbuf);
1106 1110
 
1107
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.FileAlignment));
1108
-    cli_jsonstr(pe_json, "FileAlignment", jsonbuf);
1111
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.FileAlignment));
1112
+        cli_jsonstr(pe_json, "FileAlignment", jsonbuf);
1109 1113
 
1110
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.SizeOfImage));
1111
-    cli_jsonstr(pe_json, "SizeOfImage", jsonbuf);
1114
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", EC32(optional_hdr64.SizeOfImage));
1115
+        cli_jsonstr(pe_json, "SizeOfImage", jsonbuf);
1112 1116
 
1113
-    snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", hdr_size);
1114
-    cli_jsonstr(pe_json, "SizeOfHeaders", jsonbuf);
1117
+        snprintf(jsonbuf, sizeof(jsonbuf), "0x%x", hdr_size);
1118
+        cli_jsonstr(pe_json, "SizeOfHeaders", jsonbuf);
1115 1119
 #endif
1116 1120
     }
1117 1121
 
... ...
@@ -1124,50 +1080,50 @@ int cli_scanpe(cli_ctx *ctx)
1124 1124
 
1125 1125
 
1126 1126
     switch(pe_plus ? EC16(optional_hdr64.Subsystem) : EC16(optional_hdr32.Subsystem)) {
1127
-	case 0:
1127
+    case 0:
1128 1128
         subsystem = "Unknown";
1129
-	    break;
1130
-	case 1:
1129
+        break;
1130
+    case 1:
1131 1131
         subsystem = "Native (svc)";
1132
-	    native = 1;
1133
-	    break;
1134
-	case 2:
1132
+        native = 1;
1133
+        break;
1134
+    case 2:
1135 1135
         subsystem = "Win32 GUI";
1136
-	    break;
1137
-	case 3:
1136
+        break;
1137
+    case 3:
1138 1138
         subsystem = "Win32 console";
1139
-	    break;
1140
-	case 5:
1139
+        break;
1140
+    case 5:
1141 1141
         subsystem = "OS/2 console";
1142
-	    break;
1143
-	case 7:
1142
+        break;
1143
+    case 7:
1144 1144
         subsystem = "POSIX console";
1145
-	    break;
1146
-	case 8:
1145
+        break;
1146
+    case 8:
1147 1147
         subsystem = "Native Win9x driver";
1148
-	    break;
1149
-	case 9:
1148
+        break;
1149
+    case 9:
1150 1150
         subsystem = "WinCE GUI";
1151
-	    break;
1152
-	case 10:
1151
+        break;
1152
+    case 10:
1153 1153
         subsystem = "EFI application";
1154
-	    break;
1155
-	case 11:
1154
+        break;
1155
+    case 11:
1156 1156
         subsystem = "EFI driver";
1157
-	    break;
1158
-	case 12:
1157
+        break;
1158
+    case 12:
1159 1159
         subsystem = "EFI runtime driver";
1160
-	    break;
1161
-	case 13:
1160
+        break;
1161
+    case 13:
1162 1162
         subsystem = "EFI ROM image";
1163
-	    break;
1164
-	case 14:
1163
+        break;
1164
+    case 14:
1165 1165
         subsystem = "Xbox";
1166
-	    break;
1167
-	case 16:
1166
+        break;
1167
+    case 16:
1168 1168
         subsystem = "Boot application";
1169
-	    break;
1170
-	default:
1169
+        break;
1170
+    default:
1171 1171
         subsystem = "Unknown";
1172 1172
     }
1173 1173
 
... ...
@@ -1181,14 +1137,14 @@ int cli_scanpe(cli_ctx *ctx)
1181 1181
 
1182 1182
     if (DETECT_BROKEN_PE && !native && (!(pe_plus?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment)) || (pe_plus?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment))%0x1000)) {
1183 1183
         cli_dbgmsg("Bad virtual alignemnt\n");
1184
-	cli_append_virus(ctx,"Heuristics.Broken.Executable");
1185
-	return CL_VIRUS;
1184
+        cli_append_virus(ctx,"Heuristics.Broken.Executable");
1185
+        return CL_VIRUS;
1186 1186
     }
1187 1187
 
1188 1188
     if (DETECT_BROKEN_PE && !native && (!(pe_plus?EC32(optional_hdr64.FileAlignment):EC32(optional_hdr32.FileAlignment)) || (pe_plus?EC32(optional_hdr64.FileAlignment):EC32(optional_hdr32.FileAlignment))%0x200)) {
1189 1189
         cli_dbgmsg("Bad file alignemnt\n");
1190
-	cli_append_virus(ctx, "Heuristics.Broken.Executable");
1191
-	return CL_VIRUS;
1190
+        cli_append_virus(ctx, "Heuristics.Broken.Executable");
1191
+        return CL_VIRUS;
1192 1192
     }
1193 1193
 
1194 1194
     fsize = map->len;
... ...
@@ -1196,16 +1152,16 @@ int cli_scanpe(cli_ctx *ctx)
1196 1196
     section_hdr = (struct pe_image_section_hdr *) cli_calloc(nsections, sizeof(struct pe_image_section_hdr));
1197 1197
 
1198 1198
     if(!section_hdr) {
1199
-	cli_dbgmsg("Can't allocate memory for section headers\n");
1200
-	return CL_EMEM;
1199
+        cli_dbgmsg("Can't allocate memory for section headers\n");
1200
+        return CL_EMEM;
1201 1201
     }
1202 1202
 
1203 1203
     exe_sections = (struct cli_exe_section *) cli_calloc(nsections, sizeof(struct cli_exe_section));
1204 1204
     
1205 1205
     if(!exe_sections) {
1206
-	cli_dbgmsg("Can't allocate memory for section headers\n");
1207
-	free(section_hdr);
1208
-	return CL_EMEM;
1206
+        cli_dbgmsg("Can't allocate memory for section headers\n");
1207
+        free(section_hdr);
1208
+        return CL_EMEM;
1209 1209
     }
1210 1210
 
1211 1211
     valign = (pe_plus)?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment);
... ...
@@ -1213,23 +1169,27 @@ int cli_scanpe(cli_ctx *ctx)
1213 1213
 
1214 1214
     if(fmap_readn(map, section_hdr, at, sizeof(struct pe_image_section_hdr)*nsections) != (int)(nsections*sizeof(struct pe_image_section_hdr))) {
1215 1215
         cli_dbgmsg("Can't read section header\n");
1216
-	cli_dbgmsg("Possibly broken PE file\n");
1217
-	free(section_hdr);
1218
-	free(exe_sections);
1219
-	if(DETECT_BROKEN_PE) {
1220
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
1221
-	    return CL_VIRUS;
1222
-	}
1223
-	return CL_CLEAN;
1216
+        cli_dbgmsg("Possibly broken PE file\n");
1217
+
1218
+        free(section_hdr);
1219
+        free(exe_sections);
1220
+
1221
+        if(DETECT_BROKEN_PE) {
1222
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
1223
+            return CL_VIRUS;
1224
+        }
1225
+
1226
+        return CL_CLEAN;
1224 1227
     }
1228
+
1225 1229
     at += sizeof(struct pe_image_section_hdr)*nsections;
1226 1230
 
1227 1231
     for(i = 0; falign!=0x200 && i<nsections; i++) {
1228
-	/* file alignment fallback mode - blah */
1229
-	if (falign && section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
1230
-	    cli_dbgmsg("Found misaligned section, using 0x200\n");
1231
-	    falign = 0x200;
1232
-	}
1232
+        /* file alignment fallback mode - blah */
1233
+        if (falign && section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
1234
+            cli_dbgmsg("Found misaligned section, using 0x200\n");
1235
+            falign = 0x200;
1236
+        }
1233 1237
     }
1234 1238
 
1235 1239
     hdr_size = PESALIGN(hdr_size, valign); /* Aligned headers virtual size */
... ...
@@ -1238,18 +1198,57 @@ int cli_scanpe(cli_ctx *ctx)
1238 1238
     cli_jsonint(pe_json, "NumberOfSections", nsections);
1239 1239
 #endif
1240 1240
 
1241
+    while (rescan==1) {
1242
+        rescan=0;
1243
+        for (i=0; i < nsections; i++) {
1244
+            exe_sections[i].rva = PEALIGN(EC32(section_hdr[i].VirtualAddress), valign);
1245
+            exe_sections[i].vsz = PESALIGN(EC32(section_hdr[i].VirtualSize), valign);
1246
+            exe_sections[i].raw = PEALIGN(EC32(section_hdr[i].PointerToRawData), falign);
1247
+            exe_sections[i].rsz = PESALIGN(EC32(section_hdr[i].SizeOfRawData), falign);
1248
+            exe_sections[i].chr = EC32(section_hdr[i].Characteristics);
1249
+            exe_sections[i].urva = EC32(section_hdr[i].VirtualAddress); /* Just in case */
1250
+            exe_sections[i].uvsz = EC32(section_hdr[i].VirtualSize);
1251
+            exe_sections[i].uraw = EC32(section_hdr[i].PointerToRawData);
1252
+            exe_sections[i].ursz = EC32(section_hdr[i].SizeOfRawData);
1253
+
1254
+            if (exe_sections[i].rsz) { /* Don't bother with virtual only sections */
1255
+                if (exe_sections[i].raw >= fsize || exe_sections[i].uraw > fsize) {
1256
+                    cli_dbgmsg("Broken PE file - Section %d starts or exists beyond the end of file (Offset@ %lu, Total filesize %lu)\n", i, (unsigned long)exe_sections[i].raw, (unsigned long)fsize);
1257
+                    if (nsections == 1) {
1258
+                        free(section_hdr);
1259
+                        free(exe_sections);
1260
+
1261
+                        if(DETECT_BROKEN_PE) {
1262
+                            cli_append_virus(ctx, "Heuristics.Broken.Executable");
1263
+                            return CL_VIRUS;
1264
+                        }
1265
+
1266
+                        return CL_CLEAN; /* no ninjas to see here! move along! */
1267
+                    }
1268
+
1269
+                    for (j=i; j < nsections-1; j++)
1270
+                        memcpy(&exe_sections[j], &exe_sections[j+1], sizeof(struct cli_exe_section));
1271
+
1272
+                    for (j=i; j < nsections-1; j++)
1273
+                        memcpy(&section_hdr[j], &section_hdr[j+1], sizeof(struct pe_image_section_hdr));
1274
+
1275
+                    nsections--;
1276
+                    rescan=1;
1277
+                    break;
1278
+                }
1279
+
1280
+                if (!CLI_ISCONTAINED(0, (uint32_t) fsize, exe_sections[i].raw, exe_sections[i].rsz))
1281
+                    exe_sections[i].rsz = fsize - exe_sections[i].raw;
1282
+
1283
+                if (!CLI_ISCONTAINED(0, fsize, exe_sections[i].uraw, exe_sections[i].ursz))
1284
+                    exe_sections[i].ursz = fsize - exe_sections[i].uraw;
1285
+            }
1286
+        }
1287
+    }
1288
+
1241 1289
     for(i = 0; i < nsections; i++) {
1242
-	strncpy(sname, (char *) section_hdr[i].Name, 8);
1243
-	sname[8] = 0;
1244
-	exe_sections[i].rva = PEALIGN(EC32(section_hdr[i].VirtualAddress), valign);
1245
-	exe_sections[i].vsz = PESALIGN(EC32(section_hdr[i].VirtualSize), valign);
1246
-	exe_sections[i].raw = PEALIGN(EC32(section_hdr[i].PointerToRawData), falign);
1247
-	exe_sections[i].rsz = PESALIGN(EC32(section_hdr[i].SizeOfRawData), falign);
1248
-	exe_sections[i].chr = EC32(section_hdr[i].Characteristics);
1249
-	exe_sections[i].urva = EC32(section_hdr[i].VirtualAddress); /* Just in case */
1250
-	exe_sections[i].uvsz = EC32(section_hdr[i].VirtualSize);
1251
-	exe_sections[i].uraw = EC32(section_hdr[i].PointerToRawData);
1252
-	exe_sections[i].ursz = EC32(section_hdr[i].SizeOfRawData);
1290
+        strncpy(sname, (char *) section_hdr[i].Name, 8);
1291
+        sname[8] = 0;
1253 1292
 
1254 1293
 #if HAVE_JSON
1255 1294
         add_section_info(ctx, &exe_sections[i]);
... ...
@@ -1261,127 +1260,117 @@ int cli_scanpe(cli_ctx *ctx)
1261 1261
         }
1262 1262
 #endif
1263 1263
 
1264
-	if (!exe_sections[i].vsz && exe_sections[i].rsz)
1265
-	    exe_sections[i].vsz=PESALIGN(exe_sections[i].ursz, valign);
1266
-
1267
-	if (exe_sections[i].rsz && fsize>exe_sections[i].raw && !CLI_ISCONTAINED(0, (uint32_t) fsize, exe_sections[i].raw, exe_sections[i].rsz))
1268
-	    exe_sections[i].rsz = fsize - exe_sections[i].raw;
1269
-	
1270
-	cli_dbgmsg("Section %d\n", i);
1271
-	cli_dbgmsg("Section name: %s\n", sname);
1272
-	cli_dbgmsg("Section data (from headers - in memory)\n");
1273
-	cli_dbgmsg("VirtualSize: 0x%x 0x%x\n", exe_sections[i].uvsz, exe_sections[i].vsz);
1274
-	cli_dbgmsg("VirtualAddress: 0x%x 0x%x\n", exe_sections[i].urva, exe_sections[i].rva);
1275
-	cli_dbgmsg("SizeOfRawData: 0x%x 0x%x\n", exe_sections[i].ursz, exe_sections[i].rsz);
1276
-	cli_dbgmsg("PointerToRawData: 0x%x 0x%x\n", exe_sections[i].uraw, exe_sections[i].raw);
1277
-
1278
-	if(exe_sections[i].chr & 0x20) {
1279
-	    cli_dbgmsg("Section contains executable code\n");
1280
-
1281
-	    if(exe_sections[i].vsz < exe_sections[i].rsz) {
1282
-		cli_dbgmsg("Section contains free space\n");
1283
-		/*
1284
-		cli_dbgmsg("Dumping %d bytes\n", section_hdr.SizeOfRawData - section_hdr.VirtualSize);
1285
-		ddump(desc, section_hdr.PointerToRawData + section_hdr.VirtualSize, section_hdr.SizeOfRawData - section_hdr.VirtualSize, cli_gentemp(NULL));
1286
-		*/
1264
+        if (!exe_sections[i].vsz && exe_sections[i].rsz)
1265
+            exe_sections[i].vsz=PESALIGN(exe_sections[i].ursz, valign);
1287 1266
 
1288
-	    }
1289
-	}
1267
+        cli_dbgmsg("Section %d\n", i);
1268
+        cli_dbgmsg("Section name: %s\n", sname);
1269
+        cli_dbgmsg("Section data (from headers - in memory)\n");
1270
+        cli_dbgmsg("VirtualSize: 0x%x 0x%x\n", exe_sections[i].uvsz, exe_sections[i].vsz);
1271
+        cli_dbgmsg("VirtualAddress: 0x%x 0x%x\n", exe_sections[i].urva, exe_sections[i].rva);
1272
+        cli_dbgmsg("SizeOfRawData: 0x%x 0x%x\n", exe_sections[i].ursz, exe_sections[i].rsz);
1273
+        cli_dbgmsg("PointerToRawData: 0x%x 0x%x\n", exe_sections[i].uraw, exe_sections[i].raw);
1274
+
1275
+        if(exe_sections[i].chr & 0x20) {
1276
+            cli_dbgmsg("Section contains executable code\n");
1277
+
1278
+            if(exe_sections[i].vsz < exe_sections[i].rsz) {
1279
+                cli_dbgmsg("Section contains free space\n");
1280
+                /*
1281
+                cli_dbgmsg("Dumping %d bytes\n", section_hdr.SizeOfRawData - section_hdr.VirtualSize);
1282
+                ddump(desc, section_hdr.PointerToRawData + section_hdr.VirtualSize, section_hdr.SizeOfRawData - section_hdr.VirtualSize, cli_gentemp(NULL));
1283
+                */
1284
+            }
1285
+        }
1290 1286
 
1291
-	if(exe_sections[i].chr & 0x20000000)
1292
-	    cli_dbgmsg("Section's memory is executable\n");
1287
+        if(exe_sections[i].chr & 0x20000000)
1288
+            cli_dbgmsg("Section's memory is executable\n");
1293 1289
 
1294
-	if(exe_sections[i].chr & 0x80000000)
1295
-	    cli_dbgmsg("Section's memory is writeable\n");
1290
+        if(exe_sections[i].chr & 0x80000000)
1291
+            cli_dbgmsg("Section's memory is writeable\n");
1296 1292
 
1297
-	if (DETECT_BROKEN_PE && (!valign || (exe_sections[i].urva % valign))) { /* Bad virtual alignment */
1298
-	    cli_dbgmsg("VirtualAddress is misaligned\n");
1299
-	    cli_dbgmsg("------------------------------------\n");
1300
-	    cli_append_virus(ctx, "Heuristics.Broken.Executable");
1301
-	    free(section_hdr);
1302
-	    free(exe_sections);
1303
-	    return CL_VIRUS;
1304
-	}
1293
+        if (DETECT_BROKEN_PE && (!valign || (exe_sections[i].urva % valign))) { /* Bad virtual alignment */
1294
+            cli_dbgmsg("VirtualAddress is misaligned\n");
1295
+            cli_dbgmsg("------------------------------------\n");
1296
+            cli_append_virus(ctx, "Heuristics.Broken.Executable");
1297
+            free(section_hdr);
1298
+            free(exe_sections);
1299
+            return CL_VIRUS;
1300
+        }
1305 1301
 
1306
-	if (exe_sections[i].rsz) { /* Don't bother with virtual only sections */
1307
-	    if (exe_sections[i].raw >= fsize) { /* really broken */
1308
-	      cli_dbgmsg("Broken PE file - Section %d starts beyond the end of file (Offset@ %lu, Total filesize %lu)\n", i, (unsigned long)exe_sections[i].raw, (unsigned long)fsize);
1309
-	      cli_dbgmsg("------------------------------------\n");
1310
-		free(section_hdr);
1311
-		free(exe_sections);
1312
-		if(DETECT_BROKEN_PE) {
1313
-		    cli_append_virus(ctx, "Heuristics.Broken.Executable");
1314
-		    return CL_VIRUS;
1315
-		}
1316
-		return CL_CLEAN; /* no ninjas to see here! move along! */
1317
-	    }
1302
+        if (exe_sections[i].rsz) { /* Don't bother with virtual only sections */
1303
+            if(SCAN_ALGO && (DCONF & PE_CONF_POLIPOS) && !*sname && exe_sections[i].vsz > 40000 && exe_sections[i].vsz < 70000 && exe_sections[i].chr == 0xe0000060) polipos = i;
1318 1304
 
1319
-	    if(SCAN_ALGO && (DCONF & PE_CONF_POLIPOS) && !*sname && exe_sections[i].vsz > 40000 && exe_sections[i].vsz < 70000 && exe_sections[i].chr == 0xe0000060) polipos = i;
1320
-
1321
-	    /* check hash section sigs */
1322
-	    if((DCONF & PE_CONF_MD5SECT) && ctx->engine->hm_mdb) {
1323
-	        ret = scan_pe_mdb(ctx, &exe_sections[i]);
1324
-	        if (ret != CL_CLEAN) {
1325
-	            if (ret != CL_VIRUS)
1326
-	                cli_errmsg("scan_pe: scan_pe_mdb failed: %s!\n", cl_strerror(ret));
1327
-		    cli_dbgmsg("------------------------------------\n");
1328
-	            free(section_hdr);
1329
-	            free(exe_sections);
1330
-	            return ret;
1331
-	        }
1332
-	    }
1333
-	}
1334
-	cli_dbgmsg("------------------------------------\n");
1335
-
1336
-	if (exe_sections[i].urva>>31 || exe_sections[i].uvsz>>31 || (exe_sections[i].rsz && exe_sections[i].uraw>>31) || exe_sections[i].ursz>>31) {
1337
-	    cli_dbgmsg("Found PE values with sign bit set\n");
1338
-	    free(section_hdr);
1339
-	    free(exe_sections);
1340
-	    if(DETECT_BROKEN_PE) {
1341
-		cli_append_virus(ctx, "Heuristics.Broken.Executable");
1342
-		return CL_VIRUS;
1343
-	    }
1344
-	    return CL_CLEAN;
1345
-	}
1305
+            /* check hash section sigs */
1306
+            if((DCONF & PE_CONF_MD5SECT) && ctx->engine->hm_mdb) {
1307
+                ret = scan_pe_mdb(ctx, &exe_sections[i]);
1308
+                if (ret != CL_CLEAN) {
1309
+                    if (ret != CL_VIRUS)
1310
+                        cli_errmsg("scan_pe: scan_pe_mdb failed: %s!\n", cl_strerror(ret));
1346 1311
 
1347
-	if(!i) {
1348
-	    if (DETECT_BROKEN_PE && exe_sections[i].urva!=hdr_size) { /* Bad first section RVA */
1349
-	        cli_dbgmsg("First section is in the wrong place\n");
1350
-		cli_append_virus(ctx, "Heuristics.Broken.Executable");
1351
-		free(section_hdr);
1352
-		free(exe_sections);
1353
-		return CL_VIRUS;
1354
-	    }
1355
-	    min = exe_sections[i].rva;
1356
-	    max = exe_sections[i].rva + exe_sections[i].rsz;
1357
-	} else {
1358
-	    if (DETECT_BROKEN_PE && exe_sections[i].urva - exe_sections[i-1].urva != exe_sections[i-1].vsz) { /* No holes, no overlapping, no virtual disorder */
1359
-	        cli_dbgmsg("Virtually misplaced section (wrong order, overlapping, non contiguous)\n");
1360
-		cli_append_virus(ctx, "Heuristics.Broken.Executable");
1361
-		free(section_hdr);
1362
-		free(exe_sections);
1363
-		return CL_VIRUS;
1364
-	    }
1365
-	    if(exe_sections[i].rva < min)
1366
-	        min = exe_sections[i].rva;
1312
+                    cli_dbgmsg("------------------------------------\n");
1313
+                    free(section_hdr);
1314
+                    free(exe_sections);
1315
+                    return ret;
1316
+                }
1317
+            }
1318
+        }
1319
+        cli_dbgmsg("------------------------------------\n");
1367 1320
 
1368
-	    if(exe_sections[i].rva + exe_sections[i].rsz > max) {
1369
-	        max = exe_sections[i].rva + exe_sections[i].rsz;
1370
-		overlays = exe_sections[i].raw + exe_sections[i].rsz;
1371
-	    }
1372
-	}
1321
+        if (exe_sections[i].urva>>31 || exe_sections[i].uvsz>>31 || (exe_sections[i].rsz && exe_sections[i].uraw>>31) || exe_sections[i].ursz>>31) {
1322
+            cli_dbgmsg("Found PE values with sign bit set\n");
1323
+
1324
+            free(section_hdr);
1325
+            free(exe_sections);
1326
+            if(DETECT_BROKEN_PE) {
1327
+                cli_append_virus(ctx, "Heuristics.Broken.Executable");
1328
+                return CL_VIRUS;
1329
+            }
1330
+
1331
+            return CL_CLEAN;
1332
+        }
1333
+
1334
+        if(!i) {
1335
+            if (DETECT_BROKEN_PE && exe_sections[i].urva!=hdr_size) { /* Bad first section RVA */
1336
+                cli_dbgmsg("First section is in the wrong place\n");
1337
+                cli_append_virus(ctx, "Heuristics.Broken.Executable");
1338
+                free(section_hdr);
1339
+                free(exe_sections);
1340
+                return CL_VIRUS;
1341
+            }
1342
+
1343
+            min = exe_sections[i].rva;
1344
+            max = exe_sections[i].rva + exe_sections[i].rsz;
1345
+        } else {
1346
+            if (DETECT_BROKEN_PE && exe_sections[i].urva - exe_sections[i-1].urva != exe_sections[i-1].vsz) { /* No holes, no overlapping, no virtual disorder */
1347
+                cli_dbgmsg("Virtually misplaced section (wrong order, overlapping, non contiguous)\n");
1348
+                cli_append_virus(ctx, "Heuristics.Broken.Executable");
1349
+                free(section_hdr);
1350
+                free(exe_sections);
1351
+                return CL_VIRUS;
1352
+            }
1353
+
1354
+            if(exe_sections[i].rva < min)
1355
+                min = exe_sections[i].rva;
1356
+
1357
+            if(exe_sections[i].rva + exe_sections[i].rsz > max) {
1358
+                max = exe_sections[i].rva + exe_sections[i].rsz;
1359
+                overlays = exe_sections[i].raw + exe_sections[i].rsz;
1360
+            }
1361
+        }
1373 1362
     }
1374 1363
 
1375 1364
     free(section_hdr);
1376 1365
 
1377 1366
     if(!(ep = cli_rawaddr(vep, exe_sections, nsections, &err, fsize, hdr_size)) && err) {
1378
-	cli_dbgmsg("EntryPoint out of file\n");
1379
-	free(exe_sections);
1380
-	if(DETECT_BROKEN_PE) {
1381
-	    cli_append_virus(ctx,"Heuristics.Broken.Executable");
1382
-	    return CL_VIRUS;
1383
-	}
1384
-	return CL_CLEAN;
1367
+        cli_dbgmsg("EntryPoint out of file\n");
1368
+        free(exe_sections);
1369
+        if(DETECT_BROKEN_PE) {
1370
+            cli_append_virus(ctx,"Heuristics.Broken.Executable");
1371
+            return CL_VIRUS;
1372
+        }
1373
+
1374
+        return CL_CLEAN;
1385 1375
     }
1386 1376
 
1387 1377
 #if HAVE_JSON
... ...
@@ -1395,8 +1384,8 @@ int cli_scanpe(cli_ctx *ctx)
1395 1395
     cli_dbgmsg("EntryPoint offset: 0x%x (%d)\n", ep, ep);
1396 1396
 
1397 1397
     if(pe_plus) { /* Do not continue for PE32+ files */
1398
-	free(exe_sections);
1399
-	return CL_CLEAN;
1398
+        free(exe_sections);
1399
+        return CL_CLEAN;
1400 1400
     }
1401 1401
 
1402 1402
     epsize = fmap_readn(map, epbuff, ep, 4096);
... ...
@@ -1416,14 +1405,14 @@ int cli_scanpe(cli_ctx *ctx)
1416 1416
     /* } */
1417 1417
 
1418 1418
     if(overlays) {
1419
-	int overlays_sz = fsize - overlays;
1420
-	if(overlays_sz > 0) {
1421
-	    ret = cli_scanishield(ctx, overlays, overlays_sz);
1422
-	    if(ret != CL_CLEAN) {
1423
-		free(exe_sections);
1424
-		return ret;
1425
-	    }
1426
-	}
1419
+        int overlays_sz = fsize - overlays;
1420
+        if(overlays_sz > 0) {
1421
+            ret = cli_scanishield(ctx, overlays, overlays_sz);
1422
+            if(ret != CL_CLEAN) {
1423
+                free(exe_sections);
1424
+                return ret;
1425
+            }
1426
+        }
1427 1427
     }
1428 1428
 
1429 1429
     pedata.nsections = nsections;
... ...
@@ -1441,10 +1430,11 @@ int cli_scanpe(cli_ctx *ctx)
1441 1441
     /* Bytecode BC_PE_ALL hook */
1442 1442
     bc_ctx = cli_bytecode_context_alloc();
1443 1443
     if (!bc_ctx) {
1444
-	cli_errmsg("cli_scanpe: can't allocate memory for bc_ctx\n");
1445
-	free(exe_sections);
1446
-	return CL_EMEM;
1444
+        cli_errmsg("cli_scanpe: can't allocate memory for bc_ctx\n");
1445
+        free(exe_sections);
1446
+        return CL_EMEM;
1447 1447
     }
1448
+
1448 1449
     cli_bytecode_context_setpe(bc_ctx, &pedata, exe_sections);
1449 1450
     cli_bytecode_context_setctx(bc_ctx, ctx);
1450 1451
     ret = cli_bytecode_runhook(ctx, ctx->engine, bc_ctx, BC_PE_ALL, map);
... ...
@@ -1464,228 +1454,284 @@ int cli_scanpe(cli_ctx *ctx)
1464 1464
     /* W32.Parite.B */
1465 1465
     if(SCAN_ALGO && (DCONF & PE_CONF_PARITE) && !dll && epsize == 4096 && ep == exe_sections[nsections - 1].raw) {
1466 1466
         const char *pt = cli_memstr(epbuff, 4040, "\x47\x65\x74\x50\x72\x6f\x63\x41\x64\x64\x72\x65\x73\x73\x00", 15);
1467
-	if(pt) {
1468
-	    pt += 15;
1469
-	    if((((uint32_t)cli_readint32(pt) ^ (uint32_t)cli_readint32(pt + 4)) == 0x505a4f) && (((uint32_t)cli_readint32(pt + 8) ^ (uint32_t)cli_readint32(pt + 12)) == 0xffffb) && (((uint32_t)cli_readint32(pt + 16) ^ (uint32_t)cli_readint32(pt + 20)) == 0xb8)) {
1470
-	        cli_append_virus(ctx,"Heuristics.W32.Parite.B");
1471
-		if (!SCAN_ALL) {
1472
-		    free(exe_sections);
1473
-		    return CL_VIRUS;
1474
-		}
1475
-		viruses_found++;
1476
-	    }
1477
-	}
1467
+        if(pt) {
1468
+            pt += 15;
1469
+            if((((uint32_t)cli_readint32(pt) ^ (uint32_t)cli_readint32(pt + 4)) == 0x505a4f) && (((uint32_t)cli_readint32(pt + 8) ^ (uint32_t)cli_readint32(pt + 12)) == 0xffffb) && (((uint32_t)cli_readint32(pt + 16) ^ (uint32_t)cli_readint32(pt + 20)) == 0xb8)) {
1470
+                cli_append_virus(ctx,"Heuristics.W32.Parite.B");
1471
+                if (!SCAN_ALL) {
1472
+                    free(exe_sections);
1473
+                    return CL_VIRUS;
1474
+                }
1475
+
1476
+                viruses_found++;
1477
+            }
1478
+        }
1478 1479
     }
1479 1480
 
1480 1481
     /* Kriz */
1481 1482
     if(SCAN_ALGO && (DCONF & PE_CONF_KRIZ) && epsize >= 200 && CLI_ISCONTAINED(exe_sections[nsections - 1].raw, exe_sections[nsections - 1].rsz, ep, 0x0fd2) && epbuff[1]=='\x9c' && epbuff[2]=='\x60') {
1482
-	enum {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSXORPRFX,KZSXOR,KZSDDELTA,KZSLOOP,KZSTOP};
1483
-	uint8_t kzs[] = {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSTRASH,KZSXORPRFX,KZSXOR,KZSTRASH,KZSDDELTA,KZSTRASH,KZSLOOP,KZSTOP};
1484
-	uint8_t *kzstate = kzs;
1485
-	uint8_t *kzcode = (uint8_t *)epbuff + 3;
1486
-	uint8_t kzdptr=0xff, kzdsize=0xff;
1487
-	int kzlen = 197, kzinitlen=0xffff, kzxorlen=-1;
1488
-	cli_dbgmsg("in kriz\n");
1489
-
1490
-	while(*kzstate!=KZSTOP) {
1491
-	    uint8_t op;
1492
-	    if(kzlen<=6) break;
1493
-	    op = *kzcode++;
1494
-	    kzlen--;
1495
-	    switch (*kzstate) {
1496
-	    case KZSTRASH: case KZSGETSIZE: {
1497
-		int opsz=0;
1498
-		switch(op) {
1499
-		case 0x81:
1500
-		    kzcode+=5;
1501
-		    kzlen-=5;
1502
-		    break;
1503
-		case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbd: case 0xbe: case 0xbf:
1504
-		    if(*kzstate==KZSGETSIZE && cli_readint32(kzcode)==0x0fd2) {
1505
-			kzinitlen = kzlen-5;
1506
-			kzdsize=op-0xb8;
1507
-			kzstate++;
1508
-			op=4; /* fake the register to avoid breaking out */
1509
-			cli_dbgmsg("kriz: using #%d as size counter\n", kzdsize);
1510
-		    }
1511
-		    opsz=4;
1512
-		case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4d: case 0x4e: case 0x4f:
1513
-		    op&=7;
1514
-		    if(op!=kzdptr && op!=kzdsize) {
1515
-			kzcode+=opsz;
1516
-			kzlen-=opsz;
1517
-			break;
1518
-		    }
1519
-		default:
1520
-		    kzcode--;
1521
-		    kzlen++;
1522
-		    kzstate++;
1523
-		}
1524
-		break;
1525
-	    }
1526
-	    case KZSCDELTA:
1527
-		if(op==0xe8 && (uint32_t)cli_readint32(kzcode) < 0xff) {
1528
-		    kzlen-=*kzcode+4;
1529
-		    kzcode+=*kzcode+4;
1530
-		    kzstate++;
1531
-		} else *kzstate=KZSTOP;
1532
-		break;
1533
-	    case KZSPDELTA:
1534
-		if((op&0xf8)==0x58 && (kzdptr=op-0x58)!=4) {
1535
-		    kzstate++;
1536
-		    cli_dbgmsg("kriz: using #%d as pointer\n", kzdptr);
1537
-		} else *kzstate=KZSTOP;
1538
-		break;
1539
-	    case KZSXORPRFX:
1540
-		kzstate++;
1541
-		if(op==0x3e) break;
1542
-	    case KZSXOR:
1543
-		if (op==0x80 && *kzcode==kzdptr+0xb0) {
1544
-		    kzxorlen=kzlen;
1545
-		    kzcode+=+6;
1546
-		    kzlen-=+6;
1547
-		    kzstate++;
1548
-		} else *kzstate=KZSTOP;
1549
-		break;
1550
-	    case KZSDDELTA:
1551
-		if (op==kzdptr+0x48) kzstate++;
1552
-		else *kzstate=KZSTOP;
1553
-		break;
1554
-	    case KZSLOOP:
1555
-		if (op==kzdsize+0x48 && *kzcode==0x75 && kzlen-(int8_t)kzcode[1]-3<=kzinitlen && kzlen-(int8_t)kzcode[1]>=kzxorlen) {
1556
-		    cli_append_virus(ctx,"Heuristics.W32.Kriz");
1557
-		    if (!SCAN_ALL) {
1558
-		        free(exe_sections);
1559
-			return CL_VIRUS;
1560
-		    }
1561
-		    viruses_found++;
1562
-		}
1563
-		cli_dbgmsg("kriz: loop out of bounds, corrupted sample?\n");
1564
-		kzstate++;
1565
-	    }
1566
-	}
1483
+        enum {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSXORPRFX,KZSXOR,KZSDDELTA,KZSLOOP,KZSTOP};
1484
+        uint8_t kzs[] = {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSTRASH,KZSXORPRFX,KZSXOR,KZSTRASH,KZSDDELTA,KZSTRASH,KZSLOOP,KZSTOP};
1485
+        uint8_t *kzstate = kzs;
1486
+        uint8_t *kzcode = (uint8_t *)epbuff + 3;
1487
+        uint8_t kzdptr=0xff, kzdsize=0xff;
1488
+        int kzlen = 197, kzinitlen=0xffff, kzxorlen=-1;
1489
+        cli_dbgmsg("in kriz\n");
1490
+
1491
+        while(*kzstate!=KZSTOP) {
1492
+            uint8_t op;
1493
+            if(kzlen<=6)
1494
+                break;
1495
+
1496
+            op = *kzcode++;
1497
+            kzlen--;
1498
+
1499
+            switch (*kzstate) {
1500
+            case KZSTRASH:
1501
+            case KZSGETSIZE: {
1502
+                int opsz=0;
1503
+                switch(op) {
1504
+                case 0x81:
1505
+                    kzcode+=5;
1506
+                    kzlen-=5;
1507
+                    break;
1508
+                case 0xb8:
1509
+                case 0xb9:
1510
+                case 0xba:
1511
+                case 0xbb:
1512
+                case 0xbd:
1513
+                case 0xbe:
1514
+                case 0xbf:
1515
+                    if(*kzstate==KZSGETSIZE && cli_readint32(kzcode)==0x0fd2) {
1516
+                        kzinitlen = kzlen-5;
1517
+                        kzdsize=op-0xb8;
1518
+                        kzstate++;
1519
+                        op=4; /* fake the register to avoid breaking out */
1520
+
1521
+                        cli_dbgmsg("kriz: using #%d as size counter\n", kzdsize);
1522
+                    }
1523
+                    opsz=4;
1524
+                case 0x48:
1525
+                case 0x49:
1526
+                case 0x4a:
1527
+                case 0x4b:
1528
+                case 0x4d:
1529
+                case 0x4e:
1530
+                case 0x4f:
1531
+                    op&=7;
1532
+                    if(op!=kzdptr && op!=kzdsize) {
1533
+                        kzcode+=opsz;
1534
+                        kzlen-=opsz;
1535
+                        break;
1536
+                    }
1537
+                default:
1538
+                    kzcode--;
1539
+                    kzlen++;
1540
+                    kzstate++;
1541
+                }
1542
+
1543
+                break;
1544
+            }
1545
+            case KZSCDELTA:
1546
+                if(op==0xe8 && (uint32_t)cli_readint32(kzcode) < 0xff) {
1547
+                    kzlen-=*kzcode+4;
1548
+                    kzcode+=*kzcode+4;
1549
+                    kzstate++;
1550
+                } else {
1551
+                    *kzstate=KZSTOP;
1552
+                }
1553
+
1554
+                break;
1555
+            case KZSPDELTA:
1556
+                if((op&0xf8)==0x58 && (kzdptr=op-0x58)!=4) {
1557
+                    kzstate++;
1558
+                    cli_dbgmsg("kriz: using #%d as pointer\n", kzdptr);
1559
+                } else {
1560
+                    *kzstate=KZSTOP;
1561
+                }
1562
+
1563
+                break;
1564
+            case KZSXORPRFX:
1565
+                kzstate++;
1566
+                if(op==0x3e)
1567
+                    break;
1568
+            case KZSXOR:
1569
+                if (op==0x80 && *kzcode==kzdptr+0xb0) {
1570
+                    kzxorlen=kzlen;
1571
+                    kzcode+=+6;
1572
+                    kzlen-=+6;
1573
+                    kzstate++;
1574
+                } else {
1575
+                    *kzstate=KZSTOP;
1576
+                }
1577
+
1578
+                break;
1579
+            case KZSDDELTA:
1580
+                if (op==kzdptr+0x48)
1581
+                    kzstate++;
1582
+                else
1583
+                    *kzstate=KZSTOP;
1584
+
1585
+                break;
1586
+            case KZSLOOP:
1587
+                if (op==kzdsize+0x48 && *kzcode==0x75 && kzlen-(int8_t)kzcode[1]-3<=kzinitlen && kzlen-(int8_t)kzcode[1]>=kzxorlen) {
1588
+                    cli_append_virus(ctx,"Heuristics.W32.Kriz");
1589
+                    if (!SCAN_ALL) {
1590
+                        free(exe_sections);
1591
+                        return CL_VIRUS;
1592
+                    }
1593
+
1594
+                    viruses_found++;
1595
+                }
1596
+
1597
+                cli_dbgmsg("kriz: loop out of bounds, corrupted sample?\n");
1598
+                kzstate++;
1599
+            }
1600
+        }
1567 1601
     }
1568 1602
 
1569 1603
     /* W32.Magistr.A/B */
1570 1604
     if(SCAN_ALGO && (DCONF & PE_CONF_MAGISTR) && !dll && (nsections>1) && (exe_sections[nsections - 1].chr & 0x80000000)) {
1571 1605
         uint32_t rsize, vsize, dam = 0;
1572 1606
 
1573
-	vsize = exe_sections[nsections - 1].uvsz;
1574
-	rsize = exe_sections[nsections - 1].rsz;
1575
-	if(rsize < exe_sections[nsections - 1].ursz) {
1576
-	    rsize = exe_sections[nsections - 1].ursz;
1577
-	    dam = 1;
1578
-	}
1607
+        vsize = exe_sections[nsections - 1].uvsz;
1608
+        rsize = exe_sections[nsections - 1].rsz;
1609
+        if(rsize < exe_sections[nsections - 1].ursz) {
1610
+            rsize = exe_sections[nsections - 1].ursz;
1611
+            dam = 1;
1612
+        }
1579 1613
 
1580
-	if(vsize >= 0x612c && rsize >= 0x612c && ((vsize & 0xff) == 0xec)) {
1581
-		int bw = rsize < 0x7000 ? rsize : 0x7000;
1582
-		const char *tbuff;
1614
+        if(vsize >= 0x612c && rsize >= 0x612c && ((vsize & 0xff) == 0xec)) {
1615
+            int bw = rsize < 0x7000 ? rsize : 0x7000;
1616
+            const char *tbuff;
1583 1617
 
1584
-	    if((tbuff = fmap_need_off_once(map, exe_sections[nsections - 1].raw + rsize - bw, 4096))) {
1585
-		if(cli_memstr(tbuff, 4091, "\xe8\x2c\x61\x00\x00", 5)) {
1586
-		    cli_append_virus(ctx, dam ? "Heuristics.W32.Magistr.A.dam" : "Heuristics.W32.Magistr.A");
1587
-		    if (!SCAN_ALL) {
1588
-		        free(exe_sections);
1589
-			return CL_VIRUS;
1590
-		    }
1591
-		    viruses_found++;
1592
-		}
1593
-	    }
1594
-
1595
-	} else if(rsize >= 0x7000 && vsize >= 0x7000 && ((vsize & 0xff) == 0xed)) {
1596
-		int bw = rsize < 0x8000 ? rsize : 0x8000;
1597
-		const char *tbuff;
1618
+            if((tbuff = fmap_need_off_once(map, exe_sections[nsections - 1].raw + rsize - bw, 4096))) {
1619
+                if(cli_memstr(tbuff, 4091, "\xe8\x2c\x61\x00\x00", 5)) {
1620
+                    cli_append_virus(ctx, dam ? "Heuristics.W32.Magistr.A.dam" : "Heuristics.W32.Magistr.A");
1621
+                    if (!SCAN_ALL) {
1622
+                        free(exe_sections);
1623
+                        return CL_VIRUS;
1624
+                    }
1598 1625
 
1599
-	    if((tbuff = fmap_need_off_once(map, exe_sections[nsections - 1].raw + rsize - bw, 4096))) {
1600
-		if(cli_memstr(tbuff, 4091, "\xe8\x04\x72\x00\x00", 5)) {
1601
-		    cli_append_virus(ctx,dam ? "Heuristics.W32.Magistr.B.dam" : "Heuristics.W32.Magistr.B");
1602
-		    if (!SCAN_ALL) {
1603
-		        free(exe_sections);
1604
-			return CL_VIRUS;
1605
-		    }
1606
-		    viruses_found++;
1607
-		} 
1608
-	    }
1609
-	}
1626
+                    viruses_found++;
1627
+                }
1628
+            }
1629
+        } else if(rsize >= 0x7000 && vsize >= 0x7000 && ((vsize & 0xff) == 0xed)) {
1630
+            int bw = rsize < 0x8000 ? rsize : 0x8000;
1631
+            const char *tbuff;
1632
+
1633
+            if((tbuff = fmap_need_off_once(map, exe_sections[nsections - 1].raw + rsize - bw, 4096))) {
1634
+                if(cli_memstr(tbuff, 4091, "\xe8\x04\x72\x00\x00", 5)) {
1635
+                    cli_append_virus(ctx,dam ? "Heuristics.W32.Magistr.B.dam" : "Heuristics.W32.Magistr.B");
1636
+                    if (!SCAN_ALL) {
1637
+                        free(exe_sections);
1638
+                        return CL_VIRUS;
1639
+                    }
1640
+
1641
+                    viruses_found++;
1642
+                } 
1643
+            }
1644
+        }
1610 1645
     }
1611 1646
 
1612 1647
     /* W32.Polipos.A */
1613 1648
     while(polipos && !dll && nsections > 2 && nsections < 13 && e_lfanew <= 0x800 && (EC16(optional_hdr32.Subsystem) == 2 || EC16(optional_hdr32.Subsystem) == 3) && EC16(file_hdr.Machine) == 0x14c && optional_hdr32.SizeOfStackReserve >= 0x80000) {
1614
-	uint32_t jump, jold, *jumps = NULL;
1615
-	const uint8_t *code;
1616
-	unsigned int xsjs = 0;
1617
-
1618
-	if(exe_sections[0].rsz > CLI_MAX_ALLOCATION) break;
1619
-
1620
-	if(!exe_sections[0].rsz) break;
1621
-	if(!(code=fmap_need_off_once(map, exe_sections[0].raw, exe_sections[0].rsz))) break;
1622
-	for(i=0; i<exe_sections[0].rsz - 5; i++) {
1623
-	    if((uint8_t)(code[i]-0xe8) > 1) continue;
1624
-	    jump = cli_rawaddr(exe_sections[0].rva+i+5+cli_readint32(&code[i+1]), exe_sections, nsections, &err, fsize, hdr_size);
1625
-	    if(err || !CLI_ISCONTAINED(exe_sections[polipos].raw, exe_sections[polipos].rsz, jump, 9)) continue;
1626
-	    if(xsjs % 128 == 0) {
1627
-		if(xsjs == 1280) break;
1628
-		if(!(jumps=(uint32_t *)cli_realloc2(jumps, (xsjs+128)*sizeof(uint32_t)))) {
1629
-		    free(exe_sections);
1630
-		    return CL_EMEM;
1631
-		}
1632
-	    }
1633
-	    j=0;
1634
-	    for(; j<xsjs; j++) {
1635
-		if(jumps[j]<jump) continue;
1636
-		if(jumps[j]==jump) {
1637
-		    xsjs--;
1638
-		    break;
1639
-		}
1640
-		jold=jumps[j];
1641
-		jumps[j]=jump;
1642
-		jump=jold;
1643
-	    }
1644
-	    jumps[j]=jump;
1645
-	    xsjs++;
1646
-	}
1647
-	if(!xsjs) break;
1648
-	cli_dbgmsg("Polipos: Checking %d xsect jump(s)\n", xsjs);
1649
-	for(i=0;i<xsjs;i++) {
1650
-	    if(!(code = fmap_need_off_once(map, jumps[i], 9))) continue;
1651
-	    if((jump=cli_readint32(code))==0x60ec8b55 || (code[4]==0x0ec && ((jump==0x83ec8b55 && code[6]==0x60) || (jump==0x81ec8b55 && !code[7] && !code[8])))) {
1652
-		cli_append_virus(ctx,"Heuristics.W32.Polipos.A");
1653
-		if (!SCAN_ALL) {
1654
-		    free(jumps);
1655
-		    free(exe_sections);
1656
-		    return CL_VIRUS;
1657
-		}
1658
-		viruses_found++;
1659
-	    }
1660
-	}
1661
-	free(jumps);
1662
-	break;
1649
+        uint32_t jump, jold, *jumps = NULL;
1650
+        const uint8_t *code;
1651
+        unsigned int xsjs = 0;
1652
+
1653
+        if(exe_sections[0].rsz > CLI_MAX_ALLOCATION)
1654
+            break;
1655
+        if(!exe_sections[0].rsz)
1656
+            break;
1657
+        if(!(code=fmap_need_off_once(map, exe_sections[0].raw, exe_sections[0].rsz)))
1658
+            break;
1659
+
1660
+        for(i=0; i<exe_sections[0].rsz - 5; i++) {
1661
+            if((uint8_t)(code[i]-0xe8) > 1)
1662
+                continue;
1663
+
1664
+            jump = cli_rawaddr(exe_sections[0].rva+i+5+cli_readint32(&code[i+1]), exe_sections, nsections, &err, fsize, hdr_size);
1665
+            if(err || !CLI_ISCONTAINED(exe_sections[polipos].raw, exe_sections[polipos].rsz, jump, 9))
1666
+                continue;
1667
+
1668
+            if(xsjs % 128 == 0) {
1669
+                if(xsjs == 1280)
1670
+                    break;
1671
+
1672
+                if(!(jumps=(uint32_t *)cli_realloc2(jumps, (xsjs+128)*sizeof(uint32_t)))) {
1673
+                    free(exe_sections);
1674
+                    return CL_EMEM;
1675
+                }
1676
+            }
1677
+
1678
+            j=0;
1679
+            for(; j<xsjs; j++) {
1680
+                if(jumps[j]<jump)
1681
+                    continue;
1682
+                if(jumps[j]==jump) {
1683
+                    xsjs--;
1684
+                    break;
1685
+                }
1686
+
1687
+                jold=jumps[j];
1688
+                jumps[j]=jump;
1689
+                jump=jold;
1690
+            }
1691
+
1692
+            jumps[j]=jump;
1693
+            xsjs++;
1694
+        }
1695
+
1696
+        if(!xsjs)
1697
+            break;
1698
+
1699
+        cli_dbgmsg("Polipos: Checking %d xsect jump(s)\n", xsjs);
1700
+        for(i=0;i<xsjs;i++) {
1701
+            if(!(code = fmap_need_off_once(map, jumps[i], 9)))
1702
+                continue;
1703
+
1704
+            if((jump=cli_readint32(code))==0x60ec8b55 || (code[4]==0x0ec && ((jump==0x83ec8b55 && code[6]==0x60) || (jump==0x81ec8b55 && !code[7] && !code[8])))) {
1705
+                cli_append_virus(ctx,"Heuristics.W32.Polipos.A");
1706
+                if (!SCAN_ALL) {
1707
+                    free(jumps);
1708
+                    free(exe_sections);
1709
+                    return CL_VIRUS;
1710
+                }
1711
+
1712
+                viruses_found++;
1713
+            }
1714
+        }
1715
+
1716
+        free(jumps);
1717
+        break;
1663 1718
     }
1664 1719
 
1665 1720
     /* Trojan.Swizzor.Gen */
1666 1721
     if (SCAN_ALGO && (DCONF & PE_CONF_SWIZZOR) && nsections > 1 && fsize > 64*1024 && fsize < 4*1024*1024) {
1667
-	    if(dirs[2].Size) {
1668
-		    struct swizz_stats *stats = cli_calloc(1, sizeof(*stats));
1669
-		    unsigned int m = 1000;
1670
-		    ret = CL_CLEAN;
1671
-
1672
-		    if (!stats)
1673
-			    ret = CL_EMEM;
1674
-		    else {
1675
-			    cli_parseres_special(EC32(dirs[2].VirtualAddress), EC32(dirs[2].VirtualAddress), map, exe_sections, nsections, fsize, hdr_size, 0, 0, &m, stats);
1676
-			    if ((ret = cli_detect_swizz(stats)) == CL_VIRUS) {
1677
-				cli_append_virus(ctx,"Heuristics.Trojan.Swizzor.Gen");
1678
-			    }
1679
-			    free(stats);
1680
-		    }
1681
-		    if (ret != CL_CLEAN) {
1682
-			if (!(ret == CL_VIRUS && SCAN_ALL)) {
1683
-			    free(exe_sections);
1684
-			    return ret;
1685
-			}
1686
-			viruses_found++;
1687
-		    }
1688
-	    }
1722
+        if(dirs[2].Size) {
1723
+            struct swizz_stats *stats = cli_calloc(1, sizeof(*stats));
1724
+            unsigned int m = 1000;
1725
+            ret = CL_CLEAN;
1726
+
1727
+            if (!stats) {
1728
+                ret = CL_EMEM;
1729
+            } else {
1730
+                cli_parseres_special(EC32(dirs[2].VirtualAddress), EC32(dirs[2].VirtualAddress), map, exe_sections, nsections, fsize, hdr_size, 0, 0, &m, stats);
1731
+                if ((ret = cli_detect_swizz(stats)) == CL_VIRUS)
1732
+                    cli_append_virus(ctx,"Heuristics.Trojan.Swizzor.Gen");
1733
+
1734
+                free(stats);
1735
+            }
1736
+            if (ret != CL_CLEAN) {
1737
+                if (!(ret == CL_VIRUS && SCAN_ALL)) {
1738
+                    free(exe_sections);
1739
+                    return ret;
1740
+                }
1741
+
1742
+                viruses_found++;
1743
+            }
1744
+        }
1689 1745
     }
1690 1746
 
1691 1747
 
... ...
@@ -1699,722 +1745,733 @@ int cli_scanpe(cli_ctx *ctx)
1699 1699
     /* try to find the first section with physical size == 0 */
1700 1700
     found = 0;
1701 1701
     if(DCONF & (PE_CONF_UPX | PE_CONF_FSG | PE_CONF_MEW)) {
1702
-	for(i = 0; i < (unsigned int) nsections - 1; i++) {
1703
-	    if(!exe_sections[i].rsz && exe_sections[i].vsz && exe_sections[i + 1].rsz && exe_sections[i + 1].vsz) {
1704
-		found = 1;
1705
-		cli_dbgmsg("UPX/FSG/MEW: empty section found - assuming compression\n");
1702
+        for(i = 0; i < (unsigned int) nsections - 1; i++) {
1703
+            if(!exe_sections[i].rsz && exe_sections[i].vsz && exe_sections[i + 1].rsz && exe_sections[i + 1].vsz) {
1704
+                found = 1;
1705
+                cli_dbgmsg("UPX/FSG/MEW: empty section found - assuming compression\n");
1706 1706
 #if HAVE_JSON
1707
-        cli_jsonbool(pe_json, "HasEmptySection", 1);
1707
+                cli_jsonbool(pe_json, "HasEmptySection", 1);
1708 1708
 #endif
1709
-		break;
1710
-	    }
1711
-	}
1709
+                break;
1710
+            }
1711
+        }
1712 1712
     }
1713 1713
 
1714 1714
     /* MEW support */
1715 1715
     if (found && (DCONF & PE_CONF_MEW) && epsize>=16 && epbuff[0]=='\xe9') {
1716
-	uint32_t fileoffset;
1717
-	const char *tbuff;
1716
+        uint32_t fileoffset;
1717
+        const char *tbuff;
1718 1718
 
1719
-	fileoffset = (vep + cli_readint32(epbuff + 1) + 5);
1720
-	while (fileoffset == 0x154 || fileoffset == 0x158) {
1721
-	    char *src;
1722
-	    uint32_t offdiff, uselzma;
1719
+        fileoffset = (vep + cli_readint32(epbuff + 1) + 5);
1720
+        while (fileoffset == 0x154 || fileoffset == 0x158) {
1721
+            char *src;
1722
+            uint32_t offdiff, uselzma;
1723 1723
 
1724
-	    cli_dbgmsg ("MEW: found MEW characteristics %08X + %08X + 5 = %08X\n", 
1725
-			cli_readint32(epbuff + 1), vep, cli_readint32(epbuff + 1) + vep + 5);
1724
+            cli_dbgmsg ("MEW: found MEW characteristics %08X + %08X + 5 = %08X\n", 
1725
+                cli_readint32(epbuff + 1), vep, cli_readint32(epbuff + 1) + vep + 5);
1726 1726
 
1727
-	    if(!(tbuff = fmap_need_off_once(map, fileoffset, 0xb0)))
1728
-		break;
1729
-	    if (fileoffset == 0x154) cli_dbgmsg("MEW: Win9x compatibility was set!\n");
1730
-	    else cli_dbgmsg("MEW: Win9x compatibility was NOT set!\n");
1727
+            if(!(tbuff = fmap_need_off_once(map, fileoffset, 0xb0)))
1728
+                break;
1731 1729
 
1732
-	    if((offdiff = cli_readint32(tbuff+1) - EC32(optional_hdr32.ImageBase)) <= exe_sections[i + 1].rva || offdiff >= exe_sections[i + 1].rva + exe_sections[i + 1].raw - 4) {
1733
-	        cli_dbgmsg("MEW: ESI is not in proper section\n");
1734
-		break;
1735
-	    }
1736
-	    offdiff -= exe_sections[i + 1].rva;
1730
+            if (fileoffset == 0x154)
1731
+                cli_dbgmsg("MEW: Win9x compatibility was set!\n");
1732
+            else
1733
+                cli_dbgmsg("MEW: Win9x compatibility was NOT set!\n");
1737 1734
 
1738
-	    if(!exe_sections[i + 1].rsz) {
1739
-		cli_dbgmsg("MEW: mew section is empty\n");
1740
-		break;
1741
-	    }
1742
-	    ssize = exe_sections[i + 1].vsz;
1743
-	    dsize = exe_sections[i].vsz;
1735
+            if((offdiff = cli_readint32(tbuff+1) - EC32(optional_hdr32.ImageBase)) <= exe_sections[i + 1].rva || offdiff >= exe_sections[i + 1].rva + exe_sections[i + 1].raw - 4) {
1736
+                cli_dbgmsg("MEW: ESI is not in proper section\n");
1737
+                break;
1738
+            }
1744 1739
 
1745
-	    cli_dbgmsg("MEW: ssize %08x dsize %08x offdiff: %08x\n", ssize, dsize, offdiff);
1740
+            offdiff -= exe_sections[i + 1].rva;
1746 1741
 
1747
-	    CLI_UNPSIZELIMITS("MEW", MAX(ssize, dsize));
1748
-	    CLI_UNPSIZELIMITS("MEW", MAX(ssize + dsize, exe_sections[i + 1].rsz));
1742
+            if(!exe_sections[i + 1].rsz) {
1743
+                cli_dbgmsg("MEW: mew section is empty\n");
1744
+                break;
1745
+            }
1749 1746
 
1750
-	    if (exe_sections[i + 1].rsz < offdiff + 12 || exe_sections[i + 1].rsz > ssize) {
1751
-	        cli_dbgmsg("MEW: Size mismatch: %08x\n", exe_sections[i + 1].rsz);
1752
-		break;
1753
-	    }
1747
+            ssize = exe_sections[i + 1].vsz;
1748
+            dsize = exe_sections[i].vsz;
1754 1749
 
1755
-	    /* allocate needed buffer */
1756
-	    if (!(src = cli_calloc (ssize + dsize, sizeof(char)))) {
1757
-	        free(exe_sections);
1758
-		return CL_EMEM;
1759
-	    }
1750
+            cli_dbgmsg("MEW: ssize %08x dsize %08x offdiff: %08x\n", ssize, dsize, offdiff);
1760 1751
 
1761
-	    if((bytes = fmap_readn(map, src + dsize, exe_sections[i + 1].raw, exe_sections[i + 1].rsz)) != exe_sections[i + 1].rsz) {
1762
-		cli_dbgmsg("MEW: Can't read %d bytes [read: %lu]\n", exe_sections[i + 1].rsz, (unsigned long)bytes);
1763
-		free(exe_sections);
1764
-		free(src);
1765
-		return CL_EREAD;
1766
-	    }
1767
-	    cli_dbgmsg("MEW: %u (%08x) bytes read\n", (unsigned int)bytes, (unsigned int)bytes);
1768
-
1769
-	    /* count offset to lzma proc, if lzma used, 0xe8 -> call */
1770
-	    if (tbuff[0x7b] == '\xe8') {
1771
-	        if (!CLI_ISCONTAINED(exe_sections[1].rva, exe_sections[1].vsz, cli_readint32(tbuff + 0x7c) + fileoffset + 0x80, 4)) {
1772
-		    cli_dbgmsg("MEW: lzma proc out of bounds!\n");
1773
-		    free(src);
1774
-		    break; /* to next unpacker in chain */
1775
-		}
1776
-		uselzma = cli_readint32(tbuff + 0x7c) - (exe_sections[0].rva - fileoffset - 0x80);
1777
-	    } else {
1778
-	        uselzma = 0;
1779
-	    }
1752
+            CLI_UNPSIZELIMITS("MEW", MAX(ssize, dsize));
1753
+            CLI_UNPSIZELIMITS("MEW", MAX(ssize + dsize, exe_sections[i + 1].rsz));
1754
+
1755
+            if (exe_sections[i + 1].rsz < offdiff + 12 || exe_sections[i + 1].rsz > ssize) {
1756
+                cli_dbgmsg("MEW: Size mismatch: %08x\n", exe_sections[i + 1].rsz);
1757
+                break;
1758
+            }
1759
+
1760
+            /* allocate needed buffer */
1761
+            if (!(src = cli_calloc (ssize + dsize, sizeof(char)))) {
1762
+                free(exe_sections);
1763
+                return CL_EMEM;
1764
+            }
1765
+
1766
+            if((bytes = fmap_readn(map, src + dsize, exe_sections[i + 1].raw, exe_sections[i + 1].rsz)) != exe_sections[i + 1].rsz) {
1767
+                cli_dbgmsg("MEW: Can't read %d bytes [read: %lu]\n", exe_sections[i + 1].rsz, (unsigned long)bytes);
1768
+                free(exe_sections);
1769
+                free(src);
1770
+                return CL_EREAD;
1771
+            }
1772
+
1773
+            cli_dbgmsg("MEW: %u (%08x) bytes read\n", (unsigned int)bytes, (unsigned int)bytes);
1774
+
1775
+            /* count offset to lzma proc, if lzma used, 0xe8 -> call */
1776
+            if (tbuff[0x7b] == '\xe8') {
1777
+                if (!CLI_ISCONTAINED(exe_sections[1].rva, exe_sections[1].vsz, cli_readint32(tbuff + 0x7c) + fileoffset + 0x80, 4)) {
1778
+                    cli_dbgmsg("MEW: lzma proc out of bounds!\n");
1779
+                    free(src);
1780
+                    break; /* to next unpacker in chain */
1781
+                }
1782
+
1783
+                uselzma = cli_readint32(tbuff + 0x7c) - (exe_sections[0].rva - fileoffset - 0x80);
1784
+            } else {
1785
+                uselzma = 0;
1786
+            }
1780 1787
 
1781 1788
 #if HAVE_JSON
1782
-        cli_jsonstr(pe_json, "Packer", "MEW");
1789
+            cli_jsonstr(pe_json, "Packer", "MEW");
1783 1790
 #endif
1784 1791
 
1785
-	    CLI_UNPTEMP("MEW",(src,exe_sections,0));
1786
-	    CLI_UNPRESULTS("MEW",(unmew11(src, offdiff, ssize, dsize, EC32(optional_hdr32.ImageBase), exe_sections[0].rva, uselzma, ndesc)),1,(src,0));
1787
-	    break;
1788
-	}
1792
+            CLI_UNPTEMP("MEW",(src,exe_sections,0));
1793
+            CLI_UNPRESULTS("MEW",(unmew11(src, offdiff, ssize, dsize, EC32(optional_hdr32.ImageBase), exe_sections[0].rva, uselzma, ndesc)),1,(src,0));
1794
+            break;
1795
+        }
1789 1796
     }
1790 1797
 
1791 1798
     if(epsize<168) {
1792
-	free(exe_sections);
1793
-	return CL_CLEAN;
1799
+        free(exe_sections);
1800
+        return CL_CLEAN;
1794 1801
     }
1795 1802
 
1796 1803
     if (found || upack) {
1797
-	/* Check EP for UPX vs. FSG vs. Upack */
1798
-
1799
-	/* Upack 0.39 produces 2 types of executables
1800
-	 * 3 sections:           | 2 sections (one empty, I don't chech found if !upack, since it's in OR above):
1801
-	 *   mov esi, value      |   pusha
1802
-	 *   lodsd               |   call $+0x9
1803
-	 *   push eax            |
1804
-	 *
1805
-	 * Upack 1.1/1.2 Beta produces [based on 2 samples (sUx) provided by aCaB]:
1806
-	 * 2 sections
1807
-	 *   mov esi, value
1808
-	 *   loads
1809
-	 *   mov edi, eax
1810
-	 *
1811
-	 * Upack unknown [sample 0297729]
1812
-	 * 3 sections
1813
-	 *   mov esi, value
1814
-	 *   push [esi]
1815
-	 *   jmp
1816
-	 * 
1817
-	 */
1818
-	/* upack 0.39-3s + sample 0151477*/
1819
- 	while(((upack && nsections == 3) && /* 3 sections */
1820
-	    ((
1821
-	     epbuff[0] == '\xbe' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > min && /* mov esi */
1822
-	     epbuff[5] == '\xad' && epbuff[6] == '\x50' /* lodsd; push eax */
1823
-	     )
1824
-	    || 
1825
-	    /* based on 0297729 sample from aCaB */
1826
-	    (epbuff[0] == '\xbe' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > min && /* mov esi */
1827
-	     epbuff[5] == '\xff' && epbuff[6] == '\x36' /* push [esi] */
1828
-	     )
1829
-	   )) 
1830
-	   ||
1831
-	   ((!upack && nsections == 2) && /* 2 sections */
1832
-	    (( /* upack 0.39-2s */
1833
-	     epbuff[0] == '\x60' && epbuff[1] == '\xe8' && cli_readint32(epbuff+2) == 0x9 /* pusha; call+9 */
1834
-	     )
1835
-	    ||
1836
-	    ( /* upack 1.1/1.2, based on 2 samples */
1837
-	     epbuff[0] == '\xbe' && cli_readint32(epbuff+1) - EC32(optional_hdr32.ImageBase) < min &&  /* mov esi */
1838
-	     cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > 0 &&
1839
-	     epbuff[5] == '\xad' && epbuff[6] == '\x8b' && epbuff[7] == '\xf8' /* loads;  mov edi, eax */
1840
-	     )
1841
-	   ))
1842
-	   ) { 
1843
-	    uint32_t vma, off;
1844
-	    int a,b,c;
1845
-
1846
-	    cli_dbgmsg("Upack characteristics found.\n");
1847
-	    a = exe_sections[0].vsz;
1848
-	    b = exe_sections[1].vsz;
1849
-	    if (upack) {
1850
-	        cli_dbgmsg("Upack: var set\n");
1851
-		c = exe_sections[2].vsz;
1852
-		ssize = exe_sections[0].ursz + exe_sections[0].uraw;
1853
-		off = exe_sections[0].rva;
1854
-		vma = EC32(optional_hdr32.ImageBase) + exe_sections[0].rva;
1855
-	    } else {
1856
-	        cli_dbgmsg("Upack: var NOT set\n");
1857
-		c = exe_sections[1].rva;
1858
-		ssize = exe_sections[1].uraw;
1859
-		off = 0;
1860
-		vma = exe_sections[1].rva - exe_sections[1].uraw;
1861
-	    }
1804
+        /* Check EP for UPX vs. FSG vs. Upack */
1805
+
1806
+        /* Upack 0.39 produces 2 types of executables
1807
+         * 3 sections:           | 2 sections (one empty, I don't chech found if !upack, since it's in OR above):
1808
+         *   mov esi, value      |   pusha
1809
+         *   lodsd               |   call $+0x9
1810
+         *   push eax            |
1811
+         *
1812
+         * Upack 1.1/1.2 Beta produces [based on 2 samples (sUx) provided by aCaB]:
1813
+         * 2 sections
1814
+         *   mov esi, value
1815
+         *   loads
1816
+         *   mov edi, eax
1817
+         *
1818
+         * Upack unknown [sample 0297729]
1819
+         * 3 sections
1820
+         *   mov esi, value
1821
+         *   push [esi]
1822
+         *   jmp
1823
+         * 
1824
+         */
1825
+        /* upack 0.39-3s + sample 0151477*/
1826
+        while(((upack && nsections == 3) && /* 3 sections */
1827
+            ((
1828
+             epbuff[0] == '\xbe' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > min && /* mov esi */
1829
+             epbuff[5] == '\xad' && epbuff[6] == '\x50' /* lodsd; push eax */
1830
+             )
1831
+            || 
1832
+            /* based on 0297729 sample from aCaB */
1833
+            (epbuff[0] == '\xbe' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > min && /* mov esi */
1834
+             epbuff[5] == '\xff' && epbuff[6] == '\x36' /* push [esi] */
1835
+             )
1836
+           )) 
1837
+           ||
1838
+           ((!upack && nsections == 2) && /* 2 sections */
1839
+            (( /* upack 0.39-2s */
1840
+             epbuff[0] == '\x60' && epbuff[1] == '\xe8' && cli_readint32(epbuff+2) == 0x9 /* pusha; call+9 */
1841
+             )
1842
+            ||
1843
+            ( /* upack 1.1/1.2, based on 2 samples */
1844
+             epbuff[0] == '\xbe' && cli_readint32(epbuff+1) - EC32(optional_hdr32.ImageBase) < min &&  /* mov esi */
1845
+             cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) > 0 &&
1846
+             epbuff[5] == '\xad' && epbuff[6] == '\x8b' && epbuff[7] == '\xf8' /* loads;  mov edi, eax */
1847
+             )
1848
+           ))
1849
+           ) { 
1850
+            uint32_t vma, off;
1851
+            int a,b,c;
1852
+
1853
+            cli_dbgmsg("Upack characteristics found.\n");
1854
+            a = exe_sections[0].vsz;
1855
+            b = exe_sections[1].vsz;
1856
+            if (upack) {
1857
+                cli_dbgmsg("Upack: var set\n");
1858
+
1859
+                c = exe_sections[2].vsz;
1860
+                ssize = exe_sections[0].ursz + exe_sections[0].uraw;
1861
+                off = exe_sections[0].rva;
1862
+                vma = EC32(optional_hdr32.ImageBase) + exe_sections[0].rva;
1863
+            } else {
1864
+                cli_dbgmsg("Upack: var NOT set\n");
1865
+                c = exe_sections[1].rva;
1866
+                ssize = exe_sections[1].uraw;
1867
+                off = 0;
1868
+                vma = exe_sections[1].rva - exe_sections[1].uraw;
1869
+            }
1862 1870
 
1863
-	    dsize = a+b+c;
1871
+            dsize = a+b+c;
1864 1872
 
1865
-	    CLI_UNPSIZELIMITS("Upack", MAX(MAX(dsize, ssize), exe_sections[1].ursz));
1873
+            CLI_UNPSIZELIMITS("Upack", MAX(MAX(dsize, ssize), exe_sections[1].ursz));
1866 1874
 
1867
-	    if (!CLI_ISCONTAINED(0, dsize, exe_sections[1].rva - off, exe_sections[1].ursz) || (upack && !CLI_ISCONTAINED(0, dsize, exe_sections[2].rva - exe_sections[0].rva, ssize)) || ssize > dsize) {
1868
-	        cli_dbgmsg("Upack: probably malformed pe-header, skipping to next unpacker\n");
1869
-		break;
1870
-	    }
1871
-			
1872
-	    if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
1873
-	        free(exe_sections);
1874
-		return CL_EMEM;
1875
-	    }
1875
+            if (!CLI_ISCONTAINED(0, dsize, exe_sections[1].rva - off, exe_sections[1].ursz) || (upack && !CLI_ISCONTAINED(0, dsize, exe_sections[2].rva - exe_sections[0].rva, ssize)) || ssize > dsize) {
1876
+                cli_dbgmsg("Upack: probably malformed pe-header, skipping to next unpacker\n");
1877
+                break;
1878
+            }
1879
+                
1880
+            if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
1881
+                free(exe_sections);
1882
+                return CL_EMEM;
1883
+            }
1876 1884
 
1877
-	    if((unsigned int)fmap_readn(map, dest, 0, ssize) != ssize) {
1878
-	        cli_dbgmsg("Upack: Can't read raw data of section 0\n");
1879
-		free(dest);
1880
-		break;
1881
-	    }
1885
+            if((unsigned int)fmap_readn(map, dest, 0, ssize) != ssize) {
1886
+                cli_dbgmsg("Upack: Can't read raw data of section 0\n");
1887
+                free(dest);
1888
+                break;
1889
+            }
1882 1890
 
1883
-	    if(upack) memmove(dest + exe_sections[2].rva - exe_sections[0].rva, dest, ssize);
1891
+            if(upack)
1892
+                memmove(dest + exe_sections[2].rva - exe_sections[0].rva, dest, ssize);
1884 1893
 
1885
-	    if((unsigned int)fmap_readn(map, dest + exe_sections[1].rva - off, exe_sections[1].uraw, exe_sections[1].ursz) != exe_sections[1].ursz) {
1886
-		cli_dbgmsg("Upack: Can't read raw data of section 1\n");
1887
-		free(dest);
1888
-		break;
1889
-	    }
1894
+            if((unsigned int)fmap_readn(map, dest + exe_sections[1].rva - off, exe_sections[1].uraw, exe_sections[1].ursz) != exe_sections[1].ursz) {
1895
+                cli_dbgmsg("Upack: Can't read raw data of section 1\n");
1896
+                free(dest);
1897
+                break;
1898
+            }
1890 1899
 
1891 1900
 #if HAVE_JSON
1892
-        cli_jsonstr(pe_json, "Packer", "Upack");
1901
+            cli_jsonstr(pe_json, "Packer", "Upack");
1893 1902
 #endif
1894 1903
 
1895
-	    CLI_UNPTEMP("Upack",(dest,exe_sections,0));
1896
-	    CLI_UNPRESULTS("Upack",(unupack(upack, dest, dsize, epbuff, vma, ep, EC32(optional_hdr32.ImageBase), exe_sections[0].rva, ndesc)),1,(dest,0));
1897
-	    break;
1898
-	}
1899
-    }
1904
+            CLI_UNPTEMP("Upack",(dest,exe_sections,0));
1905
+            CLI_UNPRESULTS("Upack",(unupack(upack, dest, dsize, epbuff, vma, ep, EC32(optional_hdr32.ImageBase), exe_sections[0].rva, ndesc)),1,(dest,0));
1900 1906
 
1907
+            break;
1908
+        }
1909
+    }
1901 1910
     
1902 1911
     while(found  && (DCONF & PE_CONF_FSG) && epbuff[0] == '\x87' && epbuff[1] == '\x25') {
1903
-	const char *dst;
1912
+        const char *dst;
1913
+        uint32_t newesi, newedi, newebx, newedx;
1904 1914
 
1905
-	/* FSG v2.0 support - thanks to aCaB ! */
1915
+        /* FSG v2.0 support - thanks to aCaB ! */
1916
+        
1917
+        ssize = exe_sections[i + 1].rsz;
1918
+        dsize = exe_sections[i].vsz;
1906 1919
 
1907
-	uint32_t newesi, newedi, newebx, newedx;
1908
-	
1909
-	ssize = exe_sections[i + 1].rsz;
1910
-	dsize = exe_sections[i].vsz;
1920
+        CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
1911 1921
 
1912
-	CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
1913
-
1914
-	if(ssize <= 0x19 || dsize <= ssize) {
1915
-	    cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
1916
-	    free(exe_sections);
1917
-	    return CL_CLEAN;
1918
-	}
1919
-	
1920
-	newedx = cli_readint32(epbuff + 2) - EC32(optional_hdr32.ImageBase);
1921
-	if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newedx, 4)) {
1922
-	    cli_dbgmsg("FSG: xchg out of bounds (%x), giving up\n", newedx);
1923
-	    break;
1924
-	}
1925
-	
1926
-	if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
1927
-	    cli_dbgmsg("Can't read raw data of section %d\n", i + 1);
1928
-	    free(exe_sections);
1929
-	    return CL_ESEEK;
1930
-	}
1922
+        if(ssize <= 0x19 || dsize <= ssize) {
1923
+            cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
1924
+            free(exe_sections);
1925
+            return CL_CLEAN;
1926
+        }
1927
+        
1928
+        newedx = cli_readint32(epbuff + 2) - EC32(optional_hdr32.ImageBase);
1929
+        if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newedx, 4)) {
1930
+            cli_dbgmsg("FSG: xchg out of bounds (%x), giving up\n", newedx);
1931
+            break;
1932
+        }
1933
+        
1934
+        if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
1935
+            cli_dbgmsg("Can't read raw data of section %d\n", i + 1);
1936
+            free(exe_sections);
1937
+            return CL_ESEEK;
1938
+        }
1931 1939
 
1932
-	dst = src + newedx - exe_sections[i + 1].rva;
1933
-	if(newedx < exe_sections[i + 1].rva || !CLI_ISCONTAINED(src, ssize, dst, 4)) {
1934
-	    cli_dbgmsg("FSG: New ESP out of bounds\n");
1935
-	    break;
1936
-	}
1940
+        dst = src + newedx - exe_sections[i + 1].rva;
1941
+        if(newedx < exe_sections[i + 1].rva || !CLI_ISCONTAINED(src, ssize, dst, 4)) {
1942
+            cli_dbgmsg("FSG: New ESP out of bounds\n");
1943
+            break;
1944
+        }
1937 1945
 
1938
-	newedx = cli_readint32(dst) - EC32(optional_hdr32.ImageBase);
1939
-	if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newedx, 4)) {
1940
-	    cli_dbgmsg("FSG: New ESP (%x) is wrong\n", newedx);
1941
-	    break;
1942
-	}
1943
- 
1944
-	dst = src + newedx - exe_sections[i + 1].rva;
1945
-	if(!CLI_ISCONTAINED(src, ssize, dst, 32)) {
1946
-	    cli_dbgmsg("FSG: New stack out of bounds\n");
1947
-	    break;
1948
-	}
1946
+        newedx = cli_readint32(dst) - EC32(optional_hdr32.ImageBase);
1947
+        if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newedx, 4)) {
1948
+            cli_dbgmsg("FSG: New ESP (%x) is wrong\n", newedx);
1949
+            break;
1950
+        }
1951
+     
1952
+        dst = src + newedx - exe_sections[i + 1].rva;
1953
+        if(!CLI_ISCONTAINED(src, ssize, dst, 32)) {
1954
+            cli_dbgmsg("FSG: New stack out of bounds\n");
1955
+            break;
1956
+        }
1949 1957
 
1950
-	newedi = cli_readint32(dst) - EC32(optional_hdr32.ImageBase);
1951
-	newesi = cli_readint32(dst + 4) - EC32(optional_hdr32.ImageBase);
1952
-	newebx = cli_readint32(dst + 16) - EC32(optional_hdr32.ImageBase);
1953
-	newedx = cli_readint32(dst + 20);
1958
+        newedi = cli_readint32(dst) - EC32(optional_hdr32.ImageBase);
1959
+        newesi = cli_readint32(dst + 4) - EC32(optional_hdr32.ImageBase);
1960
+        newebx = cli_readint32(dst + 16) - EC32(optional_hdr32.ImageBase);
1961
+        newedx = cli_readint32(dst + 20);
1954 1962
 
1955
-	if(newedi != exe_sections[i].rva) {
1956
-	    cli_dbgmsg("FSG: Bad destination buffer (edi is %x should be %x)\n", newedi, exe_sections[i].rva);
1957
-	    break;
1958
-	}
1963
+        if(newedi != exe_sections[i].rva) {
1964
+            cli_dbgmsg("FSG: Bad destination buffer (edi is %x should be %x)\n", newedi, exe_sections[i].rva);
1965
+            break;
1966
+        }
1959 1967
 
1960
-	if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].rsz) {
1961
-	    cli_dbgmsg("FSG: Source buffer out of section bounds\n");
1962
-	    break;
1963
-	}
1968
+        if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].rsz) {
1969
+            cli_dbgmsg("FSG: Source buffer out of section bounds\n");
1970
+            break;
1971
+        }
1964 1972
 
1965
-	if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newebx, 16)) {
1966
-	    cli_dbgmsg("FSG: Array of functions out of bounds\n");
1967
-	    break;
1968
-	}
1973
+        if(!CLI_ISCONTAINED(exe_sections[i + 1].rva, exe_sections[i + 1].rsz, newebx, 16)) {
1974
+            cli_dbgmsg("FSG: Array of functions out of bounds\n");
1975
+            break;
1976
+        }
1969 1977
 
1970
-	newedx=cli_readint32(newebx + 12 - exe_sections[i + 1].rva + src) - EC32(optional_hdr32.ImageBase);
1971
-	cli_dbgmsg("FSG: found old EP @%x\n",newedx);
1978
+        newedx=cli_readint32(newebx + 12 - exe_sections[i + 1].rva + src) - EC32(optional_hdr32.ImageBase);
1979
+        cli_dbgmsg("FSG: found old EP @%x\n",newedx);
1972 1980
 
1973
-	if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
1974
-	    free(exe_sections);
1975
-	    return CL_EMEM;
1976
-	}
1981
+        if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
1982
+            free(exe_sections);
1983
+            return CL_EMEM;
1984
+        }
1977 1985
 
1978 1986
 #if HAVE_JSON
1979
-    cli_jsonstr(pe_json, "Packer", "FSG");
1987
+        cli_jsonstr(pe_json, "Packer", "FSG");
1980 1988
 #endif
1981 1989
 
1982
-	CLI_UNPTEMP("FSG",(dest,exe_sections,0));
1983
-	CLI_UNPRESULTSFSG2("FSG",(unfsg_200(newesi - exe_sections[i + 1].rva + src, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, newedi, EC32(optional_hdr32.ImageBase), newedx, ndesc)),1,(dest,0));
1984
-	break;
1990
+        CLI_UNPTEMP("FSG",(dest,exe_sections,0));
1991
+        CLI_UNPRESULTSFSG2("FSG",(unfsg_200(newesi - exe_sections[i + 1].rva + src, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, newedi, EC32(optional_hdr32.ImageBase), newedx, ndesc)),1,(dest,0));
1992
+        break;
1985 1993
     }
1986 1994
 
1987 1995
 
1988 1996
     while(found && (DCONF & PE_CONF_FSG) && epbuff[0] == '\xbe' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) < min) {
1997
+        int sectcnt = 0;
1998
+        const char *support;
1999
+        uint32_t newesi, newedi, oldep, gp, t;
2000
+        struct cli_exe_section *sections;
1989 2001
 
1990
-	/* FSG support - v. 1.33 (thx trog for the many samples) */
1991
-
1992
-	int sectcnt = 0;
1993
-	const char *support;
1994
-	uint32_t newesi, newedi, oldep, gp, t;
1995
-	struct cli_exe_section *sections;
2002
+        /* FSG support - v. 1.33 (thx trog for the many samples) */
1996 2003
 
1997
-	ssize = exe_sections[i + 1].rsz;
1998
-	dsize = exe_sections[i].vsz;
2004
+        ssize = exe_sections[i + 1].rsz;
2005
+        dsize = exe_sections[i].vsz;
1999 2006
 
2000
-	CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
2007
+        CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
2001 2008
 
2002
-	if(ssize <= 0x19 || dsize <= ssize) {
2003
-	    cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
2004
-	    free(exe_sections);
2005
-	    return CL_CLEAN;
2006
-	}
2009
+        if(ssize <= 0x19 || dsize <= ssize) {
2010
+            cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
2011
+            free(exe_sections);
2012
+            return CL_CLEAN;
2013
+        }
2007 2014
 
2008
-	if(!(t = cli_rawaddr(cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase), NULL, 0 , &err, fsize, hdr_size)) && err ) {
2009
-	    cli_dbgmsg("FSG: Support data out of padding area\n");
2010
-	    break;
2011
-	}
2015
+        if(!(t = cli_rawaddr(cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase), NULL, 0 , &err, fsize, hdr_size)) && err ) {
2016
+            cli_dbgmsg("FSG: Support data out of padding area\n");
2017
+            break;
2018
+        }
2012 2019
 
2013
-	gp = exe_sections[i + 1].raw - t;
2020
+        gp = exe_sections[i + 1].raw - t;
2014 2021
 
2015
-	CLI_UNPSIZELIMITS("FSG", gp);
2022
+        CLI_UNPSIZELIMITS("FSG", gp);
2016 2023
 
2017
-	if(!(support = fmap_need_off_once(map, t, gp))) {
2018
-	    cli_dbgmsg("Can't read %d bytes from padding area\n", gp); 
2019
-	    free(exe_sections);
2020
-	    return CL_EREAD;
2021
-	}
2024
+        if(!(support = fmap_need_off_once(map, t, gp))) {
2025
+            cli_dbgmsg("Can't read %d bytes from padding area\n", gp); 
2026
+            free(exe_sections);
2027
+            return CL_EREAD;
2028
+        }
2022 2029
 
2023
-	/* newebx = cli_readint32(support) - EC32(optional_hdr32.ImageBase);  Unused */
2024
-	newedi = cli_readint32(support + 4) - EC32(optional_hdr32.ImageBase); /* 1st dest */
2025
-	newesi = cli_readint32(support + 8) - EC32(optional_hdr32.ImageBase); /* Source */
2030
+        /* newebx = cli_readint32(support) - EC32(optional_hdr32.ImageBase);  Unused */
2031
+        newedi = cli_readint32(support + 4) - EC32(optional_hdr32.ImageBase); /* 1st dest */
2032
+        newesi = cli_readint32(support + 8) - EC32(optional_hdr32.ImageBase); /* Source */
2026 2033
 
2027
-	if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].rsz) {
2028
-	    cli_dbgmsg("FSG: Source buffer out of section bounds\n");
2029
-	    break;
2030
-	}
2034
+        if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].rsz) {
2035
+            cli_dbgmsg("FSG: Source buffer out of section bounds\n");
2036
+            break;
2037
+        }
2031 2038
 
2032
-	if(newedi != exe_sections[i].rva) {
2033
-	    cli_dbgmsg("FSG: Bad destination (is %x should be %x)\n", newedi, exe_sections[i].rva);
2034
-	    break;
2035
-	}
2039
+        if(newedi != exe_sections[i].rva) {
2040
+            cli_dbgmsg("FSG: Bad destination (is %x should be %x)\n", newedi, exe_sections[i].rva);
2041
+            break;
2042
+        }
2036 2043
 
2037
-	/* Counting original sections */
2038
-	for(t = 12; t < gp - 4; t += 4) {
2039
-	    uint32_t rva = cli_readint32(support+t);
2044
+        /* Counting original sections */
2045
+        for(t = 12; t < gp - 4; t += 4) {
2046
+            uint32_t rva = cli_readint32(support+t);
2040 2047
 
2041
-	    if(!rva)
2042
-		break;
2048
+            if(!rva)
2049
+                break;
2043 2050
 
2044
-	    rva -= EC32(optional_hdr32.ImageBase)+1;
2045
-	    sectcnt++;
2051
+            rva -= EC32(optional_hdr32.ImageBase)+1;
2052
+            sectcnt++;
2046 2053
 
2047
-	    if(rva % 0x1000) cli_dbgmsg("FSG: Original section %d is misaligned\n", sectcnt);
2054
+            if(rva % 0x1000)
2055
+                cli_dbgmsg("FSG: Original section %d is misaligned\n", sectcnt);
2048 2056
 
2049
-	    if(rva < exe_sections[i].rva || rva - exe_sections[i].rva >= exe_sections[i].vsz) {
2050
-		cli_dbgmsg("FSG: Original section %d is out of bounds\n", sectcnt);
2051
-		break;
2052
-	    }
2053
-	}
2057
+            if(rva < exe_sections[i].rva || rva - exe_sections[i].rva >= exe_sections[i].vsz) {
2058
+                cli_dbgmsg("FSG: Original section %d is out of bounds\n", sectcnt);
2059
+                break;
2060
+            }
2061
+        }
2054 2062
 
2055
-	if(t >= gp - 4 || cli_readint32(support + t)) {
2056
-	    break;
2057
-	}
2063
+        if(t >= gp - 4 || cli_readint32(support + t)) {
2064
+            break;
2065
+        }
2058 2066
 
2059
-	if((sections = (struct cli_exe_section *) cli_malloc((sectcnt + 1) * sizeof(struct cli_exe_section))) == NULL) {
2060
-        cli_errmsg("FSG: Unable to allocate memory for sections %lu\n", (sectcnt + 1) * sizeof(struct cli_exe_section));
2061
-	    free(exe_sections);
2062
-	    return CL_EMEM;
2063
-	}
2067
+        if((sections = (struct cli_exe_section *) cli_malloc((sectcnt + 1) * sizeof(struct cli_exe_section))) == NULL) {
2068
+            cli_errmsg("FSG: Unable to allocate memory for sections %lu\n", (sectcnt + 1) * sizeof(struct cli_exe_section));
2069
+            free(exe_sections);
2070
+            return CL_EMEM;
2071
+        }
2064 2072
 
2065
-	sections[0].rva = newedi;
2066
-	for(t = 1; t <= (uint32_t)sectcnt; t++)
2067
-	    sections[t].rva = cli_readint32(support + 8 + t * 4) - 1 - EC32(optional_hdr32.ImageBase);
2073
+        sections[0].rva = newedi;
2074
+        for(t = 1; t <= (uint32_t)sectcnt; t++)
2075
+            sections[t].rva = cli_readint32(support + 8 + t * 4) - 1 - EC32(optional_hdr32.ImageBase);
2068 2076
 
2069
-	if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2070
-	    cli_dbgmsg("Can't read raw data of section %d\n", i);
2071
-	    free(exe_sections);
2072
-	    free(sections);
2073
-	    return CL_EREAD;
2074
-	}
2077
+        if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2078
+            cli_dbgmsg("Can't read raw data of section %d\n", i);
2079
+            free(exe_sections);
2080
+            free(sections);
2081
+            return CL_EREAD;
2082
+        }
2075 2083
 
2076
-	if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2077
-	    free(exe_sections);
2078
-	    free(sections);
2079
-	    return CL_EMEM;
2080
-	}
2084
+        if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2085
+            free(exe_sections);
2086
+            free(sections);
2087
+            return CL_EMEM;
2088
+        }
2081 2089
 
2082
-	oldep = vep + 161 + 6 + cli_readint32(epbuff+163);
2083
-	cli_dbgmsg("FSG: found old EP @%x\n", oldep);
2090
+        oldep = vep + 161 + 6 + cli_readint32(epbuff+163);
2091
+        cli_dbgmsg("FSG: found old EP @%x\n", oldep);
2084 2092
 
2085 2093
 #if HAVE_JSON
2086
-    cli_jsonstr(pe_json, "Packer", "FSG");
2094
+        cli_jsonstr(pe_json, "Packer", "FSG");
2087 2095
 #endif
2088 2096
 
2089
-	CLI_UNPTEMP("FSG",(dest,sections,exe_sections,0));
2090
-	CLI_UNPRESULTSFSG1("FSG",(unfsg_133(src + newesi - exe_sections[i + 1].rva, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, sections, sectcnt, EC32(optional_hdr32.ImageBase), oldep, ndesc)),1,(dest,sections,0));
2091
-	break; /* were done with 1.33 */
2097
+        CLI_UNPTEMP("FSG",(dest,sections,exe_sections,0));
2098
+        CLI_UNPRESULTSFSG1("FSG",(unfsg_133(src + newesi - exe_sections[i + 1].rva, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, sections, sectcnt, EC32(optional_hdr32.ImageBase), oldep, ndesc)),1,(dest,sections,0));
2099
+        break; /* were done with 1.33 */
2092 2100
     }
2093 2101
 
2094
-
2095 2102
     while(found && (DCONF & PE_CONF_FSG) && epbuff[0] == '\xbb' && cli_readint32(epbuff + 1) - EC32(optional_hdr32.ImageBase) < min && epbuff[5] == '\xbf' && epbuff[10] == '\xbe' && vep >= exe_sections[i + 1].rva && vep - exe_sections[i + 1].rva > exe_sections[i + 1].rva - 0xe0 ) {
2103
+        int sectcnt = 0;
2104
+        uint32_t gp, t = cli_rawaddr(cli_readint32(epbuff+1) - EC32(optional_hdr32.ImageBase), NULL, 0 , &err, fsize, hdr_size);
2105
+        const char *support;
2106
+        uint32_t newesi = cli_readint32(epbuff+11) - EC32(optional_hdr32.ImageBase);
2107
+        uint32_t newedi = cli_readint32(epbuff+6) - EC32(optional_hdr32.ImageBase);
2108
+        uint32_t oldep = vep - exe_sections[i + 1].rva;
2109
+        struct cli_exe_section *sections;
2096 2110
 
2097
-	/* FSG support - v. 1.31 */
2098
-
2099
-	int sectcnt = 0;
2100
-	uint32_t gp, t = cli_rawaddr(cli_readint32(epbuff+1) - EC32(optional_hdr32.ImageBase), NULL, 0 , &err, fsize, hdr_size);
2101
-	const char *support;
2102
-	uint32_t newesi = cli_readint32(epbuff+11) - EC32(optional_hdr32.ImageBase);
2103
-	uint32_t newedi = cli_readint32(epbuff+6) - EC32(optional_hdr32.ImageBase);
2104
-	uint32_t oldep = vep - exe_sections[i + 1].rva;
2105
-	struct cli_exe_section *sections;
2111
+        /* FSG support - v. 1.31 */
2106 2112
 
2107
-	ssize = exe_sections[i + 1].rsz;
2108
-	dsize = exe_sections[i].vsz;
2113
+        ssize = exe_sections[i + 1].rsz;
2114
+        dsize = exe_sections[i].vsz;
2109 2115
 
2110
-	if(err) {
2111
-	    cli_dbgmsg("FSG: Support data out of padding area\n");
2112
-	    break;
2113
-	}
2116
+        if(err) {
2117
+            cli_dbgmsg("FSG: Support data out of padding area\n");
2118
+            break;
2119
+        }
2114 2120
 
2115
-	if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].raw) {
2116
-	    cli_dbgmsg("FSG: Source buffer out of section bounds\n");
2117
-	    break;
2118
-	}
2121
+        if(newesi < exe_sections[i + 1].rva || newesi - exe_sections[i + 1].rva >= exe_sections[i + 1].raw) {
2122
+            cli_dbgmsg("FSG: Source buffer out of section bounds\n");
2123
+            break;
2124
+        }
2119 2125
 
2120
-	if(newedi != exe_sections[i].rva) {
2121
-	    cli_dbgmsg("FSG: Bad destination (is %x should be %x)\n", newedi, exe_sections[i].rva);
2122
-	    break;
2123
-	}
2126
+        if(newedi != exe_sections[i].rva) {
2127
+            cli_dbgmsg("FSG: Bad destination (is %x should be %x)\n", newedi, exe_sections[i].rva);
2128
+            break;
2129
+        }
2124 2130
 
2125
-	CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
2131
+        CLI_UNPSIZELIMITS("FSG", MAX(dsize, ssize));
2126 2132
 
2127
-	if(ssize <= 0x19 || dsize <= ssize) {
2128
-	    cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
2129
-	    free(exe_sections);
2130
-	    return CL_CLEAN;
2131
-	}
2133
+        if(ssize <= 0x19 || dsize <= ssize) {
2134
+            cli_dbgmsg("FSG: Size mismatch (ssize: %d, dsize: %d)\n", ssize, dsize);
2135
+            free(exe_sections);
2136
+            return CL_CLEAN;
2137
+        }
2132 2138
 
2133
-	gp = exe_sections[i + 1].raw - t;
2139
+        gp = exe_sections[i + 1].raw - t;
2134 2140
 
2135
-	CLI_UNPSIZELIMITS("FSG", gp)
2141
+        CLI_UNPSIZELIMITS("FSG", gp)
2136 2142
 
2137
-	if(!(support = fmap_need_off_once(map, t, gp))) {
2138
-	    cli_dbgmsg("Can't read %d bytes from padding area\n", gp); 
2139
-	    free(exe_sections);
2140
-	    return CL_EREAD;
2141
-	}
2143
+        if(!(support = fmap_need_off_once(map, t, gp))) {
2144
+            cli_dbgmsg("Can't read %d bytes from padding area\n", gp); 
2145
+            free(exe_sections);
2146
+            return CL_EREAD;
2147
+        }
2142 2148
 
2143
-	/* Counting original sections */
2144
-	for(t = 0; t < gp - 2; t += 2) {
2145
-	    uint32_t rva = support[t]|(support[t+1]<<8);
2149
+        /* Counting original sections */
2150
+        for(t = 0; t < gp - 2; t += 2) {
2151
+            uint32_t rva = support[t]|(support[t+1]<<8);
2146 2152
 
2147
-	    if (rva == 2 || rva == 1)
2148
-		break;
2153
+            if (rva == 2 || rva == 1)
2154
+                break;
2149 2155
 
2150
-	    rva = ((rva-2)<<12) - EC32(optional_hdr32.ImageBase);
2151
-	    sectcnt++;
2156
+            rva = ((rva-2)<<12) - EC32(optional_hdr32.ImageBase);
2157
+            sectcnt++;
2152 2158
 
2153
-	    if(rva < exe_sections[i].rva || rva - exe_sections[i].rva >= exe_sections[i].vsz) {
2154
-		cli_dbgmsg("FSG: Original section %d is out of bounds\n", sectcnt);
2155
-		break;
2156
-	    }
2157
-	}
2159
+            if(rva < exe_sections[i].rva || rva - exe_sections[i].rva >= exe_sections[i].vsz) {
2160
+                cli_dbgmsg("FSG: Original section %d is out of bounds\n", sectcnt);
2161
+                break;
2162
+            }
2163
+        }
2158 2164
 
2159
-	if(t >= gp-10 || cli_readint32(support + t + 6) != 2) {
2160
-	    break;
2161
-	}
2165
+        if(t >= gp-10 || cli_readint32(support + t + 6) != 2)
2166
+            break;
2162 2167
 
2163
-	if((sections = (struct cli_exe_section *) cli_malloc((sectcnt + 1) * sizeof(struct cli_exe_section))) == NULL) {
2164
-        cli_errmsg("FSG: Unable to allocate memory for sections %lu\n", (sectcnt + 1) * sizeof(struct cli_exe_section));
2165
-	    free(exe_sections);
2166
-	    return CL_EMEM;
2167
-	}
2168
+        if((sections = (struct cli_exe_section *) cli_malloc((sectcnt + 1) * sizeof(struct cli_exe_section))) == NULL) {
2169
+            cli_errmsg("FSG: Unable to allocate memory for sections %lu\n", (sectcnt + 1) * sizeof(struct cli_exe_section));
2170
+            free(exe_sections);
2171
+            return CL_EMEM;
2172
+        }
2168 2173
 
2169
-	sections[0].rva = newedi;
2170
-	for(t = 0; t <= (uint32_t)sectcnt - 1; t++) {
2171
-	    sections[t+1].rva = (((support[t*2]|(support[t*2+1]<<8))-2)<<12)-EC32(optional_hdr32.ImageBase);
2172
-	}
2174
+        sections[0].rva = newedi;
2175
+        for(t = 0; t <= (uint32_t)sectcnt - 1; t++)
2176
+            sections[t+1].rva = (((support[t*2]|(support[t*2+1]<<8))-2)<<12)-EC32(optional_hdr32.ImageBase);
2173 2177
 
2174
-	if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2175
-	    cli_dbgmsg("FSG: Can't read raw data of section %d\n", i);
2176
-	    free(exe_sections);
2177
-	    free(sections);
2178
-	    return CL_EREAD;
2179
-	}
2178
+        if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2179
+            cli_dbgmsg("FSG: Can't read raw data of section %d\n", i);
2180
+            free(exe_sections);
2181
+            free(sections);
2182
+            return CL_EREAD;
2183
+        }
2180 2184
 
2181
-	if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2182
-	    free(exe_sections);
2183
-	    free(sections);
2184
-	    return CL_EMEM;
2185
-	}
2185
+        if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2186
+            free(exe_sections);
2187
+            free(sections);
2188
+            return CL_EMEM;
2189
+        }
2186 2190
 
2187
-	gp = 0xda + 6*(epbuff[16]=='\xe8');
2188
-	oldep = vep + gp + 6 + cli_readint32(src+gp+2+oldep);
2189
-	cli_dbgmsg("FSG: found old EP @%x\n", oldep);
2191
+        gp = 0xda + 6*(epbuff[16]=='\xe8');
2192
+        oldep = vep + gp + 6 + cli_readint32(src+gp+2+oldep);
2193
+        cli_dbgmsg("FSG: found old EP @%x\n", oldep);
2190 2194
 
2191 2195
 #if HAVE_JSON
2192
-    cli_jsonstr(pe_json, "Packer", "FSG");
2196
+        cli_jsonstr(pe_json, "Packer", "FSG");
2193 2197
 #endif
2194 2198
 
2195
-	CLI_UNPTEMP("FSG",(dest,sections,exe_sections,0));
2196
-	CLI_UNPRESULTSFSG1("FSG",(unfsg_133(src + newesi - exe_sections[i + 1].rva, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, sections, sectcnt, EC32(optional_hdr32.ImageBase), oldep, ndesc)),1,(dest,sections,0));
2197
-	break; /* were done with 1.31 */
2199
+        CLI_UNPTEMP("FSG",(dest,sections,exe_sections,0));
2200
+        CLI_UNPRESULTSFSG1("FSG",(unfsg_133(src + newesi - exe_sections[i + 1].rva, dest, ssize + exe_sections[i + 1].rva - newesi, dsize, sections, sectcnt, EC32(optional_hdr32.ImageBase), oldep, ndesc)),1,(dest,sections,0));
2201
+
2202
+        break; /* were done with 1.31 */
2198 2203
     }
2199 2204
 
2200 2205
 
2201 2206
     if(found && (DCONF & PE_CONF_UPX)) {
2207
+        ssize = exe_sections[i + 1].rsz;
2208
+        dsize = exe_sections[i].vsz + exe_sections[i + 1].vsz;
2202 2209
 
2203
-	/* UPX support */
2210
+        /* 
2211
+         * UPX support
2212
+         * we assume (i + 1) is UPX1
2213
+         */
2204 2214
 
2205
-	/* we assume (i + 1) is UPX1 */
2206
-	ssize = exe_sections[i + 1].rsz;
2207
-	dsize = exe_sections[i].vsz + exe_sections[i + 1].vsz;
2215
+            /* cli_dbgmsg("UPX: ssize %u dsize %u\n", ssize, dsize); */
2208 2216
 
2209
-        /* cli_dbgmsg("UPX: ssize %u dsize %u\n", ssize, dsize); */
2217
+        CLI_UNPSIZELIMITS("UPX", MAX(dsize, ssize));
2210 2218
 
2211
-	CLI_UNPSIZELIMITS("UPX", MAX(dsize, ssize));
2219
+        if(ssize <= 0x19 || dsize <= ssize || dsize > CLI_MAX_ALLOCATION ) {
2220
+            cli_dbgmsg("UPX: Size mismatch or dsize too big (ssize: %d, dsize: %d)\n", ssize, dsize);
2221
+            free(exe_sections);
2222
+            return CL_CLEAN;
2223
+        }
2212 2224
 
2213
-	if(ssize <= 0x19 || dsize <= ssize || dsize > CLI_MAX_ALLOCATION ) {
2214
-	    cli_dbgmsg("UPX: Size mismatch or dsize too big (ssize: %d, dsize: %d)\n", ssize, dsize);
2215
-	    free(exe_sections);
2216
-	    return CL_CLEAN;
2217
-	}
2225
+        if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2226
+            cli_dbgmsg("UPX: Can't read raw data of section %d\n", i+1);
2227
+            free(exe_sections);
2228
+            return CL_EREAD;
2229
+        }
2218 2230
 
2219
-	if(!exe_sections[i + 1].rsz || !(src = fmap_need_off_once(map, exe_sections[i + 1].raw, ssize))) {
2220
-	    cli_dbgmsg("UPX: Can't read raw data of section %d\n", i+1);
2221
-	    free(exe_sections);
2222
-	    return CL_EREAD;
2223
-	}
2231
+        if((dest = (char *) cli_calloc(dsize + 8192, sizeof(char))) == NULL) {
2232
+            free(exe_sections);
2233
+            return CL_EMEM;
2234
+        }
2224 2235
 
2225
-	if((dest = (char *) cli_calloc(dsize + 8192, sizeof(char))) == NULL) {
2226
-	    free(exe_sections);
2227
-	    return CL_EMEM;
2228
-	}
2236
+        /* try to detect UPX code */
2237
+        if(cli_memstr(UPX_NRV2B, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2B, 24, epbuff + 0x69 + 8, 13)) {
2238
+            cli_dbgmsg("UPX: Looks like a NRV2B decompression routine\n");
2239
+            upxfn = upx_inflate2b;
2240
+        } else if(cli_memstr(UPX_NRV2D, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2D, 24, epbuff + 0x69 + 8, 13)) {
2241
+            cli_dbgmsg("UPX: Looks like a NRV2D decompression routine\n");
2242
+            upxfn = upx_inflate2d;
2243
+        } else if(cli_memstr(UPX_NRV2E, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2E, 24, epbuff + 0x69 + 8, 13)) {
2244
+            cli_dbgmsg("UPX: Looks like a NRV2E decompression routine\n");
2245
+            upxfn = upx_inflate2e;
2246
+        }
2229 2247
 
2230
-	/* try to detect UPX code */
2231
-	if(cli_memstr(UPX_NRV2B, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2B, 24, epbuff + 0x69 + 8, 13)) {
2232
-	    cli_dbgmsg("UPX: Looks like a NRV2B decompression routine\n");
2233
-	    upxfn = upx_inflate2b;
2234
-	} else if(cli_memstr(UPX_NRV2D, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2D, 24, epbuff + 0x69 + 8, 13)) {
2235
-	    cli_dbgmsg("UPX: Looks like a NRV2D decompression routine\n");
2236
-	    upxfn = upx_inflate2d;
2237
-	} else if(cli_memstr(UPX_NRV2E, 24, epbuff + 0x69, 13) || cli_memstr(UPX_NRV2E, 24, epbuff + 0x69 + 8, 13)) {
2238
-	    cli_dbgmsg("UPX: Looks like a NRV2E decompression routine\n");
2239
-	    upxfn = upx_inflate2e;
2240
-	}
2248
+        if(upxfn) {
2249
+            int skew = cli_readint32(epbuff + 2) - EC32(optional_hdr32.ImageBase) - exe_sections[i + 1].rva;
2241 2250
 
2242
-	if(upxfn) {
2243
-	    int skew = cli_readint32(epbuff + 2) - EC32(optional_hdr32.ImageBase) - exe_sections[i + 1].rva;
2251
+            if(epbuff[1] != '\xbe' || skew <= 0 || skew > 0xfff) {
2252
+                /* FIXME: legit skews?? */
2253
+                skew = 0; 
2254
+            } else if ((unsigned int)skew > ssize) {
2255
+                /* Ignore suggested skew larger than section size */
2256
+                skew = 0;
2257
+            } else {
2258
+                cli_dbgmsg("UPX: UPX1 seems skewed by %d bytes\n", skew);
2259
+            }
2244 2260
 
2245
-	    if(epbuff[1] != '\xbe' || skew <= 0 || skew > 0xfff) { /* FIXME: legit skews?? */
2246
-		skew = 0; 
2247
-	    } else if ((unsigned int)skew > ssize) {
2248
-		/* Ignore suggested skew larger than section size */
2249
-		skew = 0;
2250
-	    } else {
2251
-		cli_dbgmsg("UPX: UPX1 seems skewed by %d bytes\n", skew);
2252
-	    }
2261
+            /* Try skewed first (skew may be zero) */
2262
+            if(upxfn(src + skew, ssize - skew, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep-skew) >= 0) {
2263
+                upx_success = 1;
2264
+            }
2265
+            /* If skew not successful and non-zero, try no skew */
2266
+            else if(skew && (upxfn(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >= 0)) {
2267
+                upx_success = 1;
2268
+            }
2253 2269
 
2254
-	    /* Try skewed first (skew may be zero) */
2255
-	    if(upxfn(src + skew, ssize - skew, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep-skew) >= 0) {
2256
-		upx_success = 1;
2257
-	    }
2258
-	    /* If skew not successful and non-zero, try no skew */
2259
-	    else if(skew && (upxfn(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >= 0)) {
2260
-		upx_success = 1;
2261
-	    }
2270
+            if(upx_success)
2271
+                cli_dbgmsg("UPX: Successfully decompressed\n");
2272
+            else
2273
+                cli_dbgmsg("UPX: Preferred decompressor failed\n");
2274
+        }
2262 2275
 
2263
-	    if(upx_success)
2264
-		cli_dbgmsg("UPX: Successfully decompressed\n");
2265
-	    else
2266
-		cli_dbgmsg("UPX: Preferred decompressor failed\n");
2267
-	}
2276
+        if(!upx_success && upxfn != upx_inflate2b) {
2277
+            if(upx_inflate2b(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2b(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2268 2278
 
2269
-	if(!upx_success && upxfn != upx_inflate2b) {
2270
-	    if(upx_inflate2b(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2b(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2279
+                cli_dbgmsg("UPX: NRV2B decompressor failed\n");
2280
+            } else {
2281
+                upx_success = 1;
2282
+                cli_dbgmsg("UPX: Successfully decompressed with NRV2B\n");
2283
+            }
2284
+        }
2271 2285
 
2272
-		cli_dbgmsg("UPX: NRV2B decompressor failed\n");
2273
-	    } else {
2274
-		upx_success = 1;
2275
-		cli_dbgmsg("UPX: Successfully decompressed with NRV2B\n");
2276
-	    }
2277
-	}
2286
+        if(!upx_success && upxfn != upx_inflate2d) {
2287
+            if(upx_inflate2d(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2d(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2278 2288
 
2279
-	if(!upx_success && upxfn != upx_inflate2d) {
2280
-	    if(upx_inflate2d(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2d(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2289
+                cli_dbgmsg("UPX: NRV2D decompressor failed\n");
2290
+            } else {
2291
+                upx_success = 1;
2292
+                cli_dbgmsg("UPX: Successfully decompressed with NRV2D\n");
2293
+            }
2294
+        }
2281 2295
 
2282
-		cli_dbgmsg("UPX: NRV2D decompressor failed\n");
2283
-	    } else {
2284
-		upx_success = 1;
2285
-		cli_dbgmsg("UPX: Successfully decompressed with NRV2D\n");
2286
-	    }
2287
-	}
2296
+        if(!upx_success && upxfn != upx_inflate2e) {
2297
+            if(upx_inflate2e(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2e(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2298
+                cli_dbgmsg("UPX: NRV2E decompressor failed\n");
2299
+            } else {
2300
+                upx_success = 1;
2301
+                cli_dbgmsg("UPX: Successfully decompressed with NRV2E\n");
2302
+            }
2303
+        }
2288 2304
 
2289
-	if(!upx_success && upxfn != upx_inflate2e) {
2290
-	    if(upx_inflate2e(src, ssize, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) == -1 && upx_inflate2e(src + 0x15, ssize - 0x15, dest, &dsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep - 0x15) == -1) {
2291
-		cli_dbgmsg("UPX: NRV2E decompressor failed\n");
2292
-	    } else {
2293
-		upx_success = 1;
2294
-		cli_dbgmsg("UPX: Successfully decompressed with NRV2E\n");
2295
-	    }
2296
-	}
2305
+        if(cli_memstr(UPX_LZMA2, 20, epbuff + 0x2f, 20)) {
2306
+            uint32_t strictdsize=cli_readint32(epbuff+0x21), skew = 0;
2307
+            if(ssize > 0x15 && epbuff[0] == '\x60' && epbuff[1] == '\xbe') {
2308
+                skew = cli_readint32(epbuff+2) - exe_sections[i + 1].rva - optional_hdr32.ImageBase;
2309
+                if(skew!=0x15)
2310
+                    skew = 0;
2311
+            }
2297 2312
 
2298
-	if(cli_memstr(UPX_LZMA2, 20, epbuff + 0x2f, 20)) {
2299
-	    uint32_t strictdsize=cli_readint32(epbuff+0x21), skew = 0;
2300
-	    if(ssize > 0x15 && epbuff[0] == '\x60' && epbuff[1] == '\xbe') {
2301
-		skew = cli_readint32(epbuff+2) - exe_sections[i + 1].rva - optional_hdr32.ImageBase;
2302
-		if(skew!=0x15) skew = 0;
2303
-	    }
2304
-	    if(strictdsize<=dsize)
2305
-		upx_success = upx_inflatelzma(src+skew, ssize-skew, dest, &strictdsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >=0;
2306
-	} else if (cli_memstr(UPX_LZMA1, 20, epbuff + 0x39, 20)) {
2307
-	    uint32_t strictdsize=cli_readint32(epbuff+0x2b), skew = 0;
2308
-	    if(ssize > 0x15 && epbuff[0] == '\x60' && epbuff[1] == '\xbe') {
2309
-		skew = cli_readint32(epbuff+2) - exe_sections[i + 1].rva - optional_hdr32.ImageBase;
2310
-		if(skew!=0x15) skew = 0;
2311
-	    }
2312
-	    if(strictdsize<=dsize)
2313
-		upx_success = upx_inflatelzma(src+skew, ssize-skew, dest, &strictdsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >=0;
2314
-	}
2313
+            if(strictdsize<=dsize)
2314
+                upx_success = upx_inflatelzma(src+skew, ssize-skew, dest, &strictdsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >=0;
2315
+        } else if (cli_memstr(UPX_LZMA1, 20, epbuff + 0x39, 20)) {
2316
+            uint32_t strictdsize=cli_readint32(epbuff+0x2b), skew = 0;
2317
+            if(ssize > 0x15 && epbuff[0] == '\x60' && epbuff[1] == '\xbe') {
2318
+                skew = cli_readint32(epbuff+2) - exe_sections[i + 1].rva - optional_hdr32.ImageBase;
2319
+                if(skew!=0x15)
2320
+                    skew = 0;
2321
+            }
2315 2322
 
2316
-	if(!upx_success) {
2317
-	    cli_dbgmsg("UPX: All decompressors failed\n");
2318
-	    free(dest);
2319
-	}
2323
+            if(strictdsize<=dsize)
2324
+                upx_success = upx_inflatelzma(src+skew, ssize-skew, dest, &strictdsize, exe_sections[i].rva, exe_sections[i + 1].rva, vep) >=0;
2325
+        }
2326
+
2327
+        if(!upx_success) {
2328
+            cli_dbgmsg("UPX: All decompressors failed\n");
2329
+            free(dest);
2330
+        }
2320 2331
     }
2321 2332
 
2322 2333
     if(upx_success) {
2323
-	free(exe_sections);
2334
+        free(exe_sections);
2324 2335
 
2325
-	CLI_UNPTEMP("UPX/FSG",(dest,0));
2336
+        CLI_UNPTEMP("UPX/FSG",(dest,0));
2326 2337
 #if HAVE_JSON
2327
-    cli_jsonstr(pe_json, "Packer", "UPX");
2338
+        cli_jsonstr(pe_json, "Packer", "UPX");
2328 2339
 #endif
2329 2340
 
2330
-	if((unsigned int) write(ndesc, dest, dsize) != dsize) {
2331
-	    cli_dbgmsg("UPX/FSG: Can't write %d bytes\n", dsize);
2332
-	    free(tempfile);
2333
-	    free(dest);
2334
-	    close(ndesc);
2335
-	    return CL_EWRITE;
2336
-	}
2341
+        if((unsigned int) write(ndesc, dest, dsize) != dsize) {
2342
+            cli_dbgmsg("UPX/FSG: Can't write %d bytes\n", dsize);
2343
+            free(tempfile);
2344
+            free(dest);
2345
+            close(ndesc);
2346
+            return CL_EWRITE;
2347
+        }
2337 2348
 
2338
-	free(dest);
2339
-	if (lseek(ndesc, 0, SEEK_SET) == -1) {
2340
-        cli_dbgmsg("UPX/FSG: lseek() failed\n");
2341
-        close(ndesc);
2342
-        CLI_TMPUNLK();
2343
-        free(tempfile);
2344
-        SHA_RESET;
2345
-        return CL_ESEEK;
2346
-    }
2349
+        free(dest);
2350
+        if (lseek(ndesc, 0, SEEK_SET) == -1) {
2351
+            cli_dbgmsg("UPX/FSG: lseek() failed\n");
2352
+            close(ndesc);
2353
+            CLI_TMPUNLK();
2354
+            free(tempfile);
2355
+            SHA_RESET;
2356
+            return CL_ESEEK;
2357
+        }
2347 2358
 
2348
-	if(ctx->engine->keeptmp)
2349
-	    cli_dbgmsg("UPX/FSG: Decompressed data saved in %s\n", tempfile);
2359
+        if(ctx->engine->keeptmp)
2360
+            cli_dbgmsg("UPX/FSG: Decompressed data saved in %s\n", tempfile);
2350 2361
 
2351
-	cli_dbgmsg("***** Scanning decompressed file *****\n");
2352
-	SHA_OFF;
2353
-	if((ret = cli_magic_scandesc(ndesc, ctx)) == CL_VIRUS) {
2354
-	    close(ndesc);
2355
-	    CLI_TMPUNLK();
2356
-	    free(tempfile);
2357
-	    SHA_RESET;
2358
-	    return CL_VIRUS;
2359
-	}
2362
+        cli_dbgmsg("***** Scanning decompressed file *****\n");
2363
+        SHA_OFF;
2364
+        if((ret = cli_magic_scandesc(ndesc, ctx)) == CL_VIRUS) {
2365
+            close(ndesc);
2366
+            CLI_TMPUNLK();
2367
+            free(tempfile);
2368
+            SHA_RESET;
2369
+            return CL_VIRUS;
2370
+        }
2360 2371
 
2361
-	SHA_RESET;
2362
-	close(ndesc);
2363
-	CLI_TMPUNLK();
2364
-	free(tempfile);
2365
-	return ret;
2372
+        SHA_RESET;
2373
+        close(ndesc);
2374
+        CLI_TMPUNLK();
2375
+        free(tempfile);
2376
+        return ret;
2366 2377
     }
2367 2378
 
2368 2379
 
2369 2380
     /* Petite */
2370 2381
 
2371 2382
     if(epsize<200) {
2372
-	free(exe_sections);
2373
-	return CL_CLEAN;
2383
+        free(exe_sections);
2384
+        return CL_CLEAN;
2374 2385
     }
2375 2386
 
2376 2387
     found = 2;
2377 2388
 
2378 2389
     if(epbuff[0] != '\xb8' || (uint32_t) cli_readint32(epbuff + 1) != exe_sections[nsections - 1].rva + EC32(optional_hdr32.ImageBase)) {
2379
-	if(nsections < 2 || epbuff[0] != '\xb8' || (uint32_t) cli_readint32(epbuff + 1) != exe_sections[nsections - 2].rva + EC32(optional_hdr32.ImageBase))
2380
-	    found = 0;
2381
-	else
2382
-	    found = 1;
2390
+        if(nsections < 2 || epbuff[0] != '\xb8' || (uint32_t) cli_readint32(epbuff + 1) != exe_sections[nsections - 2].rva + EC32(optional_hdr32.ImageBase))
2391
+            found = 0;
2392
+        else
2393
+            found = 1;
2383 2394
     }
2384 2395
 
2385 2396
     if(found && (DCONF & PE_CONF_PETITE)) {
2386
-	cli_dbgmsg("Petite: v2.%d compression detected\n", found);
2397
+        cli_dbgmsg("Petite: v2.%d compression detected\n", found);
2387 2398
 
2388
-	if(cli_readint32(epbuff + 0x80) == 0x163c988d) {
2389
-	    cli_dbgmsg("Petite: level zero compression is not supported yet\n");
2390
-	} else {
2391
-	    dsize = max - min;
2399
+        if(cli_readint32(epbuff + 0x80) == 0x163c988d) {
2400
+            cli_dbgmsg("Petite: level zero compression is not supported yet\n");
2401
+        } else {
2402
+            dsize = max - min;
2392 2403
 
2393
-	    CLI_UNPSIZELIMITS("Petite", dsize);
2404
+            CLI_UNPSIZELIMITS("Petite", dsize);
2394 2405
 
2395
-	    if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2396
-		cli_dbgmsg("Petite: Can't allocate %d bytes\n", dsize);
2397
-		free(exe_sections);
2398
-		return CL_EMEM;
2399
-	    }
2406
+            if((dest = (char *) cli_calloc(dsize, sizeof(char))) == NULL) {
2407
+                cli_dbgmsg("Petite: Can't allocate %d bytes\n", dsize);
2408
+                free(exe_sections);
2409
+                return CL_EMEM;
2410
+            }
2400 2411
 
2401
-	    for(i = 0 ; i < nsections; i++) {
2402
-		if(exe_sections[i].raw) {
2403
-		    if(!exe_sections[i].rsz || (unsigned int)fmap_readn(map, dest + exe_sections[i].rva - min, exe_sections[i].raw, exe_sections[i].ursz) != exe_sections[i].ursz) {
2404
-			free(exe_sections);
2405
-			free(dest);
2406
-			return CL_CLEAN;
2407
-		    }
2408
-		}
2409
-	    }
2412
+            for(i = 0 ; i < nsections; i++) {
2413
+                if(exe_sections[i].raw) {
2414
+                    if(!exe_sections[i].rsz || (unsigned int)fmap_readn(map, dest + exe_sections[i].rva - min, exe_sections[i].raw, exe_sections[i].ursz) != exe_sections[i].ursz) {
2415
+                        free(exe_sections);
2416
+                        free(dest);
2417
+                        return CL_CLEAN;
2418
+                    }
2419
+                }
2420
+            }
2410 2421
 
2411 2422
 #if HAVE_JSON
2412
-        cli_jsonstr(pe_json, "Packer", "Petite");
2423
+            cli_jsonstr(pe_json, "Packer", "Petite");
2413 2424
 #endif
2414 2425
 
2415
-	    CLI_UNPTEMP("Petite",(dest,exe_sections,0));
2416
-	    CLI_UNPRESULTS("Petite",(petite_inflate2x_1to9(dest, min, max - min, exe_sections, nsections - (found == 1 ? 1 : 0), EC32(optional_hdr32.ImageBase),vep, ndesc, found, EC32(optional_hdr32.DataDirectory[2].VirtualAddress),EC32(optional_hdr32.DataDirectory[2].Size))),0,(dest,0));
2417
-	}
2426
+            CLI_UNPTEMP("Petite",(dest,exe_sections,0));
2427
+            CLI_UNPRESULTS("Petite",(petite_inflate2x_1to9(dest, min, max - min, exe_sections, nsections - (found == 1 ? 1 : 0), EC32(optional_hdr32.ImageBase),vep, ndesc, found, EC32(optional_hdr32.DataDirectory[2].VirtualAddress),EC32(optional_hdr32.DataDirectory[2].Size))),0,(dest,0));
2428
+        }
2418 2429
     }
2419 2430
 
2420 2431
     /* PESpin 1.1 */
... ...
@@ -2424,29 +2481,29 @@ int cli_scanpe(cli_ctx *ctx)
2424 2424
        vep < exe_sections[nsections - 1].rva + exe_sections[nsections - 1].rsz - 0x3217 - 4 &&
2425 2425
        memcmp(epbuff+4, "\xe8\x00\x00\x00\x00\x8b\x1c\x24\x83\xc3", 10) == 0)  {
2426 2426
 
2427
-	char *spinned;
2427
+        char *spinned;
2428 2428
 
2429
-	CLI_UNPSIZELIMITS("PEspin", fsize);
2429
+        CLI_UNPSIZELIMITS("PEspin", fsize);
2430 2430
 
2431
-	if((spinned = (char *) cli_malloc(fsize)) == NULL) {
2432
-        cli_errmsg("PESping: Unable to allocate memory for spinned %lu\n", (unsigned long)fsize);
2433
-	    free(exe_sections);
2434
-	    return CL_EMEM;
2435
-	}
2431
+        if((spinned = (char *) cli_malloc(fsize)) == NULL) {
2432
+            cli_errmsg("PESping: Unable to allocate memory for spinned %lu\n", (unsigned long)fsize);
2433
+            free(exe_sections);
2434
+            return CL_EMEM;
2435
+        }
2436 2436
 
2437
-	if((size_t) fmap_readn(map, spinned, 0, fsize) != fsize) {
2438
-	    cli_dbgmsg("PESpin: Can't read %lu bytes\n", (unsigned long)fsize);
2439
-	    free(spinned);
2440
-	    free(exe_sections);
2441
-	    return CL_EREAD;
2442
-	}
2437
+        if((size_t) fmap_readn(map, spinned, 0, fsize) != fsize) {
2438
+            cli_dbgmsg("PESpin: Can't read %lu bytes\n", (unsigned long)fsize);
2439
+            free(spinned);
2440
+            free(exe_sections);
2441
+            return CL_EREAD;
2442
+        }
2443 2443
 
2444 2444
 #if HAVE_JSON
2445
-    cli_jsonstr(pe_json, "Packer", "PEspin");
2445
+        cli_jsonstr(pe_json, "Packer", "PEspin");
2446 2446
 #endif
2447 2447
 
2448
-	CLI_UNPTEMP("PESpin",(spinned,exe_sections,0));
2449
-	CLI_UNPRESULTS_("PEspin",SPINCASE(),(unspin(spinned, fsize, exe_sections, nsections - 1, vep, ndesc, ctx)),0,(spinned,0));
2448
+        CLI_UNPTEMP("PESpin",(spinned,exe_sections,0));
2449
+        CLI_UNPRESULTS_("PEspin",SPINCASE(),(unspin(spinned, fsize, exe_sections, nsections - 1, vep, ndesc, ctx)),0,(spinned,0));
2450 2450
     }
2451 2451
 
2452 2452
 
... ...
@@ -2454,69 +2511,69 @@ int cli_scanpe(cli_ctx *ctx)
2454 2454
     if((DCONF & PE_CONF_YC) && nsections > 1 &&
2455 2455
        (EC32(optional_hdr32.AddressOfEntryPoint) == exe_sections[nsections - 1].rva + 0x60)) {
2456 2456
 
2457
-	uint32_t ecx = 0;
2458
-	int16_t offset;
2457
+        uint32_t ecx = 0;
2458
+        int16_t offset;
2459 2459
 
2460
-	/* yC 1.3 */
2461
-	if (!memcmp(epbuff, "\x55\x8B\xEC\x53\x56\x57\x60\xE8\x00\x00\x00\x00\x5D\x81\xED", 15) &&
2462
-	    !memcmp(epbuff+0x26, "\x8D\x3A\x8B\xF7\x33\xC0\xEB\x04\x90\xEB\x01\xC2\xAC", 13) &&
2463
-	    ((uint8_t)epbuff[0x13] == 0xB9) &&
2464
-	    ((uint16_t)(cli_readint16(epbuff+0x18)) == 0xE981) &&
2465
-	    !memcmp(epbuff+0x1e,"\x8B\xD5\x81\xC2", 4)) {
2460
+        /* yC 1.3 */
2461
+        if (!memcmp(epbuff, "\x55\x8B\xEC\x53\x56\x57\x60\xE8\x00\x00\x00\x00\x5D\x81\xED", 15) &&
2462
+            !memcmp(epbuff+0x26, "\x8D\x3A\x8B\xF7\x33\xC0\xEB\x04\x90\xEB\x01\xC2\xAC", 13) &&
2463
+            ((uint8_t)epbuff[0x13] == 0xB9) &&
2464
+            ((uint16_t)(cli_readint16(epbuff+0x18)) == 0xE981) &&
2465
+            !memcmp(epbuff+0x1e,"\x8B\xD5\x81\xC2", 4)) {
2466 2466
 
2467
-	    offset = 0;
2468
-	    if (0x6c - cli_readint32(epbuff+0xf) + cli_readint32(epbuff+0x22) == 0xC6)
2469
-		ecx = cli_readint32(epbuff+0x14) - cli_readint32(epbuff+0x1a);
2470
-	}
2467
+            offset = 0;
2468
+            if (0x6c - cli_readint32(epbuff+0xf) + cli_readint32(epbuff+0x22) == 0xC6)
2469
+            ecx = cli_readint32(epbuff+0x14) - cli_readint32(epbuff+0x1a);
2470
+        }
2471 2471
 
2472
-	/* yC 1.3 variant */
2473
-	if (!ecx && !memcmp(epbuff, "\x55\x8B\xEC\x83\xEC\x40\x53\x56\x57", 9) &&
2474
-	    !memcmp(epbuff+0x17, "\xe8\x00\x00\x00\x00\x5d\x81\xed", 8) &&
2475
-	    ((uint8_t)epbuff[0x23] == 0xB9)) {
2472
+        /* yC 1.3 variant */
2473
+        if (!ecx && !memcmp(epbuff, "\x55\x8B\xEC\x83\xEC\x40\x53\x56\x57", 9) &&
2474
+            !memcmp(epbuff+0x17, "\xe8\x00\x00\x00\x00\x5d\x81\xed", 8) &&
2475
+            ((uint8_t)epbuff[0x23] == 0xB9)) {
2476 2476
 
2477
-	    offset = 0x10;
2478
-	    if (0x6c - cli_readint32(epbuff+0x1f) + cli_readint32(epbuff+0x32) == 0xC6)
2479
-		ecx = cli_readint32(epbuff+0x24) - cli_readint32(epbuff+0x2a);
2480
-	}
2477
+            offset = 0x10;
2478
+            if (0x6c - cli_readint32(epbuff+0x1f) + cli_readint32(epbuff+0x32) == 0xC6)
2479
+            ecx = cli_readint32(epbuff+0x24) - cli_readint32(epbuff+0x2a);
2480
+        }
2481 2481
 
2482
-	/* yC 1.x/modified */
2483
-	if (!ecx && !memcmp(epbuff, "\x60\xe8\x00\x00\x00\x00\x5d\x81\xed",9) &&
2484
-	    ((uint8_t)epbuff[0xd] == 0xb9) &&
2485
-	    ((uint16_t)cli_readint16(epbuff + 0x12)== 0xbd8d) &&
2486
-	    !memcmp(epbuff+0x18, "\x8b\xf7\xac", 3)) {
2482
+        /* yC 1.x/modified */
2483
+        if (!ecx && !memcmp(epbuff, "\x60\xe8\x00\x00\x00\x00\x5d\x81\xed",9) &&
2484
+            ((uint8_t)epbuff[0xd] == 0xb9) &&
2485
+            ((uint16_t)cli_readint16(epbuff + 0x12)== 0xbd8d) &&
2486
+            !memcmp(epbuff+0x18, "\x8b\xf7\xac", 3)) {
2487 2487
 
2488
-	    offset = -0x18;
2489
-	    if (0x66 - cli_readint32(epbuff+0x9) + cli_readint32(epbuff+0x14) == 0xae)
2490
-		ecx = cli_readint32(epbuff+0xe);
2491
-	}
2488
+            offset = -0x18;
2489
+            if (0x66 - cli_readint32(epbuff+0x9) + cli_readint32(epbuff+0x14) == 0xae)
2490
+            ecx = cli_readint32(epbuff+0xe);
2491
+        }
2492 2492
 
2493
-	if (ecx > 0x800 && ecx < 0x2000 &&
2494
-	    !memcmp(epbuff+0x63+offset, "\xaa\xe2\xcc", 3) &&
2495
-	    (fsize >= exe_sections[nsections-1].raw + 0xC6 + ecx + offset)) {
2493
+        if (ecx > 0x800 && ecx < 0x2000 &&
2494
+            !memcmp(epbuff+0x63+offset, "\xaa\xe2\xcc", 3) &&
2495
+            (fsize >= exe_sections[nsections-1].raw + 0xC6 + ecx + offset)) {
2496 2496
 
2497
-	    char *spinned;
2497
+            char *spinned;
2498 2498
 
2499
-	    if((spinned = (char *) cli_malloc(fsize)) == NULL) {
2500
-            cli_errmsg("yC: Unable to allocate memory for spinned %lu\n", (unsigned long)fsize);
2501
-	      free(exe_sections);
2502
-	      return CL_EMEM;
2503
-	    }
2499
+            if((spinned = (char *) cli_malloc(fsize)) == NULL) {
2500
+                cli_errmsg("yC: Unable to allocate memory for spinned %lu\n", (unsigned long)fsize);
2501
+                free(exe_sections);
2502
+                return CL_EMEM;
2503
+            }
2504 2504
 
2505
-	    if((size_t) fmap_readn(map, spinned, 0, fsize) != fsize) {
2506
-	      cli_dbgmsg("yC: Can't read %lu bytes\n", (unsigned long)fsize);
2507
-	      free(spinned);
2508
-	      free(exe_sections);
2509
-	      return CL_EREAD;
2510
-	    }
2505
+            if((size_t) fmap_readn(map, spinned, 0, fsize) != fsize) {
2506
+                cli_dbgmsg("yC: Can't read %lu bytes\n", (unsigned long)fsize);
2507
+                free(spinned);
2508
+                free(exe_sections);
2509
+                return CL_EREAD;
2510
+            }
2511 2511
 
2512 2512
 #if HAVE_JSON
2513
-        cli_jsonstr(pe_json, "Packer", "yC");
2513
+            cli_jsonstr(pe_json, "Packer", "yC");
2514 2514
 #endif
2515 2515
 
2516
-	    cli_dbgmsg("%d,%d,%d,%d\n", nsections-1, e_lfanew, ecx, offset);
2517
-	    CLI_UNPTEMP("yC",(spinned,exe_sections,0));
2518
-	    CLI_UNPRESULTS("yC",(yc_decrypt(spinned, fsize, exe_sections, nsections-1, e_lfanew, ndesc, ecx, offset)),0,(spinned,0));
2519
-	}
2516
+            cli_dbgmsg("%d,%d,%d,%d\n", nsections-1, e_lfanew, ecx, offset);
2517
+            CLI_UNPTEMP("yC",(spinned,exe_sections,0));
2518
+            CLI_UNPRESULTS("yC",(yc_decrypt(spinned, fsize, exe_sections, nsections-1, e_lfanew, ndesc, ecx, offset)),0,(spinned,0));
2519
+        }
2520 2520
     }
2521 2521
 
2522 2522
     /* WWPack */
... ...
@@ -2525,87 +2582,111 @@ int cli_scanpe(cli_ctx *ctx)
2525 2525
        vep == exe_sections[nsections - 1].rva &&
2526 2526
        memcmp(epbuff, "\x53\x55\x8b\xe8\x33\xdb\xeb", 7) == 0 &&
2527 2527
        memcmp(epbuff+0x68, "\xe8\x00\x00\x00\x00\x58\x2d\x6d\x00\x00\x00\x50\x60\x33\xc9\x50\x58\x50\x50", 19) == 0)  {
2528
-	uint32_t head = exe_sections[nsections - 1].raw;
2528
+        uint32_t head = exe_sections[nsections - 1].raw;
2529 2529
         uint8_t *packer;
2530
-	char *src;
2531
-
2532
-	ssize = 0;
2533
-	for(i=0 ; ; i++) {
2534
-	    if(exe_sections[i].raw<head)
2535
-	        head=exe_sections[i].raw;
2536
-	    if(i+1==nsections) break;
2537
-	    if(ssize<exe_sections[i].rva+exe_sections[i].vsz)
2538
-		ssize=exe_sections[i].rva+exe_sections[i].vsz;
2539
-	}
2540
-	if(!head || !ssize || head>ssize) break;
2530
+        char *src;
2531
+
2532
+        ssize = 0;
2533
+        for(i=0 ; ; i++) {
2534
+            if(exe_sections[i].raw<head)
2535
+                head=exe_sections[i].raw;
2541 2536
 
2542
-	CLI_UNPSIZELIMITS("WWPack", ssize);
2537
+            if(i+1==nsections)
2538
+                break;
2539
+
2540
+            if(ssize<exe_sections[i].rva+exe_sections[i].vsz)
2541
+                ssize=exe_sections[i].rva+exe_sections[i].vsz;
2542
+        }
2543
+
2544
+        if(!head || !ssize || head>ssize)
2545
+            break;
2546
+
2547
+        CLI_UNPSIZELIMITS("WWPack", ssize);
2543 2548
 
2544 2549
         if(!(src=(char *)cli_calloc(ssize, sizeof(char)))) {
2545
-	    free(exe_sections);
2546
-	    return CL_EMEM;
2547
-	}
2548
-	if((size_t) fmap_readn(map, src, 0, head) != head) {
2549
-	    cli_dbgmsg("WWPack: Can't read %d bytes from headers\n", head);
2550
-	    free(src);
2551
-	    free(exe_sections);
2552
-	    return CL_EREAD;
2553
-	}
2550
+            free(exe_sections);
2551
+            return CL_EMEM;
2552
+        }
2553
+
2554
+        if((size_t) fmap_readn(map, src, 0, head) != head) {
2555
+            cli_dbgmsg("WWPack: Can't read %d bytes from headers\n", head);
2556
+            free(src);
2557
+            free(exe_sections);
2558
+            return CL_EREAD;
2559
+        }
2560
+
2554 2561
         for(i = 0 ; i < (unsigned int)nsections-1; i++) {
2555
-	    if(!exe_sections[i].rsz) continue;
2556
-            if(!CLI_ISCONTAINED(src, ssize, src+exe_sections[i].rva, exe_sections[i].rsz)) break;
2557
-            if((unsigned int)fmap_readn(map, src+exe_sections[i].rva, exe_sections[i].raw, exe_sections[i].rsz)!=exe_sections[i].rsz) break;
2562
+            if(!exe_sections[i].rsz)
2563
+                continue;
2564
+
2565
+            if(!CLI_ISCONTAINED(src, ssize, src+exe_sections[i].rva, exe_sections[i].rsz))
2566
+                break;
2567
+
2568
+            if((unsigned int)fmap_readn(map, src+exe_sections[i].rva, exe_sections[i].raw, exe_sections[i].rsz)!=exe_sections[i].rsz)
2569
+                break;
2558 2570
         }
2571
+
2559 2572
         if(i+1!=nsections) {
2560 2573
             cli_dbgmsg("WWpack: Probably hacked/damaged file.\n");
2561 2574
             free(src);
2562 2575
             break;
2563 2576
         }
2564
-	if((packer = (uint8_t *) cli_calloc(exe_sections[nsections - 1].rsz, sizeof(char))) == NULL) {
2565
-	    free(src);
2566
-	    free(exe_sections);
2567
-	    return CL_EMEM;
2568
-	}
2569
-	if(!exe_sections[nsections - 1].rsz || (size_t) fmap_readn(map, packer, exe_sections[nsections - 1].raw, exe_sections[nsections - 1].rsz) != exe_sections[nsections - 1].rsz) {
2570
-	    cli_dbgmsg("WWPack: Can't read %d bytes from wwpack sect\n", exe_sections[nsections - 1].rsz);
2571
-	    free(src);
2572
-	    free(packer);
2573
-	    free(exe_sections);
2574
-	    return CL_EREAD;
2575
-	}
2577
+
2578
+        if((packer = (uint8_t *) cli_calloc(exe_sections[nsections - 1].rsz, sizeof(char))) == NULL) {
2579
+            free(src);
2580
+            free(exe_sections);
2581
+            return CL_EMEM;
2582
+        }
2583
+
2584
+        if(!exe_sections[nsections - 1].rsz || (size_t) fmap_readn(map, packer, exe_sections[nsections - 1].raw, exe_sections[nsections - 1].rsz) != exe_sections[nsections - 1].rsz) {
2585
+            cli_dbgmsg("WWPack: Can't read %d bytes from wwpack sect\n", exe_sections[nsections - 1].rsz);
2586
+            free(src);
2587
+            free(packer);
2588
+            free(exe_sections);
2589
+            return CL_EREAD;
2590
+        }
2576 2591
 
2577 2592
 #if HAVE_JSON
2578
-    cli_jsonstr(pe_json, "Packer", "WWPack");
2593
+        cli_jsonstr(pe_json, "Packer", "WWPack");
2579 2594
 #endif
2580 2595
 
2581
-	CLI_UNPTEMP("WWPack",(src,packer,exe_sections,0));
2582
-	CLI_UNPRESULTS("WWPack",(wwunpack((uint8_t *)src, ssize, packer, exe_sections, nsections-1, e_lfanew, ndesc)),0,(src,packer,0));
2583
-	break;
2596
+        CLI_UNPTEMP("WWPack",(src,packer,exe_sections,0));
2597
+        CLI_UNPRESULTS("WWPack",(wwunpack((uint8_t *)src, ssize, packer, exe_sections, nsections-1, e_lfanew, ndesc)),0,(src,packer,0));
2598
+        break;
2584 2599
     }
2585 2600
 
2586 2601
 
2587 2602
     /* ASPACK support */
2588 2603
     while((DCONF & PE_CONF_ASPACK) && ep+58+0x70e < fsize && !memcmp(epbuff,"\x60\xe8\x03\x00\x00\x00\xe9\xeb",8)) {
2589
-	char *src;
2604
+        char *src;
2605
+
2606
+        if(epsize<0x3bf || memcmp(epbuff+0x3b9, "\x68\x00\x00\x00\x00\xc3",6))
2607
+            break;
2608
+        ssize = 0;
2609
+        for(i=0 ; i< nsections ; i++)
2610
+            if(ssize<exe_sections[i].rva+exe_sections[i].vsz)
2611
+                ssize=exe_sections[i].rva+exe_sections[i].vsz;
2590 2612
 
2591
-        if(epsize<0x3bf || memcmp(epbuff+0x3b9, "\x68\x00\x00\x00\x00\xc3",6)) break;
2592
-	ssize = 0;
2593
-	for(i=0 ; i< nsections ; i++)
2594
-	    if(ssize<exe_sections[i].rva+exe_sections[i].vsz)
2595
-		ssize=exe_sections[i].rva+exe_sections[i].vsz;
2596
-	if(!ssize) break;
2613
+        if(!ssize)
2614
+            break;
2597 2615
 
2598
-	CLI_UNPSIZELIMITS("Aspack", ssize);
2616
+        CLI_UNPSIZELIMITS("Aspack", ssize);
2599 2617
 
2600 2618
         if(!(src=(char *)cli_calloc(ssize, sizeof(char)))) {
2601
-	    free(exe_sections);
2602
-	    return CL_EMEM;
2603
-	}
2619
+            free(exe_sections);
2620
+            return CL_EMEM;
2621
+        }
2604 2622
         for(i = 0 ; i < (unsigned int)nsections; i++) {
2605
-	    if(!exe_sections[i].rsz) continue;
2606
-            if(!CLI_ISCONTAINED(src, ssize, src+exe_sections[i].rva, exe_sections[i].rsz)) break;
2607
-            if((unsigned int)fmap_readn(map, src+exe_sections[i].rva, exe_sections[i].raw, exe_sections[i].rsz)!=exe_sections[i].rsz) break;
2623
+            if(!exe_sections[i].rsz)
2624
+                continue;
2625
+
2626
+            if(!CLI_ISCONTAINED(src, ssize, src+exe_sections[i].rva, exe_sections[i].rsz))
2627
+                break;
2628
+
2629
+            if((unsigned int)fmap_readn(map, src+exe_sections[i].rva, exe_sections[i].raw, exe_sections[i].rsz)!=exe_sections[i].rsz)
2630
+                break;
2608 2631
         }
2632
+
2609 2633
         if(i!=nsections) {
2610 2634
             cli_dbgmsg("Aspack: Probably hacked/damaged Aspack file.\n");
2611 2635
             free(src);
... ...
@@ -2616,212 +2697,230 @@ int cli_scanpe(cli_ctx *ctx)
2616 2616
         cli_jsonstr(pe_json, "Packer", "Aspack");
2617 2617
 #endif
2618 2618
 
2619
-	CLI_UNPTEMP("Aspack",(src,exe_sections,0));
2620
-	CLI_UNPRESULTS("Aspack",(unaspack212((uint8_t *)src, ssize, exe_sections, nsections, vep-1, EC32(optional_hdr32.ImageBase), ndesc)),1,(src,0));
2621
-	break;
2619
+        CLI_UNPTEMP("Aspack",(src,exe_sections,0));
2620
+        CLI_UNPRESULTS("Aspack",(unaspack212((uint8_t *)src, ssize, exe_sections, nsections, vep-1, EC32(optional_hdr32.ImageBase), ndesc)),1,(src,0));
2621
+        break;
2622 2622
     }
2623 2623
 
2624 2624
     /* NsPack */
2625 2625
 
2626 2626
     while (DCONF & PE_CONF_NSPACK) {
2627
-	uint32_t eprva = vep;
2628
-	uint32_t start_of_stuff, rep = ep;
2629
-	unsigned int nowinldr;
2630
-	const char *nbuff;
2631
-
2632
-	src=epbuff;
2633
-	if (*epbuff=='\xe9') { /* bitched headers */
2634
-	    eprva = cli_readint32(epbuff+1)+vep+5;
2635
-	    if (!(rep = cli_rawaddr(eprva, exe_sections, nsections, &err, fsize, hdr_size)) && err) break;
2636
-	    if (!(nbuff = fmap_need_off_once(map, rep, 24))) break;
2637
-	    src = nbuff;
2638
-	}
2627
+        uint32_t eprva = vep;
2628
+        uint32_t start_of_stuff, rep = ep;
2629
+        unsigned int nowinldr;
2630
+        const char *nbuff;
2631
+
2632
+        src=epbuff;
2633
+        if (*epbuff=='\xe9') { /* bitched headers */
2634
+            eprva = cli_readint32(epbuff+1)+vep+5;
2635
+            if (!(rep = cli_rawaddr(eprva, exe_sections, nsections, &err, fsize, hdr_size)) && err)
2636
+                break;
2639 2637
 
2640
-	if (memcmp(src, "\x9c\x60\xe8\x00\x00\x00\x00\x5d\xb8\x07\x00\x00\x00", 13)) break;
2638
+            if (!(nbuff = fmap_need_off_once(map, rep, 24)))
2639
+                break;
2641 2640
 
2642
-	nowinldr = 0x54-cli_readint32(src+17);
2643
-	cli_dbgmsg("NsPack: Found *start_of_stuff @delta-%x\n", nowinldr);
2641
+            src = nbuff;
2642
+        }
2644 2643
 
2645
-	if(!(nbuff = fmap_need_off_once(map, rep-nowinldr, 4))) break;
2646
-	start_of_stuff=rep+cli_readint32(nbuff);
2647
-	if(!(nbuff = fmap_need_off_once(map, start_of_stuff, 20))) break;
2648
-	src = nbuff;
2649
-	if (!cli_readint32(nbuff)) {
2650
-	    start_of_stuff+=4; /* FIXME: more to do */
2651
-	    src+=4;
2652
-	}
2644
+        if (memcmp(src, "\x9c\x60\xe8\x00\x00\x00\x00\x5d\xb8\x07\x00\x00\x00", 13))
2645
+            break;
2653 2646
 
2654
-	ssize = cli_readint32(src+5)|0xff;
2655
-	dsize = cli_readint32(src+9);
2647
+        nowinldr = 0x54-cli_readint32(src+17);
2648
+        cli_dbgmsg("NsPack: Found *start_of_stuff @delta-%x\n", nowinldr);
2656 2649
 
2657
-	CLI_UNPSIZELIMITS("NsPack", MAX(ssize,dsize));
2650
+        if(!(nbuff = fmap_need_off_once(map, rep-nowinldr, 4)))
2651
+            break;
2658 2652
 
2659
-	if (!ssize || !dsize || dsize != exe_sections[0].vsz) break;
2660
-	if (!(dest=cli_malloc(dsize))) {
2661
-        cli_errmsg("NsPack: Unable to allocate memory for dest %u\n", dsize);
2662
-        break;
2663
-    }
2664
-	/* memset(dest, 0xfc, dsize); */
2653
+        start_of_stuff=rep+cli_readint32(nbuff);
2654
+        if(!(nbuff = fmap_need_off_once(map, start_of_stuff, 20)))
2655
+            break;
2665 2656
 
2666
-	if(!(src = fmap_need_off(map, start_of_stuff, ssize))) {
2667
-	    free(dest);
2668
-	    break;
2669
-	}
2670
-	/* memset(src, 0x00, ssize); */
2657
+        src = nbuff;
2658
+        if (!cli_readint32(nbuff)) {
2659
+            start_of_stuff+=4; /* FIXME: more to do */
2660
+            src+=4;
2661
+        }
2671 2662
 
2672
-	eprva+=0x27a;
2673
-	if (!(rep = cli_rawaddr(eprva, exe_sections, nsections, &err, fsize, hdr_size)) && err) {
2674
-	  free(dest);
2675
-	  break;
2676
-	}
2677
-	if(!(nbuff = fmap_need_off_once(map, rep, 5))) {
2678
-	  free(dest);
2679
-	  break;
2680
-	}
2681
-	fmap_unneed_off(map, start_of_stuff, ssize);
2682
-	eprva=eprva+5+cli_readint32(nbuff+1);
2683
-	cli_dbgmsg("NsPack: OEP = %08x\n", eprva);
2663
+        ssize = cli_readint32(src+5)|0xff;
2664
+        dsize = cli_readint32(src+9);
2665
+
2666
+        CLI_UNPSIZELIMITS("NsPack", MAX(ssize,dsize));
2667
+
2668
+        if (!ssize || !dsize || dsize != exe_sections[0].vsz)
2669
+            break;
2670
+
2671
+        if (!(dest=cli_malloc(dsize))) {
2672
+            cli_errmsg("NsPack: Unable to allocate memory for dest %u\n", dsize);
2673
+            break;
2674
+        }
2675
+        /* memset(dest, 0xfc, dsize); */
2676
+
2677
+        if(!(src = fmap_need_off(map, start_of_stuff, ssize))) {
2678
+            free(dest);
2679
+            break;
2680
+        }
2681
+        /* memset(src, 0x00, ssize); */
2682
+
2683
+        eprva+=0x27a;
2684
+        if (!(rep = cli_rawaddr(eprva, exe_sections, nsections, &err, fsize, hdr_size)) && err) {
2685
+          free(dest);
2686
+          break;
2687
+        }
2688
+
2689
+        if(!(nbuff = fmap_need_off_once(map, rep, 5))) {
2690
+          free(dest);
2691
+          break;
2692
+        }
2693
+
2694
+        fmap_unneed_off(map, start_of_stuff, ssize);
2695
+        eprva=eprva+5+cli_readint32(nbuff+1);
2696
+        cli_dbgmsg("NsPack: OEP = %08x\n", eprva);
2684 2697
 
2685 2698
 #if HAVE_JSON
2686
-    cli_jsonstr(pe_json, "Packer", "NsPack");
2699
+        cli_jsonstr(pe_json, "Packer", "NsPack");
2687 2700
 #endif
2688 2701
 
2689
-	CLI_UNPTEMP("NsPack",(dest,exe_sections,0));
2690
-	CLI_UNPRESULTS("NsPack",(unspack(src, dest, ctx, exe_sections[0].rva, EC32(optional_hdr32.ImageBase), eprva, ndesc)),0,(dest,0));
2691
-	break;
2702
+        CLI_UNPTEMP("NsPack",(dest,exe_sections,0));
2703
+        CLI_UNPRESULTS("NsPack",(unspack(src, dest, ctx, exe_sections[0].rva, EC32(optional_hdr32.ImageBase), eprva, ndesc)),0,(dest,0));
2704
+        break;
2692 2705
     }
2693 2706
 
2694 2707
     /* to be continued ... */
2695 2708
 
2696
-
2697
-
2698
-
2699 2709
     /* !!!!!!!!!!!!!!    PACKERS END HERE    !!!!!!!!!!!!!! */
2700 2710
     ctx->corrupted_input = corrupted_cur;
2701 2711
 
2702 2712
     /* Bytecode BC_PE_UNPACKER hook */
2703 2713
     bc_ctx = cli_bytecode_context_alloc();
2704 2714
     if (!bc_ctx) {
2705
-	cli_errmsg("cli_scanpe: can't allocate memory for bc_ctx\n");
2706
-	return CL_EMEM;
2715
+        cli_errmsg("cli_scanpe: can't allocate memory for bc_ctx\n");
2716
+        return CL_EMEM;
2707 2717
     }
2718
+
2708 2719
     cli_bytecode_context_setpe(bc_ctx, &pedata, exe_sections);
2709 2720
     cli_bytecode_context_setctx(bc_ctx, ctx);
2721
+
2710 2722
     ret = cli_bytecode_runhook(ctx, ctx->engine, bc_ctx, BC_PE_UNPACKER, map);
2711 2723
     switch (ret) {
2712
-	case CL_VIRUS:
2713
-	    free(exe_sections);
2714
-	    cli_bytecode_context_destroy(bc_ctx);
2715
-	    return CL_VIRUS;
2716
-	case CL_SUCCESS:
2717
-	    ndesc = cli_bytecode_context_getresult_file(bc_ctx, &tempfile);
2718
-	    cli_bytecode_context_destroy(bc_ctx);
2719
-	    if (ndesc != -1 && tempfile) {
2720
-		CLI_UNPRESULTS("bytecode PE hook", 1, 1, (0));
2721
-	    }
2722
-	    break;
2723
-	default:
2724
-	    cli_bytecode_context_destroy(bc_ctx);
2724
+    case CL_VIRUS:
2725
+        free(exe_sections);
2726
+        cli_bytecode_context_destroy(bc_ctx);
2727
+        return CL_VIRUS;
2728
+    case CL_SUCCESS:
2729
+        ndesc = cli_bytecode_context_getresult_file(bc_ctx, &tempfile);
2730
+        cli_bytecode_context_destroy(bc_ctx);
2731
+        if (ndesc != -1 && tempfile) {
2732
+            CLI_UNPRESULTS("bytecode PE hook", 1, 1, (0));
2733
+        }
2734
+
2735
+        break;
2736
+    default:
2737
+        cli_bytecode_context_destroy(bc_ctx);
2725 2738
     }
2726 2739
 
2727 2740
     free(exe_sections);
2741
+
2728 2742
 #if HAVE_JSON
2729
-    if (cli_json_timeout_cycle_check(ctx, &toval) != CL_SUCCESS) {
2743
+    if (cli_json_timeout_cycle_check(ctx, &toval) != CL_SUCCESS)
2730 2744
         return CL_ETIMEOUT;
2731
-    }
2732 2745
 #endif
2746
+
2733 2747
     if (SCAN_ALL && viruses_found)
2734
-	return CL_VIRUS;
2748
+        return CL_VIRUS;
2749
+
2735 2750
     return CL_CLEAN;
2736 2751
 }
2737 2752
 
2738 2753
 int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
2739 2754
 {
2740
-	uint16_t e_magic; /* DOS signature ("MZ") */
2741
-	uint32_t e_lfanew; /* address of new exe header */
2742
-	/* Obsolete - see below
2743
-	  uint32_t min = 0, max = 0;
2744
-	*/
2745
-	struct pe_image_file_hdr file_hdr;
2746
-	union {
2747
-	    struct pe_image_optional_hdr64 opt64;
2748
-	    struct pe_image_optional_hdr32 opt32;
2749
-	} pe_opt;
2750
-	struct pe_image_section_hdr *section_hdr;
2751
-	unsigned int i;
2752
-	unsigned int err, pe_plus = 0;
2753
-	uint32_t valign, falign, hdr_size;
2754
-	size_t fsize;
2755
-	ssize_t at;
2756
-	struct pe_image_data_dir *dirs;
2755
+    uint16_t e_magic; /* DOS signature ("MZ") */
2756
+    uint32_t e_lfanew; /* address of new exe header */
2757
+    /* Obsolete - see below
2758
+      uint32_t min = 0, max = 0;
2759
+    */
2760
+    struct pe_image_file_hdr file_hdr;
2761
+    union {
2762
+        struct pe_image_optional_hdr64 opt64;
2763
+        struct pe_image_optional_hdr32 opt32;
2764
+    } pe_opt;
2765
+    struct pe_image_section_hdr *section_hdr;
2766
+    unsigned int i;
2767
+    unsigned int err, pe_plus = 0;
2768
+    uint32_t valign, falign, hdr_size;
2769
+    size_t fsize;
2770
+    ssize_t at;
2771
+    struct pe_image_data_dir *dirs;
2757 2772
 
2758 2773
     cli_dbgmsg("in cli_peheader\n");
2759 2774
 
2760 2775
     fsize = map->len - peinfo->offset;
2761 2776
     if(fmap_readn(map, &e_magic, peinfo->offset, sizeof(e_magic)) != sizeof(e_magic)) {
2762
-	cli_dbgmsg("Can't read DOS signature\n");
2763
-	return -1;
2777
+        cli_dbgmsg("Can't read DOS signature\n");
2778
+        return -1;
2764 2779
     }
2765 2780
 
2766 2781
     if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) {
2767
-	cli_dbgmsg("Invalid DOS signature\n");
2768
-	return -1;
2782
+        cli_dbgmsg("Invalid DOS signature\n");
2783
+        return -1;
2769 2784
     }
2770 2785
 
2771 2786
     if(fmap_readn(map, &e_lfanew, peinfo->offset + 58 + sizeof(e_magic), sizeof(e_lfanew)) != sizeof(e_lfanew)) {
2772
-	/* truncated header? */
2773
-	return -1;
2787
+        /* truncated header? */
2788
+        return -1;
2774 2789
     }
2775 2790
 
2776 2791
     e_lfanew = EC32(e_lfanew);
2777 2792
     if(!e_lfanew) {
2778
-	cli_dbgmsg("Not a PE file\n");
2779
-	return -1;
2793
+        cli_dbgmsg("Not a PE file\n");
2794
+        return -1;
2780 2795
     }
2781 2796
 
2782 2797
     if(fmap_readn(map, &file_hdr, peinfo->offset + e_lfanew, sizeof(struct pe_image_file_hdr)) != sizeof(struct pe_image_file_hdr)) {
2783
-	/* bad information in e_lfanew - probably not a PE file */
2784
-	cli_dbgmsg("Can't read file header\n");
2785
-	return -1;
2798
+        /* bad information in e_lfanew - probably not a PE file */
2799
+        cli_dbgmsg("Can't read file header\n");
2800
+        return -1;
2786 2801
     }
2787 2802
 
2788 2803
     if(EC32(file_hdr.Magic) != PE_IMAGE_NT_SIGNATURE) {
2789
-	cli_dbgmsg("Invalid PE signature (probably NE file)\n");
2790
-	return -1;
2804
+        cli_dbgmsg("Invalid PE signature (probably NE file)\n");
2805
+        return -1;
2791 2806
     }
2792 2807
 
2793 2808
     if ( (peinfo->nsections = EC16(file_hdr.NumberOfSections)) < 1 || peinfo->nsections > 96 ) return -1;
2794 2809
 
2795 2810
     if (EC16(file_hdr.SizeOfOptionalHeader) < sizeof(struct pe_image_optional_hdr32)) {
2796 2811
         cli_dbgmsg("SizeOfOptionalHeader too small\n");
2797
-	return -1;
2812
+        return -1;
2798 2813
     }
2799 2814
 
2800 2815
     at = peinfo->offset + e_lfanew + sizeof(struct pe_image_file_hdr);
2801 2816
     if(fmap_readn(map, &optional_hdr32, at, sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr32)) {
2802 2817
         cli_dbgmsg("Can't read optional file header\n");
2803
-	return -1;
2818
+        return -1;
2804 2819
     }
2805 2820
     at += sizeof(struct pe_image_optional_hdr32);
2806 2821
 
2807 2822
     if(EC16(optional_hdr64.Magic)==PE32P_SIGNATURE) { /* PE+ */
2808 2823
         if(EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr64)) {
2809
-	    cli_dbgmsg("Incorrect SizeOfOptionalHeader for PE32+\n");
2810
-	    return -1;
2811
-	}
2812
-	if(fmap_readn(map, &optional_hdr32 + 1, at, sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) {
2813
-	    cli_dbgmsg("Can't read optional file header\n");
2814
-	    return -1;
2815
-	}
2816
-	at += sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32);
2817
-	hdr_size = EC32(optional_hdr64.SizeOfHeaders);
2818
-	pe_plus=1;
2824
+            cli_dbgmsg("Incorrect SizeOfOptionalHeader for PE32+\n");
2825
+            return -1;
2826
+        }
2827
+
2828
+        if(fmap_readn(map, &optional_hdr32 + 1, at, sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) != sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32)) {
2829
+            cli_dbgmsg("Can't read optional file header\n");
2830
+            return -1;
2831
+        }
2832
+
2833
+        at += sizeof(struct pe_image_optional_hdr64) - sizeof(struct pe_image_optional_hdr32);
2834
+        hdr_size = EC32(optional_hdr64.SizeOfHeaders);
2835
+        pe_plus=1;
2819 2836
     } else { /* PE */
2820
-	if (EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr32)) {
2821
-	    /* Seek to the end of the long header */
2822
-	    at += EC16(file_hdr.SizeOfOptionalHeader)-sizeof(struct pe_image_optional_hdr32);
2823
-	}
2824
-	hdr_size = EC32(optional_hdr32.SizeOfHeaders);
2837
+        if (EC16(file_hdr.SizeOfOptionalHeader)!=sizeof(struct pe_image_optional_hdr32)) {
2838
+            /* Seek to the end of the long header */
2839
+            at += EC16(file_hdr.SizeOfOptionalHeader)-sizeof(struct pe_image_optional_hdr32);
2840
+        }
2841
+
2842
+        hdr_size = EC32(optional_hdr32.SizeOfHeaders);
2825 2843
     }
2826 2844
 
2827 2845
     valign = (pe_plus)?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment);
... ...
@@ -2832,249 +2931,253 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
2832 2832
     peinfo->section = (struct cli_exe_section *) cli_calloc(peinfo->nsections, sizeof(struct cli_exe_section));
2833 2833
 
2834 2834
     if(!peinfo->section) {
2835
-	cli_dbgmsg("Can't allocate memory for section headers\n");
2836
-	return -1;
2835
+        cli_dbgmsg("Can't allocate memory for section headers\n");
2836
+        return -1;
2837 2837
     }
2838 2838
 
2839 2839
     section_hdr = (struct pe_image_section_hdr *) cli_calloc(peinfo->nsections, sizeof(struct pe_image_section_hdr));
2840 2840
 
2841 2841
     if(!section_hdr) {
2842
-	cli_dbgmsg("Can't allocate memory for section headers\n");
2843
-	free(peinfo->section);
2844
-	peinfo->section = NULL;
2845
-	return -1;
2842
+        cli_dbgmsg("Can't allocate memory for section headers\n");
2843
+        free(peinfo->section);
2844
+        peinfo->section = NULL;
2845
+        return -1;
2846 2846
     }
2847 2847
 
2848 2848
     if(fmap_readn(map, section_hdr, at, peinfo->nsections * sizeof(struct pe_image_section_hdr)) != peinfo->nsections * sizeof(struct pe_image_section_hdr)) {
2849 2849
         cli_dbgmsg("Can't read section header\n");
2850
-	cli_dbgmsg("Possibly broken PE file\n");
2851
-	free(section_hdr);
2852
-	free(peinfo->section);
2853
-	peinfo->section = NULL;
2854
-	return -1;
2850
+        cli_dbgmsg("Possibly broken PE file\n");
2851
+        free(section_hdr);
2852
+        free(peinfo->section);
2853
+        peinfo->section = NULL;
2854
+        return -1;
2855 2855
     }
2856 2856
     at += sizeof(struct pe_image_section_hdr)*peinfo->nsections;
2857 2857
 
2858 2858
     for(i = 0; falign!=0x200 && i<peinfo->nsections; i++) {
2859
-	/* file alignment fallback mode - blah */
2860
-	if (falign && section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
2861
-	    falign = 0x200;
2862
-	}
2859
+        /* file alignment fallback mode - blah */
2860
+        if (falign && section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
2861
+            falign = 0x200;
2862
+        }
2863 2863
     }
2864 2864
 
2865 2865
     for(i = 0; i < peinfo->nsections; i++) {
2866 2866
         peinfo->section[i].rva = PEALIGN(EC32(section_hdr[i].VirtualAddress), valign);
2867
-	peinfo->section[i].vsz = PESALIGN(EC32(section_hdr[i].VirtualSize), valign);
2868
-	peinfo->section[i].raw = PEALIGN(EC32(section_hdr[i].PointerToRawData), falign);
2869
-	peinfo->section[i].rsz = PESALIGN(EC32(section_hdr[i].SizeOfRawData), falign);
2867
+        peinfo->section[i].vsz = PESALIGN(EC32(section_hdr[i].VirtualSize), valign);
2868
+        peinfo->section[i].raw = PEALIGN(EC32(section_hdr[i].PointerToRawData), falign);
2869
+        peinfo->section[i].rsz = PESALIGN(EC32(section_hdr[i].SizeOfRawData), falign);
2870 2870
 
2871
-	if (!peinfo->section[i].vsz && peinfo->section[i].rsz)
2872
-	    peinfo->section[i].vsz=PESALIGN(EC32(section_hdr[i].SizeOfRawData), valign);
2871
+        if (!peinfo->section[i].vsz && peinfo->section[i].rsz)
2872
+            peinfo->section[i].vsz=PESALIGN(EC32(section_hdr[i].SizeOfRawData), valign);
2873 2873
 
2874
-	if (peinfo->section[i].rsz && !CLI_ISCONTAINED(0, (uint32_t) fsize, peinfo->section[i].raw, peinfo->section[i].rsz))
2875
-	    peinfo->section[i].rsz = (fsize - peinfo->section[i].raw)*(fsize>peinfo->section[i].raw);
2874
+        if (peinfo->section[i].rsz && !CLI_ISCONTAINED(0, (uint32_t) fsize, peinfo->section[i].raw, peinfo->section[i].rsz))
2875
+            peinfo->section[i].rsz = (fsize - peinfo->section[i].raw)*(fsize>peinfo->section[i].raw);
2876 2876
     }
2877 2877
 
2878 2878
     if(pe_plus) {
2879
-	peinfo->ep = EC32(optional_hdr64.AddressOfEntryPoint);
2880
-	dirs = optional_hdr64.DataDirectory;
2879
+        peinfo->ep = EC32(optional_hdr64.AddressOfEntryPoint);
2880
+        dirs = optional_hdr64.DataDirectory;
2881 2881
     } else {
2882
-	peinfo->ep = EC32(optional_hdr32.AddressOfEntryPoint);
2883
-	dirs = optional_hdr32.DataDirectory;
2882
+        peinfo->ep = EC32(optional_hdr32.AddressOfEntryPoint);
2883
+        dirs = optional_hdr32.DataDirectory;
2884 2884
     }
2885 2885
 
2886 2886
     if(!(peinfo->ep = cli_rawaddr(peinfo->ep, peinfo->section, peinfo->nsections, &err, fsize, hdr_size)) && err) {
2887
-	cli_dbgmsg("Broken PE file\n");
2888
-	free(section_hdr);
2889
-	free(peinfo->section);
2890
-	peinfo->section = NULL;
2891
-	return -1;
2887
+        cli_dbgmsg("Broken PE file\n");
2888
+        free(section_hdr);
2889
+        free(peinfo->section);
2890
+        peinfo->section = NULL;
2891
+        return -1;
2892 2892
     }
2893 2893
 
2894 2894
     if(EC16(file_hdr.Characteristics) & 0x2000 || !dirs[2].Size)
2895
-	peinfo->res_addr = 0;
2895
+        peinfo->res_addr = 0;
2896 2896
     else
2897
-	peinfo->res_addr = EC32(dirs[2].VirtualAddress);
2897
+        peinfo->res_addr = EC32(dirs[2].VirtualAddress);
2898 2898
 
2899 2899
     while(dirs[2].Size) {
2900
-	struct vinfo_list vlist;
2901
-	const uint8_t *vptr, *baseptr;
2902
-    	uint32_t rva, res_sz;
2903
-
2904
-	memset(&vlist, 0, sizeof(vlist));
2905
-    	findres(0x10, 0xffffffff, EC32(dirs[2].VirtualAddress), map, peinfo->section, peinfo->nsections, hdr_size, versioninfo_cb, &vlist);
2906
-	if(!vlist.count) break; /* No version_information */
2907
-	if(cli_hashset_init(&peinfo->vinfo, 32, 80)) {
2908
-	    cli_errmsg("cli_peheader: Unable to init vinfo hashset\n");
2909
-	    free(section_hdr);
2910
-	    free(peinfo->section);
2911
-	    peinfo->section = NULL;
2912
-	    return -1;
2913
-	}
2914
-
2915
-	err = 0;
2916
-	for(i=0; i<vlist.count; i++) { /* enum all version_information res - RESUMABLE */
2917
-	    cli_dbgmsg("cli_peheader: parsing version info @ rva %x (%u/%u)\n", vlist.rvas[i], i+1, vlist.count);
2918
-	    rva = cli_rawaddr(vlist.rvas[i], peinfo->section, peinfo->nsections, &err, fsize, hdr_size);
2919
-	    if(err)
2920
-		continue;
2921
-
2922
-	    if(!(vptr = fmap_need_off_once(map, rva, 16)))
2923
-		continue;
2924
-
2925
-	    baseptr = vptr - rva;
2926
-	    /* parse resource */
2927
-	    rva = cli_readint32(vptr); /* ptr to version_info */
2928
-	    res_sz = cli_readint32(vptr+4); /* sizeof(resource) */
2929
-	    rva = cli_rawaddr(rva, peinfo->section, peinfo->nsections, &err, fsize, hdr_size);
2930
-	    if(err)
2931
-		continue;
2932
-	    if(!(vptr = fmap_need_off_once(map, rva, res_sz)))
2933
-		continue;
2934
-	    
2935
-	    while(res_sz>4) { /* look for version_info - NOT RESUMABLE (expecting exactly one versioninfo) */
2936
-		uint32_t vinfo_sz, vinfo_val_sz, got_varfileinfo = 0;
2937
-
2938
-		vinfo_sz = vinfo_val_sz = cli_readint32(vptr);
2939
-		vinfo_sz &= 0xffff;
2940
-		if(vinfo_sz > res_sz)
2941
-		    break; /* the content is larger than the container */
2942
-
2943
-		vinfo_val_sz >>= 16;
2944
-		if(vinfo_sz <= 6 + 0x20 + 2 + 0x34 ||
2945
-		   vinfo_val_sz != 0x34 || 
2946
-		   memcmp(vptr+6, "V\0S\0_\0V\0E\0R\0S\0I\0O\0N\0_\0I\0N\0F\0O\0\0\0", 0x20) ||
2947
-		   (unsigned int)cli_readint32(vptr + 0x28) != 0xfeef04bd) {
2948
-		    /* - there should be enough room for the header(6), the key "VS_VERSION_INFO"(20), the padding(2) and the value(34)
2949
-		     * - the value should be sizeof(fixedfileinfo)
2950
-		     * - the key should match
2951
-		     * - there should be some proper magic for fixedfileinfo */
2952
-		    break; /* there's no point in looking further */
2953
-		}
2954
-
2955
-		/* move to the end of fixedfileinfo where the child elements are located */
2956
-		vptr += 6 + 0x20 + 2 + 0x34;
2957
-		vinfo_sz -= 6 + 0x20 + 2 + 0x34;
2958
-
2959
-		while(vinfo_sz > 6) { /* look for stringfileinfo - NOT RESUMABLE (expecting at most one stringfileinfo) */
2960
-		    uint32_t sfi_sz = cli_readint32(vptr) & 0xffff;
2900
+        struct vinfo_list vlist;
2901
+        const uint8_t *vptr, *baseptr;
2902
+        uint32_t rva, res_sz;
2961 2903
 
2962
-		    if(sfi_sz > vinfo_sz)
2963
-			break; /* the content is larger than the container */
2904
+        memset(&vlist, 0, sizeof(vlist));
2905
+        findres(0x10, 0xffffffff, EC32(dirs[2].VirtualAddress), map, peinfo->section, peinfo->nsections, hdr_size, versioninfo_cb, &vlist);
2906
+        if(!vlist.count)
2907
+            break; /* No version_information */
2964 2908
 
2965
-		    if(!got_varfileinfo && sfi_sz > 6 + 0x18 && !memcmp(vptr+6, "V\0a\0r\0F\0i\0l\0e\0I\0n\0f\0o\0\0\0", 0x18)) {
2966
-			/* skip varfileinfo as it sometimes appear before stringtableinfo */
2967
-			vptr += sfi_sz;
2968
-			vinfo_sz -= sfi_sz;
2969
-			got_varfileinfo = 1;
2970
-			continue;
2971
-		    }
2972
-
2973
-		    if(sfi_sz <= 6 + 0x1e || memcmp(vptr+6, "S\0t\0r\0i\0n\0g\0F\0i\0l\0e\0I\0n\0f\0o\0\0\0", 0x1e)) {
2974
-			/* - there should be enough room for the header(6) and the key "StringFileInfo"(1e)
2975
-			 * - the key should match */
2976
-			break; /* this is an implicit hard fail: parent is not resumable */
2977
-		    }
2978
-
2979
-		    /* move to the end of stringfileinfo where the child elements are located */
2980
-		    vptr += 6 + 0x1e;
2981
-		    sfi_sz -= 6 + 0x1e;
2982
-
2983
-		    while(sfi_sz > 6) { /* enum all stringtables - RESUMABLE */
2984
-			uint32_t st_sz = cli_readint32(vptr) & 0xffff;
2985
-			const uint8_t *next_vptr = vptr + st_sz;
2986
-			uint32_t next_sfi_sz = sfi_sz - st_sz;
2909
+        if(cli_hashset_init(&peinfo->vinfo, 32, 80)) {
2910
+            cli_errmsg("cli_peheader: Unable to init vinfo hashset\n");
2911
+            free(section_hdr);
2912
+            free(peinfo->section);
2913
+            peinfo->section = NULL;
2914
+            return -1;
2915
+        }
2987 2916
 
2988
-			if(st_sz > sfi_sz || st_sz <= 24) {
2989
-			    /* - the content is larger than the container
2990
-			       - there's no room for a stringtables (headers(6) + key(16) + padding(2)) */
2991
-			    break; /* this is an implicit hard fail: parent is not resumable */
2992
-			}
2917
+        err = 0;
2918
+        for(i=0; i<vlist.count; i++) { /* enum all version_information res - RESUMABLE */
2919
+            cli_dbgmsg("cli_peheader: parsing version info @ rva %x (%u/%u)\n", vlist.rvas[i], i+1, vlist.count);
2920
+            rva = cli_rawaddr(vlist.rvas[i], peinfo->section, peinfo->nsections, &err, fsize, hdr_size);
2921
+            if(err)
2922
+                continue;
2923
+
2924
+            if(!(vptr = fmap_need_off_once(map, rva, 16)))
2925
+                continue;
2926
+
2927
+            baseptr = vptr - rva;
2928
+            /* parse resource */
2929
+            rva = cli_readint32(vptr); /* ptr to version_info */
2930
+            res_sz = cli_readint32(vptr+4); /* sizeof(resource) */
2931
+            rva = cli_rawaddr(rva, peinfo->section, peinfo->nsections, &err, fsize, hdr_size);
2932
+            if(err)
2933
+                continue;
2934
+            if(!(vptr = fmap_need_off_once(map, rva, res_sz)))
2935
+                continue;
2936
+            
2937
+            while(res_sz>4) { /* look for version_info - NOT RESUMABLE (expecting exactly one versioninfo) */
2938
+                uint32_t vinfo_sz, vinfo_val_sz, got_varfileinfo = 0;
2939
+
2940
+                vinfo_sz = vinfo_val_sz = cli_readint32(vptr);
2941
+                vinfo_sz &= 0xffff;
2942
+                if(vinfo_sz > res_sz)
2943
+                    break; /* the content is larger than the container */
2944
+
2945
+                vinfo_val_sz >>= 16;
2946
+                if(vinfo_sz <= 6 + 0x20 + 2 + 0x34 ||
2947
+                   vinfo_val_sz != 0x34 || 
2948
+                   memcmp(vptr+6, "V\0S\0_\0V\0E\0R\0S\0I\0O\0N\0_\0I\0N\0F\0O\0\0\0", 0x20) ||
2949
+                   (unsigned int)cli_readint32(vptr + 0x28) != 0xfeef04bd) {
2950
+                    /* - there should be enough room for the header(6), the key "VS_VERSION_INFO"(20), the padding(2) and the value(34)
2951
+                     * - the value should be sizeof(fixedfileinfo)
2952
+                     * - the key should match
2953
+                     * - there should be some proper magic for fixedfileinfo */
2954
+                    break; /* there's no point in looking further */
2955
+                }
2993 2956
 
2994
-			/* move to the end of stringtable where the child elements are located */
2995
-			vptr += 24;
2996
-			st_sz -= 24;
2997
-
2998
-			while(st_sz > 6) {  /* enum all strings - RESUMABLE */
2999
-			    uint32_t s_sz, s_key_sz, s_val_sz;
3000
-
3001
-			    s_sz = (cli_readint32(vptr) & 0xffff) + 3;
3002
-			    s_sz &= ~3;
3003
-			    if(s_sz > st_sz || s_sz <= 6 + 2 + 8) {
3004
-				/* - the content is larger than the container
3005
-				 * - there's no room for a minimal string
3006
-				 * - there's no room for the value */
3007
-				st_sz = 0;
3008
-				sfi_sz = 0;
3009
-				break; /* force a hard fail */
3010
-			    }
3011
-
3012
-			    /* ~wcstrlen(key) */
3013
-			    for(s_key_sz = 6; s_key_sz+1 < s_sz; s_key_sz += 2) {
3014
-				if(vptr[s_key_sz] || vptr[s_key_sz+1]) continue;
3015
-				s_key_sz += 2;
3016
-				break;
3017
-			    }
3018
-
3019
-			    s_key_sz += 3;
3020
-			    s_key_sz &= ~3;
3021
-
3022
-			    if(s_key_sz >= s_sz) {
3023
-				/* key overflow */
3024
-				vptr += s_sz;
3025
-				st_sz -= s_sz;
3026
-				continue;
3027
-			    }
3028
-
3029
-			    s_val_sz = s_sz - s_key_sz;
3030
-			    s_key_sz -= 6;
3031
-
3032
-			    if(s_val_sz <= 2) {
3033
-				/* skip unset value */
3034
-				vptr += s_sz;
3035
-				st_sz -= s_sz;
3036
-				continue;
3037
-			    }
3038
-
3039
-			    if(cli_hashset_addkey(&peinfo->vinfo, (uint32_t)(vptr - baseptr + 6))) {
3040
-				cli_errmsg("cli_peheader: Unable to add rva to vinfo hashset\n");
3041
-				cli_hashset_destroy(&peinfo->vinfo);
3042
-				free(section_hdr);
3043
-				free(peinfo->section);
3044
-				peinfo->section = NULL;
3045
-				return -1;
3046
-			    }
3047
-
3048
-			    if(cli_debug_flag) {
3049
-				char *k, *v, *s;
3050
-
3051
-				/* FIXME: skip too long strings */
3052
-				k = cli_utf16toascii((const char*)vptr + 6, s_key_sz);
3053
-				if(k) {
3054
-				    v = cli_utf16toascii((const char*)vptr + s_key_sz + 6, s_val_sz);
3055
-				    if(v) {
3056
-					s = cli_str2hex((const char*)vptr + 6, s_key_sz + s_val_sz - 6);
3057
-					if(s) {
3058
-					    cli_dbgmsg("VersionInfo (%x): '%s'='%s' - VI:%s\n", (uint32_t)(vptr - baseptr + 6), k, v, s);
3059
-					    free(s);
3060
-					}
3061
-					free(v);
3062
-				    }
3063
-				    free(k);
3064
-				}
3065
-			    }
3066
-			    vptr += s_sz;
3067
-			    st_sz -= s_sz;
3068
-			} /* enum all strings - RESUMABLE */
3069
-			vptr = next_vptr;
3070
-			sfi_sz = next_sfi_sz * (sfi_sz != 0);
3071
-		    } /* enum all stringtables - RESUMABLE */
3072
-		    break;
3073
-		} /* look for stringfileinfo - NOT RESUMABLE */
3074
-		break;
3075
-	    } /* look for version_info - NOT RESUMABLE */
3076
-	} /* enum all version_information res - RESUMABLE */
3077
-	break;
2957
+                /* move to the end of fixedfileinfo where the child elements are located */
2958
+                vptr += 6 + 0x20 + 2 + 0x34;
2959
+                vinfo_sz -= 6 + 0x20 + 2 + 0x34;
2960
+
2961
+                while(vinfo_sz > 6) { /* look for stringfileinfo - NOT RESUMABLE (expecting at most one stringfileinfo) */
2962
+                    uint32_t sfi_sz = cli_readint32(vptr) & 0xffff;
2963
+
2964
+                    if(sfi_sz > vinfo_sz)
2965
+                        break; /* the content is larger than the container */
2966
+
2967
+                    if(!got_varfileinfo && sfi_sz > 6 + 0x18 && !memcmp(vptr+6, "V\0a\0r\0F\0i\0l\0e\0I\0n\0f\0o\0\0\0", 0x18)) {
2968
+                        /* skip varfileinfo as it sometimes appear before stringtableinfo */
2969
+                        vptr += sfi_sz;
2970
+                        vinfo_sz -= sfi_sz;
2971
+                        got_varfileinfo = 1;
2972
+                        continue;
2973
+                    }
2974
+
2975
+                    if(sfi_sz <= 6 + 0x1e || memcmp(vptr+6, "S\0t\0r\0i\0n\0g\0F\0i\0l\0e\0I\0n\0f\0o\0\0\0", 0x1e)) {
2976
+                        /* - there should be enough room for the header(6) and the key "StringFileInfo"(1e)
2977
+                         * - the key should match */
2978
+                        break; /* this is an implicit hard fail: parent is not resumable */
2979
+                    }
2980
+
2981
+                    /* move to the end of stringfileinfo where the child elements are located */
2982
+                    vptr += 6 + 0x1e;
2983
+                    sfi_sz -= 6 + 0x1e;
2984
+
2985
+                    while(sfi_sz > 6) { /* enum all stringtables - RESUMABLE */
2986
+                        uint32_t st_sz = cli_readint32(vptr) & 0xffff;
2987
+                        const uint8_t *next_vptr = vptr + st_sz;
2988
+                        uint32_t next_sfi_sz = sfi_sz - st_sz;
2989
+
2990
+                        if(st_sz > sfi_sz || st_sz <= 24) {
2991
+                            /* - the content is larger than the container
2992
+                               - there's no room for a stringtables (headers(6) + key(16) + padding(2)) */
2993
+                            break; /* this is an implicit hard fail: parent is not resumable */
2994
+                        }
2995
+
2996
+                        /* move to the end of stringtable where the child elements are located */
2997
+                        vptr += 24;
2998
+                        st_sz -= 24;
2999
+
3000
+                        while(st_sz > 6) {  /* enum all strings - RESUMABLE */
3001
+                            uint32_t s_sz, s_key_sz, s_val_sz;
3002
+
3003
+                            s_sz = (cli_readint32(vptr) & 0xffff) + 3;
3004
+                            s_sz &= ~3;
3005
+                            if(s_sz > st_sz || s_sz <= 6 + 2 + 8) {
3006
+                                /* - the content is larger than the container
3007
+                                 * - there's no room for a minimal string
3008
+                                 * - there's no room for the value */
3009
+                                st_sz = 0;
3010
+                                sfi_sz = 0;
3011
+                                break; /* force a hard fail */
3012
+                            }
3013
+
3014
+                            /* ~wcstrlen(key) */
3015
+                            for(s_key_sz = 6; s_key_sz+1 < s_sz; s_key_sz += 2) {
3016
+                                if(vptr[s_key_sz] || vptr[s_key_sz+1])
3017
+                                    continue;
3018
+
3019
+                                s_key_sz += 2;
3020
+                                break;
3021
+                            }
3022
+
3023
+                            s_key_sz += 3;
3024
+                            s_key_sz &= ~3;
3025
+
3026
+                            if(s_key_sz >= s_sz) {
3027
+                                /* key overflow */
3028
+                                vptr += s_sz;
3029
+                                st_sz -= s_sz;
3030
+                                continue;
3031
+                            }
3032
+
3033
+                            s_val_sz = s_sz - s_key_sz;
3034
+                            s_key_sz -= 6;
3035
+
3036
+                            if(s_val_sz <= 2) {
3037
+                                /* skip unset value */
3038
+                                vptr += s_sz;
3039
+                                st_sz -= s_sz;
3040
+                                continue;
3041
+                            }
3042
+
3043
+                            if(cli_hashset_addkey(&peinfo->vinfo, (uint32_t)(vptr - baseptr + 6))) {
3044
+                                cli_errmsg("cli_peheader: Unable to add rva to vinfo hashset\n");
3045
+                                cli_hashset_destroy(&peinfo->vinfo);
3046
+                                free(section_hdr);
3047
+                                free(peinfo->section);
3048
+                                peinfo->section = NULL;
3049
+                                return -1;
3050
+                            }
3051
+
3052
+                            if(cli_debug_flag) {
3053
+                                char *k, *v, *s;
3054
+
3055
+                                /* FIXME: skip too long strings */
3056
+                                k = cli_utf16toascii((const char*)vptr + 6, s_key_sz);
3057
+                                if(k) {
3058
+                                    v = cli_utf16toascii((const char*)vptr + s_key_sz + 6, s_val_sz);
3059
+                                    if(v) {
3060
+                                        s = cli_str2hex((const char*)vptr + 6, s_key_sz + s_val_sz - 6);
3061
+                                        if(s) {
3062
+                                            cli_dbgmsg("VersionInfo (%x): '%s'='%s' - VI:%s\n", (uint32_t)(vptr - baseptr + 6), k, v, s);
3063
+                                            free(s);
3064
+                                        }
3065
+                                        free(v);
3066
+                                    }
3067
+                                    free(k);
3068
+                                }
3069
+                            }
3070
+                            vptr += s_sz;
3071
+                            st_sz -= s_sz;
3072
+                        } /* enum all strings - RESUMABLE */
3073
+                        vptr = next_vptr;
3074
+                        sfi_sz = next_sfi_sz * (sfi_sz != 0);
3075
+                    } /* enum all stringtables - RESUMABLE */
3076
+                    break;
3077
+                } /* look for stringfileinfo - NOT RESUMABLE */
3078
+                break;
3079
+            } /* look for version_info - NOT RESUMABLE */
3080
+        } /* enum all version_information res - RESUMABLE */
3081
+        break;
3078 3082
     } /* while(dirs[2].Size) */
3079 3083
 
3080 3084
     free(section_hdr);
... ...
@@ -2596,6 +2596,7 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
2596 2596
             if (type == CL_TYPE_PDF ||   /* file types we collect properties about */
2597 2597
                 type == CL_TYPE_MSOLE2 ||
2598 2598
                 type == CL_TYPE_MSEXE ||
2599
+                //type == CL_TYPE_ZIP ||
2599 2600
                 type == CL_TYPE_OOXML_WORD ||
2600 2601
                 type == CL_TYPE_OOXML_PPT ||
2601 2602
                 type == CL_TYPE_OOXML_XL) { 
... ...
@@ -124,7 +124,7 @@ static int scancws(cli_ctx *ctx, struct swf_file_hdr *hdr)
124 124
 	z_stream stream;
125 125
 	char inbuff[FILEBUFF], outbuff[FILEBUFF];
126 126
 	fmap_t *map = *ctx->fmap;
127
-	int offset = 8, ret, zret, outsize = 8, count;
127
+	int offset = 8, ret, zret, outsize = 8, count, zend;
128 128
 	char *tmpname;
129 129
 	int fd;
130 130
 
... ...
@@ -174,9 +174,11 @@ static int scancws(cli_ctx *ctx, struct swf_file_hdr *hdr)
174 174
 		close(fd);
175 175
 		if(cli_unlink(tmpname)) {
176 176
 		    free(tmpname);
177
+            inflateEnd(&stream);
177 178
 		    return CL_EUNLINK;
178 179
 		}
179 180
 		free(tmpname);
181
+        inflateEnd(&stream);
180 182
 		return CL_EUNPACK;
181 183
 	    }
182 184
 	    if(!ret)
... ...
@@ -205,7 +207,9 @@ static int scancws(cli_ctx *ctx, struct swf_file_hdr *hdr)
205 205
 	stream.avail_out = FILEBUFF;
206 206
     } while(zret == Z_OK);
207 207
 
208
-    if((zret != Z_STREAM_END && zret != Z_OK) || (zret = inflateEnd(&stream)) != Z_OK) {
208
+    zend = inflateEnd(&stream);
209
+
210
+    if((zret != Z_STREAM_END && zret != Z_OK) || zend != Z_OK) {
209 211
         /*
210 212
          * outsize is initialized to 8, it being 8 here means that we couldn't even read a single byte.
211 213
          * If outsize > 8, then we have data. Let's scan what we have.
... ...
@@ -74,7 +74,7 @@ const char *fp_ident(void)
74 74
 
75 75
    if (sizeof(fp_digit) == sizeof(fp_word)) {
76 76
       strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n", 
77
-              sizeof(buf)-1);
77
+              sizeof(buf)-strlen(buf)-1);
78 78
    }
79 79
    return buf;
80 80
 }
... ...
@@ -53,14 +53,6 @@
53 53
 #define UNZIP_PRIVATE
54 54
 #include "unzip.h"
55 55
 
56
-typedef struct zip_request {
57
-    const char *name;
58
-    size_t namelen;
59
-    uint32_t loff;
60
-
61
-    int found;
62
-} zip_request_t;
63
-
64 56
 static int wrap_inflateinit2(void *a, int b) {
65 57
   return inflateInit2(a, b);
66 58
 }
... ...
@@ -427,7 +419,7 @@ static unsigned int lhdr(fmap_t *map, uint32_t loff,uint32_t zsize, unsigned int
427 427
   return zip-lh;
428 428
 }
429 429
 
430
-static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned int *fu, unsigned int fc, int *ret, cli_ctx *ctx, char *tmpd, zip_request_t *request) {
430
+static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned int *fu, unsigned int fc, int *ret, cli_ctx *ctx, char *tmpd, struct zip_requests *requests) {
431 431
   char name[256];
432 432
   int last = 0;
433 433
   const uint8_t *ch;
... ...
@@ -447,7 +439,7 @@ static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned in
447 447
   }
448 448
 
449 449
   name[0]='\0';
450
-  if((cli_debug_flag && !last) || request) {
450
+  if((cli_debug_flag && !last) || requests) {
451 451
       unsigned int size = (CH_flen>=sizeof(name))?sizeof(name)-1:CH_flen;
452 452
       const char *src = fmap_need_off_once(map, coff, size);
453 453
       if(src) {
... ...
@@ -470,16 +462,26 @@ static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned in
470 470
   }
471 471
   coff+=CH_clen;
472 472
 
473
-  if (!request) {
473
+  if (!requests) {
474 474
       if(CH_off<zsize-SIZEOF_LH) {
475 475
           lhdr(map, CH_off, zsize-CH_off, fu, fc, ch, ret, ctx, tmpd, 1, zip_scan_cb);
476 476
       } else cli_dbgmsg("cli_unzip: ch - local hdr out of file\n");
477 477
   }
478 478
   else {
479
-      size_t len = MIN(sizeof(name)-1, request->namelen);
480
-      if (!last && !strncmp(request->name, name, len)) {
481
-          request->found = 1;
482
-          request->loff = CH_off;
479
+      int i;
480
+      size_t len;
481
+
482
+      if (!last) {
483
+          for (i = 0; i < requests->namecnt; ++i) {
484
+              cli_dbgmsg("checking for %i: %s\n", i, requests->names[i]);
485
+
486
+              len = MIN(sizeof(name)-1, requests->namelens[i]);      
487
+              if (!strncmp(requests->names[i], name, len)) {
488
+                  requests->match = 1;
489
+                  requests->found = i;
490
+                  requests->loff = CH_off;
491
+              }
492
+          }
483 493
       }
484 494
   }
485 495
 
... ...
@@ -603,27 +605,46 @@ int cli_unzip_single(cli_ctx *ctx, off_t lhoffl) {
603 603
     return unzip_single_internal(ctx, lhoffl, zip_scan_cb);
604 604
 }
605 605
 
606
-int unzip_search(cli_ctx *ctx, const char *name, size_t nlen, uint32_t *loff)
606
+int unzip_search_add(struct zip_requests *requests, const char *name, size_t nlen)
607
+{
608
+    cli_dbgmsg("in unzip_search_add\n");
609
+
610
+    if (requests->namecnt >= MAX_ZIP_REQUESTS) {
611
+        cli_dbgmsg("DEBUGGING MESSAGE GOES HERE!\n");
612
+        return CL_BREAK;
613
+    }
614
+
615
+    cli_dbgmsg("unzip_search_add: adding %s (len %llu)\n", name, (long long unsigned)nlen);
616
+
617
+    requests->names[requests->namecnt] = name;
618
+    requests->namelens[requests->namecnt] = nlen;
619
+    requests->namecnt++;
620
+
621
+    return CL_SUCCESS;
622
+}
623
+
624
+int unzip_search(cli_ctx *ctx, fmap_t *map, struct zip_requests *requests)
607 625
 {
608 626
     unsigned int fc = 0;
609
-    fmap_t *map;
627
+    fmap_t *zmap = map;
610 628
     size_t fsize;
611 629
     uint32_t coff = 0;
612 630
     const char *ptr;
613
-    zip_request_t request; 
614 631
     int ret = CL_CLEAN;
615 632
 #if HAVE_JSON
616 633
     uint32_t toval = 0;
617 634
 #endif
618
-
619 635
     cli_dbgmsg("in unzip_search\n");
620
-    if (!ctx) {
636
+
637
+    if ((!ctx && !map) || !requests) {
621 638
         return CL_ENULLARG;
622 639
     }
623 640
 
624
-    map = *ctx->fmap;
625
-    fsize = map->len;
626
-    if(sizeof(off_t)!=sizeof(uint32_t) && fsize!=map->len) {
641
+    /* get priority to given map over *ctx->fmap */
642
+    if (ctx && !map)
643
+        zmap = *ctx->fmap;
644
+    fsize = zmap->len;
645
+    if(sizeof(off_t)!=sizeof(uint32_t) && fsize!=zmap->len) {
627 646
         cli_dbgmsg("unzip_search: file too big\n");
628 647
         return CL_CLEAN;
629 648
     }
... ...
@@ -633,7 +654,7 @@ int unzip_search(cli_ctx *ctx, const char *name, size_t nlen, uint32_t *loff)
633 633
     }
634 634
 
635 635
     for(coff=fsize-22 ; coff>0 ; coff--) { /* sizeof(EOC)==22 */
636
-        if(!(ptr = fmap_need_off_once(map, coff, 20)))
636
+        if(!(ptr = fmap_need_off_once(zmap, coff, 20)))
637 637
             continue;
638 638
         if(cli_readint32(ptr)==0x06054b50) {
639 639
             uint32_t chptr = cli_readint32(&ptr[16]);
... ...
@@ -643,25 +664,20 @@ int unzip_search(cli_ctx *ctx, const char *name, size_t nlen, uint32_t *loff)
643 643
         }
644 644
     }
645 645
 
646
-    request.name = name;
647
-    request.namelen = nlen;
648
-    request.found = 0;
649
-
650 646
     if(coff) {
651 647
         cli_dbgmsg("unzip_search: central @%x\n", coff);
652
-        while(ret==CL_CLEAN && (coff=chdr(map, coff, fsize, NULL, fc+1, &ret, ctx, NULL, &request))) {
653
-            if (request.found) {
654
-                *loff = request.loff;
648
+        while(ret==CL_CLEAN && (coff=chdr(zmap, coff, fsize, NULL, fc+1, &ret, ctx, NULL, requests))) {
649
+            if (requests->match) {
655 650
                 return CL_VIRUS;
656 651
             }
657 652
 
658 653
             fc++;
659
-            if (ctx->engine->maxfiles && fc >= ctx->engine->maxfiles) {
654
+            if (ctx && ctx->engine->maxfiles && fc >= ctx->engine->maxfiles) {
660 655
                 cli_dbgmsg("cli_unzip: Files limit reached (max: %u)\n", ctx->engine->maxfiles);
661 656
                 ret=CL_EMAXFILES;
662 657
             }
663 658
 #if HAVE_JSON
664
-            if (cli_json_timeout_cycle_check(ctx, (int *)(&toval)) != CL_SUCCESS) {
659
+            if (ctx && cli_json_timeout_cycle_check(ctx, (int *)(&toval)) != CL_SUCCESS) {
665 660
                 return CL_ETIMEOUT;
666 661
             }
667 662
 #endif
... ...
@@ -673,3 +689,26 @@ int unzip_search(cli_ctx *ctx, const char *name, size_t nlen, uint32_t *loff)
673 673
     return ret;
674 674
 }
675 675
 
676
+int unzip_search_single(cli_ctx *ctx, const char *name, size_t nlen, uint32_t *loff)
677
+{
678
+    struct zip_requests requests;
679
+    int ret;
680
+
681
+    cli_dbgmsg("in unzip_search_single\n");
682
+    if (!ctx) {
683
+        return CL_ENULLARG;
684
+    }
685
+
686
+    memset(&requests, 0, sizeof(struct zip_requests));
687
+
688
+    if ((ret = unzip_search_add(&requests, name, nlen)) != CL_SUCCESS) {
689
+        return ret;
690
+    }
691
+
692
+    if ((ret = unzip_search(ctx, NULL, &requests)) == CL_VIRUS) {
693
+        *loff = requests.loff;
694
+    }
695
+
696
+    return ret;
697
+}
698
+
... ...
@@ -25,15 +25,30 @@
25 25
 #include "clamav-config.h"
26 26
 #endif
27 27
 
28
+#include "others.h"
29
+
28 30
 typedef int (*zip_cb)(int fd, cli_ctx *ctx);
29 31
 #define zip_scan_cb cli_magic_scandesc
30 32
 
31
-#include "others.h"
33
+#define MAX_ZIP_REQUESTS 10
34
+struct zip_requests {
35
+    const char *names[MAX_ZIP_REQUESTS];
36
+    size_t namelens[MAX_ZIP_REQUESTS];
37
+    int namecnt;
38
+
39
+    uint32_t loff;
40
+    int found, match;
41
+};
42
+
32 43
 int cli_unzip(cli_ctx *);
33 44
 int cli_unzip_single_internal(cli_ctx *, off_t, zip_cb);
34
-int unzip_single_internal(cli_ctx *ctx, off_t lhoffl, zip_cb zcb);
45
+int unzip_single_internal(cli_ctx *, off_t, zip_cb);
35 46
 int cli_unzip_single(cli_ctx *, off_t);
36
-int unzip_search(cli_ctx *, const char *, size_t, uint32_t *);
47
+
48
+int unzip_search_add(struct zip_requests *, const char *, size_t);
49
+int unzip_search(cli_ctx *, fmap_t *, struct zip_requests *);
50
+int unzip_search_single(cli_ctx *, const char *, size_t, uint32_t *);
51
+
37 52
 
38 53
 #ifdef UNZIP_PRIVATE
39 54
 #define F_ENCR  (1<<0)
... ...
@@ -128,7 +128,10 @@ get_unicode_name(const char *name, int size, int big_endian)
128 128
 				*ret++ = '_';
129 129
 				*ret++ = (char)(name[i] + '0');
130 130
 			} else {
131
-				const uint16_t x = (uint16_t)((name[i] << 8) | name[i + 1]);
131
+				uint16_t x;
132
+				if ((i + 1) >= size)
133
+					break;
134
+				x = (uint16_t)((name[i] << 8) | name[i + 1]);
132 135
 
133 136
 				*ret++ = '_';
134 137
 				*ret++ = (char)('a'+((x&0xF)));
... ...
@@ -510,6 +513,7 @@ cli_vba_inflate(int fd, off_t offset, int *size)
510 510
 	if(b == NULL)
511 511
 		return NULL;
512 512
 
513
+	memset(buffer, 0, sizeof(buffer));
513 514
 	lseek(fd, offset+3, SEEK_SET); /* 1byte ?? , 2byte length ?? */
514 515
 	clean = TRUE;
515 516
 	pos = 0;
... ...
@@ -422,6 +422,8 @@ int cli_scanxar(cli_ctx *ctx)
422 422
     xmlTextReaderPtr reader = NULL;
423 423
     int a_hash, e_hash;
424 424
     unsigned char *a_cksum = NULL, *e_cksum = NULL;
425
+    void *a_hash_ctx = NULL, *e_hash_ctx = NULL;
426
+    char result[SHA1_HASH_SIZE];
425 427
 
426 428
     memset(&strm, 0x00, sizeof(z_stream));
427 429
 
... ...
@@ -537,8 +539,6 @@ int cli_scanxar(cli_ctx *ctx)
537 537
         unsigned char * blockp;
538 538
         void *a_sc, *e_sc;
539 539
         void *a_mc, *e_mc;
540
-        void *a_hash_ctx, *e_hash_ctx;
541
-        char result[SHA1_HASH_SIZE];
542 540
         char * expected;
543 541
 
544 542
         /* clean up temp file from previous loop iteration */
... ...
@@ -561,7 +561,11 @@ int cli_scanxar(cli_ctx *ctx)
561 561
 
562 562
 
563 563
         a_hash_ctx = xar_hash_init(a_hash, &a_sc, &a_mc);
564
+        if (a_hash_ctx == NULL)
565
+            goto exit_tmpfile;
564 566
         e_hash_ctx = xar_hash_init(e_hash, &e_sc, &e_mc);
567
+        if (e_hash_ctx == NULL)
568
+            goto exit_tmpfile;
565 569
 
566 570
         switch (encoding) {
567 571
         case CL_TYPE_GZ:
... ...
@@ -779,6 +783,7 @@ int cli_scanxar(cli_ctx *ctx)
779 779
 
780 780
         if (rc == CL_SUCCESS) {
781 781
             xar_hash_final(a_hash_ctx, result, a_hash);
782
+            a_hash_ctx = NULL;
782 783
             if (a_cksum != NULL) {
783 784
                 expected = cli_hex2str((char *)a_cksum);
784 785
                 if (xar_hash_check(a_hash, result, expected) != 0) {
... ...
@@ -789,9 +794,10 @@ int cli_scanxar(cli_ctx *ctx)
789 789
                 }
790 790
                 free(expected);
791 791
             }
792
+            xar_hash_final(e_hash_ctx, result, e_hash);
793
+            e_hash_ctx = NULL;
792 794
             if (e_cksum != NULL) {
793 795
                 if (do_extract_cksum) {
794
-                    xar_hash_final(e_hash_ctx, result, e_hash);
795 796
                     expected = cli_hex2str((char *)e_cksum);
796 797
                     if (xar_hash_check(e_hash, result, expected) != 0) {
797 798
                         cli_dbgmsg("cli_scanxar: extracted-checksum missing or mismatch.\n");
... ...
@@ -828,7 +834,11 @@ int cli_scanxar(cli_ctx *ctx)
828 828
 
829 829
  exit_tmpfile:
830 830
     xar_cleanup_temp_file(ctx, fd, tmpname);
831
-
831
+    if (a_hash_ctx != NULL)
832
+        xar_hash_final(a_hash_ctx, result, a_hash);
833
+    if (e_hash_ctx != NULL)
834
+        xar_hash_final(e_hash_ctx, result, e_hash);
835
+ 
832 836
  exit_reader:
833 837
     if (a_cksum != NULL)
834 838
         xmlFree(a_cksum);   
... ...
@@ -172,6 +172,7 @@ static unrar_fileheader_t *read_block(int fd, header_type hdr_type)
172 172
 	unrar_dbgmsg("UNRAR: Head Size: %.4x\n", file_header->head_size);
173 173
 	if(lseek(fd, file_header->next_offset, SEEK_SET) != file_header->next_offset) {
174 174
 	    unrar_dbgmsg("seek: %ld\n", file_header->next_offset);
175
+            free(file_header);
175 176
 	    return NULL;
176 177
 	}
177 178
 
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -19,6 +18,51 @@
19 19
 
20 20
 
21 21
 VPATH = @srcdir@
22
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
23
+am__make_running_with_option = \
24
+  case $${target_option-} in \
25
+      ?) ;; \
26
+      *) echo "am__make_running_with_option: internal error: invalid" \
27
+              "target option '$${target_option-}' specified" >&2; \
28
+         exit 1;; \
29
+  esac; \
30
+  has_opt=no; \
31
+  sane_makeflags=$$MAKEFLAGS; \
32
+  if $(am__is_gnu_make); then \
33
+    sane_makeflags=$$MFLAGS; \
34
+  else \
35
+    case $$MAKEFLAGS in \
36
+      *\\[\ \	]*) \
37
+        bs=\\; \
38
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
39
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
40
+    esac; \
41
+  fi; \
42
+  skip_next=no; \
43
+  strip_trailopt () \
44
+  { \
45
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
46
+  }; \
47
+  for flg in $$sane_makeflags; do \
48
+    test $$skip_next = yes && { skip_next=no; continue; }; \
49
+    case $$flg in \
50
+      *=*|--*) continue;; \
51
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
52
+      -*I?*) strip_trailopt 'I';; \
53
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
54
+      -*O?*) strip_trailopt 'O';; \
55
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
56
+      -*l?*) strip_trailopt 'l';; \
57
+      -[dEDm]) skip_next=yes;; \
58
+      -[JT]) skip_next=yes;; \
59
+    esac; \
60
+    case $$flg in \
61
+      *$$target_option*) has_opt=yes; break;; \
62
+    esac; \
63
+  done; \
64
+  test $$has_opt = yes
65
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
66
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
22 67
 pkgdatadir = $(datadir)/@PACKAGE@
23 68
 pkgincludedir = $(includedir)/@PACKAGE@
24 69
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -42,9 +86,9 @@ target_triplet = @target@
42 42
 @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la
43 43
 @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la
44 44
 subdir = libltdl
45
-DIST_COMMON = README $(am__include_HEADERS_DIST) \
46
-	$(am__ltdlinclude_HEADERS_DIST) $(srcdir)/Makefile.am \
47
-	$(srcdir)/Makefile.in COPYING.LIB
45
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
46
+	$(top_srcdir)/config/depcomp $(am__include_HEADERS_DIST) \
47
+	$(am__ltdlinclude_HEADERS_DIST) COPYING.LIB README
48 48
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
49 49
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
50 50
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -155,6 +199,7 @@ dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS)
155 155
 AM_V_lt = $(am__v_lt_@AM_V@)
156 156
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
157 157
 am__v_lt_0 = --silent
158
+am__v_lt_1 = 
158 159
 dld_link_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
159 160
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
160 161
 	$(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@
... ...
@@ -209,6 +254,18 @@ shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS)
209 209
 shl_load_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
210 210
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
211 211
 	$(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@
212
+AM_V_P = $(am__v_P_@AM_V@)
213
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
214
+am__v_P_0 = false
215
+am__v_P_1 = :
216
+AM_V_GEN = $(am__v_GEN_@AM_V@)
217
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
218
+am__v_GEN_0 = @echo "  GEN     " $@;
219
+am__v_GEN_1 = 
220
+AM_V_at = $(am__v_at_@AM_V@)
221
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
222
+am__v_at_0 = @
223
+am__v_at_1 = 
212 224
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
213 225
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
214 226
 am__depfiles_maybe = depfiles
... ...
@@ -221,20 +278,16 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
221 221
 	$(AM_CFLAGS) $(CFLAGS)
222 222
 AM_V_CC = $(am__v_CC_@AM_V@)
223 223
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
224
-am__v_CC_0 = @echo "  CC    " $@;
225
-AM_V_at = $(am__v_at_@AM_V@)
226
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
227
-am__v_at_0 = @
224
+am__v_CC_0 = @echo "  CC      " $@;
225
+am__v_CC_1 = 
228 226
 CCLD = $(CC)
229 227
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
230 228
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
231 229
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
232 230
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
233 231
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
234
-am__v_CCLD_0 = @echo "  CCLD  " $@;
235
-AM_V_GEN = $(am__v_GEN_@AM_V@)
236
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
237
-am__v_GEN_0 = @echo "  GEN   " $@;
232
+am__v_CCLD_0 = @echo "  CCLD    " $@;
233
+am__v_CCLD_1 = 
238 234
 SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \
239 235
 	$(dyld_la_SOURCES) $(libltdl_la_SOURCES) \
240 236
 	$(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \
... ...
@@ -243,10 +296,32 @@ DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \
243 243
 	$(dyld_la_SOURCES) $(libltdl_la_SOURCES) \
244 244
 	$(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \
245 245
 	$(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES)
246
+am__can_run_installinfo = \
247
+  case $$AM_UPDATE_INFO_DIR in \
248
+    n|no|NO) false;; \
249
+    *) (install-info --version) >/dev/null 2>&1;; \
250
+  esac
246 251
 am__include_HEADERS_DIST = ltdl.h
247 252
 am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \
248 253
 	libltdl/lt_dlloader.h
249 254
 HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS)
255
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
256
+# Read a list of newline-separated strings from the standard input,
257
+# and print each of them once, without duplicates.  Input order is
258
+# *not* preserved.
259
+am__uniquify_input = $(AWK) '\
260
+  BEGIN { nonempty = 0; } \
261
+  { items[$$0] = 1; nonempty = 1; } \
262
+  END { if (nonempty) { for (i in items) print i; }; } \
263
+'
264
+# Make sure the list of sources is unique.  This is necessary because,
265
+# e.g., the same source file might be shared among _SOURCES variables
266
+# for different programs/libraries.
267
+am__define_uniq_tagged_files = \
268
+  list='$(am__tagged_files)'; \
269
+  unique=`for i in $$list; do \
270
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
271
+  done | $(am__uniquify_input)`
250 272
 ETAGS = etags
251 273
 CTAGS = ctags
252 274
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -549,9 +624,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
549 549
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
550 550
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
551 551
 $(am__aclocal_m4_deps):
552
+
552 553
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
553 554
 	@$(NORMAL_INSTALL)
554
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
555 555
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
556 556
 	list2=; for p in $$list; do \
557 557
 	  if test -f $$p; then \
... ...
@@ -559,6 +634,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
559 559
 	  else :; fi; \
560 560
 	done; \
561 561
 	test -z "$$list2" || { \
562
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
563
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
562 564
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
563 565
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
564 566
 	}
... ...
@@ -574,35 +651,47 @@ uninstall-libLTLIBRARIES:
574 574
 
575 575
 clean-libLTLIBRARIES:
576 576
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
577
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
578
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
579
-	  test "$$dir" != "$$p" || dir=.; \
580
-	  echo "rm -f \"$${dir}/so_locations\""; \
581
-	  rm -f "$${dir}/so_locations"; \
582
-	done
577
+	@list='$(lib_LTLIBRARIES)'; \
578
+	locs=`for p in $$list; do echo $$p; done | \
579
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
580
+	      sort -u`; \
581
+	test -z "$$locs" || { \
582
+	  echo rm -f $${locs}; \
583
+	  rm -f $${locs}; \
584
+	}
583 585
 
584 586
 clean-noinstLTLIBRARIES:
585 587
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
586
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
587
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
588
-	  test "$$dir" != "$$p" || dir=.; \
589
-	  echo "rm -f \"$${dir}/so_locations\""; \
590
-	  rm -f "$${dir}/so_locations"; \
591
-	done
588
+	@list='$(noinst_LTLIBRARIES)'; \
589
+	locs=`for p in $$list; do echo $$p; done | \
590
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
591
+	      sort -u`; \
592
+	test -z "$$locs" || { \
593
+	  echo rm -f $${locs}; \
594
+	  rm -f $${locs}; \
595
+	}
596
+
592 597
 dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(EXTRA_dld_link_la_DEPENDENCIES) 
593 598
 	$(AM_V_CCLD)$(dld_link_la_LINK)  $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS)
599
+
594 600
 dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(EXTRA_dlopen_la_DEPENDENCIES) 
595 601
 	$(AM_V_CCLD)$(dlopen_la_LINK)  $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS)
602
+
596 603
 dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(EXTRA_dyld_la_DEPENDENCIES) 
597 604
 	$(AM_V_CCLD)$(dyld_la_LINK)  $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS)
605
+
598 606
 libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(EXTRA_libltdl_la_DEPENDENCIES) 
599 607
 	$(AM_V_CCLD)$(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS)
608
+
600 609
 libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(EXTRA_libltdlc_la_DEPENDENCIES) 
601 610
 	$(AM_V_CCLD)$(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS)
611
+
602 612
 load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(EXTRA_load_add_on_la_DEPENDENCIES) 
603 613
 	$(AM_V_CCLD)$(load_add_on_la_LINK)  $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS)
614
+
604 615
 loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(EXTRA_loadlibrary_la_DEPENDENCIES) 
605 616
 	$(AM_V_CCLD)$(loadlibrary_la_LINK)  $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS)
617
+
606 618
 shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(EXTRA_shl_load_la_DEPENDENCIES) 
607 619
 	$(AM_V_CCLD)$(shl_load_la_LINK)  $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS)
608 620
 
... ...
@@ -636,14 +725,14 @@ distclean-compile:
636 636
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
637 637
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
638 638
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
639
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
640 640
 
641 641
 .c.obj:
642 642
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
643 643
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
644 644
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
645 645
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
646
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
646
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
647 647
 
648 648
 .c.lo:
649 649
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -785,8 +874,11 @@ clean-libtool:
785 785
 	-rm -rf .libs _libs
786 786
 install-includeHEADERS: $(include_HEADERS)
787 787
 	@$(NORMAL_INSTALL)
788
-	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
789 788
 	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
789
+	if test -n "$$list"; then \
790
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
791
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
792
+	fi; \
790 793
 	for p in $$list; do \
791 794
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
792 795
 	  echo "$$d$$p"; \
... ...
@@ -803,8 +895,11 @@ uninstall-includeHEADERS:
803 803
 	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
804 804
 install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS)
805 805
 	@$(NORMAL_INSTALL)
806
-	test -z "$(ltdlincludedir)" || $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)"
807 806
 	@list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \
807
+	if test -n "$$list"; then \
808
+	  echo " $(MKDIR_P) '$(DESTDIR)$(ltdlincludedir)'"; \
809
+	  $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" || exit 1; \
810
+	fi; \
808 811
 	for p in $$list; do \
809 812
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
810 813
 	  echo "$$d$$p"; \
... ...
@@ -820,26 +915,15 @@ uninstall-ltdlincludeHEADERS:
820 820
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
821 821
 	dir='$(DESTDIR)$(ltdlincludedir)'; $(am__uninstall_files_from_dir)
822 822
 
823
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
824
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
825
-	unique=`for i in $$list; do \
826
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
827
-	  done | \
828
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
829
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
830
-	mkid -fID $$unique
831
-tags: TAGS
832
-
833
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
834
-		$(TAGS_FILES) $(LISP)
823
+ID: $(am__tagged_files)
824
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
825
+tags: tags-am
826
+TAGS: tags
827
+
828
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
835 829
 	set x; \
836 830
 	here=`pwd`; \
837
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
838
-	unique=`for i in $$list; do \
839
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
840
-	  done | \
841
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
842
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
831
+	$(am__define_uniq_tagged_files); \
843 832
 	shift; \
844 833
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
845 834
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -851,15 +935,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
851 851
 	      $$unique; \
852 852
 	  fi; \
853 853
 	fi
854
-ctags: CTAGS
855
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
856
-		$(TAGS_FILES) $(LISP)
857
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
858
-	unique=`for i in $$list; do \
859
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
860
-	  done | \
861
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
862
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
854
+ctags: ctags-am
855
+
856
+CTAGS: ctags
857
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
858
+	$(am__define_uniq_tagged_files); \
863 859
 	test -z "$(CTAGS_ARGS)$$unique" \
864 860
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
865 861
 	     $$unique
... ...
@@ -868,6 +948,21 @@ GTAGS:
868 868
 	here=`$(am__cd) $(top_builddir) && pwd` \
869 869
 	  && $(am__cd) $(top_srcdir) \
870 870
 	  && gtags -i $(GTAGS_ARGS) "$$here"
871
+cscopelist: cscopelist-am
872
+
873
+cscopelist-am: $(am__tagged_files)
874
+	list='$(am__tagged_files)'; \
875
+	case "$(srcdir)" in \
876
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
877
+	  *) sdir=$(subdir)/$(srcdir) ;; \
878
+	esac; \
879
+	for i in $$list; do \
880
+	  if test -f "$$i"; then \
881
+	    echo "$(subdir)/$$i"; \
882
+	  else \
883
+	    echo "$$sdir/$$i"; \
884
+	  fi; \
885
+	done >> $(top_builddir)/cscope.files
871 886
 
872 887
 distclean-tags:
873 888
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -1018,20 +1113,20 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1018 1018
 
1019 1019
 .MAKE: all check install install-am install-strip
1020 1020
 
1021
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
1021
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
1022 1022
 	clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
1023
-	ctags distclean distclean-compile distclean-generic \
1024
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
1025
-	html-am info info-am install install-am install-data \
1026
-	install-data-am install-dvi install-dvi-am install-exec \
1027
-	install-exec-am install-html install-html-am \
1023
+	cscopelist-am ctags ctags-am distclean distclean-compile \
1024
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
1025
+	dvi-am html html-am info info-am install install-am \
1026
+	install-data install-data-am install-dvi install-dvi-am \
1027
+	install-exec install-exec-am install-html install-html-am \
1028 1028
 	install-includeHEADERS install-info install-info-am \
1029 1029
 	install-libLTLIBRARIES install-ltdlincludeHEADERS install-man \
1030 1030
 	install-pdf install-pdf-am install-ps install-ps-am \
1031 1031
 	install-strip installcheck installcheck-am installdirs \
1032 1032
 	maintainer-clean maintainer-clean-generic mostlyclean \
1033 1033
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
1034
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
1034
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
1035 1035
 	uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1036 1036
 	uninstall-ltdlincludeHEADERS
1037 1037
 
... ...
@@ -2,7 +2,7 @@ AX_CHECK_UNAME_SYSCALL
2 2
 AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
3 3
 AC_SEARCH_LIBS([gethostent],[nsl], [(LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl")])
4 4
 
5
-AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise])
5
+AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise getnameinfo])
6 6
 AC_FUNC_FSEEKO
7 7
 
8 8
 dnl Check if anon maps are available, check if we can determine the page size
... ...
@@ -143,7 +143,7 @@ const struct clam_option __clam_options[] = {
143 143
     { NULL, "printsrc", 'p', CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Print source code of bytecode", ""},
144 144
     { NULL, "printbcir", 'c', CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Print IR of bytecode signature", ""},
145 145
     { NULL, "input", 'r', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMBC, "Input file to run the bytecode n", ""},
146
-    { NULL, "trace", 'l', CLOPT_TYPE_NUMBER, MATCH_NUMBER, 7, NULL, 0, OPT_CLAMBC, "bytecode trace level",""},
146
+    { NULL, "trace", 'T', CLOPT_TYPE_NUMBER, MATCH_NUMBER, 7, NULL, 0, OPT_CLAMBC, "bytecode trace level",""},
147 147
     { NULL, "no-trace-showsource", 's', CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Don't show source line during tracing",""},
148 148
 
149 149
     { NULL, "archive-verbose", 'a', CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMSCAN, "", ""},
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -34,6 +33,51 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
38
+am__make_running_with_option = \
39
+  case $${target_option-} in \
40
+      ?) ;; \
41
+      *) echo "am__make_running_with_option: internal error: invalid" \
42
+              "target option '$${target_option-}' specified" >&2; \
43
+         exit 1;; \
44
+  esac; \
45
+  has_opt=no; \
46
+  sane_makeflags=$$MAKEFLAGS; \
47
+  if $(am__is_gnu_make); then \
48
+    sane_makeflags=$$MFLAGS; \
49
+  else \
50
+    case $$MAKEFLAGS in \
51
+      *\\[\ \	]*) \
52
+        bs=\\; \
53
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
54
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
55
+    esac; \
56
+  fi; \
57
+  skip_next=no; \
58
+  strip_trailopt () \
59
+  { \
60
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
61
+  }; \
62
+  for flg in $$sane_makeflags; do \
63
+    test $$skip_next = yes && { skip_next=no; continue; }; \
64
+    case $$flg in \
65
+      *=*|--*) continue;; \
66
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
67
+      -*I?*) strip_trailopt 'I';; \
68
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
69
+      -*O?*) strip_trailopt 'O';; \
70
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
71
+      -*l?*) strip_trailopt 'l';; \
72
+      -[dEDm]) skip_next=yes;; \
73
+      -[JT]) skip_next=yes;; \
74
+    esac; \
75
+    case $$flg in \
76
+      *$$target_option*) has_opt=yes; break;; \
77
+    esac; \
78
+  done; \
79
+  test $$has_opt = yes
80
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
81
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
37 82
 pkgdatadir = $(datadir)/@PACKAGE@
38 83
 pkgincludedir = $(includedir)/@PACKAGE@
39 84
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -55,7 +99,8 @@ host_triplet = @host@
55 55
 target_triplet = @target@
56 56
 bin_PROGRAMS = sigtool$(EXEEXT)
57 57
 subdir = sigtool
58
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
58
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
59
+	$(top_srcdir)/config/depcomp
59 60
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
60 61
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
61 62
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -140,6 +185,19 @@ sigtool_LDADD = $(LDADD)
140 140
 AM_V_lt = $(am__v_lt_@AM_V@)
141 141
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
142 142
 am__v_lt_0 = --silent
143
+am__v_lt_1 = 
144
+AM_V_P = $(am__v_P_@AM_V@)
145
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
146
+am__v_P_0 = false
147
+am__v_P_1 = :
148
+AM_V_GEN = $(am__v_GEN_@AM_V@)
149
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
150
+am__v_GEN_0 = @echo "  GEN     " $@;
151
+am__v_GEN_1 = 
152
+AM_V_at = $(am__v_at_@AM_V@)
153
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
154
+am__v_at_0 = @
155
+am__v_at_1 = 
143 156
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
144 157
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
145 158
 am__depfiles_maybe = depfiles
... ...
@@ -152,22 +210,40 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
152 152
 	$(AM_CFLAGS) $(CFLAGS)
153 153
 AM_V_CC = $(am__v_CC_@AM_V@)
154 154
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
155
-am__v_CC_0 = @echo "  CC    " $@;
156
-AM_V_at = $(am__v_at_@AM_V@)
157
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
158
-am__v_at_0 = @
155
+am__v_CC_0 = @echo "  CC      " $@;
156
+am__v_CC_1 = 
159 157
 CCLD = $(CC)
160 158
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
161 159
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
162 160
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
163 161
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
164 162
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
165
-am__v_CCLD_0 = @echo "  CCLD  " $@;
166
-AM_V_GEN = $(am__v_GEN_@AM_V@)
167
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
168
-am__v_GEN_0 = @echo "  GEN   " $@;
163
+am__v_CCLD_0 = @echo "  CCLD    " $@;
164
+am__v_CCLD_1 = 
169 165
 SOURCES = $(sigtool_SOURCES)
170 166
 DIST_SOURCES = $(sigtool_SOURCES)
167
+am__can_run_installinfo = \
168
+  case $$AM_UPDATE_INFO_DIR in \
169
+    n|no|NO) false;; \
170
+    *) (install-info --version) >/dev/null 2>&1;; \
171
+  esac
172
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
173
+# Read a list of newline-separated strings from the standard input,
174
+# and print each of them once, without duplicates.  Input order is
175
+# *not* preserved.
176
+am__uniquify_input = $(AWK) '\
177
+  BEGIN { nonempty = 0; } \
178
+  { items[$$0] = 1; nonempty = 1; } \
179
+  END { if (nonempty) { for (i in items) print i; }; } \
180
+'
181
+# Make sure the list of sources is unique.  This is necessary because,
182
+# e.g., the same source file might be shared among _SOURCES variables
183
+# for different programs/libraries.
184
+am__define_uniq_tagged_files = \
185
+  list='$(am__tagged_files)'; \
186
+  unique=`for i in $$list; do \
187
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
188
+  done | $(am__uniquify_input)`
171 189
 ETAGS = etags
172 190
 CTAGS = ctags
173 191
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
... ...
@@ -426,14 +502,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
426 426
 $(am__aclocal_m4_deps):
427 427
 install-binPROGRAMS: $(bin_PROGRAMS)
428 428
 	@$(NORMAL_INSTALL)
429
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
430 429
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
430
+	if test -n "$$list"; then \
431
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
432
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
433
+	fi; \
431 434
 	for p in $$list; do echo "$$p $$p"; done | \
432 435
 	sed 's/$(EXEEXT)$$//' | \
433
-	while read p p1; do if test -f $$p || test -f $$p1; \
434
-	  then echo "$$p"; echo "$$p"; else :; fi; \
436
+	while read p p1; do if test -f $$p \
437
+	 || test -f $$p1 \
438
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
435 439
 	done | \
436
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
440
+	sed -e 'p;s,.*/,,;n;h' \
441
+	    -e 's|.*|.|' \
437 442
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
438 443
 	sed 'N;N;N;s,\n, ,g' | \
439 444
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
... ...
@@ -454,7 +535,8 @@ uninstall-binPROGRAMS:
454 454
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
455 455
 	files=`for p in $$list; do echo "$$p"; done | \
456 456
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
457
-	      -e 's/$$/$(EXEEXT)/' `; \
457
+	      -e 's/$$/$(EXEEXT)/' \
458
+	`; \
458 459
 	test -n "$$list" || exit 0; \
459 460
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
460 461
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
... ...
@@ -483,6 +565,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
483 483
 	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
484 484
 	  done; \
485 485
 	done; rm -f c$${pid}_.???; exit $$bad
486
+
486 487
 sigtool$(EXEEXT): $(sigtool_OBJECTS) $(sigtool_DEPENDENCIES) $(EXTRA_sigtool_DEPENDENCIES) 
487 488
 	@rm -f sigtool$(EXEEXT)
488 489
 	$(AM_V_CCLD)$(LINK) $(sigtool_OBJECTS) $(sigtool_LDADD) $(LIBS)
... ...
@@ -507,14 +590,14 @@ distclean-compile:
507 507
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
508 508
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
509 509
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
510
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
510
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
511 511
 
512 512
 .c.obj:
513 513
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
514 514
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
515 515
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
516 516
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
517
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
517
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
518 518
 
519 519
 .c.lo:
520 520
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -613,26 +696,15 @@ mostlyclean-libtool:
613 613
 clean-libtool:
614 614
 	-rm -rf .libs _libs
615 615
 
616
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
617
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
618
-	unique=`for i in $$list; do \
619
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
620
-	  done | \
621
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
622
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
623
-	mkid -fID $$unique
624
-tags: TAGS
625
-
626
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
627
-		$(TAGS_FILES) $(LISP)
616
+ID: $(am__tagged_files)
617
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
618
+tags: tags-am
619
+TAGS: tags
620
+
621
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
628 622
 	set x; \
629 623
 	here=`pwd`; \
630
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
631
-	unique=`for i in $$list; do \
632
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
633
-	  done | \
634
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
635
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
624
+	$(am__define_uniq_tagged_files); \
636 625
 	shift; \
637 626
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
638 627
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -644,15 +716,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
644 644
 	      $$unique; \
645 645
 	  fi; \
646 646
 	fi
647
-ctags: CTAGS
648
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
649
-		$(TAGS_FILES) $(LISP)
650
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
651
-	unique=`for i in $$list; do \
652
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
653
-	  done | \
654
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
655
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
647
+ctags: ctags-am
648
+
649
+CTAGS: ctags
650
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
651
+	$(am__define_uniq_tagged_files); \
656 652
 	test -z "$(CTAGS_ARGS)$$unique" \
657 653
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
658 654
 	     $$unique
... ...
@@ -661,6 +729,21 @@ GTAGS:
661 661
 	here=`$(am__cd) $(top_builddir) && pwd` \
662 662
 	  && $(am__cd) $(top_srcdir) \
663 663
 	  && gtags -i $(GTAGS_ARGS) "$$here"
664
+cscopelist: cscopelist-am
665
+
666
+cscopelist-am: $(am__tagged_files)
667
+	list='$(am__tagged_files)'; \
668
+	case "$(srcdir)" in \
669
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
670
+	  *) sdir=$(subdir)/$(srcdir) ;; \
671
+	esac; \
672
+	for i in $$list; do \
673
+	  if test -f "$$i"; then \
674
+	    echo "$(subdir)/$$i"; \
675
+	  else \
676
+	    echo "$$sdir/$$i"; \
677
+	  fi; \
678
+	done >> $(top_builddir)/cscope.files
664 679
 
665 680
 distclean-tags:
666 681
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
... ...
@@ -805,19 +888,20 @@ uninstall-am: uninstall-binPROGRAMS
805 805
 
806 806
 .MAKE: install-am install-strip
807 807
 
808
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
809
-	clean-generic clean-libtool ctags distclean distclean-compile \
810
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
811
-	dvi-am html html-am info info-am install install-am \
812
-	install-binPROGRAMS install-data install-data-am install-dvi \
813
-	install-dvi-am install-exec install-exec-am install-html \
814
-	install-html-am install-info install-info-am install-man \
815
-	install-pdf install-pdf-am install-ps install-ps-am \
816
-	install-strip installcheck installcheck-am \
817
-	installcheck-binPROGRAMS installdirs maintainer-clean \
818
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
819
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
820
-	tags uninstall uninstall-am uninstall-binPROGRAMS
808
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
809
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
810
+	ctags ctags-am distclean distclean-compile distclean-generic \
811
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
812
+	html-am info info-am install install-am install-binPROGRAMS \
813
+	install-data install-data-am install-dvi install-dvi-am \
814
+	install-exec install-exec-am install-html install-html-am \
815
+	install-info install-info-am install-man install-pdf \
816
+	install-pdf-am install-ps install-ps-am install-strip \
817
+	installcheck installcheck-am installcheck-binPROGRAMS \
818
+	installdirs maintainer-clean maintainer-clean-generic \
819
+	mostlyclean mostlyclean-compile mostlyclean-generic \
820
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
821
+	uninstall-am uninstall-binPROGRAMS
821 822
 
822 823
 
823 824
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
... ...
@@ -1125,6 +1125,11 @@ static int unpack(const struct optstruct *opts)
1125 1125
 	name[sizeof(name)-1]='\0';
1126 1126
     }
1127 1127
 
1128
+    if (cl_cvdverify(name) != CL_SUCCESS) {
1129
+        mprintf("!unpack: %s is not a valid CVD\n", name);
1130
+        return -1;
1131
+    }
1132
+
1128 1133
     if(cli_cvdunpack(name, ".") == -1) {
1129 1134
 	mprintf("!unpack: Can't unpack file %s\n", name);
1130 1135
 	return -1;
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -15,6 +14,51 @@
15 15
 
16 16
 @SET_MAKE@
17 17
 VPATH = @srcdir@
18
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19
+am__make_running_with_option = \
20
+  case $${target_option-} in \
21
+      ?) ;; \
22
+      *) echo "am__make_running_with_option: internal error: invalid" \
23
+              "target option '$${target_option-}' specified" >&2; \
24
+         exit 1;; \
25
+  esac; \
26
+  has_opt=no; \
27
+  sane_makeflags=$$MAKEFLAGS; \
28
+  if $(am__is_gnu_make); then \
29
+    sane_makeflags=$$MFLAGS; \
30
+  else \
31
+    case $$MAKEFLAGS in \
32
+      *\\[\ \	]*) \
33
+        bs=\\; \
34
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
36
+    esac; \
37
+  fi; \
38
+  skip_next=no; \
39
+  strip_trailopt () \
40
+  { \
41
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42
+  }; \
43
+  for flg in $$sane_makeflags; do \
44
+    test $$skip_next = yes && { skip_next=no; continue; }; \
45
+    case $$flg in \
46
+      *=*|--*) continue;; \
47
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
48
+      -*I?*) strip_trailopt 'I';; \
49
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
50
+      -*O?*) strip_trailopt 'O';; \
51
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
52
+      -*l?*) strip_trailopt 'l';; \
53
+      -[dEDm]) skip_next=yes;; \
54
+      -[JT]) skip_next=yes;; \
55
+    esac; \
56
+    case $$flg in \
57
+      *$$target_option*) has_opt=yes; break;; \
58
+    esac; \
59
+  done; \
60
+  test $$has_opt = yes
61
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
18 63
 pkgdatadir = $(datadir)/@PACKAGE@
19 64
 pkgincludedir = $(includedir)/@PACKAGE@
20 65
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -37,7 +81,7 @@ target_triplet = @target@
37 37
 @ENABLE_UNRAR_TRUE@am__append_1 = clam-v2.rar clam-v3.rar
38 38
 @HAVE_LIBBZ2_TRUE@am__append_2 = clam.exe.bz2 clam.bz2.zip
39 39
 subdir = test
40
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
41 41
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42 42
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
43 43
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -112,14 +156,26 @@ mkinstalldirs = $(install_sh) -d
112 112
 CONFIG_HEADER = $(top_builddir)/clamav-config.h
113 113
 CONFIG_CLEAN_FILES =
114 114
 CONFIG_CLEAN_VPATH_FILES =
115
+AM_V_P = $(am__v_P_@AM_V@)
116
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
117
+am__v_P_0 = false
118
+am__v_P_1 = :
115 119
 AM_V_GEN = $(am__v_GEN_@AM_V@)
116 120
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
117
-am__v_GEN_0 = @echo "  GEN   " $@;
121
+am__v_GEN_0 = @echo "  GEN     " $@;
122
+am__v_GEN_1 = 
118 123
 AM_V_at = $(am__v_at_@AM_V@)
119 124
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
120 125
 am__v_at_0 = @
126
+am__v_at_1 = 
121 127
 SOURCES =
122 128
 DIST_SOURCES =
129
+am__can_run_installinfo = \
130
+  case $$AM_UPDATE_INFO_DIR in \
131
+    n|no|NO) false;; \
132
+    *) (install-info --version) >/dev/null 2>&1;; \
133
+  esac
134
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
123 135
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
124 136
 ACLOCAL = @ACLOCAL@
125 137
 AMTAR = @AMTAR@
... ...
@@ -375,11 +431,11 @@ mostlyclean-libtool:
375 375
 
376 376
 clean-libtool:
377 377
 	-rm -rf .libs _libs
378
-tags: TAGS
379
-TAGS:
378
+tags TAGS:
379
+
380
+ctags CTAGS:
380 381
 
381
-ctags: CTAGS
382
-CTAGS:
382
+cscope cscopelist:
383 383
 
384 384
 
385 385
 distdir: $(DISTFILES)
... ...
@@ -515,16 +571,16 @@ uninstall-am:
515 515
 .MAKE: install-am install-strip
516 516
 
517 517
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
518
-	clean-local distclean distclean-generic distclean-libtool \
519
-	distdir dvi dvi-am html html-am info info-am install \
520
-	install-am install-data install-data-am install-dvi \
518
+	clean-local cscopelist-am ctags-am distclean distclean-generic \
519
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
520
+	install install-am install-data install-data-am install-dvi \
521 521
 	install-dvi-am install-exec install-exec-am install-html \
522 522
 	install-html-am install-info install-info-am install-man \
523 523
 	install-pdf install-pdf-am install-ps install-ps-am \
524 524
 	install-strip installcheck installcheck-am installdirs \
525 525
 	maintainer-clean maintainer-clean-generic mostlyclean \
526 526
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
527
-	uninstall uninstall-am
527
+	tags-am uninstall uninstall-am
528 528
 
529 529
 
530 530
 all: $(FILES)
... ...
@@ -1,9 +1,8 @@
1
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
1
+# Makefile.in generated by automake 1.14 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6
-# Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
7 6
 # This Makefile.in is free software; the Free Software Foundation
8 7
 # gives unlimited permission to copy and/or distribute it,
9 8
 # with or without modifications, as long as this notice is preserved.
... ...
@@ -15,6 +14,51 @@
15 15
 
16 16
 @SET_MAKE@
17 17
 VPATH = @srcdir@
18
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19
+am__make_running_with_option = \
20
+  case $${target_option-} in \
21
+      ?) ;; \
22
+      *) echo "am__make_running_with_option: internal error: invalid" \
23
+              "target option '$${target_option-}' specified" >&2; \
24
+         exit 1;; \
25
+  esac; \
26
+  has_opt=no; \
27
+  sane_makeflags=$$MAKEFLAGS; \
28
+  if $(am__is_gnu_make); then \
29
+    sane_makeflags=$$MFLAGS; \
30
+  else \
31
+    case $$MAKEFLAGS in \
32
+      *\\[\ \	]*) \
33
+        bs=\\; \
34
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
36
+    esac; \
37
+  fi; \
38
+  skip_next=no; \
39
+  strip_trailopt () \
40
+  { \
41
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42
+  }; \
43
+  for flg in $$sane_makeflags; do \
44
+    test $$skip_next = yes && { skip_next=no; continue; }; \
45
+    case $$flg in \
46
+      *=*|--*) continue;; \
47
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
48
+      -*I?*) strip_trailopt 'I';; \
49
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
50
+      -*O?*) strip_trailopt 'O';; \
51
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
52
+      -*l?*) strip_trailopt 'l';; \
53
+      -[dEDm]) skip_next=yes;; \
54
+      -[JT]) skip_next=yes;; \
55
+    esac; \
56
+    case $$flg in \
57
+      *$$target_option*) has_opt=yes; break;; \
58
+    esac; \
59
+  done; \
60
+  test $$has_opt = yes
61
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
18 63
 pkgdatadir = $(datadir)/@PACKAGE@
19 64
 pkgincludedir = $(includedir)/@PACKAGE@
20 65
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -38,7 +82,8 @@ target_triplet = @target@
38 38
 TESTS = $(am__EXEEXT_1) $(scripts)
39 39
 check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT) $(am__EXEEXT_2)
40 40
 subdir = unit_tests
41
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
41
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
42
+	$(top_srcdir)/config/depcomp $(top_srcdir)/config/test-driver
42 43
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43 44
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
44 45
 	$(top_srcdir)/m4/argz.m4 \
... ...
@@ -138,6 +183,7 @@ check_clamav_OBJECTS = $(am_check_clamav_OBJECTS)
138 138
 AM_V_lt = $(am__v_lt_@AM_V@)
139 139
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
140 140
 am__v_lt_0 = --silent
141
+am__v_lt_1 = 
141 142
 check_clamav_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
142 143
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(check_clamav_CFLAGS) \
143 144
 	$(CFLAGS) $(check_clamav_LDFLAGS) $(LDFLAGS) -o $@
... ...
@@ -154,6 +200,18 @@ am_check_fpu_endian_OBJECTS =  \
154 154
 check_fpu_endian_OBJECTS = $(am_check_fpu_endian_OBJECTS)
155 155
 check_fpu_endian_DEPENDENCIES =  \
156 156
 	$(top_builddir)/libclamav/libclamav.la
157
+AM_V_P = $(am__v_P_@AM_V@)
158
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
159
+am__v_P_0 = false
160
+am__v_P_1 = :
161
+AM_V_GEN = $(am__v_GEN_@AM_V@)
162
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
163
+am__v_GEN_0 = @echo "  GEN     " $@;
164
+am__v_GEN_1 = 
165
+AM_V_at = $(am__v_at_@AM_V@)
166
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
167
+am__v_at_0 = @
168
+am__v_at_1 = 
157 169
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
158 170
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
159 171
 am__depfiles_maybe = depfiles
... ...
@@ -166,40 +224,65 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
166 166
 	$(AM_CFLAGS) $(CFLAGS)
167 167
 AM_V_CC = $(am__v_CC_@AM_V@)
168 168
 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
169
-am__v_CC_0 = @echo "  CC    " $@;
170
-AM_V_at = $(am__v_at_@AM_V@)
171
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
172
-am__v_at_0 = @
169
+am__v_CC_0 = @echo "  CC      " $@;
170
+am__v_CC_1 = 
173 171
 CCLD = $(CC)
174 172
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
175 173
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
176 174
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
177 175
 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
178 176
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
179
-am__v_CCLD_0 = @echo "  CCLD  " $@;
180
-AM_V_GEN = $(am__v_GEN_@AM_V@)
181
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
182
-am__v_GEN_0 = @echo "  GEN   " $@;
177
+am__v_CCLD_0 = @echo "  CCLD    " $@;
178
+am__v_CCLD_1 = 
183 179
 SOURCES = $(check_clamav_SOURCES) $(check_clamd_SOURCES) \
184 180
 	$(check_fpu_endian_SOURCES)
185 181
 DIST_SOURCES = $(am__check_clamav_SOURCES_DIST) \
186 182
 	$(am__check_clamd_SOURCES_DIST) $(check_fpu_endian_SOURCES)
183
+am__can_run_installinfo = \
184
+  case $$AM_UPDATE_INFO_DIR in \
185
+    n|no|NO) false;; \
186
+    *) (install-info --version) >/dev/null 2>&1;; \
187
+  esac
188
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
189
+# Read a list of newline-separated strings from the standard input,
190
+# and print each of them once, without duplicates.  Input order is
191
+# *not* preserved.
192
+am__uniquify_input = $(AWK) '\
193
+  BEGIN { nonempty = 0; } \
194
+  { items[$$0] = 1; nonempty = 1; } \
195
+  END { if (nonempty) { for (i in items) print i; }; } \
196
+'
197
+# Make sure the list of sources is unique.  This is necessary because,
198
+# e.g., the same source file might be shared among _SOURCES variables
199
+# for different programs/libraries.
200
+am__define_uniq_tagged_files = \
201
+  list='$(am__tagged_files)'; \
202
+  unique=`for i in $$list; do \
203
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
204
+  done | $(am__uniquify_input)`
187 205
 ETAGS = etags
188 206
 CTAGS = ctags
189
-# If stdout is a non-dumb tty, use colors.  If test -t is not supported,
190
-# then this fails; a conservative approach.  Of course do not redirect
191
-# stdout here, just stderr.
192
-am__tty_colors = \
193
-red=; grn=; lgn=; blu=; std=; \
194
-test "X$(AM_COLOR_TESTS)" != Xno \
195
-&& test "X$$TERM" != Xdumb \
196
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
197
-&& { \
198
-  red=''; \
199
-  grn=''; \
200
-  lgn=''; \
201
-  blu=''; \
202
-  std=''; \
207
+am__tty_colors_dummy = \
208
+  mgn= red= grn= lgn= blu= brg= std=; \
209
+  am__color_tests=no
210
+am__tty_colors = { \
211
+  $(am__tty_colors_dummy); \
212
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
213
+    am__color_tests=no; \
214
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
215
+    am__color_tests=yes; \
216
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
217
+    am__color_tests=yes; \
218
+  fi; \
219
+  if test $$am__color_tests = yes; then \
220
+    red=''; \
221
+    grn=''; \
222
+    lgn=''; \
223
+    blu=''; \
224
+    mgn=''; \
225
+    brg=''; \
226
+    std=''; \
227
+  fi; \
203 228
 }
204 229
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
205 230
 am__vpath_adj = case $$p in \
... ...
@@ -228,91 +311,161 @@ am__uninstall_files_from_dir = { \
228 228
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
229 229
          $(am__cd) "$$dir" && rm -f $$files; }; \
230 230
   }
231
-# Restructured Text title and section.
232
-am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
233
-am__rst_section = sed 'p;s/./=/g;p;g'
234
-# Put stdin (possibly several lines separated by ".  ") in a box.
235
-# Prefix each line by 'col' and terminate each with 'std', for coloring.
236
-# Multi line coloring is problematic with "less -R", so we really need
237
-# to color each line individually.
238
-am__text_box = $(AWK) '{			\
239
-  n = split($$0, lines, "\\.  "); max = 0;	\
240
-  for (i = 1; i <= n; ++i)			\
241
-    if (max < length(lines[i]))			\
242
-      max = length(lines[i]);			\
243
-  for (i = 0; i < max; ++i)			\
244
-    line = line "=";				\
245
-  print col line std;				\
246
-  for (i = 1; i <= n; ++i)			\
247
-    if (lines[i])				\
248
-      print col lines[i] std;			\
249
-  print col line std;				\
231
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
232
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
233
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
234
+# A command that, given a newline-separated list of test names on the
235
+# standard input, print the name of the tests that are to be re-run
236
+# upon "make recheck".
237
+am__list_recheck_tests = $(AWK) '{ \
238
+  recheck = 1; \
239
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
240
+    { \
241
+      if (rc < 0) \
242
+        { \
243
+          if ((getline line2 < ($$0 ".log")) < 0) \
244
+	    recheck = 0; \
245
+          break; \
246
+        } \
247
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
248
+        { \
249
+          recheck = 0; \
250
+          break; \
251
+        } \
252
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
253
+        { \
254
+          break; \
255
+        } \
256
+    }; \
257
+  if (recheck) \
258
+    print $$0; \
259
+  close ($$0 ".trs"); \
260
+  close ($$0 ".log"); \
261
+}'
262
+# A command that, given a newline-separated list of test names on the
263
+# standard input, create the global log from their .trs and .log files.
264
+am__create_global_log = $(AWK) ' \
265
+function fatal(msg) \
266
+{ \
267
+  print "fatal: making $@: " msg | "cat >&2"; \
268
+  exit 1; \
269
+} \
270
+function rst_section(header) \
271
+{ \
272
+  print header; \
273
+  len = length(header); \
274
+  for (i = 1; i <= len; i = i + 1) \
275
+    printf "="; \
276
+  printf "\n\n"; \
277
+} \
278
+{ \
279
+  copy_in_global_log = 1; \
280
+  global_test_result = "RUN"; \
281
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
282
+    { \
283
+      if (rc < 0) \
284
+         fatal("failed to read from " $$0 ".trs"); \
285
+      if (line ~ /$(am__global_test_result_rx)/) \
286
+        { \
287
+          sub("$(am__global_test_result_rx)", "", line); \
288
+          sub("[ 	]*$$", "", line); \
289
+          global_test_result = line; \
290
+        } \
291
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
292
+        copy_in_global_log = 0; \
293
+    }; \
294
+  if (copy_in_global_log) \
295
+    { \
296
+      rst_section(global_test_result ": " $$0); \
297
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
298
+      { \
299
+        if (rc < 0) \
300
+          fatal("failed to read from " $$0 ".log"); \
301
+        print line; \
302
+      }; \
303
+      printf "\n"; \
304
+    }; \
305
+  close ($$0 ".trs"); \
306
+  close ($$0 ".log"); \
250 307
 }'
308
+# Restructured Text title.
309
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
251 310
 # Solaris 10 'make', and several other traditional 'make' implementations,
252 311
 # pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
253 312
 # by disabling -e (using the XSI extension "set +e") if it's set.
254 313
 am__sh_e_setup = case $$- in *e*) set +e;; esac
314
+# Default flags passed to test drivers.
315
+am__common_driver_flags = \
316
+  --color-tests "$$am__color_tests" \
317
+  --enable-hard-errors "$$am__enable_hard_errors" \
318
+  --expect-failure "$$am__expect_failure"
255 319
 # To be inserted before the command running the test.  Creates the
256 320
 # directory for the log if needed.  Stores in $dir the directory
257
-# containing $f, in $tst the test, in $log the log, and passes
258
-# TESTS_ENVIRONMENT.  Save and restore TERM around use of
259
-# TESTS_ENVIRONMENT, in case that unsets it.
321
+# containing $f, in $tst the test, in $log the log.  Executes the
322
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
323
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
324
+# will run the test scripts (or their associated LOG_COMPILER, if
325
+# thy have one).
260 326
 am__check_pre = \
261 327
 $(am__sh_e_setup);					\
262 328
 $(am__vpath_adj_setup) $(am__vpath_adj)			\
329
+$(am__tty_colors);					\
263 330
 srcdir=$(srcdir); export srcdir;			\
264
-rm -f $@-t;						\
265
-am__trap='rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st'; \
266
-trap "st=129; $$am__trap" 1; trap "st=130; $$am__trap" 2;	\
267
-trap "st=141; $$am__trap" 13; trap "st=143; $$am__trap" 15; \
268
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;		\
269
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;	\
331
+case "$@" in						\
332
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
333
+    *) am__odir=.;; 					\
334
+esac;							\
335
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
336
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
270 337
 if test -f "./$$f"; then dir=./;			\
271 338
 elif test -f "$$f"; then dir=;				\
272 339
 else dir="$(srcdir)/"; fi;				\
273
-tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;		\
274
-$(TESTS_ENVIRONMENT)
275
-# To be appended to the command running the test.  Handle the stdout
276
-# and stderr redirection, and catch the exit status.
277
-am__check_post = \
278
->$@-t 2>&1;						\
279
-estatus=$$?;						\
280
-if test -n '$(DISABLE_HARD_ERRORS)'			\
281
-   && test $$estatus -eq 99; then			\
282
-  estatus=1;						\
283
-fi;							\
284
-TERM=$$__SAVED_TERM; export TERM;			\
285
-$(am__tty_colors);					\
286
-xfailed=PASS;						\
340
+tst=$$dir$$f; log='$@'; 				\
341
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
342
+  am__enable_hard_errors=no; 				\
343
+else							\
344
+  am__enable_hard_errors=yes; 				\
345
+fi; 							\
287 346
 case " $(XFAIL_TESTS) " in				\
288 347
   *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
289
-    xfailed=XFAIL;;					\
290
-esac;							\
291
-case $$estatus.$$xfailed in				\
292
-    0.XFAIL) col=$$red; res=XPASS;;			\
293
-    0.*)     col=$$grn; res=PASS ;;			\
294
-    77.*)    col=$$blu; res=SKIP ;;			\
295
-    99.*)    col=$$red; res=FAIL ;;			\
296
-    *.XFAIL) col=$$lgn; res=XFAIL;;			\
297
-    *.*)     col=$$red; res=FAIL ;;			\
298
-esac;							\
299
-echo "$${col}$$res$${std}: $$f";			\
300
-echo "$$res: $$f (exit: $$estatus)" |			\
301
-  $(am__rst_section) >$@;				\
302
-cat $@-t >>$@;						\
303
-rm -f $@-t
348
+    am__expect_failure=yes;;				\
349
+  *)							\
350
+    am__expect_failure=no;;				\
351
+esac; 							\
352
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
353
+# A shell command to get the names of the tests scripts with any registered
354
+# extension removed (i.e., equivalently, the names of the test logs, with
355
+# the '.log' extension removed).  The result is saved in the shell variable
356
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
357
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
358
+# since that might cause problem with VPATH rewrites for suffix-less tests.
359
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
360
+am__set_TESTS_bases = \
361
+  bases='$(TEST_LOGS)'; \
362
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
363
+  bases=`echo $$bases`
304 364
 RECHECK_LOGS = $(TEST_LOGS)
305
-AM_RECURSIVE_TARGETS = check recheck check-html recheck-html
306
-TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
365
+AM_RECURSIVE_TARGETS = check recheck
307 366
 TEST_SUITE_LOG = test-suite.log
308 367
 TEST_EXTENSIONS = @EXEEXT@ .test
368
+LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
309 369
 LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
370
+am__set_b = \
371
+  case '$@' in \
372
+    */*) \
373
+      case '$*' in \
374
+        */*) b='$*';; \
375
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
376
+       esac;; \
377
+    *) \
378
+      b='$*';; \
379
+  esac
310 380
 am__test_logs1 = $(TESTS:=.log)
311 381
 am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
312 382
 TEST_LOGS = $(am__test_logs2:.test.log=.log)
383
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
313 384
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
314 385
 	$(TEST_LOG_FLAGS)
315
-TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
316 386
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
317 387
 ACLOCAL = @ACLOCAL@
318 388
 AMTAR = @AMTAR@
... ...
@@ -552,7 +705,7 @@ EXTRA_DIST = .split $(srcdir)/*.ref input test-freshclam.conf valgrind.supp viru
552 552
 all: all-am
553 553
 
554 554
 .SUFFIXES:
555
-.SUFFIXES: .c .html .lo .log .o .obj .test .test$(EXEEXT)
555
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
556 556
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
557 557
 	@for dep in $?; do \
558 558
 	  case '$(am__configure_deps)' in \
... ...
@@ -592,12 +745,15 @@ clean-checkPROGRAMS:
592 592
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
593 593
 	echo " rm -f" $$list; \
594 594
 	rm -f $$list
595
+
595 596
 check_clamav$(EXEEXT): $(check_clamav_OBJECTS) $(check_clamav_DEPENDENCIES) $(EXTRA_check_clamav_DEPENDENCIES) 
596 597
 	@rm -f check_clamav$(EXEEXT)
597 598
 	$(AM_V_CCLD)$(check_clamav_LINK) $(check_clamav_OBJECTS) $(check_clamav_LDADD) $(LIBS)
599
+
598 600
 check_clamd$(EXEEXT): $(check_clamd_OBJECTS) $(check_clamd_DEPENDENCIES) $(EXTRA_check_clamd_DEPENDENCIES) 
599 601
 	@rm -f check_clamd$(EXEEXT)
600 602
 	$(AM_V_CCLD)$(LINK) $(check_clamd_OBJECTS) $(check_clamd_LDADD) $(LIBS)
603
+
601 604
 check_fpu_endian$(EXEEXT): $(check_fpu_endian_OBJECTS) $(check_fpu_endian_DEPENDENCIES) $(EXTRA_check_fpu_endian_DEPENDENCIES) 
602 605
 	@rm -f check_fpu_endian$(EXEEXT)
603 606
 	$(AM_V_CCLD)$(LINK) $(check_fpu_endian_OBJECTS) $(check_fpu_endian_LDADD) $(LIBS)
... ...
@@ -627,14 +783,14 @@ distclean-compile:
627 627
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
628 628
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
629 629
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
630
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
630
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
631 631
 
632 632
 .c.obj:
633 633
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
634 634
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
635 635
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
636 636
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
637
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
637
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
638 638
 
639 639
 .c.lo:
640 640
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -831,26 +987,15 @@ mostlyclean-libtool:
831 831
 clean-libtool:
832 832
 	-rm -rf .libs _libs
833 833
 
834
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
835
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
836
-	unique=`for i in $$list; do \
837
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
838
-	  done | \
839
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
840
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
841
-	mkid -fID $$unique
842
-tags: TAGS
843
-
844
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
845
-		$(TAGS_FILES) $(LISP)
834
+ID: $(am__tagged_files)
835
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
836
+tags: tags-am
837
+TAGS: tags
838
+
839
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
846 840
 	set x; \
847 841
 	here=`pwd`; \
848
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
849
-	unique=`for i in $$list; do \
850
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
851
-	  done | \
852
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
853
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
842
+	$(am__define_uniq_tagged_files); \
854 843
 	shift; \
855 844
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
856 845
 	  test -n "$$unique" || unique=$$empty_fix; \
... ...
@@ -862,15 +1007,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
862 862
 	      $$unique; \
863 863
 	  fi; \
864 864
 	fi
865
-ctags: CTAGS
866
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
867
-		$(TAGS_FILES) $(LISP)
868
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
869
-	unique=`for i in $$list; do \
870
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
871
-	  done | \
872
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
873
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
865
+ctags: ctags-am
866
+
867
+CTAGS: ctags
868
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
869
+	$(am__define_uniq_tagged_files); \
874 870
 	test -z "$(CTAGS_ARGS)$$unique" \
875 871
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
876 872
 	     $$unique
... ...
@@ -879,167 +1020,271 @@ GTAGS:
879 879
 	here=`$(am__cd) $(top_builddir) && pwd` \
880 880
 	  && $(am__cd) $(top_srcdir) \
881 881
 	  && gtags -i $(GTAGS_ARGS) "$$here"
882
+cscopelist: cscopelist-am
883
+
884
+cscopelist-am: $(am__tagged_files)
885
+	list='$(am__tagged_files)'; \
886
+	case "$(srcdir)" in \
887
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
888
+	  *) sdir=$(subdir)/$(srcdir) ;; \
889
+	esac; \
890
+	for i in $$list; do \
891
+	  if test -f "$$i"; then \
892
+	    echo "$(subdir)/$$i"; \
893
+	  else \
894
+	    echo "$$sdir/$$i"; \
895
+	  fi; \
896
+	done >> $(top_builddir)/cscope.files
882 897
 
883 898
 distclean-tags:
884 899
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
885 900
 
901
+# Recover from deleted '.trs' file; this should ensure that
902
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
903
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
904
+# to avoid problems with "make -n".
905
+.log.trs:
906
+	rm -f $< $@
907
+	$(MAKE) $(AM_MAKEFLAGS) $<
908
+
909
+# Leading 'am--fnord' is there to ensure the list of targets does not
910
+# expand to empty, as could happen e.g. with make check TESTS=''.
911
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
912
+am--force-recheck:
913
+	@:
914
+
886 915
 $(TEST_SUITE_LOG): $(TEST_LOGS)
887
-	@$(am__sh_e_setup);						\
888
-	list='$(TEST_LOGS)';						\
889
-	results=`for f in $$list; do					\
890
-		   test -r $$f && read line < $$f && echo "$$line"	\
891
-		     || echo FAIL;					\
892
-		 done`;							\
893
-	all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[	 ]*//'`; \
894
-	fail=`echo "$$results" | grep -c '^FAIL'`;			\
895
-	pass=`echo "$$results" | grep -c '^PASS'`;			\
896
-	skip=`echo "$$results" | grep -c '^SKIP'`;			\
897
-	xfail=`echo "$$results" | grep -c '^XFAIL'`;			\
898
-	xpass=`echo "$$results" | grep -c '^XPASS'`;			\
899
-	failures=`expr $$fail + $$xpass`;				\
900
-	all=`expr $$all - $$skip`;					\
901
-	if test "$$all" -eq 1; then tests=test; All=;			\
902
-	else tests=tests; All="All "; fi;				\
903
-	case fail=$$fail:xpass=$$xpass:xfail=$$xfail in			\
904
-	  fail=0:xpass=0:xfail=0)					\
905
-	    msg="$$All$$all $$tests passed.  ";				\
906
-	    exit=true;;							\
907
-	  fail=0:xpass=0:xfail=*)					\
908
-	    msg="$$All$$all $$tests behaved as expected";		\
909
-	    if test "$$xfail" -eq 1; then xfailures=failure;		\
910
-	    else xfailures=failures; fi;				\
911
-	    msg="$$msg ($$xfail expected $$xfailures).  ";		\
912
-	    exit=true;;							\
913
-	  fail=*:xpass=0:xfail=*)					\
914
-	    msg="$$fail of $$all $$tests failed.  ";			\
915
-	    exit=false;;						\
916
-	  fail=*:xpass=*:xfail=*)					\
917
-	    msg="$$failures of $$all $$tests did not behave as expected"; \
918
-	    if test "$$xpass" -eq 1; then xpasses=pass;			\
919
-	    else xpasses=passes; fi;					\
920
-	    msg="$$msg ($$xpass unexpected $$xpasses).  ";		\
921
-	    exit=false;;						\
922
-	  *)								\
923
-	    echo >&2 "incorrect case"; exit 4;;				\
924
-	esac;								\
925
-	if test "$$skip" -ne 0; then					\
926
-	  if test "$$skip" -eq 1; then					\
927
-	    msg="$$msg($$skip test was not run).  ";			\
928
-	  else								\
929
-	    msg="$$msg($$skip tests were not run).  ";			\
930
-	  fi;								\
931
-	fi;								\
916
+	@$(am__set_TESTS_bases); \
917
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
918
+	redo_bases=`for i in $$bases; do \
919
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
920
+	            done`; \
921
+	if test -n "$$redo_bases"; then \
922
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
923
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
924
+	  if $(am__make_dryrun); then :; else \
925
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
926
+	  fi; \
927
+	fi; \
928
+	if test -n "$$am__remaking_logs"; then \
929
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
930
+	       "recursion detected" >&2; \
931
+	else \
932
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
933
+	fi; \
934
+	if $(am__make_dryrun); then :; else \
935
+	  st=0;  \
936
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
937
+	  for i in $$redo_bases; do \
938
+	    test -f $$i.trs && test -r $$i.trs \
939
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
940
+	    test -f $$i.log && test -r $$i.log \
941
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
942
+	  done; \
943
+	  test $$st -eq 0 || exit 1; \
944
+	fi
945
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
946
+	ws='[ 	]'; \
947
+	results=`for b in $$bases; do echo $$b.trs; done`; \
948
+	test -n "$$results" || results=/dev/null; \
949
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
950
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
951
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
952
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
953
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
954
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
955
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
956
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
957
+	  success=true; \
958
+	else \
959
+	  success=false; \
960
+	fi; \
961
+	br='==================='; br=$$br$$br$$br$$br; \
962
+	result_count () \
963
+	{ \
964
+	    if test x"$$1" = x"--maybe-color"; then \
965
+	      maybe_colorize=yes; \
966
+	    elif test x"$$1" = x"--no-color"; then \
967
+	      maybe_colorize=no; \
968
+	    else \
969
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
970
+	    fi; \
971
+	    shift; \
972
+	    desc=$$1 count=$$2; \
973
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
974
+	      color_start=$$3 color_end=$$std; \
975
+	    else \
976
+	      color_start= color_end=; \
977
+	    fi; \
978
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
979
+	}; \
980
+	create_testsuite_report () \
981
+	{ \
982
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
983
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
984
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
985
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
986
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
987
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
988
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
989
+	}; \
932 990
 	{								\
933 991
 	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
934 992
 	    $(am__rst_title);						\
935
-	  echo "$$msg";							\
993
+	  create_testsuite_report --no-color;				\
936 994
 	  echo;								\
937 995
 	  echo ".. contents:: :depth: 2";				\
938 996
 	  echo;								\
939
-	  for f in $$list; do						\
940
-	    test -r $$f && read line < $$f || line=;			\
941
-	    case $$line in						\
942
-	      PASS:*|XFAIL:*);;						\
943
-	      *) echo; cat $$f;;					\
944
-	    esac;							\
945
-	  done;								\
946
-	} >$(TEST_SUITE_LOG).tmp;					\
997
+	  for b in $$bases; do echo $$b; done				\
998
+	    | $(am__create_global_log);					\
999
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
947 1000
 	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
948
-	if test "$$failures" -ne 0; then				\
949
-	  msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG).  ";		\
950
-	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
951
-	    msg="$${msg}Please report to $(PACKAGE_BUGREPORT).  ";	\
952
-	  fi;								\
953
-	fi;								\
954
-	test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG);	\
955
-	$(am__tty_colors);						\
956
-	if $$exit; then							\
1001
+	if $$success; then						\
957 1002
 	  col="$$grn";							\
958 1003
 	 else								\
959 1004
 	  col="$$red";							\
1005
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
960 1006
 	fi;								\
961
-	echo "$$msg" | $(am__text_box) "col=$$col" "std=$$std";		\
962
-	$$exit || exit 1
963
-
964
-check-TESTS recheck:
965
-	@if test $@ != recheck; then \
966
-	   list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list; \
967
-	 fi
968
-	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
969
-	@list='' list2='$(TEST_LOGS)'; for f in $$list2; do \
970
-	  test .log = $$f && continue; \
971
-	  if test $@ = recheck; then \
972
-	    test -f $$f || continue; \
973
-	    if test -r $$f && read line < $$f; then \
974
-	      case $$line in FAIL*|XPASS*) : ;; *) continue;; esac; \
975
-	    fi; \
976
-	  fi; \
977
-	  if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \
978
-	done; \
979
-	if test $@ = recheck && test -n "$$list"; then \
980
-	  echo "am--clean: ; rm -f $$list" \
981
-	    | $(MAKE) $(AM_MAKEFLAGS) -f - am--clean || exit 1; \
982
-	fi; \
983
-	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
984
-recheck: $(check_PROGRAMS) $(check_SCRIPTS)
985
-
986
-am--mostlyclean-test-html:
987
-	list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list
988
-	rm -f $(TEST_SUITE_HTML)
989
-
990
-.log.html:
991
-	@list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';		\
992
-	for r2h in $$list; do						\
993
-	  if ($$r2h --version) >/dev/null 2>&1; then			\
994
-	    R2H=$$r2h;							\
1007
+	echo "$${col}$$br$${std}"; 					\
1008
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
1009
+	echo "$${col}$$br$${std}"; 					\
1010
+	create_testsuite_report --maybe-color;				\
1011
+	echo "$$col$$br$$std";						\
1012
+	if $$success; then :; else					\
1013
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
1014
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
1015
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
995 1016
 	  fi;								\
996
-	done;								\
997
-	if test -z "$$R2H"; then					\
998
-	  echo >&2 "cannot find rst2html, cannot create $@";		\
999
-	  exit 2;							\
1017
+	  echo "$$col$$br$$std";					\
1000 1018
 	fi;								\
1001
-	$$R2H $< >$@.tmp
1002
-	@mv $@.tmp $@
1003
-
1004
-# Be sure to run check first, and then to convert the result.
1005
-# Beware of concurrent executions.  Run "check" not "check-TESTS", as
1006
-# check-SCRIPTS and other dependencies are rebuilt by the former only.
1007
-# And expect check to fail.
1008
-check-html recheck-html:
1009
-	@target=`echo $@ | sed 's/-html$$//'`; \
1010
-	rv=0; $(MAKE) $(AM_MAKEFLAGS) $$target || rv=$$?; \
1011
-	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
1012
-	exit $$rv
1019
+	$$success || exit 1
1020
+
1021
+check-TESTS:
1022
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
1023
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
1024
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
1025
+	@set +e; $(am__set_TESTS_bases); \
1026
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
1027
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
1028
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
1029
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
1030
+	exit $$?;
1031
+recheck: all $(check_PROGRAMS) $(check_SCRIPTS)
1032
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
1033
+	@set +e; $(am__set_TESTS_bases); \
1034
+	bases=`for i in $$bases; do echo $$i; done \
1035
+	         | $(am__list_recheck_tests)` || exit 1; \
1036
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
1037
+	log_list=`echo $$log_list`; \
1038
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
1039
+	        am__force_recheck=am--force-recheck \
1040
+	        TEST_LOGS="$$log_list"; \
1041
+	exit $$?
1013 1042
 check_clamav.log: check_clamav$(EXEEXT)
1014
-	@p='check_clamav$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1043
+	@p='check_clamav$(EXEEXT)'; \
1044
+	b='check_clamav'; \
1045
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1046
+	--log-file $$b.log --trs-file $$b.trs \
1047
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1048
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1015 1049
 check_freshclam.sh.log: check_freshclam.sh
1016
-	@p='check_freshclam.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1050
+	@p='check_freshclam.sh'; \
1051
+	b='check_freshclam.sh'; \
1052
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1053
+	--log-file $$b.log --trs-file $$b.trs \
1054
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1055
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1017 1056
 check_sigtool.sh.log: check_sigtool.sh
1018
-	@p='check_sigtool.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1057
+	@p='check_sigtool.sh'; \
1058
+	b='check_sigtool.sh'; \
1059
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1060
+	--log-file $$b.log --trs-file $$b.trs \
1061
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1062
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1019 1063
 check_unit_vg.sh.log: check_unit_vg.sh
1020
-	@p='check_unit_vg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1064
+	@p='check_unit_vg.sh'; \
1065
+	b='check_unit_vg.sh'; \
1066
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1067
+	--log-file $$b.log --trs-file $$b.trs \
1068
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1069
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1021 1070
 check1_clamscan.sh.log: check1_clamscan.sh
1022
-	@p='check1_clamscan.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1071
+	@p='check1_clamscan.sh'; \
1072
+	b='check1_clamscan.sh'; \
1073
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1074
+	--log-file $$b.log --trs-file $$b.trs \
1075
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1076
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1023 1077
 check2_clamd.sh.log: check2_clamd.sh
1024
-	@p='check2_clamd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1078
+	@p='check2_clamd.sh'; \
1079
+	b='check2_clamd.sh'; \
1080
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1081
+	--log-file $$b.log --trs-file $$b.trs \
1082
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1083
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1025 1084
 check3_clamd.sh.log: check3_clamd.sh
1026
-	@p='check3_clamd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1085
+	@p='check3_clamd.sh'; \
1086
+	b='check3_clamd.sh'; \
1087
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1088
+	--log-file $$b.log --trs-file $$b.trs \
1089
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1090
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1027 1091
 check4_clamd.sh.log: check4_clamd.sh
1028
-	@p='check4_clamd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1092
+	@p='check4_clamd.sh'; \
1093
+	b='check4_clamd.sh'; \
1094
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1095
+	--log-file $$b.log --trs-file $$b.trs \
1096
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1097
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1029 1098
 check5_clamd_vg.sh.log: check5_clamd_vg.sh
1030
-	@p='check5_clamd_vg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1099
+	@p='check5_clamd_vg.sh'; \
1100
+	b='check5_clamd_vg.sh'; \
1101
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1102
+	--log-file $$b.log --trs-file $$b.trs \
1103
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1104
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1031 1105
 check6_clamd_vg.sh.log: check6_clamd_vg.sh
1032
-	@p='check6_clamd_vg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1106
+	@p='check6_clamd_vg.sh'; \
1107
+	b='check6_clamd_vg.sh'; \
1108
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1109
+	--log-file $$b.log --trs-file $$b.trs \
1110
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1111
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1033 1112
 check7_clamd_hg.sh.log: check7_clamd_hg.sh
1034
-	@p='check7_clamd_hg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1113
+	@p='check7_clamd_hg.sh'; \
1114
+	b='check7_clamd_hg.sh'; \
1115
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1116
+	--log-file $$b.log --trs-file $$b.trs \
1117
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1118
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1035 1119
 check8_clamd_hg.sh.log: check8_clamd_hg.sh
1036
-	@p='check8_clamd_hg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1120
+	@p='check8_clamd_hg.sh'; \
1121
+	b='check8_clamd_hg.sh'; \
1122
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1123
+	--log-file $$b.log --trs-file $$b.trs \
1124
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1125
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1037 1126
 check9_clamscan_vg.sh.log: check9_clamscan_vg.sh
1038
-	@p='check9_clamscan_vg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
1127
+	@p='check9_clamscan_vg.sh'; \
1128
+	b='check9_clamscan_vg.sh'; \
1129
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
1130
+	--log-file $$b.log --trs-file $$b.trs \
1131
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
1132
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1039 1133
 .test.log:
1040
-	@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
1134
+	@p='$<'; \
1135
+	$(am__set_b); \
1136
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
1137
+	--log-file $$b.log --trs-file $$b.trs \
1138
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
1139
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
1041 1140
 @am__EXEEXT_TRUE@.test$(EXEEXT).log:
1042
-@am__EXEEXT_TRUE@	@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
1141
+@am__EXEEXT_TRUE@	@p='$<'; \
1142
+@am__EXEEXT_TRUE@	$(am__set_b); \
1143
+@am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
1144
+@am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
1145
+@am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
1146
+@am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
1043 1147
 
1044 1148
 distdir: $(DISTFILES)
1045 1149
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
... ...
@@ -1098,7 +1343,7 @@ install-strip:
1098 1098
 	fi
1099 1099
 mostlyclean-generic:
1100 1100
 	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
1101
-	-test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
1101
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
1102 1102
 	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
1103 1103
 
1104 1104
 clean-generic:
... ...
@@ -1170,8 +1415,8 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
1170 1170
 
1171 1171
 mostlyclean: mostlyclean-am
1172 1172
 
1173
-mostlyclean-am: am--mostlyclean-test-html mostlyclean-compile \
1174
-	mostlyclean-generic mostlyclean-libtool
1173
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
1174
+	mostlyclean-libtool
1175 1175
 
1176 1176
 pdf: pdf-am
1177 1177
 
... ...
@@ -1183,22 +1428,21 @@ ps-am:
1183 1183
 
1184 1184
 uninstall-am:
1185 1185
 
1186
-.MAKE: check-am check-html install-am install-strip recheck-html
1187
-
1188
-.PHONY: CTAGS GTAGS all all-am am--mostlyclean-test-html check \
1189
-	check-TESTS check-am check-html clean clean-checkPROGRAMS \
1190
-	clean-generic clean-libtool clean-local ctags distclean \
1191
-	distclean-compile distclean-generic distclean-libtool \
1192
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
1193
-	install install-am install-data install-data-am install-dvi \
1194
-	install-dvi-am install-exec install-exec-am install-html \
1195
-	install-html-am install-info install-info-am install-man \
1196
-	install-pdf install-pdf-am install-ps install-ps-am \
1197
-	install-strip installcheck installcheck-am installdirs \
1198
-	maintainer-clean maintainer-clean-generic mostlyclean \
1199
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
1200
-	pdf pdf-am ps ps-am recheck recheck-html tags uninstall \
1201
-	uninstall-am
1186
+.MAKE: check-am install-am install-strip
1187
+
1188
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
1189
+	clean-checkPROGRAMS clean-generic clean-libtool clean-local \
1190
+	cscopelist-am ctags ctags-am distclean distclean-compile \
1191
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
1192
+	dvi-am html html-am info info-am install install-am \
1193
+	install-data install-data-am install-dvi install-dvi-am \
1194
+	install-exec install-exec-am install-html install-html-am \
1195
+	install-info install-info-am install-man install-pdf \
1196
+	install-pdf-am install-ps install-ps-am install-strip \
1197
+	installcheck installcheck-am installdirs maintainer-clean \
1198
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
1199
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1200
+	recheck tags tags-am uninstall uninstall-am
1202 1201
 
1203 1202
 
1204 1203
 check_unit_vg.sh: $(FILES)