Browse code

Dynamic fpu endian detection for remaining unit tests and removal of fpu_words_bigendian configuration option and artifacts.

Steven Morgan authored on 2013/11/12 08:00:58
Showing 14 changed files
... ...
@@ -99,9 +99,6 @@
99 99
 /* file i/o buffer size */
100 100
 #undef FILEBUFF
101 101
 
102
-/* FPU byte ordering matches CPU */
103
-#undef FPU_WORDS_BIGENDIAN
104
-
105 102
 /* enable workaround for broken DNS servers */
106 103
 #undef FRESHCLAM_DNS_FIX
107 104
 
... ...
@@ -138,9 +135,6 @@
138 138
 /* attrib packed */
139 139
 #undef HAVE_ATTRIB_PACKED
140 140
 
141
-/* autoitea06 enabled */
142
-#undef HAVE_AUTOITEA06
143
-
144 141
 /* have bzip2 */
145 142
 #undef HAVE_BZLIB_H
146 143
 
... ...
@@ -45,6 +45,7 @@
45 45
 #include "libclamav/bytecode.h"
46 46
 #include "libclamav/bytecode_detect.h"
47 47
 #include "target.h"
48
+#include "fpu.h"
48 49
 
49 50
 #ifndef _WIN32
50 51
 extern const struct clam_option *clam_options;
... ...
@@ -448,9 +449,8 @@ int main(int argc, char **argv)
448 448
 #ifdef FRESHCLAM_DNS_FIX
449 449
 	printf("FRESHCLAM_DNS_FIX ");
450 450
 #endif
451
-#ifdef FPU_WORDS_BIGENDIAN
452
-	printf("AUTOIT_EA06 ");
453
-#endif
451
+        if (get_fpu_endian() != FPU_ENDIAN_UNKNOWN)
452
+            printf("AUTOIT_EA06 ");
454 453
 #ifdef HAVE_BZLIB_H
455 454
 	printf("BZIP2 ");
456 455
 #endif
... ...
@@ -673,8 +673,6 @@ VERSIONSCRIPT_FALSE
673 673
 VERSIONSCRIPT_TRUE
674 674
 VERSIONSCRIPTFLAG
675 675
 LIBM
676
-HAVE_AUTOITEA06_FALSE
677
-HAVE_AUTOITEA06_TRUE
678 676
 LTDLOPEN
679 677
 LT_CONFIG_H
680 678
 CONVENIENCE_LTDL_FALSE
... ...
@@ -826,7 +824,6 @@ with_included_ltdl
826 826
 with_ltdl_include
827 827
 with_ltdl_lib
828 828
 enable_ltdl_install
829
-with_fpu_words_bigendian
830 829
 enable_gcc_vcheck
831 830
 enable_experimental
832 831
 enable_mempool
... ...
@@ -1557,7 +1554,6 @@ Optional Packages:
1557 1557
   --with-included-ltdl    use the GNU ltdl sources included here
1558 1558
   --with-ltdl-include=DIR use the ltdl headers installed in DIR
1559 1559
   --with-ltdl-lib=DIR     use the libltdl.la installed in DIR
1560
-  --with-fpu-words-bigendian=(yes/no/auto)    specify FPU endianess (default=auto)
1561 1560
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
1562 1561
   --with-libcheck-prefix[=DIR]  search for libcheck in DIR/include and DIR/lib
1563 1562
   --without-libcheck-prefix     don't search for libcheck in includedir and libdir
... ...
@@ -13403,71 +13399,6 @@ _ACEOF
13403 13403
     ;;
13404 13404
 esac
13405 13405
 
