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

0.98.2
Steven Morgan 12 years ago
parent 3cab931d78
commit b02190b40c
  1. 6
      clamav-config.h.in
  2. 6
      clamconf/clamconf.c
  3. 104
      configure
  4. 7
      configure.ac
  5. 47
      m4/acinclude.m4
  6. 6
      test/Makefile.am
  7. 5
      test/Makefile.in
  8. 10
      unit_tests/Makefile.am
  9. 64
      unit_tests/Makefile.in
  10. 10
      unit_tests/check_clamav.c
  11. 10
      unit_tests/check_common.sh
  12. 34
      unit_tests/check_fpu_endian.c
  13. 3
      win32/clamav-config.h
  14. 1
      win32/update-win32.pl

@ -99,9 +99,6 @@
/* file i/o buffer size */
#undef FILEBUFF
/* FPU byte ordering matches CPU */
#undef FPU_WORDS_BIGENDIAN
/* enable workaround for broken DNS servers */
#undef FRESHCLAM_DNS_FIX
@ -138,9 +135,6 @@
/* attrib packed */
#undef HAVE_ATTRIB_PACKED
/* autoitea06 enabled */
#undef HAVE_AUTOITEA06
/* have bzip2 */
#undef HAVE_BZLIB_H

@ -45,6 +45,7 @@
#include "libclamav/bytecode.h"
#include "libclamav/bytecode_detect.h"
#include "target.h"
#include "fpu.h"
#ifndef _WIN32
extern const struct clam_option *clam_options;
@ -448,9 +449,8 @@ int main(int argc, char **argv)
#ifdef FRESHCLAM_DNS_FIX
printf("FRESHCLAM_DNS_FIX ");
#endif
#ifdef FPU_WORDS_BIGENDIAN
printf("AUTOIT_EA06 ");
#endif
if (get_fpu_endian() != FPU_ENDIAN_UNKNOWN)
printf("AUTOIT_EA06 ");
#ifdef HAVE_BZLIB_H
printf("BZIP2 ");
#endif

104
configure vendored