13406
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FPU byte ordering is bigendian" >&5
13407
-$as_echo_n "checking whether FPU byte ordering is bigendian... " >&6; }
13408
-if ${ac_cv_c_fpu_bigendian+:} false; then :
13409
-  $as_echo_n "(cached) " >&6
13410
-else
13411
-  ac_cv_c_fpu_bigendian=auto
13412
-
13413
-# Check whether --with-fpu-words-bigendian was given.
13414
-if test "${with_fpu_words_bigendian+set}" = set; then :
13415
-  withval=$with_fpu_words_bigendian; ac_cv_c_fpu_bigendian=$with_fpu_words_bigendian
13416
-else
13417
-  ac_cv_c_fpu_bigendian=auto
13418
-fi
13419
-
13420
-
13421
-if test $ac_cv_c_fpu_bigendian = auto; then
13422
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13423
-/* end confdefs.h.  */
13424
-double d = 3815911171354501045744583353695226502220105394563506259449467213186125718792664588210662403287568710818873279842508553551908601408568128557088985172985437412593385138085986771664896.0;
13425
-_ACEOF
13426
-if ac_fn_c_try_compile "$LINENO"; then :
13427
-
13428
-if ${GREP-grep} emmeelle conftest.$ac_objext >/dev/null 2>&1 ; then
13429
-	ac_cv_c_fpu_bigendian=yes
13430
-fi
13431
-if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then
13432
-	ac_cv_c_fpu_bigendian=no
13433
-fi
13434
-if test "$ac_cv_c_bigendian" = "universal"; then
13435
-        ac_cv_c_fpu_bigendian=universal
13436
-fi
13437
-
13438
-fi
13439
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13440
-fi
13441
-
13442
-
13443
-fi
13444
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fpu_bigendian" >&5
13445
-$as_echo "$ac_cv_c_fpu_bigendian" >&6; }
13446
-have_autoitea06="no"
13447
-case $ac_cv_c_fpu_bigendian in
13448
-	yes)
13449
-
13450
-$as_echo "#define FPU_WORDS_BIGENDIAN 1" >>confdefs.h
13451
-
13452
-                have_autoitea06="yes"
13453
-		;;
13454
-	no)
13455
-
13456
-$as_echo "#define FPU_WORDS_BIGENDIAN 0" >>confdefs.h
13457
-
13458
-                have_autoitea06="yes"
13459
-		;;
13460
-	universal)
13461
-
13462
-$as_echo "#define FPU_WORDS_BIGENDIAN WORDS_BIGENDIAN" >>confdefs.h
13463
-
13464
-                have_autoitea06="yes"
13465
-		;;
13466
-	*)
13467
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to determine FPU endianess, some features may not be available in this build" >&5
13468
-$as_echo "$as_me: WARNING: Unable to determine FPU endianess, some features may not be available in this build" >&2;}
13469
-esac
13470
-
13471 13406
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13472 13407
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
13473 13408
 if ${ac_cv_c_bigendian+:} false; then :
... ...
@@ -13693,20 +13624,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13693 13693
  esac
13694 13694
 
13695 13695
 
13696
- if test "x$have_autoitea06" == "xyes"; then
13697
-  HAVE_AUTOITEA06_TRUE=
13698
-  HAVE_AUTOITEA06_FALSE='#'
13699
-else
13700
-  HAVE_AUTOITEA06_TRUE='#'
13701
-  HAVE_AUTOITEA06_FALSE=
13702
-fi
13703
-
13704
-if test "x$have_autoitea06" == "xyes"; then
13705
-
13706
-$as_echo "#define HAVE_AUTOITEA06 1" >>confdefs.h
13707
-
13708
-fi
13709
-
13710 13696
 LIBM=
13711 13697
 case $host in
13712 13698
 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
... ...
@@ -21274,10 +21191,6 @@ LT_CONFIG_H=clamav-config.h
21274 21274
 
21275 21275
 
21276 21276
 
21277
-if test -z "${HAVE_AUTOITEA06_TRUE}" && test -z "${HAVE_AUTOITEA06_FALSE}"; then
21278
-  as_fn_error $? "conditional \"HAVE_AUTOITEA06\" was never defined.
21279
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
21280
-fi
21281 21277
 if test -z "${VERSIONSCRIPT_TRUE}" && test -z "${VERSIONSCRIPT_FALSE}"; then
21282 21278
   as_fn_error $? "conditional \"VERSIONSCRIPT\" was never defined.
21283 21279
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
... ...
@@ -23902,10 +23815,6 @@ LT_CONFIG_H=clamav-config.h
23902 23902
 
23903 23903
 
23904 23904
 
23905
-if test -z "${HAVE_AUTOITEA06_TRUE}" && test -z "${HAVE_AUTOITEA06_FALSE}"; then
23906
-  as_fn_error $? "conditional \"HAVE_AUTOITEA06\" was never defined.
23907
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
23908
-fi
23909 23905
 if test -z "${VERSIONSCRIPT_TRUE}" && test -z "${VERSIONSCRIPT_FALSE}"; then
23910 23906
   as_fn_error $? "conditional \"VERSIONSCRIPT\" was never defined.
23911 23907
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
... ...
@@ -26555,19 +26464,6 @@ fi
26555 26555
 $as_echo "$as_me: Summary of engine detection features" >&6;}
26556 26556
 
26557 26557
 
26558
-   $as_echo_n "              autoit_ea06 : "
26559
-   if test "x" = "xno"; then :
26560
-  $as_echo "$have_autoitea06 (disabled)"
26561
-elif test "x" = "xyes"; then :
26562
-  $as_echo "$have_autoitea06"
26563
-elif test "x" = "x"; then :
26564
-  $as_echo "$have_autoitea06"
26565
-else
26566
-  $as_echo "$have_autoitea06 ()"
26567
-fi
26568
-
26569
-
26570
-
26571 26558
    $as_echo_n "              bzip2       : "
26572 26559
    if test "x$want_bzip2" = "xno"; then :
26573 26560
   $as_echo "$bzip_check (disabled)"
... ...
@@ -75,14 +75,8 @@ AC_HEADER_STDC
75 75
 AC_C_RESTRICT
76 76
 AC_C_CONST
77 77
 AC_C_INLINE
78
-AC_C_FPU_BIGENDIAN
79 78
 AC_C_BIGENDIAN
80 79
 
81
-AM_CONDITIONAL([HAVE_AUTOITEA06], test "x$have_autoitea06" == "xyes")
82
-if test "x$have_autoitea06" == "xyes"; then
83
-   AC_DEFINE([HAVE_AUTOITEA06], 1, [autoitea06 enabled])
84
-fi
85
-
86 80
 LT_LIB_M
87 81
 
88 82
 AC_ARG_ENABLE([gcc-vcheck],
... ...
@@ -1811,7 +1805,6 @@ CL_MSG_STATUS([jit         ],[$have_jit],[$enable_llvm])
1811 1811
 CL_MSG_STATUS([mempool     ],[$have_mempool],[$enable_mempool])
1812 1812
 
1813 1813
 AC_MSG_NOTICE([Summary of engine detection features])
1814
-CL_MSG_STATUS([autoit_ea06 ],[$have_autoitea06],[])
1815 1814
 CL_MSG_STATUS([bzip2       ],[$bzip_check],[$want_bzip2])
1816 1815
 CL_MSG_STATUS([zlib        ],[$ZLIB_HOME],[yes])
1817 1816
 CL_MSG_STATUS([unrar       ],[$want_unrar],[$want_unrar])
... ...
@@ -584,53 +584,6 @@ AC_DEFUN([AM_MAINTAINER_MODE],
584 584
 ]
585 585
 )
586 586
 
587
-dnl AC_C_FPU_BIGENDIAN
588
-dnl Detects FPU endianess
589
-dnl FPU_WORDS_BIGENDIAN = 1 for big endian
590
-dnl FPU_WORDS_BIGENDIAN = 0 for little endian
591
-dnl FPU_WORDS_BIGENDIAN undefined when endianes cannot be determined
592
-
593
-AC_DEFUN([AC_C_FPU_BIGENDIAN],
594
-[AC_CACHE_CHECK([whether FPU byte ordering is bigendian], [ac_cv_c_fpu_bigendian],
595
-[ac_cv_c_fpu_bigendian=auto
596
-AC_ARG_WITH(fpu-words-bigendian,
597
-[  --with-fpu-words-bigendian=(yes/no/auto)    specify FPU endianess (default=auto)],
598
-ac_cv_c_fpu_bigendian=$with_fpu_words_bigendian, ac_cv_c_fpu_bigendian=auto)
599
-
600
-if test $ac_cv_c_fpu_bigendian = auto; then
601
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[double d = 3815911171354501045744583353695226502220105394563506259449467213186125718792664588210662403287568710818873279842508553551908601408568128557088985172985437412593385138085986771664896.0;]])],[
602
-if ${GREP-grep} emmeelle conftest.$ac_objext >/dev/null 2>&1 ; then
603
-	ac_cv_c_fpu_bigendian=yes
604
-fi
605
-if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then
606
-	ac_cv_c_fpu_bigendian=no
607
-fi
608
-if test "$ac_cv_c_bigendian" = "universal"; then
609
-        ac_cv_c_fpu_bigendian=universal
610
-fi
611
-])
612
-fi
613
-
614
-])
615
-have_autoitea06="no"
616
-case $ac_cv_c_fpu_bigendian in
617
-	yes)
618
-		AC_DEFINE([FPU_WORDS_BIGENDIAN], 1, [FPU byte ordering is big endian])
619
-                have_autoitea06="yes"
620
-		;;
621
-	no)
622
-		AC_DEFINE([FPU_WORDS_BIGENDIAN], 0, [FPU byte ordering is little endian])
623
-                have_autoitea06="yes"
624
-		;;
625
-	universal)
626
-	        AC_DEFINE([FPU_WORDS_BIGENDIAN], [WORDS_BIGENDIAN], [FPU byte ordering matches CPU])
627
-                have_autoitea06="yes"
628
-		;;
629
-	*)
630
-		AC_MSG_WARN([Unable to determine FPU endianess, some features may not be available in this build])
631
-esac
632
-])
633
-
634 587
 dnl AC_C_CVE_2008_1372