@ -673,8 +673,6 @@ VERSIONSCRIPT_FALSE
VERSIONSCRIPT_TRUE
VERSIONSCRIPTFLAG
LIBM
HAVE_AUTOITEA06_FALSE
HAVE_AUTOITEA06_TRUE
LTDLOPEN
LT_CONFIG_H
CONVENIENCE_LTDL_FALSE
@ -826,7 +824,6 @@ with_included_ltdl
with_ltdl_include
with_ltdl_lib
enable_ltdl_install
with_fpu_words_bigendian
enable_gcc_vcheck
enable_experimental
enable_mempool
@ -1557,7 +1554,6 @@ Optional Packages:
--with-included-ltdl use the GNU ltdl sources included here
--with-ltdl-include=DIR use the ltdl headers installed in DIR
--with-ltdl-lib=DIR use the libltdl.la installed in DIR
--with-fpu-words-bigendian=(yes/no/auto) specify FPU endianess (default=auto)
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libcheck-prefix[=DIR] search for libcheck in DIR/include and DIR/lib
--without-libcheck-prefix don't search for libcheck in includedir and libdir
@ -13403,71 +13399,6 @@ _ACEOF
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FPU byte ordering is bigendian" >&5
$as_echo_n "checking whether FPU byte ordering is bigendian... " >&6; }
if ${ac_cv_c_fpu_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_fpu_bigendian=auto
# Check whether --with-fpu-words-bigendian was given.
if test "${with_fpu_words_bigendian+set}" = set; then :
withval=$with_fpu_words_bigendian; ac_cv_c_fpu_bigendian=$with_fpu_words_bigendian
else
ac_cv_c_fpu_bigendian=auto
fi
if test $ac_cv_c_fpu_bigendian = auto; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
double d = 3815911171354501045744583353695226502220105394563506259449467213186125718792664588210662403287568710818873279842508553551908601408568128557088985172985437412593385138085986771664896.0;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if ${GREP-grep} emmeelle conftest.$ac_objext >/dev/null 2>&1 ; then
ac_cv_c_fpu_bigendian=yes
fi
if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then
ac_cv_c_fpu_bigendian=no
fi
if test "$ac_cv_c_bigendian" = "universal"; then
ac_cv_c_fpu_bigendian=universal
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fpu_bigendian" >&5
$as_echo "$ac_cv_c_fpu_bigendian" >&6; }
have_autoitea06="no"
case $ac_cv_c_fpu_bigendian in
yes)
$as_echo "#define FPU_WORDS_BIGENDIAN 1" >>confdefs.h
have_autoitea06="yes"
;;
no)
$as_echo "#define FPU_WORDS_BIGENDIAN 0" >>confdefs.h
have_autoitea06="yes"
;;
universal)
$as_echo "#define FPU_WORDS_BIGENDIAN WORDS_BIGENDIAN" >>confdefs.h
have_autoitea06="yes"
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to determine FPU endianess, some features may not be available in this build" >&5
$as_echo "$as_me: WARNING: Unable to determine FPU endianess, some features may not be available in this build" >&2;}
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
@ -13693,20 +13624,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac
if test "x$have_autoitea06" == "xyes"; then
HAVE_AUTOITEA06_TRUE=
HAVE_AUTOITEA06_FALSE='#'
else
HAVE_AUTOITEA06_TRUE='#'
HAVE_AUTOITEA06_FALSE=
fi
if test "x$have_autoitea06" == "xyes"; then
$as_echo "#define HAVE_AUTOITEA06 1" >>confdefs.h
fi
LIBM=
case $host in
*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
@ -21274,10 +21191,6 @@ LT_CONFIG_H=clamav-config.h
if test -z "${HAVE_AUTOITEA06_TRUE}" && test -z "${HAVE_AUTOITEA06_FALSE}"; then
as_fn_error $? "conditional \"HAVE_AUTOITEA06\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${VERSIONSCRIPT_TRUE}" && test -z "${VERSIONSCRIPT_FALSE}"; then
as_fn_error $? "conditional \"VERSIONSCRIPT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -23902,10 +23815,6 @@ LT_CONFIG_H=clamav-config.h
if test -z "${HAVE_AUTOITEA06_TRUE}" && test -z "${HAVE_AUTOITEA06_FALSE}"; then
as_fn_error $? "conditional \"HAVE_AUTOITEA06\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${VERSIONSCRIPT_TRUE}" && test -z "${VERSIONSCRIPT_FALSE}"; then
as_fn_error $? "conditional \"VERSIONSCRIPT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -26555,19 +26464,6 @@ fi
$as_echo "$as_me: Summary of engine detection features" >&6;}
$as_echo_n " autoit_ea06 : "
if test "x" = "xno"; then :
$as_echo "$have_autoitea06 (disabled)"
elif test "x" = "xyes"; then :
$as_echo "$have_autoitea06"
elif test "x" = "x"; then :
$as_echo "$have_autoitea06"
else
$as_echo "$have_autoitea06 ()"
fi
$as_echo_n " bzip2 : "
if test "x$want_bzip2" = "xno"; then :
$as_echo "$bzip_check (disabled)"