635 588
 dnl Checks DoS in bzlib 
636 589
 AC_DEFUN([AC_C_CVE_2008_1372],
... ...
@@ -2,7 +2,7 @@ FILES = clam-v2.rar clam-v3.rar clam.cab clam.exe clam.zip \
2 2
 	clam.arj clam.exe.rtf clam.exe.szdd clam.tar.gz clam.chm clam.sis \
3 3
 	clam-aspack.exe clam-pespin.exe clam-upx.exe clam-fsg.exe clam-mew.exe\
4 4
 	clam-nsis.exe clam-petite.exe clam-upack.exe clam-wwpack.exe clam.pdf\
5
-	clam.mail clam.ppt clam.tnef clam.ea05.exe clam.d64.zip\
5
+	clam.mail clam.ppt clam.tnef clam.ea05.exe clam.ea06.exe clam.d64.zip\
6 6
 	clam.exe.mbox.base64 clam.exe.mbox.uu clam.exe.binhex clam.ole.doc \
7 7
 	clam.impl.zip clam.exe.html clam.bin-be.cpio clam.bin-le.cpio \
8 8
 	clam.newc.cpio clam.odc.cpio clam-yc.exe clam_IScab_int.exe \
... ...
@@ -13,10 +13,6 @@ if HAVE_LIBBZ2
13 13
 FILES += clam.exe.bz2 clam.bz2.zip
14 14
 endif
15 15
 
16
-if HAVE_AUTOITEA06
17
-FILES += clam.ea06.exe
18
-endif
19
-
20 16
 SPLIT_DIR=$(top_srcdir)/test/.split
21 17
 
22 18
 all: $(FILES)
... ...
@@ -35,7 +35,6 @@ build_triplet = @build@
35 35
 host_triplet = @host@
36 36
 target_triplet = @target@
37 37
 @HAVE_LIBBZ2_TRUE@am__append_1 = clam.exe.bz2 clam.bz2.zip
38
-@HAVE_AUTOITEA06_TRUE@am__append_2 = clam.ea06.exe
39 38
 subdir = test
40 39
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
41 40
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
... ...
@@ -237,13 +236,13 @@ FILES = clam-v2.rar clam-v3.rar clam.cab clam.exe clam.zip clam.arj \
237 237
 	clam-aspack.exe clam-pespin.exe clam-upx.exe clam-fsg.exe \
238 238
 	clam-mew.exe clam-nsis.exe clam-petite.exe clam-upack.exe \
239 239
 	clam-wwpack.exe clam.pdf clam.mail clam.ppt clam.tnef \
240
-	clam.ea05.exe clam.d64.zip clam.exe.mbox.base64 \
240
+	clam.ea05.exe clam.ea06.exe clam.d64.zip clam.exe.mbox.base64 \
241 241
 	clam.exe.mbox.uu clam.exe.binhex clam.ole.doc clam.impl.zip \
242 242
 	clam.exe.html clam.bin-be.cpio clam.bin-le.cpio clam.newc.cpio \
243 243
 	clam.odc.cpio clam-yc.exe clam_IScab_int.exe \
244 244
 	clam_IScab_ext.exe clam_ISmsi_int.exe clam_ISmsi_ext.exe \
245 245
 	clam.7z clam_cache_emax.tgz clam.iso clamjol.iso \
246
-	$(am__append_1) $(am__append_2)
246
+	$(am__append_1)
247 247
 SPLIT_DIR = $(top_srcdir)/test/.split
248 248
 EXTRA_DIST = .split
249 249
 all: all-am
... ...
@@ -15,16 +15,18 @@ check10_clamd_hg.sh: $(FILES)
15 15
 $(FILES) :
16 16
 	cat $(SPLIT_DIR)/split.$@aa $(SPLIT_DIR)/split.$@ab > $@
17 17
 
18
+
18 19
 programs = check_clamav
19 20
 scripts = check_freshclam.sh check_sigtool.sh check_unit_vg.sh check1_clamscan.sh check2_clamd.sh check3_clamd.sh check4_clamd.sh\
20 21
 	  check5_clamd_vg.sh check6_clamd_vg.sh check7_clamd_hg.sh check8_clamd_hg.sh check9_clamscan_vg.sh
22
+utils = check_fpu_endian
21 23
 TESTS_ENVIRONMENT=export abs_srcdir=$(abs_srcdir) AWK=$(AWK);
22 24
 if ENABLE_UNRAR
23 25
 else
24 26
 TESTS_ENVIRONMENT += export unrar_disabled=1;
25 27
 endif
26 28
 TESTS = $(programs) $(scripts)
27
-check_PROGRAMS = $(programs) check_clamd
29
+check_PROGRAMS = $(programs) check_clamd $(utils)
28 30
 check_SCRIPTS = $(scripts)
29 31
 
30 32
 AM_CFLAGS=@WERR_CFLAGS@
... ...
@@ -43,6 +45,10 @@ check_clamd_SOURCES = check_clamav_skip.c
43 43
 check_clamav_SOURCES = check_clamav_skip.c
44 44
 endif
45 45
 
46
+check_fpu_endian_SOURCES = check_fpu_endian.c
47
+check_fpu_endian_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
48
+check_fpu_endian_LDADD = $(top_builddir)/libclamav/libclamav.la
49
+
46 50
 check_clamav.c: $(top_builddir)/test/clam.exe clamav.hdb
47 51
 check_clamd.sh: $(top_builddir)/test/clam.exe check_clamd
48 52
 check_clamscan.sh: $(top_builddir)/test/clam.exe
... ...
@@ -56,7 +62,7 @@ $(top_builddir)/test/clam.exe:
56 56
 quick-check:
57 57
 	VALGRIND=no LIBEFENCE=no LIBDUMA=no $(MAKE) check
58 58
 
59
-CLEANFILES=lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb
59
+CLEANFILES=lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb $(utils)
60 60
 EXTRA_DIST=.split $(srcdir)/*.ref input test-freshclam.conf valgrind.supp virusaction-test.sh $(scripts) preload_run.sh check_common.sh
61 61
 if ENABLE_COVERAGE
62 62
 LCOV_OUTPUT = lcov.out
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
1
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -15,23 +15,6 @@
15 15
 
16 16
 @SET_MAKE@
17 17
 VPATH = @srcdir@
18
-am__make_dryrun = \
19
-  { \
20
-    am__dry=no; \
21
-    case $$MAKEFLAGS in \
22
-      *\\[\ \	]*) \
23
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
24
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
25
-      *) \
26
-        for am__flg in $$MAKEFLAGS; do \
27
-          case $$am__flg in \
28
-            *=*|--*) ;; \
29
-            *n*) am__dry=yes; break;; \
30
-          esac; \
31
-        done;; \
32
-    esac; \
33
-    test $$am__dry = yes; \
34
-  }
35 18
 pkgdatadir = $(datadir)/@PACKAGE@
36 19
 pkgincludedir = $(includedir)/@PACKAGE@
37 20
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -53,7 +36,7 @@ host_triplet = @host@
53 53
 target_triplet = @target@
54 54
 @ENABLE_UNRAR_FALSE@am__append_1 = export unrar_disabled=1;
55 55
 TESTS = $(am__EXEEXT_1) $(scripts)
56
-check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT)
56
+check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT) $(am__EXEEXT_2)
57 57
 subdir = unit_tests
58 58
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
59 59
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
... ...
@@ -75,6 +58,7 @@ CONFIG_HEADER = $(top_builddir)/clamav-config.h
75 75
 CONFIG_CLEAN_FILES =
76 76
 CONFIG_CLEAN_VPATH_FILES =
77 77
 am__EXEEXT_1 = check_clamav$(EXEEXT)
78
+am__EXEEXT_2 = check_fpu_endian$(EXEEXT)
78 79
 am__check_clamav_SOURCES_DIST = check_clamav_skip.c check_clamav.c \
79 80
 	checks.h checks_common.h $(top_builddir)/libclamav/clamav.h \
80 81
 	check_jsnorm.c check_str.c check_regex.c check_disasm.c \
... ...
@@ -106,6 +90,11 @@ am__check_clamd_SOURCES_DIST = check_clamav_skip.c check_clamd.c \
106 106
 @HAVE_LIBCHECK_TRUE@	check_clamd-check_clamd.$(OBJEXT)
107 107
 check_clamd_OBJECTS = $(am_check_clamd_OBJECTS)
108 108
 check_clamd_DEPENDENCIES =
109
+am_check_fpu_endian_OBJECTS =  \
110
+	check_fpu_endian-check_fpu_endian.$(OBJEXT)
111
+check_fpu_endian_OBJECTS = $(am_check_fpu_endian_OBJECTS)
112
+check_fpu_endian_DEPENDENCIES =  \
113
+	$(top_builddir)/libclamav/libclamav.la
109 114
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
110 115
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
111 116
 am__depfiles_maybe = depfiles
... ...
@@ -132,14 +121,10 @@ am__v_CCLD_0 = @echo "  CCLD  " $@;
132 132
 AM_V_GEN = $(am__v_GEN_@AM_V@)
133 133
 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
134 134
 am__v_GEN_0 = @echo "  GEN   " $@;
135
-SOURCES = $(check_clamav_SOURCES) $(check_clamd_SOURCES)
135
+SOURCES = $(check_clamav_SOURCES) $(check_clamd_SOURCES) \
136
+	$(check_fpu_endian_SOURCES)
136 137
 DIST_SOURCES = $(am__check_clamav_SOURCES_DIST) \
137
-	$(am__check_clamd_SOURCES_DIST)
138
-am__can_run_installinfo = \
139
-  case $$AM_UPDATE_INFO_DIR in \
140
-    n|no|NO) false;; \
141
-    *) (install-info --version) >/dev/null 2>&1;; \
142
-  esac
138
+	$(am__check_clamd_SOURCES_DIST) $(check_fpu_endian_SOURCES)
143 139
 ETAGS = etags
144 140
 CTAGS = ctags
145 141
 # If stdout is a non-dumb tty, use colors.  If test -t is not supported,
... ...
@@ -443,6 +428,7 @@ programs = check_clamav
443 443
 scripts = check_freshclam.sh check_sigtool.sh check_unit_vg.sh check1_clamscan.sh check2_clamd.sh check3_clamd.sh check4_clamd.sh\
444 444
 	  check5_clamd_vg.sh check6_clamd_vg.sh check7_clamd_hg.sh check8_clamd_hg.sh check9_clamscan_vg.sh
445 445
 
446
+utils = check_fpu_endian
446 447
 TESTS_ENVIRONMENT = export abs_srcdir=$(abs_srcdir) AWK=$(AWK); \
447 448
 	$(am__append_1)
448 449
 check_SCRIPTS = $(scripts)
... ...
@@ -459,7 +445,10 @@ AM_CFLAGS = @WERR_CFLAGS@
459 459
 @HAVE_LIBCHECK_TRUE@check_clamd_SOURCES = check_clamd.c checks_common.h
460 460
 @HAVE_LIBCHECK_TRUE@check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
461 461
 @HAVE_LIBCHECK_TRUE@check_clamd_LDADD = @CHECK_LIBS@ @CLAMD_LIBS@
462
-CLEANFILES = lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb
462
+check_fpu_endian_SOURCES = check_fpu_endian.c
463
+check_fpu_endian_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
464
+check_fpu_endian_LDADD = $(top_builddir)/libclamav/libclamav.la
465
+CLEANFILES = lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb $(utils)
463 466
 EXTRA_DIST = .split $(srcdir)/*.ref input test-freshclam.conf valgrind.supp virusaction-test.sh $(scripts) preload_run.sh check_common.sh
464 467
 @ENABLE_COVERAGE_TRUE@LCOV_OUTPUT = lcov.out
465 468
 @ENABLE_COVERAGE_TRUE@LCOV_HTML = lcov_html
... ...
@@ -516,6 +505,9 @@ check_clamav$(EXEEXT): $(check_clamav_OBJECTS) $(check_clamav_DEPENDENCIES) $(EX
516 516
 check_clamd$(EXEEXT): $(check_clamd_OBJECTS) $(check_clamd_DEPENDENCIES) $(EXTRA_check_clamd_DEPENDENCIES) 
517 517
 	@rm -f check_clamd$(EXEEXT)
518 518
 	$(AM_V_CCLD)$(LINK) $(check_clamd_OBJECTS) $(check_clamd_LDADD) $(LIBS)
519
+check_fpu_endian$(EXEEXT): $(check_fpu_endian_OBJECTS) $(check_fpu_endian_DEPENDENCIES) $(EXTRA_check_fpu_endian_DEPENDENCIES) 
520
+	@rm -f check_fpu_endian$(EXEEXT)
521
+	$(AM_V_CCLD)$(LINK) $(check_fpu_endian_OBJECTS) $(check_fpu_endian_LDADD) $(LIBS)
519 522
 
520 523
 mostlyclean-compile:
521 524
 	-rm -f *.$(OBJEXT)
... ...
@@ -535,6 +527,7 @@ distclean-compile:
535 535
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamav-check_uniq.Po@am__quote@
536 536
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamd-check_clamav_skip.Po@am__quote@
537 537
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamd-check_clamd.Po@am__quote@
538
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_fpu_endian-check_fpu_endian.Po@am__quote@
538 539
 
539 540
 .c.o:
540 541
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
... ...
@@ -725,6 +718,20 @@ check_clamd-check_clamd.obj: check_clamd.c
725 725
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
726 726
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_clamd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o check_clamd-check_clamd.obj `if test -f 'check_clamd.c'; then $(CYGPATH_W) 'check_clamd.c'; else $(CYGPATH_W) '$(srcdir)/check_clamd.c'; fi`
727 727
 
728
+check_fpu_endian-check_fpu_endian.o: check_fpu_endian.c
729
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_fpu_endian_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT check_fpu_endian-check_fpu_endian.o -MD -MP -MF $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo -c -o check_fpu_endian-check_fpu_endian.o `test -f 'check_fpu_endian.c' || echo '$(srcdir)/'`check_fpu_endian.c
730
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo $(DEPDIR)/check_fpu_endian-check_fpu_endian.Po
731
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='check_fpu_endian.c' object='check_fpu_endian-check_fpu_endian.o' libtool=no @AMDEPBACKSLASH@
732
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
733
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_fpu_endian_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o check_fpu_endian-check_fpu_endian.o `test -f 'check_fpu_endian.c' || echo '$(srcdir)/'`check_fpu_endian.c
734
+
735
+check_fpu_endian-check_fpu_endian.obj: check_fpu_endian.c
736
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_fpu_endian_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT check_fpu_endian-check_fpu_endian.obj -MD -MP -MF $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo -c -o check_fpu_endian-check_fpu_endian.obj `if test -f 'check_fpu_endian.c'; then $(CYGPATH_W) 'check_fpu_endian.c'; else $(CYGPATH_W) '$(srcdir)/check_fpu_endian.c'; fi`
737
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo $(DEPDIR)/check_fpu_endian-check_fpu_endian.Po
738
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='check_fpu_endian.c' object='check_fpu_endian-check_fpu_endian.obj' libtool=no @AMDEPBACKSLASH@
739
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
740
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_fpu_endian_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o check_fpu_endian-check_fpu_endian.obj `if test -f 'check_fpu_endian.c'; then $(CYGPATH_W) 'check_fpu_endian.c'; else $(CYGPATH_W) '$(srcdir)/check_fpu_endian.c'; fi`
741
+
728 742
 mostlyclean-libtool:
729 743
 	-rm -f *.lo
730 744
 
... ...
@@ -877,7 +884,8 @@ check-TESTS recheck:
877 877
 	  if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \
878 878
 	done; \
879 879
 	if test $@ = recheck && test -n "$$list"; then \
880
-	  $(am__make_dryrun) || rm -f $$list || exit 1; \
880
+	  echo "am--clean: ; rm -f $$list" \
881
+	    | $(MAKE) $(AM_MAKEFLAGS) -f - am--clean || exit 1; \
881 882
 	fi; \
882 883
 	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
883 884
 recheck: $(check_PROGRAMS) $(check_SCRIPTS)
... ...
@@ -405,9 +405,8 @@ static void init_testfiles(void)
405 405
 	testfiles[i-1] = strdup(dirent->d_name);
406 406
     }
407 407
     testfiles_n = i;
408
-#ifndef HAVE_AUTOITEA06
409
-    expect--;
410
-#endif
408
+    if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
409
+        expect--;
411 410
     fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
412 411
 
413 412
     closedir(d);
... ...
@@ -621,9 +620,8 @@ static Suite *test_cl_suite(void)
621 621
     suite_add_tcase(s, tc_cl_scan);
622 622
     tcase_add_checked_fixture (tc_cl_scan, engine_setup, engine_teardown);
623 623
 #ifdef CHECK_HAVE_LOOPS
624
-#ifndef HAVE_AUTOITEA06    
625
-    expect--;
626
-#endif
624
+    if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
625
+        expect--;
627 626
     tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expect);
628 627
     tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expect);
629 628
     tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expect);
... ...
@@ -13,6 +13,8 @@ CHECK_CLAMD=$TOP/unit_tests/check_clamd
13 13
 CLAMDSCAN=$TOP/clamdscan/clamdscan
14 14
 TESTFILES=$TOP/test/clam*
15 15
 NFILES=`ls -1 $TESTFILES | wc -l`
16
+#CHECK_FPU_ENDIAN=$TOP/unit_tests/.libs/lt-check_fpu_endian
17
+CHECK_FPU_ENDIAN=$TOP/unit_tests/check_fpu_endian
16 18
 
17 19
 killclamd() {
18 20
     test -f clamd-test.pid &&
... ...
@@ -198,11 +200,13 @@ EOF
198 198
     fi
199 199
     NINFECTED=`grep "Infected files" clamscan4.log | cut -f2 -d: | sed -e 's/ //g'`
200 200
     grep "clam.ea05.exe: ClamAV-Test-Icon-EA0X.UNOFFICIAL FOUND" clamscan4.log || die "icon-test1 failed"
201
-    if test -e ../../test/clam.ea06.exe; then
201
+
202
+    test_run_check $CHECK_FPU_ENDIAN
203
+    if test $? -eq 3; then
204
+        NEXPECT=3
205
+    else
202 206
         grep "clam.ea06.exe: ClamAV-Test-Icon-EA0X.UNOFFICIAL FOUND" clamscan4.log || die "icon-test2 failed"
203 207
         NEXPECT=4
204
-    else
205
-        NEXPECT=3
206 208
     fi
207 209
     grep "clam_IScab_ext.exe: ClamAV-Test-Icon-IScab.UNOFFICIAL FOUND" clamscan4.log || die "icon-test3 failed"
208 210
     grep "clam_IScab_int.exe: ClamAV-Test-Icon-IScab.UNOFFICIAL FOUND" clamscan4.log || die "icon-test4 failed"
209 211
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+/*
1
+ *  Copyright (C) 2013 Sourcefire, Inc.
2
+ *
3
+ *  Authors: Steven Morgan <smorgan@sourcefire.com>
4
+ *
5
+ *  This program is free software; you can redistribute it and/or modify
6
+ *  it under the terms of the GNU General Public License version 2 as
7
+ *  published by the Free Software Foundation.
8
+ *
9
+ *  This program is distributed in the hope that it will be useful,
10
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+ *  GNU General Public License for more details.
13
+ *
14
+ *  You should have received a copy of the GNU General Public License
15
+ *  along with this program; if not, write to the Free Software
16
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
+ *  MA 02110-1301, USA.
18
+ */
19
+
20
+#include "../libclamav/fpu.h"
21
+
22
+/* Helper command line interface to determinine fpu endianess in unit test scripts.
23
+ *   parameters: none
24
+ *   returns:
25
+ *     1 - fpu big endian
26
+ *     2 - fpu little endian
27
+ *     3 - fpu endian unknown
28
+ */
29
+
30
+int main (int argc, char **argv)
31
+{
32
+    return  get_fpu_endian();
33
+}
... ...
@@ -95,9 +95,6 @@
95 95
 /* file i/o buffer size */
96 96
 #define FILEBUFF 8192
97 97
 
98
-/* FPU byte ordering matches CPU */
99
-#define FPU_WORDS_BIGENDIAN 0
100
-
101 98
 /* enable workaround for broken DNS servers */
102 99
 /* #undef FRESHCLAM_DNS_FIX */
103 100
 
... ...
@@ -48,7 +48,6 @@ my %CONF = (
48 48
     'DEFAULT_FD_SETSIZE' => '1024',
49 49
     'FDPASS_NEED_XOPEN' => -1,
50 50
     'FILEBUFF' => '8192',
51
-    'FPU_WORDS_BIGENDIAN' => '0',
52 51
     'FRESHCLAM_DNS_FIX' => -1,
53 52
     'FRESHCLAM_NO_CACHE' => -1,
54 53
     'HAVE_ARGZ_ADD' => -1,