@ -75,14 +75,8 @@ AC_HEADER_STDC
AC_C_RESTRICT
AC_C_CONST
AC_C_INLINE
AC_C_FPU_BIGENDIAN
AC_C_BIGENDIAN
AM_CONDITIONAL([HAVE_AUTOITEA06], test "x$have_autoitea06" == "xyes")
if test "x$have_autoitea06" == "xyes"; then
AC_DEFINE([HAVE_AUTOITEA06], 1, [autoitea06 enabled])
fi
LT_LIB_M
AC_ARG_ENABLE([gcc-vcheck],
@ -1811,7 +1805,6 @@ CL_MSG_STATUS([jit ],[$have_jit],[$enable_llvm])
CL_MSG_STATUS([mempool ],[$have_mempool],[$enable_mempool])
AC_MSG_NOTICE([Summary of engine detection features])
CL_MSG_STATUS([autoit_ea06 ],[$have_autoitea06],[])
CL_MSG_STATUS([bzip2 ],[$bzip_check],[$want_bzip2])
CL_MSG_STATUS([zlib ],[$ZLIB_HOME],[yes])
CL_MSG_STATUS([unrar ],[$want_unrar],[$want_unrar])

@ -584,53 +584,6 @@ AC_DEFUN([AM_MAINTAINER_MODE],
]
)
dnl AC_C_FPU_BIGENDIAN
dnl Detects FPU endianess
dnl FPU_WORDS_BIGENDIAN = 1 for big endian
dnl FPU_WORDS_BIGENDIAN = 0 for little endian
dnl FPU_WORDS_BIGENDIAN undefined when endianes cannot be determined
AC_DEFUN([AC_C_FPU_BIGENDIAN],
[AC_CACHE_CHECK([whether FPU byte ordering is bigendian], [ac_cv_c_fpu_bigendian],
[ac_cv_c_fpu_bigendian=auto
AC_ARG_WITH(fpu-words-bigendian,
[ --with-fpu-words-bigendian=(yes/no/auto) specify FPU endianess (default=auto)],
ac_cv_c_fpu_bigendian=$with_fpu_words_bigendian, ac_cv_c_fpu_bigendian=auto)
if test $ac_cv_c_fpu_bigendian = auto; then
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[double d = 3815911171354501045744583353695226502220105394563506259449467213186125718792664588210662403287568710818873279842508553551908601408568128557088985172985437412593385138085986771664896.0;]])],[
if ${GREP-grep} emmeelle conftest.$ac_objext >/dev/null 2>&1 ; then
ac_cv_c_fpu_bigendian=yes
fi
if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then
ac_cv_c_fpu_bigendian=no
fi
if test "$ac_cv_c_bigendian" = "universal"; then
ac_cv_c_fpu_bigendian=universal
fi
])
fi
])
have_autoitea06="no"
case $ac_cv_c_fpu_bigendian in
yes)
AC_DEFINE([FPU_WORDS_BIGENDIAN], 1, [FPU byte ordering is big endian])
have_autoitea06="yes"
;;
no)
AC_DEFINE([FPU_WORDS_BIGENDIAN], 0, [FPU byte ordering is little endian])
have_autoitea06="yes"
;;
universal)
AC_DEFINE([FPU_WORDS_BIGENDIAN], [WORDS_BIGENDIAN], [FPU byte ordering matches CPU])
have_autoitea06="yes"
;;
*)
AC_MSG_WARN([Unable to determine FPU endianess, some features may not be available in this build])
esac
])
dnl AC_C_CVE_2008_1372
dnl Checks DoS in bzlib
AC_DEFUN([AC_C_CVE_2008_1372],

@ -2,7 +2,7 @@ FILES = clam-v2.rar clam-v3.rar clam.cab clam.exe clam.zip \
clam.arj clam.exe.rtf clam.exe.szdd clam.tar.gz clam.chm clam.sis \
clam-aspack.exe clam-pespin.exe clam-upx.exe clam-fsg.exe clam-mew.exe\
clam-nsis.exe clam-petite.exe clam-upack.exe clam-wwpack.exe clam.pdf\
clam.mail clam.ppt clam.tnef clam.ea05.exe clam.d64.zip\
clam.mail clam.ppt clam.tnef clam.ea05.exe clam.ea06.exe clam.d64.zip\
clam.exe.mbox.base64 clam.exe.mbox.uu clam.exe.binhex clam.ole.doc \
clam.impl.zip clam.exe.html clam.bin-be.cpio clam.bin-le.cpio \
clam.newc.cpio clam.odc.cpio clam-yc.exe clam_IScab_int.exe \
@ -13,10 +13,6 @@ if HAVE_LIBBZ2
FILES += clam.exe.bz2 clam.bz2.zip
endif
if HAVE_AUTOITEA06
FILES += clam.ea06.exe
endif
SPLIT_DIR=$(top_srcdir)/test/.split
all: $(FILES)

@ -35,7 +35,6 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
@HAVE_LIBBZ2_TRUE@am__append_1 = clam.exe.bz2 clam.bz2.zip
@HAVE_AUTOITEA06_TRUE@am__append_2 = clam.ea06.exe
subdir = test
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
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 \
clam-aspack.exe clam-pespin.exe clam-upx.exe clam-fsg.exe \
clam-mew.exe clam-nsis.exe clam-petite.exe clam-upack.exe \
clam-wwpack.exe clam.pdf clam.mail clam.ppt clam.tnef \
clam.ea05.exe clam.d64.zip clam.exe.mbox.base64 \
clam.ea05.exe clam.ea06.exe clam.d64.zip clam.exe.mbox.base64 \
clam.exe.mbox.uu clam.exe.binhex clam.ole.doc clam.impl.zip \
clam.exe.html clam.bin-be.cpio clam.bin-le.cpio clam.newc.cpio \
clam.odc.cpio clam-yc.exe clam_IScab_int.exe \
clam_IScab_ext.exe clam_ISmsi_int.exe clam_ISmsi_ext.exe \
clam.7z clam_cache_emax.tgz clam.iso clamjol.iso \
$(am__append_1) $(am__append_2)
$(am__append_1)
SPLIT_DIR = $(top_srcdir)/test/.split
EXTRA_DIST = .split
all: all-am

@ -15,16 +15,18 @@ check10_clamd_hg.sh: $(FILES)
$(FILES) :
cat $(SPLIT_DIR)/split.$@aa $(SPLIT_DIR)/split.$@ab > $@
programs = check_clamav
scripts = check_freshclam.sh check_sigtool.sh check_unit_vg.sh check1_clamscan.sh check2_clamd.sh check3_clamd.sh check4_clamd.sh\
check5_clamd_vg.sh check6_clamd_vg.sh check7_clamd_hg.sh check8_clamd_hg.sh check9_clamscan_vg.sh
utils = check_fpu_endian
TESTS_ENVIRONMENT=export abs_srcdir=$(abs_srcdir) AWK=$(AWK);
if ENABLE_UNRAR
else
TESTS_ENVIRONMENT += export unrar_disabled=1;
endif
TESTS = $(programs) $(scripts)
check_PROGRAMS = $(programs) check_clamd
check_PROGRAMS = $(programs) check_clamd $(utils)
check_SCRIPTS = $(scripts)
AM_CFLAGS=@WERR_CFLAGS@
@ -43,6 +45,10 @@ check_clamd_SOURCES = check_clamav_skip.c
check_clamav_SOURCES = check_clamav_skip.c
endif
check_fpu_endian_SOURCES = check_fpu_endian.c
check_fpu_endian_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
check_fpu_endian_LDADD = $(top_builddir)/libclamav/libclamav.la
check_clamav.c: $(top_builddir)/test/clam.exe clamav.hdb
check_clamd.sh: $(top_builddir)/test/clam.exe check_clamd
check_clamscan.sh: $(top_builddir)/test/clam.exe
@ -56,7 +62,7 @@ $(top_builddir)/test/clam.exe:
quick-check:
VALGRIND=no LIBEFENCE=no LIBDUMA=no $(MAKE) check
CLEANFILES=lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb
CLEANFILES=lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb $(utils)
EXTRA_DIST=.split $(srcdir)/*.ref input test-freshclam.conf valgrind.supp virusaction-test.sh $(scripts) preload_run.sh check_common.sh
if ENABLE_COVERAGE
LCOV_OUTPUT = lcov.out

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -15,23 +15,6 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -53,7 +36,7 @@ host_triplet = @host@
target_triplet = @target@
@ENABLE_UNRAR_FALSE@am__append_1 = export unrar_disabled=1;
TESTS = $(am__EXEEXT_1) $(scripts)
check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT)
check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT) $(am__EXEEXT_2)
subdir = unit_tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -75,6 +58,7 @@ CONFIG_HEADER = $(top_builddir)/clamav-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = check_clamav$(EXEEXT)
am__EXEEXT_2 = check_fpu_endian$(EXEEXT)
am__check_clamav_SOURCES_DIST = check_clamav_skip.c check_clamav.c \
checks.h checks_common.h $(top_builddir)/libclamav/clamav.h \
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 \
@HAVE_LIBCHECK_TRUE@ check_clamd-check_clamd.$(OBJEXT)
check_clamd_OBJECTS = $(am_check_clamd_OBJECTS)
check_clamd_DEPENDENCIES =
am_check_fpu_endian_OBJECTS = \
check_fpu_endian-check_fpu_endian.$(OBJEXT)
check_fpu_endian_OBJECTS = $(am_check_fpu_endian_OBJECTS)
check_fpu_endian_DEPENDENCIES = \
$(top_builddir)/libclamav/libclamav.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
@ -132,14 +121,10 @@ am__v_CCLD_0 = @echo " CCLD " $@;
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(check_clamav_SOURCES) $(check_clamd_SOURCES)
SOURCES = $(check_clamav_SOURCES) $(check_clamd_SOURCES) \
$(check_fpu_endian_SOURCES)
DIST_SOURCES = $(am__check_clamav_SOURCES_DIST) \
$(am__check_clamd_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
$(am__check_clamd_SOURCES_DIST) $(check_fpu_endian_SOURCES)
ETAGS = etags
CTAGS = ctags
# If stdout is a non-dumb tty, use colors. If test -t is not supported,
@ -443,6 +428,7 @@ programs = check_clamav
scripts = check_freshclam.sh check_sigtool.sh check_unit_vg.sh check1_clamscan.sh check2_clamd.sh check3_clamd.sh check4_clamd.sh\
check5_clamd_vg.sh check6_clamd_vg.sh check7_clamd_hg.sh check8_clamd_hg.sh check9_clamscan_vg.sh
utils = check_fpu_endian
TESTS_ENVIRONMENT = export abs_srcdir=$(abs_srcdir) AWK=$(AWK); \
$(am__append_1)
check_SCRIPTS = $(scripts)
@ -459,7 +445,10 @@ AM_CFLAGS = @WERR_CFLAGS@
@HAVE_LIBCHECK_TRUE@check_clamd_SOURCES = check_clamd.c checks_common.h
@HAVE_LIBCHECK_TRUE@check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
@HAVE_LIBCHECK_TRUE@check_clamd_LDADD = @CHECK_LIBS@ @CLAMD_LIBS@
CLEANFILES = lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb
check_fpu_endian_SOURCES = check_fpu_endian.c
check_fpu_endian_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
check_fpu_endian_LDADD = $(top_builddir)/libclamav/libclamav.la
CLEANFILES = lcov.out *.gcno *.gcda *.log $(FILES) test-stderr.log clamscan.log accdenied clamav.hdb $(utils)
EXTRA_DIST = .split $(srcdir)/*.ref input test-freshclam.conf valgrind.supp virusaction-test.sh $(scripts) preload_run.sh check_common.sh
@ENABLE_COVERAGE_TRUE@LCOV_OUTPUT = lcov.out
@ENABLE_COVERAGE_TRUE@LCOV_HTML = lcov_html
@ -516,6 +505,9 @@ check_clamav$(EXEEXT): $(check_clamav_OBJECTS) $(check_clamav_DEPENDENCIES) $(EX
check_clamd$(EXEEXT): $(check_clamd_OBJECTS) $(check_clamd_DEPENDENCIES) $(EXTRA_check_clamd_DEPENDENCIES)
@rm -f check_clamd$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(check_clamd_OBJECTS) $(check_clamd_LDADD) $(LIBS)
check_fpu_endian$(EXEEXT): $(check_fpu_endian_OBJECTS) $(check_fpu_endian_DEPENDENCIES) $(EXTRA_check_fpu_endian_DEPENDENCIES)
@rm -f check_fpu_endian$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(check_fpu_endian_OBJECTS) $(check_fpu_endian_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@ -535,6 +527,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamav-check_uniq.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamd-check_clamav_skip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_clamd-check_clamd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_fpu_endian-check_fpu_endian.Po@am__quote@
.c.o:
@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
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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`
check_fpu_endian-check_fpu_endian.o: check_fpu_endian.c
@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
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo $(DEPDIR)/check_fpu_endian-check_fpu_endian.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_fpu_endian.c' object='check_fpu_endian-check_fpu_endian.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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
check_fpu_endian-check_fpu_endian.obj: check_fpu_endian.c
@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`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_fpu_endian-check_fpu_endian.Tpo $(DEPDIR)/check_fpu_endian-check_fpu_endian.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_fpu_endian.c' object='check_fpu_endian-check_fpu_endian.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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`
mostlyclean-libtool:
-rm -f *.lo
@ -877,7 +884,8 @@ check-TESTS recheck:
if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \
done; \
if test $@ = recheck && test -n "$$list"; then \
$(am__make_dryrun) || rm -f $$list || exit 1; \
echo "am--clean: ; rm -f $$list" \
| $(MAKE) $(AM_MAKEFLAGS) -f - am--clean || exit 1; \
fi; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
recheck: $(check_PROGRAMS) $(check_SCRIPTS)

@ -405,9 +405,8 @@ static void init_testfiles(void)
testfiles[i-1] = strdup(dirent->d_name);
}
testfiles_n = i;
#ifndef HAVE_AUTOITEA06
expect--;
#endif
if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
expect--;
fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
closedir(d);
@ -621,9 +620,8 @@ static Suite *test_cl_suite(void)
suite_add_tcase(s, tc_cl_scan);
tcase_add_checked_fixture (tc_cl_scan, engine_setup, engine_teardown);
#ifdef CHECK_HAVE_LOOPS
#ifndef HAVE_AUTOITEA06
expect--;
#endif
if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
expect--;
tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expect);
tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expect);
tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expect);

@ -13,6 +13,8 @@ CHECK_CLAMD=$TOP/unit_tests/check_clamd
CLAMDSCAN=$TOP/clamdscan/clamdscan
TESTFILES=$TOP/test/clam*
NFILES=`ls -1 $TESTFILES | wc -l`
#CHECK_FPU_ENDIAN=$TOP/unit_tests/.libs/lt-check_fpu_endian
CHECK_FPU_ENDIAN=$TOP/unit_tests/check_fpu_endian
killclamd() {
test -f clamd-test.pid &&
@ -198,11 +200,13 @@ EOF
fi
NINFECTED=`grep "Infected files" clamscan4.log | cut -f2 -d: | sed -e 's/ //g'`
grep "clam.ea05.exe: ClamAV-Test-Icon-EA0X.UNOFFICIAL FOUND" clamscan4.log || die "icon-test1 failed"
if test -e ../../test/clam.ea06.exe; then
test_run_check $CHECK_FPU_ENDIAN
if test $? -eq 3; then
NEXPECT=3
else
grep "clam.ea06.exe: ClamAV-Test-Icon-EA0X.UNOFFICIAL FOUND" clamscan4.log || die "icon-test2 failed"
NEXPECT=4
else
NEXPECT=3
fi
grep "clam_IScab_ext.exe: ClamAV-Test-Icon-IScab.UNOFFICIAL FOUND" clamscan4.log || die "icon-test3 failed"
grep "clam_IScab_int.exe: ClamAV-Test-Icon-IScab.UNOFFICIAL FOUND" clamscan4.log || die "icon-test4 failed"

@ -0,0 +1,34 @@
/*
* Copyright (C) 2013 Sourcefire, Inc.
*
* Authors: Steven Morgan <smorgan@sourcefire.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include "../libclamav/fpu.h"
/* Helper command line interface to determinine fpu endianess in unit test scripts.
* parameters: none
* returns:
* 1 - fpu big endian
* 2 - fpu little endian
* 3 - fpu endian unknown
*/
int main (int argc, char **argv)
{
return get_fpu_endian();
}

@ -95,9 +95,6 @@
/* file i/o buffer size */
#define FILEBUFF 8192
/* FPU byte ordering matches CPU */
#define FPU_WORDS_BIGENDIAN 0
/* enable workaround for broken DNS servers */
/* #undef FRESHCLAM_DNS_FIX */

@ -48,7 +48,6 @@ my %CONF = (
'DEFAULT_FD_SETSIZE' => '1024',
'FDPASS_NEED_XOPEN' => -1,
'FILEBUFF' => '8192',
'FPU_WORDS_BIGENDIAN' => '0',
'FRESHCLAM_DNS_FIX' => -1,
'FRESHCLAM_NO_CACHE' => -1,
'HAVE_ARGZ_ADD' => -1,

Loading…
Cancel
Save